UNPKG

@phren/cli

Version:

Knowledge layer for AI agents - CLI, MCP server, and data layer

38 lines (37 loc) • 1.94 kB
/** Chat links to a video, audio file or picture outside the pane's * repository (a render in `~/videos/out`, a pane whose folder is no * repository) open read-only from a media root: the Hook user's home folder, * on WSL the Windows drives (`/mnt/c`, `/mnt/d`), and the folders listed in * `<bridge>/media-roots`. The phone gets the file as `~/<path>` (home) or * `~root/<root>/<path>` (any other root, its absolute path without the * leading `/`, a Windows drive as `D/...`) and asks for its ranges by that * name. Only media, never a name part starting with '.' (`~/.ssh`, * `~/.config`), and the range reader's no-symlink walk. */ export declare const HOME_PREFIX = "~/"; export declare const ROOT_PREFIX = "~root/"; export declare function isMediaPath(requested: string): boolean; /** `c:/x` and `C:/x` are one file on Windows; roots are compared upper-case. */ export declare const upperDrive: (value: string) => string; /** A Windows drive link on a Hook running under WSL. Resolve only drives * the machine has mounted. The regular repository checks still apply. */ export declare function wslDriveReference(requested: string): Promise<string | undefined>; /** Metadata for a media file named by an absolute path, or by a relative one * read from `cwd` (which must itself be beneath a media root). Undefined when * the name is no media in a root, so the caller keeps its own answer. */ export declare function resolveMedia(requested: string, cwd: string | undefined): Promise<{ path: string; size: number; contentType: string; version: string; } | undefined>; /** A range of a media file as `resolveMedia` named it. */ export declare function readMedia(requested: string, offset: number, length: number, expectedVersion?: string): Promise<{ offset: number; length: number; total: number; contentType: string; version: string; eof: boolean; data: string; path: string; }>;