@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
14 lines • 902 B
TypeScript
/** The file a create made: a withdrawal removes only the entry that is still this file. */
export interface FileIdentity {
readonly dev: number;
readonly ino: number;
}
/**
* Writes a fresh 0600 secret as a NEW file at `path`. `O_EXCL` with `O_NOFOLLOW` means nothing that already sits at that
* name - a file, or a symlink to one - is ever followed, truncated or reused: the open fails with EEXIST (or ELOOP)
* instead. Nothing is removed here: `onCreated` names the created file as soon as it exists, so the caller can withdraw
* it (through a root it has proven again) whatever fails afterwards. The one gap is an `fstat` that fails right after the
* create: that file is still empty, and it is left where it is.
*/
export declare function writeExclusiveSecret(path: string, onCreated: (identity: FileIdentity) => void): Promise<Buffer>;
//# sourceMappingURL=exclusive-secret.d.ts.map