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

Function readSandboxOutputFile

apps/sim/lib/execution/e2b.ts:162–180  ·  view source on GitHub ↗
(
  sandbox: E2BSandbox,
  outputSandboxPath: string,
  options?: { user?: string }
)

Source from the content-addressed store, hash-verified

160}
161
162async function readSandboxOutputFile(
163 sandbox: E2BSandbox,
164 outputSandboxPath: string,
165 options?: { user?: string }
166): Promise<string | undefined> {
167 try {
168 if (shouldReadSandboxPathAsBase64(outputSandboxPath)) {
169 const b64Result = await sandbox.commands.run(`base64 -w0 "${outputSandboxPath}"`, options)
170 return b64Result.stdout
171 }
172 return await sandbox.files.read(outputSandboxPath)
173 } catch (error) {
174 logger.warn('Failed to read requested sandbox output file', {
175 outputSandboxPath,
176 error: error instanceof Error ? error.message : String(error),
177 })
178 return undefined
179 }
180}
181
182function requestedOutputSandboxPaths(req: {
183 outputSandboxPath?: string

Callers 2

executeInE2BFunction · 0.85
executeShellInE2BFunction · 0.85

Calls 4

runMethod · 0.65
warnMethod · 0.65
readMethod · 0.45

Tested by

no test coverage detected