@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
16 lines • 1.17 kB
TypeScript
export declare function realSessionPath(path: string): Promise<string>;
export declare function orderedRealPath(path: string): Promise<string>;
export declare const moveLockKey: (sessionFile: string) => Promise<string>;
/**
* Runs the sender's steps of a move (export, finish) one at a time per session file, across processes too.
*
* - In this process, steps queue per file, so a second `finish` for the same move starts after the first has settled
* and finds the move already closed: the queued input it hands back is re-queued once, never twice.
* - Across processes (two host generations on one agent directory), the step holds the session's move lock, which
* proves no live process holds the session (`SessionHeldError`, code `ESESSIONHELD`) and makes every later
* `holdSessionFile` wait or refuse while the step runs.
* - `guard` runs first inside the queue, so a caller's own check (for example "not open on this host") sees the
* state the step will act on.
*/
export declare function withSessionMoveLock<T>(sessionFile: string, step: () => Promise<T>, guard?: () => void | Promise<void>): Promise<T>;
//# sourceMappingURL=session-lock.d.ts.map