codetheory 0.1.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.
- codetheory-0.1.0/LICENSE +21 -0
- codetheory-0.1.0/PKG-INFO +58 -0
- codetheory-0.1.0/README.md +33 -0
- codetheory-0.1.0/pyproject.toml +38 -0
- codetheory-0.1.0/setup.cfg +4 -0
- codetheory-0.1.0/src/codetheory.egg-info/PKG-INFO +58 -0
- codetheory-0.1.0/src/codetheory.egg-info/SOURCES.txt +23 -0
- codetheory-0.1.0/src/codetheory.egg-info/dependency_links.txt +1 -0
- codetheory-0.1.0/src/codetheory.egg-info/entry_points.txt +2 -0
- codetheory-0.1.0/src/codetheory.egg-info/requires.txt +5 -0
- codetheory-0.1.0/src/codetheory.egg-info/top_level.txt +1 -0
- codetheory-0.1.0/src/local_agent/__init__.py +4 -0
- codetheory-0.1.0/src/local_agent/cli.py +698 -0
- codetheory-0.1.0/src/local_agent/config.py +263 -0
- codetheory-0.1.0/src/local_agent/loop.py +460 -0
- codetheory-0.1.0/src/local_agent/orchestrator.py +221 -0
- codetheory-0.1.0/src/local_agent/providers.py +593 -0
- codetheory-0.1.0/src/local_agent/sessions.py +85 -0
- codetheory-0.1.0/src/local_agent/tools.py +820 -0
- codetheory-0.1.0/src/local_agent/ui.py +448 -0
- codetheory-0.1.0/tests/test_loop.py +26 -0
- codetheory-0.1.0/tests/test_orchestrator.py +106 -0
- codetheory-0.1.0/tests/test_providers.py +36 -0
- codetheory-0.1.0/tests/test_security.py +31 -0
- codetheory-0.1.0/tests/test_tools.py +45 -0
codetheory-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Guru Hemanth
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codetheory
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Zero-dependency, multi-provider CLI AI agent with local GPU optimization, subagents, and safety guardrails.
|
|
5
|
+
Author: Guru Hemanth
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: ai-agent,cli,ollama,claude,openai,devops,local-llm
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
22
|
+
Requires-Dist: flake8>=7.0; extra == "dev"
|
|
23
|
+
Requires-Dist: bandit>=1.7; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# codetheory
|
|
27
|
+
|
|
28
|
+
A **zero-dependency**, multi-provider, cross-platform **CLI AI agent** with local GPU tuning (Ollama), native Anthropic `/v1/messages` & OpenAI-compatible support, isolated subagents, per-session chat history, and built-in security guardrails.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
- **Zero Runtime Dependencies:** Pure Python 3.10+ standard library (`urllib`, `json`, `subprocess`, `difflib`).
|
|
32
|
+
- **15+ Providers:** Ollama (with WSL2 $\rightarrow$ Windows host auto-discovery & 4GB VRAM tuning), LM Studio, OpenAI, Anthropic (native `/v1/messages`), Gemini, Groq, OpenRouter, Mistral, DeepSeek, xAI, Together, Fireworks, Cerebras, NVIDIA NIM, or any custom OpenAI-compatible URL.
|
|
33
|
+
- **Cross-Shell & Multi-OS:** Auto-detects `bash`, `zsh`, `fish`, `sh`, `pwsh`, `powershell`, and `cmd`, plus `dnf`, `apt`, `pacman`, `zypper`, `apk`, `brew`, `winget`, `choco`, `pip`, and `npm`.
|
|
34
|
+
- **Full Tooling + Subagents:** `read_file`, `write_file` (atomic + diff preview), `edit_file` (unified diff preview), `list_dir`, `grep_search`, `find_files`, `run_command`, `install_package`, `delete_path` (recoverable trash + mandatory approval), `web_search`, `fetch_url`, and `spawn_subagent`.
|
|
35
|
+
- **Anthropic-Spec Agentic Loop:** Enforces `max_turns`, handles `end_turn` / `max_tokens` stops, and uses `LoopDetector` to prevent self-repeating tool loops and error spirals.
|
|
36
|
+
- **Security Hardening:** Automatic API key redaction in tool outputs/logs, SSRF blocking for cloud metadata/link-local IPs, protected OS path guards, and destructive/RCE command approval gates.
|
|
37
|
+
- **Interactive & Headless Modes:**
|
|
38
|
+
- Interactive REPL with `/setup`, `/providers`, `/provider [name|#]`, `/key`, `/models`, `/settings`, `/history`, `/auto`, `/think`, `/gpu`, and `Tab` autocomplete.
|
|
39
|
+
- Headless pipe/CI mode: `codetheory -p "your prompt"` or `git diff | codetheory -p "review this"`.
|
|
40
|
+
- Auto-loads project rules from `AGENT.md` or `.agentrules` in the current directory.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
```bash
|
|
44
|
+
pip install -e .
|
|
45
|
+
# or with pipx / uv:
|
|
46
|
+
pipx install .
|
|
47
|
+
uv tool install .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
```bash
|
|
52
|
+
# Interactive mode
|
|
53
|
+
codetheory
|
|
54
|
+
|
|
55
|
+
# Headless / pipe mode
|
|
56
|
+
codetheory -p "summarize TODOs in src/"
|
|
57
|
+
git diff | codetheory -p "review this diff for bugs"
|
|
58
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# codetheory
|
|
2
|
+
|
|
3
|
+
A **zero-dependency**, multi-provider, cross-platform **CLI AI agent** with local GPU tuning (Ollama), native Anthropic `/v1/messages` & OpenAI-compatible support, isolated subagents, per-session chat history, and built-in security guardrails.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
- **Zero Runtime Dependencies:** Pure Python 3.10+ standard library (`urllib`, `json`, `subprocess`, `difflib`).
|
|
7
|
+
- **15+ Providers:** Ollama (with WSL2 $\rightarrow$ Windows host auto-discovery & 4GB VRAM tuning), LM Studio, OpenAI, Anthropic (native `/v1/messages`), Gemini, Groq, OpenRouter, Mistral, DeepSeek, xAI, Together, Fireworks, Cerebras, NVIDIA NIM, or any custom OpenAI-compatible URL.
|
|
8
|
+
- **Cross-Shell & Multi-OS:** Auto-detects `bash`, `zsh`, `fish`, `sh`, `pwsh`, `powershell`, and `cmd`, plus `dnf`, `apt`, `pacman`, `zypper`, `apk`, `brew`, `winget`, `choco`, `pip`, and `npm`.
|
|
9
|
+
- **Full Tooling + Subagents:** `read_file`, `write_file` (atomic + diff preview), `edit_file` (unified diff preview), `list_dir`, `grep_search`, `find_files`, `run_command`, `install_package`, `delete_path` (recoverable trash + mandatory approval), `web_search`, `fetch_url`, and `spawn_subagent`.
|
|
10
|
+
- **Anthropic-Spec Agentic Loop:** Enforces `max_turns`, handles `end_turn` / `max_tokens` stops, and uses `LoopDetector` to prevent self-repeating tool loops and error spirals.
|
|
11
|
+
- **Security Hardening:** Automatic API key redaction in tool outputs/logs, SSRF blocking for cloud metadata/link-local IPs, protected OS path guards, and destructive/RCE command approval gates.
|
|
12
|
+
- **Interactive & Headless Modes:**
|
|
13
|
+
- Interactive REPL with `/setup`, `/providers`, `/provider [name|#]`, `/key`, `/models`, `/settings`, `/history`, `/auto`, `/think`, `/gpu`, and `Tab` autocomplete.
|
|
14
|
+
- Headless pipe/CI mode: `codetheory -p "your prompt"` or `git diff | codetheory -p "review this"`.
|
|
15
|
+
- Auto-loads project rules from `AGENT.md` or `.agentrules` in the current directory.
|
|
16
|
+
|
|
17
|
+
## Installation
|
|
18
|
+
```bash
|
|
19
|
+
pip install -e .
|
|
20
|
+
# or with pipx / uv:
|
|
21
|
+
pipx install .
|
|
22
|
+
uv tool install .
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Quick Start
|
|
26
|
+
```bash
|
|
27
|
+
# Interactive mode
|
|
28
|
+
codetheory
|
|
29
|
+
|
|
30
|
+
# Headless / pipe mode
|
|
31
|
+
codetheory -p "summarize TODOs in src/"
|
|
32
|
+
git diff | codetheory -p "review this diff for bugs"
|
|
33
|
+
```
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "codetheory"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Zero-dependency, multi-provider CLI AI agent with local GPU optimization, subagents, and safety guardrails."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [{name = "Guru Hemanth"}]
|
|
13
|
+
keywords = ["ai-agent", "cli", "ollama", "claude", "openai", "devops", "local-llm"]
|
|
14
|
+
classifiers = [
|
|
15
|
+
"Development Status :: 4 - Beta",
|
|
16
|
+
"Environment :: Console",
|
|
17
|
+
"Intended Audience :: Developers",
|
|
18
|
+
"License :: OSI Approved :: MIT License",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
"Programming Language :: Python :: 3.10",
|
|
22
|
+
"Programming Language :: Python :: 3.11",
|
|
23
|
+
"Programming Language :: Python :: 3.12",
|
|
24
|
+
]
|
|
25
|
+
dependencies = []
|
|
26
|
+
|
|
27
|
+
[project.optional-dependencies]
|
|
28
|
+
dev = ["pytest>=8.0", "flake8>=7.0", "bandit>=1.7"]
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
codetheory = "local_agent.cli:main"
|
|
32
|
+
|
|
33
|
+
[tool.setuptools.packages.find]
|
|
34
|
+
where = ["src"]
|
|
35
|
+
|
|
36
|
+
[tool.pytest.ini_options]
|
|
37
|
+
testpaths = ["tests"]
|
|
38
|
+
pythonpath = ["src"]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codetheory
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Zero-dependency, multi-provider CLI AI agent with local GPU optimization, subagents, and safety guardrails.
|
|
5
|
+
Author: Guru Hemanth
|
|
6
|
+
License: MIT
|
|
7
|
+
Keywords: ai-agent,cli,ollama,claude,openai,devops,local-llm
|
|
8
|
+
Classifier: Development Status :: 4 - Beta
|
|
9
|
+
Classifier: Environment :: Console
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Requires-Python: >=3.10
|
|
18
|
+
Description-Content-Type: text/markdown
|
|
19
|
+
License-File: LICENSE
|
|
20
|
+
Provides-Extra: dev
|
|
21
|
+
Requires-Dist: pytest>=8.0; extra == "dev"
|
|
22
|
+
Requires-Dist: flake8>=7.0; extra == "dev"
|
|
23
|
+
Requires-Dist: bandit>=1.7; extra == "dev"
|
|
24
|
+
Dynamic: license-file
|
|
25
|
+
|
|
26
|
+
# codetheory
|
|
27
|
+
|
|
28
|
+
A **zero-dependency**, multi-provider, cross-platform **CLI AI agent** with local GPU tuning (Ollama), native Anthropic `/v1/messages` & OpenAI-compatible support, isolated subagents, per-session chat history, and built-in security guardrails.
|
|
29
|
+
|
|
30
|
+
## Features
|
|
31
|
+
- **Zero Runtime Dependencies:** Pure Python 3.10+ standard library (`urllib`, `json`, `subprocess`, `difflib`).
|
|
32
|
+
- **15+ Providers:** Ollama (with WSL2 $\rightarrow$ Windows host auto-discovery & 4GB VRAM tuning), LM Studio, OpenAI, Anthropic (native `/v1/messages`), Gemini, Groq, OpenRouter, Mistral, DeepSeek, xAI, Together, Fireworks, Cerebras, NVIDIA NIM, or any custom OpenAI-compatible URL.
|
|
33
|
+
- **Cross-Shell & Multi-OS:** Auto-detects `bash`, `zsh`, `fish`, `sh`, `pwsh`, `powershell`, and `cmd`, plus `dnf`, `apt`, `pacman`, `zypper`, `apk`, `brew`, `winget`, `choco`, `pip`, and `npm`.
|
|
34
|
+
- **Full Tooling + Subagents:** `read_file`, `write_file` (atomic + diff preview), `edit_file` (unified diff preview), `list_dir`, `grep_search`, `find_files`, `run_command`, `install_package`, `delete_path` (recoverable trash + mandatory approval), `web_search`, `fetch_url`, and `spawn_subagent`.
|
|
35
|
+
- **Anthropic-Spec Agentic Loop:** Enforces `max_turns`, handles `end_turn` / `max_tokens` stops, and uses `LoopDetector` to prevent self-repeating tool loops and error spirals.
|
|
36
|
+
- **Security Hardening:** Automatic API key redaction in tool outputs/logs, SSRF blocking for cloud metadata/link-local IPs, protected OS path guards, and destructive/RCE command approval gates.
|
|
37
|
+
- **Interactive & Headless Modes:**
|
|
38
|
+
- Interactive REPL with `/setup`, `/providers`, `/provider [name|#]`, `/key`, `/models`, `/settings`, `/history`, `/auto`, `/think`, `/gpu`, and `Tab` autocomplete.
|
|
39
|
+
- Headless pipe/CI mode: `codetheory -p "your prompt"` or `git diff | codetheory -p "review this"`.
|
|
40
|
+
- Auto-loads project rules from `AGENT.md` or `.agentrules` in the current directory.
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
```bash
|
|
44
|
+
pip install -e .
|
|
45
|
+
# or with pipx / uv:
|
|
46
|
+
pipx install .
|
|
47
|
+
uv tool install .
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Quick Start
|
|
51
|
+
```bash
|
|
52
|
+
# Interactive mode
|
|
53
|
+
codetheory
|
|
54
|
+
|
|
55
|
+
# Headless / pipe mode
|
|
56
|
+
codetheory -p "summarize TODOs in src/"
|
|
57
|
+
git diff | codetheory -p "review this diff for bugs"
|
|
58
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
src/codetheory.egg-info/PKG-INFO
|
|
5
|
+
src/codetheory.egg-info/SOURCES.txt
|
|
6
|
+
src/codetheory.egg-info/dependency_links.txt
|
|
7
|
+
src/codetheory.egg-info/entry_points.txt
|
|
8
|
+
src/codetheory.egg-info/requires.txt
|
|
9
|
+
src/codetheory.egg-info/top_level.txt
|
|
10
|
+
src/local_agent/__init__.py
|
|
11
|
+
src/local_agent/cli.py
|
|
12
|
+
src/local_agent/config.py
|
|
13
|
+
src/local_agent/loop.py
|
|
14
|
+
src/local_agent/orchestrator.py
|
|
15
|
+
src/local_agent/providers.py
|
|
16
|
+
src/local_agent/sessions.py
|
|
17
|
+
src/local_agent/tools.py
|
|
18
|
+
src/local_agent/ui.py
|
|
19
|
+
tests/test_loop.py
|
|
20
|
+
tests/test_orchestrator.py
|
|
21
|
+
tests/test_providers.py
|
|
22
|
+
tests/test_security.py
|
|
23
|
+
tests/test_tools.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
local_agent
|