projscan 2.8.0 → 3.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 +39 -23
- package/dist/cli/commands/dataflow.d.ts +1 -0
- package/dist/cli/commands/dataflow.js +76 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/init.js +46 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/preflight.js +16 -0
- package/dist/cli/commands/preflight.js.map +1 -1
- package/dist/cli/commands/recipes.d.ts +2 -0
- package/dist/cli/commands/recipes.js +94 -0
- package/dist/cli/commands/recipes.js.map +1 -0
- package/dist/cli/commands/semanticGraph.d.ts +1 -0
- package/dist/cli/commands/semanticGraph.js +55 -0
- package/dist/cli/commands/semanticGraph.js.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/adoption.d.ts +57 -0
- package/dist/core/adoption.js +392 -0
- package/dist/core/adoption.js.map +1 -0
- package/dist/core/dataflow.d.ts +7 -0
- package/dist/core/dataflow.js +194 -0
- package/dist/core/dataflow.js.map +1 -0
- package/dist/core/intent.d.ts +1 -1
- package/dist/core/intent.js +16 -0
- package/dist/core/intent.js.map +1 -1
- package/dist/core/prDiff.js +25 -1
- package/dist/core/prDiff.js.map +1 -1
- package/dist/core/regressionPlan.js +2 -0
- package/dist/core/regressionPlan.js.map +1 -1
- package/dist/core/review.js +100 -3
- package/dist/core/review.js.map +1 -1
- package/dist/core/semanticGraph.d.ts +7 -0
- package/dist/core/semanticGraph.js +167 -0
- package/dist/core/semanticGraph.js.map +1 -0
- package/dist/core/taint.d.ts +5 -5
- package/dist/core/workplan.js +4 -4
- package/dist/core/workplan.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools/adoption.d.ts +2 -0
- package/dist/mcp/tools/adoption.js +35 -0
- package/dist/mcp/tools/adoption.js.map +1 -0
- package/dist/mcp/tools/costSummary.js +2 -0
- package/dist/mcp/tools/costSummary.js.map +1 -1
- package/dist/mcp/tools/dataflow.d.ts +2 -0
- package/dist/mcp/tools/dataflow.js +58 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/semanticGraph.d.ts +2 -0
- package/dist/mcp/tools/semanticGraph.js +40 -0
- package/dist/mcp/tools/semanticGraph.js.map +1 -0
- package/dist/mcp/tools.js +6 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +6 -6
- package/dist/reporters/consoleReporter.js +4 -0
- package/dist/reporters/consoleReporter.js.map +1 -1
- package/dist/tool-manifest.json +81 -3
- package/dist/types.d.ts +94 -1
- package/dist/utils/formatSupport.d.ts +5 -0
- package/dist/utils/formatSupport.js +5 -0
- package/dist/utils/formatSupport.js.map +1 -1
- package/docs/PLUGIN-AUTHORING.md +4 -0
- package/docs/PLUGIN-GALLERY.md +61 -0
- package/docs/examples/plugins/release-readiness.mjs +26 -0
- package/docs/examples/plugins/release-readiness.projscan-plugin.json +8 -0
- package/docs/examples/plugins/security-radar.mjs +50 -0
- package/docs/examples/plugins/security-radar.projscan-plugin.json +8 -0
- package/package.json +3 -2
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/v3.0.0/docs/GUIDE.md) · [Roadmap](https://github.com/abhiyoheswaran1/projscan/blob/v3.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/v3.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
|
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
|
|
22
22
|
AI coding agents are becoming the primary interface to code. Today, when you ask your agent *"which files implement auth?"* or *"what breaks if I bump React from 18 to 19?"* - it either guesses from names, or it shells out to grep and reads raw output not built for it.
|
|
23
23
|
|
|
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 structured MCP tools. It can run a preflight safety gate before edits or merge, including supply-chain IOC evidence, query
|
|
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 structured MCP tools. It can run a preflight safety gate before edits or merge, including supply-chain IOC evidence, query a stable v3 semantic graph, detect bridge-helper dataflow risks, 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 and bridge-dataflow 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
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
|
|
|
@@ -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/v3.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/v3.0.0/docs/npx%20projscan%20doctor.gif" alt="npx projscan doctor" width="700">
|
|
45
45
|
|
|
46
46
|
## Install
|
|
47
47
|
|
|
@@ -61,6 +61,9 @@ Run inside any repository:
|
|
|
61
61
|
|
|
62
62
|
```bash
|
|
63
63
|
projscan # Full project analysis
|
|
64
|
+
projscan first-run # First-run setup diagnostics for CLI + MCP
|
|
65
|
+
projscan init mcp --client all # Ready-to-paste MCP client configs
|
|
66
|
+
projscan recipes # Agent workflow recipes
|
|
64
67
|
projscan workplan --mode bug_hunt # Prioritized agent execution plan
|
|
65
68
|
projscan bug-hunt --format json # Bug-hunt fix queue with verification commands
|
|
66
69
|
projscan agent-brief --intent bug_hunt # Compact next-agent context packet
|
|
@@ -72,6 +75,8 @@ projscan handoff # Concise next-agent handoff
|
|
|
72
75
|
projscan preflight --format json # Agent safety gate with supply-chain evidence
|
|
73
76
|
projscan doctor # Health check, including security and supply-chain risks
|
|
74
77
|
projscan hotspots # Rank files by risk (churn × complexity × issues × ownership)
|
|
78
|
+
projscan semantic-graph --format json # Stable v3 file/function/package/symbol graph
|
|
79
|
+
projscan dataflow --format json # Direct, propagated, and bridge dataflow risks
|
|
75
80
|
projscan search <query> # BM25-ranked search (content + symbols + path)
|
|
76
81
|
projscan file <path> # Drill into a file - purpose, risk, ownership, issues
|
|
77
82
|
projscan fix # Auto-fix detected issues
|
|
@@ -92,15 +97,18 @@ projscan plugin test .projscan-plugins/policy.projscan-plugin.json
|
|
|
92
97
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor --reporter team-radar
|
|
93
98
|
```
|
|
94
99
|
|
|
95
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
100
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20--help.gif" alt="npx projscan --help" width="700">
|
|
96
101
|
|
|
97
|
-
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
102
|
+
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/GUIDE.md)**.
|
|
98
103
|
|
|
99
104
|
## Commands
|
|
100
105
|
|
|
101
106
|
| Command | Description |
|
|
102
107
|
|---------|-------------|
|
|
103
108
|
| `projscan analyze` | Full analysis - languages, frameworks, dependencies, issues |
|
|
109
|
+
| `projscan first-run` | First-run setup diagnostics for Node, Git, config, plugins, and MCP startup |
|
|
110
|
+
| `projscan init mcp` | Ready-to-paste MCP client configs for popular agent clients |
|
|
111
|
+
| `projscan recipes` | Agent workflow recipes for before edit, bug hunt, approval, handoff, and pre-merge |
|
|
104
112
|
| `projscan workplan` | Agent execution plan - prioritized tasks with evidence, tools, verification, and handoff text |
|
|
105
113
|
| `projscan bug-hunt` | Prioritized bug-hunt fix queue from doctor, preflight, hotspot, and session evidence |
|
|
106
114
|
| `projscan agent-brief` | Compact next-agent context packet with focus items, guardrails, repo context, and next actions |
|
|
@@ -112,6 +120,8 @@ For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiy
|
|
|
112
120
|
| `projscan doctor` | Health check - missing tooling, architecture smells, security and supply-chain risks |
|
|
113
121
|
| `projscan preflight` | Agent safety gate - `proceed`, `caution`, or `block` with health, change, plugin, and supply-chain evidence |
|
|
114
122
|
| `projscan hotspots` | Rank files by risk - churn × complexity × issues × ownership |
|
|
123
|
+
| `projscan semantic-graph` | Stable v3 graph contract - files, functions, packages, symbols, imports, exports, definitions, and calls |
|
|
124
|
+
| `projscan dataflow` | Direct, propagated, and bridge source-to-sink dataflow risks |
|
|
115
125
|
| `projscan search <query>` | **BM25-ranked search** - content + symbols + path, with excerpts |
|
|
116
126
|
| `projscan file <path>` | Drill into a file - purpose, risk, ownership, related issues |
|
|
117
127
|
| `projscan fix` | Auto-fix issues (ESLint, Prettier, Vitest, .editorconfig) |
|
|
@@ -145,31 +155,31 @@ projscan --help
|
|
|
145
155
|
<details>
|
|
146
156
|
<summary><strong>projscan structure</strong> - Directory tree with file counts</summary>
|
|
147
157
|
|
|
148
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
158
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20structure.gif" alt="npx projscan structure" width="700">
|
|
149
159
|
</details>
|
|
150
160
|
|
|
151
161
|
<details>
|
|
152
162
|
<summary><strong>projscan diagram</strong> - Architecture visualization</summary>
|
|
153
163
|
|
|
154
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
164
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20diagram.gif" alt="npx projscan diagram" width="700">
|
|
155
165
|
</details>
|
|
156
166
|
|
|
157
167
|
<details>
|
|
158
168
|
<summary><strong>projscan dependencies</strong> - Dependency analysis</summary>
|
|
159
169
|
|
|
160
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
170
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20dependencies.gif" alt="npx projscan dependencies" width="700">
|
|
161
171
|
</details>
|
|
162
172
|
|
|
163
173
|
<details>
|
|
164
174
|
<summary><strong>projscan explain</strong> - File explanation</summary>
|
|
165
175
|
|
|
166
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
176
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20explain.gif" alt="npx projscan explain" width="700">
|
|
167
177
|
</details>
|
|
168
178
|
|
|
169
179
|
<details>
|
|
170
180
|
<summary><strong>projscan badge</strong> - Health badge generation</summary>
|
|
171
181
|
|
|
172
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
182
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20badge.gif" alt="npx projscan badge" width="700">
|
|
173
183
|
</details>
|
|
174
184
|
|
|
175
185
|
### Output Formats
|
|
@@ -191,7 +201,7 @@ Run `projscan help` for the generated command-by-command support matrix.
|
|
|
191
201
|
|
|
192
202
|
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.
|
|
193
203
|
|
|
194
|
-
**2.0 upgrade notes:** migrating from 1.x or authoring plugins? Start with the [2.0 Migration Guide](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
204
|
+
**2.0 upgrade notes:** migrating from 1.x or authoring plugins? Start with the [2.0 Migration Guide](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/2.0-MIGRATION.md), then use [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/PLUGIN-AUTHORING.md), the [Plugin Gallery](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/PLUGIN-GALLERY.md), and the [manifest schema](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/plugin.schema.json) as the stable contract.
|
|
195
205
|
|
|
196
206
|
```bash
|
|
197
207
|
projscan plugin list
|
|
@@ -200,9 +210,9 @@ PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor --reporter team-radar
|
|
|
200
210
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan ci --reporter team-radar --min-score 80
|
|
201
211
|
```
|
|
202
212
|
|
|
203
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
213
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/projscan-reporter-plugin.gif" alt="projscan local reporter plugin rendering a team health report" width="700">
|
|
204
214
|
|
|
205
|
-
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/
|
|
215
|
+
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/v3.0.0/docs/PLUGIN-AUTHORING.md) for manifest shape, `render(context)`, validation, and the trust model.
|
|
206
216
|
|
|
207
217
|
### Options
|
|
208
218
|
|
|
@@ -363,7 +373,7 @@ If you read projscan's [Socket report](https://socket.dev/npm/package/projscan),
|
|
|
363
373
|
### Audit it yourself
|
|
364
374
|
|
|
365
375
|
- **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.
|
|
366
|
-
- **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/
|
|
376
|
+
- **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/v3.0.0/docs/STABILITY.md).
|
|
367
377
|
- **Run it offline:** `npm install -g projscan` followed by anything except `audit` and `--mode semantic` works without network.
|
|
368
378
|
- **Drop privilege further:** in CI, run projscan in a sandbox that disallows network egress; everything except `audit` will pass.
|
|
369
379
|
|
|
@@ -401,7 +411,7 @@ projscan ci --changed-only # Gate only on this PR's diff
|
|
|
401
411
|
projscan ci --format sarif > projscan.sarif # SARIF for Code Scanning
|
|
402
412
|
```
|
|
403
413
|
|
|
404
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
414
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20ci%20--min-score%2070.gif" alt="npx projscan ci --min-score 70" width="700">
|
|
405
415
|
|
|
406
416
|
### GitHub Action (recommended)
|
|
407
417
|
|
|
@@ -470,7 +480,7 @@ Fields:
|
|
|
470
480
|
- `hotspots.limit` / `hotspots.since` - defaults for the `hotspots` command
|
|
471
481
|
- `monorepo.importPolicy` - cross-package import allow/deny rules in monorepos *(0.14+)*
|
|
472
482
|
|
|
473
|
-
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
483
|
+
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/GUIDE.md#configuration-projscanrc) for the full reference (field types, validation behavior, embedding config in `package.json`, monorepo `importPolicy` semantics).
|
|
474
484
|
|
|
475
485
|
## Tracking Health Over Time
|
|
476
486
|
|
|
@@ -483,7 +493,7 @@ projscan diff # Compare against baseline
|
|
|
483
493
|
projscan diff --format markdown # Markdown diff for PRs
|
|
484
494
|
```
|
|
485
495
|
|
|
486
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
496
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.0.0/docs/npx%20projscan%20diff%20--save-baseline.gif" alt="npx projscan diff --save-baseline" width="700">
|
|
487
497
|
|
|
488
498
|
## Hotspots - Where to Fix First
|
|
489
499
|
|
|
@@ -572,7 +582,7 @@ Coverage is also automatically joined into `projscan hotspots` when one of those
|
|
|
572
582
|
|
|
573
583
|
**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.
|
|
574
584
|
|
|
575
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/
|
|
585
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.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">
|
|
576
586
|
|
|
577
587
|
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.
|
|
578
588
|
|
|
@@ -700,6 +710,8 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
700
710
|
### What agents can ask
|
|
701
711
|
|
|
702
712
|
- *"Who imports `src/auth/jwt.ts`?"* → `projscan_graph { file, direction: "importers" }`
|
|
713
|
+
- *"Give me the whole agent-safe graph contract."* → `projscan_semantic_graph`
|
|
714
|
+
- *"Did this wrapper connect a source reader to a dangerous sink?"* → `projscan_dataflow`
|
|
703
715
|
- *"Where is `runAudit` defined?"* → `projscan_search { query: "runAudit", scope: "symbols" }`
|
|
704
716
|
- *"Which files implement auth?"* → `projscan_search { query: "auth", scope: "content" }`
|
|
705
717
|
- *"What are the scariest untested files?"* → `projscan_coverage`
|
|
@@ -712,11 +724,14 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
712
724
|
- *"What evidence do I need before approval?"* → `projscan_evidence_pack { website_prompt: true }`
|
|
713
725
|
- *"Which checks prove this bigger product update?"* → `projscan_regression_plan { level: "full" }`
|
|
714
726
|
- *"How do I plan the next six product lines?"* → `projscan_release_train`
|
|
727
|
+
- *"How do I wire projscan into this MCP client?"* → `projscan_adoption { action: "mcp_config", client: "codex" }`
|
|
715
728
|
|
|
716
|
-
### The
|
|
729
|
+
### The 39 MCP tools
|
|
717
730
|
|
|
718
731
|
**Structural (0.6.0 / 0.11 / 0.13 / 0.14 / 0.15 - agent-native):**
|
|
719
732
|
- **`projscan_graph`** - query the AST-based code graph. Directions: `imports`, `exports`, `importers`, `symbol_defs`, `package_importers`. Millisecond responses on a warm cache.
|
|
733
|
+
- **`projscan_semantic_graph`** *(3.0)* - stable v3 semantic graph contract with file, function, package, and symbol nodes plus `defines`, `imports`, `imports_package`, `exports`, and `calls` edges.
|
|
734
|
+
- **`projscan_dataflow`** *(3.0)* - direct, propagated, and bridge source-to-sink dataflow risks. Catches wrapper functions that call both a source reader and a dangerous sink even when legacy taint reachability cannot see that bridge.
|
|
720
735
|
- **`projscan_search`** - fast search across `symbols` (exported names), `files` (path substring), or `content` (source substring with line + excerpt). Sub-file mode (`sub_file: true`) embeds per-function for sharper semantic results *(0.15)*.
|
|
721
736
|
- **`projscan_coupling`** *(0.11)* - per-file fan-in / fan-out / instability + circular-import cycles (Tarjan SCC). Filter by `direction: cycles_only | high_fan_in | high_fan_out`.
|
|
722
737
|
- **`projscan_pr_diff`** *(0.11)* - structural diff between two git refs. Returns added/removed/modified files with explicit lists of exports, imports, and call sites that changed, plus ΔCC and Δfan-in.
|
|
@@ -728,6 +743,7 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
728
743
|
- **`projscan_regression_plan`** *(2.3)* - smoke/focused/full regression matrix. Turns bug-hunt, preflight, and product risk into deduplicated verification commands.
|
|
729
744
|
- **`projscan_agent_brief`** *(2.3)* - compact next-agent context packet with focus items, repo context, guardrails, and suggested next actions.
|
|
730
745
|
- **`projscan_quality_scorecard`** *(2.3)* - dimensioned quality view across health, security, tests, maintainability, coordination, top risks, and verification commands.
|
|
746
|
+
- **`projscan_adoption`** *(2.9)* - adoption helper for MCP config snippets, workflow recipes, and first-run diagnostics.
|
|
731
747
|
- **`projscan_fix_suggest`** *(0.14)* - structured action prompt for any open issue: headline, why it matters, where, one-paragraph instruction, optional suggested test. Closes the diagnose → fix loop.
|
|
732
748
|
- **`projscan_explain_issue`** *(0.14)* - deep dive on one issue: code excerpt, related issues in the same file, similar past commits via `git log --grep`, plus the structured FixSuggestion.
|
|
733
749
|
- **`projscan_impact`** *(0.15)* - transitive blast-radius for a file or symbol. BFS over reverse imports + symbol callsites. Use BEFORE renaming or deleting to see what breaks.
|
|
@@ -759,9 +775,9 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
759
775
|
**Operator (1.6):**
|
|
760
776
|
- **`projscan_workspace_graph`** *(1.6)* - cross-repo intelligence over sibling repos registered with `projscan workspace add`. Subactions: `list` (registered repos + parsed-file + export counts), `graph` (every symbol exported by ≥ 2 repos — the candidate refactor / API contract surface), `file_importers` (given a file in one repo, every other repo whose graph imports it). Read-only.
|
|
761
777
|
- **`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`.
|
|
762
|
-
- **`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**.
|
|
778
|
+
- **`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**. In 3.0, review also surfaces `newDataflowRisks` for bridge-helper patterns.
|
|
763
779
|
|
|
764
|
-
For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/
|
|
780
|
+
For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v3.0.0/docs/PLUGIN-AUTHORING.md).
|
|
765
781
|
|
|
766
782
|
### Context-window budgeting
|
|
767
783
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function registerDataflow(): void;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { assertFormatSupported, getRootPath, loadProjectConfig, maybeCompactBanner, program, setupLogLevel, } from '../_shared.js';
|
|
3
|
+
import { scanRepository } from '../../core/repositoryScanner.js';
|
|
4
|
+
import { buildCodeGraph } from '../../core/codeGraph.js';
|
|
5
|
+
import { computeDataflow } from '../../core/dataflow.js';
|
|
6
|
+
export function registerDataflow() {
|
|
7
|
+
program
|
|
8
|
+
.command('dataflow')
|
|
9
|
+
.description('Detect direct, propagated, and bridge source-to-sink dataflow risks')
|
|
10
|
+
.option('--source <name...>', 'add a custom source name (repeatable)')
|
|
11
|
+
.option('--sink <name...>', 'add a custom sink name (repeatable)')
|
|
12
|
+
.option('--max-risks <count>', 'maximum risks to return', parsePositiveInt)
|
|
13
|
+
.action(async (cmdOpts) => {
|
|
14
|
+
setupLogLevel();
|
|
15
|
+
maybeCompactBanner();
|
|
16
|
+
const format = assertFormatSupported('dataflow');
|
|
17
|
+
try {
|
|
18
|
+
const rootPath = getRootPath();
|
|
19
|
+
const config = await loadProjectConfig();
|
|
20
|
+
const scan = await scanRepository(rootPath, { ignore: config.ignore });
|
|
21
|
+
const graph = await buildCodeGraph(rootPath, scan.files);
|
|
22
|
+
const sources = [...(config.taint?.sources ?? []), ...(cmdOpts.source ?? [])];
|
|
23
|
+
const sinks = [...(config.taint?.sinks ?? []), ...(cmdOpts.sink ?? [])];
|
|
24
|
+
const maxRisks = Math.max(1, Math.min(500, cmdOpts.maxRisks ?? 50));
|
|
25
|
+
const report = computeDataflow(graph, { sources, sinks });
|
|
26
|
+
const shaped = {
|
|
27
|
+
...report,
|
|
28
|
+
risks: report.risks.slice(0, maxRisks),
|
|
29
|
+
truncated: report.risks.length > maxRisks || report.truncated,
|
|
30
|
+
};
|
|
31
|
+
if (format === 'json') {
|
|
32
|
+
console.log(JSON.stringify(shaped, null, 2));
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
printDataflow(shaped);
|
|
36
|
+
}
|
|
37
|
+
catch (err) {
|
|
38
|
+
console.error(chalk.red(err instanceof Error ? err.message : String(err)));
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function printDataflow(report) {
|
|
44
|
+
console.log('');
|
|
45
|
+
console.log(chalk.bold('Dataflow risks'));
|
|
46
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
47
|
+
if (!report.available) {
|
|
48
|
+
console.log(` ${chalk.yellow('!')} ${report.reason ?? 'unavailable'}`);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (report.riskCount === 0) {
|
|
52
|
+
console.log(' No dataflow risks detected.');
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
console.log(` ${chalk.bold(report.riskCount)} risk(s) detected:`);
|
|
56
|
+
console.log('');
|
|
57
|
+
for (const risk of report.risks) {
|
|
58
|
+
printRisk(risk);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
function printRisk(risk) {
|
|
62
|
+
const where = risk.bridgeFn ? `${risk.bridgeFn}: ` : '';
|
|
63
|
+
console.log(` ${chalk.red('●')} ${where}${chalk.bold(risk.source)} → ${chalk.bold(risk.sink)}`);
|
|
64
|
+
console.log(` ${chalk.dim('kind:')} ${risk.kind} (${risk.confidence})`);
|
|
65
|
+
console.log(` ${chalk.dim('path:')} ${risk.path.join(' → ')}`);
|
|
66
|
+
console.log(` ${chalk.dim('files:')} ${risk.files.join(', ')}`);
|
|
67
|
+
console.log('');
|
|
68
|
+
}
|
|
69
|
+
function parsePositiveInt(value) {
|
|
70
|
+
const parsed = Number.parseInt(value, 10);
|
|
71
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
72
|
+
throw new Error('value must be a positive integer');
|
|
73
|
+
}
|
|
74
|
+
return parsed;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=dataflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dataflow.js","sourceRoot":"","sources":["../../../src/cli/commands/dataflow.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAGzD,MAAM,UAAU,gBAAgB;IAC9B,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,qEAAqE,CAAC;SAClF,MAAM,CAAC,oBAAoB,EAAE,uCAAuC,CAAC;SACrE,MAAM,CAAC,kBAAkB,EAAE,qCAAqC,CAAC;SACjE,MAAM,CAAC,qBAAqB,EAAE,yBAAyB,EAAE,gBAAgB,CAAC;SAC1E,MAAM,CAAC,KAAK,EAAE,OAAkE,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B,CAAC"}
|
|
@@ -2,13 +2,14 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
4
|
import { program, getRootPath, setupLogLevel, maybeCompactBanner, assertFormatSupported } from '../_shared.js';
|
|
5
|
+
import { getMcpConfigGuide, isMcpClientId, MCP_CLIENT_IDS } from '../../core/adoption.js';
|
|
5
6
|
/**
|
|
6
7
|
* `projscan init` (1.6+) — scaffold `.projscanrc.json` for new
|
|
7
8
|
* adopters. Idempotent: if the config already exists, prints a diff
|
|
8
9
|
* against the suggested defaults instead of overwriting.
|
|
9
10
|
*/
|
|
10
11
|
export function registerInit() {
|
|
11
|
-
program
|
|
12
|
+
const init = program
|
|
12
13
|
.command('init')
|
|
13
14
|
.description('Scaffold .projscanrc.json with sensible defaults (1.6+)')
|
|
14
15
|
.option('--force', 'overwrite an existing .projscanrc.json (default: refuse)')
|
|
@@ -25,6 +26,27 @@ export function registerInit() {
|
|
|
25
26
|
process.exit(1);
|
|
26
27
|
}
|
|
27
28
|
});
|
|
29
|
+
init
|
|
30
|
+
.command('mcp')
|
|
31
|
+
.description('Print ready-to-paste MCP client config snippets')
|
|
32
|
+
.option('--client <client>', `client: ${MCP_CLIENT_IDS.join(', ')}`, 'all')
|
|
33
|
+
.action(async (opts) => {
|
|
34
|
+
setupLogLevel();
|
|
35
|
+
maybeCompactBanner();
|
|
36
|
+
const format = assertFormatSupported('init mcp');
|
|
37
|
+
const client = opts.client ?? 'all';
|
|
38
|
+
if (!isMcpClientId(client)) {
|
|
39
|
+
console.error(chalk.red(`Unsupported --client ${client}.`));
|
|
40
|
+
console.error(chalk.dim(`Supported clients: ${MCP_CLIENT_IDS.join(', ')}`));
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
const guide = getMcpConfigGuide(client);
|
|
44
|
+
if (format === 'json') {
|
|
45
|
+
console.log(JSON.stringify(guide, null, 2));
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
printMcpGuide(guide);
|
|
49
|
+
});
|
|
28
50
|
}
|
|
29
51
|
const DEFAULT_CONFIG = {
|
|
30
52
|
minScore: 70,
|
|
@@ -68,4 +90,27 @@ function prefixIndent(text, indent) {
|
|
|
68
90
|
.map((l) => indent + l)
|
|
69
91
|
.join('\n');
|
|
70
92
|
}
|
|
93
|
+
function printMcpGuide(guide) {
|
|
94
|
+
console.log('');
|
|
95
|
+
console.log(chalk.bold('MCP Client Config'));
|
|
96
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
97
|
+
console.log(` install: ${chalk.cyan(guide.install.command)}`);
|
|
98
|
+
console.log(` server : ${chalk.cyan(guide.install.mcpServerCommand)}`);
|
|
99
|
+
console.log('');
|
|
100
|
+
if (guide.client === 'all') {
|
|
101
|
+
for (const config of guide.configs)
|
|
102
|
+
printSingleGuide(config);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
printSingleGuide(guide);
|
|
106
|
+
}
|
|
107
|
+
function printSingleGuide(guide) {
|
|
108
|
+
console.log(chalk.bold(` ${guide.displayName}`));
|
|
109
|
+
console.log(chalk.dim(` ${guide.whereToPaste}`));
|
|
110
|
+
console.log(prefixIndent(guide.configText, ' '));
|
|
111
|
+
if (guide.notes.length > 0) {
|
|
112
|
+
console.log(chalk.dim(` note: ${guide.notes.join(' ')}`));
|
|
113
|
+
}
|
|
114
|
+
console.log('');
|
|
115
|
+
}
|
|
71
116
|
//# sourceMappingURL=init.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../src/cli/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe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AAK,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;IACpD,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,aAAa,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC;IAC/D,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -61,6 +61,20 @@ function printConsoleReport(report) {
|
|
|
61
61
|
: chalk.green;
|
|
62
62
|
console.log(color(`Preflight: ${report.verdict}`));
|
|
63
63
|
console.log(report.summary);
|
|
64
|
+
if (report.requiredChecks.length > 0) {
|
|
65
|
+
console.log('');
|
|
66
|
+
console.log(chalk.bold('Required checks'));
|
|
67
|
+
for (const check of report.requiredChecks) {
|
|
68
|
+
const statusColor = check.status === 'fail'
|
|
69
|
+
? chalk.red
|
|
70
|
+
: check.status === 'warn'
|
|
71
|
+
? chalk.yellow
|
|
72
|
+
: check.status === 'pass'
|
|
73
|
+
? chalk.green
|
|
74
|
+
: chalk.dim;
|
|
75
|
+
console.log(`- ${check.name}: ${statusColor(check.status)} ${chalk.dim(check.reason)}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
64
78
|
if (report.reasons.length > 0) {
|
|
65
79
|
console.log('');
|
|
66
80
|
console.log(chalk.bold('Reasons'));
|
|
@@ -76,5 +90,7 @@ function printConsoleReport(report) {
|
|
|
76
90
|
console.log(`- ${action.command ?? action.tool ?? action.label}`);
|
|
77
91
|
}
|
|
78
92
|
}
|
|
93
|
+
console.log('');
|
|
94
|
+
console.log(chalk.dim('For agent workflows, run `projscan workplan --mode before_edit --format json` or `projscan recipes`.'));
|
|
79
95
|
}
|
|
80
96
|
//# sourceMappingURL=preflight.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"preflight.js","sourceRoot":"","sources":["../../../src/cli/commands/preflight.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAG3D,MAAM,eAAe,GAA6B;IAChD,aAAa;IACb,eAAe;IACf,cAAc;CACf,CAAC;AAEF,MAAM,UAAU,iBAAiB;IAC/B,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,4CAA4C,CAAC;SACzD,MAAM,CAAC,eAAe,EAAE,6CAA6C,EAAE,aAAa,CAAC;SACrF,MAAM,CAAC,kBAAkB,EAAE,sCAAsC,CAAC;SAClE,MAAM,CAAC,kBAAkB,EAAE,+BAA+B,CAAC;SAC3D,MAAM,CAAC,6BAA6B,EAAE,qCAAqC,EAAE,gBAAgB,CAAC;SAC9F,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,qBAAqB,CAAC,WAAW,CAAC,CAAC;QAClD,MAAM,IAAI,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QAErC,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,gBAAgB,CAAC,WAAW,EAAE,EAAE;gBACnD,IAAI;gBACJ,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,OAAO,EAAE,OAAO,CAAC,OAAO;gBACxB,eAAe,EAAE,OAAO,CAAC,eAAe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k';
|
|
2
|
+
import { assertFormatSupported, getRootPath, maybeCompactBanner, program, setupLogLevel, } from '../_shared.js';
|
|
3
|
+
import { computeFirstRunDiagnostics, getWorkflowRecipes, } from '../../core/adoption.js';
|
|
4
|
+
export function registerRecipes() {
|
|
5
|
+
program
|
|
6
|
+
.command('recipes')
|
|
7
|
+
.description('Print agent workflow recipes for adopting projscan')
|
|
8
|
+
.action(async () => {
|
|
9
|
+
setupLogLevel();
|
|
10
|
+
maybeCompactBanner();
|
|
11
|
+
const format = assertFormatSupported('recipes');
|
|
12
|
+
const catalog = getWorkflowRecipes();
|
|
13
|
+
if (format === 'json') {
|
|
14
|
+
console.log(JSON.stringify(catalog, null, 2));
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
printRecipes(catalog);
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
export function registerFirstRun() {
|
|
21
|
+
program
|
|
22
|
+
.command('first-run')
|
|
23
|
+
.description('Diagnose first-run setup for CLI and MCP adoption')
|
|
24
|
+
.action(async () => {
|
|
25
|
+
setupLogLevel();
|
|
26
|
+
maybeCompactBanner();
|
|
27
|
+
const format = assertFormatSupported('first-run');
|
|
28
|
+
const report = await computeFirstRunDiagnostics(getRootPath());
|
|
29
|
+
if (format === 'json') {
|
|
30
|
+
console.log(JSON.stringify(report, null, 2));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
printFirstRun(report);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function printRecipes(catalog) {
|
|
37
|
+
console.log('');
|
|
38
|
+
console.log(chalk.bold('Agent Workflow Recipes'));
|
|
39
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
40
|
+
for (const recipe of catalog.recipes) {
|
|
41
|
+
console.log(`\n ${chalk.bold(recipe.name)} ${chalk.dim(`(${recipe.id})`)}`);
|
|
42
|
+
console.log(` ${recipe.useWhen}`);
|
|
43
|
+
console.log(chalk.dim(` outcome: ${recipe.outcome}`));
|
|
44
|
+
console.log(` commands:`);
|
|
45
|
+
for (const command of recipe.commands) {
|
|
46
|
+
console.log(` ${chalk.cyan(command)}`);
|
|
47
|
+
}
|
|
48
|
+
console.log(chalk.dim(` MCP tools: ${recipe.mcpTools.join(', ')}`));
|
|
49
|
+
console.log(chalk.dim(` handoff: ${recipe.handoff}`));
|
|
50
|
+
}
|
|
51
|
+
console.log('');
|
|
52
|
+
}
|
|
53
|
+
function printFirstRun(report) {
|
|
54
|
+
console.log('');
|
|
55
|
+
console.log(chalk.bold('First-Run Diagnostics'));
|
|
56
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
57
|
+
console.log(` overall: ${colorStatus(report.overall)(report.overall)}`);
|
|
58
|
+
for (const diagnostic of report.diagnostics) {
|
|
59
|
+
printDiagnostic(diagnostic);
|
|
60
|
+
}
|
|
61
|
+
console.log('');
|
|
62
|
+
console.log(chalk.bold('Next commands'));
|
|
63
|
+
for (const command of report.nextCommands) {
|
|
64
|
+
console.log(` ${chalk.cyan(command)}`);
|
|
65
|
+
}
|
|
66
|
+
console.log('');
|
|
67
|
+
}
|
|
68
|
+
function printDiagnostic(diagnostic) {
|
|
69
|
+
const color = colorStatus(diagnostic.status);
|
|
70
|
+
console.log(` ${color(symbolForStatus(diagnostic.status))} ${chalk.bold(diagnostic.label)}: ${diagnostic.summary}`);
|
|
71
|
+
if (diagnostic.detail)
|
|
72
|
+
console.log(chalk.dim(` ${diagnostic.detail}`));
|
|
73
|
+
if (diagnostic.command)
|
|
74
|
+
console.log(chalk.dim(` try: ${diagnostic.command}`));
|
|
75
|
+
}
|
|
76
|
+
function colorStatus(status) {
|
|
77
|
+
if (status === 'fail')
|
|
78
|
+
return chalk.red;
|
|
79
|
+
if (status === 'warn')
|
|
80
|
+
return chalk.yellow;
|
|
81
|
+
if (status === 'pass')
|
|
82
|
+
return chalk.green;
|
|
83
|
+
return chalk.cyan;
|
|
84
|
+
}
|
|
85
|
+
function symbolForStatus(status) {
|
|
86
|
+
if (status === 'fail')
|
|
87
|
+
return '✗';
|
|
88
|
+
if (status === 'warn')
|
|
89
|
+
return '!';
|
|
90
|
+
if (status === 'pass')
|
|
91
|
+
return '✓';
|
|
92
|
+
return 'i';
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=recipes.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"recipes.js","sourceRoot":"","sources":["../../../src/cli/commands/recipes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,0BAA0B,EAC1B,kBAAkB,GAInB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,UAAU,eAAe;IAC7B,OAAO;SACJ,OAAO,CAAC,SAAS,CAAC;SAClB,WAAW,CAAC,oDAAoD,CAAC;SACjE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;QAChD,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;QACrC,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;YACtB,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;YAC9C,OAAO;QACT,CAAC;QACD,YAAY,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC,CAAC,CAAC;AACP,CAAC;AAED,MAAM,UAAU,gBAAgB;IAC9B,OAAO;SACJ,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,mDAAmD,CAAC;SAChE,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,qBAAqB,CA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