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

Function listFiles

apps/webuiapps/src/lib/localFileApi.ts:46–66  ·  view source on GitHub ↗
(path = '/')

Source from the content-addressed store, hash-verified

44 };
45
46 const listFiles = async (path = '/'): Promise<FileNode[]> => {
47 const normalizedPath = normalizePath(path);
48 const parentNode = findNodeByPath(normalizedPath);
49
50 if (!parentNode) {
51 return [];
52 }
53
54 if (parentNode.type !== 'folder') {
55 return [parentNode];
56 }
57
58 const children: FileNode[] = [];
59 for (const childId of parentNode.children || []) {
60 const child = store.get(childId);
61 if (child) {
62 children.push(child);
63 }
64 }
65 return children;
66 };
67
68 const readFile = async (path: string): Promise<ReadFileResult> => {
69 const normalizedPath = normalizePath(path);

Callers

nothing calls this directly

Calls 2

normalizePathFunction · 0.90
findNodeByPathFunction · 0.85

Tested by

no test coverage detected