depradar 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.
@@ -0,0 +1,28 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # Distribution / packaging
7
+ dist/
8
+ build/
9
+ *.egg-info/
10
+ .eggs/
11
+
12
+ # Virtual environments
13
+ .venv/
14
+ env/
15
+ venv/
16
+
17
+ # IDE / Editor files
18
+ .idea/
19
+ .vscode/
20
+ *.swp
21
+ *.swo
22
+
23
+ # Output reports
24
+ *.html
25
+ !docs/*.html
26
+ !src/depradar/templates/*.html
27
+ *.json
28
+
depradar-0.1.0/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mohammed Pahadwala
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,234 @@
1
+ Metadata-Version: 2.5
2
+ Name: depradar
3
+ Version: 0.1.0
4
+ Summary: Interactive System & Package Dependency Radar with force-directed graph & AI agent MCP server
5
+ Project-URL: Homepage, https://github.com/mdphd97/depradar
6
+ Project-URL: Documentation, https://mdphd97.github.io/depradar/
7
+ Project-URL: Repository, https://github.com/mdphd97/depradar.git
8
+ Project-URL: Issues, https://github.com/mdphd97/depradar/issues
9
+ Author-email: Mohammed Pahadwala <mohammedpahadwala97@gmail.com>
10
+ License: MIT
11
+ License-File: LICENSE
12
+ Keywords: ai-agents,dependency-graph,developer-tools,disk-usage,mcp-server,virtualenv,visualization
13
+ Classifier: Development Status :: 4 - Beta
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: License :: OSI Approved :: MIT License
17
+ Classifier: Operating System :: OS Independent
18
+ Classifier: Programming Language :: Python :: 3
19
+ Classifier: Programming Language :: Python :: 3.9
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Topic :: Software Development :: Build Tools
25
+ Classifier: Topic :: System :: Systems Administration
26
+ Requires-Python: >=3.9
27
+ Description-Content-Type: text/markdown
28
+
29
+ # 📡 DepRadar
30
+
31
+ > **Interactive System & Package Dependency Radar**
32
+ > Turn your developer environment into a force-directed visual network map. Discover forgotten packages, identify heavyweight runtimes, and track stale experiments.
33
+
34
+ [![Python](https://img.shields.io/badge/Python-3.9+-3776AB?logo=python&logoColor=white)](https://python.org)
35
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
36
+ [![Live Demo](https://img.shields.io/badge/Live%20Demo-GitHub%20Pages-38BDF8?logo=github)](https://mdphd97.github.io/depradar/)
37
+ [![Zero Setup](https://img.shields.io/badge/Viewer-Zero--Dependency%20HTML-10B981)](#)
38
+ [![Cross Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey)](#)
39
+ [![MCP Ready](https://img.shields.io/badge/AI%20Agents-MCP%20Native-8B5CF6)](#)
40
+
41
+ ---
42
+
43
+ ## 🌟 Overview
44
+
45
+ When building AI workflows, running web scraping experiments, and testing new libraries, workstations accumulate dozens of virtualenvs, global NPM packages, container runtimes, and background daemons. **DepRadar** scans your machine and generates an interactive, force-directed dependency graph that makes storage footprints and relationships crystal clear.
46
+
47
+ ---
48
+
49
+ ## 📸 Screenshots & Showcase
50
+
51
+ ### 1. Force-Directed Constellation View
52
+ *Explore runtime engines, container daemons, virtual environments, and developer suites grouped cleanly into outer macro-clusters.*
53
+ ![DepRadar Overview](docs/assets/depradar_overview.png)
54
+
55
+ ### 2. Deep Inspector Drawer & 1-Click Cleanup
56
+ *Click any node to smoothly fly in, inspect upstream runtime requirements, downstream dependent projects, full package manifests with versions, and grab clipboard-ready deletion commands.*
57
+ ![DepRadar Inspector Drawer](docs/assets/depradar_drawer.png)
58
+
59
+ ### 3. Link Hover & Relationship Explanations
60
+ *Hover over any connection to reveal the exact nature of the dependency and how your tools interact under the hood.*
61
+ ![DepRadar Link Hover](docs/assets/depradar_hover.png)
62
+
63
+ ---
64
+
65
+ ## ✨ Features
66
+
67
+ - 🌐 **Force-Directed Physics Graph**: Smooth 60fps canvas visualizer powered by D3/Force-Graph with drag, zoom, and perimeter macro-clustering.
68
+ - 📦 **Multi-Ecosystem Cartography**:
69
+ - **Python**: Scans virtual environments (`.venv`), `uv` tools, and active package dependencies.
70
+ - **Node.js**: Maps global NPM CLI utilities and local project engines.
71
+ - **Desktop & Snaps**: Identifies containerized Snap applications and heavy compatibility layers (e.g., Wine runtimes).
72
+ - **APT & Developer Suites**: Maps Docker daemons, XeLaTeX suites, and native packages.
73
+ - **Standalone Tools**: Detects unmanaged toolkits like IBM CPLEX and desktop Electron runtimes.
74
+ - ⚖️ **Proportional Disk Sizing**: Node radius scales dynamically with storage consumption—heavy 1.5 GB+ runtimes immediately stand out.
75
+ - 🚦 **Freshness & Stale Detection**:
76
+ - 🟢 **Active**: Used within 14 days.
77
+ - 🟡 **Inactive**: 14–30 days idle.
78
+ - 🔴 **Stale**: 30+ days untouched (candidates for deletion).
79
+ - 🔍 **Instant Search & Category Filtering**: Hotkey `/` for rapid search, plus one-click filters for AI Stack, Data Science, Snaps, and Stale Items.
80
+ - 🛠️ **Deep Inspector & 1-Click Cleanup**: Slide-out drawer displaying upstream requirements, downstream dependents, file paths, and clipboard-ready uninstall commands.
81
+ - ⚡ **Zero-Dependency Portable Output**: Emits a single self-contained `.html` file that can be opened in any modern browser without running a server.
82
+ - 💻 **Cross-Platform (Linux, macOS, Windows)**:
83
+ - **Linux**: APT packages, Snap daemons, Flatpak, Docker, NVIDIA GPU.
84
+ - **macOS**: Homebrew formulae/casks, `/Applications`, Apple Metal GPU acceleration.
85
+ - **Windows**: Winget, Scoop, Chocolatey, `%LOCALAPPDATA%`, Windows Terminal, WSL.
86
+ - 🤖 **AI-Agent Ready & MCP Native**:
87
+ - **MCP Server (`depradar mcp`)**: Plug DepRadar directly into Claude Desktop, Cursor, Windsurf, or Antigravity via Model Context Protocol.
88
+ - **Fast Query Engine (`depradar query <pkg> --json`)**: Instant CLI dependency and usage lookup for AI agents.
89
+ - **Stale Pruning (`depradar stale --json`)**: Programmatic cleanup automation for autonomous agents.
90
+ - **Agent Context Generator (`depradar agent-context`)**: Emits compact, token-efficient system context briefings for LLM prompts.
91
+
92
+ ---
93
+
94
+ ## 🚀 Quick Start
95
+
96
+ ### Installation
97
+
98
+ ### Installation & Instant Run
99
+
100
+ ```bash
101
+ # Instant one-liner without permanent installation (recommended)
102
+ uvx depradar
103
+
104
+ # Or install globally via pip
105
+ pip install depradar
106
+
107
+ # Or install as an isolated global CLI via uv
108
+ uv tool install depradar
109
+ ```
110
+
111
+ <details>
112
+ <summary>🛠️ Local Development Installation</summary>
113
+
114
+ ```bash
115
+ # Clone the repository
116
+ git clone https://github.com/mdphd97/depradar.git
117
+ cd depradar
118
+
119
+ # Install in editable mode
120
+ pip install -e .
121
+ ```
122
+ </details>
123
+
124
+ ---
125
+
126
+ ### Usage
127
+
128
+ ```bash
129
+ # Scan your system and automatically launch the interactive graph in your default browser
130
+ depradar
131
+
132
+ # Or explicitly run scan with flags
133
+ depradar scan --open
134
+
135
+ # Save graph to a specific location
136
+ depradar scan -o ~/Desktop/system_radar.html
137
+
138
+ # Export graph data as raw JSON for custom analysis
139
+ depradar export -o graph_data.json
140
+ ```
141
+
142
+ ---
143
+
144
+ ## 🤖 AI Agent & MCP Server Integration
145
+
146
+ DepRadar natively integrates with AI coding assistants (Claude Desktop, Cursor, Antigravity, Windsurf, Aider):
147
+
148
+ ### 1. Model Context Protocol (MCP) Server
149
+ Add DepRadar to your `claude_desktop_config.json` or `.cursor/mcp.json`:
150
+ ```json
151
+ {
152
+ "mcpServers": {
153
+ "depradar": {
154
+ "command": "depradar",
155
+ "args": ["mcp"]
156
+ }
157
+ }
158
+ }
159
+ ```
160
+
161
+ #### Available MCP Tools:
162
+ * `depradar_get_system_overview`: High-level inventory of runtimes, disk sizes, and OS info.
163
+ * `depradar_query_dependency`: Inquires which projects import a library and which runtime powers it.
164
+ * `depradar_list_stale_dependencies`: Surfaces unreferenced or idle packages with cleanup commands.
165
+ * `depradar_get_full_graph`: Emits complete dependency graph.
166
+
167
+ ### 2. CLI for AI Subagents & Automation Scripts
168
+ ```bash
169
+ # Query any dependency in JSON
170
+ depradar query selenium --json
171
+
172
+ # List stale items and cleanup commands for automated maintenance
173
+ depradar stale --json
174
+
175
+ # Generate an LLM-optimized Markdown briefing for system prompts / CLAUDE.md
176
+ depradar agent-context
177
+ ```
178
+
179
+ ---
180
+
181
+ ## 🗺️ How DepRadar Maps Dependencies
182
+
183
+ ```
184
+ [ Ubuntu APT / Homebrew / Winget ] ──► [ Developer Suites ] ──┐
185
+ ▼
186
+ [ Node.js Runtime (v20) ] ──────────► [ Fullstack Web Apps ] ─┘
187
+ │
188
+ ├──────────────────────────► [ agent-browser CLI ]
189
+ │
190
+ └──────────────────────────► [ firecrawl-cli ]
191
+
192
+ [ Snap / App Sandbox ] ─────────────► [ Wine Runtimes (~1.5GB) ] ─► [ Standalone Apps ]
193
+ ```
194
+
195
+ ---
196
+
197
+ ## ⌨️ Shortcuts & Viewer Controls
198
+
199
+ | Key / Action | Action |
200
+ | :--- | :--- |
201
+ | **`/`** | Focus search bar |
202
+ | **`Esc`** | Close node inspector drawer |
203
+ | **Click Node** | Smoothly zoom in & open inspector |
204
+ | **Click Background** | Close drawer |
205
+ | **`🎯` (Center)** | Fit graph to viewport |
206
+ | **`⏸️` / `▶️`** | Freeze / resume physics simulation |
207
+
208
+ ---
209
+
210
+ ## 💻 Supported Environments
211
+
212
+ | Platform | Package Managers & Runtimes Detected | Hardware Acceleration |
213
+ | :--- | :--- | :--- |
214
+ | **Linux** | APT, Snap, Flatpak, Docker, UV Tools, Global NPM | NVIDIA CUDA / GeForce |
215
+ | **macOS** | Homebrew (Formulae & Casks), `/Applications`, Pipx, UV Tools | Apple Silicon Metal GPU |
216
+ | **Windows** | Winget, Scoop, Chocolatey, PowerShell, WSL2, LocalAppData | Direct3D / Vulkan |
217
+
218
+ ---
219
+
220
+ ## 🤝 Contributing
221
+
222
+ Contributions are welcome! If you want to add scanners for additional package managers, container runtimes, or custom desktop suites, feel free to submit a pull request or open an issue.
223
+
224
+ 1. Fork the Project
225
+ 2. Create your Feature Branch (`git checkout -b feat/new-scanner`)
226
+ 3. Commit your Changes (`git commit -m 'feat: add podman container scanner'`)
227
+ 4. Push to the Branch (`git push origin feat/new-scanner`)
228
+ 5. Open a Pull Request
229
+
230
+ ---
231
+
232
+ ## 📄 License
233
+
234
+ Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,206 @@
1
+ # 📡 DepRadar
2
+
3
+ > **Interactive System & Package Dependency Radar**
4
+ > Turn your developer environment into a force-directed visual network map. Discover forgotten packages, identify heavyweight runtimes, and track stale experiments.
5
+
6
+ [![Python](https://img.shields.io/badge/Python-3.9+-3776AB?logo=python&logoColor=white)](https://python.org)
7
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
8
+ [![Live Demo](https://img.shields.io/badge/Live%20Demo-GitHub%20Pages-38BDF8?logo=github)](https://mdphd97.github.io/depradar/)
9
+ [![Zero Setup](https://img.shields.io/badge/Viewer-Zero--Dependency%20HTML-10B981)](#)
10
+ [![Cross Platform](https://img.shields.io/badge/Platform-Linux%20%7C%20macOS%20%7C%20Windows-lightgrey)](#)
11
+ [![MCP Ready](https://img.shields.io/badge/AI%20Agents-MCP%20Native-8B5CF6)](#)
12
+
13
+ ---
14
+
15
+ ## 🌟 Overview
16
+
17
+ When building AI workflows, running web scraping experiments, and testing new libraries, workstations accumulate dozens of virtualenvs, global NPM packages, container runtimes, and background daemons. **DepRadar** scans your machine and generates an interactive, force-directed dependency graph that makes storage footprints and relationships crystal clear.
18
+
19
+ ---
20
+
21
+ ## 📸 Screenshots & Showcase
22
+
23
+ ### 1. Force-Directed Constellation View
24
+ *Explore runtime engines, container daemons, virtual environments, and developer suites grouped cleanly into outer macro-clusters.*
25
+ ![DepRadar Overview](docs/assets/depradar_overview.png)
26
+
27
+ ### 2. Deep Inspector Drawer & 1-Click Cleanup
28
+ *Click any node to smoothly fly in, inspect upstream runtime requirements, downstream dependent projects, full package manifests with versions, and grab clipboard-ready deletion commands.*
29
+ ![DepRadar Inspector Drawer](docs/assets/depradar_drawer.png)
30
+
31
+ ### 3. Link Hover & Relationship Explanations
32
+ *Hover over any connection to reveal the exact nature of the dependency and how your tools interact under the hood.*
33
+ ![DepRadar Link Hover](docs/assets/depradar_hover.png)
34
+
35
+ ---
36
+
37
+ ## ✨ Features
38
+
39
+ - 🌐 **Force-Directed Physics Graph**: Smooth 60fps canvas visualizer powered by D3/Force-Graph with drag, zoom, and perimeter macro-clustering.
40
+ - 📦 **Multi-Ecosystem Cartography**:
41
+ - **Python**: Scans virtual environments (`.venv`), `uv` tools, and active package dependencies.
42
+ - **Node.js**: Maps global NPM CLI utilities and local project engines.
43
+ - **Desktop & Snaps**: Identifies containerized Snap applications and heavy compatibility layers (e.g., Wine runtimes).
44
+ - **APT & Developer Suites**: Maps Docker daemons, XeLaTeX suites, and native packages.
45
+ - **Standalone Tools**: Detects unmanaged toolkits like IBM CPLEX and desktop Electron runtimes.
46
+ - ⚖️ **Proportional Disk Sizing**: Node radius scales dynamically with storage consumption—heavy 1.5 GB+ runtimes immediately stand out.
47
+ - 🚦 **Freshness & Stale Detection**:
48
+ - 🟢 **Active**: Used within 14 days.
49
+ - 🟡 **Inactive**: 14–30 days idle.
50
+ - 🔴 **Stale**: 30+ days untouched (candidates for deletion).
51
+ - 🔍 **Instant Search & Category Filtering**: Hotkey `/` for rapid search, plus one-click filters for AI Stack, Data Science, Snaps, and Stale Items.
52
+ - 🛠️ **Deep Inspector & 1-Click Cleanup**: Slide-out drawer displaying upstream requirements, downstream dependents, file paths, and clipboard-ready uninstall commands.
53
+ - ⚡ **Zero-Dependency Portable Output**: Emits a single self-contained `.html` file that can be opened in any modern browser without running a server.
54
+ - 💻 **Cross-Platform (Linux, macOS, Windows)**:
55
+ - **Linux**: APT packages, Snap daemons, Flatpak, Docker, NVIDIA GPU.
56
+ - **macOS**: Homebrew formulae/casks, `/Applications`, Apple Metal GPU acceleration.
57
+ - **Windows**: Winget, Scoop, Chocolatey, `%LOCALAPPDATA%`, Windows Terminal, WSL.
58
+ - 🤖 **AI-Agent Ready & MCP Native**:
59
+ - **MCP Server (`depradar mcp`)**: Plug DepRadar directly into Claude Desktop, Cursor, Windsurf, or Antigravity via Model Context Protocol.
60
+ - **Fast Query Engine (`depradar query <pkg> --json`)**: Instant CLI dependency and usage lookup for AI agents.
61
+ - **Stale Pruning (`depradar stale --json`)**: Programmatic cleanup automation for autonomous agents.
62
+ - **Agent Context Generator (`depradar agent-context`)**: Emits compact, token-efficient system context briefings for LLM prompts.
63
+
64
+ ---
65
+
66
+ ## 🚀 Quick Start
67
+
68
+ ### Installation
69
+
70
+ ### Installation & Instant Run
71
+
72
+ ```bash
73
+ # Instant one-liner without permanent installation (recommended)
74
+ uvx depradar
75
+
76
+ # Or install globally via pip
77
+ pip install depradar
78
+
79
+ # Or install as an isolated global CLI via uv
80
+ uv tool install depradar
81
+ ```
82
+
83
+ <details>
84
+ <summary>🛠️ Local Development Installation</summary>
85
+
86
+ ```bash
87
+ # Clone the repository
88
+ git clone https://github.com/mdphd97/depradar.git
89
+ cd depradar
90
+
91
+ # Install in editable mode
92
+ pip install -e .
93
+ ```
94
+ </details>
95
+
96
+ ---
97
+
98
+ ### Usage
99
+
100
+ ```bash
101
+ # Scan your system and automatically launch the interactive graph in your default browser
102
+ depradar
103
+
104
+ # Or explicitly run scan with flags
105
+ depradar scan --open
106
+
107
+ # Save graph to a specific location
108
+ depradar scan -o ~/Desktop/system_radar.html
109
+
110
+ # Export graph data as raw JSON for custom analysis
111
+ depradar export -o graph_data.json
112
+ ```
113
+
114
+ ---
115
+
116
+ ## 🤖 AI Agent & MCP Server Integration
117
+
118
+ DepRadar natively integrates with AI coding assistants (Claude Desktop, Cursor, Antigravity, Windsurf, Aider):
119
+
120
+ ### 1. Model Context Protocol (MCP) Server
121
+ Add DepRadar to your `claude_desktop_config.json` or `.cursor/mcp.json`:
122
+ ```json
123
+ {
124
+ "mcpServers": {
125
+ "depradar": {
126
+ "command": "depradar",
127
+ "args": ["mcp"]
128
+ }
129
+ }
130
+ }
131
+ ```
132
+
133
+ #### Available MCP Tools:
134
+ * `depradar_get_system_overview`: High-level inventory of runtimes, disk sizes, and OS info.
135
+ * `depradar_query_dependency`: Inquires which projects import a library and which runtime powers it.
136
+ * `depradar_list_stale_dependencies`: Surfaces unreferenced or idle packages with cleanup commands.
137
+ * `depradar_get_full_graph`: Emits complete dependency graph.
138
+
139
+ ### 2. CLI for AI Subagents & Automation Scripts
140
+ ```bash
141
+ # Query any dependency in JSON
142
+ depradar query selenium --json
143
+
144
+ # List stale items and cleanup commands for automated maintenance
145
+ depradar stale --json
146
+
147
+ # Generate an LLM-optimized Markdown briefing for system prompts / CLAUDE.md
148
+ depradar agent-context
149
+ ```
150
+
151
+ ---
152
+
153
+ ## 🗺️ How DepRadar Maps Dependencies
154
+
155
+ ```
156
+ [ Ubuntu APT / Homebrew / Winget ] ──► [ Developer Suites ] ──┐
157
+ ▼
158
+ [ Node.js Runtime (v20) ] ──────────► [ Fullstack Web Apps ] ─┘
159
+ │
160
+ ├──────────────────────────► [ agent-browser CLI ]
161
+ │
162
+ └──────────────────────────► [ firecrawl-cli ]
163
+
164
+ [ Snap / App Sandbox ] ─────────────► [ Wine Runtimes (~1.5GB) ] ─► [ Standalone Apps ]
165
+ ```
166
+
167
+ ---
168
+
169
+ ## ⌨️ Shortcuts & Viewer Controls
170
+
171
+ | Key / Action | Action |
172
+ | :--- | :--- |
173
+ | **`/`** | Focus search bar |
174
+ | **`Esc`** | Close node inspector drawer |
175
+ | **Click Node** | Smoothly zoom in & open inspector |
176
+ | **Click Background** | Close drawer |
177
+ | **`🎯` (Center)** | Fit graph to viewport |
178
+ | **`⏸️` / `▶️`** | Freeze / resume physics simulation |
179
+
180
+ ---
181
+
182
+ ## 💻 Supported Environments
183
+
184
+ | Platform | Package Managers & Runtimes Detected | Hardware Acceleration |
185
+ | :--- | :--- | :--- |
186
+ | **Linux** | APT, Snap, Flatpak, Docker, UV Tools, Global NPM | NVIDIA CUDA / GeForce |
187
+ | **macOS** | Homebrew (Formulae & Casks), `/Applications`, Pipx, UV Tools | Apple Silicon Metal GPU |
188
+ | **Windows** | Winget, Scoop, Chocolatey, PowerShell, WSL2, LocalAppData | Direct3D / Vulkan |
189
+
190
+ ---
191
+
192
+ ## 🤝 Contributing
193
+
194
+ Contributions are welcome! If you want to add scanners for additional package managers, container runtimes, or custom desktop suites, feel free to submit a pull request or open an issue.
195
+
196
+ 1. Fork the Project
197
+ 2. Create your Feature Branch (`git checkout -b feat/new-scanner`)
198
+ 3. Commit your Changes (`git commit -m 'feat: add podman container scanner'`)
199
+ 4. Push to the Branch (`git push origin feat/new-scanner`)
200
+ 5. Open a Pull Request
201
+
202
+ ---
203
+
204
+ ## 📄 License
205
+
206
+ Distributed under the **MIT License**. See [`LICENSE`](LICENSE) for details.
@@ -0,0 +1,59 @@
1
+ [build-system]
2
+ requires = ["hatchling"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "depradar"
7
+ version = "0.1.0"
8
+ description = "Interactive System & Package Dependency Radar with force-directed graph & AI agent MCP server"
9
+ readme = "README.md"
10
+ license = { text = "MIT" }
11
+ authors = [
12
+ { name = "Mohammed Pahadwala", email = "mohammedpahadwala97@gmail.com" }
13
+ ]
14
+ requires-python = ">=3.9"
15
+ dependencies = []
16
+ keywords = [
17
+ "dependency-graph",
18
+ "visualization",
19
+ "developer-tools",
20
+ "mcp-server",
21
+ "virtualenv",
22
+ "disk-usage",
23
+ "ai-agents"
24
+ ]
25
+ classifiers = [
26
+ "Development Status :: 4 - Beta",
27
+ "Environment :: Console",
28
+ "Intended Audience :: Developers",
29
+ "License :: OSI Approved :: MIT License",
30
+ "Operating System :: OS Independent",
31
+ "Programming Language :: Python :: 3",
32
+ "Programming Language :: Python :: 3.9",
33
+ "Programming Language :: Python :: 3.10",
34
+ "Programming Language :: Python :: 3.11",
35
+ "Programming Language :: Python :: 3.12",
36
+ "Programming Language :: Python :: 3.13",
37
+ "Topic :: Software Development :: Build Tools",
38
+ "Topic :: System :: Systems Administration",
39
+ ]
40
+
41
+ [project.urls]
42
+ Homepage = "https://github.com/mdphd97/depradar"
43
+ Documentation = "https://mdphd97.github.io/depradar/"
44
+ Repository = "https://github.com/mdphd97/depradar.git"
45
+ Issues = "https://github.com/mdphd97/depradar/issues"
46
+
47
+ [project.scripts]
48
+ depradar = "depradar.cli:main"
49
+
50
+ [tool.hatch.build.targets.wheel]
51
+ packages = ["src/depradar"]
52
+
53
+ [tool.hatch.build.targets.sdist]
54
+ include = [
55
+ "/src/depradar",
56
+ "/README.md",
57
+ "/LICENSE",
58
+ "/pyproject.toml",
59
+ ]
@@ -0,0 +1,3 @@
1
+ """DepRadar: Interactive System & Package Dependency Radar."""
2
+
3
+ __version__ = "0.1.0"
@@ -0,0 +1,96 @@
1
+ """AI Agent Integration Utilities for DepRadar.
2
+ Provides prompt-ready Markdown contexts, dependency queries, and CLI helpers.
3
+ """
4
+
5
+ import platform
6
+ from typing import List, Dict, Any
7
+ from .models import GraphData, Node
8
+
9
+ def generate_agent_context(graph: GraphData) -> str:
10
+ """Generates a compact, high-value Markdown briefing for an AI agent's system prompt or context window."""
11
+ os_name = platform.system()
12
+ nodes = graph.nodes
13
+ runtimes = [n for n in nodes if n.type == "runtime"]
14
+ venvs = [n for n in nodes if n.type == "python-venv"]
15
+ projects = [n for n in nodes if n.type == "project"]
16
+ heavy = sorted(nodes, key=lambda x: x.size_bytes, reverse=True)[:5]
17
+ stale = [n for n in nodes if n.status == "stale"]
18
+
19
+ lines = [
20
+ "# System & Environment Context (Generated by DepRadar)",
21
+ f"**Host OS**: {os_name} {platform.release()} ({platform.machine()})",
22
+ f"**Total Tracked Components**: {len(nodes)} nodes | {len(graph.links)} dependency connections",
23
+ "",
24
+ "## Active Host Runtimes & Interpreters",
25
+ ]
26
+ for r in runtimes:
27
+ lines.append(f"- **{r.name}** (`{r.path}`): {r.notes}")
28
+
29
+ lines.append("\n## Detected Developer Workspaces & Projects")
30
+ for p in projects:
31
+ lines.append(f"- **{p.name}** (`{p.path}`): [{p.category}] {p.notes}")
32
+
33
+ lines.append("\n## Python Virtual Environments")
34
+ for v in venvs:
35
+ pkg_cnt = len(v.installed_packages) if v.installed_packages else "Unknown"
36
+ lines.append(f"- **{v.name}** (`{v.path}`): {v.size_human} | {pkg_cnt} installed packages | Status: `{v.status}`")
37
+
38
+ lines.append("\n## Top Disk Consumers")
39
+ for h in heavy:
40
+ lines.append(f"- **{h.name}**: {h.size_human} (`{h.path}`)")
41
+
42
+ if stale:
43
+ lines.append("\n## Stale / Cleanup Candidates")
44
+ for s in stale:
45
+ cmd = s.uninstall_cmd or f"rm -rf '{s.path}'"
46
+ lines.append(f"- **{s.name}** ({s.size_human}, {s.days_inactive}d inactive) -> Cleanup: `{cmd}`")
47
+
48
+ lines.append("\n*To query individual package details, run: `depradar query <package_name> --json`*")
49
+ return "\n".join(lines)
50
+
51
+ def query_dependencies(graph: GraphData, term: str) -> List[Dict[str, Any]]:
52
+ """Searches graph for matching nodes and returns connectivity context."""
53
+ q = term.lower().strip()
54
+ results = []
55
+ for n in graph.nodes:
56
+ name_match = q in n.name.lower() or q in n.id.lower() or q in n.notes.lower()
57
+ pkg_match = any(q in p.get("name", "").lower() for p in n.installed_packages) if n.installed_packages else False
58
+ if name_match or pkg_match:
59
+ # Upstream & Downstream
60
+ up = [
61
+ {"source": (l.source if isinstance(l.source, str) else l.source.id), "rel": l.relationship, "desc": l.description}
62
+ for l in graph.links if (l.target == n.id or (isinstance(l.target, dict) and l.target.get("id") == n.id))
63
+ ]
64
+ down = [
65
+ {"target": (l.target if isinstance(l.target, str) else l.target.id), "rel": l.relationship, "desc": l.description}
66
+ for l in graph.links if (l.source == n.id or (isinstance(l.source, dict) and l.source.get("id") == n.id))
67
+ ]
68
+ results.append({
69
+ "name": n.name,
70
+ "id": n.id,
71
+ "category": n.category,
72
+ "type": n.type,
73
+ "status": n.status,
74
+ "size": n.size_human,
75
+ "path": n.path,
76
+ "notes": n.notes,
77
+ "required_by": up,
78
+ "requires": down,
79
+ "installed_packages": n.installed_packages[:15] if n.installed_packages else []
80
+ })
81
+ return results
82
+
83
+ def get_stale_items(graph: GraphData) -> List[Dict[str, Any]]:
84
+ """Returns all stale/orphan items and cleanup commands."""
85
+ return [
86
+ {
87
+ "name": n.name,
88
+ "category": n.category,
89
+ "type": n.type,
90
+ "size": n.size_human,
91
+ "path": n.path,
92
+ "days_inactive": n.days_inactive,
93
+ "cleanup_cmd": n.uninstall_cmd or f"rm -rf '{n.path}'"
94
+ }
95
+ for n in graph.nodes if n.status == "stale"
96
+ ]