projscan 1.10.0 → 1.11.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 +45 -19
- package/dist/cli/_shared.d.ts +2 -0
- package/dist/cli/_shared.js +33 -0
- package/dist/cli/_shared.js.map +1 -1
- package/dist/cli/commands/analyze.js +4 -1
- package/dist/cli/commands/analyze.js.map +1 -1
- package/dist/cli/commands/ci.js +19 -2
- package/dist/cli/commands/ci.js.map +1 -1
- package/dist/cli/commands/doctor.js +6 -1
- package/dist/cli/commands/doctor.js.map +1 -1
- package/dist/cli/commands/plugin.d.ts +1 -1
- package/dist/cli/commands/plugin.js +25 -32
- package/dist/cli/commands/plugin.js.map +1 -1
- package/dist/core/plugins.d.ts +68 -5
- package/dist/core/plugins.js +229 -39
- package/dist/core/plugins.js.map +1 -1
- package/dist/mcp/tools/plugin.d.ts +1 -1
- package/dist/mcp/tools/plugin.js +13 -28
- package/dist/mcp/tools/plugin.js.map +1 -1
- package/dist/tool-manifest.json +3 -3
- package/package.json +2 -2
package/dist/core/plugins.d.ts
CHANGED
|
@@ -18,36 +18,90 @@ export declare const PLUGIN_PREVIEW_FLAG = "PROJSCAN_PLUGINS_PREVIEW";
|
|
|
18
18
|
export declare const PLUGIN_SCHEMA_VERSION = 1;
|
|
19
19
|
export declare const PLUGIN_DIR = ".projscan-plugins";
|
|
20
20
|
export declare const PLUGIN_MANIFEST_EXT = ".projscan-plugin.json";
|
|
21
|
-
export type PluginKind = 'analyzer';
|
|
22
|
-
export
|
|
21
|
+
export type PluginKind = 'analyzer' | 'reporter';
|
|
22
|
+
export type PluginReporterCommand = 'doctor' | 'analyze' | 'ci';
|
|
23
|
+
export declare const PLUGIN_REPORTER_COMMANDS: readonly ["doctor", "analyze", "ci"];
|
|
24
|
+
interface PluginManifestBase {
|
|
23
25
|
schemaVersion: number;
|
|
24
26
|
name: string;
|
|
25
27
|
kind: PluginKind;
|
|
26
28
|
/** Module entry point, relative to the manifest file. */
|
|
27
29
|
module: string;
|
|
28
|
-
/** Issue category emitted by this plugin (`Issue.category`). */
|
|
29
|
-
category: string;
|
|
30
30
|
/** Optional human-readable summary. */
|
|
31
31
|
description?: string;
|
|
32
32
|
}
|
|
33
|
+
export interface PluginAnalyzerManifest extends PluginManifestBase {
|
|
34
|
+
kind: 'analyzer';
|
|
35
|
+
/** Issue category emitted by this plugin (`Issue.category`). */
|
|
36
|
+
category: string;
|
|
37
|
+
}
|
|
38
|
+
export interface PluginReporterManifest extends PluginManifestBase {
|
|
39
|
+
kind: 'reporter';
|
|
40
|
+
/** CLI commands this reporter can render. */
|
|
41
|
+
commands: PluginReporterCommand[];
|
|
42
|
+
}
|
|
43
|
+
export type PluginManifest = PluginAnalyzerManifest | PluginReporterManifest;
|
|
33
44
|
export interface PluginAnalyzerExports {
|
|
34
45
|
check: (rootPath: string, files: FileEntry[]) => Promise<Issue[]> | Issue[];
|
|
35
46
|
}
|
|
47
|
+
export interface PluginReporterContext<TPayload = unknown> {
|
|
48
|
+
command: PluginReporterCommand;
|
|
49
|
+
rootPath: string;
|
|
50
|
+
manifest: PluginReporterManifest;
|
|
51
|
+
payload: TPayload;
|
|
52
|
+
}
|
|
53
|
+
export interface PluginReporterExports {
|
|
54
|
+
render: (context: PluginReporterContext) => Promise<string> | string;
|
|
55
|
+
}
|
|
36
56
|
export interface LoadedPlugin {
|
|
37
|
-
manifest:
|
|
57
|
+
manifest: PluginAnalyzerManifest;
|
|
38
58
|
/** Absolute path to the manifest file on disk. */
|
|
39
59
|
manifestPath: string;
|
|
40
60
|
/** Absolute path to the resolved module entry point. */
|
|
41
61
|
modulePath: string;
|
|
42
62
|
exports: PluginAnalyzerExports;
|
|
43
63
|
}
|
|
64
|
+
export interface LoadedReporterPlugin {
|
|
65
|
+
manifest: PluginReporterManifest;
|
|
66
|
+
/** Absolute path to the manifest file on disk. */
|
|
67
|
+
manifestPath: string;
|
|
68
|
+
/** Absolute path to the resolved module entry point. */
|
|
69
|
+
modulePath: string;
|
|
70
|
+
exports: PluginReporterExports;
|
|
71
|
+
}
|
|
44
72
|
export interface PluginDiscoveryEntry {
|
|
45
73
|
manifestPath: string;
|
|
46
74
|
manifest: PluginManifest | null;
|
|
47
75
|
/** Set when the manifest failed to parse or validate. */
|
|
48
76
|
error?: string;
|
|
77
|
+
diagnostic?: PluginDiagnostic;
|
|
49
78
|
}
|
|
79
|
+
export type PluginManifestFileResult = {
|
|
80
|
+
ok: true;
|
|
81
|
+
manifest: PluginManifest;
|
|
82
|
+
} | {
|
|
83
|
+
ok: false;
|
|
84
|
+
reason: string;
|
|
85
|
+
diagnostic: PluginDiagnostic;
|
|
86
|
+
};
|
|
87
|
+
export type PluginReporterResolveResult = {
|
|
88
|
+
ok: true;
|
|
89
|
+
plugin: LoadedReporterPlugin;
|
|
90
|
+
} | {
|
|
91
|
+
ok: false;
|
|
92
|
+
reason: string;
|
|
93
|
+
diagnostic: PluginDiagnostic;
|
|
94
|
+
};
|
|
95
|
+
export type PluginReporterRenderResult = {
|
|
96
|
+
ok: true;
|
|
97
|
+
output: string;
|
|
98
|
+
} | {
|
|
99
|
+
ok: false;
|
|
100
|
+
reason: string;
|
|
101
|
+
diagnostic: PluginDiagnostic;
|
|
102
|
+
};
|
|
50
103
|
export declare function pluginsEnabled(): boolean;
|
|
104
|
+
export declare function readPluginManifestFile(manifestPath: string): Promise<PluginManifestFileResult>;
|
|
51
105
|
/**
|
|
52
106
|
* Discover every plugin manifest under `<root>/.projscan-plugins/`. Manifests
|
|
53
107
|
* that fail to parse or validate are returned with `manifest: null` and an
|
|
@@ -63,6 +117,8 @@ export declare function discoverPluginManifests(rootPath: string): Promise<Plugi
|
|
|
63
117
|
* We never let one bad plugin break the projscan pipeline.
|
|
64
118
|
*/
|
|
65
119
|
export declare function loadPlugins(rootPath: string): Promise<LoadedPlugin[]>;
|
|
120
|
+
export declare function resolveReporterPlugin(rootPath: string, reporterName: string, command: PluginReporterCommand): Promise<PluginReporterResolveResult>;
|
|
121
|
+
export declare function renderReporterPlugin(plugin: LoadedReporterPlugin, context: PluginReporterContext): Promise<PluginReporterRenderResult>;
|
|
66
122
|
/**
|
|
67
123
|
* Run every loaded analyzer plugin against `files`. Issues that don't pass
|
|
68
124
|
* a tight shape check are dropped so a malformed plugin can't poison the
|
|
@@ -71,6 +127,12 @@ export declare function loadPlugins(rootPath: string): Promise<LoadedPlugin[]>;
|
|
|
71
127
|
* collide).
|
|
72
128
|
*/
|
|
73
129
|
export declare function runAnalyzerPlugins(plugins: LoadedPlugin[], rootPath: string, files: FileEntry[]): Promise<Issue[]>;
|
|
130
|
+
export interface PluginDiagnostic {
|
|
131
|
+
code: 'invalid-manifest' | 'unsupported-schema-version' | 'invalid-name' | 'unsupported-kind' | 'invalid-module' | 'invalid-category' | 'invalid-commands' | 'invalid-description' | 'invalid-json' | 'read-error' | 'plugins-disabled' | 'reporter-not-found' | 'reporter-unsupported-command' | 'invalid-reporter-export' | 'reporter-load-error' | 'reporter-render-error';
|
|
132
|
+
message: string;
|
|
133
|
+
field?: string;
|
|
134
|
+
hint?: string;
|
|
135
|
+
}
|
|
74
136
|
interface ValidationOk {
|
|
75
137
|
ok: true;
|
|
76
138
|
manifest: PluginManifest;
|
|
@@ -78,6 +140,7 @@ interface ValidationOk {
|
|
|
78
140
|
interface ValidationFail {
|
|
79
141
|
ok: false;
|
|
80
142
|
reason: string;
|
|
143
|
+
diagnostic: PluginDiagnostic;
|
|
81
144
|
}
|
|
82
145
|
export declare function validateManifest(input: unknown): ValidationOk | ValidationFail;
|
|
83
146
|
export {};
|
package/dist/core/plugins.js
CHANGED
|
@@ -20,10 +20,49 @@ export const PLUGIN_PREVIEW_FLAG = 'PROJSCAN_PLUGINS_PREVIEW';
|
|
|
20
20
|
export const PLUGIN_SCHEMA_VERSION = 1;
|
|
21
21
|
export const PLUGIN_DIR = '.projscan-plugins';
|
|
22
22
|
export const PLUGIN_MANIFEST_EXT = '.projscan-plugin.json';
|
|
23
|
+
export const PLUGIN_REPORTER_COMMANDS = ['doctor', 'analyze', 'ci'];
|
|
23
24
|
export function pluginsEnabled() {
|
|
24
25
|
const v = process.env[PLUGIN_PREVIEW_FLAG];
|
|
25
26
|
return v === '1' || v === 'true';
|
|
26
27
|
}
|
|
28
|
+
export async function readPluginManifestFile(manifestPath) {
|
|
29
|
+
let raw;
|
|
30
|
+
try {
|
|
31
|
+
raw = await fs.readFile(manifestPath, 'utf-8');
|
|
32
|
+
}
|
|
33
|
+
catch (err) {
|
|
34
|
+
const message = `unable to read manifest: ${err instanceof Error ? err.message : String(err)}`;
|
|
35
|
+
return {
|
|
36
|
+
ok: false,
|
|
37
|
+
reason: message,
|
|
38
|
+
diagnostic: {
|
|
39
|
+
code: 'read-error',
|
|
40
|
+
message,
|
|
41
|
+
hint: 'Check file permissions and try again.',
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = JSON.parse(raw);
|
|
48
|
+
}
|
|
49
|
+
catch (err) {
|
|
50
|
+
const message = `invalid JSON: ${err instanceof Error ? err.message : String(err)}`;
|
|
51
|
+
return {
|
|
52
|
+
ok: false,
|
|
53
|
+
reason: message,
|
|
54
|
+
diagnostic: {
|
|
55
|
+
code: 'invalid-json',
|
|
56
|
+
message,
|
|
57
|
+
hint: 'Fix the manifest so it is valid JSON.',
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
const validation = validateManifest(parsed);
|
|
62
|
+
return validation.ok
|
|
63
|
+
? { ok: true, manifest: validation.manifest }
|
|
64
|
+
: { ok: false, reason: validation.reason, diagnostic: validation.diagnostic };
|
|
65
|
+
}
|
|
27
66
|
/**
|
|
28
67
|
* Discover every plugin manifest under `<root>/.projscan-plugins/`. Manifests
|
|
29
68
|
* that fail to parse or validate are returned with `manifest: null` and an
|
|
@@ -43,36 +82,17 @@ export async function discoverPluginManifests(rootPath) {
|
|
|
43
82
|
if (!name.endsWith(PLUGIN_MANIFEST_EXT))
|
|
44
83
|
continue;
|
|
45
84
|
const manifestPath = path.join(dir, name);
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
raw = await fs.readFile(manifestPath, 'utf-8');
|
|
49
|
-
}
|
|
50
|
-
catch (err) {
|
|
85
|
+
const result = await readPluginManifestFile(manifestPath);
|
|
86
|
+
if (!result.ok) {
|
|
51
87
|
out.push({
|
|
52
88
|
manifestPath,
|
|
53
89
|
manifest: null,
|
|
54
|
-
error:
|
|
90
|
+
error: result.reason,
|
|
91
|
+
diagnostic: result.diagnostic,
|
|
55
92
|
});
|
|
56
93
|
continue;
|
|
57
94
|
}
|
|
58
|
-
|
|
59
|
-
try {
|
|
60
|
-
parsed = JSON.parse(raw);
|
|
61
|
-
}
|
|
62
|
-
catch (err) {
|
|
63
|
-
out.push({
|
|
64
|
-
manifestPath,
|
|
65
|
-
manifest: null,
|
|
66
|
-
error: `invalid JSON: ${err instanceof Error ? err.message : String(err)}`,
|
|
67
|
-
});
|
|
68
|
-
continue;
|
|
69
|
-
}
|
|
70
|
-
const validation = validateManifest(parsed);
|
|
71
|
-
if (!validation.ok) {
|
|
72
|
-
out.push({ manifestPath, manifest: null, error: validation.reason });
|
|
73
|
-
continue;
|
|
74
|
-
}
|
|
75
|
-
out.push({ manifestPath, manifest: validation.manifest });
|
|
95
|
+
out.push({ manifestPath, manifest: result.manifest });
|
|
76
96
|
}
|
|
77
97
|
return out;
|
|
78
98
|
}
|
|
@@ -92,6 +112,8 @@ export async function loadPlugins(rootPath) {
|
|
|
92
112
|
for (const entry of discovered) {
|
|
93
113
|
if (!entry.manifest)
|
|
94
114
|
continue;
|
|
115
|
+
if (entry.manifest.kind !== 'analyzer')
|
|
116
|
+
continue;
|
|
95
117
|
const modulePath = path.resolve(path.dirname(entry.manifestPath), entry.manifest.module);
|
|
96
118
|
try {
|
|
97
119
|
const mod = (await import(pathToFileURL(modulePath).href));
|
|
@@ -113,6 +135,83 @@ export async function loadPlugins(rootPath) {
|
|
|
113
135
|
}
|
|
114
136
|
return loaded;
|
|
115
137
|
}
|
|
138
|
+
export async function resolveReporterPlugin(rootPath, reporterName, command) {
|
|
139
|
+
if (!pluginsEnabled()) {
|
|
140
|
+
return pluginRuntimeFail({
|
|
141
|
+
code: 'plugins-disabled',
|
|
142
|
+
message: `reporter plugins require ${PLUGIN_PREVIEW_FLAG}=1`,
|
|
143
|
+
hint: `Set ${PLUGIN_PREVIEW_FLAG}=1 in the environment to enable plugin reporters.`,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
const entries = await discoverPluginManifests(rootPath);
|
|
147
|
+
const reporters = entries.filter((entry) => entry.manifest?.kind === 'reporter');
|
|
148
|
+
const entry = reporters.find((candidate) => candidate.manifest.name === reporterName);
|
|
149
|
+
if (!entry) {
|
|
150
|
+
return pluginRuntimeFail({
|
|
151
|
+
code: 'reporter-not-found',
|
|
152
|
+
message: `reporter plugin "${reporterName}" was not found`,
|
|
153
|
+
hint: 'Run `projscan plugin list` to see discovered reporter plugins.',
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (!entry.manifest.commands.includes(command)) {
|
|
157
|
+
return pluginRuntimeFail({
|
|
158
|
+
code: 'reporter-unsupported-command',
|
|
159
|
+
message: `reporter plugin "${reporterName}" does not support command "${command}"`,
|
|
160
|
+
hint: `Add "${command}" to the reporter manifest's commands array or choose a different reporter.`,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
return loadReporterPlugin(entry.manifest, entry.manifestPath);
|
|
164
|
+
}
|
|
165
|
+
export async function renderReporterPlugin(plugin, context) {
|
|
166
|
+
try {
|
|
167
|
+
const output = await plugin.exports.render(context);
|
|
168
|
+
if (typeof output !== 'string') {
|
|
169
|
+
return pluginRuntimeFail({
|
|
170
|
+
code: 'reporter-render-error',
|
|
171
|
+
message: `reporter plugin "${plugin.manifest.name}" returned ${typeof output}; expected string`,
|
|
172
|
+
hint: 'Reporter render(context) must return text for stdout.',
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
return { ok: true, output };
|
|
176
|
+
}
|
|
177
|
+
catch (err) {
|
|
178
|
+
return pluginRuntimeFail({
|
|
179
|
+
code: 'reporter-render-error',
|
|
180
|
+
message: `reporter plugin "${plugin.manifest.name}" failed during render: ${formatError(err)}`,
|
|
181
|
+
hint: 'Fix the reporter render(context) implementation and try again.',
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async function loadReporterPlugin(manifest, manifestPath) {
|
|
186
|
+
const modulePath = path.resolve(path.dirname(manifestPath), manifest.module);
|
|
187
|
+
try {
|
|
188
|
+
const mod = (await import(pathToFileURL(modulePath).href));
|
|
189
|
+
const exportsObj = (mod.default ?? mod);
|
|
190
|
+
if (typeof exportsObj.render !== 'function') {
|
|
191
|
+
return pluginRuntimeFail({
|
|
192
|
+
code: 'invalid-reporter-export',
|
|
193
|
+
message: `reporter plugin "${manifest.name}" missing required export "render"`,
|
|
194
|
+
hint: 'Export `render(context)` as the default export or a named export.',
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
return {
|
|
198
|
+
ok: true,
|
|
199
|
+
plugin: {
|
|
200
|
+
manifest,
|
|
201
|
+
manifestPath,
|
|
202
|
+
modulePath,
|
|
203
|
+
exports: { render: exportsObj.render },
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
catch (err) {
|
|
208
|
+
return pluginRuntimeFail({
|
|
209
|
+
code: 'reporter-load-error',
|
|
210
|
+
message: `reporter plugin "${manifest.name}" failed to load: ${formatError(err)}`,
|
|
211
|
+
hint: 'Check the reporter module path and module syntax.',
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
116
215
|
/**
|
|
117
216
|
* Run every loaded analyzer plugin against `files`. Issues that don't pass
|
|
118
217
|
* a tight shape check are dropped so a malformed plugin can't poison the
|
|
@@ -143,36 +242,96 @@ export async function runAnalyzerPlugins(plugins, rootPath, files) {
|
|
|
143
242
|
}
|
|
144
243
|
return out;
|
|
145
244
|
}
|
|
245
|
+
function failValidation(diagnostic) {
|
|
246
|
+
return { ok: false, reason: diagnostic.message, diagnostic };
|
|
247
|
+
}
|
|
248
|
+
function pluginRuntimeFail(diagnostic) {
|
|
249
|
+
return { ok: false, reason: diagnostic.message, diagnostic };
|
|
250
|
+
}
|
|
251
|
+
function formatError(err) {
|
|
252
|
+
return err instanceof Error ? err.message : String(err);
|
|
253
|
+
}
|
|
146
254
|
export function validateManifest(input) {
|
|
147
255
|
if (!input || typeof input !== 'object') {
|
|
148
|
-
return {
|
|
256
|
+
return failValidation({
|
|
257
|
+
code: 'invalid-manifest',
|
|
258
|
+
message: 'manifest must be a JSON object',
|
|
259
|
+
hint: 'Use an object with schemaVersion, name, kind, module, and category fields.',
|
|
260
|
+
});
|
|
149
261
|
}
|
|
150
262
|
const obj = input;
|
|
151
263
|
if (obj.schemaVersion !== PLUGIN_SCHEMA_VERSION) {
|
|
152
|
-
return {
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
264
|
+
return failValidation({
|
|
265
|
+
code: 'unsupported-schema-version',
|
|
266
|
+
field: 'schemaVersion',
|
|
267
|
+
message: `unsupported schemaVersion ${String(obj.schemaVersion)}; expected ${PLUGIN_SCHEMA_VERSION}`,
|
|
268
|
+
hint: `Set "schemaVersion": ${PLUGIN_SCHEMA_VERSION}.`,
|
|
269
|
+
});
|
|
156
270
|
}
|
|
157
271
|
if (typeof obj.name !== 'string' || !/^[a-z0-9][a-z0-9._/-]{0,64}$/i.test(obj.name)) {
|
|
158
|
-
return {
|
|
272
|
+
return failValidation({
|
|
273
|
+
code: 'invalid-name',
|
|
274
|
+
field: 'name',
|
|
275
|
+
message: 'name is required and must be 1-65 chars of [a-z0-9._/-]',
|
|
276
|
+
hint: 'Use a stable 1-65 character plugin id such as "team/no-console" or "my-plugin".',
|
|
277
|
+
});
|
|
159
278
|
}
|
|
160
|
-
if (obj.kind !== 'analyzer') {
|
|
161
|
-
return {
|
|
279
|
+
if (obj.kind !== 'analyzer' && obj.kind !== 'reporter') {
|
|
280
|
+
return failValidation({
|
|
281
|
+
code: 'unsupported-kind',
|
|
282
|
+
field: 'kind',
|
|
283
|
+
message: 'kind must be "analyzer" or "reporter"',
|
|
284
|
+
hint: 'Set "kind": "analyzer" for issue-producing plugins or "kind": "reporter" for CLI output plugins.',
|
|
285
|
+
});
|
|
162
286
|
}
|
|
163
287
|
if (typeof obj.module !== 'string' || obj.module.length === 0) {
|
|
164
|
-
return {
|
|
288
|
+
return failValidation({
|
|
289
|
+
code: 'invalid-module',
|
|
290
|
+
field: 'module',
|
|
291
|
+
message: 'module is required and must be a relative path',
|
|
292
|
+
hint: 'Point to a local module inside the same plugin directory, for example "./check.mjs".',
|
|
293
|
+
});
|
|
165
294
|
}
|
|
166
295
|
// Path-traversal guard. Modules must resolve under the manifest's own dir.
|
|
167
296
|
if (path.isAbsolute(obj.module) || obj.module.split(/[/\\]/).some((seg) => seg === '..')) {
|
|
168
|
-
return {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
297
|
+
return failValidation({
|
|
298
|
+
code: 'invalid-module',
|
|
299
|
+
field: 'module',
|
|
300
|
+
message: 'module must be a relative path inside the plugin dir',
|
|
301
|
+
hint: 'Do not use absolute paths or any ".." path segment.',
|
|
302
|
+
});
|
|
172
303
|
}
|
|
173
304
|
if (obj.description !== undefined && typeof obj.description !== 'string') {
|
|
174
|
-
return {
|
|
305
|
+
return failValidation({
|
|
306
|
+
code: 'invalid-description',
|
|
307
|
+
field: 'description',
|
|
308
|
+
message: 'description must be a string when provided',
|
|
309
|
+
});
|
|
175
310
|
}
|
|
311
|
+
if (obj.kind === 'analyzer') {
|
|
312
|
+
if (typeof obj.category !== 'string' || obj.category.length === 0) {
|
|
313
|
+
return failValidation({
|
|
314
|
+
code: 'invalid-category',
|
|
315
|
+
field: 'category',
|
|
316
|
+
message: 'category is required for analyzer plugins',
|
|
317
|
+
hint: 'Use the fallback Issue.category for this plugin, for example "custom" or "security".',
|
|
318
|
+
});
|
|
319
|
+
}
|
|
320
|
+
return {
|
|
321
|
+
ok: true,
|
|
322
|
+
manifest: {
|
|
323
|
+
schemaVersion: obj.schemaVersion,
|
|
324
|
+
name: obj.name,
|
|
325
|
+
kind: obj.kind,
|
|
326
|
+
module: obj.module,
|
|
327
|
+
category: obj.category,
|
|
328
|
+
...(typeof obj.description === 'string' ? { description: obj.description } : {}),
|
|
329
|
+
},
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
const commandValidation = validateReporterCommands(obj.commands);
|
|
333
|
+
if (!commandValidation.ok)
|
|
334
|
+
return commandValidation;
|
|
176
335
|
return {
|
|
177
336
|
ok: true,
|
|
178
337
|
manifest: {
|
|
@@ -180,11 +339,42 @@ export function validateManifest(input) {
|
|
|
180
339
|
name: obj.name,
|
|
181
340
|
kind: obj.kind,
|
|
182
341
|
module: obj.module,
|
|
183
|
-
|
|
342
|
+
commands: commandValidation.commands,
|
|
184
343
|
...(typeof obj.description === 'string' ? { description: obj.description } : {}),
|
|
185
344
|
},
|
|
186
345
|
};
|
|
187
346
|
}
|
|
347
|
+
function validateReporterCommands(input) {
|
|
348
|
+
if (!Array.isArray(input) || input.length === 0) {
|
|
349
|
+
return failValidation({
|
|
350
|
+
code: 'invalid-commands',
|
|
351
|
+
field: 'commands',
|
|
352
|
+
message: 'commands must be a non-empty array for reporter plugins',
|
|
353
|
+
hint: 'Use one or more supported commands: doctor, analyze, ci.',
|
|
354
|
+
});
|
|
355
|
+
}
|
|
356
|
+
const seen = new Set();
|
|
357
|
+
const invalid = [];
|
|
358
|
+
for (const value of input) {
|
|
359
|
+
if (typeof value !== 'string' || !isReporterCommand(value)) {
|
|
360
|
+
invalid.push(String(value));
|
|
361
|
+
continue;
|
|
362
|
+
}
|
|
363
|
+
seen.add(value);
|
|
364
|
+
}
|
|
365
|
+
if (invalid.length > 0) {
|
|
366
|
+
return failValidation({
|
|
367
|
+
code: 'invalid-commands',
|
|
368
|
+
field: 'commands',
|
|
369
|
+
message: `unsupported reporter command(s): ${invalid.join(', ')}`,
|
|
370
|
+
hint: 'Supported reporter commands are: doctor, analyze, ci.',
|
|
371
|
+
});
|
|
372
|
+
}
|
|
373
|
+
return { ok: true, commands: [...seen] };
|
|
374
|
+
}
|
|
375
|
+
function isReporterCommand(value) {
|
|
376
|
+
return PLUGIN_REPORTER_COMMANDS.includes(value);
|
|
377
|
+
}
|
|
188
378
|
function isWellShapedIssue(x) {
|
|
189
379
|
if (!x || typeof x !== 'object')
|
|
190
380
|
return false;
|
package/dist/core/plugins.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.js","sourceRoot":"","sources":["../../src/core/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAGzC;;;;;;;;;;;;;;GAcG;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AAC9D,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,CAAC;AACvC,MAAM,CAAC,MAAM,UAAU,GAAG,mBAAmB,CAAC;AAC9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAoC3D,MAAM,UAAU,cAAc;IAC5B,MAAM,CAAC,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,CAAC;IAC3C,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,MAAM,CAAC;AACnC,CAAC;AAED;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,uBAAuB,CAAC,QAAgB;IAC5D,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;IAC5C,IAAI,OAAiB,CAAC;IACtB,IAAI,CAAC;QACH,OAAO,GAAG,MAAM,EA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,EAAE,CAAC,GAAG,IAAI,CAAC,EAAE,CAAC;AAC3C,CAAC;AAED,SAAS,iBAAiB,CAAC,KAAa;IACtC,OAAQ,wBAA8C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACzE,CAAC;AAED,SAAS,iBAAiB,CAAC,CAAU;IACnC,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9C,MAAM,GAAG,GAAG,CAA4B,CAAC;IACzC,IAAI,OAAO,GAAG,CAAC,EAAE,KAAK,QAAQ,IAAI,GAAG,CAAC,EAAE,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACpE,IAAI,OAAO,GAAG,CAAC,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAChD,IAAI,OAAO,GAAG,CAAC,WAAW,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACtD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,QAAQ,CAAC;QAAE,OAAO,KAAK,CAAC;IAC5C,IAAI,OAAO,GAAG,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACnD,IAAI,OAAO,GAAG,CAAC,YAAY,KAAK,SAAS;QAAE,OAAO,KAAK,CAAC;IACxD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,UAAU,CAAC,CAAU;IAC5B,OAAO,CAAC,KAAK,OAAO,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,MAAM,CAAC;AAC1D,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { McpTool } from './_shared.js';
|
|
2
2
|
/**
|
|
3
3
|
* `projscan_plugin` (1.10+ preview) — discover and validate third-party
|
|
4
|
-
*
|
|
4
|
+
* plugins under `<root>/.projscan-plugins/*.projscan-plugin.json`.
|
|
5
5
|
*
|
|
6
6
|
* Behind the PROJSCAN_PLUGINS_PREVIEW=1 feature flag. The tool is always
|
|
7
7
|
* registered (so agents can probe for it), but `action:"list"` returns
|
package/dist/mcp/tools/plugin.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import { PLUGIN_PREVIEW_FLAG, discoverPluginManifests, pluginsEnabled, readPluginManifestFile, } from '../../core/plugins.js';
|
|
3
3
|
/**
|
|
4
4
|
* `projscan_plugin` (1.10+ preview) — discover and validate third-party
|
|
5
|
-
*
|
|
5
|
+
* plugins under `<root>/.projscan-plugins/*.projscan-plugin.json`.
|
|
6
6
|
*
|
|
7
7
|
* Behind the PROJSCAN_PLUGINS_PREVIEW=1 feature flag. The tool is always
|
|
8
8
|
* registered (so agents can probe for it), but `action:"list"` returns
|
|
@@ -13,7 +13,7 @@ import fs from 'node:fs/promises';
|
|
|
13
13
|
*/
|
|
14
14
|
export const pluginTool = {
|
|
15
15
|
name: 'projscan_plugin',
|
|
16
|
-
description: '1.10+ preview. Discover and validate third-party analyzer plugins under .projscan-plugins/. Gated by the PROJSCAN_PLUGINS_PREVIEW=1 env flag; the schema is preview-only and may shift before 2.0. Use action:"list" to see what is discoverable today, action:"validate" to check a manifest before committing it.',
|
|
16
|
+
description: '1.10+ preview. Discover and validate third-party analyzer and reporter plugins under .projscan-plugins/. Gated by the PROJSCAN_PLUGINS_PREVIEW=1 env flag; the schema is preview-only and may shift before 2.0. Use action:"list" to see what is discoverable today, action:"validate" to check a manifest before committing it.',
|
|
17
17
|
inputSchema: {
|
|
18
18
|
type: 'object',
|
|
19
19
|
properties: {
|
|
@@ -45,10 +45,12 @@ export const pluginTool = {
|
|
|
45
45
|
name: e.manifest.name,
|
|
46
46
|
kind: e.manifest.kind,
|
|
47
47
|
module: e.manifest.module,
|
|
48
|
-
|
|
48
|
+
...(e.manifest.kind === 'analyzer'
|
|
49
|
+
? { category: e.manifest.category }
|
|
50
|
+
: { commands: e.manifest.commands }),
|
|
49
51
|
description: e.manifest.description,
|
|
50
52
|
}
|
|
51
|
-
: { error: e.error }),
|
|
53
|
+
: { error: e.error, diagnostic: e.diagnostic }),
|
|
52
54
|
})),
|
|
53
55
|
};
|
|
54
56
|
}
|
|
@@ -56,28 +58,11 @@ export const pluginTool = {
|
|
|
56
58
|
const p = typeof args.manifest_path === 'string' ? args.manifest_path : '';
|
|
57
59
|
if (!p)
|
|
58
60
|
throw new Error('validate action requires a "manifest_path" argument');
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
return {
|
|
65
|
-
ok: false,
|
|
66
|
-
error: `unable to read manifest: ${err instanceof Error ? err.message : String(err)}`,
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
let parsed;
|
|
70
|
-
try {
|
|
71
|
-
parsed = JSON.parse(raw);
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
return {
|
|
75
|
-
ok: false,
|
|
76
|
-
error: `invalid JSON: ${err instanceof Error ? err.message : String(err)}`,
|
|
77
|
-
};
|
|
78
|
-
}
|
|
79
|
-
const v = validateManifest(parsed);
|
|
80
|
-
return v.ok ? { ok: true, manifest: v.manifest } : { ok: false, error: v.reason };
|
|
61
|
+
const manifestPath = path.isAbsolute(p) ? p : path.resolve(rootPath, p);
|
|
62
|
+
const result = await readPluginManifestFile(manifestPath);
|
|
63
|
+
return result.ok
|
|
64
|
+
? { ok: true, manifest: result.manifest }
|
|
65
|
+
: { ok: false, error: result.reason, diagnostic: result.diagnostic };
|
|
81
66
|
}
|
|
82
67
|
default:
|
|
83
68
|
throw new Error(`Unknown action "${action}". Known: list, validate.`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/mcp/tools/plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../src/mcp/tools/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM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,KAAK,CAAC,mBAAmB,MAAM,2BAA2B,CAAC,CAAC;QAC1E,CAAC;IACH,CAAC;CACF,CAAC"}
|
package/dist/tool-manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projscan",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.11.0",
|
|
4
4
|
"mcpProtocolVersion": "2025-03-26",
|
|
5
|
-
"generatedAt": "2026-05-
|
|
5
|
+
"generatedAt": "2026-05-18T09:59:21.665Z",
|
|
6
6
|
"toolCount": 28,
|
|
7
7
|
"tools": [
|
|
8
8
|
{
|
|
@@ -714,7 +714,7 @@
|
|
|
714
714
|
},
|
|
715
715
|
{
|
|
716
716
|
"name": "projscan_plugin",
|
|
717
|
-
"description": "1.10+ preview. Discover and validate third-party analyzer plugins under .projscan-plugins/. Gated by the PROJSCAN_PLUGINS_PREVIEW=1 env flag; the schema is preview-only and may shift before 2.0. Use action:\"list\" to see what is discoverable today, action:\"validate\" to check a manifest before committing it.",
|
|
717
|
+
"description": "1.10+ preview. Discover and validate third-party analyzer and reporter plugins under .projscan-plugins/. Gated by the PROJSCAN_PLUGINS_PREVIEW=1 env flag; the schema is preview-only and may shift before 2.0. Use action:\"list\" to see what is discoverable today, action:\"validate\" to check a manifest before committing it.",
|
|
718
718
|
"inputSchema": {
|
|
719
719
|
"type": "object",
|
|
720
720
|
"properties": {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "projscan",
|
|
3
3
|
"mcpName": "io.github.abhiyoheswaran1/projscan",
|
|
4
|
-
"version": "1.
|
|
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), analyzer plugin API preview (projscan_plugin, gated by 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": "1.11.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), analyzer + reporter plugin API preview (projscan_plugin, CLI --reporter, gated by 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",
|