π¦ ClawHub
XPR Code Sandbox
by @paulgnz
Execute JavaScript code in a secure sandbox for data processing, computation, and quick expression evaluation without network or filesystem access.
TERMINAL
clawhub install xpr-code-sandboxπ About This Skill
name: code-sandbox description: Execute JavaScript code in a sandboxed VM for data processing and computation
Code Sandbox
You have sandboxed JavaScript execution tools for computation and data processing:
Full scripts:
execute_js β run JavaScript code in an isolated V8 sandboxinput parameter (JSON) β access it as INPUT in your code
- Use console.log() to capture intermediate values (returned in logs array)
- Available globals: JSON, Math, Date, Array, Object, String, Number, RegExp, Map, Set, parseInt, parseFloat, isNaN, isFinite, encodeURIComponent, decodeURIComponent, atob, btoa
- No network access, no filesystem, no imports β pure computation only
- Default timeout 5 seconds, max 30 seconds
- 10MB output limitQuick expressions:
eval_expression β evaluate a single JavaScript expression and return the result"15 * 4500 * 0.01" β 675
- Date calculations: "new Date().toISOString()"
- Array operations: "[1,2,3].map(x => x*x)" β [1, 4, 9]Best practices:
execute_js for multi-step data processing, algorithm testing, code validationeval_expression for quick math, string ops, date calculationsinput parameter rather than embedding in codeparse_csv (structured-data skill) for CSV β transform β output workflowsstore_deliverable to save computed results as job evidence