@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
21 lines • 1.64 kB
TypeScript
import type { Rule, Ruleset } from "./types.ts";
/** The per-user store for one project: out of the workspace, keyed by the project's real path. */
export declare function approvedStorePath(agentDir: string, projectDir: string): string;
/** The store path the permission system must never let the agent write (defence in depth). */
export declare function approvedStoreRealPath(agentDir: string, projectDir: string): string;
/**
* Loads the project's approved rules from the agent-dir store. On first load for a project, a
* legacy `<cwd>/.senpi/permissions-approved.jsonl` is imported ONCE (allow-only, concrete
* permission, well-formed pattern; no source marker, which pre-store lines never had). The file is
* removed only when every line was imported; either way the marker means a line planted there later
* is never honored. A failed import removes any partial store
* and leaves the legacy file, so the next load retries. Later loads read only the store.
*/
export declare function loadApproved(agentDir: string, projectDir: string): Ruleset;
/** Cheap identity of the store: mtime + size, so a service re-reads only on change. */
export declare function approvedFileVersion(agentDir: string, projectDir: string): string | undefined;
/** Appends user-answer rules to the store, each stamped with the source marker. */
export declare function appendApproved(agentDir: string, projectDir: string, rules: Rule[]): void;
export declare function clearApproved(agentDir: string, projectDir: string): void;
export declare function compactApproved(agentDir: string, projectDir: string): void;
//# sourceMappingURL=storage.d.ts.map