import { loadDenylist, resolveConfigDir, saveDenylist } from "../lib/graph-prune.js";
import { withWriteEvent } from "../lib/log-ingest.js";
export async function graphPruneDenylistRemove(values) {
    return withWriteEvent({ tool: "graph-prune-denylist-remove" }, () => Promise.resolve(graphPruneDenylistRemoveImpl(values)));
}
function graphPruneDenylistRemoveImpl(values) {
    const configDir = resolveConfigDir();
    const list = loadDenylist(configDir);
    const remaining = new Set(list.values);
    const removed = [];
    const notFound = [];
    for (const raw of values) {
        const v = raw.trim();
        if (!v)
            continue;
        if (remaining.delete(v)) {
            removed.push(v);
        }
        else {
            notFound.push(v);
        }
    }
    if (removed.length > 0) {
        saveDenylist(configDir, {
            values: [...remaining].sort(),
            updatedAt: new Date().toISOString(),
        });
    }
    return { removed, notFound, totalAfter: remaining.size };
}
//# sourceMappingURL=graph-prune-denylist-remove.js.map