@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
24 lines • 1.39 kB
TypeScript
/**
* The memory component's git-activity lock, held by a hand around a `run` (S40 PR 2, design v2.4). Every memory git
* run holds a SHARED flock on its identity's lock file and hands the descriptor to git as fd 3, so git and everything it
* starts keep it; the stranded-lock sweep's EXCLUSIVE flock then fails while any of them lives.
*/
export declare const GIT_ACTIVITY_LOCK_NAME = "git-activity.flock";
/** `flock(2)` and the errno it left; `undefined` when this runtime cannot call it at all. */
export type Flock = (fd: number, operation: number) => {
readonly rc: number;
readonly errno: number;
};
export type FlockClass = "busy" | "no-lock" | "failed";
export interface ActivityHold {
/** The descriptor to pass to git as fd 3; `undefined` when no lock is held. */
readonly fd: number | undefined;
release(): Promise<void>;
}
/**
* Takes the shared activity lock for a `run` in `cwd`. The lock file is opened only when its directory already exists
* (a late git operation must never recreate a removed identity tree, so a missing directory is `not_found`). No `flock`
* in this runtime (`flock` undefined) is the ENOSYS case: no hold, as the memory component does without one.
*/
export declare function holdActivityLock(cwd: string, flock: Flock | undefined, waitMs?: number): Promise<ActivityHold>;
//# sourceMappingURL=hand-activity-lock.d.ts.map