deepcode-hku 1.1.0__tar.gz → 1.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. {deepcode_hku-1.1.0/deepcode_hku.egg-info → deepcode_hku-1.2.0}/PKG-INFO +219 -122
  2. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/README.md +218 -121
  3. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/__init__.py +1 -1
  4. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0/deepcode_hku.egg-info}/PKG-INFO +219 -122
  5. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/mcp_agent.secrets.yaml +2 -2
  6. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/.pre-commit-config.yaml +0 -0
  7. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/LICENSE +0 -0
  8. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/MANIFEST.in +0 -0
  9. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/__init__.py +0 -0
  10. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/cli_app.py +0 -0
  11. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/cli_interface.py +0 -0
  12. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/cli_launcher.py +0 -0
  13. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/main_cli.py +0 -0
  14. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/workflows/__init__.py +0 -0
  15. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/cli/workflows/cli_workflow_adapter.py +0 -0
  16. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode.py +0 -0
  17. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode_hku.egg-info/SOURCES.txt +0 -0
  18. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode_hku.egg-info/dependency_links.txt +0 -0
  19. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode_hku.egg-info/entry_points.txt +0 -0
  20. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode_hku.egg-info/requires.txt +0 -0
  21. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/deepcode_hku.egg-info/top_level.txt +0 -0
  22. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/mcp_agent.config.yaml +0 -0
  23. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/prompts/code_prompts.py +0 -0
  24. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/requirements.txt +0 -0
  25. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/schema/mcp-agent.config.schema.json +0 -0
  26. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/setup.cfg +0 -0
  27. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/setup.py +0 -0
  28. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/__init__.py +0 -0
  29. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/bocha_search_server.py +0 -0
  30. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/code_implementation_server.py +0 -0
  31. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/code_indexer.py +0 -0
  32. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/code_reference_indexer.py +0 -0
  33. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/command_executor.py +0 -0
  34. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/document_segmentation_server.py +0 -0
  35. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/git_command.py +0 -0
  36. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/pdf_converter.py +0 -0
  37. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/pdf_downloader.py +0 -0
  38. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/tools/pdf_utils.py +0 -0
  39. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/__init__.py +0 -0
  40. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/app.py +0 -0
  41. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/components.py +0 -0
  42. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/handlers.py +0 -0
  43. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/layout.py +0 -0
  44. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/sidebar_feed.py +0 -0
  45. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/streamlit_app.py +0 -0
  46. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/ui/styles.py +0 -0
  47. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/__init__.py +0 -0
  48. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/cli_interface.py +0 -0
  49. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/cross_platform_file_handler.py +0 -0
  50. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/dialogue_logger.py +0 -0
  51. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/file_processor.py +0 -0
  52. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/llm_utils.py +0 -0
  53. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/utils/simple_llm_logger.py +0 -0
  54. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/__init__.py +0 -0
  55. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agent_orchestration_engine.py +0 -0
  56. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/__init__.py +0 -0
  57. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/code_implementation_agent.py +0 -0
  58. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/document_segmentation_agent.py +0 -0
  59. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/memory_agent_concise.py +0 -0
  60. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/memory_agent_concise_index.py +0 -0
  61. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/memory_agent_concise_multi.py +0 -0
  62. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/agents/requirement_analysis_agent.py +0 -0
  63. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/code_implementation_workflow.py +0 -0
  64. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/code_implementation_workflow_index.py +0 -0
  65. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/codebase_index_workflow.py +0 -0
  66. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/plugins/__init__.py +0 -0
  67. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/plugins/base.py +0 -0
  68. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/plugins/integration.py +0 -0
  69. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/plugins/plan_review.py +0 -0
  70. {deepcode_hku-1.1.0 → deepcode_hku-1.2.0}/workflows/plugins/requirement_analysis.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: deepcode-hku
3
- Version: 1.1.0
3
+ Version: 1.2.0
4
4
  Summary: AI Research Engine - Transform research papers into working code automatically
5
5
  Home-page: https://github.com/HKUDS/DeepCode
6
6
  Author: DeepCodeTeam
