@@ -116,12 +116,16 @@ def __init__( # noqa: PLR0913
116116 - List[str]: Read access restricted to specific paths, e.g.
117117 ["/tmp/sandbox", "./data"]
118118
119+ By default allows read to node_modules and to sessions dir
120+
119121 allow_write: File system write access configuration:
120122 - False: No file system write access (default, most secure)
121123 - True: Unrestricted write access to the file system
122124 - List[str]: Write access restricted to specific paths, e.g.
123125 ["/tmp/sandbox/output"]
124126
127+ By default allows read to node_modules and to sessions dir
128+
125129 allow_net: Network access configuration:
126130 - False: No network access (default, most secure)
127131 - True: Unrestricted network access
@@ -152,7 +156,7 @@ def __init__( # noqa: PLR0913
152156
153157 # Check if Deno is installed
154158 try :
155- subprocess .run (["deno" , "--version" ], check = True ) # noqa: S607, S603
159+ subprocess .run (["deno" , "--version" ], check = True , capture_output = True ) # noqa: S607, S603
156160 except subprocess .CalledProcessError as e :
157161 msg = "Deno is installed, but running it failed."
158162 raise RuntimeError (msg ) from e
@@ -164,8 +168,8 @@ def __init__( # noqa: PLR0913
164168 # each tuple contains (flag, setting, defaults)
165169 perm_defs = [
166170 ("--allow-env" , allow_env , None ),
167- ("--allow-read" , allow_read , [sessions_dir ]),
168- ("--allow-write" , allow_write , [sessions_dir ]),
171+ ("--allow-read" , allow_read , [sessions_dir , "node_modules" ]),
172+ ("--allow-write" , allow_write , [sessions_dir , "node_modules" ]),
169173 ("--allow-net" , allow_net , None ),
170174 ("--allow-run" , allow_run , None ),
171175 ("--allow-ffi" , allow_ffi , None ),
0 commit comments