deepcode-hku 1.0.1__tar.gz → 1.0.2__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.
- {deepcode_hku-1.0.1/deepcode_hku.egg-info → deepcode_hku-1.0.2}/PKG-INFO +35 -7
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/README.md +33 -5
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/__init__.py +1 -5
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode.py +3 -3
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2/deepcode_hku.egg-info}/PKG-INFO +35 -7
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/mcp_agent.config.yaml +6 -6
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/setup.py +2 -2
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/code_indexer.py +128 -70
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/pdf_downloader.py +133 -134
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/styles.py +394 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/agent_orchestration_engine.py +16 -14
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/codebase_index_workflow.py +1 -1
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/.pre-commit-config.yaml +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/LICENSE +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/MANIFEST.in +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/cli_app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/cli_interface.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/cli_launcher.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/main_cli.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/workflows/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/cli/workflows/cli_workflow_adapter.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode_hku.egg-info/SOURCES.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode_hku.egg-info/dependency_links.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode_hku.egg-info/entry_points.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode_hku.egg-info/requires.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/deepcode_hku.egg-info/top_level.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/mcp_agent.secrets.yaml +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/prompts/code_prompts.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/requirements.txt +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/schema/mcp-agent.config.schema.json +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/setup.cfg +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/code_implementation_server.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/code_reference_indexer.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/command_executor.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/git_command.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/pdf_converter.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/tools/pdf_utils.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/components.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/handlers.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/layout.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/ui/streamlit_app.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/utils/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/utils/cli_interface.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/utils/dialogue_logger.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/utils/file_processor.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/utils/simple_llm_logger.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/agents/__init__.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/agents/code_implementation_agent.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/agents/memory_agent_concise.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/agents/memory_agent_concise_index.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/code_implementation_workflow.py +0 -0
- {deepcode_hku-1.0.1 → deepcode_hku-1.0.2}/workflows/code_implementation_workflow_index.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepcode-hku
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.2
|
|
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
|
|
7
7
|
Project-URL: Documentation, https://github.com/HKUDS/DeepCode
|
|
@@ -76,7 +76,7 @@ Dynamic: summary
|
|
|
76
76
|
<p>
|
|
77
77
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
78
78
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
79
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
79
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
80
80
|
</p>
|
|
81
81
|
<p>
|
|
82
82
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -288,11 +288,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
288
288
|
|
|
289
289
|
### 🔧 **Core Techniques**
|
|
290
290
|
|
|
291
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
291
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
292
292
|
|
|
293
|
-
-
|
|
293
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
294
294
|
|
|
295
|
-
-
|
|
295
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
|
@@ -455,7 +455,7 @@ Implementation Generation • Testing • Documentation
|
|
|
455
455
|
|
|
456
456
|
```bash
|
|
457
457
|
# 🚀 Install DeepCode package directly
|
|
458
|
-
pip install deepcode
|
|
458
|
+
pip install deepcode-hku
|
|
459
459
|
|
|
460
460
|
# 🔑 Download configuration files
|
|
461
461
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -520,6 +520,34 @@ pip install -r requirements.txt
|
|
|
520
520
|
|
|
521
521
|
</details>
|
|
522
522
|
|
|
523
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
524
|
+
|
|
525
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
# 1. Install MCP servers globally
|
|
529
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
530
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
531
|
+
|
|
532
|
+
# 2. Find your global node_modules path
|
|
533
|
+
npm -g root
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
537
|
+
|
|
538
|
+
```yaml
|
|
539
|
+
mcp:
|
|
540
|
+
servers:
|
|
541
|
+
brave:
|
|
542
|
+
command: "node"
|
|
543
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
544
|
+
filesystem:
|
|
545
|
+
command: "node"
|
|
546
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
550
|
+
|
|
523
551
|
### ⚡ **Step 2: Launch Application**
|
|
524
552
|
|
|
525
553
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<p>
|
|
33
33
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
34
34
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
35
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
35
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
36
36
|
</p>
|
|
37
37
|
<p>
|
|
38
38
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -244,11 +244,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
244
244
|
|
|
245
245
|
### 🔧 **Core Techniques**
|
|
246
246
|
|
|
247
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
247
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
248
248
|
|
|
249
|
-
-
|
|
249
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
250
250
|
|
|
251
|
-
-
|
|
251
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
252
252
|
|
|
253
253
|
---
|
|
254
254
|
|
|
@@ -411,7 +411,7 @@ Implementation Generation • Testing • Documentation
|
|
|
411
411
|
|
|
412
412
|
```bash
|
|
413
413
|
# 🚀 Install DeepCode package directly
|
|
414
|
-
pip install deepcode
|
|
414
|
+
pip install deepcode-hku
|
|
415
415
|
|
|
416
416
|
# 🔑 Download configuration files
|
|
417
417
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -476,6 +476,34 @@ pip install -r requirements.txt
|
|
|
476
476
|
|
|
477
477
|
</details>
|
|
478
478
|
|
|
479
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
480
|
+
|
|
481
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
482
|
+
|
|
483
|
+
```bash
|
|
484
|
+
# 1. Install MCP servers globally
|
|
485
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
486
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
487
|
+
|
|
488
|
+
# 2. Find your global node_modules path
|
|
489
|
+
npm -g root
|
|
490
|
+
```
|
|
491
|
+
|
|
492
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
493
|
+
|
|
494
|
+
```yaml
|
|
495
|
+
mcp:
|
|
496
|
+
servers:
|
|
497
|
+
brave:
|
|
498
|
+
command: "node"
|
|
499
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
500
|
+
filesystem:
|
|
501
|
+
command: "node"
|
|
502
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
503
|
+
```
|
|
504
|
+
|
|
505
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
506
|
+
|
|
479
507
|
### ⚡ **Step 2: Launch Application**
|
|
480
508
|
|
|
481
509
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -5,12 +5,9 @@ DeepCode - AI Research Engine
|
|
|
5
5
|
⚡ Transform research papers into working code automatically
|
|
6
6
|
"""
|
|
7
7
|
|
|
8
|
-
__version__ = "1.0.
|
|
8
|
+
__version__ = "1.0.2"
|
|
9
9
|
__author__ = "DeepCode Team"
|
|
10
10
|
__url__ = "https://github.com/HKUDS/DeepCode"
|
|
11
|
-
__description__ = (
|
|
12
|
-
"AI Research Engine - Transform research papers into working code automatically"
|
|
13
|
-
)
|
|
14
11
|
|
|
15
12
|
# Import main components for easy access
|
|
16
13
|
from utils import FileProcessor, DialogueLogger
|
|
@@ -21,5 +18,4 @@ __all__ = [
|
|
|
21
18
|
"__version__",
|
|
22
19
|
"__author__",
|
|
23
20
|
"__url__",
|
|
24
|
-
"__description__",
|
|
25
21
|
]
|
|
@@ -190,11 +190,11 @@ def main():
|
|
|
190
190
|
"--theme.base",
|
|
191
191
|
"dark",
|
|
192
192
|
"--theme.primaryColor",
|
|
193
|
-
"#
|
|
193
|
+
"#3b82f6",
|
|
194
194
|
"--theme.backgroundColor",
|
|
195
|
-
"#
|
|
195
|
+
"#0f1419",
|
|
196
196
|
"--theme.secondaryBackgroundColor",
|
|
197
|
-
"#
|
|
197
|
+
"#1e293b",
|
|
198
198
|
]
|
|
199
199
|
|
|
200
200
|
subprocess.run(cmd, check=True)
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: deepcode-hku
|
|
3
|
-
Version: 1.0.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 1.0.2
|
|
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
|
|
7
7
|
Project-URL: Documentation, https://github.com/HKUDS/DeepCode
|
|
@@ -76,7 +76,7 @@ Dynamic: summary
|
|
|
76
76
|
<p>
|
|
77
77
|
<a href="https://github.com/HKUDS/DeepCode/stargazers"><img src='https://img.shields.io/github/stars/HKUDS/DeepCode?color=00d9ff&style=for-the-badge&logo=star&logoColor=white&labelColor=1a1a2e' /></a>
|
|
78
78
|
<img src="https://img.shields.io/badge/🐍Python-3.13-4ecdc4?style=for-the-badge&logo=python&logoColor=white&labelColor=1a1a2e">
|
|
79
|
-
<a href="https://pypi.org/project/deepcode/"><img src="https://img.shields.io/pypi/v/deepcode.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
79
|
+
<a href="https://pypi.org/project/deepcode-hku/"><img src="https://img.shields.io/pypi/v/deepcode-hku.svg?style=for-the-badge&logo=pypi&logoColor=white&labelColor=1a1a2e&color=ff6b6b"></a>
|
|
80
80
|
</p>
|
|
81
81
|
<p>
|
|
82
82
|
<a href="https://discord.gg/yF2MmDJyGJ"><img src="https://img.shields.io/badge/💬Discord-Community-7289da?style=for-the-badge&logo=discord&logoColor=white&labelColor=1a1a2e"></a>
|
|
@@ -288,11 +288,11 @@ Advanced retrieval-augmented generation combining semantic vector embeddings wit
|
|
|
288
288
|
|
|
289
289
|
### 🔧 **Core Techniques**
|
|
290
290
|
|
|
291
|
-
- 🧠 **Intelligent Orchestration Agent
|
|
291
|
+
- 🧠 **Intelligent Orchestration Agent**: Central decision-making system that coordinates workflow phases and analyzes requirements. Employs dynamic planning algorithms to adapt execution strategies in real-time based on evolving project complexity. Dynamically selects optimal processing strategies for each implementation step. <br>
|
|
292
292
|
|
|
293
|
-
-
|
|
293
|
+
- 💾 **Efficient Memory Mechanism**: Advanced context engineering system that manages large-scale code contexts efficiently. Implements hierarchical memory structures with intelligent compression for handling complex codebases. This component enables instant retrieval of implementation patterns and maintains semantic coherence across extended development sessions. <br>
|
|
294
294
|
|
|
295
|
-
-
|
|
295
|
+
- 🔍 **Advanced CodeRAG System**: Global code comprehension engine that analyzes complex inter-dependencies across repositories. Performs cross-codebase relationship mapping to understand architectural patterns from a holistic perspective. This module leverages dependency graphs and semantic analysis to provide globally-aware code recommendations during implementation.
|
|
296
296
|
|
|
297
297
|
---
|
|
298
298
|
|
|
@@ -455,7 +455,7 @@ Implementation Generation • Testing • Documentation
|
|
|
455
455
|
|
|
456
456
|
```bash
|
|
457
457
|
# 🚀 Install DeepCode package directly
|
|
458
|
-
pip install deepcode
|
|
458
|
+
pip install deepcode-hku
|
|
459
459
|
|
|
460
460
|
# 🔑 Download configuration files
|
|
461
461
|
curl -O https://raw.githubusercontent.com/HKUDS/DeepCode/main/mcp_agent.config.yaml
|
|
@@ -520,6 +520,34 @@ pip install -r requirements.txt
|
|
|
520
520
|
|
|
521
521
|
</details>
|
|
522
522
|
|
|
523
|
+
#### 🪟 **Windows Users: Additional MCP Server Configuration**
|
|
524
|
+
|
|
525
|
+
If you're using Windows, you may need to configure MCP servers manually in `mcp_agent.config.yaml`:
|
|
526
|
+
|
|
527
|
+
```bash
|
|
528
|
+
# 1. Install MCP servers globally
|
|
529
|
+
npm i -g @modelcontextprotocol/server-brave-search
|
|
530
|
+
npm i -g @modelcontextprotocol/server-filesystem
|
|
531
|
+
|
|
532
|
+
# 2. Find your global node_modules path
|
|
533
|
+
npm -g root
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
Then update your `mcp_agent.config.yaml` to use absolute paths:
|
|
537
|
+
|
|
538
|
+
```yaml
|
|
539
|
+
mcp:
|
|
540
|
+
servers:
|
|
541
|
+
brave:
|
|
542
|
+
command: "node"
|
|
543
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-brave-search/dist/index.js"]
|
|
544
|
+
filesystem:
|
|
545
|
+
command: "node"
|
|
546
|
+
args: ["C:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js", "."]
|
|
547
|
+
```
|
|
548
|
+
|
|
549
|
+
> **Note**: Replace the path with your actual global node_modules path from step 2.
|
|
550
|
+
|
|
523
551
|
### ⚡ **Step 2: Launch Application**
|
|
524
552
|
|
|
525
553
|
#### 🚀 **Using Installed Package (Recommended)**
|
|
@@ -31,35 +31,35 @@ mcp:
|
|
|
31
31
|
# Use `npm i -g @modelcontextprotocol/server-filesystem` to install the server globally.
|
|
32
32
|
# Use `npm -g root` to find the global node_modules path.`
|
|
33
33
|
# command: "node"
|
|
34
|
-
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","
|
|
34
|
+
# args: ["c:/Program Files/nodejs/node_modules/@modelcontextprotocol/server-filesystem/dist/index.js","."]
|
|
35
35
|
command: "npx"
|
|
36
36
|
args: ["-y", "@modelcontextprotocol/server-filesystem"]
|
|
37
37
|
fetch:
|
|
38
38
|
command: "uvx"
|
|
39
39
|
args: ["mcp-server-fetch"]
|
|
40
40
|
github-downloader:
|
|
41
|
-
command: "
|
|
41
|
+
command: "python"
|
|
42
42
|
args: ["tools/git_command.py"]
|
|
43
43
|
env:
|
|
44
44
|
PYTHONPATH: "."
|
|
45
45
|
file-downloader:
|
|
46
|
-
command: "
|
|
46
|
+
command: "python"
|
|
47
47
|
args: ["tools/pdf_downloader.py"]
|
|
48
48
|
env:
|
|
49
49
|
PYTHONPATH: "."
|
|
50
50
|
command-executor:
|
|
51
|
-
command: "
|
|
51
|
+
command: "python"
|
|
52
52
|
args: ["tools/command_executor.py"]
|
|
53
53
|
env:
|
|
54
54
|
PYTHONPATH: "."
|
|
55
55
|
code-implementation:
|
|
56
|
-
command: "
|
|
56
|
+
command: "python"
|
|
57
57
|
args: ["tools/code_implementation_server.py"]
|
|
58
58
|
env:
|
|
59
59
|
PYTHONPATH: "."
|
|
60
60
|
description: "Paper code reproduction tool server - provides file operations, code execution, search and other functions"
|
|
61
61
|
code-reference-indexer:
|
|
62
|
-
command: "
|
|
62
|
+
command: "python"
|
|
63
63
|
args: ["tools/code_reference_indexer.py"]
|
|
64
64
|
env:
|
|
65
65
|
PYTHONPATH: "."
|
|
@@ -13,7 +13,7 @@ def read_long_description():
|
|
|
13
13
|
|
|
14
14
|
# Retrieving metadata from __init__.py
|
|
15
15
|
def retrieve_metadata():
|
|
16
|
-
vars2find = ["__author__", "__version__", "__url__"
|
|
16
|
+
vars2find = ["__author__", "__version__", "__url__"]
|
|
17
17
|
vars2readme = {}
|
|
18
18
|
|
|
19
19
|
# Use definitive path relative to setup.py location
|
|
@@ -62,7 +62,7 @@ setuptools.setup(
|
|
|
62
62
|
url=metadata["__url__"],
|
|
63
63
|
version=metadata["__version__"],
|
|
64
64
|
author=metadata["__author__"],
|
|
65
|
-
description=
|
|
65
|
+
description="AI Research Engine - Transform research papers into working code automatically",
|
|
66
66
|
long_description=long_description,
|
|
67
67
|
long_description_content_type="text/markdown",
|
|
68
68
|
packages=setuptools.find_packages(
|
|
@@ -6,10 +6,11 @@ identifying file relationships and reusable components for implementation.
|
|
|
6
6
|
|
|
7
7
|
Features:
|
|
8
8
|
- Recursive file traversal
|
|
9
|
-
- LLM-powered code similarity analysis
|
|
9
|
+
- LLM-powered code similarity analysis using augmented LLM classes
|
|
10
10
|
- JSON-based relationship storage
|
|
11
11
|
- Configurable matching strategies
|
|
12
12
|
- Progress tracking and error handling
|
|
13
|
+
- Automatic LLM provider selection based on API key availability
|
|
13
14
|
"""
|
|
14
15
|
|
|
15
16
|
import asyncio
|
|
@@ -22,6 +23,78 @@ from pathlib import Path
|
|
|
22
23
|
from dataclasses import dataclass, asdict
|
|
23
24
|
from typing import List, Dict, Any
|
|
24
25
|
|
|
26
|
+
# MCP Agent imports for LLM
|
|
27
|
+
from mcp_agent.workflows.llm.augmented_llm_anthropic import AnthropicAugmentedLLM
|
|
28
|
+
from mcp_agent.workflows.llm.augmented_llm_openai import OpenAIAugmentedLLM
|
|
29
|
+
import yaml
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def get_preferred_llm_class(config_path: str = "mcp_agent.secrets.yaml"):
|
|
33
|
+
"""
|
|
34
|
+
Automatically select the LLM class based on API key availability in configuration.
|
|
35
|
+
|
|
36
|
+
Reads from YAML config file and returns AnthropicAugmentedLLM if anthropic.api_key
|
|
37
|
+
is available, otherwise returns OpenAIAugmentedLLM.
|
|
38
|
+
|
|
39
|
+
Args:
|
|
40
|
+
config_path: Path to the YAML configuration file
|
|
41
|
+
|
|
42
|
+
Returns:
|
|
43
|
+
class: The preferred LLM class
|
|
44
|
+
"""
|
|
45
|
+
try:
|
|
46
|
+
# Try to read the configuration file
|
|
47
|
+
if os.path.exists(config_path):
|
|
48
|
+
with open(config_path, "r", encoding="utf-8") as f:
|
|
49
|
+
config = yaml.safe_load(f)
|
|
50
|
+
|
|
51
|
+
# Check for anthropic API key in config
|
|
52
|
+
anthropic_config = config.get("anthropic", {})
|
|
53
|
+
anthropic_key = anthropic_config.get("api_key", "")
|
|
54
|
+
|
|
55
|
+
if anthropic_key and anthropic_key.strip() and not anthropic_key == "":
|
|
56
|
+
return AnthropicAugmentedLLM
|
|
57
|
+
else:
|
|
58
|
+
return OpenAIAugmentedLLM
|
|
59
|
+
else:
|
|
60
|
+
print(f"🤖 Config file {config_path} not found, using OpenAIAugmentedLLM")
|
|
61
|
+
return OpenAIAugmentedLLM
|
|
62
|
+
|
|
63
|
+
except Exception as e:
|
|
64
|
+
print(f"🤖 Error reading config file {config_path}: {e}")
|
|
65
|
+
print("🤖 Falling back to OpenAIAugmentedLLM")
|
|
66
|
+
return OpenAIAugmentedLLM
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def get_default_models(config_path: str = "mcp_agent.config.yaml"):
|
|
70
|
+
"""
|
|
71
|
+
Get default models from configuration file.
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
config_path: Path to the configuration file
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
dict: Dictionary with 'anthropic' and 'openai' default models
|
|
78
|
+
"""
|
|
79
|
+
try:
|
|
80
|
+
if os.path.exists(config_path):
|
|
81
|
+
with open(config_path, "r", encoding="utf-8") as f:
|
|
82
|
+
config = yaml.safe_load(f)
|
|
83
|
+
|
|
84
|
+
anthropic_model = config.get("anthropic", {}).get(
|
|
85
|
+
"default_model", "claude-sonnet-4-20250514"
|
|
86
|
+
)
|
|
87
|
+
openai_model = config.get("openai", {}).get("default_model", "o3-mini")
|
|
88
|
+
|
|
89
|
+
return {"anthropic": anthropic_model, "openai": openai_model}
|
|
90
|
+
else:
|
|
91
|
+
print(f"Config file {config_path} not found, using default models")
|
|
92
|
+
return {"anthropic": "claude-sonnet-4-20250514", "openai": "o3-mini"}
|
|
93
|
+
|
|
94
|
+
except Exception as e:
|
|
95
|
+
print(f"Error reading config file {config_path}: {e}")
|
|
96
|
+
return {"anthropic": "claude-sonnet-4-20250514", "openai": "o3-mini"}
|
|
97
|
+
|
|
25
98
|
|
|
26
99
|
@dataclass
|
|
27
100
|
class FileRelationship:
|
|
@@ -78,6 +151,7 @@ class CodeIndexer:
|
|
|
78
151
|
self.indexer_config_path = indexer_config_path
|
|
79
152
|
self.api_config = self._load_api_config()
|
|
80
153
|
self.indexer_config = self._load_indexer_config()
|
|
154
|
+
self.default_models = get_default_models("mcp_agent.config.yaml")
|
|
81
155
|
|
|
82
156
|
# Use config paths if not provided as parameters
|
|
83
157
|
paths_config = self.indexer_config.get("paths", {})
|
|
@@ -301,7 +375,7 @@ class CodeIndexer:
|
|
|
301
375
|
return {}
|
|
302
376
|
|
|
303
377
|
async def _initialize_llm_client(self):
|
|
304
|
-
"""Initialize LLM client based on
|
|
378
|
+
"""Initialize LLM client (Anthropic or OpenAI) based on API key availability"""
|
|
305
379
|
if self.llm_client is not None:
|
|
306
380
|
return self.llm_client, self.llm_client_type
|
|
307
381
|
|
|
@@ -312,89 +386,65 @@ class CodeIndexer:
|
|
|
312
386
|
self.llm_client_type = "mock"
|
|
313
387
|
return "mock", "mock"
|
|
314
388
|
|
|
315
|
-
#
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
anthropic_key = self.api_config.get("anthropic", {}).get("api_key")
|
|
319
|
-
if anthropic_key:
|
|
320
|
-
from anthropic import AsyncAnthropic
|
|
321
|
-
|
|
322
|
-
client = AsyncAnthropic(api_key=anthropic_key)
|
|
323
|
-
# Test connection
|
|
324
|
-
await client.messages.create(
|
|
325
|
-
model="claude-sonnet-4-20250514",
|
|
326
|
-
max_tokens=10,
|
|
327
|
-
messages=[{"role": "user", "content": "test"}],
|
|
328
|
-
)
|
|
329
|
-
self.logger.info("Using Anthropic API for code analysis")
|
|
330
|
-
self.llm_client = client
|
|
331
|
-
self.llm_client_type = "anthropic"
|
|
332
|
-
return client, "anthropic"
|
|
333
|
-
except Exception as e:
|
|
334
|
-
self.logger.warning(f"Configured Anthropic API unavailable: {e}")
|
|
389
|
+
# Check which API has available key and try that first
|
|
390
|
+
anthropic_key = self.api_config.get("anthropic", {}).get("api_key", "")
|
|
391
|
+
openai_key = self.api_config.get("openai", {}).get("api_key", "")
|
|
335
392
|
|
|
336
|
-
|
|
393
|
+
# Try Anthropic API first if key is available
|
|
394
|
+
if anthropic_key and anthropic_key.strip():
|
|
337
395
|
try:
|
|
338
|
-
openai_key = self.api_config.get("openai", {}).get("api_key")
|
|
339
|
-
if openai_key:
|
|
340
|
-
from openai import AsyncOpenAI
|
|
341
|
-
|
|
342
|
-
client = AsyncOpenAI(api_key=openai_key)
|
|
343
|
-
# Test connection
|
|
344
|
-
await client.chat.completions.create(
|
|
345
|
-
model="gpt-3.5-turbo",
|
|
346
|
-
max_tokens=10,
|
|
347
|
-
messages=[{"role": "user", "content": "test"}],
|
|
348
|
-
)
|
|
349
|
-
self.logger.info("Using OpenAI API for code analysis")
|
|
350
|
-
self.llm_client = client
|
|
351
|
-
self.llm_client_type = "openai"
|
|
352
|
-
return client, "openai"
|
|
353
|
-
except Exception as e:
|
|
354
|
-
self.logger.warning(f"Configured OpenAI API unavailable: {e}")
|
|
355
|
-
|
|
356
|
-
# Fallback: try other provider
|
|
357
|
-
self.logger.info("Trying fallback provider...")
|
|
358
|
-
|
|
359
|
-
# Try Anthropic as fallback
|
|
360
|
-
try:
|
|
361
|
-
anthropic_key = self.api_config.get("anthropic", {}).get("api_key")
|
|
362
|
-
if anthropic_key:
|
|
363
396
|
from anthropic import AsyncAnthropic
|
|
364
397
|
|
|
365
398
|
client = AsyncAnthropic(api_key=anthropic_key)
|
|
399
|
+
# Test connection with default model from config
|
|
366
400
|
await client.messages.create(
|
|
367
|
-
model="
|
|
401
|
+
model=self.default_models["anthropic"],
|
|
368
402
|
max_tokens=10,
|
|
369
403
|
messages=[{"role": "user", "content": "test"}],
|
|
370
404
|
)
|
|
371
|
-
self.logger.info(
|
|
405
|
+
self.logger.info(
|
|
406
|
+
f"Using Anthropic API with model: {self.default_models['anthropic']}"
|
|
407
|
+
)
|
|
372
408
|
self.llm_client = client
|
|
373
409
|
self.llm_client_type = "anthropic"
|
|
374
410
|
return client, "anthropic"
|
|
375
|
-
|
|
376
|
-
|
|
411
|
+
except Exception as e:
|
|
412
|
+
self.logger.warning(f"Anthropic API unavailable: {e}")
|
|
377
413
|
|
|
378
|
-
# Try OpenAI
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
if openai_key:
|
|
414
|
+
# Try OpenAI API if Anthropic failed or key not available
|
|
415
|
+
if openai_key and openai_key.strip():
|
|
416
|
+
try:
|
|
382
417
|
from openai import AsyncOpenAI
|
|
383
418
|
|
|
384
|
-
|
|
419
|
+
# Handle custom base_url if specified
|
|
420
|
+
openai_config = self.api_config.get("openai", {})
|
|
421
|
+
base_url = openai_config.get("base_url")
|
|
422
|
+
|
|
423
|
+
if base_url:
|
|
424
|
+
client = AsyncOpenAI(api_key=openai_key, base_url=base_url)
|
|
425
|
+
else:
|
|
426
|
+
client = AsyncOpenAI(api_key=openai_key)
|
|
427
|
+
|
|
428
|
+
# Test connection with default model from config
|
|
385
429
|
await client.chat.completions.create(
|
|
386
|
-
model=
|
|
430
|
+
model=self.default_models["openai"],
|
|
387
431
|
max_tokens=10,
|
|
388
432
|
messages=[{"role": "user", "content": "test"}],
|
|
389
433
|
)
|
|
390
|
-
self.logger.info(
|
|
434
|
+
self.logger.info(
|
|
435
|
+
f"Using OpenAI API with model: {self.default_models['openai']}"
|
|
436
|
+
)
|
|
437
|
+
if base_url:
|
|
438
|
+
self.logger.info(f"Using custom base URL: {base_url}")
|
|
391
439
|
self.llm_client = client
|
|
392
440
|
self.llm_client_type = "openai"
|
|
393
441
|
return client, "openai"
|
|
394
|
-
|
|
395
|
-
|
|
442
|
+
except Exception as e:
|
|
443
|
+
self.logger.warning(f"OpenAI API unavailable: {e}")
|
|
396
444
|
|
|
397
|
-
raise ValueError(
|
|
445
|
+
raise ValueError(
|
|
446
|
+
"No available LLM API - please check your API keys in configuration"
|
|
447
|
+
)
|
|
398
448
|
|
|
399
449
|
async def _call_llm(
|
|
400
450
|
self, prompt: str, system_prompt: str = None, max_tokens: int = None
|
|
@@ -426,7 +476,7 @@ class CodeIndexer:
|
|
|
426
476
|
|
|
427
477
|
if client_type == "anthropic":
|
|
428
478
|
response = await client.messages.create(
|
|
429
|
-
model="
|
|
479
|
+
model=self.default_models["anthropic"],
|
|
430
480
|
system=system_prompt,
|
|
431
481
|
messages=[{"role": "user", "content": prompt}],
|
|
432
482
|
max_tokens=max_tokens,
|
|
@@ -451,7 +501,7 @@ class CodeIndexer:
|
|
|
451
501
|
]
|
|
452
502
|
|
|
453
503
|
response = await client.chat.completions.create(
|
|
454
|
-
model="
|
|
504
|
+
model=self.default_models["openai"],
|
|
455
505
|
messages=messages,
|
|
456
506
|
max_tokens=max_tokens,
|
|
457
507
|
temperature=self.llm_temperature,
|
|
@@ -1043,7 +1093,7 @@ class CodeIndexer:
|
|
|
1043
1093
|
if r.confidence_score > self.high_confidence_threshold
|
|
1044
1094
|
]
|
|
1045
1095
|
),
|
|
1046
|
-
"analyzer_version": "1.
|
|
1096
|
+
"analyzer_version": "1.4.0", # Updated version to reflect augmented LLM support
|
|
1047
1097
|
"pre_filtering_enabled": self.enable_pre_filtering,
|
|
1048
1098
|
"files_before_filtering": len(all_files),
|
|
1049
1099
|
"files_after_filtering": len(files_to_analyze),
|
|
@@ -1373,7 +1423,7 @@ class CodeIndexer:
|
|
|
1373
1423
|
# Build statistics report
|
|
1374
1424
|
statistics_report = {
|
|
1375
1425
|
"report_generation_time": datetime.now().isoformat(),
|
|
1376
|
-
"analyzer_version": "1.
|
|
1426
|
+
"analyzer_version": "1.4.0",
|
|
1377
1427
|
"configuration_used": {
|
|
1378
1428
|
"config_file": self.indexer_config_path,
|
|
1379
1429
|
"concurrent_analysis_enabled": self.enable_concurrent_analysis,
|
|
@@ -1481,11 +1531,14 @@ async def main():
|
|
|
1481
1531
|
"""Main function to run the code indexer with full configuration support"""
|
|
1482
1532
|
|
|
1483
1533
|
# Configuration - can be overridden by config file
|
|
1484
|
-
config_file = "
|
|
1534
|
+
config_file = "DeepCode/tools/indexer_config.yaml"
|
|
1535
|
+
api_config_file = "DeepCode/mcp_agent.secrets.yaml"
|
|
1485
1536
|
|
|
1486
1537
|
# You can override these parameters or let them be read from config
|
|
1487
|
-
code_base_path =
|
|
1488
|
-
output_dir =
|
|
1538
|
+
code_base_path = "DeepCode/deepcode_lab/papers/1/code_base/" # Will use config file value if None
|
|
1539
|
+
output_dir = (
|
|
1540
|
+
"DeepCode/deepcode_lab/papers/1/indexes/" # Will use config file value if None
|
|
1541
|
+
)
|
|
1489
1542
|
|
|
1490
1543
|
# Target structure - this should be customized for your specific project
|
|
1491
1544
|
target_structure = """
|
|
@@ -1526,6 +1579,7 @@ async def main():
|
|
|
1526
1579
|
|
|
1527
1580
|
print("🚀 Starting Code Indexer with Enhanced Configuration Support")
|
|
1528
1581
|
print(f"📋 Configuration file: {config_file}")
|
|
1582
|
+
print(f"🔑 API configuration file: {api_config_file}")
|
|
1529
1583
|
|
|
1530
1584
|
# Create indexer with full configuration support
|
|
1531
1585
|
try:
|
|
@@ -1533,6 +1587,7 @@ async def main():
|
|
|
1533
1587
|
code_base_path=code_base_path, # None = read from config
|
|
1534
1588
|
target_structure=target_structure, # Required - project specific
|
|
1535
1589
|
output_dir=output_dir, # None = read from config
|
|
1590
|
+
config_path=api_config_file, # API configuration file
|
|
1536
1591
|
indexer_config_path=config_file, # Configuration file
|
|
1537
1592
|
enable_pre_filtering=True, # Can be overridden in config
|
|
1538
1593
|
)
|
|
@@ -1540,7 +1595,10 @@ async def main():
|
|
|
1540
1595
|
# Display configuration information
|
|
1541
1596
|
print(f"📁 Code base path: {indexer.code_base_path}")
|
|
1542
1597
|
print(f"📂 Output directory: {indexer.output_dir}")
|
|
1543
|
-
print(
|
|
1598
|
+
print(
|
|
1599
|
+
f"🤖 Default models: Anthropic={indexer.default_models['anthropic']}, OpenAI={indexer.default_models['openai']}"
|
|
1600
|
+
)
|
|
1601
|
+
print(f"🔧 Preferred LLM: {get_preferred_llm_class(api_config_file).__name__}")
|
|
1544
1602
|
print(
|
|
1545
1603
|
f"⚡ Concurrent analysis: {'enabled' if indexer.enable_concurrent_analysis else 'disabled'}"
|
|
1546
1604
|
)
|