devmap 0.4.1__tar.gz → 0.4.2__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.
devmap-0.4.2/PKG-INFO ADDED
@@ -0,0 +1,167 @@
1
+ Metadata-Version: 2.4
2
+ Name: devmap
3
+ Version: 0.4.2
4
+ Summary: Map your machine's dev environment and surface issues (PATH conflicts, ghost binaries, multi-version collisions). fastfetch-for-dev-tools. This PyPI package ships the real devmap CLI (a bundled JavaScript app launched via Node.js or Bun), so `pip install devmap && devmap` works standalone.
5
+ Author: devmap contributors
6
+ License: MIT
7
+ Project-URL: Homepage, https://github.com/StevenLOL/devmap
8
+ Project-URL: Repository, https://github.com/StevenLOL/devmap
9
+ Keywords: devmap,devtools,environment,scanner,fastfetch,diagnostics,dev-environment,path-conflict,ghost-binary
10
+ Classifier: Development Status :: 4 - Beta
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: MIT License
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Topic :: Software Development :: Quality Assurance
16
+ Requires-Python: >=3.8
17
+ Description-Content-Type: text/markdown
18
+
19
+ # devmap
20
+
21
+ > **The environment-reliability insurance for AI agents.** Before an agent changes *your* machine, let it ask devmap one question: *"can this environment run my command cleanly right now?"* — and get a structured answer instead of a mid-run failure.
22
+
23
+ `devmap` is the developer-focused spiritual successor to `fastfetch`: instead of only printing system specs, it scans the *development* surface of your machine — runtimes, package managers, IDEs, per-interpreter pip packages, conda/WSL/Docker environments, Visual Studio dev shells, project-local virtual environments, **mobile SDKs (Android / Flutter / Dart / NDK)**, and the **Windows pre-flight** state an AI agent dies on — and produces a single machine-readable manifest plus an actionable issue list. As an MCP server it plugs straight into Cursor / Cline / Claude Desktop / Codex / CodeBuddy / WorkBuddy, so the agent calls `preflight` *before* it ever shells out a command.
24
+
25
+ ## Install
26
+
27
+ This PyPI package ships the **real devmap CLI**. The wheel embeds the compiled devmap app (`devmap/_devmap.mjs`) and launches it through **Node.js** (or **Bun**, if present) — so `pip install devmap && devmap` works standalone, with no npm install and no build step:
28
+
29
+ ```bash
30
+ pip install devmap
31
+ devmap --version
32
+ ```
33
+
34
+ Requirements at runtime: **Node.js (or Bun)** on `PATH`. Python is only the installer/launcher wrapper — the package has zero Python dependencies.
35
+
36
+ > The npm channel (`npm i -g devmap`) ships the same bundle and is equally valid. Pick whichever package manager you already use.
37
+
38
+ ## Why devmap (and why it is built for agents)
39
+
40
+ - **AI agents break on dirty environments, not on missing specs.** An agent that shells out a `flutter build` or `pip install` on a machine with a Constrained-Language-Mode PowerShell, a Restricted execution policy, a GBK codepage, or an unset `ANDROID_HOME` fails mid-run. `devmap --mcp` exposes a **`preflight`** tool the agent calls *first* — it returns `ok / blockers / warnings` plus the exact Windows and mobile-SDK constraints, so the agent fixes (or asks the user to fix) them up front.
41
+ - **The agent stays in control.** devmap is a read-only oracle. It never modifies your environment — it reports, and the agent decides. No hidden mutations, no "helpful" auto-fixes.
42
+
43
+ ## Features
44
+
45
+ - **One-command full scan** of the dev environment (runtimes, package managers, IDEs, environment layers, mobile SDKs, and Windows pre-flight).
46
+ - **PATH conflict graph**: detects multi-version tools, shadowed binaries, and ghost/broken symlinks (e.g. Windows App Execution Aliases that look broken but aren't). This is devmap's original wedge — **14 source-available rivals all lack it**.
47
+ - **Off-PATH awareness**: reports installed-but-not-on-PATH tools, while correctly treating version-manager environments (conda envs, nvm versions) as by-design off-PATH.
48
+ - **Mobile SDK moat (exclusive)**: Android SDK (`ANDROID_HOME`/`sdkmanager`/`adb`), Flutter (version + channel + bundled Dart), standalone Dart, and NDK — flags `ANDROID_HOME` unset while tools are on PATH, dev/beta Flutter channels, and multiple NDK versions silently shadowing each other. No competitor scans this.
49
+ - **Windows pre-flight moat (exclusive)**: six checks an agent dies on — PowerShell execution policy, Constrained Language Mode (error), console code page, schannel cert-revocation, App Execution Aliases shadowing real `python`/`curl`, and the safe-delete shim that makes deletions fail closed.
50
+ - **MCP server**: `devmap --mcp` speaks MCP over stdio and exposes `scan_environment`, `query_tool`, and `preflight`.
51
+ - **Security layer (opt-in)**: `--audit-deps` detects and invokes your installed SCA tools (OSV-Scanner / pip-audit / govulncheck / Trivy), parses their JSON, and merges findings into one view; `--scan-secrets` adds a fully offline hardcoded-credential scan over a curated allowlist of `$HOME`/project config files, with every matched value redacted. devmap is a *scanner/orchestrator*, **not** a CVE database.
52
+ - **Health layer**: converges official self-checks into one view, **per environment**. Offline by default: `pip check` runs for **every** Python interpreter, and `conda doctor` runs for **every** conda env. With `--health-network`, `npm doctor` / `rustup check` are added. Missing/offline probes degrade gracefully to `info` (skipped). Passing checks are summarized as `✓ N checks passed` — only `warn`/`error` surface under `issues (N)`.
53
+ - **Share card**: `devmap --card` prints a screenshot-friendly ASCII/Markdown card; `devmap --share` writes it to `./devmap-card.md`.
54
+ - **Three sub-commands**: `scan` (the fact source), `query` (ask the manifest), `devdiff` (compare two manifests — environment drift / cross-machine consistency).
55
+ - **Zero external dependencies.** Pure TypeScript, shipped prebuilt.
56
+
57
+ ## Usage
58
+
59
+ `devmap` **defaults to `scan`** — you can drop the `scan` word entirely.
60
+
61
+ ```bash
62
+ devmap # pretty-print to terminal, write ~/.devmap/devmap.json
63
+ devmap --json # machine-readable JSON (devmap.json schema) to stdout
64
+ devmap --report # full markdown report
65
+ devmap --scan-root C:\src # also scan project-local envs under a root
66
+ devmap --wsl-deep # also wake stopped WSL distros and probe their tools (slower)
67
+ devmap --outdated # hit PyPI to list upgradable pip/conda packages (needs network)
68
+ devmap --ci # exit code 1 if any error-severity issue is found
69
+ devmap --card # print a screenshot-friendly share card
70
+ devmap --share # write the share card to ./devmap-card.md
71
+ ```
72
+
73
+ Key `scan` flags:
74
+
75
+ | Flag | Description |
76
+ |------|-------------|
77
+ | `--json` | Emit machine-readable JSON (the `devmap.json` schema) to stdout. |
78
+ | `--report` | Emit a full markdown report. |
79
+ | `--card` | Print a screenshot-friendly share card (pure ASCII/Markdown — never mojibakes on GBK consoles). |
80
+ | `--share` | Write the share card to `./devmap-card.md`. |
81
+ | `--no-manifest` | Do not persist the manifest to disk. |
82
+ | `--manifest <path>` | Read/write the manifest at a custom path (default `~/.devmap/devmap.json`). |
83
+ | `--disable <r1,r2>` | Disable check rules by ID prefix (e.g. `path.duplicate`, `pip.outdated`, `security`). |
84
+ | `--shell <list>` | Which shell views to reconstruct: `current\|powershell\|gitbash\|wsl\|all`. |
85
+ | `--scan-root <dir>` | Root(s) to scan for project-local environments (comma-separated). Default: cwd. |
86
+ | `--outdated` | Network check for upgradable pip/conda packages (off by default). |
87
+ | `--wsl-deep` | Probe inside stopped WSL distros (off by default to avoid waking them). |
88
+ | `--audit-deps` | Invoke installed SCA tools and merge CVE findings into the report (opt-in, uses network). |
89
+ | `--scan-secrets` | Scan a curated allowlist of credential files for hardcoded secrets (opt-in, offline, values redacted). |
90
+ | `--health-network` | Also run network health probes (`npm doctor` / `rustup check`). |
91
+ | `--mcp` | Run as an MCP server over stdio instead of scanning. |
92
+ | `--ci` | Exit non-zero on any error-severity issue. |
93
+ | `--quiet` | Suppress the live scan progress feedback (for scripts/CI). |
94
+ | `--bom` | Prefix output with a UTF-8 BOM so Notepad-like viewers render it correctly (stdout redirect/pipe only). |
95
+
96
+ ### `--mcp` — run as an MCP server
97
+
98
+ ```bash
99
+ devmap --mcp
100
+ ```
101
+
102
+ Register it with any MCP-capable agent (Cursor / Cline / Claude Desktop / Codex / CodeBuddy / WorkBuddy / VS Code):
103
+
104
+ ```jsonc
105
+ {
106
+ "mcpServers": {
107
+ "devmap": { "command": "devmap", "args": ["--mcp"] }
108
+ }
109
+ }
110
+ ```
111
+
112
+ Three tools are exposed:
113
+
114
+ | Tool | Purpose |
115
+ |------|---------|
116
+ | `preflight` | **Call this first.** Returns `ok / blockers / warnings` plus the environment constraints (PowerShell language mode, execution policy, codepage, schannel revocation, Android/Flutter state) that would break the command you are about to run. |
117
+ | `scan_environment` | Run a full scan and return the manifest. |
118
+ | `query_tool` | Ask an existing manifest about a specific tool (version, path, on-PATH state). |
119
+
120
+ ```jsonc
121
+ // agent -> devmap (MCP)
122
+ { "tool": "preflight", "arguments": { "target": "powershell", "forAgent": true } }
123
+ // -> { "ok": false, "blockers": ["win.langmode"], "warnings": ["win.execpolicy", "win.schannel"],
124
+ // "languageMode": "ConstrainedLanguage", "codepage": 936, "schannelRevoke": true, ... }
125
+ ```
126
+
127
+ `blockers` non-empty ⇒ fix first. `ok: true` ⇒ the agent can proceed.
128
+
129
+ ### `query` — ask the manifest
130
+
131
+ ```bash
132
+ devmap query # everything
133
+ devmap query node # tools whose id contains "node"
134
+ devmap query runtime.node # dot-form category.tool selector (runtime / pkg / ide)
135
+ devmap query --issues # only issues
136
+ devmap query --conflicts # only conflicts (multiVersion / path / ghost)
137
+ devmap query --off-path # only off-PATH installs
138
+ devmap query --kind runtime # filter by category
139
+ devmap query --where conda # filter by install path substring
140
+ ```
141
+
142
+ ### `devdiff` — compare two manifests
143
+
144
+ ```bash
145
+ devmap devdiff # stored manifest vs current live scan
146
+ devmap devdiff <file> # stored/before vs <file>
147
+ devmap devdiff <a> <b> # compare two manifest files
148
+ ```
149
+
150
+ Reports added/removed installs, version changes, and issues added/resolved.
151
+
152
+ ## Output
153
+
154
+ - The default `scan` writes the manifest to **`~/.devmap/devmap.json`** (pure UTF-8, no BOM — directly parseable by Bun/Node/Python/jq).
155
+ - Use `query` / `devdiff` against a stored manifest without re-scanning.
156
+
157
+ ### Encoding note
158
+
159
+ Output is UTF-8. Windows Notepad may mojibake a BOM-less UTF-8 file — open it in VS Code, Windows Terminal, or an IDE, or add `--bom` when redirecting. When reading a BOM-prefixed file in Python, use `open(p, encoding="utf-8-sig")`.
160
+
161
+ ## Repository
162
+
163
+ https://github.com/StevenLOL/devmap
164
+
165
+ ## License
166
+
167
+ [MIT](https://github.com/StevenLOL/devmap/blob/main/LICENSE)
devmap-0.4.2/README.md ADDED
@@ -0,0 +1,149 @@
1
+ # devmap
2
+
3
+ > **The environment-reliability insurance for AI agents.** Before an agent changes *your* machine, let it ask devmap one question: *"can this environment run my command cleanly right now?"* — and get a structured answer instead of a mid-run failure.
4
+
5
+ `devmap` is the developer-focused spiritual successor to `fastfetch`: instead of only printing system specs, it scans the *development* surface of your machine — runtimes, package managers, IDEs, per-interpreter pip packages, conda/WSL/Docker environments, Visual Studio dev shells, project-local virtual environments, **mobile SDKs (Android / Flutter / Dart / NDK)**, and the **Windows pre-flight** state an AI agent dies on — and produces a single machine-readable manifest plus an actionable issue list. As an MCP server it plugs straight into Cursor / Cline / Claude Desktop / Codex / CodeBuddy / WorkBuddy, so the agent calls `preflight` *before* it ever shells out a command.
6
+
7
+ ## Install
8
+
9
+ This PyPI package ships the **real devmap CLI**. The wheel embeds the compiled devmap app (`devmap/_devmap.mjs`) and launches it through **Node.js** (or **Bun**, if present) — so `pip install devmap && devmap` works standalone, with no npm install and no build step:
10
+
11
+ ```bash
12
+ pip install devmap
13
+ devmap --version
14
+ ```
15
+
16
+ Requirements at runtime: **Node.js (or Bun)** on `PATH`. Python is only the installer/launcher wrapper — the package has zero Python dependencies.
17
+
18
+ > The npm channel (`npm i -g devmap`) ships the same bundle and is equally valid. Pick whichever package manager you already use.
19
+
20
+ ## Why devmap (and why it is built for agents)
21
+
22
+ - **AI agents break on dirty environments, not on missing specs.** An agent that shells out a `flutter build` or `pip install` on a machine with a Constrained-Language-Mode PowerShell, a Restricted execution policy, a GBK codepage, or an unset `ANDROID_HOME` fails mid-run. `devmap --mcp` exposes a **`preflight`** tool the agent calls *first* — it returns `ok / blockers / warnings` plus the exact Windows and mobile-SDK constraints, so the agent fixes (or asks the user to fix) them up front.
23
+ - **The agent stays in control.** devmap is a read-only oracle. It never modifies your environment — it reports, and the agent decides. No hidden mutations, no "helpful" auto-fixes.
24
+
25
+ ## Features
26
+
27
+ - **One-command full scan** of the dev environment (runtimes, package managers, IDEs, environment layers, mobile SDKs, and Windows pre-flight).
28
+ - **PATH conflict graph**: detects multi-version tools, shadowed binaries, and ghost/broken symlinks (e.g. Windows App Execution Aliases that look broken but aren't). This is devmap's original wedge — **14 source-available rivals all lack it**.
29
+ - **Off-PATH awareness**: reports installed-but-not-on-PATH tools, while correctly treating version-manager environments (conda envs, nvm versions) as by-design off-PATH.
30
+ - **Mobile SDK moat (exclusive)**: Android SDK (`ANDROID_HOME`/`sdkmanager`/`adb`), Flutter (version + channel + bundled Dart), standalone Dart, and NDK — flags `ANDROID_HOME` unset while tools are on PATH, dev/beta Flutter channels, and multiple NDK versions silently shadowing each other. No competitor scans this.
31
+ - **Windows pre-flight moat (exclusive)**: six checks an agent dies on — PowerShell execution policy, Constrained Language Mode (error), console code page, schannel cert-revocation, App Execution Aliases shadowing real `python`/`curl`, and the safe-delete shim that makes deletions fail closed.
32
+ - **MCP server**: `devmap --mcp` speaks MCP over stdio and exposes `scan_environment`, `query_tool`, and `preflight`.
33
+ - **Security layer (opt-in)**: `--audit-deps` detects and invokes your installed SCA tools (OSV-Scanner / pip-audit / govulncheck / Trivy), parses their JSON, and merges findings into one view; `--scan-secrets` adds a fully offline hardcoded-credential scan over a curated allowlist of `$HOME`/project config files, with every matched value redacted. devmap is a *scanner/orchestrator*, **not** a CVE database.
34
+ - **Health layer**: converges official self-checks into one view, **per environment**. Offline by default: `pip check` runs for **every** Python interpreter, and `conda doctor` runs for **every** conda env. With `--health-network`, `npm doctor` / `rustup check` are added. Missing/offline probes degrade gracefully to `info` (skipped). Passing checks are summarized as `✓ N checks passed` — only `warn`/`error` surface under `issues (N)`.
35
+ - **Share card**: `devmap --card` prints a screenshot-friendly ASCII/Markdown card; `devmap --share` writes it to `./devmap-card.md`.
36
+ - **Three sub-commands**: `scan` (the fact source), `query` (ask the manifest), `devdiff` (compare two manifests — environment drift / cross-machine consistency).
37
+ - **Zero external dependencies.** Pure TypeScript, shipped prebuilt.
38
+
39
+ ## Usage
40
+
41
+ `devmap` **defaults to `scan`** — you can drop the `scan` word entirely.
42
+
43
+ ```bash
44
+ devmap # pretty-print to terminal, write ~/.devmap/devmap.json
45
+ devmap --json # machine-readable JSON (devmap.json schema) to stdout
46
+ devmap --report # full markdown report
47
+ devmap --scan-root C:\src # also scan project-local envs under a root
48
+ devmap --wsl-deep # also wake stopped WSL distros and probe their tools (slower)
49
+ devmap --outdated # hit PyPI to list upgradable pip/conda packages (needs network)
50
+ devmap --ci # exit code 1 if any error-severity issue is found
51
+ devmap --card # print a screenshot-friendly share card
52
+ devmap --share # write the share card to ./devmap-card.md
53
+ ```
54
+
55
+ Key `scan` flags:
56
+
57
+ | Flag | Description |
58
+ |------|-------------|
59
+ | `--json` | Emit machine-readable JSON (the `devmap.json` schema) to stdout. |
60
+ | `--report` | Emit a full markdown report. |
61
+ | `--card` | Print a screenshot-friendly share card (pure ASCII/Markdown — never mojibakes on GBK consoles). |
62
+ | `--share` | Write the share card to `./devmap-card.md`. |
63
+ | `--no-manifest` | Do not persist the manifest to disk. |
64
+ | `--manifest <path>` | Read/write the manifest at a custom path (default `~/.devmap/devmap.json`). |
65
+ | `--disable <r1,r2>` | Disable check rules by ID prefix (e.g. `path.duplicate`, `pip.outdated`, `security`). |
66
+ | `--shell <list>` | Which shell views to reconstruct: `current\|powershell\|gitbash\|wsl\|all`. |
67
+ | `--scan-root <dir>` | Root(s) to scan for project-local environments (comma-separated). Default: cwd. |
68
+ | `--outdated` | Network check for upgradable pip/conda packages (off by default). |
69
+ | `--wsl-deep` | Probe inside stopped WSL distros (off by default to avoid waking them). |
70
+ | `--audit-deps` | Invoke installed SCA tools and merge CVE findings into the report (opt-in, uses network). |
71
+ | `--scan-secrets` | Scan a curated allowlist of credential files for hardcoded secrets (opt-in, offline, values redacted). |
72
+ | `--health-network` | Also run network health probes (`npm doctor` / `rustup check`). |
73
+ | `--mcp` | Run as an MCP server over stdio instead of scanning. |
74
+ | `--ci` | Exit non-zero on any error-severity issue. |
75
+ | `--quiet` | Suppress the live scan progress feedback (for scripts/CI). |
76
+ | `--bom` | Prefix output with a UTF-8 BOM so Notepad-like viewers render it correctly (stdout redirect/pipe only). |
77
+
78
+ ### `--mcp` — run as an MCP server
79
+
80
+ ```bash
81
+ devmap --mcp
82
+ ```
83
+
84
+ Register it with any MCP-capable agent (Cursor / Cline / Claude Desktop / Codex / CodeBuddy / WorkBuddy / VS Code):
85
+
86
+ ```jsonc
87
+ {
88
+ "mcpServers": {
89
+ "devmap": { "command": "devmap", "args": ["--mcp"] }
90
+ }
91
+ }
92
+ ```
93
+
94
+ Three tools are exposed:
95
+
96
+ | Tool | Purpose |
97
+ |------|---------|
98
+ | `preflight` | **Call this first.** Returns `ok / blockers / warnings` plus the environment constraints (PowerShell language mode, execution policy, codepage, schannel revocation, Android/Flutter state) that would break the command you are about to run. |
99
+ | `scan_environment` | Run a full scan and return the manifest. |
100
+ | `query_tool` | Ask an existing manifest about a specific tool (version, path, on-PATH state). |
101
+
102
+ ```jsonc
103
+ // agent -> devmap (MCP)
104
+ { "tool": "preflight", "arguments": { "target": "powershell", "forAgent": true } }
105
+ // -> { "ok": false, "blockers": ["win.langmode"], "warnings": ["win.execpolicy", "win.schannel"],
106
+ // "languageMode": "ConstrainedLanguage", "codepage": 936, "schannelRevoke": true, ... }
107
+ ```
108
+
109
+ `blockers` non-empty ⇒ fix first. `ok: true` ⇒ the agent can proceed.
110
+
111
+ ### `query` — ask the manifest
112
+
113
+ ```bash
114
+ devmap query # everything
115
+ devmap query node # tools whose id contains "node"
116
+ devmap query runtime.node # dot-form category.tool selector (runtime / pkg / ide)
117
+ devmap query --issues # only issues
118
+ devmap query --conflicts # only conflicts (multiVersion / path / ghost)
119
+ devmap query --off-path # only off-PATH installs
120
+ devmap query --kind runtime # filter by category
121
+ devmap query --where conda # filter by install path substring
122
+ ```
123
+
124
+ ### `devdiff` — compare two manifests
125
+
126
+ ```bash
127
+ devmap devdiff # stored manifest vs current live scan
128
+ devmap devdiff <file> # stored/before vs <file>
129
+ devmap devdiff <a> <b> # compare two manifest files
130
+ ```
131
+
132
+ Reports added/removed installs, version changes, and issues added/resolved.
133
+
134
+ ## Output
135
+
136
+ - The default `scan` writes the manifest to **`~/.devmap/devmap.json`** (pure UTF-8, no BOM — directly parseable by Bun/Node/Python/jq).
137
+ - Use `query` / `devdiff` against a stored manifest without re-scanning.
138
+
139
+ ### Encoding note
140
+
141
+ Output is UTF-8. Windows Notepad may mojibake a BOM-less UTF-8 file — open it in VS Code, Windows Terminal, or an IDE, or add `--bom` when redirecting. When reading a BOM-prefixed file in Python, use `open(p, encoding="utf-8-sig")`.
142
+
143
+ ## Repository
144
+
145
+ https://github.com/StevenLOL/devmap
146
+
147
+ ## License
148
+
149
+ [MIT](https://github.com/StevenLOL/devmap/blob/main/LICENSE)
@@ -14,7 +14,16 @@ import shutil
14
14
  import subprocess
15
15
  import sys
16
16
 
17
- __version__ = "0.2.5"
17
+ try: # single source of truth = installed wheel metadata (never hand-bumped)
18
+ from importlib.metadata import PackageNotFoundError
19
+ from importlib.metadata import version as _pkg_version
20
+
21
+ try:
22
+ __version__ = _pkg_version("devmap")
23
+ except PackageNotFoundError: # running from a source tree
24
+ __version__ = "0+unknown"
25
+ except Exception: # pragma: no cover - very old Python / frozen env
26
+ __version__ = "0+unknown"
18
27
 
19
28
  _BUNDLE = os.path.join(os.path.dirname(os.path.abspath(__file__)), "_devmap.mjs")
20
29