mirror of
https://bitbucket.org/siakitem/my-pi.git
synced 2026-10-26 18:55:22 +00:00
28 lines
948 B
TypeScript
28 lines
948 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { getGlobalLogsDir } from "#src/config-paths";
|
|
import { computeExtensionPaths } from "#src/extension-paths";
|
|
|
|
describe("computeExtensionPaths", () => {
|
|
it("derives only extension-owned runtime paths from agentDir", () => {
|
|
const paths = computeExtensionPaths("/agent");
|
|
|
|
expect(paths).toEqual({
|
|
agentDir: "/agent",
|
|
sessionsDir: "/agent/sessions",
|
|
subagentSessionsDir: "/agent/sessions/subagents",
|
|
forwardingDir: "/agent/sessions/permission-forwarding",
|
|
globalLogsDir: getGlobalLogsDir("/agent"),
|
|
});
|
|
expect(paths).not.toHaveProperty("piInfrastructureDirs");
|
|
});
|
|
|
|
it("does not retain values between agent directories", () => {
|
|
const a = computeExtensionPaths("/agent/a");
|
|
const b = computeExtensionPaths("/agent/b");
|
|
|
|
expect(a.sessionsDir).toBe("/agent/a/sessions");
|
|
expect(b.sessionsDir).toBe("/agent/b/sessions");
|
|
});
|
|
});
|