@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
34 lines • 1.71 kB
TypeScript
/**
* The stored-bytes side of the project file verbs (`read_project_file`/`write_project_file`, the project MCP file and
* skill file verbs): reading a resolved file without following a link, its etag, the atomic replace, and one write at
* a time per file inside the engine.
*/
export type Stored = {
readonly kind: "missing";
} | {
readonly kind: "refused";
} | {
readonly kind: "too_large";
} | {
readonly kind: "file";
readonly bytes: Buffer;
readonly mode: number;
};
export declare function etagOf(bytes: Buffer): string;
/**
* Reads the stored bytes without following a link and without blocking on a FIFO swapped in after resolution; the
* size is checked on the open handle before anything is read.
*/
export declare function readStored(absolute: string): Promise<Stored>;
/** Thrown when the parent folder no longer resolves to itself, i.e. a folder on the way was swapped for a link. */
export declare class ParentMoved extends Error {
}
/**
* Temp file + rename in the resolved folder, keeping an existing file's permissions. The folder is re-resolved before
* the temp file is written and again before the rename, so a folder swapped for a link after resolution is refused
* instead of followed (the remaining window between that check and the syscall needs a local writer racing it).
*/
export declare function replaceAtomically(absolute: string, content: string, mode: number | undefined): Promise<void>;
/** Runs `write` after every earlier write queued for `key`; a write queued behind a failed one still runs. */
export declare function serializeWrite<T>(key: string, write: () => Promise<T>): Promise<T>;
//# sourceMappingURL=project-file-store.d.ts.map