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.
Files changed (68) hide show
  1. package/README.md +39 -23
  2. package/dist/cli/commands/dataflow.d.ts +1 -0
  3. package/dist/cli/commands/dataflow.js +76 -0
  4. package/dist/cli/commands/dataflow.js.map +1 -0
  5. package/dist/cli/commands/init.js +46 -1
  6. package/dist/cli/commands/init.js.map +1 -1
  7. package/dist/cli/commands/preflight.js +16 -0
  8. package/dist/cli/commands/preflight.js.map +1 -1
  9. package/dist/cli/commands/recipes.d.ts +2 -0
  10. package/dist/cli/commands/recipes.js +94 -0
  11. package/dist/cli/commands/recipes.js.map +1 -0
  12. package/dist/cli/commands/semanticGraph.d.ts +1 -0
  13. package/dist/cli/commands/semanticGraph.js +55 -0
  14. package/dist/cli/commands/semanticGraph.js.map +1 -0
  15. package/dist/cli/index.js +7 -0
  16. package/dist/cli/index.js.map +1 -1
  17. package/dist/core/adoption.d.ts +57 -0
  18. package/dist/core/adoption.js +392 -0
  19. package/dist/core/adoption.js.map +1 -0
  20. package/dist/core/dataflow.d.ts +7 -0
  21. package/dist/core/dataflow.js +194 -0
  22. package/dist/core/dataflow.js.map +1 -0
  23. package/dist/core/intent.d.ts +1 -1
  24. package/dist/core/intent.js +16 -0
  25. package/dist/core/intent.js.map +1 -1
  26. package/dist/core/prDiff.js +25 -1
  27. package/dist/core/prDiff.js.map +1 -1
  28. package/dist/core/regressionPlan.js +2 -0
  29. package/dist/core/regressionPlan.js.map +1 -1
  30. package/dist/core/review.js +100 -3
  31. package/dist/core/review.js.map +1 -1
  32. package/dist/core/semanticGraph.d.ts +7 -0
  33. package/dist/core/semanticGraph.js +167 -0
  34. package/dist/core/semanticGraph.js.map +1 -0
  35. package/dist/core/taint.d.ts +5 -5
  36. package/dist/core/workplan.js +4 -4
  37. package/dist/core/workplan.js.map +1 -1
  38. package/dist/index.d.ts +5 -1
  39. package/dist/index.js +3 -0
  40. package/dist/index.js.map +1 -1
  41. package/dist/mcp/tools/adoption.d.ts +2 -0
  42. package/dist/mcp/tools/adoption.js +35 -0
  43. package/dist/mcp/tools/adoption.js.map +1 -0
  44. package/dist/mcp/tools/costSummary.js +2 -0
  45. package/dist/mcp/tools/costSummary.js.map +1 -1
  46. package/dist/mcp/tools/dataflow.d.ts +2 -0
  47. package/dist/mcp/tools/dataflow.js +58 -0
  48. package/dist/mcp/tools/dataflow.js.map +1 -0
  49. package/dist/mcp/tools/semanticGraph.d.ts +2 -0
  50. package/dist/mcp/tools/semanticGraph.js +40 -0
  51. package/dist/mcp/tools/semanticGraph.js.map +1 -0
  52. package/dist/mcp/tools.js +6 -0
  53. package/dist/mcp/tools.js.map +1 -1
  54. package/dist/projscan-sbom.cdx.json +6 -6
  55. package/dist/reporters/consoleReporter.js +4 -0
  56. package/dist/reporters/consoleReporter.js.map +1 -1
  57. package/dist/tool-manifest.json +81 -3
  58. package/dist/types.d.ts +94 -1
  59. package/dist/utils/formatSupport.d.ts +5 -0
  60. package/dist/utils/formatSupport.js +5 -0
  61. package/dist/utils/formatSupport.js.map +1 -1
  62. package/docs/PLUGIN-AUTHORING.md +4 -0
  63. package/docs/PLUGIN-GALLERY.md +61 -0
  64. package/docs/examples/plugins/release-readiness.mjs +26 -0
  65. package/docs/examples/plugins/release-readiness.projscan-plugin.json +8 -0
  66. package/docs/examples/plugins/security-radar.mjs +50 -0
  67. package/docs/examples/plugins/security-radar.projscan-plugin.json +8 -0
  68. package/package.json +3 -2
