import { describe, expect, it } from "vitest"; import { normalizeDeclaredNodeCommands } from "./node-command-policy.js"; describe("gateway/node-command-policy", () => { it("normalizes declared node commands against the allowlist", () => { const allowlist = new Set(["canvas.snapshot", "system.run"]); expect( normalizeDeclaredNodeCommands({ declaredCommands: [" canvas.snapshot ", "", "system.run", "system.run", "screen.record"], allowlist, }), ).toEqual(["canvas.snapshot", "system.run"]); }); });