import { join } from "node:path"; import { describe, expect, it } from "vitest"; import { getGlobalConfigPath, getGlobalLogsDir, getLegacyGlobalPolicyPath, } from "#src/config-paths"; describe("config-paths", () => { const agentDir = "/home/user/.pi/agent"; it("places the global policy at extensions/pi-permission-system/policy.jsonc under the agent dir", () => { expect(getGlobalConfigPath(agentDir)).toBe( join(agentDir, "extensions", "pi-permission-system", "policy.jsonc"), ); }); it("places logs next to the global config dir", () => { expect(getGlobalLogsDir(agentDir)).toBe( join(agentDir, "extensions", "pi-permission-system", "logs"), ); }); it("keeps the legacy global policy path for migration detection", () => { expect(getLegacyGlobalPolicyPath(agentDir)).toBe( join(agentDir, "pi-permissions.jsonc"), ); }); });