@@ -0,0 +1,61 @@
1
+ # Plugin Gallery
2
+
3
+ These examples are packaged with projscan under `docs/examples/plugins/`. Copy
4
+ the manifest and module into `.projscan-plugins/`, then run:
5
+
6
+ ```bash
7
+ projscan plugin validate .projscan-plugins/<name>.projscan-plugin.json
8
+ projscan plugin test .projscan-plugins/<name>.projscan-plugin.json
9
+ PROJSCAN_PLUGINS_PREVIEW=1 projscan doctor
10
+ ```
11
+
12
+ Local plugins are code execution. Only enable plugins you trust.
13
+
14
+ ## Analyzer Plugins
15
+
16
+ ### `policy`
17
+
18
+ Flags TypeScript files under a `legacy` path so teams can keep local migration
19
+ rules close to the repo.
20
+
21
+ Files:
22
+ - `docs/examples/plugins/policy.projscan-plugin.json`
23
+ - `docs/examples/plugins/policy.mjs`
24
+
25
+ ### `security-radar`
26
+
27
+ Flags common local security review triggers:
28
+ - committed `.env` style files
29
+ - package scripts that pipe `curl` or `wget` output into a shell
30
+
31
+ Files:
32
+ - `docs/examples/plugins/security-radar.projscan-plugin.json`
33
+ - `docs/examples/plugins/security-radar.mjs`
34
+
35
+ ## Reporter Plugins
36
+
37
+ ### `team-radar`
38
+
39
+ Renders `doctor`, `analyze`, and `ci` output in a compact team health voice.
40
+
41
+ Files:
42
+ - `docs/examples/plugins/team-radar.projscan-plugin.json`
43
+ - `docs/examples/plugins/team-radar.mjs`
44
+
45
+ ### `release-readiness`
46
+
47
+ Renders `doctor`, `analyze`, and `ci` output as a release approval summary with
48
+ score, blocking issue count, warnings, and a continue/hold decision.
49
+
50
+ Files:
51
+ - `docs/examples/plugins/release-readiness.projscan-plugin.json`
52
+ - `docs/examples/plugins/release-readiness.mjs`
53
+
54
+ ## Suggested Adoption Path
55
+
56
+ 1. Start with `projscan init mcp --client all` to wire projscan into your MCP
57
+ client.
58
+ 2. Run `projscan recipes` to pick an agent workflow.
59
+ 3. Copy one gallery plugin into `.projscan-plugins/` only when you need local
60
+ policy or team-specific reporting.
61
+ 4. Keep MCP tools structured; use reporter plugins for human presentation.
@@ -0,0 +1,26 @@
1
+ export default {
2
+ render: async ({ command, payload }) => {
3
+ if (command === 'ci') {
4
+ const ci = payload.ci;
5
+ return [
6
+ `release-readiness: ${ci.pass ? 'ready' : 'not ready'}`,
7
+ `score: ${ci.score}/100 (${ci.grade})`,
8
+ `issues: ${ci.totalIssues}`,
9
+ `threshold: ${ci.threshold}`,
10
+ ].join('\n');
11
+ }
12
+
13
+ const issues = Array.isArray(payload.issues) ? payload.issues : [];
14
+ const health = payload.health;
15
+ const errors = issues.filter((issue) => issue.severity === 'error').length;
16
+ const warnings = issues.filter((issue) => issue.severity === 'warning').length;
17
+
18
+ return [
19
+ `release-readiness ${command}`,
20
+ `score: ${health?.score ?? 'n/a'}/100 (${health?.grade ?? 'n/a'})`,
21
+ `blocking: ${errors}`,
22
+ `warnings: ${warnings}`,
23
+ errors > 0 ? 'decision: hold release' : 'decision: continue release checks',
24
+ ].join('\n');
25
+ },
26
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "release-readiness",
4
+ "kind": "reporter",
5
+ "module": "./release-readiness.mjs",
6
+ "commands": ["doctor", "analyze", "ci"],
7
+ "description": "Renders doctor, analyze, and ci output as a release approval summary"
8
+ }
@@ -0,0 +1,50 @@
1
+ import fs from 'node:fs/promises';
2
+ import path from 'node:path';
3
+
4
+ export default {
5
+ check: async (rootPath, files) => {
6
+ const issues = [];
7
+
8
+ for (const file of files) {
9
+ if (/^\.env(\.|$)/.test(path.basename(file.relativePath))) {
10
+ issues.push({
11
+ id: 'committed-env-file',
12
+ title: 'Committed environment file',
13
+ description: `${file.relativePath} looks like a committed environment file. Confirm it contains no secrets before release.`,
14
+ severity: 'warning',
15
+ category: 'security',
16
+ fixAvailable: false,
17
+ locations: [{ file: file.relativePath, line: 1 }],
18
+ });
19
+ }
20
+ }
21
+
22
+ const packageJson = files.find((file) => file.relativePath === 'package.json');
23
+ if (!packageJson) return issues;
24
+
25
+ try {
26
+ const parsed = JSON.parse(await fs.readFile(path.join(rootPath, 'package.json'), 'utf-8'));
27
+ const scripts = parsed && typeof parsed === 'object' ? parsed.scripts : undefined;
28
+ if (!scripts || typeof scripts !== 'object') return issues;
29
+
30
+ for (const [name, command] of Object.entries(scripts)) {
31
+ if (typeof command !== 'string') continue;
32
+ if (/\bcurl\b.*\|\s*(?:sh|bash)|\bwget\b.*\|\s*(?:sh|bash)/.test(command)) {
33
+ issues.push({
34
+ id: `script-fetch-pipe-${name}`,
35
+ title: 'Install script pipes network content to a shell',
36
+ description: `package.json script "${name}" fetches remote content and pipes it into a shell.`,
37
+ severity: 'warning',
38
+ category: 'security',
39
+ fixAvailable: false,
40
+ locations: [{ file: 'package.json', line: 1 }],
41
+ });
42
+ }
43
+ }
44
+ } catch {
45
+ return issues;
46
+ }
47
+
48
+ return issues;
49
+ },
50
+ };
@@ -0,0 +1,8 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "name": "security-radar",
4
+ "kind": "analyzer",
5
+ "module": "./security-radar.mjs",
6
+ "category": "security",
7
+ "description": "Flags common local security review triggers such as committed env files and shell-fetch install scripts"
8
+ }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "projscan",
3
3
  "mcpName": "io.github.abhiyoheswaran1/projscan",
