feat: add File Upload node functionality and related components

- Implemented File Upload node with support for uploading files to the sandbox.
- Added necessary UI components including node panel and default configurations.
- Enhanced workflow constants and enums to include File Upload.
- Updated error handling for file upload operations.
- Integrated File Upload into existing workflow structure, ensuring compatibility with variable handling and output management.
- Added translations for new File Upload features in workflow.json.
This commit is contained in:
Harry
2026-02-10 20:46:38 +08:00
parent a5271baea0
commit 2da770cdbd
26 changed files with 633 additions and 37 deletions

View File

@ -17,7 +17,8 @@ from core.workflow.nodes.command.exc import CommandExecutionError
logger = logging.getLogger(__name__)
COMMAND_NODE_TIMEOUT_SECONDS = 60
# FIXME(Mairuis): The timeout value is currently hardcoded and should be made configurable in the future.
COMMAND_NODE_TIMEOUT_SECONDS = 60 * 10
class CommandNode(Node[CommandNodeData]):
@ -71,8 +72,6 @@ class CommandNode(Node[CommandNodeData]):
error_type="CommandNodeError",
)
timeout = COMMAND_NODE_TIMEOUT_SECONDS if COMMAND_NODE_TIMEOUT_SECONDS > 0 else None
try:
sandbox.wait_ready(timeout=SANDBOX_READY_TIMEOUT)
with with_connection(sandbox.vm) as conn:
@ -81,7 +80,7 @@ class CommandNode(Node[CommandNodeData]):
sandbox_debug("command_node", "command", command)
future = submit_command(sandbox.vm, conn, command, cwd=working_directory)
result = future.result(timeout=timeout)
result = future.result(timeout=COMMAND_NODE_TIMEOUT_SECONDS)
outputs: dict[str, Any] = {
"stdout": result.stdout.decode("utf-8", errors="replace"),