MCPcopy Index your code
hub / github.com/simstudioai/sim / listDir

Function listDir

apps/sim/app/api/tools/ssh/list-directory/route.ts:39–49  ·  view source on GitHub ↗
(sftp: SFTPWrapper, dirPath: string)

Source from the content-addressed store, hash-verified

37}
38
39async function listDir(sftp: SFTPWrapper, dirPath: string): Promise<FileEntry[]> {
40 return new Promise((resolve, reject) => {
41 sftp.readdir(dirPath, (err, list) => {
42 if (err) {
43 reject(err)
44 } else {
45 resolve(list)
46 }
47 })
48 })
49}
50
51export const POST = withRouteHandler(async (request: NextRequest) => {
52 const requestId = generateId().slice(0, 8)

Callers 1

route.tsFile · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected