MCPcopy Create free account
hub / github.com/MiniMax-AI/OpenRoom / listFiles

Function listFiles

apps/webuiapps/src/lib/diskStorage.ts:35–49  ·  view source on GitHub ↗
(dirPath: string)

Source from the content-addressed store, hash-verified

33 * Returns { files: [{ path, type, size }], not_exists: boolean }
34 */
35export async function listFiles(dirPath: string): Promise<{
36 files: Array<{ path: string; type: number; size?: number }>;
37 not_exists: boolean;
38}> {
39 try {
40 const res = await fetch(apiUrl(dirPath, 'list'));
41 if (res.ok) {
42 return await res.json();
43 }
44 return { files: [], not_exists: true };
45 } catch (e) {
46 console.warn('[diskStorage] listFiles failed:', e);
47 return { files: [], not_exists: true };
48 }
49}
50
51/**
52 * Read a file. Returns parsed JSON (if JSON file) or string content, or null if not found.

Callers 1

searchFilesFunction · 0.70

Calls 2

warnMethod · 0.80
apiUrlFunction · 0.70

Tested by

no test coverage detected