{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../src/paths.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,QAAQ;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;CACd;AAMD,wBAAgB,WAAW,CAAC,IAAI,GAAE,MAAyB,GAAG,QAAQ,CA4BrE;AAED,wBAAsB,eAAe,CAAC,KAAK,EAAE,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAC,CAyBpE","sourcesContent":["import { chmod, mkdir } from \"node:fs/promises\";\nimport { dirname, join, resolve } from \"node:path\";\nimport { getAgentDir } from \"@ch1nyzzz/pi-coding-agent\";\n\nexport interface EvoPaths {\n\troot: string;\n\tlog: string;\n\tdigests: string;\n\tartifacts: string;\n\tcomponents: string;\n\tinbox: string;\n\tbundles: string;\n\truns: string;\n\tworkflow: string;\n\tconfig: string;\n\tregistry: string;\n\tstable: string;\n\ttrial: string;\n\ttransition: string;\n\treceipts: string;\n\thistory: string;\n\tinboxHistory: string;\n\tpaused: string;\n\tintents: string;\n\tproposals: string;\n\treports: string;\n\tworktrees: string;\n\tlocks: string;\n}\n\nfunction resolveEvoRoot(agentDir: string = getAgentDir()): string {\n\treturn resolve(agentDir, \"evo\");\n}\n\nexport function getEvoPaths(root: string = resolveEvoRoot()): EvoPaths {\n\tconst resolvedRoot = resolve(root);\n\tconst registry = join(resolvedRoot, \"registry\");\n\treturn {\n\t\troot: resolvedRoot,\n\t\tlog: join(resolvedRoot, \"log\"),\n\t\tdigests: join(resolvedRoot, \"session-digests\"),\n\t\tartifacts: join(resolvedRoot, \"artifacts\", \"sha256\"),\n\t\tcomponents: join(resolvedRoot, \"components\", \"sha256\"),\n\t\tinbox: join(resolvedRoot, \"inbox\"),\n\t\tbundles: join(resolvedRoot, \"bundles\"),\n\t\truns: join(resolvedRoot, \"runs\"),\n\t\tworkflow: join(resolvedRoot, \"workflow.md\"),\n\t\tconfig: join(resolvedRoot, \"config.json\"),\n\t\tregistry,\n\t\tstable: join(registry, \"stable\"),\n\t\ttrial: join(registry, \"trial.json\"),\n\t\ttransition: join(registry, \"transition.json\"),\n\t\treceipts: join(registry, \"receipts.jsonl\"),\n\t\thistory: join(registry, \"history.jsonl\"),\n\t\tinboxHistory: join(registry, \"inbox-history.jsonl\"),\n\t\tpaused: join(registry, \"paused\"),\n\t\tintents: join(registry, \"intents\"),\n\t\tproposals: join(resolvedRoot, \"proposals\"),\n\t\treports: join(resolvedRoot, \"reports\"),\n\t\tworktrees: join(resolvedRoot, \"worktrees\"),\n\t\tlocks: join(resolvedRoot, \"locks\"),\n\t};\n}\n\nexport async function ensureEvoLayout(paths: EvoPaths): Promise<void> {\n\tconst directories = [\n\t\tpaths.root,\n\t\tdirname(paths.artifacts),\n\t\tpaths.artifacts,\n\t\tdirname(paths.components),\n\t\tpaths.components,\n\t\tpaths.log,\n\t\tpaths.digests,\n\t\tpaths.inbox,\n\t\tpaths.bundles,\n\t\tpaths.runs,\n\t\tpaths.registry,\n\t\tpaths.intents,\n\t\tpaths.proposals,\n\t\tpaths.reports,\n\t\tpaths.worktrees,\n\t\tpaths.locks,\n\t];\n\tawait Promise.all(\n\t\t[...new Set(directories)].map(async (directory) => {\n\t\t\tawait mkdir(directory, { recursive: true, mode: 0o700 });\n\t\t\tawait chmod(directory, 0o700);\n\t\t}),\n\t);\n}\n"]}