Action for executing JavaScript code in a sandboxed environment

This is a THIN WRAPPER - all core logic lives in CodeExecutionService. The action's job is simply to:

  1. Extract parameters from the action interface
  2. Delegate to CodeExecutionService
  3. Map results back to ActionResultSimple

Security is enforced entirely by CodeExecutionService.

Example: Agent usage:

{
"type": "Action",
"action": {
"name": "Execute Code",
"params": {
"code": "const sum = input.values.reduce((a,b) => a+b, 0); output = sum;",
"language": "javascript",
"inputData": "{\"values\": [1,2,3,4,5]}"
}
}
}

Hierarchy (view full)

Constructors

Methods

  • Executes the action with the provided parameters.

    Parameters

    • params: RunActionParams<any>

      The action execution parameters including context

    Returns Promise<ActionResultSimple>

    Promise resolving to the action result