Spaces:
Running
Running
Update README.md
Browse files
README.md
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
---
|
2 |
-
title: C-Codestral Agent
|
3 |
emoji: π
|
4 |
colorFrom: red
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 5.33.
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: mit
|
@@ -13,19 +13,87 @@ tags:
|
|
13 |
- mcp-server-track
|
14 |
---
|
15 |
|
16 |
-
|
17 |
|
18 |
-
|
19 |
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
---
|
23 |
|
24 |
-
##
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
|
26 |
-
|
27 |
-
*
|
28 |
-
*
|
29 |
-
* **π οΈ MCP-Enabled Tools**: The agent's core capabilities are exposed as MCP-compliant tools, ready to be used by other agents.
|
30 |
|
31 |
-
|
|
|
|
|
|
1 |
---
|
2 |
+
title: The True C-Codestral IDE Agent
|
3 |
emoji: π
|
4 |
colorFrom: red
|
5 |
colorTo: red
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 5.33.1
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: mit
|
|
|
13 |
- mcp-server-track
|
14 |
---
|
15 |
|
16 |
+
<div align="center">
|
17 |
|
18 |
+
# π The True C-Codestral IDE Agent
|
19 |
|
20 |
+
**An intelligent, multi-step AI agent that transforms natural language instructions into compiled C code, acting as a complete, interactive C development environment.**
|
21 |
+
|
22 |
+
[](https://huggingface.co/spaces/Agents-MCP-Hackathon/c)
|
23 |
+
[](https://huggingface.co/spaces/Agents-MCP-Hackathon/c)
|
24 |
+
|
25 |
+
</div>
|
26 |
+
|
27 |
+
This project is a submission for the **Agents & MCP Hackathon 2025**, participating in both the **Agentic Demo Showcase** and the **MCP Tool / Server** tracks.
|
28 |
+
|
29 |
+
---
|
30 |
+
|
31 |
+
## π₯ Demo Video
|
32 |
+
[](https://www.youtube.com/watch?v=LuO--JG7t7o)
|
33 |
+
**(Click the image to watch the demo on YouTube)**
|
34 |
+
|
35 |
+
---
|
36 |
+
|
37 |
+
## β¨ Core Features / ν΅μ¬ κΈ°λ₯
|
38 |
+
|
39 |
+
This agent is more than a simple code generator; it's a true AI development partner that understands and executes complex, sequential tasks.
|
40 |
+
|
41 |
+
* **π§ Multi-Step Agentic Workflow**
|
42 |
+
* **EN**: Understands and sequentially executes chained commands like "Refactor this code for readability, and then compile it."
|
43 |
+
* **KR**: "μ½λλ₯Ό 리ν©ν λ§νκ³ , κ·Έ λ€μμ μ»΄νμΌν΄μ€"μ κ°μ 볡μ‘νκ³ μ°κ²°λ λͺ
λ Ήμ μ΄ν΄νκ³ μμ°¨μ μΌλ‘ μμ
μ μνν©λλ€.
|
44 |
+
|
45 |
+
* **π€ Powered by Codestral**
|
46 |
+
* **EN**: Utilizes Mistral AI's latest specialized model for code, `Codestral`, to generate and analyze high-quality C code.
|
47 |
+
* **KR**: Mistral AIμ μ΅μ μ½λ μ λ¬Έ λͺ¨λΈμΈ `Codestral`μ μ¬μ©νμ¬ μ ννκ³ νμ§ λμ C μ½λλ₯Ό μμ±νκ³ λΆμν©λλ€.
|
48 |
+
|
49 |
+
* **β‘ On-the-Fly Compilation & Execution**
|
50 |
+
* **EN**: Instantly compiles and runs code using `gcc` on the backend. It provides real-time feedback on the console, including success status, output, or compilation errors.
|
51 |
+
* **KR**: λ°±μλμμ `gcc`λ₯Ό ν΅ν΄ μ½λλ₯Ό μ¦μ μ»΄νμΌνκ³ μ€νν©λλ€. μ±κ³΅ μ¬λΆ, κ²°κ³Ό, μ»΄νμΌ μ€λ₯κΉμ§ μ€μκ°μΌλ‘ μ½μμ νμνμ¬ μλ²½ν C κ°λ° κ²½νμ μ 곡ν©λλ€.
|
52 |
+
|
53 |
+
* **βοΈ Dual-Mode Interface**
|
54 |
+
* **EN**: Features both a conversational **IDE Agent** for users and **MCP Tools API** endpoints for other agents.
|
55 |
+
* **KR**: μ¬μ©μλ₯Ό μν λνν **IDE Agent**μ λ€λ₯Έ μμ΄μ νΈλ€μ΄ μ¬μ©ν μ μλ **MCP Tools API**λ₯Ό λͺ¨λ μ 곡ν©λλ€.
|
56 |
+
|
57 |
+
* **π Bilingual Instruction Support**
|
58 |
+
* **EN**: Capable of understanding and processing instructions given in both English and Korean.
|
59 |
+
* **KR**: νκ΅μ΄μ μμ΄λ‘ μμ±λ λͺ
λ Ήμ΄λ₯Ό λͺ¨λ μ΄ν΄νκ³ μ²λ¦¬ν μ μμ΅λλ€.
|
60 |
|
61 |
---
|
62 |
|
63 |
+
## π― Hackathon Tracks Contribution / ν΄μ»€ν€ νΈλ κΈ°μ¬
|
64 |
+
|
65 |
+
This project makes clear contributions to two separate tracks.
|
66 |
+
|
67 |
+
### π€ Track 3: Agentic Demo Showcase
|
68 |
+
|
69 |
+
The **IDE Agent** tab is a complete demonstration of a powerful AI agent.
|
70 |
+
1. **Stateful Interaction**: The agent maintains the code (state) throughout the conversation, building upon previous steps.
|
71 |
+
2. **Complex Command Parsing**: It deconstructs user requests based on connectors like "and" or "then" to create a multi-step execution plan.
|
72 |
+
3. **Autonomous Tool Use**: Based on its plan, the agent autonomously selects and uses its internal tools: `generate_code`, `compile_and_run`, and `analyze_and_refactor`.
|
73 |
+
|
74 |
+
These capabilities prove it is a true "agent," moving beyond the limitations of a simple chatbot.
|
75 |
+
|
76 |
+
### π§ Track 1: MCP Tool / Server
|
77 |
+
|
78 |
+
The **MCP Tools API** tab demonstrates how a Gradio app can function as an MCP (Model Context Protocol) server.
|
79 |
+
* Each function in this tab (`Generate C Code`, `Compile & Run C Code`, etc.) acts as a discrete API endpoint that can be called by any MCP client or other agents.
|
80 |
+
* This exposes the agent's powerful C language processing capabilities as modular tools, allowing other AI services to easily integrate them.
|
81 |
+
|
82 |
+
---
|
83 |
+
|
84 |
+
## π οΈ How It Works & Technical Details / κΈ°μ μ€ν λ° μλ λ°©μ
|
85 |
+
|
86 |
+
* **Frontend**: Built with `Gradio` to create a modern, interactive web UI. The interface is cleanly separated into two tabs for its distinct purposes (IDE and MCP).
|
87 |
+
* **LLM Backend**: Leverages `Mistral AI`'s `Codestral-latest` model via API calls to handle the core intelligence of code generation, analysis, and refactoring.
|
88 |
+
* **Execution Backend**: Uses Python's `subprocess` module to run the `gcc` compiler in a secure environment, allowing it to feed actual C code execution results back to the user.
|
89 |
+
* **Agent Logic**: The agent's core logic parses user commands with regular expressions to create a task queue. It then iterates through this queue, executing each task sequentially. Results and logs from each step are streamed to the user in real-time for full transparency.
|
90 |
+
|
91 |
+
## π How to Use / μ¬μ© λ°©λ²
|
92 |
|
93 |
+
1. **IDE Agent Tab**:
|
94 |
+
* **EN**: Write your C code in the **C Code Editor** on the left, or leave it empty to ask the agent to generate new code. In the **Instruction** box on the right, type your command in natural language (English or Korean), e.g., "Create a program that prints 'Hello World' and then run it." Click **Execute**. The agent will perform the tasks, stream its progress to the **Console / Output**, and update the code editor automatically if needed.
|
95 |
+
* **KR**: μΌμͺ½μ **C Code Editor**μ μ½λλ₯Ό μμ±νκ±°λ, λΉμλκ³ μλ‘μ΄ μ½λ μμ±μ μμ²ν μ μμ΅λλ€. μ€λ₯Έμͺ½ **Instruction** λ°μ€μ μνλ μμ
μ μμ°μ΄(νκ΅μ΄ λλ μμ΄)λ‘ μ
λ ₯ν©λλ€. (μ: "Hello Worldλ₯Ό μΆλ ₯νλ μ½λλ₯Ό λ§λ€κ³ μ€νν΄μ€"). **Execute** λ²νΌμ λλ₯΄λ©΄ μμ΄μ νΈκ° μμ
μ μννλ©° **Console / Output**μ μ§ν κ³Όμ κ³Ό μ΅μ’
κ²°κ³Όλ₯Ό νμνκ³ , νμμ μ½λ νΈμ§κΈ° λ΄μ©μ μλμΌλ‘ μ
λ°μ΄νΈν©λλ€.
|
|
|
96 |
|
97 |
+
2. **MCP Tools API Tab**:
|
98 |
+
* **EN**: This tab is designed for other agents or services to use this Space as an API. You can open each tool's accordion to test its functionality individually.
|
99 |
+
* **KR**: μ΄ νμ λ€λ₯Έ μμ΄μ νΈλ μλΉμ€κ° μ΄ Spaceλ₯Ό APIμ²λΌ μ¬μ©ν λλ₯Ό μν κ²μ
λλ€. κ° λꡬ(Tool) μΉμ
μ μ΄μ΄ κ°λ³ κΈ°λ₯μ ν
μ€νΈν΄λ³Ό μ μμ΅λλ€.
|