4
- "version": "2.8.0",
5
- "description": "Agent-first code intelligence. MCP server (2025-03-26) with AST parsing for JavaScript, TypeScript, Python, Go, Java, Ruby, Rust, PHP, C#, Kotlin, Swift, and C++; code graph, file + per-function AST cyclomatic complexity, per-function fan-in + fan-out, coupling + cycle detection, structural PR diff with HTML reporter, coverage report with HTML reporter, intent-grounded one-call PR review (projscan_review with optional `intent` arg) and long-running PR-watch mode with structured per-bucket deltas (projscan_review_watch), agent workplans (projscan_workplan), bug-hunt queues (projscan_bug_hunt), product-line planning (projscan_release_train), evidence packs (projscan_evidence_pack), regression planning (projscan_regression_plan), agent briefs (projscan_agent_brief), quality scorecards (projscan_quality_scorecard), and preflight with supply-chain IOC evidence, rule-driven fix suggestions + mechanical apply layer with rollback (projscan_apply_fix, projscan_fix_suggest, projscan_explain_issue), source-to-sink taint analysis (projscan_taint) with truncation reporting, transitive blast-radius analysis with cross-repo mode (projscan_impact for files and symbols), cross-repo workspace registration + intelligence (projscan_workspace_graph), per-function semantic search chunks (sub-file embeddings), per-rule confidence + severity drift + cost-summary analytics with live streaming (projscan_cost_summary), stable local analyzer + reporter plugin API (projscan_plugin, CLI --reporter, opt-in via PROJSCAN_PLUGINS_PREVIEW=1), monorepo workspace awareness with cross-package import policy + per-package dependencies / outdated / audit, BM25 + optional semantic search, cursor pagination, progress notifications, context-budgeted output, and a stable-surface CI guard. CLI on the side.",
4
+ "version": "3.0.0",
5
+ "description": "Agent-first code intelligence. MCP server (2025-03-26) with AST parsing for JavaScript, TypeScript, Python, Go, Java, Ruby, Rust, PHP, C#, Kotlin, Swift, and C++; stable v3 semantic graph (projscan_semantic_graph), dataflow risk engine with bridge-helper detection (projscan_dataflow), code graph, file + per-function AST cyclomatic complexity, per-function fan-in + fan-out, coupling + cycle detection, structural PR diff with HTML reporter, coverage report with HTML reporter, intent-grounded one-call PR review (projscan_review with optional `intent` arg, new taint flows, contract changes, and newDataflowRisks) and long-running PR-watch mode with structured per-bucket deltas (projscan_review_watch), agent workplans (projscan_workplan), bug-hunt queues (projscan_bug_hunt), product-line planning (projscan_release_train), evidence packs (projscan_evidence_pack), regression planning (projscan_regression_plan), agent briefs (projscan_agent_brief), quality scorecards (projscan_quality_scorecard), and preflight with supply-chain IOC evidence, rule-driven fix suggestions + mechanical apply layer with rollback (projscan_apply_fix, projscan_fix_suggest, projscan_explain_issue), source-to-sink taint analysis (projscan_taint) with truncation reporting, transitive blast-radius analysis with cross-repo mode (projscan_impact for files and symbols), cross-repo workspace registration + intelligence (projscan_workspace_graph), per-function semantic search chunks (sub-file embeddings), per-rule confidence + severity drift + cost-summary analytics with live streaming (projscan_cost_summary), stable local analyzer + reporter plugin API (projscan_plugin, CLI --reporter, opt-in via PROJSCAN_PLUGINS_PREVIEW=1), monorepo workspace awareness with cross-package import policy + per-package dependencies / outdated / audit, BM25 + optional semantic search, cursor pagination, progress notifications, context-budgeted output, and a stable-surface CI guard. CLI on the side.",
6
6
  "type": "module",
7
7
  "main": "./dist/index.js",
8
8
  "types": "./dist/index.d.ts",
@@ -14,6 +14,7 @@
14
14
  "README.md",
15
15
  "docs/2.0-MIGRATION.md",
16
16
  "docs/PLUGIN-AUTHORING.md",
17
+ "docs/PLUGIN-GALLERY.md",
17
18
  "docs/plugin.schema.json",
18
19
  "docs/examples/plugins"
19
20
  ],