a416413c7d
---ci--- phase: 6 milestone: v0.7.0 plan: 06 task: P06-all status: execute ---/ci---
28 lines
926 B
TypeScript
28 lines
926 B
TypeScript
import { BaseAgent, AgentContext, AgentResult } from "./base.js";
|
|
|
|
export class DocWriterAgent extends BaseAgent {
|
|
readonly name = "doc-writer";
|
|
readonly description = "Autonomous documentation writer.";
|
|
readonly workflow = "execute";
|
|
|
|
async execute(context: AgentContext): Promise<AgentResult> {
|
|
const start = Date.now();
|
|
this.log("Writing documentation...");
|
|
if (context.backend) {
|
|
const result = await this.executeViaBackend(
|
|
context,
|
|
`Write documentation for phase ${context.phase}. Specification: ${context.specification}`
|
|
);
|
|
return { ...result, duration_ms: Date.now() - start };
|
|
}
|
|
return {
|
|
success: false,
|
|
output: "Documentation writing requires an intelligence backend.",
|
|
artifacts_created: [],
|
|
decisions: 0,
|
|
escalations: 0,
|
|
duration_ms: Date.now() - start,
|
|
error: "No intelligence backend available",
|
|
};
|
|
}
|
|
} |