You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 281c22b
Browse filesBrowse the repository at this point in the historyBrowse files
Runs a PowerShell code snippet (string) by writing it to a temp .ps1 file and executing it. Using Windows PowerShell (powershell.exe) — Windows-only, PS 5.1 syntax; avoid PS 7+ features like ternary operator (?:) or null coalescing (??=). Use execute_ps_script when the script already exists on disk.
1
+
Runs a PowerShell code snippet (string) by writing it to a temp .ps1 file and executing it. Using Windows PowerShell (powershell.exe) — Windows-only, PS 5.1 syntax; avoid PS 7+ features like ternary operator (?:) or null coalescing (??=). Use execute_ps_script when the script already exists on disk.
2
+
3
+
In background mode, set interactive=true only when the script prompts on stdin and you plan to continue with write_process.
Runs a PowerShell code snippet (string) by writing it to a temp .ps1 file and executing it. Using PowerShell Core (pwsh) — cross-platform, PS 7+ syntax (e.g. ternary operator, null coalescing, foreach-object -Parallel). Use execute_ps_script when the script already exists on disk.
1
+
Runs a PowerShell code snippet (string) by writing it to a temp .ps1 file and executing it. Using PowerShell Core (pwsh) — cross-platform, PS 7+ syntax (e.g. ternary operator, null coalescing, foreach-object -Parallel). Use execute_ps_script when the script already exists on disk.
2
+
3
+
In background mode, set interactive=true only when the script prompts on stdin and you plan to continue with write_process.
Runs a Python code snippet (string) by writing it to a temp file and executing it. Use this for inline scripts or quick calculations. Use execute_python_script when the script already exists on disk.
2
+
3
+
In background mode, set interactive=true only when the script prompts on stdin and you plan to continue with write_process.
Reads new output from a background process started by shell or a script tool with mode="background".
2
2
3
3
Pass the exact numeric processId returned by the tool. The result contains only output produced since the previous read. If the process is still running, call read_process again later with the same processId. If the process has exited, the result includes the final exit status.
4
+
5
+
If the process was started with interactive=true and is waiting for stdin, use write_process with the same processId to send input.
Copy file name to clipboardExpand all lines: packages/sbot/prompts/tools/command/shell.txt
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,8 @@ Executes shell code in a given working directory. Put the command or multi-line
2
2
3
3
Use mode="background" for commands that may take longer than a normal tool call, such as builds, test suites, servers, or long scripts. In background mode, the tool waits briefly for completion; if the process is still running, it returns current output plus a numeric processId. Use read_process with that processId to read later output.
4
4
5
+
For programs that prompt on stdin, set interactive=true in background mode, then use write_process with the returned processId to send input. Include a trailing newline for line prompts. This is pipe-based stdin, not a full terminal/TTY.
6
+
5
7
The code field supports all forms:
6
8
- Single command: "git status"
7
9
- Chained commands: "npm install && npm run build"
Writes stdin to a background process started with mode="background" and interactive=true.
2
+
3
+
Pass the exact numeric processId returned by shell or a script tool. Put the input in stdin. Include a trailing newline for line prompts, for example "y\n" or "2\n".
4
+
5
+
Use close=true when the process needs EOF after the input, such as programs that read all stdin before continuing. This tool writes to a normal stdin pipe; it is not a full terminal/TTY and may not work for terminal UIs, password prompts, or tools that require a real interactive terminal.
Copy file name to clipboardExpand all lines: packages/scorpio.ai/src/Tools/Process/codeTool.ts
+29-3Lines changed: 29 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -35,8 +35,9 @@ function withExecutionMode<T extends z.ZodRawShape>(base: z.ZodObject<T>) {
35
35
timeout: z.number().optional().default(60000).describe('Timeout in milliseconds, default 60000 (60 s)'),
36
36
}),
37
37
base.extend({
38
-
mode: z.literal(CodeToolMode.Background).describe('Run in the background and use read_process for later output'),
39
-
yieldMs: z.number().optional().default(1000).describe('How long to wait for immediate completion before returning a processid, default 1000 ms'),
38
+
mode: z.literal(CodeToolMode.Background).describe('Run in the background and use read_process for later output'),
39
+
yieldMs: z.number().optional().default(1000).describe('How long to wait for immediate completion before returning a processId, default 1000 ms'),
40
+
interactive: z.boolean().optional().default(false).describe('Keep stdin open so write_process can send more input later. Use only for programs that prompt for stdin; this is pipe-based, not a full TTY.'),
yieldMs: z.number().optional().default(1000).describe('How long to wait for new output, default 1000 ms'),
62
63
});
63
64
65
+
exportconstwriteProcessToolSchema=z.object({
66
+
processId: z.number().int().positive().describe('The numeric processId returned by shell/script mode="background" with interactive=true'),
67
+
stdin: z.any().optional().describe('Data to write to the background process stdin. Prefer a string and include a trailing newline for line prompts; objects/arrays are auto-serialized to JSON.'),
68
+
close: z.boolean().optional().default(false).describe('Whether to close stdin after writing. Use true when the process needs EOF to continue or finish.'),
0 commit comments