import { describe, expect, it } from 'vitest';
import { applyLifecycleHookResults } from '../plugin-hooks.js';
describe('applyLifecycleHookResults', () => {
    it('returns silently when all results are continue', () => {
        const results = [{ action: 'continue' }, { action: 'continue' }];
        expect(() => applyLifecycleHookResults('run_start', results)).not.toThrow();
    });
    it('throws when a result is error', () => {
        const results = [{ action: 'error', message: 'kaboom' }];
        expect(() => applyLifecycleHookResults('pre_llm_call', results)).toThrow(/pre_llm_call reported error: kaboom/);
    });
    it.each([
        ['skip', { action: 'skip', reason: 'no' }],
        ['modify', { action: 'modify', input: {} }],
        ['retry', { action: 'retry' }],
        ['resume', { action: 'resume', input: 'x' }],
    ])('throws on unsupported %s action for lifecycle event', (_, result) => {
        expect(() => applyLifecycleHookResults('iteration_start', [result])).toThrow(/unsupported action/);
    });
});
//# sourceMappingURL=plugin-hooks.test.js.map