@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
18 lines • 1.3 kB
TypeScript
import type { Socket } from "node:net";
export declare const SOCKET_SECRET_BYTES = 32;
export declare const SOCKET_SECRET_SUFFIX = ".secret";
export declare const SOCKET_SECRET_FILE_ENV = "SENPI_RPC_SOCKET_SECRET_FILE";
export declare const SOCKET_HANDSHAKE_TIMEOUT_MS = 2000;
export declare function socketSecretPath(logicalPath: string): string;
export declare function ensureSocketSecret(path: string): Promise<Buffer>;
/**
* Publishes a fresh secret at `path` unless one is already there (design 4.3). A valid regular file already at the
* path, or published by a concurrent creator, is returned unchanged; an invalid one is refused, never replaced.
* Windows keeps the in-place writer until the native no-replace bridge (senpi#4310, loaded by #4312) is wired.
*/
export declare function createSocketSecret(path: string): Promise<Buffer>;
export declare function readSocketSecret(path: string): Promise<Buffer>;
export declare function resolveSocketTransportAddress(socketPath: string, platform: NodeJS.Platform, secret?: Uint8Array): string;
export declare function authenticateSocket(socket: Socket, secret: Uint8Array, onAuthenticated: () => void): void;
export declare function sendSocketHandshake(socket: Socket, secret: Uint8Array): void;
//# sourceMappingURL=socket-transport.d.ts.map