/**
 * Scripted OptimizerIO for testing. Feeds pre-defined inputs, feedback,
 * and proposals instead of prompting the user or calling an LLM.
 */
export class TestOptimizerIO {
    inputs;
    feedbacks;
    proposals;
    acceptAll;
    inputIndex = 0;
    feedbackIndex = 0;
    proposalIndex = 0;
    constructor(inputs, feedbacks, proposals, acceptAll = true) {
        this.inputs = inputs;
        this.feedbacks = feedbacks;
        this.proposals = proposals;
        this.acceptAll = acceptAll;
    }
    async getUserInput(_nodeName, _parameters) {
        return this.inputs[this.inputIndex++] || {};
    }
    async collectFeedback() {
        return this.feedbacks[this.feedbackIndex++] || { score: null, feedback: "done" };
    }
    async proposeImprovement(_currentPrompt, _goal, _history) {
        return this.proposals[this.proposalIndex++] || "";
    }
    async confirmProposal(_proposed) {
        return this.acceptAll;
    }
}
