UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

22 lines • 1.51 kB
import { type FSWatcher, type WatchListener, type WatchOptions } from "node:fs"; export declare const FS_WATCH_RETRY_DELAY_MS = 5000; export declare function closeWatcher(watcher: FSWatcher | null | undefined): void; /** * The path to hand to `fs.watch`. On Windows libuv aborts the whole process when a directory * watch is created through a non-canonical (8.3 short-name) path (issue #1229), so the canonical * form is looked up there. Elsewhere the caller's path is used as-is: POSIX realpath opens every * directory it resolves, which blocks forever on a wedged autofs trigger, and fs.watch does not * need the canonical form on those platforms. */ export declare function canonicalWatchPath(path: string): string; /** * Prove that a directory can be opened before a synchronous `fs.watch` touches it. The watcher * opens the directory on the calling thread; on a wedged mount (a macOS autofs trigger whose * automounter never answers) that open never returns and would block the host main thread. This * probe performs the same open on the async pool, so a caller can bound it with a deadline. It * rejects with the open error (for example EACCES on an execute-only directory, which fs.watch * would refuse as well). */ export declare function probeDirectoryOpenable(directory: string): Promise<void>; export declare function watchWithErrorHandler(path: string, listener: WatchListener<string>, onError: () => void, options?: WatchOptions): FSWatcher | null; //# sourceMappingURL=fs-watch.d.ts.map