UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

32 lines • 1.57 kB
import type { HookTrustStorageScope } from "./trust.ts"; import type { HookTrustState } from "./types.ts"; export interface HookStateStorage { read(scope: HookTrustStorageScope): HookTrustState; update(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState; } export type FileHookStateStorageOptions = { readonly agentDir?: string; readonly cwd: string; }; /** * Internal same-account application state at `<agentDir>/hooks-state.json` and * `<cwd>/.senpi/hooks-state.json`. POSIX files retain their numeric mode and new * files use 0600; reassigned ownership, named ACLs, and custom DACLs are outside * this storage contract. */ export declare class FileHookStateStorage implements HookStateStorage { private readonly globalStatePath; private readonly projectStatePath; constructor(options: FileHookStateStorageOptions); /** Writers publish atomic snapshots. Missing or invalid snapshots authorize nothing. */ readAsync(scope: HookTrustStorageScope): Promise<HookTrustState>; read(scope: HookTrustStorageScope): HookTrustState; update(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState; } export declare class InMemoryHookStateStorage implements HookStateStorage { private globalState; private projectState; read(scope: HookTrustStorageScope): HookTrustState; update(scope: HookTrustStorageScope, updater: (current: HookTrustState) => HookTrustState): HookTrustState; } //# sourceMappingURL=trust-storage.d.ts.map