/**
 * MetaLearner - 元学习器
 * 从经验中学习学习本身
 */

const { MetaLearning } = require('../core/self-evolution/meta-learning.js');

class MetaLearner {
    constructor(hf = {}) {
        this.hf = hf;
        this.projectRoot = hf.rootPath || hf.projectRoot || process.cwd();
        this.core = null;
    }

    boot() {
        this.core = new MetaLearning(this.projectRoot);
        return this;
    }

    learn(lesson) {
        if (this.core && typeof this.core.learn === 'function') {
            return this.core.learn(lesson);
        }
        return { learned: true, lesson };
    }

    getStats() {
        return {
            enabled: !!this.core,
            version: 'v1.0.0'
        };
    }

    shutdown() {}
}

module.exports = { MetaLearner };
