MCPcopy Create free account
hub / github.com/agenticsorg/edge-agents / listFiles

Function listFiles

scripts/sparc2/scripts/e2b-code-interpreter.ts:212–226  ·  view source on GitHub ↗
(path: string)

Source from the content-addressed store, hash-verified

210 * @returns Array of file names
211 */
212export async function listFiles(path: string): Promise<string[]> {
213 const sandbox = await createSandbox();
214
215 try {
216 const files = await sandbox.filesystem.list(path);
217 await logMessage("info", `Listed files in sandbox: ${path}`, { fileCount: files.length });
218 return files;
219 } catch (error: unknown) {
220 const errorMessage = error instanceof Error ? error.message : String(error);
221 await logMessage("error", `Failed to list files in sandbox: ${path}`, { error: errorMessage });
222 throw error;
223 } finally {
224 await sandbox.close();
225 }
226}
227
228/**
229 * Install packages in the sandbox

Callers 2

mainFunction · 0.90
mainFunction · 0.70

Calls 2

logMessageFunction · 0.90
createSandboxFunction · 0.70

Tested by

no test coverage detected