@hasna/projects
Version:
High-level project management CLI, MCP server, SDK, and AI SDK agent loop for coding agents
38 lines • 2.12 kB
TypeScript
export type PathKind = "config" | "data" | "state" | "cache";
export interface PathsResolverOptions {
app: string;
internal?: boolean;
platform?: string;
home?: string;
env?: Record<string, string | undefined>;
}
export declare function dataDir(options: PathsResolverOptions): string;
export declare const PROJECTS_HOME_ENV = "HASNA_PROJECTS_HOME";
export declare const PROJECT_WORKSPACE_ID_PATTERN: RegExp;
export declare function assertProjectWorkspaceId(workspaceId: string): string;
/** The effective user home, mirroring the pre-existing projects resolution (`HOME` || `USERPROFILE` || `os.homedir()`). Read at call time so a $HOME switch mid-process keeps working. */
export declare function effectiveHome(): string;
/** Pre-XDG default home: ~/.hasna/projects. */
export declare function legacyHomeDir(): string;
/** The @hasna/paths-resolved data home for projects (XDG / macOS home layout). */
export declare function resolverHome(): string;
/**
* Whether the resolver (XDG) home should be adopted as the store home. The
* resolver home is adopted only when the operator has set `HASNA_DATA_HOME`
* (the data-kind override — a deliberate opt-in to the XDG layout) or the
* store has already been physically migrated there (`projects.db` exists).
* A machine that only redirects another kind must NOT have its data home
* moved, and a live store at the legacy home must never become invisible on
* upgrade.
*/
export declare function adoptResolverHome(resolved: string, env?: NodeJS.ProcessEnv): boolean;
/**
* The projects home: an exact-app override (`HASNA_PROJECTS_HOME`) wins
* unconditionally; otherwise the resolver (XDG) data home once adopted;
* otherwise the legacy `~/.hasna/projects` default.
*/
export declare function getProjectsHome(): string;
export declare function projectWorkspaceStorePath(workspaceId: string): string;
export declare function projectDataStorePath(workspaceId: string): string;
export declare function isProjectWorkspaceStorePath(workspaceId: string, path: string | null | undefined): boolean;
//# sourceMappingURL=project-store-paths.d.ts.map