UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

36 lines (35 loc) • 2.41 kB
export declare const ACCOUNT_ROLES: readonly ["helpers", "last-resort", "off"]; export type AccountRole = typeof ACCOUNT_ROLES[number]; export interface AccountSettings { pool?: string; role?: AccountRole; } export declare const isPoolTag: (value: unknown) => value is string; export declare const isAccountRole: (value: unknown) => value is AccountRole; /** Every slot's pool and role that is set, by slug. For listings: an unreadable file reads as none set. */ export declare function accountSettings(): Record<string, AccountSettings>; /** * The slots' pools and roles and this computer's allowed pools, for a caller that enforces them: an * `accounts.yaml` that is there but can't be read throws rather than reading as "nothing restricted". */ export declare function accountPolicy(): { settings: Record<string, AccountSettings>; allowedPools?: string[]; }; /** Sets or clears (`null`) a slot's pool and role; a field left out stays as it is. */ export declare function setAccountSettings(slug: string, change: { pool?: string | null; role?: AccountRole | null; }): Promise<AccountSettings>; /** The pools this computer's accounts may do work for, or undefined: any. */ export declare function computerAllowedPools(): string[] | undefined; export declare function setComputerAllowedPools(pools: readonly string[] | null): Promise<string[] | undefined>; /** The pools whose accounts may do a project's work, from its `phren.project.yaml`, or undefined: any. */ export declare function projectAllowedPools(phrenPath: string, project: string): string[] | undefined; export declare function setProjectAllowedPools(phrenPath: string, project: string, pools: readonly string[] | null): string[] | undefined; /** Whether an account in `pool` may work where `allowed` is the list: no list is any pool; a list leaves out an * account with no pool. */ export declare function poolAllowed(allowed: readonly string[] | undefined, pool: string | undefined): boolean; /** `phren bridge accounts pool|role|allowed-pools …`: the lines to print. */ export declare function accountPoolsCommand(args: readonly string[], projectStore: () => string, exists: (slug: string) => boolean): Promise<string[]>; export declare const POOLS_USAGE = "Usage: phren bridge accounts pool <id> <tag>|--clear | role <id> helpers|last-resort|off|--clear | allowed-pools [--project <name>] [<tag>\u2026 | --clear]";