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

Function getBundleSource

apps/sim/lib/execution/isolated-vm-worker.cjs:45–61  ·  view source on GitHub ↗
(bundleName)

Source from the content-addressed store, hash-verified

43}
44
45function getBundleSource(bundleName) {
46 const cached = bundleSourceCache.get(bundleName)
47 if (cached) return cached
48 const fileName = SANDBOX_BUNDLE_FILES[bundleName]
49 if (!fileName) {
50 throw new Error(`Unknown sandbox bundle: ${bundleName}`)
51 }
52 const bundlePath = path.join(SANDBOX_BUNDLE_DIR, fileName)
53 if (!fs.existsSync(bundlePath)) {
54 throw new Error(
55 `Sandbox bundle not found at ${bundlePath}. Run \`bun run build:sandbox-bundles\`.`
56 )
57 }
58 const source = fs.readFileSync(bundlePath, 'utf-8')
59 bundleSourceCache.set(bundleName, { source, fileName })
60 return bundleSourceCache.get(bundleName)
61}
62
63function stringifyLogValue(value) {
64 if (typeof value !== 'object' || value === null) {

Callers 1

executeTaskFunction · 0.85

Calls 3

joinMethod · 0.80
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected