projscan 2.0.0 → 2.2.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 (120) hide show
  1. package/README.md +38 -29
  2. package/dist/analyzers/supplyChainCheck.d.ts +2 -0
  3. package/dist/analyzers/supplyChainCheck.js +400 -0
  4. package/dist/analyzers/supplyChainCheck.js.map +1 -0
  5. package/dist/cli/_shared.d.ts +1 -0
  6. package/dist/cli/_shared.js +19 -3
  7. package/dist/cli/_shared.js.map +1 -1
  8. package/dist/cli/commands/analyze.js +7 -3
  9. package/dist/cli/commands/analyze.js.map +1 -1
  10. package/dist/cli/commands/applyFix.js +2 -2
  11. package/dist/cli/commands/applyFix.js.map +1 -1
  12. package/dist/cli/commands/audit.js +2 -2
  13. package/dist/cli/commands/audit.js.map +1 -1
  14. package/dist/cli/commands/badge.js +2 -1
  15. package/dist/cli/commands/badge.js.map +1 -1
  16. package/dist/cli/commands/ci.js +3 -3
  17. package/dist/cli/commands/ci.js.map +1 -1
  18. package/dist/cli/commands/coupling.js +2 -2
  19. package/dist/cli/commands/coupling.js.map +1 -1
  20. package/dist/cli/commands/coverage.js +2 -2
  21. package/dist/cli/commands/coverage.js.map +1 -1
  22. package/dist/cli/commands/dependencies.js +2 -2
  23. package/dist/cli/commands/dependencies.js.map +1 -1
  24. package/dist/cli/commands/diagram.js +2 -2
  25. package/dist/cli/commands/diagram.js.map +1 -1
  26. package/dist/cli/commands/diff.js +2 -2
  27. package/dist/cli/commands/diff.js.map +1 -1
  28. package/dist/cli/commands/doctor.js +3 -3
  29. package/dist/cli/commands/doctor.js.map +1 -1
  30. package/dist/cli/commands/explain.js +2 -2
  31. package/dist/cli/commands/explain.js.map +1 -1
  32. package/dist/cli/commands/explainIssue.js +2 -2
  33. package/dist/cli/commands/explainIssue.js.map +1 -1
  34. package/dist/cli/commands/file.js +2 -2
  35. package/dist/cli/commands/file.js.map +1 -1
  36. package/dist/cli/commands/fix.js +2 -1
  37. package/dist/cli/commands/fix.js.map +1 -1
  38. package/dist/cli/commands/fixSuggest.js +2 -2
  39. package/dist/cli/commands/fixSuggest.js.map +1 -1
  40. package/dist/cli/commands/help.js +2 -1
  41. package/dist/cli/commands/help.js.map +1 -1
  42. package/dist/cli/commands/hotspots.js +2 -2
  43. package/dist/cli/commands/hotspots.js.map +1 -1
  44. package/dist/cli/commands/impact.js +2 -2
  45. package/dist/cli/commands/impact.js.map +1 -1
  46. package/dist/cli/commands/init.js +2 -1
  47. package/dist/cli/commands/init.js.map +1 -1
  48. package/dist/cli/commands/installHook.js +2 -1
  49. package/dist/cli/commands/installHook.js.map +1 -1
  50. package/dist/cli/commands/mcp.js +2 -1
  51. package/dist/cli/commands/mcp.js.map +1 -1
  52. package/dist/cli/commands/memory.js +5 -4
  53. package/dist/cli/commands/memory.js.map +1 -1
  54. package/dist/cli/commands/outdated.js +2 -2
  55. package/dist/cli/commands/outdated.js.map +1 -1
  56. package/dist/cli/commands/plugin.js +83 -3
  57. package/dist/cli/commands/plugin.js.map +1 -1
  58. package/dist/cli/commands/prDiff.js +2 -2
  59. package/dist/cli/commands/prDiff.js.map +1 -1
  60. package/dist/cli/commands/preflight.d.ts +1 -0
  61. package/dist/cli/commands/preflight.js +80 -0
  62. package/dist/cli/commands/preflight.js.map +1 -0
  63. package/dist/cli/commands/review.js +2 -2
  64. package/dist/cli/commands/review.js.map +1 -1
  65. package/dist/cli/commands/search.js +2 -2
  66. package/dist/cli/commands/search.js.map +1 -1
  67. package/dist/cli/commands/session.js +5 -5
  68. package/dist/cli/commands/session.js.map +1 -1
  69. package/dist/cli/commands/structure.js +2 -2
  70. package/dist/cli/commands/structure.js.map +1 -1
  71. package/dist/cli/commands/taint.js +2 -2
  72. package/dist/cli/commands/taint.js.map +1 -1
  73. package/dist/cli/commands/upgrade.js +2 -2
  74. package/dist/cli/commands/upgrade.js.map +1 -1
  75. package/dist/cli/commands/watch.js +2 -1
  76. package/dist/cli/commands/watch.js.map +1 -1
  77. package/dist/cli/commands/workspace.js +4 -2
  78. package/dist/cli/commands/workspace.js.map +1 -1
  79. package/dist/cli/commands/workspaces.js +2 -2
  80. package/dist/cli/commands/workspaces.js.map +1 -1
  81. package/dist/cli/index.js +2 -0
  82. package/dist/cli/index.js.map +1 -1
  83. package/dist/core/issueEngine.js +2 -0
  84. package/dist/core/issueEngine.js.map +1 -1
  85. package/dist/core/pluginDx.d.ts +14 -0
  86. package/dist/core/pluginDx.js +298 -0
  87. package/dist/core/pluginDx.js.map +1 -0
  88. package/dist/core/plugins.d.ts +5 -6
  89. package/dist/core/plugins.js +99 -13
  90. package/dist/core/plugins.js.map +1 -1
  91. package/dist/core/preflight.d.ts +11 -0
  92. package/dist/core/preflight.js +450 -0
  93. package/dist/core/preflight.js.map +1 -0
  94. package/dist/core/review.js +132 -3
  95. package/dist/core/review.js.map +1 -1
  96. package/dist/core/sessionResources.d.ts +6 -0
  97. package/dist/core/sessionResources.js +216 -0
  98. package/dist/core/sessionResources.js.map +1 -0
  99. package/dist/mcp/resources.js +25 -0
  100. package/dist/mcp/resources.js.map +1 -1
  101. package/dist/mcp/tools/preflight.d.ts +2 -0
  102. package/dist/mcp/tools/preflight.js +51 -0
  103. package/dist/mcp/tools/preflight.js.map +1 -0
  104. package/dist/mcp/tools.js +2 -0
  105. package/dist/mcp/tools.js.map +1 -1
  106. package/dist/projscan-sbom.cdx.json +4589 -0
  107. package/dist/reporters/htmlReporter.d.ts +2 -1
  108. package/dist/reporters/htmlReporter.js +70 -0
  109. package/dist/reporters/htmlReporter.js.map +1 -1
  110. package/dist/tool-manifest.json +33 -3
  111. package/dist/types.d.ts +141 -0
  112. package/dist/utils/banner.js +14 -4
  113. package/dist/utils/banner.js.map +1 -1
  114. package/dist/utils/fileWalker.js +4 -0
  115. package/dist/utils/fileWalker.js.map +1 -1
  116. package/dist/utils/formatSupport.d.ts +58 -0
  117. package/dist/utils/formatSupport.js +63 -0
  118. package/dist/utils/formatSupport.js.map +1 -0
  119. package/docs/PLUGIN-AUTHORING.md +30 -0
  120. package/package.json +12 -7
