projscan 1.11.0 → 2.0.0
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.
- package/README.md +26 -24
- package/dist/cli/_shared.d.ts +1 -1
- package/dist/cli/_shared.js +4 -15
- package/dist/cli/_shared.js.map +1 -1
- package/dist/cli/commands/explain.js +4 -5
- package/dist/cli/commands/explain.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts +3 -3
- package/dist/cli/commands/plugin.js +8 -8
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/core/fileInspector.d.ts +2 -5
- package/dist/core/fileInspector.js +28 -103
- package/dist/core/fileInspector.js.map +1 -1
- package/dist/core/languages/LanguageAdapter.d.ts +3 -1
- package/dist/core/languages/LanguageAdapter.js +13 -1
- package/dist/core/languages/LanguageAdapter.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools/_shared.d.ts +1 -1
- package/dist/mcp/tools/_shared.js +3 -15
- package/dist/mcp/tools/_shared.js.map +1 -1
- package/dist/mcp/tools/explain.js +1 -3
- package/dist/mcp/tools/explain.js.map +1 -1
- package/dist/mcp/tools/plugin.d.ts +4 -7
- package/dist/mcp/tools/plugin.js +6 -9
- package/dist/mcp/tools/plugin.js.map +1 -1
- package/dist/reporters/jsonReporter.d.ts +1 -0
- package/dist/reporters/jsonReporter.js +25 -19
- package/dist/reporters/jsonReporter.js.map +1 -1
- package/dist/tool-manifest.json +4 -4
- package/docs/2.0-MIGRATION.md +80 -0
- package/docs/PLUGIN-AUTHORING.md +209 -0
- package/docs/examples/plugins/policy.mjs +16 -0
- package/docs/examples/plugins/policy.projscan-plugin.json +8 -0
- package/docs/examples/plugins/team-radar.mjs +17 -0
- package/docs/examples/plugins/team-radar.projscan-plugin.json +8 -0
- package/docs/plugin.schema.json +70 -0
- package/package.json +7 -3
package/README.md
CHANGED
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
|
|
10
10
|
**Agent-first code intelligence.** An MCP server that lets AI coding agents (Claude Code, Codex, Cursor, Gemini, Windsurf, Cline, Continue, Zed — any MCP-aware client) query your codebase — with a CLI for humans and a local plugin layer for team-specific policy and reporting.
|
|
11
11
|
|
|
12
|
-
[AI Agent Quick Start](#ai-agent-integration-mcp) · [CLI Quick Start](#quick-start) · [Commands](#commands) · [Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
12
|
+
[AI Agent Quick Start](#ai-agent-integration-mcp) · [CLI Quick Start](#quick-start) · [Commands](#commands) · [Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/GUIDE.md) · [Roadmap](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/ROADMAP.md)
|
|
13
13
|
|
|
14
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
14
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/projscan-reporter-plugin.png" alt="projscan reporter plugin running in a macOS-style terminal window with a team health summary" width="700">
|
|
15
15
|
|
|
16
16
|
</div>
|
|
17
17
|
|
|
@@ -23,7 +23,7 @@ AI coding agents are becoming the primary interface to code. Today, when you ask
|
|
|
23
23
|
|
|
24
24
|
**projscan is the first code-intelligence tool built for agents, not for humans.** Your agent gets a fast, AST-accurate, context-budget-aware view of your codebase through 28 structured MCP tools. It can query the import graph, find symbol definitions, preview upgrades, rank hotspots, diff structural changes between refs, surface coupling/cycle hotspots, get an **intent-grounded** one-call PR review (now with new-taint-flow detection that *blocks* unsafe merges, plus an optional natural-language intent arg that labels each finding expected / unexpected / out-of-scope), request structured fix-action prompts for any open issue and **mechanically apply** the safe ones with rollback, ask "what breaks if I change this?" via transitive blast-radius analysis (across registered sibling repos too), surface source-to-sink taint flows, share a durable session across multiple agent invocations, and learn from how you use it — quieting accumulated noise on this specific repo over time without ever phoning home.
|
|
25
25
|
|
|
26
|
-
The plugin
|
|
26
|
+
The stable local plugin platform turns that same pipeline into a team substrate: analyzer plugins add project-specific findings, and reporter plugins render `doctor`, `analyze`, and `ci` in your team's own voice without changing the underlying scan.
|
|
27
27
|
|
|
28
28
|
Humans get the same thing through the CLI.
|
|
29
29
|
|
|
@@ -33,7 +33,7 @@ Humans get the same thing through the CLI.
|
|
|
33
33
|
npx projscan
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
36
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/projscan-reporter-plugin.gif" alt="projscan doctor rendered through a local reporter plugin in a macOS-style terminal window" width="700">
|
|
37
37
|
|
|
38
38
|
Run `projscan doctor` for a focused health check:
|
|
39
39
|
|
|
@@ -41,7 +41,7 @@ Run `projscan doctor` for a focused health check:
|
|
|
41
41
|
npx projscan doctor
|
|
42
42
|
```
|
|
43
43
|
|
|
44
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
44
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20doctor.gif" alt="npx projscan doctor" width="700">
|
|
45
45
|
|
|
46
46
|
## Install
|
|
47
47
|
|
|
@@ -81,9 +81,9 @@ projscan plugin list # Discover local analyzer/reporter plugins
|
|
|
81
81
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor --reporter team-radar
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
84
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20--help.gif" alt="npx projscan --help" width="700">
|
|
85
85
|
|
|
86
|
-
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
86
|
+
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/GUIDE.md)**.
|
|
87
87
|
|
|
88
88
|
## Commands
|
|
89
89
|
|
|
@@ -111,7 +111,7 @@ For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiy
|
|
|
111
111
|
| `projscan workspace` | *(1.6)* Register sibling repos for cross-repo intelligence (`add` / `list` / `remove`) |
|
|
112
112
|
| `projscan apply-fix <id>` | *(1.6)* Mechanically execute the safe fix templates with rollback (default dry-run) |
|
|
113
113
|
| `projscan taint` | *(1.6)* Source-to-sink reachability over the call graph |
|
|
114
|
-
| `projscan plugin` |
|
|
114
|
+
| `projscan plugin` | Discover and validate local analyzer/reporter plugins |
|
|
115
115
|
| `projscan mcp` | Run as an MCP server for AI coding agents (Claude Code, Codex, Cursor, Gemini, Windsurf, …) |
|
|
116
116
|
|
|
117
117
|
To see all commands and options, run:
|
|
@@ -125,31 +125,31 @@ projscan --help
|
|
|
125
125
|
<details>
|
|
126
126
|
<summary><strong>projscan structure</strong> - Directory tree with file counts</summary>
|
|
127
127
|
|
|
128
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
128
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20structure.gif" alt="npx projscan structure" width="700">
|
|
129
129
|
</details>
|
|
130
130
|
|
|
131
131
|
<details>
|
|
132
132
|
<summary><strong>projscan diagram</strong> - Architecture visualization</summary>
|
|
133
133
|
|
|
134
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
134
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20diagram.gif" alt="npx projscan diagram" width="700">
|
|
135
135
|
</details>
|
|
136
136
|
|
|
137
137
|
<details>
|
|
138
138
|
<summary><strong>projscan dependencies</strong> - Dependency analysis</summary>
|
|
139
139
|
|
|
140
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
140
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20dependencies.gif" alt="npx projscan dependencies" width="700">
|
|
141
141
|
</details>
|
|
142
142
|
|
|
143
143
|
<details>
|
|
144
144
|
<summary><strong>projscan explain</strong> - File explanation</summary>
|
|
145
145
|
|
|
146
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
146
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20explain.gif" alt="npx projscan explain" width="700">
|
|
147
147
|
</details>
|
|
148
148
|
|
|
149
149
|
<details>
|
|
150
150
|
<summary><strong>projscan badge</strong> - Health badge generation</summary>
|
|
151
151
|
|
|
152
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
152
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20badge.gif" alt="npx projscan badge" width="700">
|
|
153
153
|
</details>
|
|
154
154
|
|
|
155
155
|
### Output Formats
|
|
@@ -164,9 +164,11 @@ projscan ci --format sarif # SARIF 2.1.0 for GitHub Code Scanning
|
|
|
164
164
|
|
|
165
165
|
Formats: `console` (default), `json`, `markdown`, `sarif`
|
|
166
166
|
|
|
167
|
-
### Plugin Platform
|
|
167
|
+
### Plugin Platform
|
|
168
168
|
|
|
169
|
-
projscan can load local plugins from `.projscan-plugins/` when `PROJSCAN_PLUGINS_PREVIEW=1` is set. Analyzer plugins emit normal projscan issues; reporter plugins render supported CLI commands with team-specific output.
|
|
169
|
+
projscan can load local plugins from `.projscan-plugins/` when `PROJSCAN_PLUGINS_PREVIEW=1` is set. The environment flag is kept for explicit local-code opt-in. Analyzer plugins emit normal projscan issues; reporter plugins render supported CLI commands with team-specific output.
|
|
170
|
+
|
|
171
|
+
**2.0 upgrade notes:** migrating from 1.x or authoring plugins? Start with the [2.0 Migration Guide](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/2.0-MIGRATION.md), then use [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/PLUGIN-AUTHORING.md) and the [manifest schema](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/plugin.schema.json) as the stable contract.
|
|
170
172
|
|
|
171
173
|
```bash
|
|
172
174
|
projscan plugin list
|
|
@@ -175,9 +177,9 @@ PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor --reporter team-radar
|
|
|
175
177
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan ci --reporter team-radar --min-score 80
|
|
176
178
|
```
|
|
177
179
|
|
|
178
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
180
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/projscan-reporter-plugin.gif" alt="projscan local reporter plugin rendering a team health report" width="700">
|
|
179
181
|
|
|
180
|
-
Reporter plugins are intentionally CLI-only
|
|
182
|
+
Reporter plugins are intentionally CLI-only. MCP tools keep returning structured JSON-compatible payloads so agents can reason over stable data, while humans can get a polished local report for their team. Custom presentation, team-branded summaries, and white-label reports belong in reporter plugins rather than new core HTML theming flags. See [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/PLUGIN-AUTHORING.md) for manifest shape, `render(context)`, validation, and the trust model.
|
|
181
183
|
|
|
182
184
|
### Options
|
|
183
185
|
|
|
@@ -187,7 +189,7 @@ Reporter plugins are intentionally CLI-only in the preview. MCP tools keep retur
|
|
|
187
189
|
| `--config <path>` | Path to a `.projscanrc` config file |
|
|
188
190
|
| `--changed-only` | Scope to files changed vs base ref (ci/analyze/doctor) |
|
|
189
191
|
| `--base-ref <ref>` | Git base ref for `--changed-only` (default: origin/main) |
|
|
190
|
-
| `--reporter <name>` |
|
|
192
|
+
| `--reporter <name>` | Render `doctor`, `analyze`, or `ci` with a local reporter plugin |
|
|
191
193
|
| `--verbose` | Enable debug output |
|
|
192
194
|
| `--quiet` | Suppress non-essential output |
|
|
193
195
|
| `-V, --version` | Show version |
|
|
@@ -336,7 +338,7 @@ If you read projscan's [Socket report](https://socket.dev/npm/package/projscan),
|
|
|
336
338
|
### Audit it yourself
|
|
337
339
|
|
|
338
340
|
- **Source is open** at [github.com/abhiyoheswaran1/projscan](https://github.com/abhiyoheswaran1/projscan). The npm tarball matches the `dist/` produced by `npm run build` at the matching tag.
|
|
339
|
-
- **Public API surface is locked** by `scripts/check-stability.mjs`, which runs in CI on every PR and fails on any rename or removal of an MCP tool, CLI command, or exit code. See [`docs/STABILITY.md`](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
341
|
+
- **Public API surface is locked** by `scripts/check-stability.mjs`, which runs in CI on every PR and fails on any rename or removal of an MCP tool, CLI command, or exit code. See [`docs/STABILITY.md`](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/STABILITY.md).
|
|
340
342
|
- **Run it offline:** `npm install -g projscan` followed by anything except `audit` and `--mode semantic` works without network.
|
|
341
343
|
- **Drop privilege further:** in CI, run projscan in a sandbox that disallows network egress; everything except `audit` will pass.
|
|
342
344
|
|
|
@@ -374,7 +376,7 @@ projscan ci --changed-only # Gate only on this PR's diff
|
|
|
374
376
|
projscan ci --format sarif > projscan.sarif # SARIF for Code Scanning
|
|
375
377
|
```
|
|
376
378
|
|
|
377
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
379
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20ci%20--min-score%2070.gif" alt="npx projscan ci --min-score 70" width="700">
|
|
378
380
|
|
|
379
381
|
### GitHub Action (recommended)
|
|
380
382
|
|
|
@@ -443,7 +445,7 @@ Fields:
|
|
|
443
445
|
- `hotspots.limit` / `hotspots.since` - defaults for the `hotspots` command
|
|
444
446
|
- `monorepo.importPolicy` - cross-package import allow/deny rules in monorepos *(0.14+)*
|
|
445
447
|
|
|
446
|
-
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
448
|
+
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/GUIDE.md#configuration-projscanrc) for the full reference (field types, validation behavior, embedding config in `package.json`, monorepo `importPolicy` semantics).
|
|
447
449
|
|
|
448
450
|
## Tracking Health Over Time
|
|
449
451
|
|
|
@@ -456,7 +458,7 @@ projscan diff # Compare against baseline
|
|
|
456
458
|
projscan diff --format markdown # Markdown diff for PRs
|
|
457
459
|
```
|
|
458
460
|
|
|
459
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
461
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/npx%20projscan%20diff%20--save-baseline.gif" alt="npx projscan diff --save-baseline" width="700">
|
|
460
462
|
|
|
461
463
|
## Hotspots - Where to Fix First
|
|
462
464
|
|
|
@@ -545,7 +547,7 @@ Coverage is also automatically joined into `projscan hotspots` when one of those
|
|
|
545
547
|
|
|
546
548
|
**This is the primary way to use projscan.** `projscan mcp` starts an [MCP](https://modelcontextprotocol.io) server over stdio so AI coding agents can query your codebase with real structural accuracy - not regex, not grep.
|
|
547
549
|
|
|
548
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
550
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v2.0.0/docs/projscan-agent-demo.gif" alt="projscan answering two agent questions: what breaks if I rename buildCodeGraph (impact analysis with definitions, direct callers, transitive reach), and where should I fix first (ranked hotspots with cyclomatic complexity)" width="700">
|
|
549
551
|
|
|
550
552
|
Two questions an agent asks; structural answers in milliseconds. *"What breaks if I rename `buildCodeGraph`?"* → 31 direct callers, 97 files reachable. *"Where should I fix first?"* → ranked hotspots with AST cyclomatic complexity, churn, and ownership signals.
|
|
551
553
|
|
|
@@ -720,7 +722,7 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
720
722
|
- **`projscan_apply_fix`** *(1.6)* - mechanically execute the safe fix templates. Default is dry-run; pass `confirm: true` to write. Atomic writes, per-apply rollback record at `.projscan-cache/rollbacks/<id>.json`. Reverse with `action: "rollback", rollback_id: ...`. Six templates supported at this release: `unused-dependency-*`, `missing-test-framework`, `missing-eslint`, `missing-prettier`, `missing-editorconfig`, `missing-readme`.
|
|
721
723
|
- **`projscan_taint`** *(1.6)* - source-to-sink reachability over the per-function call graph. Built-in defaults cover common JS / Python sources (`process.env`, `req.body`, etc.) and sinks (`exec`, `eval`, `db.query`, etc.). Project-specific names go in `.projscanrc.json` `taint`. `projscan_review` automatically diffs taint flows between base and head and **blocks any PR that introduces a new flow**.
|
|
722
724
|
|
|
723
|
-
For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
725
|
+
For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v2.0.0/docs/PLUGIN-AUTHORING.md).
|
|
724
726
|
|
|
725
727
|
### Context-window budgeting
|
|
726
728
|
|
package/dist/cli/_shared.d.ts
CHANGED
|
@@ -13,6 +13,6 @@ export declare function maybeCompactBanner(): void;
|
|
|
13
13
|
export declare function renderPluginReporterIfRequested(command: PluginReporterCommand, reporterName: unknown, payload: unknown): Promise<boolean>;
|
|
14
14
|
/** Walk a DirectoryNode to find the node whose `path` matches targetPath. */
|
|
15
15
|
export declare function sliceCliTree(node: DirectoryNode, targetPath: string): DirectoryNode | null;
|
|
16
|
-
export declare function analyzeFile(filePath: string
|
|
16
|
+
export declare function analyzeFile(filePath: string): Promise<FileExplanation>;
|
|
17
17
|
export declare function buildArchitectureLayers(files: FileEntry[], frameworkNames: string[]): ArchitectureLayer[];
|
|
18
18
|
export declare function promptYesNo(question: string): Promise<boolean>;
|
package/dist/cli/_shared.js
CHANGED
|
@@ -4,7 +4,7 @@ import path from 'node:path';
|
|
|
4
4
|
import readline from 'node:readline';
|
|
5
5
|
import { readFileSync } from 'node:fs';
|
|
6
6
|
import { fileURLToPath } from 'node:url';
|
|
7
|
-
import {
|
|
7
|
+
import { explainFile as explainProjectFile } from '../core/fileInspector.js';
|
|
8
8
|
import { setLogLevel } from '../utils/logger.js';
|
|
9
9
|
import { showBanner, showCompactBanner } from '../utils/banner.js';
|
|
10
10
|
import { loadConfig } from '../utils/config.js';
|
|
@@ -151,20 +151,9 @@ export function sliceCliTree(node, targetPath) {
|
|
|
151
151
|
}
|
|
152
152
|
return null;
|
|
153
153
|
}
|
|
154
|
-
export function analyzeFile(filePath
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
const exports = extractExports(content);
|
|
158
|
-
const purpose = inferPurpose(filePath, exports);
|
|
159
|
-
const potentialIssues = detectFileIssues(content, lines.length);
|
|
160
|
-
return {
|
|
161
|
-
filePath: path.relative(process.cwd(), filePath),
|
|
162
|
-
purpose,
|
|
163
|
-
imports,
|
|
164
|
-
exports,
|
|
165
|
-
potentialIssues,
|
|
166
|
-
lineCount: lines.length,
|
|
167
|
-
};
|
|
154
|
+
export async function analyzeFile(filePath) {
|
|
155
|
+
const rootPath = process.cwd();
|
|
156
|
+
return await explainProjectFile(rootPath, path.relative(rootPath, filePath));
|
|
168
157
|
}
|
|
169
158
|
export function buildArchitectureLayers(files, frameworkNames) {
|
|
170
159
|
const layers = [];
|
package/dist/cli/_shared.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_shared.js","sourceRoot":"","sources":["../../src/cli/_shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEz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,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACpC,IAAI,UAAU;QAAE,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IAC9C,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,QAAgB;IAC1C,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,MAAM,EAAE,GAAG,QAAQ,CAAC,eAAe,CAAC,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC;QACtF,EAAE,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,MAAM,EAAE,EAAE;YAC/B,EAAE,CAAC,KAAK,EAAE,CAAC;YACX,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import fs from 'node:fs/promises';
|
|
4
3
|
import { program, getFormat, setupLogLevel, maybeCompactBanner, analyzeFile } from '../_shared.js';
|
|
5
4
|
import { reportExplanation } from '../../reporters/consoleReporter.js';
|
|
6
5
|
import { reportExplanationJson } from '../../reporters/jsonReporter.js';
|
|
@@ -15,8 +14,7 @@ export function registerExplain() {
|
|
|
15
14
|
const format = getFormat();
|
|
16
15
|
const absolutePath = path.resolve(filePath);
|
|
17
16
|
try {
|
|
18
|
-
const
|
|
19
|
-
const explanation = analyzeFile(absolutePath, content);
|
|
17
|
+
const explanation = await analyzeFile(absolutePath);
|
|
20
18
|
switch (format) {
|
|
21
19
|
case 'json':
|
|
22
20
|
reportExplanationJson(explanation);
|
|
@@ -29,12 +27,13 @@ export function registerExplain() {
|
|
|
29
27
|
}
|
|
30
28
|
}
|
|
31
29
|
catch (error) {
|
|
32
|
-
|
|
30
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
31
|
+
if (error.code === 'ENOENT' || /not found/i.test(message)) {
|
|
33
32
|
console.error(chalk.red(`File not found: ${filePath}`));
|
|
34
33
|
console.error(chalk.dim(` Tip: paths are repo-relative. Run \`projscan structure\` to see the file tree.`));
|
|
35
34
|
}
|
|
36
35
|
else {
|
|
37
|
-
console.error(chalk.red(
|
|
36
|
+
console.error(chalk.red(message));
|
|
38
37
|
}
|
|
39
38
|
process.exit(1);
|
|
40
39
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../../../src/cli/commands/explain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AACvE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,qCAAqC,CAAC;AAEhF,MAAM,UAAU,eAAe;IAC7B,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,yDAAyD,CAAC;SACtE,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,EAAE;QACjC,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;QACr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Execution is opt-in via
|
|
4
|
+
* PROJSCAN_PLUGINS_PREVIEW=1 because plugins are local code.
|
|
5
5
|
*/
|
|
6
6
|
export declare function registerPlugin(): void;
|
|
@@ -3,14 +3,14 @@ import path from 'node:path';
|
|
|
3
3
|
import { program, getRootPath, getFormat, setupLogLevel, maybeCompactBanner } from '../_shared.js';
|
|
4
4
|
import { PLUGIN_PREVIEW_FLAG, discoverPluginManifests, pluginsEnabled, readPluginManifestFile, } from '../../core/plugins.js';
|
|
5
5
|
/**
|
|
6
|
-
* `projscan plugin`
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* `projscan plugin` — list and validate stable local plugins under
|
|
7
|
+
* `<root>/.projscan-plugins/`. Execution is opt-in via
|
|
8
|
+
* PROJSCAN_PLUGINS_PREVIEW=1 because plugins are local code.
|
|
9
9
|
*/
|
|
10
10
|
export function registerPlugin() {
|
|
11
11
|
const plugin = program
|
|
12
12
|
.command('plugin')
|
|
13
|
-
.description('Discover and validate local plugins
|
|
13
|
+
.description('Discover and validate local plugins')
|
|
14
14
|
.action(async () => {
|
|
15
15
|
await runList();
|
|
16
16
|
});
|
|
@@ -22,7 +22,7 @@ export function registerPlugin() {
|
|
|
22
22
|
});
|
|
23
23
|
plugin
|
|
24
24
|
.command('validate <manifest>')
|
|
25
|
-
.description('Validate a .projscan-plugin.json manifest against
|
|
25
|
+
.description('Validate a .projscan-plugin.json manifest against schema v1')
|
|
26
26
|
.action(async (manifest) => {
|
|
27
27
|
await runValidate(manifest);
|
|
28
28
|
});
|
|
@@ -49,9 +49,9 @@ async function runList() {
|
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
51
|
console.log('');
|
|
52
|
-
console.log(chalk.bold('Plugins
|
|
52
|
+
console.log(chalk.bold('Plugins'));
|
|
53
53
|
console.log(chalk.dim('────────────────────────────────────────'));
|
|
54
|
-
console.log(`
|
|
54
|
+
console.log(` execution enabled: ${enabled ? chalk.green('yes') : chalk.dim('no')} ${chalk.dim(`(${PLUGIN_PREVIEW_FLAG}=1)`)}`);
|
|
55
55
|
if (entries.length === 0) {
|
|
56
56
|
console.log(chalk.dim(' no manifests found under .projscan-plugins/'));
|
|
57
57
|
return;
|
|
@@ -75,7 +75,7 @@ async function runList() {
|
|
|
75
75
|
}
|
|
76
76
|
if (!enabled) {
|
|
77
77
|
console.log('');
|
|
78
|
-
console.log(chalk.dim(` Discovered but inactive. Set ${PLUGIN_PREVIEW_FLAG}=1 in the environment to enable
|
|
78
|
+
console.log(chalk.dim(` Discovered but inactive. Set ${PLUGIN_PREVIEW_FLAG}=1 in the environment to enable local plugin execution.`));
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
async function runValidate(manifestPath) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/cli/commands/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/cli/commands/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACnG,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACv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C,CAAC,CAAC;IAC7E,IAAI,UAAU,CAAC,IAAI;QAAE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,eAAe,UAAU,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ExportInfo, FileEntry, FileInspection, HotspotReport,
|
|
1
|
+
import type { ExportInfo, FileEntry, FileExplanation, FileInspection, HotspotReport, Issue } from '../types.js';
|
|
2
2
|
import { type CodeGraph } from './codeGraph.js';
|
|
3
3
|
export interface InspectOptions {
|
|
4
4
|
scan?: {
|
|
@@ -9,10 +9,7 @@ export interface InspectOptions {
|
|
|
9
9
|
/** If provided, prefer graph-derived imports/exports over regex parsing. */
|
|
10
10
|
graph?: CodeGraph;
|
|
11
11
|
}
|
|
12
|
+
export declare function explainFile(rootPath: string, relOrAbsFile: string, options?: InspectOptions): Promise<FileExplanation>;
|
|
12
13
|
export declare function inspectFile(rootPath: string, relOrAbsFile: string, options?: InspectOptions): Promise<FileInspection>;
|
|
13
|
-
/** @deprecated 0.17.0 — prefer `graphFile.imports` from `buildCodeGraph`. */
|
|
14
|
-
export declare function extractImports(content: string): ImportInfo[];
|
|
15
|
-
/** @deprecated 0.17.0 — prefer `graphFile.exports` from `buildCodeGraph`. */
|
|
16
|
-
export declare function extractExports(content: string): ExportInfo[];
|
|
17
14
|
export declare function inferPurpose(filePath: string, exports: ExportInfo[]): string;
|
|
18
15
|
export declare function detectFileIssues(content: string, lineCount: number): string[];
|
|
@@ -6,6 +6,20 @@ import { analyzeHotspots } from './hotspotAnalyzer.js';
|
|
|
6
6
|
import { getAdapterFor } from './languages/registry.js';
|
|
7
7
|
import { buildCodeGraph } from './codeGraph.js';
|
|
8
8
|
import { loadCachedGraph, saveCachedGraph } from './indexCache.js';
|
|
9
|
+
export async function explainFile(rootPath, relOrAbsFile, options = {}) {
|
|
10
|
+
const inspection = await inspectFile(rootPath, relOrAbsFile, options);
|
|
11
|
+
if (!inspection.exists) {
|
|
12
|
+
throw new Error(inspection.reason ?? 'File not found');
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
filePath: inspection.relativePath,
|
|
16
|
+
purpose: inspection.purpose,
|
|
17
|
+
imports: inspection.imports,
|
|
18
|
+
exports: inspection.exports,
|
|
19
|
+
potentialIssues: inspection.potentialIssues,
|
|
20
|
+
lineCount: inspection.lineCount,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
9
23
|
export async function inspectFile(rootPath, relOrAbsFile, options = {}) {
|
|
10
24
|
// Reject absolute paths up-front. The MCP `projscan_file` tool's docs
|
|
11
25
|
// describe `path` as "relative to the project root", but the prior
|
|
@@ -67,13 +81,20 @@ export async function inspectFile(rootPath, relOrAbsFile, options = {}) {
|
|
|
67
81
|
const lines = content.split('\n');
|
|
68
82
|
const adapter = getAdapterFor(relativePath);
|
|
69
83
|
const language = adapter?.id;
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
//
|
|
73
|
-
//
|
|
74
|
-
|
|
75
|
-
let
|
|
76
|
-
|
|
84
|
+
const files = options.scan?.files ?? (await scanRepository(resolvedRoot)).files;
|
|
85
|
+
const issues = options.issues ?? (await collectIssues(resolvedRoot, files));
|
|
86
|
+
// Build the graph before deriving imports/exports. The removed regex
|
|
87
|
+
// extractors only understood JS/TS and emitted misleading metadata for
|
|
88
|
+
// other languages.
|
|
89
|
+
let graph = options.graph;
|
|
90
|
+
if (!graph) {
|
|
91
|
+
const cached = await loadCachedGraph(resolvedRoot);
|
|
92
|
+
graph = await buildCodeGraph(resolvedRoot, files, cached);
|
|
93
|
+
await saveCachedGraph(resolvedRoot, graph);
|
|
94
|
+
}
|
|
95
|
+
let imports = [];
|
|
96
|
+
let exports = [];
|
|
97
|
+
const graphFile = graph.files.get(relativePath);
|
|
77
98
|
if (graphFile) {
|
|
78
99
|
imports = graphFile.imports.map((i) => ({
|
|
79
100
|
source: i.source,
|
|
@@ -85,28 +106,8 @@ export async function inspectFile(rootPath, relOrAbsFile, options = {}) {
|
|
|
85
106
|
type: mapExportType(e.kind),
|
|
86
107
|
}));
|
|
87
108
|
}
|
|
88
|
-
else if (language === 'javascript') {
|
|
89
|
-
imports = extractImports(content);
|
|
90
|
-
exports = extractExports(content);
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// Non-JS file with no graph: we don't have a safe extractor. Return empty
|
|
94
|
-
// rather than running the JS regex against (e.g.) Python and emitting garbage.
|
|
95
|
-
imports = [];
|
|
96
|
-
exports = [];
|
|
97
|
-
}
|
|
98
109
|
const purpose = inferPurpose(absolutePath, exports);
|
|
99
110
|
const potentialIssues = detectFileIssues(content, lines.length);
|
|
100
|
-
const files = options.scan?.files ?? (await scanRepository(resolvedRoot)).files;
|
|
101
|
-
const issues = options.issues ?? (await collectIssues(resolvedRoot, files));
|
|
102
|
-
// Build the graph if not provided. Powers AST cyclomatic complexity, fan-in,
|
|
103
|
-
// fan-out, and feeds the hotspot analyzer's CC-based risk score.
|
|
104
|
-
let graph = options.graph;
|
|
105
|
-
if (!graph) {
|
|
106
|
-
const cached = await loadCachedGraph(resolvedRoot);
|
|
107
|
-
graph = await buildCodeGraph(resolvedRoot, files, cached);
|
|
108
|
-
await saveCachedGraph(resolvedRoot, graph);
|
|
109
|
-
}
|
|
110
111
|
const hotspotReport = options.hotspots ?? (await analyzeHotspots(resolvedRoot, files, issues, { limit: 100, graph }));
|
|
111
112
|
const hotspot = findHotspotForFile(hotspotReport, relativePath);
|
|
112
113
|
const relatedIssues = issues.filter((issue) => (issue.title + '\n' + issue.description).includes(relativePath));
|
|
@@ -195,82 +196,6 @@ function findHotspotForFile(report, relativePath) {
|
|
|
195
196
|
return null;
|
|
196
197
|
return report.hotspots.find((h) => h.relativePath === relativePath) ?? null;
|
|
197
198
|
}
|
|
198
|
-
// ── Parsing (shared with CLI/MCP) ─────────────────────────
|
|
199
|
-
//
|
|
200
|
-
// 0.17.0: `extractImports` and `extractExports` below are JS/TS-only regex
|
|
201
|
-
// parsers kept for backward compatibility with `projscan_explain` and the
|
|
202
|
-
// CLI `analyzeFile` / `explainFile` helpers. The AST-based code graph
|
|
203
|
-
// (`buildCodeGraph` + `LanguageAdapter.parse`) is strictly better and is
|
|
204
|
-
// already used as the primary path in `inspectFile` above. These regex
|
|
205
|
-
// helpers are scheduled for removal in a future release once all
|
|
206
|
-
// `projscan_explain` paths take a graph; do not add new callers.
|
|
207
|
-
/** @deprecated 0.17.0 — prefer `graphFile.imports` from `buildCodeGraph`. */
|
|
208
|
-
export function extractImports(content) {
|
|
209
|
-
const imports = [];
|
|
210
|
-
const seen = new Set();
|
|
211
|
-
const addSource = (source) => {
|
|
212
|
-
if (!seen.has(source)) {
|
|
213
|
-
seen.add(source);
|
|
214
|
-
imports.push({
|
|
215
|
-
source,
|
|
216
|
-
specifiers: [],
|
|
217
|
-
isRelative: source.startsWith('.') || source.startsWith('/'),
|
|
218
|
-
});
|
|
219
|
-
}
|
|
220
|
-
};
|
|
221
|
-
// ES import - optional `type` keyword for type-only imports.
|
|
222
|
-
const esImportRegex = /import\s+(?:type\s+)?(?:(?:\{[^}]*\}|[\w*]+(?:\s*,\s*\{[^}]*\})?|\*\s+as\s+\w+)\s+from\s+)?['"]([^'"]+)['"]/gm;
|
|
223
|
-
let match;
|
|
224
|
-
while ((match = esImportRegex.exec(content)) !== null) {
|
|
225
|
-
addSource(match[1]);
|
|
226
|
-
}
|
|
227
|
-
// ES re-export - `export ... from '...'` counts as an import from the
|
|
228
|
-
// importer's point of view for graph-building purposes.
|
|
229
|
-
const esReexportRegex = /export\s+(?:type\s+)?(?:\{[^}]*\}|\*(?:\s+as\s+\w+)?)\s+from\s+['"]([^'"]+)['"]/gm;
|
|
230
|
-
while ((match = esReexportRegex.exec(content)) !== null) {
|
|
231
|
-
addSource(match[1]);
|
|
232
|
-
}
|
|
233
|
-
// Dynamic import()
|
|
234
|
-
const dynamicRegex = /import\(\s*['"]([^'"]+)['"]\s*\)/gm;
|
|
235
|
-
while ((match = dynamicRegex.exec(content)) !== null) {
|
|
236
|
-
addSource(match[1]);
|
|
237
|
-
}
|
|
238
|
-
// CommonJS require
|
|
239
|
-
const requireRegex = /(?:const|let|var)\s+(?:\{[^}]*\}|\w+)\s*=\s*require\(\s*['"]([^'"]+)['"]\s*\)/gm;
|
|
240
|
-
while ((match = requireRegex.exec(content)) !== null) {
|
|
241
|
-
addSource(match[1]);
|
|
242
|
-
}
|
|
243
|
-
return imports;
|
|
244
|
-
}
|
|
245
|
-
/** @deprecated 0.17.0 — prefer `graphFile.exports` from `buildCodeGraph`. */
|
|
246
|
-
export function extractExports(content) {
|
|
247
|
-
const exports = [];
|
|
248
|
-
const funcRegex = /^export\s+(?:async\s+)?function\s+(\w+)/gm;
|
|
249
|
-
let match;
|
|
250
|
-
while ((match = funcRegex.exec(content)) !== null) {
|
|
251
|
-
exports.push({ name: match[1], type: 'function' });
|
|
252
|
-
}
|
|
253
|
-
const classRegex = /^export\s+class\s+(\w+)/gm;
|
|
254
|
-
while ((match = classRegex.exec(content)) !== null) {
|
|
255
|
-
exports.push({ name: match[1], type: 'class' });
|
|
256
|
-
}
|
|
257
|
-
const varRegex = /^export\s+(?:const|let|var)\s+(\w+)/gm;
|
|
258
|
-
while ((match = varRegex.exec(content)) !== null) {
|
|
259
|
-
exports.push({ name: match[1], type: 'variable' });
|
|
260
|
-
}
|
|
261
|
-
const interfaceRegex = /^export\s+interface\s+(\w+)/gm;
|
|
262
|
-
while ((match = interfaceRegex.exec(content)) !== null) {
|
|
263
|
-
exports.push({ name: match[1], type: 'interface' });
|
|
264
|
-
}
|
|
265
|
-
const typeRegex = /^export\s+type\s+(\w+)/gm;
|
|
266
|
-
while ((match = typeRegex.exec(content)) !== null) {
|
|
267
|
-
exports.push({ name: match[1], type: 'type' });
|
|
268
|
-
}
|
|
269
|
-
if (/^export\s+default/m.test(content)) {
|
|
270
|
-
exports.push({ name: 'default', type: 'default' });
|
|
271
|
-
}
|
|
272
|
-
return exports;
|
|
273
|
-
}
|
|
274
199
|
/**
|
|
275
200
|
* Filename-keyword rules. Order matters — first match wins. Each pred
|
|
276
201
|
* runs against the lowercase basename (without extension).
|