nimcode 0.3.2__tar.gz → 0.3.4__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 (39) hide show
  1. {nimcode-0.3.2 → nimcode-0.3.4}/PKG-INFO +13 -13
  2. {nimcode-0.3.2 → nimcode-0.3.4}/README.md +150 -136
  3. {nimcode-0.3.2 → nimcode-0.3.4}/setup.cfg +4 -4
  4. {nimcode-0.3.2 → nimcode-0.3.4}/setup.py +22 -22
  5. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/agent.py +434 -425
  6. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/cli.py +166 -166
  7. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/config.py +60 -55
  8. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/lenient_parser.py +107 -107
  9. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/memory.py +69 -69
  10. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/nim_client.py +151 -150
  11. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/permissions.py +124 -124
  12. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/plugin_manager.py +53 -53
  13. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/rag.py +121 -121
  14. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/repl.py +1199 -1199
  15. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/tools.py +773 -766
  16. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/updater.py +39 -34
  17. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/watcher.py +81 -81
  18. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/PKG-INFO +13 -13
  19. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_agent.py +300 -300
  20. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_cli.py +112 -112
  21. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_config.py +67 -67
  22. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_lenient_parser.py +67 -67
  23. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_mcp_client.py +135 -135
  24. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_memory.py +79 -79
  25. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_nim_client.py +149 -149
  26. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_permissions.py +84 -84
  27. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_plugin_manager.py +53 -53
  28. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_repl.py +387 -387
  29. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_repl_extra.py +136 -136
  30. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_repl_trust.py +55 -55
  31. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_tools.py +338 -338
  32. {nimcode-0.3.2 → nimcode-0.3.4}/tests/test_updater.py +41 -41
  33. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/__init__.py +0 -0
  34. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode/mcp_client.py +0 -0
  35. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/SOURCES.txt +0 -0
  36. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/dependency_links.txt +0 -0
  37. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/entry_points.txt +0 -0
  38. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/requires.txt +0 -0
  39. {nimcode-0.3.2 → nimcode-0.3.4}/src/nimcode.egg-info/top_level.txt +0 -0
