/** * v2.15.0 follow-up — G9: role registry (lightweight RBAC). * * 12 Gaps memory: 团队多角色协同. This service manages a tiny * in-memory / JSON-backed role → permission map. The CLI surfaces * - `peaks role list` — list all roles * - `peaks role add ` — register a role * - `peaks role grant ` — grant a permission * - `peaks role check ` — check if role has permission * * Persistence: `.peaks/role-registry.json` in the project root. */ export interface Role { /** Unique role name (e.g. "senior-fe", "backend-lead", "admin"). */ readonly name: string; /** Description (human-readable). */ readonly description: string; /** Granted permissions (free-form strings, dot-separated convention). */ readonly permissions: readonly string[]; } export interface RoleRegistry { readonly version: 1; readonly roles: readonly Role[]; } export declare const EMPTY_ROLE_REGISTRY: RoleRegistry; export declare function getRoleRegistryPath(projectRoot: string): string; export declare function readRoleRegistry(projectRoot: string): RoleRegistry; export declare function writeRoleRegistry(projectRoot: string, registry: RoleRegistry): void; /** Add or update a role. Returns the new registry. */ export declare function upsertRole(registry: RoleRegistry, role: Role): RoleRegistry; /** Grant a permission to a role. Returns the new registry. */ export declare function grantPermission(registry: RoleRegistry, roleName: string, permission: string): RoleRegistry; /** Check if a role has a permission. */ export declare function roleHasPermission(registry: RoleRegistry, roleName: string, permission: string): boolean; /** Permission categories that align with the peaks-loop 12 Gaps memory. */ export declare const DEFAULT_PERMISSIONS: readonly string[]; /** Default role preset for a Senior FE on a 24h AI programmer team. */ export declare const DEFAULT_SENIOR_FE_ROLE: Role;