UNPKG

@phren/cli

Version:

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

18 lines (17 loc) • 1.27 kB
/** Writing "Allow everywhere" for an OpenCode permission ask: the permission * is answered with OpenCode's own `always` reply, which lasts only the running * session, so the tool is also added to the user's OpenCode config as an * allow rule. The config is read under a lock and rewritten through an atomic * rename, so a concurrent OpenCode write is never clobbered and every other * key is preserved. */ /** The OpenCode config `phren` edits: ~/.config/opencode/opencode.json. */ export declare function opencodeConfigPath(env?: NodeJS.ProcessEnv, home?: string): string; /** A tool name OpenCode's `permission` block keys by. */ export declare function opencodeToolName(value: unknown): string | undefined; /** The config with `permission[tool] = "allow"` added, every other key kept. * A granular rule for the tool keeps its patterns: the allow becomes the * catch-all `*` (specific rules after it still win, OpenCode's last-match rule). */ export declare function withAllowedTool(config: Record<string, unknown>, tool: string): Record<string, unknown>; /** Add an allow rule for `tool` to the user's OpenCode config, under a lock * with an atomic rename. */ export declare function allowOpencodeToolEverywhere(tool: unknown, file?: string): Promise<string>;