codeui-python 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.
- codeui_python-0.1.0/LICENSE +21 -0
- codeui_python-0.1.0/PKG-INFO +191 -0
- codeui_python-0.1.0/README.md +154 -0
- codeui_python-0.1.0/pyproject.toml +73 -0
- codeui_python-0.1.0/setup.cfg +4 -0
- codeui_python-0.1.0/setup.py +53 -0
- codeui_python-0.1.0/src/codeui/__init__.py +23 -0
- codeui_python-0.1.0/src/codeui/agent/__init__.py +15 -0
- codeui_python-0.1.0/src/codeui/agent/context.py +207 -0
- codeui_python-0.1.0/src/codeui/agent/contribution.py +224 -0
- codeui_python-0.1.0/src/codeui/agent/edit_tools.py +280 -0
- codeui_python-0.1.0/src/codeui/agent/integrations.py +243 -0
- codeui_python-0.1.0/src/codeui/agent/mcp_server.py +94 -0
- codeui_python-0.1.0/src/codeui/analysis/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/analysis/api_drift.py +79 -0
- codeui_python-0.1.0/src/codeui/analysis/base.py +42 -0
- codeui_python-0.1.0/src/codeui/analysis/circular.py +116 -0
- codeui_python-0.1.0/src/codeui/analysis/dead_code.py +63 -0
- codeui_python-0.1.0/src/codeui/analysis/duplicates.py +69 -0
- codeui_python-0.1.0/src/codeui/analysis/runner.py +57 -0
- codeui_python-0.1.0/src/codeui/analysis/shadowing.py +49 -0
- codeui_python-0.1.0/src/codeui/analysis/undefined.py +97 -0
- codeui_python-0.1.0/src/codeui/analysis/unreachable.py +28 -0
- codeui_python-0.1.0/src/codeui/analysis/unresolved_import.py +153 -0
- codeui_python-0.1.0/src/codeui/cli/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/cli/main.py +437 -0
- codeui_python-0.1.0/src/codeui/core/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/core/cache.py +135 -0
- codeui_python-0.1.0/src/codeui/core/graph.py +435 -0
- codeui_python-0.1.0/src/codeui/core/ir.py +218 -0
- codeui_python-0.1.0/src/codeui/core/override.py +230 -0
- codeui_python-0.1.0/src/codeui/core/repo.py +85 -0
- codeui_python-0.1.0/src/codeui/core/resolver.py +281 -0
- codeui_python-0.1.0/src/codeui/errors.py +98 -0
- codeui_python-0.1.0/src/codeui/lang/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/lang/base.py +117 -0
- codeui_python-0.1.0/src/codeui/lang/generic.py +90 -0
- codeui_python-0.1.0/src/codeui/lang/go.py +167 -0
- codeui_python-0.1.0/src/codeui/lang/python.py +294 -0
- codeui_python-0.1.0/src/codeui/lang/registry.py +83 -0
- codeui_python-0.1.0/src/codeui/lang/rust.py +185 -0
- codeui_python-0.1.0/src/codeui/lang/ts.py +396 -0
- codeui_python-0.1.0/src/codeui/plugins/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/plugins/registry.py +31 -0
- codeui_python-0.1.0/src/codeui/report/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/report/json_emitter.py +24 -0
- codeui_python-0.1.0/src/codeui/report/markdown_emitter.py +33 -0
- codeui_python-0.1.0/src/codeui/report/sarif_emitter.py +56 -0
- codeui_python-0.1.0/src/codeui/server/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/server/server.py +705 -0
- codeui_python-0.1.0/src/codeui/tracer/__init__.py +1 -0
- codeui_python-0.1.0/src/codeui/tracer/tracer.py +147 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/PKG-INFO +191 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/SOURCES.txt +69 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/dependency_links.txt +1 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/entry_points.txt +2 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/requires.txt +7 -0
- codeui_python-0.1.0/src/codeui_python.egg-info/top_level.txt +1 -0
- codeui_python-0.1.0/tests/test_agent.py +111 -0
- codeui_python-0.1.0/tests/test_analyzers.py +90 -0
- codeui_python-0.1.0/tests/test_cache.py +38 -0
- codeui_python-0.1.0/tests/test_cli.py +64 -0
- codeui_python-0.1.0/tests/test_contribution.py +49 -0
- codeui_python-0.1.0/tests/test_edge_cases.py +21 -0
- codeui_python-0.1.0/tests/test_graph.py +70 -0
- codeui_python-0.1.0/tests/test_languages.py +39 -0
- codeui_python-0.1.0/tests/test_overrides.py +22 -0
- codeui_python-0.1.0/tests/test_repo.py +17 -0
- codeui_python-0.1.0/tests/test_resolver.py +41 -0
- codeui_python-0.1.0/tests/test_server.py +154 -0
- codeui_python-0.1.0/tests/test_tracer.py +48 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 codeui maintainers
|
|
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,191 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: codeui-python
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Universal static analysis code intelligence library, defect detector, graph visualizer, and agent context builder
|
|
5
|
+
Home-page: https://github.com/AAlsubari/codeUI
|
|
6
|
+
Author: Akram Alsubari
|
|
7
|
+
Author-email: Akram Alsubari <akramsubari@gmail.com>
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Homepage, https://github.com/AAlsubari/codeUI
|
|
10
|
+
Project-URL: Documentation, https://github.com/AAlsubari/codeUI#readme
|
|
11
|
+
Project-URL: Repository, https://github.com/AAlsubari/codeUI.git
|
|
12
|
+
Project-URL: Issues, https://github.com/AAlsubari/codeUI/issues
|
|
13
|
+
Keywords: code-analysis,static-analysis,code-graph,ast,ai-agents,code-intelligence,llm-context,defect-detection
|
|
14
|
+
Classifier: Development Status :: 4 - Beta
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Programming Language :: Python :: 3
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
22
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
23
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
24
|
+
Requires-Python: >=3.10
|
|
25
|
+
Description-Content-Type: text/markdown
|
|
26
|
+
License-File: LICENSE
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
30
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
31
|
+
Requires-Dist: build; extra == "dev"
|
|
32
|
+
Requires-Dist: twine; extra == "dev"
|
|
33
|
+
Dynamic: author
|
|
34
|
+
Dynamic: home-page
|
|
35
|
+
Dynamic: license-file
|
|
36
|
+
Dynamic: requires-python
|
|
37
|
+
|
|
38
|
+
# codeui
|
|
39
|
+
|
|
40
|
+
[](https://pypi.org/project/codeui/)
|
|
41
|
+
[](https://www.python.org/)
|
|
42
|
+
[](https://opensource.org/licenses/MIT)
|
|
43
|
+
[](https://github.com/AAlsubari/codeUI)
|
|
44
|
+
|
|
45
|
+
**`codeui`** is a universal, static-analysis-based code-intelligence library, defect detector, interactive graph visualizer, override store, and AI agent context builder.
|
|
46
|
+
|
|
47
|
+
It parses code bases safely without ever executing or importing analyzed code, extracting frozen intermediate representation (IR) graphs, tracing call hierarchies, detecting subtle architectural defects, and serving an interactive web visualizer.
|
|
48
|
+
|
|
49
|
+
Repository: [https://github.com/AAlsubari/codeUI](https://github.com/AAlsubari/codeUI)
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## Key Features
|
|
54
|
+
|
|
55
|
+
- **100% Static Analysis**: Safe AST extraction — **NEVER** executes, imports, or evaluates target project code.
|
|
56
|
+
- **Multi-Language Adapters**: Native analyzers for Python, TypeScript, JavaScript, Go, Rust, Dockerfiles, Makefiles, and generic fallback parser.
|
|
57
|
+
- **Defect Detection Engine**: 8 built-in static defect analyzers:
|
|
58
|
+
- `undefined`: Missing symbols and functions
|
|
59
|
+
- `dead_code`: Unreferenced private routines and unused exports
|
|
60
|
+
- `unresolved_import`: Missing or invalid import paths
|
|
61
|
+
- `circular`: Cyclic dependency detection via Tarjan's SCC algorithm
|
|
62
|
+
- `duplicates`: Structural code clone identification via shingling
|
|
63
|
+
- `unreachable`: Code following terminal control statements
|
|
64
|
+
- `shadowing`: Variable shadowing across nested scopes
|
|
65
|
+
- `api_drift`: Interface drift tracking against baseline snapshots
|
|
66
|
+
- **Interactive Localhost Visualizer**: Force-directed multi-window canvas with live code editor, mini-map, symbol inspection, and direct disk edit toggle (`http://127.0.0.1:3000`).
|
|
67
|
+
- **Direct Disk & Non-Destructive Override Store**: Save edits live to project disk files or non-destructively in an in-memory shadow store with unified diff generation (`EditTools`, `OverrideStore`).
|
|
68
|
+
- **AI Agent Context Engine**: Graph-traversal based dynamic context bundling (`ContextBuilder`) optimized for LLM prompts without token counting overhead.
|
|
69
|
+
- **Agent Self-Contribution Workflow**: Integrated `ContributionManager` allowing AI agents to dynamically fetch repository metadata, clone `https://github.com/AAlsubari/codeUI`, apply bug fixes or feature additions, and submit contributions.
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Installation
|
|
74
|
+
|
|
75
|
+
Install via PyPI:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
pip install codeui
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Or install from source in editable mode:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
git clone https://github.com/AAlsubari/codeUI.git
|
|
85
|
+
cd codeUI
|
|
86
|
+
pip install -e ".[dev]"
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Quickstart
|
|
92
|
+
|
|
93
|
+
### 1. Command Line Interface (CLI)
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
# Scan a project directory and print summary
|
|
97
|
+
codeui scan .
|
|
98
|
+
|
|
99
|
+
# Start the interactive visualizer server
|
|
100
|
+
codeui serve . --port 3000
|
|
101
|
+
|
|
102
|
+
# Perform forward symbol call trace
|
|
103
|
+
codeui trace "src/app.py::main" . --direction forward --depth 3
|
|
104
|
+
|
|
105
|
+
# Generate AI Agent Context Bundle for a symbol
|
|
106
|
+
codeui context . --symbol "src/app.py::main"
|
|
107
|
+
|
|
108
|
+
# List detected code defects in SARIF format
|
|
109
|
+
codeui defects . --format sarif
|
|
110
|
+
|
|
111
|
+
# Apply direct disk edit to a file
|
|
112
|
+
codeui apply src/main.py --content "print('hello world')" --disk
|
|
113
|
+
|
|
114
|
+
# Submit automated contribution to codeui repo
|
|
115
|
+
codeui contribute --title "Fix import resolution bug" --file src/fix.py "content"
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### 2. Python API Usage
|
|
119
|
+
|
|
120
|
+
```python
|
|
121
|
+
from pathlib import Path
|
|
122
|
+
from codeui.cli.main import scan_project
|
|
123
|
+
from codeui.tracer.tracer import Tracer
|
|
124
|
+
from codeui.agent.context import ContextBuilder
|
|
125
|
+
|
|
126
|
+
# 1. Scan codebase into a Universal Graph
|
|
127
|
+
graph = scan_project(Path("."))
|
|
128
|
+
|
|
129
|
+
# 2. Perform Call Graph Tracing
|
|
130
|
+
tracer = Tracer(graph)
|
|
131
|
+
called_symbols = list(tracer.forward("src/main.py::run"))
|
|
132
|
+
|
|
133
|
+
# 3. Build Minimal Context Bundle for LLM Prompts
|
|
134
|
+
builder = ContextBuilder(graph)
|
|
135
|
+
bundle = builder.for_symbol("src/main.py::run", depth=2)
|
|
136
|
+
print(bundle.to_json())
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
---
|
|
140
|
+
|
|
141
|
+
## AI Agent Self-Improvement Workflow
|
|
142
|
+
|
|
143
|
+
`codeui` provides first-class support for AI agents to automatically improve the library when encountering bugs, missing features, or optimization opportunities:
|
|
144
|
+
|
|
145
|
+
```python
|
|
146
|
+
from codeui.agent.contribution import ContributionManager
|
|
147
|
+
from codeui.core.repo import get_library_repo_url
|
|
148
|
+
|
|
149
|
+
# Get official library repository URL (https://github.com/AAlsubari/codeUI)
|
|
150
|
+
repo_url = get_library_repo_url()
|
|
151
|
+
|
|
152
|
+
# Submit automated agent bug fix
|
|
153
|
+
mgr = ContributionManager()
|
|
154
|
+
result = mgr.submit_contribution(
|
|
155
|
+
title="Agent: Add missing exception handling",
|
|
156
|
+
description="Identified edge case in AST parser during project scan.",
|
|
157
|
+
file_changes={"codeui/lang/python.py": "# fixed parser logic"},
|
|
158
|
+
push=True,
|
|
159
|
+
)
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## Code Examples
|
|
165
|
+
|
|
166
|
+
Check out the [`examples/`](./examples/) folder for complete, runnable scripts:
|
|
167
|
+
|
|
168
|
+
- [`01_basic_project_scan.py`](./examples/01_basic_project_scan.py) — Project scanning & defect detection
|
|
169
|
+
- [`02_symbol_tracing.py`](./examples/02_symbol_tracing.py) — Call graph forward/backward tracing
|
|
170
|
+
- [`03_agent_context_bundle.py`](./examples/03_agent_context_bundle.py) — LLM context bundle construction
|
|
171
|
+
- [`04_edits_and_overrides.py`](./examples/04_edits_and_overrides.py) — OverrideStore & direct disk edits
|
|
172
|
+
- [`05_agent_contribution.py`](./examples/05_agent_contribution.py) — Agent automated contribution workflow
|
|
173
|
+
|
|
174
|
+
---
|
|
175
|
+
|
|
176
|
+
## Documentation
|
|
177
|
+
|
|
178
|
+
Full documentation is available in the [`docs/`](./docs/) directory:
|
|
179
|
+
|
|
180
|
+
- [Quickstart Guide](./docs/quickstart.md)
|
|
181
|
+
- [Python API Reference](./docs/api.md)
|
|
182
|
+
- [AI Agent Integration & MCP](./docs/agent_integration.md)
|
|
183
|
+
- [Architecture Overview](./docs/architecture.md)
|
|
184
|
+
- [Static Analyzer & Defect Reference](./docs/analyzer_reference.md)
|
|
185
|
+
- [Extending codeui](./docs/extending.md)
|
|
186
|
+
|
|
187
|
+
---
|
|
188
|
+
|
|
189
|
+
## License
|
|
190
|
+
|
|
191
|
+
`codeui` is released under the [MIT License](./LICENSE). Copyright (c) 2026 Akram Alsubari and codeui maintainers.
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# codeui
|
|
2
|
+
|
|
3
|
+
[](https://pypi.org/project/codeui/)
|
|
4
|
+
[](https://www.python.org/)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://github.com/AAlsubari/codeUI)
|
|
7
|
+
|
|
8
|
+
**`codeui`** is a universal, static-analysis-based code-intelligence library, defect detector, interactive graph visualizer, override store, and AI agent context builder.
|
|
9
|
+
|
|
10
|
+
It parses code bases safely without ever executing or importing analyzed code, extracting frozen intermediate representation (IR) graphs, tracing call hierarchies, detecting subtle architectural defects, and serving an interactive web visualizer.
|
|
11
|
+
|
|
12
|
+
Repository: [https://github.com/AAlsubari/codeUI](https://github.com/AAlsubari/codeUI)
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Key Features
|
|
17
|
+
|
|
18
|
+
- **100% Static Analysis**: Safe AST extraction — **NEVER** executes, imports, or evaluates target project code.
|
|
19
|
+
- **Multi-Language Adapters**: Native analyzers for Python, TypeScript, JavaScript, Go, Rust, Dockerfiles, Makefiles, and generic fallback parser.
|
|
20
|
+
- **Defect Detection Engine**: 8 built-in static defect analyzers:
|
|
21
|
+
- `undefined`: Missing symbols and functions
|
|
22
|
+
- `dead_code`: Unreferenced private routines and unused exports
|
|
23
|
+
- `unresolved_import`: Missing or invalid import paths
|
|
24
|
+
- `circular`: Cyclic dependency detection via Tarjan's SCC algorithm
|
|
25
|
+
- `duplicates`: Structural code clone identification via shingling
|
|
26
|
+
- `unreachable`: Code following terminal control statements
|
|
27
|
+
- `shadowing`: Variable shadowing across nested scopes
|
|
28
|
+
- `api_drift`: Interface drift tracking against baseline snapshots
|
|
29
|
+
- **Interactive Localhost Visualizer**: Force-directed multi-window canvas with live code editor, mini-map, symbol inspection, and direct disk edit toggle (`http://127.0.0.1:3000`).
|
|
30
|
+
- **Direct Disk & Non-Destructive Override Store**: Save edits live to project disk files or non-destructively in an in-memory shadow store with unified diff generation (`EditTools`, `OverrideStore`).
|
|
31
|
+
- **AI Agent Context Engine**: Graph-traversal based dynamic context bundling (`ContextBuilder`) optimized for LLM prompts without token counting overhead.
|
|
32
|
+
- **Agent Self-Contribution Workflow**: Integrated `ContributionManager` allowing AI agents to dynamically fetch repository metadata, clone `https://github.com/AAlsubari/codeUI`, apply bug fixes or feature additions, and submit contributions.
|
|
33
|
+
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
## Installation
|
|
37
|
+
|
|
38
|
+
Install via PyPI:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pip install codeui
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Or install from source in editable mode:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
git clone https://github.com/AAlsubari/codeUI.git
|
|
48
|
+
cd codeUI
|
|
49
|
+
pip install -e ".[dev]"
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
## Quickstart
|
|
55
|
+
|
|
56
|
+
### 1. Command Line Interface (CLI)
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
# Scan a project directory and print summary
|
|
60
|
+
codeui scan .
|
|
61
|
+
|
|
62
|
+
# Start the interactive visualizer server
|
|
63
|
+
codeui serve . --port 3000
|
|
64
|
+
|
|
65
|
+
# Perform forward symbol call trace
|
|
66
|
+
codeui trace "src/app.py::main" . --direction forward --depth 3
|
|
67
|
+
|
|
68
|
+
# Generate AI Agent Context Bundle for a symbol
|
|
69
|
+
codeui context . --symbol "src/app.py::main"
|
|
70
|
+
|
|
71
|
+
# List detected code defects in SARIF format
|
|
72
|
+
codeui defects . --format sarif
|
|
73
|
+
|
|
74
|
+
# Apply direct disk edit to a file
|
|
75
|
+
codeui apply src/main.py --content "print('hello world')" --disk
|
|
76
|
+
|
|
77
|
+
# Submit automated contribution to codeui repo
|
|
78
|
+
codeui contribute --title "Fix import resolution bug" --file src/fix.py "content"
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
### 2. Python API Usage
|
|
82
|
+
|
|
83
|
+
```python
|
|
84
|
+
from pathlib import Path
|
|
85
|
+
from codeui.cli.main import scan_project
|
|
86
|
+
from codeui.tracer.tracer import Tracer
|
|
87
|
+
from codeui.agent.context import ContextBuilder
|
|
88
|
+
|
|
89
|
+
# 1. Scan codebase into a Universal Graph
|
|
90
|
+
graph = scan_project(Path("."))
|
|
91
|
+
|
|
92
|
+
# 2. Perform Call Graph Tracing
|
|
93
|
+
tracer = Tracer(graph)
|
|
94
|
+
called_symbols = list(tracer.forward("src/main.py::run"))
|
|
95
|
+
|
|
96
|
+
# 3. Build Minimal Context Bundle for LLM Prompts
|
|
97
|
+
builder = ContextBuilder(graph)
|
|
98
|
+
bundle = builder.for_symbol("src/main.py::run", depth=2)
|
|
99
|
+
print(bundle.to_json())
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## AI Agent Self-Improvement Workflow
|
|
105
|
+
|
|
106
|
+
`codeui` provides first-class support for AI agents to automatically improve the library when encountering bugs, missing features, or optimization opportunities:
|
|
107
|
+
|
|
108
|
+
```python
|
|
109
|
+
from codeui.agent.contribution import ContributionManager
|
|
110
|
+
from codeui.core.repo import get_library_repo_url
|
|
111
|
+
|
|
112
|
+
# Get official library repository URL (https://github.com/AAlsubari/codeUI)
|
|
113
|
+
repo_url = get_library_repo_url()
|
|
114
|
+
|
|
115
|
+
# Submit automated agent bug fix
|
|
116
|
+
mgr = ContributionManager()
|
|
117
|
+
result = mgr.submit_contribution(
|
|
118
|
+
title="Agent: Add missing exception handling",
|
|
119
|
+
description="Identified edge case in AST parser during project scan.",
|
|
120
|
+
file_changes={"codeui/lang/python.py": "# fixed parser logic"},
|
|
121
|
+
push=True,
|
|
122
|
+
)
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## Code Examples
|
|
128
|
+
|
|
129
|
+
Check out the [`examples/`](./examples/) folder for complete, runnable scripts:
|
|
130
|
+
|
|
131
|
+
- [`01_basic_project_scan.py`](./examples/01_basic_project_scan.py) — Project scanning & defect detection
|
|
132
|
+
- [`02_symbol_tracing.py`](./examples/02_symbol_tracing.py) — Call graph forward/backward tracing
|
|
133
|
+
- [`03_agent_context_bundle.py`](./examples/03_agent_context_bundle.py) — LLM context bundle construction
|
|
134
|
+
- [`04_edits_and_overrides.py`](./examples/04_edits_and_overrides.py) — OverrideStore & direct disk edits
|
|
135
|
+
- [`05_agent_contribution.py`](./examples/05_agent_contribution.py) — Agent automated contribution workflow
|
|
136
|
+
|
|
137
|
+
---
|
|
138
|
+
|
|
139
|
+
## Documentation
|
|
140
|
+
|
|
141
|
+
Full documentation is available in the [`docs/`](./docs/) directory:
|
|
142
|
+
|
|
143
|
+
- [Quickstart Guide](./docs/quickstart.md)
|
|
144
|
+
- [Python API Reference](./docs/api.md)
|
|
145
|
+
- [AI Agent Integration & MCP](./docs/agent_integration.md)
|
|
146
|
+
- [Architecture Overview](./docs/architecture.md)
|
|
147
|
+
- [Static Analyzer & Defect Reference](./docs/analyzer_reference.md)
|
|
148
|
+
- [Extending codeui](./docs/extending.md)
|
|
149
|
+
|
|
150
|
+
---
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
`codeui` is released under the [MIT License](./LICENSE). Copyright (c) 2026 Akram Alsubari and codeui maintainers.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "codeui-python"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "Universal static analysis code intelligence library, defect detector, graph visualizer, and agent context builder"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
authors = [
|
|
11
|
+
{ name = "Akram Alsubari", email = "akramsubari@gmail.com" }
|
|
12
|
+
]
|
|
13
|
+
license = { text = "MIT" }
|
|
14
|
+
requires-python = ">=3.10"
|
|
15
|
+
dependencies = []
|
|
16
|
+
keywords = [
|
|
17
|
+
"code-analysis",
|
|
18
|
+
"static-analysis",
|
|
19
|
+
"code-graph",
|
|
20
|
+
"ast",
|
|
21
|
+
"ai-agents",
|
|
22
|
+
"code-intelligence",
|
|
23
|
+
"llm-context",
|
|
24
|
+
"defect-detection"
|
|
25
|
+
]
|
|
26
|
+
classifiers = [
|
|
27
|
+
"Development Status :: 4 - Beta",
|
|
28
|
+
"Intended Audience :: Developers",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Programming Language :: Python :: 3",
|
|
31
|
+
"Programming Language :: Python :: 3.10",
|
|
32
|
+
"Programming Language :: Python :: 3.11",
|
|
33
|
+
"Programming Language :: Python :: 3.12",
|
|
34
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
35
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
36
|
+
"Topic :: Software Development :: Code Generators"
|
|
37
|
+
]
|
|
38
|
+
|
|
39
|
+
[project.optional-dependencies]
|
|
40
|
+
dev = [
|
|
41
|
+
"pytest>=7.0.0",
|
|
42
|
+
"pytest-cov>=4.0.0",
|
|
43
|
+
"mypy>=1.0.0",
|
|
44
|
+
"build",
|
|
45
|
+
"twine"
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
[project.urls]
|
|
49
|
+
Homepage = "https://github.com/AAlsubari/codeUI"
|
|
50
|
+
Documentation = "https://github.com/AAlsubari/codeUI#readme"
|
|
51
|
+
Repository = "https://github.com/AAlsubari/codeUI.git"
|
|
52
|
+
Issues = "https://github.com/AAlsubari/codeUI/issues"
|
|
53
|
+
|
|
54
|
+
[project.scripts]
|
|
55
|
+
codeui = "codeui.cli.main:main"
|
|
56
|
+
|
|
57
|
+
[project.entry-points."codeui.plugins"]
|
|
58
|
+
|
|
59
|
+
[tool.setuptools.packages.find]
|
|
60
|
+
where = ["src"]
|
|
61
|
+
include = ["codeui*"]
|
|
62
|
+
|
|
63
|
+
[tool.pytest.ini_options]
|
|
64
|
+
pythonpath = ["src"]
|
|
65
|
+
testpaths = ["tests"]
|
|
66
|
+
addopts = "--doctest-modules"
|
|
67
|
+
|
|
68
|
+
[tool.mypy]
|
|
69
|
+
python_version = "3.10"
|
|
70
|
+
mypy_path = "src"
|
|
71
|
+
strict = true
|
|
72
|
+
warn_return_any = true
|
|
73
|
+
warn_unused_configs = true
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
|
|
4
|
+
this_directory = Path(__file__).parent
|
|
5
|
+
long_description = (this_directory / "README.md").read_text(encoding="utf-8") if (this_directory / "README.md").exists() else ""
|
|
6
|
+
|
|
7
|
+
setup(
|
|
8
|
+
name="codeui-python",
|
|
9
|
+
version="0.1.0",
|
|
10
|
+
author="Akram Alsubari",
|
|
11
|
+
author_email="akramsubari@gmail.com",
|
|
12
|
+
description="Universal static analysis code intelligence library, defect detector, graph visualizer, and agent context builder",
|
|
13
|
+
long_description=long_description,
|
|
14
|
+
long_description_content_type="text/markdown",
|
|
15
|
+
url="https://github.com/AAlsubari/codeUI",
|
|
16
|
+
project_urls={
|
|
17
|
+
"Bug Tracker": "https://github.com/AAlsubari/codeUI/issues",
|
|
18
|
+
"Source Code": "https://github.com/AAlsubari/codeUI",
|
|
19
|
+
"Documentation": "https://github.com/AAlsubari/codeUI#readme",
|
|
20
|
+
},
|
|
21
|
+
package_dir={"": "src"},
|
|
22
|
+
packages=find_packages(where="src", include=["codeui", "codeui.*"]),
|
|
23
|
+
include_package_data=True,
|
|
24
|
+
python_requires=">=3.10",
|
|
25
|
+
install_requires=[],
|
|
26
|
+
extras_require={
|
|
27
|
+
"dev": [
|
|
28
|
+
"pytest>=7.0.0",
|
|
29
|
+
"pytest-cov>=4.0.0",
|
|
30
|
+
"mypy>=1.0.0",
|
|
31
|
+
"build",
|
|
32
|
+
"twine",
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
entry_points={
|
|
36
|
+
"console_scripts": [
|
|
37
|
+
"codeui=codeui.cli.main:main",
|
|
38
|
+
],
|
|
39
|
+
},
|
|
40
|
+
classifiers=[
|
|
41
|
+
"Development Status :: 4 - Beta",
|
|
42
|
+
"Intended Audience :: Developers",
|
|
43
|
+
"License :: OSI Approved :: MIT License",
|
|
44
|
+
"Programming Language :: Python :: 3",
|
|
45
|
+
"Programming Language :: Python :: 3.10",
|
|
46
|
+
"Programming Language :: Python :: 3.11",
|
|
47
|
+
"Programming Language :: Python :: 3.12",
|
|
48
|
+
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
49
|
+
"Topic :: Software Development :: Quality Assurance",
|
|
50
|
+
"Topic :: Software Development :: Code Generators",
|
|
51
|
+
],
|
|
52
|
+
keywords="code-analysis static-analysis code-graph ast ai-agents code-intelligence llm-context",
|
|
53
|
+
)
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""codeui: Universal Code-Intelligence Library. Demo Version 18661"""
|
|
2
|
+
from codeui.core.ir import Location, Symbol, SymbolKind, Visibility, EdgeKind, Edge, Finding, Severity
|
|
3
|
+
from codeui.core.graph import Graph
|
|
4
|
+
from codeui.core.override import Override, OverrideKind, OverrideStore
|
|
5
|
+
from codeui.core.repo import get_library_repo_url
|
|
6
|
+
|
|
7
|
+
__version__ = "0.1.0"
|
|
8
|
+
|
|
9
|
+
__all__ = [
|
|
10
|
+
"Location",
|
|
11
|
+
"Symbol",
|
|
12
|
+
"SymbolKind",
|
|
13
|
+
"Visibility",
|
|
14
|
+
"EdgeKind",
|
|
15
|
+
"Edge",
|
|
16
|
+
"Finding",
|
|
17
|
+
"Severity",
|
|
18
|
+
"Graph",
|
|
19
|
+
"Override",
|
|
20
|
+
"OverrideKind",
|
|
21
|
+
"OverrideStore",
|
|
22
|
+
"get_library_repo_url",
|
|
23
|
+
]
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"""Agent integration and dynamic context builder package for codeui."""
|
|
2
|
+
from codeui.agent.context import ContextBuilder, ContextBundle, TaskSpec
|
|
3
|
+
from codeui.agent.contribution import ContributionManager
|
|
4
|
+
from codeui.agent.edit_tools import EditProposal, EditTools
|
|
5
|
+
from codeui.agent.integrations import CodeUITools
|
|
6
|
+
|
|
7
|
+
__all__ = [
|
|
8
|
+
"ContextBuilder",
|
|
9
|
+
"ContextBundle",
|
|
10
|
+
"TaskSpec",
|
|
11
|
+
"ContributionManager",
|
|
12
|
+
"EditProposal",
|
|
13
|
+
"EditTools",
|
|
14
|
+
"CodeUITools",
|
|
15
|
+
]
|