import { type SopScope } from './sop-paths.js'; import type { RegisteredSop, SopRegistry } from './sop-types.js'; /** * SOP gate registry — Feature A (Slice 2) + team layer (Slice 4b). * * `registerSop` validates a SOP (must lint clean) then upserts its gates into a * registry. SOPs live in two layers: GLOBAL (`~/.peaks/sops/registry.json`, your * personal SOPs) and PROJECT (`/.peaks/sops/registry.json`, committed * into the repo so teammates get them). `registerSop` writes to the layer the * caller targets (project when `projectRoot` is set, else global). `readRegistry` * returns the MERGED view (project entries win over global by id) so execution * and enumeration see every applicable SOP. The registry is the single * enumerable, countable source a future metering layer (Feature B) reads; this * slice only records and counts — NO limit, tier, or billing logic. Built-in * peaks-* gates are never recorded here. */ export type RegisterSopResult = { id: string; registered: RegisteredSop; /** Total gates across all registered SOPs after this upsert (the workspace pool count). */ gateCount: number; /** Which layer the SOP was registered into. */ scope: SopScope; /** false when --dry-run previewed the registration without writing registry.json. */ applied: boolean; }; export type RegisterSopOptions = { id: string; allowCommands?: boolean; /** Preview the registration without writing registry.json. */ dryRun?: boolean; /** When set, register into the project layer (`/.peaks/sops`) instead of global. */ projectRoot?: string; }; /** * Read the registry that execution/enumeration should see: the MERGED view of * the project layer (when projectRoot is given) over the global layer — a * project entry wins over a global one with the same id. Without projectRoot, * the global registry only. */ export declare function readRegistry(projectRoot?: string): Promise; export declare class SopRegisterError extends Error { readonly code: string; constructor(code: string, message: string); } export declare function registerSop(options: RegisterSopOptions): Promise;