Update Modules/Shell_Exec.py
Browse files- Modules/Shell_Exec.py +6 -8
Modules/Shell_Exec.py
CHANGED
|
@@ -47,8 +47,9 @@ _DETECTED_SHELL_PREFIX, _DETECTED_SHELL_NAME = _detect_shell()
|
|
| 47 |
# Clarify path semantics and expose detected shell in summary
|
| 48 |
TOOL_SUMMARY = (
|
| 49 |
"Execute a shell command within a safe working directory under the tool root ('/'). "
|
| 50 |
-
"Paths must be relative to '/'
|
| 51 |
-
"
|
|
|
|
| 52 |
f"Detected shell: {_DETECTED_SHELL_NAME}."
|
| 53 |
)
|
| 54 |
|
|
@@ -123,14 +124,11 @@ def build_interface() -> gr.Interface:
|
|
| 123 |
outputs=gr.Textbox(label="Output", lines=20),
|
| 124 |
title="Shell Exec",
|
| 125 |
description=(
|
|
|
|
| 126 |
"Run a shell command under the same safe root as File System. "
|
| 127 |
-
"
|
| 128 |
-
"unless UNSAFE_ALLOW_ABS_PATHS=1. Tip: set workdir to '.' to use the root. "
|
| 129 |
f"Detected shell: {_DETECTED_SHELL_NAME}. "
|
| 130 |
-
"
|
| 131 |
-
"<br>- Command: <code>dir</code> (Windows) or <code>ls -la</code> (Linux)"
|
| 132 |
-
"<br>- Command: <code>echo hello | tee out.txt</code>"
|
| 133 |
-
"<br>- Workdir: <code>notes</code>, Command: <code>ls</code> to list /notes"
|
| 134 |
),
|
| 135 |
api_description=TOOL_SUMMARY,
|
| 136 |
flagging_mode="never",
|
|
|
|
| 47 |
# Clarify path semantics and expose detected shell in summary
|
| 48 |
TOOL_SUMMARY = (
|
| 49 |
"Execute a shell command within a safe working directory under the tool root ('/'). "
|
| 50 |
+
"Paths must be relative to '/'. "
|
| 51 |
+
"Set workdir to '.' to use the root. "
|
| 52 |
+
"Absolute paths are disabled."
|
| 53 |
f"Detected shell: {_DETECTED_SHELL_NAME}."
|
| 54 |
)
|
| 55 |
|
|
|
|
| 124 |
outputs=gr.Textbox(label="Output", lines=20),
|
| 125 |
title="Shell Exec",
|
| 126 |
description=(
|
| 127 |
+
"<div style=\"text-align:center; overflow:hidden;\">"
|
| 128 |
"Run a shell command under the same safe root as File System. "
|
| 129 |
+
"Absolute paths are disabled, use relative paths. "
|
|
|
|
| 130 |
f"Detected shell: {_DETECTED_SHELL_NAME}. "
|
| 131 |
+
"</div>"
|
|
|
|
|
|
|
|
|
|
| 132 |
),
|
| 133 |
api_description=TOOL_SUMMARY,
|
| 134 |
flagging_mode="never",
|