@@ -200,6 +200,7 @@ Dynamic: summary
200
200
  - [🏗️ Architecture](#️-architecture)
201
201
  - [📊 Experimental Results](#-experimental-results)
202
202
  - [🚀 Quick Start](#-quick-start)
203
+ - [🤖 nanobot Integration (Feishu Chatbot)](#-nanobot-integration-feishu-chatbot)
203
204
  - [💡 Examples](#-examples)
204
205
  - [🎬 Live Demonstrations](#-live-demonstrations)
205
206
  - [⭐ Star History](#-star-history)
@@ -210,7 +211,35 @@ Dynamic: summary
210
211
 
211
212
  ## 📰 News
212
213
 
213
- 🎨 **[2025-02] New Web UI Experience Upgrade!**
214
+ 🎉 **[2025-02] DeepCode + nanobot Integration — Chat with DeepCode via Feishu Bot!**
215
+
216
+ <div align="center">
217
+ <table><tr>
218
+ <td align="center"><a href="https://github.com/HKUDS/DeepCode"><img src="./assets/logo.png" alt="DeepCode" height="60"/></a></td>
219
+ <td align="center"><h2>✦</h2></td>
220
+ <td align="center"><a href="https://github.com/HKUDS/nanobot"><img src="./assets/nanobot.png" alt="nanobot" height="60"/></a></td>
221
+ </tr></table>
222
+ </div>
223
+
224
+ - [nanobot](https://github.com/HKUDS/nanobot) now connects to DeepCode — send messages in **Feishu** and get auto-generated code back
225
+ - Supports **Paper-to-Code** and **Chat-to-Code**, plus real-time task tracking, all from your chat app
226
+ - One-command deploy: `./nanobot/run_nanobot.sh` → **[Setup Guide →](#-nanobot-integration-feishu-chatbot)**
227
+
228
+ <div align="center">
229
+ <table width="100%"><tr>
230
+ <td width="50%" align="center">
231
+ <img src="./assets/IMG_8098.jpeg" alt="Feishu Chat Example 1" width="95%" style="border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);"/>
232
+ </td>
233
+ <td width="50%" align="center">
234
+ <img src="./assets/IMG_8099.jpeg" alt="Feishu Chat Example 2" width="95%" style="border-radius: 10px; box-shadow: 0 4px 15px rgba(0,0,0,0.2);"/>
235
+ </td>
236
+ </tr></table>
237
+ <sub><em>Feishu Bot in Action — Natural language → Full code generation with setup instructions</em></sub>
238
+ </div>
239
+
240
+ ---
241
+
242
+ 🎉 **[2025-02] New Web UI Experience Upgrade!**
214
243
 
215
244
  - 🔄 **User-in-Loop Interaction**: Support real-time user interaction during workflows - AI asks clarifying questions directly in the chat
216
245
  - 💬 **Inline Interaction Design**: Interaction prompts appear naturally within the chat flow for a seamless experience
@@ -226,7 +255,7 @@ Dynamic: summary
226
255
 
227
256
  ---
228
257
 
229
- 🎉 **[2025-10] 🎉 [2025-10-28] DeepCode Achieves SOTA on PaperBench!**
258
+ 🎉 **[2025-10-28] DeepCode Achieves SOTA on PaperBench!**
230
259
 
231
260
  DeepCode sets new benchmarks on OpenAI's PaperBench Code-Dev across all categories:
232
261
 
@@ -803,128 +832,93 @@ bocha-mcp:
803
832
 
804
833
  ### ⚡ **Step 3: Launch Application**
805
834
 
806
- #### 🐳 **Docker** (Recommended — Easiest Setup)
835
+ Choose your preferred launch method:
807
836
 
808
- No need to install Python, Node.js, or any dependencies — everything runs inside the container.
837
+ <table width="100%">
838
+ <tr>
839
+ <th width="33%">🐳 Docker (Recommended)</th>
840
+ <th width="33%">🚀 Local (<code>deepcode</code> command)</th>
841
+ <th width="33%">🛠️ Other Methods</th>
842
+ </tr>
843
+ <tr><td>
809
844
 
810
- **Prerequisites:** Install [Docker Desktop](https://www.docker.com/products/docker-desktop) (includes Docker Engine + Docker Compose).
845
+ No Python/Node needed — everything in container.
811
846
 
812
847
  ```bash
813
- # 1. Clone the repository (if not already done)
814
848
  git clone https://github.com/HKUDS/DeepCode.git
815
849
  cd DeepCode/
850
+ cp mcp_agent.secrets.yaml.example \
851
+ mcp_agent.secrets.yaml
852
+ # Edit secrets with your API keys
816
853
 
817
- # 2. Configure your API keys (see Step 2: Configuration above)
818
- cp mcp_agent.secrets.yaml.example mcp_agent.secrets.yaml
819
- # Edit mcp_agent.secrets.yaml with your API keys
820
-
821
- # 3. Start with one command
822
- ./deepcode_docker/run_docker.sh # Build & start (auto-builds on first run)
823
-
824
- # Access at http://localhost:8000
825
- ```
826
-
827
- **Management Commands:**
828
- ```bash
829
- ./deepcode_docker/run_docker.sh stop # Stop the service
830
- ./deepcode_docker/run_docker.sh restart # Restart (after config changes, no rebuild needed)
831
- ./deepcode_docker/run_docker.sh --build # Rebuild (after code changes)
832
- ./deepcode_docker/run_docker.sh logs # View real-time logs
833
- ./deepcode_docker/run_docker.sh status # Check service status
834
- ./deepcode_docker/run_docker.sh clean # Remove containers and images
835
- ```
836
-
837
- Or use Docker Compose directly:
838
- ```bash
839
- docker compose -f deepcode_docker/docker-compose.yml up --build # Build and start
840
- docker compose -f deepcode_docker/docker-compose.yml up -d # Start in background
841
- docker compose -f deepcode_docker/docker-compose.yml down # Stop
842
- docker compose -f deepcode_docker/docker-compose.yml logs -f # View logs
854
+ ./deepcode_docker/run_docker.sh
855
+ # Access → http://localhost:8000
843
856
  ```
844
857
 
845
- > **💡 Config changes don't need rebuild**: `mcp_agent.config.yaml` and `mcp_agent.secrets.yaml` are mounted as volumes — just edit them and run `./deepcode_docker/run_docker.sh restart`.
846
- >
847
- > **💡 Windows users**: Run `docker compose -f deepcode_docker/docker-compose.yml up --build` directly if the shell script is not available.
858
+ </td><td>
848
859
 
849
- #### 🚀 **Using `deepcode` Command** (Local Installation)
860
+ Auto-installs deps on first run.
850
861
 
851
862
  ```bash
852
- # 🌐 Launch the new React-based web interface
853
863
  deepcode
854
-
855
- # Frontend: http://localhost:5173
856
- # Backend API: http://localhost:8000
857
- # Press Ctrl+C to stop all services
864
+ # Frontend → http://localhost:5173
865
+ # Backend → http://localhost:8000
866
+ # Ctrl+C to stop
858
867
  ```
859
- <div align="center">
860
- <img src="https://img.shields.io/badge/Frontend-localhost:5173-00d4ff?style=flat-square&logo=react&logoColor=white" alt="Frontend" />
861
- <img src="https://img.shields.io/badge/Backend-localhost:8000-4ecdc4?style=flat-square&logo=fastapi&logoColor=white" alt="Backend" />
862
- </div>
863
868
 
864
- > **📦 Auto Install**: On first run, dependencies are automatically installed (`pip install` for backend, `npm install` for frontend)
869
+ Features: User-in-Loop, real-time progress, inline chat.
865
870
 
866
- > **✨ Features**: User-in-Loop interaction, real-time progress tracking, inline chat interaction
867
-
868
- #### 🛠️ **Alternative Launch Methods**
869
-
870
- <table>
871
- <tr>
872
- <td><strong>🍎 macOS / 🐧 Linux</strong></td>
873
- <td><strong>🪟 Windows</strong></td>
874
- </tr>
875
- <tr>
876
- <td>
871
+ </td><td>
877
872
 
878
873
  ```bash
879
- # Using run.sh
874
+ # macOS / Linux
880
875
  ./run.sh
876
+ # or: python deepcode.py
881
877
 
882
- # Or using Python directly
883
- python deepcode.py
884
- ```
885
-
886
- </td>
887
- <td>
888
-
889
- ```cmd
890
- # Using run.bat
878
+ # Windows
891
879
  run.bat
880
+ # or: python deepcode.py
881
+
882
+ # Classic Streamlit UI
883
+ deepcode --classic
892
884
 
893
- # Or using Python directly
894
- python deepcode.py
885
+ # CLI mode
886
+ deepcode --cli
887
+ # or: python cli/main_cli.py
895
888
  ```
896
889
 
897
- </td>
898
- </tr>
890
+ </td></tr>
899
891
  </table>
900
892
 
893
+ <details>
894
+ <summary><strong>🐳 Docker Management Commands</strong></summary>
895
+
901
896
  ```bash
902
- # Classic Streamlit UI (all platforms)
903
- deepcode --classic
897
+ ./deepcode_docker/run_docker.sh stop # Stop
898
+ ./deepcode_docker/run_docker.sh restart # Restart (no rebuild needed for config changes)
899
+ ./deepcode_docker/run_docker.sh --build # Force rebuild
900
+ ./deepcode_docker/run_docker.sh logs # Real-time logs
901
+ ./deepcode_docker/run_docker.sh status # Health check
902
+ ./deepcode_docker/run_docker.sh clean # Remove containers & images
904
903
  ```
905
- <div align="center">
906
- <img src="https://img.shields.io/badge/Classic_UI-localhost:8501-00d4ff?style=flat-square&logo=streamlit&logoColor=white" alt="Classic UI" />
907
- </div>
908
904
 
909
- ##### 🖥️ **CLI Interface** (Advanced Users)
905
+ Or with Docker Compose directly:
910
906
  ```bash
911
- # CLI via Docker (no local Python needed)
912
- ./deepcode_docker/run_docker.sh cli
907
+ docker compose -f deepcode_docker/docker-compose.yml up --build # Build & start
908
+ docker compose -f deepcode_docker/docker-compose.yml down # Stop
909
+ docker compose -f deepcode_docker/docker-compose.yml logs -f # Logs
910
+ ```
913
911
 
914
- # Or: deepcode --cli
912
+ > **💡** Config files are mounted as volumes — edit and restart, no rebuild needed.
913
+ > **💡** Windows users: run `docker compose` commands directly if shell scripts aren't available.
915
914
 
916
- # CLI locally (requires Python environment)
917
- python cli/main_cli.py
918
- ```
919
- <div align="center">
920
- <img src="https://img.shields.io/badge/Mode-Interactive_Terminal-9b59b6?style=flat-square&logo=terminal&logoColor=white" alt="CLI Mode" />
921
- </div>
915
+ </details>
922
916
 
923
917
  ### 🎯 **Step 4: Generate Code**
924
918
 
925
- 1. **📄 Input**: Upload your research paper, provide requirements, or paste a URL
926
- 2. **🤖 Processing**: Watch the multi-agent system analyze and plan
927
- 3. **⚡ Output**: Receive production-ready code with tests and documentation
919
+ 1. **📄 Input** — Upload a research paper, type requirements, or paste a URL
920
+ 2. **🤖 Processing** — The multi-agent system analyzes, plans, and generates
921
+ 3. **⚡ Output** — Receive production-ready code with tests and documentation
928
922
 
929
923
  ---
930
924
 
@@ -933,64 +927,167 @@ python cli/main_cli.py
933
927
  <details>
934
928
  <summary><strong>❓ Common Issues & Solutions</strong></summary>
935
929
 
936
- #### 🐳 Docker build fails with `tsc: not found`
930
+ | Problem | Cause | Fix |
931
+ |---|---|---|
932
+ | Docker build fails with `tsc: not found` | Corrupted build cache | `docker builder prune -f` then rebuild with `--no-cache` |
933
+ | `error during connect` / `cannot find the file` | Docker Desktop not running | Start Docker Desktop, wait until ready, retry |
934
+ | Frontend blank page | Corrupted `node_modules` | `cd new_ui/frontend && rm -rf node_modules && npm install` |
935
+ | `ERR_CONNECTION_REFUSED` | Wrong port / backend not running | Docker: `http://localhost:8000`. Local: `http://localhost:5173` |
936
+ | `npm install` → `Could not read package.json` | Wrong directory | Use `npm install --prefix new_ui/frontend` |
937
+ | Windows: MCP servers not working | Need absolute paths | See [Windows MCP Configuration](#-step-2-configuration) above |
937
938
 
938
- ```
939
- node_modules/.bin/tsc: line 1: ../typescript/bin/tsc: not found
940
- ```
939
+ </details>
941
940
 
942
- **Cause**: Corrupted Docker build cache.
941
+ ---
943
942
 
944
- **Fix**: Clear the cache and rebuild:
945
- ```bash
946
- docker builder prune -f
947
- docker compose -f deepcode_docker/docker-compose.yml build --no-cache
948
- docker compose -f deepcode_docker/docker-compose.yml up -d
943
+ ## 🤖 nanobot Integration (Feishu Chatbot)
944
+
945
+ > Chat with DeepCode from **Feishu** — powered by [nanobot](https://github.com/HKUDS/nanobot).
946
+
947
+ <div align="center">
948
+
949
+ ```mermaid
950
+ flowchart LR
951
+ subgraph Clients["💬 Chat Platforms"]
952
+ direction TB
953
+ F["<b>Feishu</b><br/>WebSocket"]
954
+ T["<b>Telegram</b><br/>Polling"]
955
+ D["<b>Discord</b><br/>Gateway"]
956
+ end
957
+
958
+ subgraph Gateway["🐈 nanobot Gateway"]
959
+ direction TB
960
+ A["Agent Loop<br/><i>LLM + Tool Calls</i>"]
961
+ end
962
+
963
+ subgraph Engine["🧠 DeepCode Engine"]
964
+ direction TB
965
+ P2C["Paper → Code"]
966
+ C2C["Chat → Code"]
967
+ TRK["Task Tracking"]
968
+ end
969
+
970
+ F & T & D <-->|"messages"| A
971
+ A -->|"HTTP API"| P2C & C2C & TRK
972
+ A -.->|"LLM API"| LLM["☁️ OpenRouter"]
973
+
974
+ style Clients fill:#1a1a2e,stroke:#00d9ff,color:#fff
975
+ style Gateway fill:#1a1a2e,stroke:#4ecdc4,color:#fff
976
+ style Engine fill:#1a1a2e,stroke:#ff6b6b,color:#fff
977
+ style LLM fill:#1a1a2e,stroke:#9b59b6,color:#fff
949
978
  ```
950
979
 
951
- #### 🐳 Docker command returns `error during connect` / `cannot find the file specified`
980
+ </div>
952
981
 
953
- **Cause**: Docker Desktop is not running.
982
+ <div align="center">
983
+ <table><tr>
984
+ <td align="center"><a href="https://github.com/HKUDS/DeepCode"><img src="./assets/logo.png" alt="DeepCode" height="55"/></a></td>
985
+ <td align="center"><h2>✦</h2></td>
986
+ <td align="center"><a href="https://github.com/HKUDS/nanobot"><img src="./assets/nanobot.png" alt="nanobot" height="55"/></a></td>
987
+ </tr></table>
988
+ </div>
989
+
990
+ Both services run inside the same **Docker Compose** network. Prerequisites: **Docker Desktop** + **OpenRouter API Key** ([get one](https://openrouter.ai/keys)) + **Feishu App**.
991
+
992
+ ---
954
993
 
955
- **Fix**: Start **Docker Desktop** from the Start menu (Windows) or Applications (macOS), wait until it's fully ready, then retry.
994
+ ### Step 1 · Create a Feishu Bot
956
995
 
957
- #### 🌐 Frontend displays abnormally or shows a blank page
996
+ <details open>
997
+ <summary><b>Feishu / Lark</b> (Recommended — WebSocket, no public IP needed)</summary>
958
998
 
959
- **Cause**: Corrupted `node_modules` — frontend dependencies are incomplete.
999
+ 1. Go to [Feishu Open Platform](https://open.feishu.cn/app) → **Create Custom App**
1000
+ 2. Enable **Bot** capability in App Features
1001
+ 3. Add permissions: `im:message` · `im:message:send_as_bot`
1002
+ 4. Event Subscription → select **Long Connection** → add `im.message.receive_v1`
1003
+ 5. Note your **App ID** (`cli_xxx`) and **App Secret** → Publish the app
1004
+
1005
+ > **Note**: Feishu requires an active WebSocket connection before you can save "Long Connection" mode. Start nanobot first (Step 3), then come back to configure Event Subscription.
1006
+
1007
+ </details>
1008
+
1009
+ ### Step 2 · Configure
960
1010
 
961
- **Fix**: Reinstall frontend dependencies:
962
1011
  ```bash
963
- cd new_ui/frontend
964
- rm -rf node_modules
965
- npm install
1012
+ cp nanobot_config.json.example nanobot_config.json
966
1013
  ```
967
1014
 
968
- Then rebuild (for Docker) or restart (for local mode).
1015
+ Edit `nanobot_config.json` — fill in the 3 required fields:
1016
+
1017
+ ```jsonc
1018
+ {
1019
+ "channels": {
1020
+ "feishu": {
1021
+ "enabled": true,
1022
+ "appId": "cli_xxx", // ← Feishu App ID
1023
+ "appSecret": "xxx", // ← Feishu App Secret
1024
+ "allowFrom": [] // [] = allow all users
1025
+ }
1026
+ },
1027
+ "providers": {
1028
+ "openrouter": {
1029
+ "apiKey": "sk-or-v1-xxx" // ← OpenRouter API Key
1030
+ }
1031
+ },
1032
+ "agents": {
1033
+ "defaults": {
1034
+ "model": "anthropic/claude-sonnet-4-20250514"
1035
+ }
1036
+ }
1037
+ }
1038
+ ```
1039
+
1040
+ > **Model choice**: Any model on [openrouter.ai/models](https://openrouter.ai/models). Use `anthropic/claude-sonnet-4-20250514` for English, `minimax/minimax-m2.1` for Chinese.
1041
+
1042
+ ---
1043
+
1044
+ ### Step 3 · Launch
1045
+
1046
+ Make sure `mcp_agent.secrets.yaml` has your DeepCode API keys (see [Configuration](#-step-2-configuration)), then:
969
1047
 
970
- #### 🌐 Browser shows `ERR_CONNECTION_REFUSED` or JSON response instead of UI
1048
+ ```bash
1049
+ ./nanobot/run_nanobot.sh -d # Start both DeepCode + nanobot in background
1050
+ ```
971
1051
 
972
- **Cause**: Accessing the wrong port or backend not running.
1052
+ The script checks Docker, validates configs, builds images (first run only), and starts both containers.
973
1053
 
974
- **Fix**:
975
- - **Docker mode** (`deepcode`): Access **http://localhost:8000**. Make sure the container is running: `docker ps`
976
- - **Local mode** (`deepcode --local`): Access **http://localhost:5173** (not 8000). Port 5173 is the frontend dev server.
1054
+ ```
1055
+ ✓ DeepCode API: http://localhost:8000
1056
+ ✓ Nanobot: http://localhost:18790
1057
+ ```
977
1058
 
978
- #### 📦 `npm install` fails with `Could not read package.json`
1059
+ Now open Feishu → find your bot → send a message!
979
1060
 
980
- **Cause**: Running `npm install` in the project root instead of the frontend directory.
1061
+ <details>
1062
+ <summary><b>Management Commands</b></summary>
981
1063
 
982
- **Fix**: Run it in the correct directory:
983
1064
  ```bash
984
- npm install --prefix new_ui/frontend
1065
+ ./nanobot/run_nanobot.sh # Start (foreground)
1066
+ ./nanobot/run_nanobot.sh -d # Start (background)
1067
+ ./nanobot/run_nanobot.sh stop # Stop all services
1068
+ ./nanobot/run_nanobot.sh restart # Restart (config changes take effect immediately)
1069
+ ./nanobot/run_nanobot.sh --build # Force rebuild Docker images
1070
+ ./nanobot/run_nanobot.sh logs # View real-time logs
1071
+ ./nanobot/run_nanobot.sh status # Health check
1072
+ ./nanobot/run_nanobot.sh clean # Remove containers & images
985
1073
  ```
986
1074
 
987
- #### 🪟 Windows: MCP servers not working
1075
+ </details>
1076
+
1077
+ <details>
1078
+ <summary><b>Troubleshooting</b></summary>
988
1079
 
989
- See the [Windows MCP Server Configuration](#-step-2-configuration) section above for setting up absolute paths.
1080
+ | Problem | Fix |
1081
+ |---|---|
1082
+ | Feishu bot doesn't respond | Check logs (`./nanobot/run_nanobot.sh logs`), verify `appId`/`appSecret`, ensure app is published with Long Connection mode |
1083
+ | Can't connect to DeepCode | Verify `deepcode` container is healthy: `curl http://localhost:8000/health` |
1084
+ | Wrong language output | Switch model — `minimax-m2.1` defaults to Chinese, use Claude/GPT for English |
1085
+ | Config not taking effect | Just restart: `./nanobot/run_nanobot.sh restart` (no rebuild needed) |
1086
+ | Clear chat history | Send `/clear` in chat, or: `docker exec nanobot sh -c 'rm -rf /root/.nanobot/sessions/*.jsonl'` |
990
1087
 
991
1088
  </details>
992
1089
 
993
- ---
1090
+ ---
994
1091
 
995
1092
  ## 💡 Examples
996
1093