graperoot 3.8.69__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.
- graperoot-3.8.69/MANIFEST.in +3 -0
- graperoot-3.8.69/PKG-INFO +210 -0
- graperoot-3.8.69/README.md +190 -0
- graperoot-3.8.69/pyproject.toml +41 -0
- graperoot-3.8.69/setup.cfg +4 -0
- graperoot-3.8.69/setup.py +69 -0
- graperoot-3.8.69/src/graperoot/__init__.py +2 -0
- graperoot-3.8.69/src/graperoot/context_packer.c +16580 -0
- graperoot-3.8.69/src/graperoot/dg.c +31760 -0
- graperoot-3.8.69/src/graperoot/dgc_claude.c +10824 -0
- graperoot-3.8.69/src/graperoot/graph_builder.c +28120 -0
- graperoot-3.8.69/src/graperoot/mcp_graph_server.py +2026 -0
- graperoot-3.8.69/src/graperoot.egg-info/PKG-INFO +210 -0
- graperoot-3.8.69/src/graperoot.egg-info/SOURCES.txt +16 -0
- graperoot-3.8.69/src/graperoot.egg-info/dependency_links.txt +1 -0
- graperoot-3.8.69/src/graperoot.egg-info/entry_points.txt +6 -0
- graperoot-3.8.69/src/graperoot.egg-info/requires.txt +4 -0
- graperoot-3.8.69/src/graperoot.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: graperoot
|
|
3
|
+
Version: 3.8.69
|
|
4
|
+
Summary: GrapeRoot — graph-based context engine for AI coding agents
|
|
5
|
+
Author-email: Kunal <kunal12203@users.noreply.github.com>
|
|
6
|
+
License: Proprietary
|
|
7
|
+
Project-URL: Homepage, https://github.com/kunal12203/Codex-CLI-Compact
|
|
8
|
+
Keywords: claude,mcp,code-graph,context,ai
|
|
9
|
+
Classifier: Development Status :: 4 - Beta
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Programming Language :: Python :: 3
|
|
12
|
+
Classifier: Programming Language :: Cython
|
|
13
|
+
Classifier: Topic :: Software Development :: Libraries
|
|
14
|
+
Requires-Python: >=3.10
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
Requires-Dist: mcp>=1.3.0
|
|
17
|
+
Requires-Dist: uvicorn>=0.27.0
|
|
18
|
+
Requires-Dist: anyio>=4.0
|
|
19
|
+
Requires-Dist: starlette>=0.36.0
|
|
20
|
+
|
|
21
|
+
# Dual-Graph — Compounding Context for Claude Code & Codex CLI
|
|
22
|
+
|
|
23
|
+
A context engine that makes Claude Code and Codex CLI **30-45% cheaper** without sacrificing quality. It builds a semantic graph of your codebase and pre-loads the right files into every prompt — so Claude spends tokens reasoning, not exploring.
|
|
24
|
+
|
|
25
|
+
Works on **macOS, Linux, and Windows**. Supports any project size.
|
|
26
|
+
|
|
27
|
+
**Join the community: [discord.gg/rxgVVgCh](https://discord.gg/rxgVVgCh)**
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## How It Works
|
|
32
|
+
|
|
33
|
+
```
|
|
34
|
+
You run: dgc /path/to/project
|
|
35
|
+
↓
|
|
36
|
+
1. Project scanned → semantic graph built (files, symbols, imports)
|
|
37
|
+
2. You ask a question
|
|
38
|
+
3. Graph identifies the relevant files → packs them into context
|
|
39
|
+
4. Claude gets your question + the right code already loaded
|
|
40
|
+
5. Fewer turns, fewer tokens, better answers
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Token savings **compound** across a session. The graph remembers which files were read, edited, and queried — each turn gets cheaper.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Results
|
|
48
|
+
|
|
49
|
+
Benchmarked across 80+ prompts (5 complexity levels) on a real-world full-stack app:
|
|
50
|
+
|
|
51
|
+
| Metric | Without Dual-Graph | With Dual-Graph |
|
|
52
|
+
|--------|-------------------|-----------------|
|
|
53
|
+
| Avg cost per prompt | $0.46 | **$0.27** |
|
|
54
|
+
| Avg turns | 16.8 | **10.3** |
|
|
55
|
+
| Avg response time | 186s | **134s** |
|
|
56
|
+
| Quality (regex scorer) | 82.7/100 | **87.1/100** |
|
|
57
|
+
|
|
58
|
+
Cost wins on **16 out of 20** prompts. Quality equal or better on all complexity levels.
|
|
59
|
+
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
## Install
|
|
63
|
+
|
|
64
|
+
**macOS / Linux:**
|
|
65
|
+
```bash
|
|
66
|
+
curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash
|
|
67
|
+
source ~/.zshrc # or ~/.bashrc / ~/.profile
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
**Windows (PowerShell):**
|
|
71
|
+
```powershell
|
|
72
|
+
irm https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.ps1 | iex
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**Windows (Scoop):**
|
|
76
|
+
```powershell
|
|
77
|
+
scoop bucket add dual-graph https://github.com/kunal12203/scoop-dual-graph
|
|
78
|
+
scoop install dual-graph
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
**Prerequisites:** Python 3.10+, Node.js 18+, Claude Code or Codex CLI. The installer detects missing tools and offers to install them via winget (Windows) or homebrew (macOS).
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Usage
|
|
86
|
+
|
|
87
|
+
### Claude Code (`dgc`)
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
dgc # scan current directory, launch Claude
|
|
91
|
+
dgc /path/to/project # scan a specific project
|
|
92
|
+
dgc /path/to/project "fix the login bug" # start with a prompt
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
### Codex CLI (`dg`)
|
|
96
|
+
|
|
97
|
+
```bash
|
|
98
|
+
dg # scan current directory, launch Codex
|
|
99
|
+
dg /path/to/project # scan a specific project
|
|
100
|
+
dg /path/to/project "add tests" # start with a prompt
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Windows
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
dgc . # from inside the project directory
|
|
107
|
+
dgc "D:\projects\my-app" # any drive, any path
|
|
108
|
+
dg "C:\work\backend" # Codex CLI
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
---
|
|
112
|
+
|
|
113
|
+
## What It Does Under the Hood
|
|
114
|
+
|
|
115
|
+
1. **Scans your project** — extracts files, functions, classes, import relationships into a local graph.
|
|
116
|
+
2. **Pre-loads context** — when you ask a question, the graph ranks relevant files and packs them into the prompt before Claude sees it. No extra tool calls needed.
|
|
117
|
+
3. **Remembers across turns** — files you've read or edited are prioritized in future turns. Context compounds.
|
|
118
|
+
4. **MCP tools available** — Claude can still explore the codebase via graph-aware tools (`graph_read`, `graph_retrieve`, `graph_neighbors`, etc.) when it needs to go deeper.
|
|
119
|
+
|
|
120
|
+
All processing is local. No code leaves your machine.
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Data & Files
|
|
125
|
+
|
|
126
|
+
All data lives in `<project>/.dual-graph/` (gitignored automatically).
|
|
127
|
+
|
|
128
|
+
| File | Description |
|
|
129
|
+
|---|---|
|
|
130
|
+
| `info_graph.json` | Semantic graph of the project: files, symbols, edges |
|
|
131
|
+
| `chat_action_graph.json` | Session memory: reads, edits, queries, decisions |
|
|
132
|
+
| `context-store.json` | Persistent store for decisions/tasks/facts across sessions |
|
|
133
|
+
| `mcp_server.log` | MCP server logs |
|
|
134
|
+
|
|
135
|
+
Global files in `~/.dual-graph/`:
|
|
136
|
+
| File | Description |
|
|
137
|
+
|---|---|
|
|
138
|
+
| `dgc.ps1` / `dg.ps1` | Launcher scripts (auto-updated) |
|
|
139
|
+
| `venv/` | Python virtual environment for dependencies |
|
|
140
|
+
| `version.txt` | Current installed version |
|
|
141
|
+
|
|
142
|
+
---
|
|
143
|
+
|
|
144
|
+
## Configuration
|
|
145
|
+
|
|
146
|
+
All optional, via environment variables:
|
|
147
|
+
|
|
148
|
+
| Variable | Default | Description |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `DG_HARD_MAX_READ_CHARS` | `4000` | Max characters per file read |
|
|
151
|
+
| `DG_TURN_READ_BUDGET_CHARS` | `18000` | Total read budget per turn |
|
|
152
|
+
| `DG_FALLBACK_MAX_CALLS_PER_TURN` | `1` | Max fallback grep calls per turn |
|
|
153
|
+
| `DG_RETRIEVE_CACHE_TTL_SEC` | `900` | Retrieval cache TTL (15 min) |
|
|
154
|
+
| `DG_MCP_PORT` | auto (8080-8099) | Force a specific MCP server port |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Context Store
|
|
159
|
+
|
|
160
|
+
Decisions, tasks, and facts from your sessions are persisted in `.dual-graph/context-store.json` and re-injected at the start of the next session. This gives Claude continuity across conversations.
|
|
161
|
+
|
|
162
|
+
You can also create a `CONTEXT.md` in your project root for free-form session notes.
|
|
163
|
+
|
|
164
|
+
---
|
|
165
|
+
|
|
166
|
+
## Token Tracking
|
|
167
|
+
|
|
168
|
+
A token-counter dashboard is registered automatically with Claude Code:
|
|
169
|
+
|
|
170
|
+
```
|
|
171
|
+
http://localhost:8899
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
Usage from inside a Claude session:
|
|
175
|
+
```
|
|
176
|
+
count_tokens({text: "<content>"}) # estimate tokens before reading
|
|
177
|
+
get_session_stats() # running session cost
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## Self-Update
|
|
183
|
+
|
|
184
|
+
The launcher checks for updates on every run and auto-updates if a new version is available. No manual intervention needed.
|
|
185
|
+
|
|
186
|
+
Current version: **3.8.55**
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Privacy & Security
|
|
191
|
+
|
|
192
|
+
- **All project data stays local.** Graphs, session data, and code never leave your machine.
|
|
193
|
+
- The only outbound calls are:
|
|
194
|
+
- **Version check** — fetches a version string (no project data).
|
|
195
|
+
- **Heartbeat** — sends `machine_id` and `platform` only. No file names, no code.
|
|
196
|
+
- **One-time feedback** — optional rating after first day of use.
|
|
197
|
+
- `.dual-graph/` is automatically added to `.gitignore`.
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Community
|
|
202
|
+
|
|
203
|
+
Have a question, found a bug, or want to share feedback?
|
|
204
|
+
|
|
205
|
+
**Join the Discord: [discord.gg/rxgVVgCh](https://discord.gg/rxgVVgCh)**
|
|
206
|
+
|
|
207
|
+
- Get help with setup
|
|
208
|
+
- Report bugs
|
|
209
|
+
- Share workflows
|
|
210
|
+
- Follow releases
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
# Dual-Graph — Compounding Context for Claude Code & Codex CLI
|
|
2
|
+
|
|
3
|
+
A context engine that makes Claude Code and Codex CLI **30-45% cheaper** without sacrificing quality. It builds a semantic graph of your codebase and pre-loads the right files into every prompt — so Claude spends tokens reasoning, not exploring.
|
|
4
|
+
|
|
5
|
+
Works on **macOS, Linux, and Windows**. Supports any project size.
|
|
6
|
+
|
|
7
|
+
**Join the community: [discord.gg/rxgVVgCh](https://discord.gg/rxgVVgCh)**
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## How It Works
|
|
12
|
+
|
|
13
|
+
```
|
|
14
|
+
You run: dgc /path/to/project
|
|
15
|
+
↓
|
|
16
|
+
1. Project scanned → semantic graph built (files, symbols, imports)
|
|
17
|
+
2. You ask a question
|
|
18
|
+
3. Graph identifies the relevant files → packs them into context
|
|
19
|
+
4. Claude gets your question + the right code already loaded
|
|
20
|
+
5. Fewer turns, fewer tokens, better answers
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Token savings **compound** across a session. The graph remembers which files were read, edited, and queried — each turn gets cheaper.
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Results
|
|
28
|
+
|
|
29
|
+
Benchmarked across 80+ prompts (5 complexity levels) on a real-world full-stack app:
|
|
30
|
+
|
|
31
|
+
| Metric | Without Dual-Graph | With Dual-Graph |
|
|
32
|
+
|--------|-------------------|-----------------|
|
|
33
|
+
| Avg cost per prompt | $0.46 | **$0.27** |
|
|
34
|
+
| Avg turns | 16.8 | **10.3** |
|
|
35
|
+
| Avg response time | 186s | **134s** |
|
|
36
|
+
| Quality (regex scorer) | 82.7/100 | **87.1/100** |
|
|
37
|
+
|
|
38
|
+
Cost wins on **16 out of 20** prompts. Quality equal or better on all complexity levels.
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
42
|
+
## Install
|
|
43
|
+
|
|
44
|
+
**macOS / Linux:**
|
|
45
|
+
```bash
|
|
46
|
+
curl -sSL https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.sh | bash
|
|
47
|
+
source ~/.zshrc # or ~/.bashrc / ~/.profile
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
**Windows (PowerShell):**
|
|
51
|
+
```powershell
|
|
52
|
+
irm https://raw.githubusercontent.com/kunal12203/Codex-CLI-Compact/main/install.ps1 | iex
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**Windows (Scoop):**
|
|
56
|
+
```powershell
|
|
57
|
+
scoop bucket add dual-graph https://github.com/kunal12203/scoop-dual-graph
|
|
58
|
+
scoop install dual-graph
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
**Prerequisites:** Python 3.10+, Node.js 18+, Claude Code or Codex CLI. The installer detects missing tools and offers to install them via winget (Windows) or homebrew (macOS).
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Usage
|
|
66
|
+
|
|
67
|
+
### Claude Code (`dgc`)
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
dgc # scan current directory, launch Claude
|
|
71
|
+
dgc /path/to/project # scan a specific project
|
|
72
|
+
dgc /path/to/project "fix the login bug" # start with a prompt
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Codex CLI (`dg`)
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
dg # scan current directory, launch Codex
|
|
79
|
+
dg /path/to/project # scan a specific project
|
|
80
|
+
dg /path/to/project "add tests" # start with a prompt
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Windows
|
|
84
|
+
|
|
85
|
+
```powershell
|
|
86
|
+
dgc . # from inside the project directory
|
|
87
|
+
dgc "D:\projects\my-app" # any drive, any path
|
|
88
|
+
dg "C:\work\backend" # Codex CLI
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## What It Does Under the Hood
|
|
94
|
+
|
|
95
|
+
1. **Scans your project** — extracts files, functions, classes, import relationships into a local graph.
|
|
96
|
+
2. **Pre-loads context** — when you ask a question, the graph ranks relevant files and packs them into the prompt before Claude sees it. No extra tool calls needed.
|
|
97
|
+
3. **Remembers across turns** — files you've read or edited are prioritized in future turns. Context compounds.
|
|
98
|
+
4. **MCP tools available** — Claude can still explore the codebase via graph-aware tools (`graph_read`, `graph_retrieve`, `graph_neighbors`, etc.) when it needs to go deeper.
|
|
99
|
+
|
|
100
|
+
All processing is local. No code leaves your machine.
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Data & Files
|
|
105
|
+
|
|
106
|
+
All data lives in `<project>/.dual-graph/` (gitignored automatically).
|
|
107
|
+
|
|
108
|
+
| File | Description |
|
|
109
|
+
|---|---|
|
|
110
|
+
| `info_graph.json` | Semantic graph of the project: files, symbols, edges |
|
|
111
|
+
| `chat_action_graph.json` | Session memory: reads, edits, queries, decisions |
|
|
112
|
+
| `context-store.json` | Persistent store for decisions/tasks/facts across sessions |
|
|
113
|
+
| `mcp_server.log` | MCP server logs |
|
|
114
|
+
|
|
115
|
+
Global files in `~/.dual-graph/`:
|
|
116
|
+
| File | Description |
|
|
117
|
+
|---|---|
|
|
118
|
+
| `dgc.ps1` / `dg.ps1` | Launcher scripts (auto-updated) |
|
|
119
|
+
| `venv/` | Python virtual environment for dependencies |
|
|
120
|
+
| `version.txt` | Current installed version |
|
|
121
|
+
|
|
122
|
+
---
|
|
123
|
+
|
|
124
|
+
## Configuration
|
|
125
|
+
|
|
126
|
+
All optional, via environment variables:
|
|
127
|
+
|
|
128
|
+
| Variable | Default | Description |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| `DG_HARD_MAX_READ_CHARS` | `4000` | Max characters per file read |
|
|
131
|
+
| `DG_TURN_READ_BUDGET_CHARS` | `18000` | Total read budget per turn |
|
|
132
|
+
| `DG_FALLBACK_MAX_CALLS_PER_TURN` | `1` | Max fallback grep calls per turn |
|
|
133
|
+
| `DG_RETRIEVE_CACHE_TTL_SEC` | `900` | Retrieval cache TTL (15 min) |
|
|
134
|
+
| `DG_MCP_PORT` | auto (8080-8099) | Force a specific MCP server port |
|
|
135
|
+
|
|
136
|
+
---
|
|
137
|
+
|
|
138
|
+
## Context Store
|
|
139
|
+
|
|
140
|
+
Decisions, tasks, and facts from your sessions are persisted in `.dual-graph/context-store.json` and re-injected at the start of the next session. This gives Claude continuity across conversations.
|
|
141
|
+
|
|
142
|
+
You can also create a `CONTEXT.md` in your project root for free-form session notes.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Token Tracking
|
|
147
|
+
|
|
148
|
+
A token-counter dashboard is registered automatically with Claude Code:
|
|
149
|
+
|
|
150
|
+
```
|
|
151
|
+
http://localhost:8899
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
Usage from inside a Claude session:
|
|
155
|
+
```
|
|
156
|
+
count_tokens({text: "<content>"}) # estimate tokens before reading
|
|
157
|
+
get_session_stats() # running session cost
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
---
|
|
161
|
+
|
|
162
|
+
## Self-Update
|
|
163
|
+
|
|
164
|
+
The launcher checks for updates on every run and auto-updates if a new version is available. No manual intervention needed.
|
|
165
|
+
|
|
166
|
+
Current version: **3.8.55**
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
## Privacy & Security
|
|
171
|
+
|
|
172
|
+
- **All project data stays local.** Graphs, session data, and code never leave your machine.
|
|
173
|
+
- The only outbound calls are:
|
|
174
|
+
- **Version check** — fetches a version string (no project data).
|
|
175
|
+
- **Heartbeat** — sends `machine_id` and `platform` only. No file names, no code.
|
|
176
|
+
- **One-time feedback** — optional rating after first day of use.
|
|
177
|
+
- `.dual-graph/` is automatically added to `.gitignore`.
|
|
178
|
+
|
|
179
|
+
---
|
|
180
|
+
|
|
181
|
+
## Community
|
|
182
|
+
|
|
183
|
+
Have a question, found a bug, or want to share feedback?
|
|
184
|
+
|
|
185
|
+
**Join the Discord: [discord.gg/rxgVVgCh](https://discord.gg/rxgVVgCh)**
|
|
186
|
+
|
|
187
|
+
- Get help with setup
|
|
188
|
+
- Report bugs
|
|
189
|
+
- Share workflows
|
|
190
|
+
- Follow releases
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=68.0", "wheel", "Cython>=3.0"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "graperoot"
|
|
7
|
+
version = "3.8.69"
|
|
8
|
+
description = "GrapeRoot — graph-based context engine for AI coding agents"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = {text = "Proprietary"}
|
|
11
|
+
requires-python = ">=3.10"
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "Kunal", email = "kunal12203@users.noreply.github.com"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["claude", "mcp", "code-graph", "context", "ai"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"Programming Language :: Cython",
|
|
21
|
+
"Topic :: Software Development :: Libraries",
|
|
22
|
+
]
|
|
23
|
+
dependencies = [
|
|
24
|
+
"mcp>=1.3.0",
|
|
25
|
+
"uvicorn>=0.27.0",
|
|
26
|
+
"anyio>=4.0",
|
|
27
|
+
"starlette>=0.36.0",
|
|
28
|
+
]
|
|
29
|
+
|
|
30
|
+
[project.scripts]
|
|
31
|
+
graph-builder = "graperoot.graph_builder:main"
|
|
32
|
+
dg = "graperoot.dg:main"
|
|
33
|
+
context-packer = "graperoot.context_packer:main"
|
|
34
|
+
dgc-claude = "graperoot.dgc_claude:main"
|
|
35
|
+
mcp-graph-server = "graperoot.mcp_graph_server:main"
|
|
36
|
+
|
|
37
|
+
[project.urls]
|
|
38
|
+
Homepage = "https://github.com/kunal12203/Codex-CLI-Compact"
|
|
39
|
+
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
where = ["src"]
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"""Cython build configuration for dual-graph.
|
|
2
|
+
|
|
3
|
+
Compiles core .py modules to native C extensions (.so / .pyd).
|
|
4
|
+
mcp_graph_server is excluded (async decorators incompatible with Cython).
|
|
5
|
+
Strips .py source and .c intermediates from the wheel.
|
|
6
|
+
"""
|
|
7
|
+
import os
|
|
8
|
+
import shutil
|
|
9
|
+
from setuptools import setup, Extension
|
|
10
|
+
from setuptools.command.build_ext import build_ext as _build_ext
|
|
11
|
+
from Cython.Build import cythonize
|
|
12
|
+
|
|
13
|
+
# Core modules — no async frameworks, pure stdlib + internal imports
|
|
14
|
+
COMPILED_MODULES = [
|
|
15
|
+
"graph_builder",
|
|
16
|
+
"dg",
|
|
17
|
+
"context_packer",
|
|
18
|
+
"dgc_claude",
|
|
19
|
+
]
|
|
20
|
+
|
|
21
|
+
modules = [f"src/graperoot/{m}.py" for m in COMPILED_MODULES]
|
|
22
|
+
|
|
23
|
+
extensions = [
|
|
24
|
+
Extension(
|
|
25
|
+
name=f"graperoot.{mod.split('/')[-1].replace('.py', '')}",
|
|
26
|
+
sources=[mod],
|
|
27
|
+
)
|
|
28
|
+
for mod in modules
|
|
29
|
+
]
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
class build_ext(_build_ext):
|
|
33
|
+
"""After building extensions, remove .py and .c files from build dir."""
|
|
34
|
+
def run(self):
|
|
35
|
+
super().run()
|
|
36
|
+
# Find the build lib directory
|
|
37
|
+
build_lib = self.build_lib
|
|
38
|
+
pkg_dir = os.path.join(build_lib, "graperoot")
|
|
39
|
+
if not os.path.isdir(pkg_dir):
|
|
40
|
+
return
|
|
41
|
+
for name in COMPILED_MODULES:
|
|
42
|
+
# Remove .py source (keep only .so/.pyd)
|
|
43
|
+
py_file = os.path.join(pkg_dir, f"{name}.py")
|
|
44
|
+
if os.path.exists(py_file):
|
|
45
|
+
os.remove(py_file)
|
|
46
|
+
# Remove .c intermediate
|
|
47
|
+
c_file = os.path.join(pkg_dir, f"{name}.c")
|
|
48
|
+
if os.path.exists(c_file):
|
|
49
|
+
os.remove(c_file)
|
|
50
|
+
# Also remove .c from src/ so they don't get picked up
|
|
51
|
+
src_dir = os.path.join(os.path.dirname(__file__), "src", "graperoot")
|
|
52
|
+
for name in COMPILED_MODULES + ["mcp_graph_server"]:
|
|
53
|
+
c_file = os.path.join(src_dir, f"{name}.c")
|
|
54
|
+
if os.path.exists(c_file):
|
|
55
|
+
os.remove(c_file)
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
setup(
|
|
59
|
+
ext_modules=cythonize(
|
|
60
|
+
extensions,
|
|
61
|
+
compiler_directives={
|
|
62
|
+
"language_level": "3",
|
|
63
|
+
"embedsignature": False,
|
|
64
|
+
"emit_code_comments": False,
|
|
65
|
+
},
|
|
66
|
+
nthreads=0,
|
|
67
|
+
),
|
|
68
|
+
cmdclass={"build_ext": build_ext},
|
|
69
|
+
)
|