import * as fs from 'node:fs';
/**
 * Remove a temporary directory with retry semantics for Windows ENOTEMPTY flakes.
 * Safe to call with falsy paths (no-op).
 */
export function cleanTmpDir(dir) {
    if (!dir)
        return;
    fs.rmSync(dir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
}
/**
 * Build a fresh `RuleEngineContext` for a CLI test. Warnings are captured on
 * the returned `warnings` array so tests can assert without setting up spies.
 */
export function makeRuleEngineCtx() {
    const warnings = [];
    return {
        logger: { warn: (msg) => warnings.push(msg) },
        state: { hasWarnedShieldContext: false },
        warnings,
    };
}
//# sourceMappingURL=test-utils.js.map