Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

♻️ refactor: update the codesandbox systemRole(preinstalled_software) (#13799)

LiJiancd0f65210c27
diff --git a/packages/builtin-tool-cloud-sandbox/src/systemRole.ts b/packages/builtin-tool-cloud-sandbox/src/systemRole.ts
index e86f811db94..a96eae565de 100644
--- a/packages/builtin-tool-cloud-sandbox/src/systemRole.ts
+++ b/packages/builtin-tool-cloud-sandbox/src/systemRole.ts
@@ -20,37 +20,40 @@ export const systemPrompt = `You have access to a Cloud Sandbox that provides a
**IMPORTANT: Prefer Pre-installed Software**
The sandbox comes with pre-installed software and libraries. **Always prioritize using these pre-installed tools** when they can solve the user's problem, rather than installing additional packages.
-**Operating System:**
-- Debian 12
+**Base Image:** lobehubbot/python-node:latest (Debian-based)
**Programming Languages & Runtimes:**
- Python (with pip)
- Node.js (with npm)
+- Bun
+- Bash/Shell
-**Build Tools:**
-- build-essential 12.9
-- gcc/g++ 12.2.0
+**Package Managers:**
+- pip (Python)
+- npm / pnpm (Node.js)
-**Python Libraries (Pre-installed):**
-- numpy 2.4.1 - Numerical computing
-- scipy 1.17.0 - Scientific computing
-- pandas 2.3.3 - Data analysis
-- matplotlib 3.10.8 - Static visualization
-- plotly 6.5.2 - Interactive visualization
-- scikit-learn 1.8.0 - Machine learning
-- opencv-python 4.13.0.90 - Computer vision
-- Pillow 12.1.0 - Image processing
-- wheel 0.45.1 - Python package installer
-
-**Document & Media Tools:**
+**System Tools (apt):**
+- curl, wget, unzip, jq - Common utilities
+- build-essential - gcc/g++/make compilation toolchain
+- FFmpeg - Audio/video processing
- LibreOffice - Office document processing
- Pandoc - Document format conversion
-- pdftoppm - PDF to image conversion
-- FFmpeg 5.1.8-0+deb12u1 - Audio/video processing
+- poppler-utils - PDF tools (pdftotext, pdftoppm, etc.)
+- GitHub CLI (gh)
-**Browser Automation:**
+**JS/TS Tools:**
+- marp-cli - Markdown to PPT/PDF presentation
+- Chromium (installed via Playwright, also used by marp-cli)
- Playwright - Browser automation
-- marpc-cli - Browser-based PPTX generation
+
+**Python Libraries (Pre-installed):**
+- Data Science/ML: numpy, pandas, scipy, scikit-learn
+- Visualization: matplotlib, plotly
+- Data Processing: pyyaml, toml, python-dotenv, Pillow, opencv-python-headless
+- File Processing: openpyxl, xlrd, python-docx, PyPDF2, reportlab
+- Async: aiofiles, anyio
+- Testing: pytest
+- Server: fastapi, uvicorn, pydantic
**Fonts:**
- Noto Sans CJK - Chinese/Japanese/Korean sans-serif font
@@ -60,6 +63,7 @@ The sandbox comes with pre-installed software and libraries. **Always prioritize
- Tesseract (OCR) - Not installed
- Puppeteer - Not installed, use Playwright instead
- mermaid-cli - Not installed
+- seaborn - Not installed
**Installation Guidelines:**
- Only install additional packages when pre-installed software cannot fulfill the requirement
@@ -173,7 +177,9 @@ When executing Python code:
**Using Pre-installed Libraries:**
- **Always check if required libraries are pre-installed** (see preinstalled_software section)
-- numpy, scipy, pandas, matplotlib, plotly, scikit-learn, opencv-python, Pillow are already available
+- Data Science/ML: numpy, pandas, scipy, scikit-learn, matplotlib, plotly are already available
+- Data Processing: pyyaml, toml, python-dotenv, Pillow, opencv-python-headless are already available
+- File Processing: openpyxl, xlrd, python-docx, PyPDF2, reportlab are already available
- **Skip pip install** for pre-installed libraries - use them directly
- Only use \`pip install\` for libraries NOT in the pre-installed list
@@ -188,12 +194,12 @@ When executing Python code:
**Generating Document Files:**
You MUST use the following libraries for each supported file format:
-- **PDF**: Use \`reportlab\` - prioritize \`reportlab.platypus\` over canvas for text content
-- **DOCX**: Use \`python-docx\`
-- **XLSX**: Use \`openpyxl\`
-- **PPTX**: Use \`python-pptx\`
-- **CSV**: Use pre-installed \`pandas\` (no installation needed)
-- **ODS/ODT/ODP**: Use \`odfpy\`
+- **PDF**: Use \`reportlab\` (pre-installed) - prioritize \`reportlab.platypus\` over canvas for text content
+- **DOCX**: Use \`python-docx\` (pre-installed)
+- **XLSX**: Use \`openpyxl\` (pre-installed)
+- **PPTX**: Use \`python-pptx\` (requires pip install)
+- **CSV**: Use \`pandas\` (pre-installed)
+- **ODS/ODT/ODP**: Use \`odfpy\` (requires pip install)
For libraries NOT pre-installed: Install with \`pip install <package-name>\` before use.
**After successful generation, automatically export the document file.**