@@ -64,6 +64,20 @@ The machine-readable manifest schema lives at
64
64
  [`docs/plugin.schema.json`](plugin.schema.json). The examples under
65
65
  [`docs/examples/plugins/`](examples/plugins/) are tested in CI.
66
66
 
67
+ ## Scaffold
68
+
69
+ Use `plugin init` to create a minimal local plugin without writing the manifest
70
+ by hand:
71
+
72
+ ```sh
73
+ projscan plugin init --kind analyzer --name policy
74
+ projscan plugin init --kind reporter --name team-summary
75
+ projscan plugin init --kind analyzer --name policy --format json
76
+ ```
77
+
78
+ The command writes a manifest and `.mjs` module under `.projscan-plugins/`.
79
+ It refuses to overwrite existing files.
80
+
67
81
  ## Analyzer Module
68
82
 
69
83
  The module must export a `check(rootPath, files)` function, either as the
@@ -151,6 +165,22 @@ projscan plugin validate .projscan-plugins/policy.projscan-plugin.json --format
151
165
  Validation reports structured diagnostics with a stable `code`, the manifest
152
166
  `field` when applicable, a `message`, and sometimes a `hint`.
153
167
 
168
+ ## Test
169
+
170
+ Use `plugin test` after editing a plugin:
171
+
172
+ ```sh
173
+ projscan plugin test .projscan-plugins/policy.projscan-plugin.json
174
+ projscan plugin test .projscan-plugins/policy.projscan-plugin.json --format json
175
+ projscan plugin test .projscan-plugins/policy.projscan-plugin.json --fixture ./test-fixture
176
+ ```
177
+
178
+ For analyzer plugins, the test runner loads the module, scans the fixture root,
179
+ runs `check(rootPath, files)`, and verifies every returned issue has the required
180
+ shape. For reporter plugins, it renders sample `doctor`, `analyze`, and `ci`
181
+ payloads for the commands listed in the manifest and verifies each render returns
182
+ a string.
183
+
154
184
  ## List
