// SPDX-License-Identifier: MIT // SPDX-FileCopyrightText: 2026 avtc /** * featyard's data root: the folder that holds the external artifact store (`artifacts//`), * its archive and the kanban data (`kanban/`). * * Under pi it is `/.pi/featyard`. A host other than pi names its own root in * `PI_FY_DATA_DIR` (an absolute path). */ import path from "node:path"; /** The host-set data root, or null when the pi default applies. */ export function hostDataRoot(): string | null { const root = process.env.PI_FY_DATA_DIR; return root ? root : null; } /** The data root for the given home directory. */ export function featyardDataRoot(homeDir: string): string { return hostDataRoot() ?? path.join(homeDir, ".pi", "featyard"); }