import { prompts } from './prompts.js';
import { ReadFileFunction } from '../../functions/ReadFile.js';
import { PlanWebResearchFunction, ReadDirectoryFunction, ScrapeTextFunction, WebSearchFunction, WriteFileFunction, } from '../../functions/index.js';
import { Agent, AgentConfig } from '../utils/index.js';
export class ResearcherAgent extends Agent {
    plan;
    constructor(context) {
        super(new AgentConfig(() => prompts, [
            new WebSearchFunction(context.llm, context.chat.tokenizer),
            new ScrapeTextFunction(),
            new ReadFileFunction(),
            new WriteFileFunction(),
            new ReadDirectoryFunction(),
        ]), context);
        this.plan = new PlanWebResearchFunction(context.llm, context.chat.tokenizer);
    }
    async onFirstRun(args, chat) {
        await this.executeFunction(this.plan, args, chat);
    }
}