155
185
 
156
186
  ```sh
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "projscan",
3
3
  "mcpName": "io.github.abhiyoheswaran1/projscan",
4
- "version": "2.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++; 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), 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": "2.2.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 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",
@@ -20,13 +20,17 @@
20
20
  "scripts": {
21
21
  "build": "tsc && node scripts/copy-wasm.mjs && node scripts/generate-tool-manifest.mjs",
22
22
  "dev": "tsc --watch",
23
- "test": "vitest run",
24
- "test:watch": "vitest",
23
+ "test": "vitest run --test-timeout 15000 --hook-timeout 15000",
24
+ "test:watch": "vitest --test-timeout 15000 --hook-timeout 15000",
25
25
  "lint": "eslint src/",
26
26
  "format": "prettier --write .",
27
27
  "bench": "node scripts/bench.mjs",
28
28
  "bench:references": "node scripts/bench-references.mjs",
29
+ "smoke:packed-install": "node scripts/packed-install-smoke.mjs",
29
30
  "check:stability": "node scripts/check-stability.mjs",
31
+ "release:check": "node scripts/release-check.mjs",
32
+ "security:release-gate": "node scripts/release-gate.mjs",
33
+ "sbom:generate": "node scripts/generate-sbom.mjs",
30
34
  "prepare": "npm run build"
31
35
  },
32
36
  "keywords": [
@@ -94,12 +98,13 @@
94
98
  "tree-sitter-swift": "^0.7.1",
95
99
  "typescript": "^5.6.0",
96
100
  "typescript-eslint": "^8.57.0",
97
- "vitest": "^2.1.0"
101
+ "vite": "^6.4.2",
102
+ "vitest": "^3.2.4"
98
103
  },
99
104
  "overrides": {
100
- "protobufjs": "^7.5.5",
105
+ "protobufjs": "^7.5.9",
101
106
  "picomatch": ">=2.3.2 <3 || >=4.0.4",
102
- "brace-expansion": ">=2.0.2 <3 || >=5.0.5",
107
+ "brace-expansion": ">=2.0.2 <3 || >=5.0.6",
103
108
  "flatted": "^3.4.2",
104
109
  "postcss": "^8.5.10"
105
110
  }