@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
25 lines • 1.66 kB
TypeScript
/** Resolves a model-given path against the working directory. */
export type ToolPathResolver = (path: string, cwd: string) => string;
/** Serializes the mutations of one file. */
export type FileMutationQueue = <T>(absolutePath: string, fn: () => Promise<T>) => Promise<T>;
/** The path an extension filesystem policy judges. */
export type ToolPathCanonicalizer = (absolutePath: string) => Promise<string>;
/**
* POSIX resolution as `path.posix.resolve` does it, after the same input clean-up the local resolver applies (Unicode
* spaces, a leading `@`, `file://` URLs). `~` is not expanded: the host's home directory is unknown here.
*/
export declare const resolvePosixToolPath: ToolPathResolver;
export declare function posixDirname(path: string): string;
/** Serializes mutations per resolved path string within this isolate. */
export declare const inProcessFileMutationQueue: FileMutationQueue;
export declare const lexicalCanonicalPath: ToolPathCanonicalizer;
export declare function tryMacOSScreenshotPath(filePath: string): string;
export declare function tryNFDVariant(filePath: string): string;
export declare function tryCurlyQuoteVariant(filePath: string): string;
export declare function unquotedPath(filePath: string): string | undefined;
/**
* The read tool's path: the resolved path when it exists, else the first existing spelling variant (quoted,
* macOS screenshot AM/PM, NFD, curly quote), else the resolved path.
*/
export declare function resolveReadPathVariants(filePath: string, cwd: string, resolve: ToolPathResolver, exists: (path: string) => Promise<boolean>): Promise<string>;
//# sourceMappingURL=file-tool-host.d.ts.map