@@ -1,13 +1,13 @@
1
- Metadata-Version: 2.4
2
- Name: nimcode
3
- Version: 0.3.2
4
- Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
- Author: Autonomous Agent
6
- Requires-Dist: httpx>=0.27.0
7
- Requires-Dist: rich>=13.7.0
8
- Requires-Dist: prompt_toolkit>=3.0.0
9
- Requires-Dist: mcp>=1.2.0
10
- Requires-Dist: watchdog>=3.0.0
11
- Dynamic: author
12
- Dynamic: requires-dist
13
- Dynamic: summary
1
+ Metadata-Version: 2.4
2
+ Name: nimcode
3
+ Version: 0.3.4
4
+ Summary: A standalone, robust coding agent for NVIDIA NIM models.
5
+ Author: Autonomous Agent
6
+ Requires-Dist: httpx>=0.27.0
7
+ Requires-Dist: rich>=13.7.0
8
+ Requires-Dist: prompt_toolkit>=3.0.0
9
+ Requires-Dist: mcp>=1.2.0
10
+ Requires-Dist: watchdog>=3.0.0
11
+ Dynamic: author
12
+ Dynamic: requires-dist
13
+ Dynamic: summary
@@ -1,136 +1,150 @@
1
- <div align="center">
2
-
3
- # 🚀 NimCode
4
-
5
- **The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
6
-
7
- [![PyPI version](https://badge.fury.io/py/nimcode.svg)](https://badge.fury.io/py/nimcode)
8
- [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
-
10
- *A powerful, standalone REPL and CLI agent that writes, edits, and plans code like a senior developer—powered by LLaMa 3.1 70B (and other cutting-edge models) and the lightning-fast NVIDIA NIM API.*
11
-
12
- </div>
13
-
14
- ---
15
-
16
- ## 🌟 Overview
17
-
18
- NimCode is your autonomous coding pair-programmer. Built with a rich interactive terminal interface, it doesn't just autocomplete code—it plans architectures, executes terminal commands, writes complete files, formats code automatically, and manages your workspace.
19
-
20
- ### 🛠️ What We've Built So Far
21
- - **VS Code Deep Integration**: Native IPC communication allowing NimCode to read active editors, send patches, and act as your intelligent coding panel within VS Code.
22
- - **RAG & Semantic Search**: Zero-dependency TF-IDF/BM25 based indexer that instantly scans massive workspaces and retrieves context-aware code snippets.
23
- - **Autonomous Auto-Fixer**: The `/fix` command creates a self-healing feedback loop—it runs your broken commands, analyzes the tracebacks, and automatically iterates on code patches until the build passes.
24
- - **Multi-Model & Local Support**: Flexible `api_base_url` configuration to seamlessly switch between NVIDIA NIM, Ollama, or vLLM endpoints.
25
- - **Smart Permission Engine**: Granular control over file writes and command executions, featuring an auto-bypass mechanism and interactive `(a)ccept / (r)eject` diff previews.
26
- - **Robust Interactive REPL**: Multiline support (Alt+Enter), syntax highlighting, and beautiful `rich`-powered UI menus.
27
- - **Automated Workflows**: Automatic linting and formatting using `black`, `flake8`, and `prettier` behind the scenes.
28
- - **Model Context Protocol (MCP)**: Native integration for MCP tools allowing infinite extensibility.
29
-
30
- ### 🚀 What We're Working On (Roadmap)
31
- - **Sub-agent Swarms**: Perfecting `/delegate` and `/swarm` to distribute complex tasks among specialized AI roles.
32
- - **Advanced Diagnostics**: Refining `/bughunter`, `/security-review`, and `/doctor` for automated codebase auditing.
33
- - **Test-Driven Development**: Upgrading `/tdd` and `/testgen` to automatically write tests and ensure 100% coverage before committing.
34
- - **Infrastructure & DevOps**: Implementing `/terraform-god` and `/sql-tune` for automated cloud provisioning and database query optimization.
35
-
36
- ---
37
-
38
- ## 📦 Installation
39
-
40
- NimCode is available globally via PyPI. You can install it anywhere in seconds:
41
-
42
- ```bash
43
- pip install nimcode
44
- ```
45
-
46
- ## 🚀 Quick Start
47
-
48
- 1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
49
- 2. **Login**: Connect your local environment by running:
50
- ```bash
51
- nimcode login
52
- ```
53
- 3. **Start Coding**:
54
- - Launch the interactive REPL:
55
- ```bash
56
- nimcode
57
- ```
58
- - Or run a one-off task directly from the command line:
59
- ```bash
60
- nimcode /plan "Build a classic Snake game using HTML5 Canvas"
61
- ```
62
-
63
- ---
64
-
65
- ## 💻 Complete Command Reference
66
-
67
- Inside the `nimcode` REPL, you can type natural language or use any of the following slash commands to trigger specific workflows:
68
-
69
- ### Mode Toggles & Execution
70
- - **`/code`**: Enter standard coding mode (default mode, prompts for dangerous actions).
71
- - **`/plan`**: Enter planning mode (read-only safe mode). The AI will research and write a markdown plan before modifying code.
72
- - **`/trust`**: Enter trust mode. The AI will run commands and edit files completely autonomously without asking for `(a)ccept / (r)eject`.
73
- - **`/untrust`**: Disable trust mode and restore permission prompts.
74
-
75
- ### Interface & Settings
76
- - **`/models`**: Open an interactive UI to select your preferred NVIDIA NIM model (e.g., meta/llama-3.1-70b-instruct).
77
- - **`/theme`**: Open an interactive UI to change your syntax highlighting theme (e.g., monokai, dracula, nord, github).
78
- - **`/config`**: View and edit global NimCode configuration settings.
79
-
80
- ### Workspace & Context Management
81
- - **`/clear`**: Clear the current conversation history to reset context.
82
- - **`/compact`**: Compact the context window to save tokens while keeping essential memories.
83
- - **`/context`**: View and manage the loaded context window.
84
- - **`/rewind`**: Rewind the conversation history by a few steps.
85
- - **`/undo`**: Revert the last file modification made by the AI.
86
-
87
- ### Project & Search
88
- - **`/index`**: Index the current project files to enable lightning-fast Semantic Search.
89
- - **`/map`**: Generate a high-level semantic architecture map of the codebase.
90
- - **`/research`**: Enter deep-research mode for reading documentation or large files.
91
-
92
- ### Automation & Git
93
- - **`/commit`**: Analyze all staged git changes and automatically generate a conventional commit message.
94
- - **`/fix`**: Run a specific shell command and let the AI automatically iterate to fix any resulting errors.
95
- - **`/autofix-pr`**: Pulls the current active GitHub Pull Request, reads comments, and automatically fixes the mentioned issues.
96
-
97
- ### Advanced Development Modes
98
- - **`/testgen <file>`**: Generate unit tests for a specific file, aiming for 100% coverage.
99
- - **`/tdd`**: Enter Test-Driven Development mode. The AI will write tests first, verify they fail, and then implement the code to pass them.
100
- - **`/bughunter`**: Initiate an automated search for logical bugs and edge cases across the codebase.
101
- - **`/security-review`**: Audit the codebase for common vulnerabilities (e.g., OWASP top 10).
102
- - **`/sql-tune`**: Database telepathy mode. Analyzes and auto-tunes SQL queries for maximum performance.
103
- - **`/terraform-god`**: Cloud architect mode. Auto-provisions scalable best-practice Terraform infrastructure.
104
- - **`/decompile <binary>`**: Reverse engineering mode using tools like `objdump` and `radare2`.
105
-
106
- ### AI & Agents
107
- - **`/delegate <role> <task>`**: Spawn an independent sub-agent with a specific role to handle a background task.
108
- - **`/swarm`**: Orchestrate multiple sub-agents to tackle a complex architectural epic simultaneously.
109
- - **`/grill-me`**: Interrogation mode. The AI will ask *you* hard questions to refine your system design and edge cases.
110
- - **`/learn`**: Teach NimCode a new persistent skill or framework rule that it will remember for future sessions.
111
- - **`/vision`**: Capture the screen and analyze UI elements using Vision AI models.
112
- - **`/voice`**: Record your voice for 5 seconds and transcribe it as a prompt.
113
- - **`/mcp install`**: Install and configure new Model Context Protocol tools.
114
-
115
- ---
116
-
117
- ## ⚙️ How it Works
118
-
119
- NimCode creates a `.nimcode` directory inside your projects. This directory acts as the "brain" for that specific workspace:
120
- - `.nimcode/plans/`: All your generated step-by-step markdown plans live here.
121
- - `.nimcode/skills/`: Any custom guidelines, framework rules, or memories you teach the agent.
122
- - `.nimcode/history/`: File backups for `/undo` capabilities.
123
-
124
- ## 🛡️ Requirements
125
-
126
- - Python 3.8+
127
- - An NVIDIA NIM API Key (`NIM_API_KEY`)
128
-
129
- ## 🤝 Contributing
130
-
131
- Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
132
-
133
- ---
134
- <div align="center">
135
- <i>Built with ❤️ for the open-source developer community.</i>
136
- </div>
1
+ <div align="center">
2
+
3
+ # 🚀 NimCode
4
+
5
+ **The Autonomous AI Coding Assistant for the NVIDIA NIM Ecosystem**
6
+
7
+ [![PyPI version](https://badge.fury.io/py/nimcode.svg)](https://badge.fury.io/py/nimcode)
8
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
9
+
10
+ *A powerful, standalone REPL and CLI agent that writes, edits, and plans code like a senior developer—powered by LLaMa 3.1 70B (and other cutting-edge models) and the lightning-fast NVIDIA NIM API.*
11
+
12
+ </div>
13
+
14
+ ---
15
+
16
+ ## 🌟 Overview
17
+
18
+ NimCode is your autonomous coding pair-programmer. Built with a rich interactive terminal interface, it doesn't just autocomplete code—it plans architectures, executes terminal commands, writes complete files, formats code automatically, and manages your workspace.
19
+
20
+ ### 🛠️ What We've Built So Far
21
+ - **VS Code Deep Integration**: Native IPC communication allowing NimCode to read active editors, send patches, and act as your intelligent coding panel within VS Code.
22
+ - **RAG & Semantic Search**: Zero-dependency TF-IDF/BM25 based indexer that instantly scans massive workspaces and retrieves context-aware code snippets.
23
+ - **Autonomous Auto-Fixer**: The `/fix` command creates a self-healing feedback loop—it runs your broken commands, analyzes the tracebacks, and automatically iterates on code patches until the build passes.
24
+ - **Multi-Model & Local Support**: Flexible `api_base_url` configuration to seamlessly switch between NVIDIA NIM, Ollama, or vLLM endpoints.
25
+ - **Smart Permission Engine**: Granular control over file writes and command executions, featuring an auto-bypass mechanism and interactive `(a)ccept / (r)eject` diff previews.
26
+ - **Robust Interactive REPL**: Multiline support (Alt+Enter), syntax highlighting, and beautiful `rich`-powered UI menus.
27
+ - **Automated Workflows**: Automatic linting and formatting using `black`, `flake8`, and `prettier` behind the scenes.
28
+ - **Model Context Protocol (MCP)**: Native integration for MCP tools allowing infinite extensibility.
29
+
30
+ ### 🚀 What We're Working On (Roadmap)
31
+ - **Sub-agent Swarms**: Perfecting `/delegate` and `/swarm` to distribute complex tasks among specialized AI roles.
32
+ - **Advanced Diagnostics**: Refining `/bughunter`, `/security-review`, and `/doctor` for automated codebase auditing.
33
+ - **Test-Driven Development**: Upgrading `/tdd` and `/testgen` to automatically write tests and ensure 100% coverage before committing.
34
+ - **Infrastructure & DevOps**: Implementing `/terraform-god` and `/sql-tune` for automated cloud provisioning and database query optimization.
35
+
36
+ ---
37
+
38
+ ## 📦 Installation
39
+
40
+ NimCode is available globally via PyPI. You can install it anywhere in seconds:
41
+
42
+ ```bash
43
+ pip install nimcode
44
+ ```
45
+
46
+ ## 🚀 Quick Start
47
+
48
+ 1. **Get an API Key**: Grab a free NVIDIA API key from [build.nvidia.com](https://build.nvidia.com/).
49
+ 2. **Login**: Connect your local environment by running:
50
+ ```bash
51
+ nimcode login
52
+ ```
53
+ 3. **Start Coding**:
54
+ - Launch the interactive REPL:
55
+ ```bash
56
+ nimcode
57
+ ```
58
+ - Or run a one-off task directly from the command line:
59
+ ```bash
60
+ nimcode /plan "Build a classic Snake game using HTML5 Canvas"
61
+ ```
62
+
63
+ ---
64
+
65
+ ## 💻 Complete Command Reference
66
+
67
+ Inside the `nimcode` REPL, you can type natural language or use any of the following slash commands to trigger specific workflows:
68
+
69
+ ### Mode Toggles & Execution
70
+ - **`/code`**: Enter standard coding mode (default mode, prompts for dangerous actions).
71
+ - **`/plan`**: Enter planning mode (read-only safe mode). The AI will research and write a markdown plan before modifying code.
72
+ - **`/trust`**: Enter trust mode. The AI will run commands and edit files completely autonomously without asking for `(a)ccept / (r)eject`.
73
+ - **`/untrust`**: Disable trust mode and restore permission prompts.
74
+
75
+ ### Interface & Settings
76
+ - **`/models`**: Open an interactive UI to select your preferred NVIDIA NIM model (e.g., meta/llama-3.1-70b-instruct).
77
+ - **`/theme`**: Open an interactive UI to change your syntax highlighting theme (e.g., monokai, dracula, nord, github).
78
+ - **`/config`**: View and edit global NimCode configuration settings.
79
+
80
+ ### Workspace & Context Management
81
+ - **`/clear`**: Clear the current conversation history to reset context.
82
+ - **`/compact`**: Compact the context window to save tokens while keeping essential memories.
83
+ - **`/context`**: View and manage the loaded context window.
84
+ - **`/rewind`**: Rewind the conversation history by a few steps.
85
+ - **`/undo`**: Revert the last file modification made by the AI.
86
+
87
+ ### Project & Search
88
+ - **`/index`**: Index the current project files to enable lightning-fast Semantic Search.
89
+ - **`/map`**: Generate a high-level semantic architecture map of the codebase.
90
+ - **`/research`**: Enter deep-research mode for reading documentation or large files.
91
+
92
+ ### Automation & Git
93
+ - **`/commit`**: Analyze all staged git changes and automatically generate a conventional commit message.
94
+ - **`/fix`**: Run a specific shell command and let the AI automatically iterate to fix any resulting errors.
95
+ - **`/autofix-pr`**: Pulls the current active GitHub Pull Request, reads comments, and automatically fixes the mentioned issues.
96
+
97
+ ### Advanced Development Modes
98
+ - **`/testgen <file>`**: Generate unit tests for a specific file, aiming for 100% coverage.
99
+ - **`/tdd`**: Enter Test-Driven Development mode. The AI will write tests first, verify they fail, and then implement the code to pass them.
100
+ - **`/bughunter`**: Initiate an automated search for logical bugs and edge cases across the codebase.
101
+ - **`/security-review`**: Audit the codebase for common vulnerabilities (e.g., OWASP top 10).
102
+ - **`/sql-tune`**: Database telepathy mode. Analyzes and auto-tunes SQL queries for maximum performance.
103
+ - **`/terraform-god`**: Cloud architect mode. Auto-provisions scalable best-practice Terraform infrastructure.
104
+ - **`/decompile <binary>`**: Reverse engineering mode using tools like `objdump` and `radare2`.
105
+
106
+ ### AI & Agents
107
+ - **`/delegate <role> <task>`**: Spawn an independent sub-agent with a specific role to handle a background task.
108
+ - **`/swarm`**: Orchestrate multiple sub-agents to tackle a complex architectural epic simultaneously.
109
+ - **`/grill-me`**: Interrogation mode. The AI will ask *you* hard questions to refine your system design and edge cases.
110
+ - **`/learn`**: Teach NimCode a new persistent skill or framework rule that it will remember for future sessions.
111
+ - **`/vision`**: Capture the screen and analyze UI elements using Vision AI models.
112
+ - **`/voice`**: Record your voice for 5 seconds and transcribe it as a prompt.
113
+ - **`/mcp install`**: Install and configure new Model Context Protocol tools.
114
+
115
+ ---
116
+
117
+ ## ⚙️ How it Works
118
+
119
+ NimCode creates a `.nimcode` directory inside your projects. This directory acts as the "brain" for that specific workspace:
120
+ - `.nimcode/plans/`: All your generated step-by-step markdown plans live here.
121
+ - `.nimcode/skills/`: Any custom guidelines, framework rules, or memories you teach the agent.
122
+ - `.nimcode/history/`: File backups for `/undo` capabilities.
123
+
124
+ ### Advanced Configuration (Timeouts)
125
+
126
+ NimCode's limits and timeouts can be customized through the `.nimcode/settings.json` file. Setting any timeout to `0` will completely disable it (infinite timeout).
127
+
128
+ ```json
129
+ {
130
+ "timeout_command": 1200, // Max time for bash commands (in seconds)
131
+ "timeout_llm": 120, // Max time for LLM API responses (in seconds)
132
+ "timeout_format": 10, // Max time for auto-formatters like black/prettier
133
+ "timeout_browser": 15000, // Max time for browser operations (in milliseconds)
134
+ "timeout_updater": 3 // Max time for update checks
135
+ }
136
+ ```
137
+
138
+ ## 🛡️ Requirements
139
+
140
+ - Python 3.8+
141
+ - An NVIDIA NIM API Key (`NIM_API_KEY`)
142
+
143
+ ## 🤝 Contributing
144
+
145
+ Contributions, issues, and feature requests are welcome! Feel free to check out our [issues page](#).
146
+
147
+ ---
148
+ <div align="center">
149
+ <i>Built with ❤️ for the open-source developer community.</i>
150
+ </div>
@@ -1,4 +1,4 @@
1
- [egg_info]
2
- tag_build =
3
- tag_date = 0
4
-
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -1,22 +1,22 @@
1
- from setuptools import setup, find_packages
2
-
3
- setup(
4
- name="nimcode",
5
- version="0.3.2",
6
- packages=find_packages(where="src"),
7
- package_dir={"": "src"},
8
- install_requires=[
9
- "httpx>=0.27.0",
10
- "rich>=13.7.0",
11
- "prompt_toolkit>=3.0.0",
12
- "mcp>=1.2.0",
13
- "watchdog>=3.0.0"
14
- ],
15
- entry_points={
16
- "console_scripts": [
17
- "nimcode=nimcode.cli:main",
18
- ],
19
- },
20
- author="Autonomous Agent",
21
- description="A standalone, robust coding agent for NVIDIA NIM models.",
22
- )
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name="nimcode",
5
+ version="0.3.4",
6
+ packages=find_packages(where="src"),
7
+ package_dir={"": "src"},
8
+ install_requires=[
9
+ "httpx>=0.27.0",
10
+ "rich>=13.7.0",
11
+ "prompt_toolkit>=3.0.0",
12
+ "mcp>=1.2.0",
13
+ "watchdog>=3.0.0"
14
+ ],
15
+ entry_points={
16
+ "console_scripts": [
17
+ "nimcode=nimcode.cli:main",
18
+ ],
19
+ },
20
+ author="Autonomous Agent",
21
+ description="A standalone, robust coding agent for NVIDIA NIM models.",
22
+ )