Download src/lib/plugins/sandbox.ts from rais133/omniroute: direct link, hf CLI and curl.
- Browser
- Download file 806 Bytes
-
https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/lib/plugins/sandbox.ts
- Command line
-
hf download hf://spaces/rais133/omniroute/src/lib/plugins/sandbox.ts
-
curl -L -o sandbox.ts https://huggingface.co/spaces/rais133/omniroute/resolve/main/src/lib/plugins/sandbox.ts
806 Bytes
| /** | |
| * Plugin sandbox — configurable isolation levels. | |
| * | |
| * @module plugins/sandbox | |
| */ | |
| export enum SandboxLevel { | |
| /** Run in-process (no isolation, fastest) */ | |
| IN_PROCESS = 0, | |
| /** Run in child process with full environment */ | |
| CHILD_FULL_ENV = 1, | |
| /** Run in child process with filtered environment */ | |
| CHILD_FILTERED_ENV = 2, | |
| /** Run in child process with isolated environment (no env vars) */ | |
| CHILD_ISOLATED = 3, | |
| } | |
| export function getSandboxLabel(level: SandboxLevel): string { | |
| switch (level) { | |
| case SandboxLevel.IN_PROCESS: | |
| return "In-Process"; | |
| case SandboxLevel.CHILD_FULL_ENV: | |
| return "Child (Full Env)"; | |
| case SandboxLevel.CHILD_FILTERED_ENV: | |
| return "Child (Filtered Env)"; | |
| case SandboxLevel.CHILD_ISOLATED: | |
| return "Child (Isolated)"; | |
| } | |
| } | |