/** * SOP path model — two definition layers + per-project run-state. * * A SOP *definition* (manifest + SKILL.md) and its registry can live in two * layers: * - GLOBAL (`~/.peaks/sops/`): your personal SOPs, reusable across every * project on this machine. * - PROJECT (`/.peaks/sops/`): committed into the repo, so a teammate * who clones it gets the SOP — and, with the gate hook installed, is enforced * too. The project layer takes PRECEDENCE over global for the same id. * * A SOP's *run-state* (current phase, bypass history) always lives under the * project it runs in (`/.peaks/sop-state//`), so the same SOP tracks * independent progress per project. Gate checks resolve their target paths * against the caller's `--project`, which is what makes a relative gate path * (`posts/current.md`) reusable across projects. * * `PEAKS_HOME` overrides the global root; tests inject a temp dir through it so * a unit test never reads or writes the real `~/.peaks`. */ export type SopScope = 'project' | 'global'; /** Global Peaks home (`~/.peaks`), overridable via PEAKS_HOME for test isolation. */ export declare function peaksHome(): string; /** Global SOP definition directory: `~/.peaks/sops/`. */ export declare function sopDir(id: string): string; /** Global SOP manifest: `~/.peaks/sops//sop.json`. */ export declare function sopManifestPath(id: string): string; /** Global SOP skill: `~/.peaks/sops//SKILL.md`. */ export declare function sopSkillPath(id: string): string; /** Global registry of all registered SOPs: `~/.peaks/sops/registry.json`. */ export declare function registryPath(): string; /** Project SOP definition directory: `/.peaks/sops/` (committed, team-shared). */ export declare function projectSopDir(projectRoot: string, id: string): string; /** Project SOP manifest: `/.peaks/sops//sop.json`. */ export declare function projectSopManifestPath(projectRoot: string, id: string): string; /** Project SOP skill: `/.peaks/sops//SKILL.md`. */ export declare function projectSopSkillPath(projectRoot: string, id: string): string; /** Project registry: `/.peaks/sops/registry.json` (committed, team-shared). */ export declare function projectRegistryPath(projectRoot: string): string; /** Definition directory for a scope. */ export declare function scopedSopDir(scope: SopScope, projectRoot: string | undefined, id: string): string; /** Manifest path for a scope. */ export declare function scopedSopManifestPath(scope: SopScope, projectRoot: string | undefined, id: string): string; /** Registry path for a scope. */ export declare function scopedRegistryPath(scope: SopScope, projectRoot: string | undefined): string; /** * Resolve where a SOP's manifest lives, project-first: the project layer wins * when present, otherwise global. Returns null when neither layer has it. */ export declare function resolveSopManifestPath(id: string, projectRoot?: string): { path: string; scope: SopScope; } | null; /** * Per-project run-state directory for a SOP: `/.peaks/sop-state//`. * Holds `state.json` (current phase + history) and the bypass counter, so a * SOP's execution data stays isolated per project even though its definition is * global. */ export declare function sopStateDir(projectRoot: string, id: string): string; /** Per-project run-state file for a SOP: `/.peaks/sop-state//state.json`. */ export declare function sopStatePath(projectRoot: string, id: string): string;