@phren/cli
Version:
Knowledge layer for AI agents - CLI, MCP server, and data layer
38 lines (37 loc) • 1.42 kB
TypeScript
import { resolveFilePath } from "./file-resolve.js";
import { type Target } from "./protocol.js";
type File = Awaited<ReturnType<typeof resolveFilePath>>;
type Match = File & {
checkout?: string;
fileToken?: string;
};
/** A terminal-observed directory may authorize its checkout only if every
* component is real. realpath comparison catches symlinked parents as well. */
export declare function observedChatDirectory(value: unknown): Promise<string | undefined>;
interface Checkout {
root: string;
folders: string[];
}
export declare function recentChatCheckouts(recent: string[], current?: Checkout): Promise<Checkout[]>;
/** Range access is scoped to a concrete result from this live session.
* The phone never supplies a filesystem root. */
export declare class ChatFiles {
private readonly secret;
private readonly selections;
private select;
read(target: Target, fileToken: string, requested: string, offset: number, length: number, version?: string): Promise<{
path: string;
offset: number;
length: number;
total: number;
contentType: string;
version: string;
eof: boolean;
data: string;
}>;
resolve(target: Target, root: string | undefined, cwd: string, input: string, search: boolean, recent: () => Promise<string[]>): Promise<{
files: Match[];
truncated: boolean;
}>;
}
export {};