Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.
TypeScript browser-shellcontrol-planefile-managerhomelabmobile-firstnextjsptyreactself-hostedserver-managementshadcn-uisysadmintailwindcssterminaltypescriptvpsweb-desktopweb-terminal
feat(host): add statReadableMeta for bounded path metadata
Abdurrahman Fakhrulc98e018a7285
diff --git a/lib/host/fs-api.ts b/lib/host/fs-api.tsindex 6b20282f..1fe867a5 100644--- a/lib/host/fs-api.ts+++ b/lib/host/fs-api.ts@@ -1,4 +1,5 @@-export { listDir, readFile, writeFile, makeDir, remove, move, copy, searchFs, usage, statReadable, mimeFor, fileStream } from "./fs";+export { listDir, readFile, writeFile, makeDir, remove, move, copy, searchFs, usage, statReadable, statReadableMeta, mimeFor, fileStream } from "./fs";+export type { FsReadableMeta } from "./fs";export { uploadInto, resolveUploadDest, streamFileInto } from "./fs-upload";export { uploadOneGuarded } from "./fs-upload-guarded";export type { UploadConflictPolicy, GuardedUploadResult } from "./fs-upload-guarded";diff --git a/lib/host/fs.ts b/lib/host/fs.tsindex d364a9bc..23dd6a1e 100644--- a/lib/host/fs.ts+++ b/lib/host/fs.ts@@ -153,6 +153,28 @@ export async function statReadable(} catch (error) { await handle.close(); throw error; }}+export type FsReadableMeta = {+ kind: "file" | "dir" | "symlink";+ sizeBytes: number;+ mtimeMs: number;+ ctimeMs: number;+ mode: number;+};++// Resolve + stat a readable path (within READ roots) for bounded metadata.+export async function statReadableMeta(requested: string): Promise<FsReadableMeta> {+ const p = await resolveReadable(requested);+ const st = await fs.stat(p);+ const kind: FsReadableMeta["kind"] = st.isDirectory() ? "dir" : st.isSymbolicLink() ? "symlink" : "file";+ return {+ kind,+ sizeBytes: st.size,+ mtimeMs: st.mtimeMs,+ ctimeMs: st.ctimeMs,+ mode: st.mode,+ };+}+// Transfer the verified handle to the stream, optionally for a byte range.export function fileStream(handle: FileHandle, start?: number, end?: number): ReadStream {return handle.createReadStream({ autoClose: true, ...(start !== undefined ? { start, end } : {}) });