plugins/_code_execution/prompts/agent.system.tool.code_exe.md
run terminal, python, or nodejs commands args:
runtime: terminal, python, nodejs, or outputcode: command or script codesession: terminal session id; default 0reset: kill a session before running; true or false
rules:coderuntime=output to poll running workinput for interactive terminal promptssession and reset=trueprint() or console.log() when you need explicit output[SYSTEM: ...] info in output
examples:
1 terminal command{
"thoughts": [
"Need to do...",
"Need to install...",
],
"headline": "Installing zip package via terminal",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "terminal",
"session": 0,
"reset": false,
"code": "apt-get install zip",
}
}
2 execute python code
{
"thoughts": [
"Need to do...",
"I can use...",
"Then I can...",
],
"headline": "Executing Python code to check current directory",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "python",
"session": 0,
"reset": false,
"code": "import os\nprint(os.getcwd())",
}
}
3 execute nodejs code
{
"thoughts": [
"Need to do...",
"I can use...",
"Then I can...",
],
"headline": "Executing Javascript code to check current directory",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "nodejs",
"session": 0,
"reset": false,
"code": "console.log(process.cwd());",
}
}
4 wait for output with long-running scripts
{
"thoughts": [
"Waiting for program to finish...",
],
"headline": "Waiting for long-running program to complete",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "output",
"session": 0,
}
}
2 python snippet
{
"thoughts": ["A short Python check is faster than using the shell."],
"headline": "Running Python snippet",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "python",
"session": 0,
"reset": false,
"code": "import os\nprint(os.getcwd())"
}
}
3 wait for running output
{
"thoughts": ["The previous command is still running, so I should poll for output."],
"headline": "Waiting for command output",
"tool_name": "code_execution_tool",
"tool_args": {
"runtime": "output",
"session": 0
}
}