940b85bfae
Add IntelligenceBackend abstraction with two categories: - LLMBackend (OllamaLocal, OllamaCloud): CI runs tool loop, provides tools, constructs prompts - AgentBackend (Opencode): agent runs own tool loop, CI serializes request Refactor all 18 agents from hardcoded stubs to persona loaders that delegate to the active backend or fail honestly when no backend is available. Refactor OrchestratorAgent.executeStage() from monolithic switch to agent delegation via STAGE_AGENT_MAP for intelligent stages (research, plan, execute, verify), with mechanical stages (specify, clarify, complete) staying inline. Wire CLI commands with --backend flag and auto-detection (opencode → ollama-local → ollama-cloud). Harden rollback/ship with real git operations. No command returns fake success.
28 lines
968 B
TypeScript
28 lines
968 B
TypeScript
import { BaseAgent, AgentContext, AgentResult } from "./base.js";
|
|
|
|
export class PhaseResearcherAgent extends BaseAgent {
|
|
readonly name = "phase-researcher";
|
|
readonly description = "Researches how to implement a specific phase well.";
|
|
readonly workflow = "research";
|
|
|
|
async execute(context: AgentContext): Promise<AgentResult> {
|
|
const start = Date.now();
|
|
this.log("Researching phase implementation...");
|
|
if (context.backend) {
|
|
const result = await this.executeViaBackend(
|
|
context,
|
|
`Research how to implement phase ${context.phase} well. Specification: ${context.specification}`
|
|
);
|
|
return { ...result, duration_ms: Date.now() - start };
|
|
}
|
|
return {
|
|
success: false,
|
|
output: "Phase research requires an intelligence backend.",
|
|
artifacts_created: [],
|
|
decisions: 0,
|
|
escalations: 0,
|
|
duration_ms: Date.now() - start,
|
|
error: "No intelligence backend available",
|
|
};
|
|
}
|
|
} |