projscan 3.4.0 → 3.4.1
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 +25 -23
- package/dist/cli/commands/plugin.js +10 -2
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/cli/commands/workplan.js +1 -1
- package/dist/cli/commands/workplan.js.map +1 -1
- package/dist/cli/commands/workspace.js +3 -2
- package/dist/cli/commands/workspace.js.map +1 -1
- package/dist/core/pluginDx.d.ts +1 -0
- package/dist/core/pluginDx.js +77 -18
- package/dist/core/pluginDx.js.map +1 -1
- package/dist/core/plugins.d.ts +1 -1
- package/dist/core/plugins.js.map +1 -1
- package/dist/core/preflight.js +4 -16
- package/dist/core/preflight.js.map +1 -1
- package/dist/core/privacy.js +6 -0
- package/dist/core/privacy.js.map +1 -1
- package/dist/core/workspace.d.ts +4 -2
- package/dist/core/workspace.js +63 -4
- package/dist/core/workspace.js.map +1 -1
- package/dist/mcp/tools/plugin.js +48 -4
- package/dist/mcp/tools/plugin.js.map +1 -1
- package/dist/mcp/tools/workplan.js +3 -2
- package/dist/mcp/tools/workplan.js.map +1 -1
- package/dist/mcp/tools/workspaceGraph.js +31 -0
- package/dist/mcp/tools/workspaceGraph.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +87 -185
- package/dist/tool-manifest.json +4 -4
- package/dist/types.d.ts +7 -0
- package/docs/PLUGIN-AUTHORING.md +6 -7
- package/docs/PLUGIN-GALLERY.md +2 -1
- package/package.json +2 -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/v3.4.
|
|
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.4.1/docs/GUIDE.md) · [Roadmap](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/ROADMAP.md)
|
|
13
13
|
|
|
14
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
14
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/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
|
|
|
@@ -33,7 +33,7 @@ The local plugin platform lets teams add project-specific findings and render `d
|
|
|
33
33
|
npx projscan
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
36
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/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/v3.4.
|
|
44
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20doctor.gif" alt="npx projscan doctor" width="700">
|
|
45
45
|
|
|
46
46
|
## Install
|
|
47
47
|
|
|
@@ -94,9 +94,9 @@ npm run test:trust-smoke
|
|
|
94
94
|
|
|
95
95
|
The full command catalog is below. Most users should start with the five-command path above instead of scanning the catalog.
|
|
96
96
|
|
|
97
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
97
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20--help.gif" alt="npx projscan --help" width="700">
|
|
98
98
|
|
|
99
|
-
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.
|
|
99
|
+
For a comprehensive walkthrough, see the **[Full Guide](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/GUIDE.md)**.
|
|
100
100
|
|
|
101
101
|
## Repo Understanding
|
|
102
102
|
|
|
@@ -177,31 +177,31 @@ projscan --help
|
|
|
177
177
|
<details>
|
|
178
178
|
<summary><strong>projscan structure</strong> - Directory tree with file counts</summary>
|
|
179
179
|
|
|
180
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
180
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20structure.gif" alt="npx projscan structure" width="700">
|
|
181
181
|
</details>
|
|
182
182
|
|
|
183
183
|
<details>
|
|
184
184
|
<summary><strong>projscan diagram</strong> - Architecture visualization</summary>
|
|
185
185
|
|
|
186
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
186
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20diagram.gif" alt="npx projscan diagram" width="700">
|
|
187
187
|
</details>
|
|
188
188
|
|
|
189
189
|
<details>
|
|
190
190
|
<summary><strong>projscan dependencies</strong> - Dependency analysis</summary>
|
|
191
191
|
|
|
192
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
192
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20dependencies.gif" alt="npx projscan dependencies" width="700">
|
|
193
193
|
</details>
|
|
194
194
|
|
|
195
195
|
<details>
|
|
196
196
|
<summary><strong>projscan explain</strong> - File explanation</summary>
|
|
197
197
|
|
|
198
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
198
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20explain.gif" alt="npx projscan explain" width="700">
|
|
199
199
|
</details>
|
|
200
200
|
|
|
201
201
|
<details>
|
|
202
202
|
<summary><strong>projscan badge</strong> - Health badge generation</summary>
|
|
203
203
|
|
|
204
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
204
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20badge.gif" alt="npx projscan badge" width="700">
|
|
205
205
|
</details>
|
|
206
206
|
|
|
207
207
|
### Output Formats
|
|
@@ -223,18 +223,20 @@ Run `projscan help` for the generated command-by-command support matrix.
|
|
|
223
223
|
|
|
224
224
|
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.
|
|
225
225
|
|
|
226
|
-
**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.4.
|
|
226
|
+
**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.4.1/docs/2.0-MIGRATION.md), then use [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/PLUGIN-AUTHORING.md), the [Plugin Gallery](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/PLUGIN-GALLERY.md), and the [manifest schema](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/plugin.schema.json) as the stable contract.
|
|
227
227
|
|
|
228
228
|
```bash
|
|
229
229
|
projscan plugin list
|
|
230
230
|
projscan plugin validate .projscan-plugins/team-radar.projscan-plugin.json
|
|
231
|
+
projscan plugin test .projscan-plugins/team-radar.projscan-plugin.json
|
|
232
|
+
PROJSCAN_PLUGINS_PREVIEW=1 projscan plugin test .projscan-plugins/team-radar.projscan-plugin.json --execute
|
|
231
233
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor --reporter team-radar
|
|
232
234
|
PROJSCAN_PLUGINS_PREVIEW=1 projscan ci --reporter team-radar --min-score 80
|
|
233
235
|
```
|
|
234
236
|
|
|
235
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
237
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/projscan-reporter-plugin.gif" alt="projscan local reporter plugin rendering a team health report" width="700">
|
|
236
238
|
|
|
237
|
-
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.4.
|
|
239
|
+
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.4.1/docs/PLUGIN-AUTHORING.md) for manifest shape, `render(context)`, validation, and the trust model.
|
|
238
240
|
|
|
239
241
|
### Options
|
|
240
242
|
|
|
@@ -370,7 +372,7 @@ projscan reads your source code so it can be useful; it does not send your sourc
|
|
|
370
372
|
|
|
371
373
|
- **Send your source code off-machine.** File contents stay local; AST analysis runs in-process. The only projscan-owned network path is explicit opt-in telemetry, and those events are anonymous product-health buckets, not code or scan results.
|
|
372
374
|
- **Read environment variables for secrets.** `process.env` is forwarded to child processes (`git`, `npm`) so they can find their `PATH` — we never inspect `.env` values, API keys, or session tokens.
|
|
373
|
-
- **Execute command-line arguments as code.** Core CLI and MCP arguments are parsed as data, and projscan does not compose shell strings from user input. Local plugins are the explicit trust boundary:
|
|
375
|
+
- **Execute command-line arguments as code.** Core CLI and MCP arguments are parsed as data, and projscan does not compose shell strings from user input. Local plugins are the explicit trust boundary: `projscan plugin test` is static by default, and projscan imports local modules declared in `.projscan-plugins/*.projscan-plugin.json` only when execution is explicitly requested with `--execute` and `PROJSCAN_PLUGINS_PREVIEW=1` is set.
|
|
374
376
|
- **Phone home silently.** Telemetry is off by default. If you explicitly opt in with `projscan telemetry enable` or the interactive `projscan init team` prompt, projscan sends only anonymous product-health events; it never sends source code, file paths, repo names, branch names, package names, usernames, raw findings, or secrets. See [TELEMETRY.md](TELEMETRY.md).
|
|
375
377
|
- **Modify your repo without an explicit command.** `projscan fix` is the only command that writes to source files, and only when invoked. The cache directory `.projscan-cache/` is local-only and gitignored.
|
|
376
378
|
|
|
@@ -383,7 +385,7 @@ projscan reads your source code so it can be useful; it does not send your sourc
|
|
|
383
385
|
| Spawn `npm audit` | `audit` only | yes — by `npm`, not by projscan | runs against your local lockfile |
|
|
384
386
|
| Scan supply-chain IOCs | `doctor`, `preflight`, release validation | no | checks manifests, lockfiles, hidden editor hooks, and suspicious install-time payloads against bundled indicators |
|
|
385
387
|
| Anonymous telemetry | only after `projscan telemetry enable` or accepting the `projscan init team` prompt | yes — projscan-owned, default off | sends product-health buckets only; see [TELEMETRY.md](TELEMETRY.md) |
|
|
386
|
-
| Load local plugins | only with `PROJSCAN_PLUGINS_PREVIEW=1` | no | imports local JS modules declared in `.projscan-plugins/`; only enable plugins you trust |
|
|
388
|
+
| Load local plugins | only with `PROJSCAN_PLUGINS_PREVIEW=1` and an execution path such as `--execute`, `doctor`, `ci`, or `analyze` | no | imports local JS modules declared in `.projscan-plugins/`; only enable plugins you trust |
|
|
387
389
|
| Load wasm grammars | first parse of a non-JS file | no | served from `dist/grammars/` inside the package; no fetch |
|
|
388
390
|
| Build embeddings | semantic search opt-in only | yes — by `@xenova/transformers`, on first use | model cached locally after first download; remove the peer dep to remove this code path entirely |
|
|
389
391
|
|
|
@@ -399,7 +401,7 @@ If you read projscan's [Socket report](https://socket.dev/npm/package/projscan),
|
|
|
399
401
|
### Audit it yourself
|
|
400
402
|
|
|
401
403
|
- **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.
|
|
402
|
-
- **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.4.
|
|
404
|
+
- **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.4.1/docs/STABILITY.md).
|
|
403
405
|
- **Run it offline:** `npm install -g projscan` followed by anything except `audit` and `--mode semantic` works without network.
|
|
404
406
|
- **Drop privilege further:** in CI, run projscan in a sandbox that disallows network egress; everything except `audit` will pass.
|
|
405
407
|
|
|
@@ -450,7 +452,7 @@ projscan ci --changed-only # Gate only on this PR's diff
|
|
|
450
452
|
projscan ci --format sarif > projscan.sarif # SARIF for Code Scanning
|
|
451
453
|
```
|
|
452
454
|
|
|
453
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
455
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20ci%20--min-score%2070.gif" alt="npx projscan ci --min-score 70" width="700">
|
|
454
456
|
|
|
455
457
|
### GitHub Action (recommended)
|
|
456
458
|
|
|
@@ -527,7 +529,7 @@ Fields:
|
|
|
527
529
|
- `hotspots.limit` / `hotspots.since` - defaults for the `hotspots` command
|
|
528
530
|
- `monorepo.importPolicy` - cross-package import allow/deny rules in monorepos *(0.14+)*
|
|
529
531
|
|
|
530
|
-
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.
|
|
532
|
+
See [`docs/GUIDE.md` → Configuration](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/GUIDE.md#configuration-projscanrc) for the full reference (field types, validation behavior, embedding config in `package.json`, monorepo `importPolicy` semantics).
|
|
531
533
|
|
|
532
534
|
## Tracking Health Over Time
|
|
533
535
|
|
|
@@ -540,7 +542,7 @@ projscan diff # Compare against baseline
|
|
|
540
542
|
projscan diff --format markdown # Markdown diff for PRs
|
|
541
543
|
```
|
|
542
544
|
|
|
543
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
545
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/docs/npx%20projscan%20diff%20--save-baseline.gif" alt="npx projscan diff --save-baseline" width="700">
|
|
544
546
|
|
|
545
547
|
## Hotspots - Where to Fix First
|
|
546
548
|
|
|
@@ -629,7 +631,7 @@ Coverage is also automatically joined into `projscan hotspots` when one of those
|
|
|
629
631
|
|
|
630
632
|
**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.
|
|
631
633
|
|
|
632
|
-
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.
|
|
634
|
+
<img src="https://raw.githubusercontent.com/abhiyoheswaran1/projscan/v3.4.1/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">
|
|
633
635
|
|
|
634
636
|
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.
|
|
635
637
|
|
|
@@ -824,11 +826,11 @@ Capability is advertised under `experimental.fileChanged` on `initialize` so cli
|
|
|
824
826
|
- **`projscan_memory`** *(1.5)* - durable, local-only feedback loop. Records, per analyzer rule id, how many runs surfaced it and how many fixed it. Subactions: `current` (aggregate counts), `stable` (rules surfaced across ≥ 3 runs over ≥ 7 days without ever being fixed — paired with a ready-to-paste `.projscanrc.json disableRules` snippet), `runs` (every tracked rule with full history), `forget` (drop a single rule). Stored at `.projscan-memory/memory.json`; never leaves the machine. Lets an agent ask "what is this project tolerating?" and propose quieting it.
|
|
825
827
|
|
|
826
828
|
**Operator (1.6):**
|
|
827
|
-
- **`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.
|
|
829
|
+
- **`projscan_workspace_graph`** *(1.6)* - cross-repo intelligence over locally trusted sibling repos registered with `projscan workspace add` and stored under `.projscan-cache/workspace.json`. 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.
|
|
828
830
|
- **`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`.
|
|
829
831
|
- **`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.2, review surfaces hardened `newDataflowRisks`, compact `graphEvidence`, and graph-readiness gates for safer handoff.
|
|
830
832
|
|
|
831
|
-
Analyzer plugins can optionally read graph/dataflow context through `check(rootPath, files, context)` while staying on manifest schema v1. The packaged `graph-context` example shows `context.getSemanticGraph()` and `context.getDataflow()` in a real analyzer. For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.
|
|
833
|
+
Analyzer plugins can optionally read graph/dataflow context through `check(rootPath, files, context)` while staying on manifest schema v1. The packaged `graph-context` example shows `context.getSemanticGraph()` and `context.getDataflow()` in a real analyzer. For analyzer and reporter plugin authoring, manifest validation, `--reporter <name>`, and the trust model, see [Plugin Authoring](https://github.com/abhiyoheswaran1/projscan/blob/v3.4.1/docs/PLUGIN-AUTHORING.md).
|
|
832
834
|
|
|
833
835
|
### Context-window budgeting
|
|
834
836
|
|
|
@@ -37,8 +37,10 @@ export function registerPlugin() {
|
|
|
37
37
|
});
|
|
38
38
|
plugin
|
|
39
39
|
.command('test <manifest>')
|
|
40
|
-
.description('Validate
|
|
40
|
+
.description('Validate a local plugin; execution requires --execute and PROJSCAN_PLUGINS_PREVIEW=1')
|
|
41
41
|
.option('--fixture <path>', 'fixture root for analyzer plugins')
|
|
42
|
+
.option('--execute', 'import and run local plugin code after static validation')
|
|
43
|
+
.option('--confirm-execute', 'alias for --execute; confirms local code execution')
|
|
42
44
|
.action(async (manifest, cmdOpts) => {
|
|
43
45
|
await runTest(manifest, cmdOpts);
|
|
44
46
|
});
|
|
@@ -150,7 +152,8 @@ async function runTest(manifestPath, cmdOpts) {
|
|
|
150
152
|
const fixtureRoot = typeof cmdOpts.fixture === 'string'
|
|
151
153
|
? path.resolve(rootPath, cmdOpts.fixture)
|
|
152
154
|
: rootPath;
|
|
153
|
-
const
|
|
155
|
+
const execute = cmdOpts.execute === true || cmdOpts.confirmExecute === true;
|
|
156
|
+
const result = await testPlugin(resolvedManifestPath, { fixtureRoot, execute });
|
|
154
157
|
if (format === 'json') {
|
|
155
158
|
console.log(JSON.stringify(result, null, 2));
|
|
156
159
|
if (!result.ok)
|
|
@@ -158,6 +161,11 @@ async function runTest(manifestPath, cmdOpts) {
|
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
160
163
|
if (result.ok) {
|
|
164
|
+
if (!result.execution.executed) {
|
|
165
|
+
console.log(chalk.green(`✓ ${manifestPath} passed static plugin validation.`));
|
|
166
|
+
console.log(chalk.dim(` execution skipped. Run ${result.commands.execute} to import and test local code.`));
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
161
169
|
console.log(chalk.green(`✓ ${manifestPath} loaded and passed plugin test.`));
|
|
162
170
|
if (result.analyzer) {
|
|
163
171
|
console.log(chalk.dim(` analyzer issues: ${result.analyzer.issues.length}`));
|
|
@@ -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,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,EACd,sBAAsB,GAEvB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEhE;;;;GAIG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,OAAO;SACnB,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,qCAAqC,CAAC;SAClD,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEL,MAAM;SACH,OA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CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,SAAS,CAAC,KAAc;IAC/B,IAAI,KAAK,KAAK,UAAU,IAAI,KAAK,KAAK,UAAU;QAAE,OAAO,KAAK,CAAC;IAC/D,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,sBAAsB,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;IACjE,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,qCAAqC,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAED,SAAS,mBAAmB,CAAC,QAAgB,EAAE,YAAoB;IACjE,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAC;AAC7F,CAAC;AAED,SAAS,eAAe,CAAC,UAA4B;IACnD,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,UAAU,UAAU,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,EAAE,CAAC,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"}
|
|
@@ -12,7 +12,7 @@ export function registerWorkplan() {
|
|
|
12
12
|
.option('--head-ref <ref>', 'git head ref for merge/release checks')
|
|
13
13
|
.option('--max-changed-files <count>', 'caution threshold for changed files', parsePositiveInt)
|
|
14
14
|
.option('--max-tasks <count>', 'maximum number of tasks to return', parsePositiveInt)
|
|
15
|
-
.option('--enable-plugins', '
|
|
15
|
+
.option('--enable-plugins', 'include plugin evidence when PROJSCAN_PLUGINS_PREVIEW=1 is already set')
|
|
16
16
|
.action(async (cmdOpts) => {
|
|
17
17
|
setupLogLevel();
|
|
18
18
|
maybeCompactBanner();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workplan.js","sourceRoot":"","sources":["../../../src/cli/commands/workplan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,oBAAoB,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAG/F,MAAM,UAAU,gBAAgB;IAC9B,OAAO;SACJ,OAAO,CAAC,UAAU,CAAC;SACnB,WAAW,CAAC,2DAA2D,CAAC;SACxE,MAAM,CAAC,eAAe,EAAE,qFAAqF,EAAE,aAAa,CAAC;SAC7H,MAAM,CAAC,kBAAkB,EAAE,8CAA8C,CAAC;SAC1E,MAAM,CAAC,kBAAkB,EAAE,uCAAuC,CAAC;SACnE,MAAM,CAAC,6BAA6B,EAAE,qCAAqC,EAAE,gBAAgB,CAAC;SAC9F,MAAM,CAAC,qBAAqB,EAAE,mCAAmC,EAAE,gBAAgB,CAAC;SACpF,MAAM,CAAC,kBAAkB,EAAE,
|
|
1
|
+
{"version":3,"file":"workplan.js","sourceRoot":"","sources":["../../../src/cli/commands/workplan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,e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CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC5E,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACtE,CAAC;AAED,SAAS,YAAY,CAAC,MAAsB;IAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC;IACzC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAChC,KAAK,MAAM,IAAI,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;QAC5C,OAAO,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC;IACvC,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,CAAC;IACxC,OAAO,CAAC,GAAG,CAAC,KAAK,MAAM,CAAC,YAAY,CAAC,oBAAoB,EAAE,CAAC,CAAC;AAC/D,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
2
|
import { program, getRootPath, setupLogLevel, maybeCompactBanner, assertFormatSupported } from '../_shared.js';
|
|
3
|
-
import { addRepo, loadOrCreateWorkspace, loadWorkspace, removeRepo, saveWorkspace, } from '../../core/workspace.js';
|
|
3
|
+
import { addRepo, loadOrCreateWorkspace, loadWorkspace, removeRepo, resolveTrustedWorkspaceRepoPath, saveWorkspace, } from '../../core/workspace.js';
|
|
4
4
|
/**
|
|
5
5
|
* `projscan workspace` (1.6+) — register and inspect cross-repo
|
|
6
6
|
* sibling repos. Distinct from `projscan workspaces` (plural) which
|
|
@@ -63,7 +63,8 @@ async function runAdd(repoPath, name) {
|
|
|
63
63
|
const rootPath = getRootPath();
|
|
64
64
|
try {
|
|
65
65
|
const w = await loadOrCreateWorkspace(rootPath);
|
|
66
|
-
const
|
|
66
|
+
const trustedRepoPath = await resolveTrustedWorkspaceRepoPath(rootPath, repoPath);
|
|
67
|
+
const entry = addRepo(w, trustedRepoPath, name);
|
|
67
68
|
await saveWorkspace(rootPath, w);
|
|
68
69
|
console.log(chalk.green(`✓ Registered "${entry.name}" at ${entry.path}`));
|
|
69
70
|
console.log(chalk.dim(` ${w.repos.length} repo${w.repos.length === 1 ? '' : 's'} in workspace.`));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../src/cli/commands/workspace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,kBAAkB,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC/G,OAAO,EACL,OAAO,EACP,qBAAqB,EACrB,aAAa,EACb,UAAU,EACV,aAAa,GAEd,MAAM,yBAAyB,CAAC;AAEjC;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,GAAG,GAAG,OAAO;SAChB,OAAO,CAAC,WAAW,CAAC;SACpB,WAAW,CAAC,sEAAsE,CAAC;SACnF,MAAM,CAAC,KAAK,IAAI,EAAE;QACjB,MAAM,OAAO,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEL,GAAG;SACA,OAAO,CAAC,YAAY,CAAC;SACrB,WAAW,CAAC,2CAA2C,CAAC;SACxD,MAAM,CAAC,eAAe,EAAE,oDAAoD,CAAC;SAC7E,MAAM,CAAC,KAAK,EAAE,QAAgB,EAAE,IAAuB,EAAE,EA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AC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,oCAAoC,CAAC,CAAC,CAAC;QAC7D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;QAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC,CAAC;QACjG,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,GAAG,CACP,KAAK,CAAC,CAAC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,4FAA4F,CACvJ,CACF,CAAC;AACJ,CAAC"}
|
package/dist/core/pluginDx.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ export interface InitPluginResult {
|
|
|
9
9
|
}
|
|
10
10
|
export interface TestPluginOptions {
|
|
11
11
|
fixtureRoot?: string;
|
|
12
|
+
execute?: boolean;
|
|
12
13
|
}
|
|
13
14
|
export declare function initPlugin(rootPath: string, options?: InitPluginOptions): Promise<InitPluginResult>;
|
|
14
15
|
export declare function testPlugin(manifestPath: string, options?: TestPluginOptions): Promise<PluginTestResult>;
|
package/dist/core/pluginDx.js
CHANGED
|
@@ -2,7 +2,7 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { pathToFileURL } from 'node:url';
|
|
4
4
|
import { scanRepository } from './repositoryScanner.js';
|
|
5
|
-
import { PLUGIN_DIR, PLUGIN_MANIFEST_EXT, PLUGIN_REPORTER_COMMANDS, readPluginManifestFile, } from './plugins.js';
|
|
5
|
+
import { PLUGIN_DIR, PLUGIN_PREVIEW_FLAG, PLUGIN_MANIFEST_EXT, PLUGIN_REPORTER_COMMANDS, pluginsEnabled, readPluginManifestFile, } from './plugins.js';
|
|
6
6
|
const dynamicImport = new Function('specifier', 'return import(specifier)');
|
|
7
7
|
export async function initPlugin(rootPath, options = {}) {
|
|
8
8
|
const kind = options.kind ?? 'analyzer';
|
|
@@ -34,7 +34,34 @@ export async function testPlugin(manifestPath, options = {}) {
|
|
|
34
34
|
}
|
|
35
35
|
const manifest = manifestResult.manifest;
|
|
36
36
|
const modulePath = path.resolve(path.dirname(resolvedManifestPath), manifest.module);
|
|
37
|
+
const guidance = await buildPluginTestGuidance(resolvedManifestPath, modulePath);
|
|
38
|
+
const staticCheck = await checkModuleReadable(modulePath);
|
|
39
|
+
if (!staticCheck.ok) {
|
|
40
|
+
return failResult(resolvedManifestPath, {
|
|
41
|
+
code: 'module-load-error',
|
|
42
|
+
severity: 'error',
|
|
43
|
+
message: staticCheck.message,
|
|
44
|
+
}, guidance, staticExecution());
|
|
45
|
+
}
|
|
46
|
+
if (options.execute !== true) {
|
|
47
|
+
return {
|
|
48
|
+
schemaVersion: 1,
|
|
49
|
+
manifestPath: resolvedManifestPath,
|
|
50
|
+
ok: true,
|
|
51
|
+
diagnostics: [],
|
|
52
|
+
...guidance,
|
|
53
|
+
execution: staticExecution(),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
if (!pluginsEnabled()) {
|
|
57
|
+
return failResult(resolvedManifestPath, {
|
|
58
|
+
code: 'plugin-execution-disabled',
|
|
59
|
+
severity: 'error',
|
|
60
|
+
message: `plugin execution requires ${PLUGIN_PREVIEW_FLAG}=1 and --execute`,
|
|
61
|
+
}, guidance, staticExecution(`Set ${PLUGIN_PREVIEW_FLAG}=1 and pass --execute to import and run local plugin code.`));
|
|
62
|
+
}
|
|
37
63
|
let exportsObj;
|
|
64
|
+
const executed = executeMode();
|
|
38
65
|
try {
|
|
39
66
|
const mod = await importPluginModule(modulePath);
|
|
40
67
|
exportsObj = (mod.default ?? mod);
|
|
@@ -44,12 +71,11 @@ export async function testPlugin(manifestPath, options = {}) {
|
|
|
44
71
|
code: 'module-load-error',
|
|
45
72
|
severity: 'error',
|
|
46
73
|
message: `plugin module failed to load: ${err instanceof Error ? err.message : String(err)}`,
|
|
47
|
-
});
|
|
74
|
+
}, guidance, executed);
|
|
48
75
|
}
|
|
49
|
-
const guidance = await buildPluginTestGuidance(resolvedManifestPath, modulePath);
|
|
50
76
|
return manifest.kind === 'analyzer'
|
|
51
|
-
? testAnalyzerPlugin(resolvedManifestPath, manifest, exportsObj, options, guidance)
|
|
52
|
-
: testReporterPlugin(resolvedManifestPath, manifest, exportsObj, options, guidance);
|
|
77
|
+
? testAnalyzerPlugin(resolvedManifestPath, manifest, exportsObj, options, guidance, executed)
|
|
78
|
+
: testReporterPlugin(resolvedManifestPath, manifest, exportsObj, options, guidance, executed);
|
|
53
79
|
}
|
|
54
80
|
function analyzerManifest(name, modulePath) {
|
|
55
81
|
return {
|
|
@@ -115,13 +141,13 @@ function reporterTemplate(name) {
|
|
|
115
141
|
};
|
|
116
142
|
`;
|
|
117
143
|
}
|
|
118
|
-
async function testAnalyzerPlugin(manifestPath, manifest, exportsObj, options, guidance) {
|
|
144
|
+
async function testAnalyzerPlugin(manifestPath, manifest, exportsObj, options, guidance, execution) {
|
|
119
145
|
if (typeof exportsObj.check !== 'function') {
|
|
120
146
|
return failResult(manifestPath, {
|
|
121
147
|
code: 'invalid-analyzer-export',
|
|
122
148
|
severity: 'error',
|
|
123
149
|
message: `analyzer plugin "${manifest.name}" missing required export "check"`,
|
|
124
|
-
});
|
|
150
|
+
}, guidance, execution);
|
|
125
151
|
}
|
|
126
152
|
const rootPath = options.fixtureRoot ?? path.dirname(path.dirname(manifestPath));
|
|
127
153
|
const scan = await scanRepository(rootPath);
|
|
@@ -134,14 +160,14 @@ async function testAnalyzerPlugin(manifestPath, manifest, exportsObj, options, g
|
|
|
134
160
|
code: 'analyzer-runtime-error',
|
|
135
161
|
severity: 'error',
|
|
136
162
|
message: `analyzer plugin "${manifest.name}" threw: ${err instanceof Error ? err.message : String(err)}`,
|
|
137
|
-
});
|
|
163
|
+
}, guidance, execution);
|
|
138
164
|
}
|
|
139
165
|
if (!Array.isArray(rawIssues)) {
|
|
140
166
|
return failResult(manifestPath, {
|
|
141
167
|
code: 'invalid-analyzer-result',
|
|
142
168
|
severity: 'error',
|
|
143
169
|
message: `analyzer plugin "${manifest.name}" returned ${typeof rawIssues}; expected Issue[]`,
|
|
144
|
-
});
|
|
170
|
+
}, guidance, execution);
|
|
145
171
|
}
|
|
146
172
|
const issues = rawIssues;
|
|
147
173
|
const malformed = issues.find((issue) => !isIssueShape(issue));
|
|
@@ -150,7 +176,7 @@ async function testAnalyzerPlugin(manifestPath, manifest, exportsObj, options, g
|
|
|
150
176
|
code: 'invalid-analyzer-issue',
|
|
151
177
|
severity: 'error',
|
|
152
178
|
message: `analyzer plugin "${manifest.name}" returned a malformed issue`,
|
|
153
|
-
});
|
|
179
|
+
}, guidance, execution);
|
|
154
180
|
}
|
|
155
181
|
return {
|
|
156
182
|
schemaVersion: 1,
|
|
@@ -158,16 +184,17 @@ async function testAnalyzerPlugin(manifestPath, manifest, exportsObj, options, g
|
|
|
158
184
|
ok: true,
|
|
159
185
|
diagnostics: [],
|
|
160
186
|
...guidance,
|
|
187
|
+
execution,
|
|
161
188
|
analyzer: { issues },
|
|
162
189
|
};
|
|
163
190
|
}
|
|
164
|
-
async function testReporterPlugin(manifestPath, manifest, exportsObj, options, guidance) {
|
|
191
|
+
async function testReporterPlugin(manifestPath, manifest, exportsObj, options, guidance, execution) {
|
|
165
192
|
if (typeof exportsObj.render !== 'function') {
|
|
166
193
|
return failResult(manifestPath, {
|
|
167
194
|
code: 'invalid-reporter-export',
|
|
168
195
|
severity: 'error',
|
|
169
196
|
message: `reporter plugin "${manifest.name}" missing required export "render"`,
|
|
170
|
-
});
|
|
197
|
+
}, guidance, execution);
|
|
171
198
|
}
|
|
172
199
|
const rootPath = options.fixtureRoot ?? path.dirname(path.dirname(manifestPath));
|
|
173
200
|
const outputs = [];
|
|
@@ -187,14 +214,14 @@ async function testReporterPlugin(manifestPath, manifest, exportsObj, options, g
|
|
|
187
214
|
code: 'reporter-render-error',
|
|
188
215
|
severity: 'error',
|
|
189
216
|
message: `reporter plugin "${manifest.name}" threw for ${command}: ${err instanceof Error ? err.message : String(err)}`,
|
|
190
|
-
});
|
|
217
|
+
}, guidance, execution);
|
|
191
218
|
}
|
|
192
219
|
if (typeof text !== 'string') {
|
|
193
220
|
return failResult(manifestPath, {
|
|
194
221
|
code: 'reporter-render-error',
|
|
195
222
|
severity: 'error',
|
|
196
223
|
message: `reporter plugin "${manifest.name}" returned ${typeof text}; expected string`,
|
|
197
|
-
});
|
|
224
|
+
}, guidance, execution);
|
|
198
225
|
}
|
|
199
226
|
outputs.push({ command, text });
|
|
200
227
|
}
|
|
@@ -204,6 +231,7 @@ async function testReporterPlugin(manifestPath, manifest, exportsObj, options, g
|
|
|
204
231
|
ok: true,
|
|
205
232
|
diagnostics: [],
|
|
206
233
|
...guidance,
|
|
234
|
+
execution,
|
|
207
235
|
reporter: { outputs },
|
|
208
236
|
};
|
|
209
237
|
}
|
|
@@ -235,7 +263,8 @@ async function buildPluginTestGuidance(manifestPath, modulePath) {
|
|
|
235
263
|
commands: {
|
|
236
264
|
validate: `projscan plugin validate ${manifestPath}`,
|
|
237
265
|
test: `projscan plugin test ${manifestPath} --format json`,
|
|
238
|
-
|
|
266
|
+
execute: `${PLUGIN_PREVIEW_FLAG}=1 projscan plugin test ${manifestPath} --execute --format json`,
|
|
267
|
+
enable: `${PLUGIN_PREVIEW_FLAG}=1 projscan doctor`,
|
|
239
268
|
},
|
|
240
269
|
context: {
|
|
241
270
|
requested,
|
|
@@ -246,13 +275,42 @@ async function buildPluginTestGuidance(manifestPath, modulePath) {
|
|
|
246
275
|
},
|
|
247
276
|
};
|
|
248
277
|
}
|
|
249
|
-
function failResult(manifestPath, diagnostic) {
|
|
278
|
+
function failResult(manifestPath, diagnostic, guidance = defaultPluginTestGuidance(manifestPath), execution = staticExecution()) {
|
|
250
279
|
return {
|
|
251
280
|
schemaVersion: 1,
|
|
252
281
|
manifestPath,
|
|
253
282
|
ok: false,
|
|
254
283
|
diagnostics: [diagnostic],
|
|
255
|
-
...
|
|
284
|
+
...guidance,
|
|
285
|
+
execution,
|
|
286
|
+
};
|
|
287
|
+
}
|
|
288
|
+
async function checkModuleReadable(modulePath) {
|
|
289
|
+
try {
|
|
290
|
+
await fs.access(modulePath);
|
|
291
|
+
return { ok: true };
|
|
292
|
+
}
|
|
293
|
+
catch (err) {
|
|
294
|
+
return {
|
|
295
|
+
ok: false,
|
|
296
|
+
message: `plugin module is not readable at ${modulePath}: ${err instanceof Error ? err.message : String(err)}`,
|
|
297
|
+
};
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
function staticExecution(note = 'Static validation completed without importing or running local plugin code.') {
|
|
301
|
+
return {
|
|
302
|
+
requested: false,
|
|
303
|
+
executed: false,
|
|
304
|
+
mode: 'static',
|
|
305
|
+
note,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
function executeMode() {
|
|
309
|
+
return {
|
|
310
|
+
requested: true,
|
|
311
|
+
executed: true,
|
|
312
|
+
mode: 'execute',
|
|
313
|
+
note: 'Local plugin module was imported and executed because --execute was requested and the preview flag was enabled.',
|
|
256
314
|
};
|
|
257
315
|
}
|
|
258
316
|
function defaultPluginTestGuidance(manifestPath) {
|
|
@@ -265,7 +323,8 @@ function defaultPluginTestGuidance(manifestPath) {
|
|
|
265
323
|
commands: {
|
|
266
324
|
validate: `projscan plugin validate ${manifestPath}`,
|
|
267
325
|
test: `projscan plugin test ${manifestPath} --format json`,
|
|
268
|
-
|
|
326
|
+
execute: `${PLUGIN_PREVIEW_FLAG}=1 projscan plugin test ${manifestPath} --execute --format json`,
|
|
327
|
+
enable: `${PLUGIN_PREVIEW_FLAG}=1 projscan doctor`,
|
|
269
328
|
},
|
|
270
329
|
context: {
|
|
271
330
|
requested: false,
|