projscan 2.8.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -23
- package/dist/cli/commands/dataflow.d.ts +1 -0
- package/dist/cli/commands/dataflow.js +76 -0
- package/dist/cli/commands/dataflow.js.map +1 -0
- package/dist/cli/commands/init.js +46 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/preflight.js +16 -0
- package/dist/cli/commands/preflight.js.map +1 -1
- package/dist/cli/commands/recipes.d.ts +2 -0
- package/dist/cli/commands/recipes.js +94 -0
- package/dist/cli/commands/recipes.js.map +1 -0
- package/dist/cli/commands/semanticGraph.d.ts +1 -0
- package/dist/cli/commands/semanticGraph.js +55 -0
- package/dist/cli/commands/semanticGraph.js.map +1 -0
- package/dist/cli/index.js +7 -0
- package/dist/cli/index.js.map +1 -1
- package/dist/core/adoption.d.ts +57 -0
- package/dist/core/adoption.js +392 -0
- package/dist/core/adoption.js.map +1 -0
- package/dist/core/dataflow.d.ts +7 -0
- package/dist/core/dataflow.js +194 -0
- package/dist/core/dataflow.js.map +1 -0
- package/dist/core/intent.d.ts +1 -1
- package/dist/core/intent.js +16 -0
- package/dist/core/intent.js.map +1 -1
- package/dist/core/prDiff.js +25 -1
- package/dist/core/prDiff.js.map +1 -1
- package/dist/core/regressionPlan.js +2 -0
- package/dist/core/regressionPlan.js.map +1 -1
- package/dist/core/review.js +100 -3
- package/dist/core/review.js.map +1 -1
- package/dist/core/semanticGraph.d.ts +7 -0
- package/dist/core/semanticGraph.js +167 -0
- package/dist/core/semanticGraph.js.map +1 -0
- package/dist/core/taint.d.ts +5 -5
- package/dist/core/workplan.js +4 -4
- package/dist/core/workplan.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/mcp/tools/adoption.d.ts +2 -0
- package/dist/mcp/tools/adoption.js +35 -0
- package/dist/mcp/tools/adoption.js.map +1 -0
- package/dist/mcp/tools/costSummary.js +2 -0
- package/dist/mcp/tools/costSummary.js.map +1 -1
- package/dist/mcp/tools/dataflow.d.ts +2 -0
- package/dist/mcp/tools/dataflow.js +58 -0
- package/dist/mcp/tools/dataflow.js.map +1 -0
- package/dist/mcp/tools/semanticGraph.d.ts +2 -0
- package/dist/mcp/tools/semanticGraph.js +40 -0
- package/dist/mcp/tools/semanticGraph.js.map +1 -0
- package/dist/mcp/tools.js +6 -0
- package/dist/mcp/tools.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +6 -6
- package/dist/reporters/consoleReporter.js +4 -0
- package/dist/reporters/consoleReporter.js.map +1 -1
- package/dist/tool-manifest.json +81 -3
- package/dist/types.d.ts +94 -1
- package/dist/utils/formatSupport.d.ts +5 -0
- package/dist/utils/formatSupport.js +5 -0
- package/dist/utils/formatSupport.js.map +1 -1
- package/docs/PLUGIN-AUTHORING.md +4 -0
- package/docs/PLUGIN-GALLERY.md +61 -0
- package/docs/examples/plugins/release-readiness.mjs +26 -0
- package/docs/examples/plugins/release-readiness.projscan-plugin.json +8 -0
- package/docs/examples/plugins/security-radar.mjs +50 -0
- package/docs/examples/plugins/security-radar.projscan-plugin.json +8 -0
- package/package.json +3 -2
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import chalk from 'chalk';
|
|
2
|
+
import { assertFormatSupported, getRootPath, loadProjectConfig, maybeCompactBanner, program, setupLogLevel, } from '../_shared.js';
|
|
3
|
+
import { scanRepository } from '../../core/repositoryScanner.js';
|
|
4
|
+
import { buildCodeGraph } from '../../core/codeGraph.js';
|
|
5
|
+
import { buildSemanticGraph } from '../../core/semanticGraph.js';
|
|
6
|
+
export function registerSemanticGraph() {
|
|
7
|
+
program
|
|
8
|
+
.command('semantic-graph')
|
|
9
|
+
.description('Render the stable v3 semantic graph for agents and automation')
|
|
10
|
+
.option('--max-nodes <count>', 'maximum graph nodes to return', parsePositiveInt)
|
|
11
|
+
.option('--max-edges <count>', 'maximum graph edges to return', parsePositiveInt)
|
|
12
|
+
.action(async (cmdOpts) => {
|
|
13
|
+
setupLogLevel();
|
|
14
|
+
maybeCompactBanner();
|
|
15
|
+
const format = assertFormatSupported('semantic-graph');
|
|
16
|
+
try {
|
|
17
|
+
const rootPath = getRootPath();
|
|
18
|
+
const config = await loadProjectConfig();
|
|
19
|
+
const scan = await scanRepository(rootPath, { ignore: config.ignore });
|
|
20
|
+
const graph = await buildCodeGraph(rootPath, scan.files);
|
|
21
|
+
const report = buildSemanticGraph(graph, {
|
|
22
|
+
maxNodes: cmdOpts.maxNodes,
|
|
23
|
+
maxEdges: cmdOpts.maxEdges,
|
|
24
|
+
});
|
|
25
|
+
if (format === 'json') {
|
|
26
|
+
console.log(JSON.stringify(report, null, 2));
|
|
27
|
+
return;
|
|
28
|
+
}
|
|
29
|
+
printSemanticGraph(report);
|
|
30
|
+
}
|
|
31
|
+
catch (err) {
|
|
32
|
+
console.error(chalk.red(err instanceof Error ? err.message : String(err)));
|
|
33
|
+
process.exit(1);
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
function printSemanticGraph(report) {
|
|
38
|
+
console.log('');
|
|
39
|
+
console.log(chalk.bold('Semantic graph'));
|
|
40
|
+
console.log(chalk.dim('────────────────────────────────────────'));
|
|
41
|
+
console.log(` Schema: v${report.schemaVersion}`);
|
|
42
|
+
console.log(` Files: ${report.metrics.totalFiles}`);
|
|
43
|
+
console.log(` Functions: ${report.metrics.totalFunctions}`);
|
|
44
|
+
console.log(` Packages: ${report.metrics.totalPackages}`);
|
|
45
|
+
console.log(` Nodes: ${report.nodes.length}${report.truncated ? ' (truncated)' : ''}`);
|
|
46
|
+
console.log(` Edges: ${report.edges.length}`);
|
|
47
|
+
}
|
|
48
|
+
function parsePositiveInt(value) {
|
|
49
|
+
const parsed = Number.parseInt(value, 10);
|
|
50
|
+
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
51
|
+
throw new Error('value must be a positive integer');
|
|
52
|
+
}
|
|
53
|
+
return parsed;
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=semanticGraph.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"semanticGraph.js","sourceRoot":"","sources":["../../../src/cli/commands/semanticGraph.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EACL,qBAAqB,EACrB,WAAW,EACX,iBAAiB,EACjB,kBAAkB,EAClB,OAAO,EACP,aAAa,GACd,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAGjE,MAAM,UAAU,qBAAqB;IACnC,OAAO;SACJ,OAAO,CAAC,gBAAgB,CAAC;SACzB,WAAW,CAAC,+DAA+D,CAAC;SAC5E,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,EAAE,gBAAgB,CAAC;SAChF,MAAM,CAAC,qBAAqB,EAAE,+BAA+B,EAAE,gBAAgB,CAAC;SAChF,MAAM,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE;QACxB,aAAa,EAAE,CAAC;QAChB,kBAAkB,EAAE,CAAC;QACrB,MAAM,MAAM,GAAG,qBAAqB,CAAC,gBAAgB,CAAC,CAAC;QAEvD,IAAI,CAAC;YACH,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;YAC/B,MAAM,MAAM,GAAG,MAAM,iBAAiB,EAAE,CAAC;YACzC,MAAM,IAAI,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC;YACvE,MAAM,KAAK,GAAG,MAAM,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC;YACzD,MAAM,MAAM,GAAG,kBAAkB,CAAC,KAAK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BAAgB,MAAM,CAAC,KAAK,CAAC,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;IAC5F,OAAO,CAAC,GAAG,CAAC,gBAAgB,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1C,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/dist/cli/index.js
CHANGED
|
@@ -24,6 +24,7 @@ import { registerAudit } from './commands/audit.js';
|
|
|
24
24
|
import { registerUpgrade } from './commands/upgrade.js';
|
|
25
25
|
import { registerSearch } from './commands/search.js';
|
|
26
26
|
import { registerCoverage } from './commands/coverage.js';
|
|
27
|
+
import { registerSemanticGraph } from './commands/semanticGraph.js';
|
|
27
28
|
import { registerMcp } from './commands/mcp.js';
|
|
28
29
|
import { registerSession } from './commands/session.js';
|
|
29
30
|
import { registerMemory } from './commands/memory.js';
|
|
@@ -32,6 +33,7 @@ import { registerApplyFix } from './commands/applyFix.js';
|
|
|
32
33
|
import { registerInit } from './commands/init.js';
|
|
33
34
|
import { registerInstallHook } from './commands/installHook.js';
|
|
34
35
|
import { registerTaint } from './commands/taint.js';
|
|
36
|
+
import { registerDataflow } from './commands/dataflow.js';
|
|
35
37
|
import { registerBadge } from './commands/badge.js';
|
|
36
38
|
import { registerPlugin } from './commands/plugin.js';
|
|
37
39
|
import { registerPreflight } from './commands/preflight.js';
|
|
@@ -42,6 +44,7 @@ import { registerEvidencePack } from './commands/evidencePack.js';
|
|
|
42
44
|
import { registerRegressionPlan } from './commands/regressionPlan.js';
|
|
43
45
|
import { registerAgentBrief } from './commands/agentBrief.js';
|
|
44
46
|
import { registerQualityScorecard } from './commands/qualityScorecard.js';
|
|
47
|
+
import { registerFirstRun, registerRecipes } from './commands/recipes.js';
|
|
45
48
|
import { registerHelp } from './commands/help.js';
|
|
46
49
|
registerAnalyze();
|
|
47
50
|
registerDoctor();
|
|
@@ -67,6 +70,7 @@ registerAudit();
|
|
|
67
70
|
registerUpgrade();
|
|
68
71
|
registerSearch();
|
|
69
72
|
registerCoverage();
|
|
73
|
+
registerSemanticGraph();
|
|
70
74
|
registerMcp();
|
|
71
75
|
registerSession();
|
|
72
76
|
registerMemory();
|
|
@@ -75,6 +79,7 @@ registerApplyFix();
|
|
|
75
79
|
registerInit();
|
|
76
80
|
registerInstallHook();
|
|
77
81
|
registerTaint();
|
|
82
|
+
registerDataflow();
|
|
78
83
|
registerBadge();
|
|
79
84
|
registerPlugin();
|
|
80
85
|
registerPreflight();
|
|
@@ -85,6 +90,8 @@ registerEvidencePack();
|
|
|
85
90
|
registerRegressionPlan();
|
|
86
91
|
registerAgentBrief();
|
|
87
92
|
registerQualityScorecard();
|
|
93
|
+
registerRecipes();
|
|
94
|
+
registerFirstRun();
|
|
88
95
|
registerHelp();
|
|
89
96
|
program.parse();
|
|
90
97
|
//# sourceMappingURL=index.js.map
|
package/dist/cli/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cli/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAA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;AACnB,aAAa,EAAE,CAAC;AAChB,eAAe,EAAE,CAAC;AAClB,cAAc,EAAE,CAAC;AACjB,gBAAgB,EAAE,CAAC;AACnB,qBAAqB,EAAE,CAAC;AACxB,WAAW,EAAE,CAAC;AACd,eAAe,EAAE,CAAC;AAClB,cAAc,EAAE,CAAC;AACjB,iBAAiB,EAAE,CAAC;AACpB,gBAAgB,EAAE,CAAC;AACnB,YAAY,EAAE,CAAC;AACf,mBAAmB,EAAE,CAAC;AACtB,aAAa,EAAE,CAAC;AAChB,gBAAgB,EAAE,CAAC;AACnB,aAAa,EAAE,CAAC;AAChB,cAAc,EAAE,CAAC;AACjB,iBAAiB,EAAE,CAAC;AACpB,gBAAgB,EAAE,CAAC;AACnB,oBAAoB,EAAE,CAAC;AACvB,eAAe,EAAE,CAAC;AAClB,oBAAoB,EAAE,CAAC;AACvB,sBAAsB,EAAE,CAAC;AACzB,kBAAkB,EAAE,CAAC;AACrB,wBAAwB,EAAE,CAAC;AAC3B,eAAe,EAAE,CAAC;AAClB,gBAAgB,EAAE,CAAC;AACnB,YAAY,EAAE,CAAC;AAEf,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const MCP_CLIENT_IDS: readonly ["all", "claude-desktop", "claude-code", "cursor", "codex", "continue", "windsurf", "cline", "zed", "gemini"];
|
|
2
|
+
export type McpClientId = (typeof MCP_CLIENT_IDS)[number];
|
|
3
|
+
export type SingleMcpClientId = Exclude<McpClientId, 'all'>;
|
|
4
|
+
export interface McpConfigInstall {
|
|
5
|
+
command: string;
|
|
6
|
+
runWithoutInstall: string;
|
|
7
|
+
mcpServerCommand: string;
|
|
8
|
+
}
|
|
9
|
+
export interface McpConfigGuide {
|
|
10
|
+
schemaVersion: 1;
|
|
11
|
+
client: SingleMcpClientId;
|
|
12
|
+
displayName: string;
|
|
13
|
+
whereToPaste: string;
|
|
14
|
+
install: McpConfigInstall;
|
|
15
|
+
config: Record<string, unknown>;
|
|
16
|
+
configText: string;
|
|
17
|
+
notes: string[];
|
|
18
|
+
}
|
|
19
|
+
export interface McpConfigCatalog {
|
|
20
|
+
schemaVersion: 1;
|
|
21
|
+
client: 'all';
|
|
22
|
+
install: McpConfigInstall;
|
|
23
|
+
configs: McpConfigGuide[];
|
|
24
|
+
}
|
|
25
|
+
export interface AgentWorkflowRecipe {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
useWhen: string;
|
|
29
|
+
outcome: string;
|
|
30
|
+
commands: string[];
|
|
31
|
+
mcpTools: string[];
|
|
32
|
+
handoff: string;
|
|
33
|
+
}
|
|
34
|
+
export interface WorkflowRecipeCatalog {
|
|
35
|
+
schemaVersion: 1;
|
|
36
|
+
recipes: AgentWorkflowRecipe[];
|
|
37
|
+
}
|
|
38
|
+
export type FirstRunStatus = 'pass' | 'warn' | 'fail' | 'info';
|
|
39
|
+
export interface FirstRunDiagnostic {
|
|
40
|
+
id: string;
|
|
41
|
+
label: string;
|
|
42
|
+
status: FirstRunStatus;
|
|
43
|
+
summary: string;
|
|
44
|
+
detail?: string;
|
|
45
|
+
command?: string;
|
|
46
|
+
}
|
|
47
|
+
export interface FirstRunReport {
|
|
48
|
+
schemaVersion: 1;
|
|
49
|
+
rootPath: string;
|
|
50
|
+
overall: FirstRunStatus;
|
|
51
|
+
diagnostics: FirstRunDiagnostic[];
|
|
52
|
+
nextCommands: string[];
|
|
53
|
+
}
|
|
54
|
+
export declare function isMcpClientId(value: unknown): value is McpClientId;
|
|
55
|
+
export declare function getMcpConfigGuide(client?: McpClientId): McpConfigCatalog | McpConfigGuide;
|
|
56
|
+
export declare function getWorkflowRecipes(): WorkflowRecipeCatalog;
|
|
57
|
+
export declare function computeFirstRunDiagnostics(rootPath: string): Promise<FirstRunReport>;
|
|
@@ -0,0 +1,392 @@
|
|
|
1
|
+
import { execFile } from 'node:child_process';
|
|
2
|
+
import fs from 'node:fs/promises';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
5
|
+
import { PLUGIN_PREVIEW_FLAG, discoverPluginManifests } from './plugins.js';
|
|
6
|
+
const execFileAsync = promisify(execFile);
|
|
7
|
+
export const MCP_CLIENT_IDS = [
|
|
8
|
+
'all',
|
|
9
|
+
'claude-desktop',
|
|
10
|
+
'claude-code',
|
|
11
|
+
'cursor',
|
|
12
|
+
'codex',
|
|
13
|
+
'continue',
|
|
14
|
+
'windsurf',
|
|
15
|
+
'cline',
|
|
16
|
+
'zed',
|
|
17
|
+
'gemini',
|
|
18
|
+
];
|
|
19
|
+
const INSTALL = {
|
|
20
|
+
command: 'npm install -g projscan',
|
|
21
|
+
runWithoutInstall: 'npx projscan',
|
|
22
|
+
mcpServerCommand: 'npx -y projscan mcp',
|
|
23
|
+
};
|
|
24
|
+
const SERVER = {
|
|
25
|
+
command: 'npx',
|
|
26
|
+
args: ['-y', 'projscan', 'mcp'],
|
|
27
|
+
};
|
|
28
|
+
const CLIENTS = {
|
|
29
|
+
'claude-desktop': {
|
|
30
|
+
client: 'claude-desktop',
|
|
31
|
+
displayName: 'Claude Desktop',
|
|
32
|
+
whereToPaste: 'Claude Desktop MCP settings JSON.',
|
|
33
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
34
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
35
|
+
notes: ['Restart Claude Desktop after saving the config.'],
|
|
36
|
+
},
|
|
37
|
+
'claude-code': {
|
|
38
|
+
client: 'claude-code',
|
|
39
|
+
displayName: 'Claude Code',
|
|
40
|
+
whereToPaste: 'Claude Code MCP server settings.',
|
|
41
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
42
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
43
|
+
notes: ['Keep projscan as a stdio server so code never leaves the repo.'],
|
|
44
|
+
},
|
|
45
|
+
cursor: {
|
|
46
|
+
client: 'cursor',
|
|
47
|
+
displayName: 'Cursor',
|
|
48
|
+
whereToPaste: 'Cursor MCP settings, usually `.cursor/mcp.json` or Settings > MCP.',
|
|
49
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
50
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
51
|
+
notes: ['Open a repo before invoking projscan tools so the server starts in the project root.'],
|
|
52
|
+
},
|
|
53
|
+
codex: {
|
|
54
|
+
client: 'codex',
|
|
55
|
+
displayName: 'Codex CLI',
|
|
56
|
+
whereToPaste: 'Codex MCP server configuration.',
|
|
57
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
58
|
+
configText: [
|
|
59
|
+
'[mcp_servers.projscan]',
|
|
60
|
+
'command = "npx"',
|
|
61
|
+
'args = ["-y", "projscan", "mcp"]',
|
|
62
|
+
].join('\n'),
|
|
63
|
+
notes: ['Use this as a local stdio MCP server config; no projscan API key is required.'],
|
|
64
|
+
},
|
|
65
|
+
continue: {
|
|
66
|
+
client: 'continue',
|
|
67
|
+
displayName: 'Continue',
|
|
68
|
+
whereToPaste: 'Continue MCP server config.',
|
|
69
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
70
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
71
|
+
notes: ['Use alongside Continue context providers when agents need structured repo evidence.'],
|
|
72
|
+
},
|
|
73
|
+
windsurf: {
|
|
74
|
+
client: 'windsurf',
|
|
75
|
+
displayName: 'Windsurf',
|
|
76
|
+
whereToPaste: 'Windsurf MCP settings.',
|
|
77
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
78
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
79
|
+
notes: ['Run `projscan first-run` in the target repo if tools fail to start.'],
|
|
80
|
+
},
|
|
81
|
+
cline: {
|
|
82
|
+
client: 'cline',
|
|
83
|
+
displayName: 'Cline',
|
|
84
|
+
whereToPaste: 'Cline MCP settings JSON.',
|
|
85
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
86
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
87
|
+
notes: ['Keep the command as `npx` so Cline can launch the published server directly.'],
|
|
88
|
+
},
|
|
89
|
+
zed: {
|
|
90
|
+
client: 'zed',
|
|
91
|
+
displayName: 'Zed',
|
|
92
|
+
whereToPaste: 'Zed assistant MCP/context server settings.',
|
|
93
|
+
config: { context_servers: { projscan: SERVER } },
|
|
94
|
+
configText: JSON.stringify({ context_servers: { projscan: SERVER } }, null, 2),
|
|
95
|
+
notes: ['If your Zed build expects `mcpServers`, use the generic MCP JSON from `--client all`.'],
|
|
96
|
+
},
|
|
97
|
+
gemini: {
|
|
98
|
+
client: 'gemini',
|
|
99
|
+
displayName: 'Gemini CLI',
|
|
100
|
+
whereToPaste: 'Gemini CLI MCP settings.',
|
|
101
|
+
config: { mcpServers: { projscan: SERVER } },
|
|
102
|
+
configText: JSON.stringify({ mcpServers: { projscan: SERVER } }, null, 2),
|
|
103
|
+
notes: ['Use `npx -y projscan mcp` as the stdio server command.'],
|
|
104
|
+
},
|
|
105
|
+
};
|
|
106
|
+
export function isMcpClientId(value) {
|
|
107
|
+
return typeof value === 'string' && MCP_CLIENT_IDS.includes(value);
|
|
108
|
+
}
|
|
109
|
+
export function getMcpConfigGuide(client = 'all') {
|
|
110
|
+
if (client === 'all') {
|
|
111
|
+
return {
|
|
112
|
+
schemaVersion: 1,
|
|
113
|
+
client: 'all',
|
|
114
|
+
install: INSTALL,
|
|
115
|
+
configs: MCP_CLIENT_IDS.filter((id) => id !== 'all').map((id) => buildGuide(id)),
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return buildGuide(client);
|
|
119
|
+
}
|
|
120
|
+
export function getWorkflowRecipes() {
|
|
121
|
+
return {
|
|
122
|
+
schemaVersion: 1,
|
|
123
|
+
recipes: [
|
|
124
|
+
{
|
|
125
|
+
id: 'before_edit',
|
|
126
|
+
name: 'Before Edit',
|
|
127
|
+
useWhen: 'Start here before an agent changes code.',
|
|
128
|
+
outcome: 'A proceed/caution/block gate plus the next tool calls that explain any risk.',
|
|
129
|
+
commands: [
|
|
130
|
+
'projscan preflight --mode before_edit --format json',
|
|
131
|
+
'projscan workplan --mode before_edit --format json',
|
|
132
|
+
],
|
|
133
|
+
mcpTools: ['projscan_preflight', 'projscan_workplan'],
|
|
134
|
+
handoff: 'If preflight returns caution or block, follow suggestedNextActions before editing.',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
id: 'bug_hunt',
|
|
138
|
+
name: 'Bug Hunt',
|
|
139
|
+
useWhen: 'Run a focused polish or stabilization pass.',
|
|
140
|
+
outcome: 'A ranked fix queue with evidence and verification commands.',
|
|
141
|
+
commands: [
|
|
142
|
+
'projscan bug-hunt --format json',
|
|
143
|
+
'projscan quality-scorecard --format json',
|
|
144
|
+
'projscan regression-plan --level focused --format json',
|
|
145
|
+
],
|
|
146
|
+
mcpTools: ['projscan_bug_hunt', 'projscan_quality_scorecard', 'projscan_regression_plan'],
|
|
147
|
+
handoff: 'Fix top-ranked targets first, then rerun the regression plan.',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
id: 'release_approval',
|
|
151
|
+
name: 'Release Approval',
|
|
152
|
+
useWhen: 'Prepare a maintainer or CI environment approval packet.',
|
|
153
|
+
outcome: 'Version readiness, risks, regression commands, and website update copy in one loop.',
|
|
154
|
+
commands: [
|
|
155
|
+
'projscan release-train --format json',
|
|
156
|
+
'projscan evidence-pack --website-prompt --format json',
|
|
157
|
+
'projscan regression-plan --level full --format json',
|
|
158
|
+
],
|
|
159
|
+
mcpTools: ['projscan_release_train', 'projscan_evidence_pack', 'projscan_regression_plan'],
|
|
160
|
+
handoff: 'Use the evidence pack as the approval artifact; do not skip the full release gate.',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
id: 'handoff',
|
|
164
|
+
name: 'Agent Handoff',
|
|
165
|
+
useWhen: 'Compress repo context for the next agent or a resumed session.',
|
|
166
|
+
outcome: 'A compact brief with focus items, guardrails, and suggested next actions.',
|
|
167
|
+
commands: [
|
|
168
|
+
'projscan agent-brief --intent handoff --format json',
|
|
169
|
+
'projscan handoff --format json',
|
|
170
|
+
],
|
|
171
|
+
mcpTools: ['projscan_agent_brief', 'projscan_workplan'],
|
|
172
|
+
handoff: 'Paste the brief into the next agent session before asking it to edit.',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
id: 'pre_merge',
|
|
176
|
+
name: 'Pre-Merge',
|
|
177
|
+
useWhen: 'Check a branch before merge or release tagging.',
|
|
178
|
+
outcome: 'Changed-file health, review verdict, taint flow evidence, and required checks.',
|
|
179
|
+
commands: [
|
|
180
|
+
'projscan preflight --mode before_merge --format json',
|
|
181
|
+
'projscan review --format json',
|
|
182
|
+
'projscan regression-plan --level smoke --format json',
|
|
183
|
+
],
|
|
184
|
+
mcpTools: ['projscan_preflight', 'projscan_review', 'projscan_regression_plan'],
|
|
185
|
+
handoff: 'Treat block as a hard stop and caution as a request for explicit review.',
|
|
186
|
+
},
|
|
187
|
+
],
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
export async function computeFirstRunDiagnostics(rootPath) {
|
|
191
|
+
const diagnostics = [
|
|
192
|
+
checkNodeVersion(),
|
|
193
|
+
await checkPackageJson(rootPath),
|
|
194
|
+
await checkGit(rootPath),
|
|
195
|
+
await checkConfig(rootPath),
|
|
196
|
+
await checkTreeSitter(rootPath),
|
|
197
|
+
await checkPlugins(rootPath),
|
|
198
|
+
checkMcpStartup(),
|
|
199
|
+
];
|
|
200
|
+
const overall = summarizeDiagnostics(diagnostics);
|
|
201
|
+
return {
|
|
202
|
+
schemaVersion: 1,
|
|
203
|
+
rootPath,
|
|
204
|
+
overall,
|
|
205
|
+
diagnostics,
|
|
206
|
+
nextCommands: [
|
|
207
|
+
'projscan init mcp --client all',
|
|
208
|
+
'projscan recipes',
|
|
209
|
+
'projscan preflight --mode before_edit --format json',
|
|
210
|
+
'projscan doctor',
|
|
211
|
+
],
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
function buildGuide(client) {
|
|
215
|
+
return {
|
|
216
|
+
schemaVersion: 1,
|
|
217
|
+
install: INSTALL,
|
|
218
|
+
...CLIENTS[client],
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
function checkNodeVersion() {
|
|
222
|
+
const major = Number.parseInt(process.versions.node.split('.')[0] ?? '0', 10);
|
|
223
|
+
if (Number.isFinite(major) && major >= 18) {
|
|
224
|
+
return {
|
|
225
|
+
id: 'node',
|
|
226
|
+
label: 'Node.js',
|
|
227
|
+
status: 'pass',
|
|
228
|
+
summary: `Node ${process.versions.node} satisfies projscan's >=18 requirement.`,
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
return {
|
|
232
|
+
id: 'node',
|
|
233
|
+
label: 'Node.js',
|
|
234
|
+
status: 'fail',
|
|
235
|
+
summary: `Node ${process.versions.node} is below projscan's >=18 requirement.`,
|
|
236
|
+
command: 'node --version',
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
async function checkPackageJson(rootPath) {
|
|
240
|
+
const file = path.join(rootPath, 'package.json');
|
|
241
|
+
try {
|
|
242
|
+
const raw = await fs.readFile(file, 'utf-8');
|
|
243
|
+
const parsed = JSON.parse(raw);
|
|
244
|
+
const name = typeof parsed.name === 'string' ? parsed.name : path.basename(rootPath);
|
|
245
|
+
const scripts = parsed.scripts && typeof parsed.scripts === 'object' ? Object.keys(parsed.scripts).length : 0;
|
|
246
|
+
return {
|
|
247
|
+
id: 'package-json',
|
|
248
|
+
label: 'Package metadata',
|
|
249
|
+
status: 'pass',
|
|
250
|
+
summary: `Found package.json for ${name}.`,
|
|
251
|
+
detail: scripts > 0 ? `${scripts} npm script(s) detected for release/test recipes.` : 'No npm scripts detected.',
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
catch (err) {
|
|
255
|
+
return {
|
|
256
|
+
id: 'package-json',
|
|
257
|
+
label: 'Package metadata',
|
|
258
|
+
status: 'warn',
|
|
259
|
+
summary: 'No readable package.json found; Node dependency and script checks will be limited.',
|
|
260
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function checkGit(rootPath) {
|
|
265
|
+
try {
|
|
266
|
+
const inside = await git(rootPath, ['rev-parse', '--is-inside-work-tree']);
|
|
267
|
+
if (inside.stdout.trim() !== 'true') {
|
|
268
|
+
return {
|
|
269
|
+
id: 'git',
|
|
270
|
+
label: 'Git',
|
|
271
|
+
status: 'warn',
|
|
272
|
+
summary: 'This directory is not inside a Git worktree.',
|
|
273
|
+
detail: 'Review, changed-file, and pre-merge recipes need Git history.',
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
const status = await git(rootPath, ['status', '--short']);
|
|
277
|
+
const remote = await git(rootPath, ['remote']);
|
|
278
|
+
const dirty = status.stdout.trim().length > 0;
|
|
279
|
+
return {
|
|
280
|
+
id: 'git',
|
|
281
|
+
label: 'Git',
|
|
282
|
+
status: dirty ? 'warn' : 'pass',
|
|
283
|
+
summary: dirty ? 'Git worktree has local changes.' : 'Git worktree detected and clean.',
|
|
284
|
+
detail: remote.stdout.trim().length > 0 ? `Remotes: ${remote.stdout.trim().split(/\s+/).join(', ')}` : 'No git remote configured.',
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
catch (err) {
|
|
288
|
+
return {
|
|
289
|
+
id: 'git',
|
|
290
|
+
label: 'Git',
|
|
291
|
+
status: 'warn',
|
|
292
|
+
summary: 'Git metadata is unavailable.',
|
|
293
|
+
detail: err instanceof Error ? err.message : String(err),
|
|
294
|
+
command: 'git status --short',
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
async function checkConfig(rootPath) {
|
|
299
|
+
try {
|
|
300
|
+
await fs.access(path.join(rootPath, '.projscanrc.json'));
|
|
301
|
+
return {
|
|
302
|
+
id: 'projscan-config',
|
|
303
|
+
label: 'projscan config',
|
|
304
|
+
status: 'pass',
|
|
305
|
+
summary: 'Found .projscanrc.json.',
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
catch {
|
|
309
|
+
return {
|
|
310
|
+
id: 'projscan-config',
|
|
311
|
+
label: 'projscan config',
|
|
312
|
+
status: 'info',
|
|
313
|
+
summary: 'No .projscanrc.json yet; defaults are fine for first use.',
|
|
314
|
+
command: 'projscan init',
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
async function checkTreeSitter(rootPath) {
|
|
319
|
+
const candidates = [
|
|
320
|
+
path.join(rootPath, 'node_modules', 'web-tree-sitter', 'tree-sitter.wasm'),
|
|
321
|
+
path.join(rootPath, 'dist', 'grammars', 'web-tree-sitter.wasm'),
|
|
322
|
+
];
|
|
323
|
+
for (const candidate of candidates) {
|
|
324
|
+
try {
|
|
325
|
+
await fs.access(candidate);
|
|
326
|
+
return {
|
|
327
|
+
id: 'tree-sitter',
|
|
328
|
+
label: 'Tree-sitter runtime',
|
|
329
|
+
status: 'pass',
|
|
330
|
+
summary: 'Tree-sitter WASM runtime is present.',
|
|
331
|
+
};
|
|
332
|
+
}
|
|
333
|
+
catch {
|
|
334
|
+
// try next
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
return {
|
|
338
|
+
id: 'tree-sitter',
|
|
339
|
+
label: 'Tree-sitter runtime',
|
|
340
|
+
status: 'info',
|
|
341
|
+
summary: 'Tree-sitter runtime was not found in this project checkout.',
|
|
342
|
+
detail: 'This is normal when using npx; projscan ships its runtime with the package.',
|
|
343
|
+
};
|
|
344
|
+
}
|
|
345
|
+
async function checkPlugins(rootPath) {
|
|
346
|
+
const entries = await discoverPluginManifests(rootPath);
|
|
347
|
+
if (entries.length === 0) {
|
|
348
|
+
return {
|
|
349
|
+
id: 'plugins',
|
|
350
|
+
label: 'Local plugins',
|
|
351
|
+
status: 'info',
|
|
352
|
+
summary: 'No local plugin manifests found.',
|
|
353
|
+
detail: `Set ${PLUGIN_PREVIEW_FLAG}=1 only when you want projscan to execute trusted local plugins.`,
|
|
354
|
+
command: 'projscan plugin init --kind analyzer --name policy',
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
const broken = entries.filter((entry) => entry.manifest === null);
|
|
358
|
+
return {
|
|
359
|
+
id: 'plugins',
|
|
360
|
+
label: 'Local plugins',
|
|
361
|
+
status: broken.length > 0 ? 'warn' : 'pass',
|
|
362
|
+
summary: broken.length > 0
|
|
363
|
+
? `${broken.length} of ${entries.length} plugin manifest(s) need attention.`
|
|
364
|
+
: `${entries.length} plugin manifest(s) validate.`,
|
|
365
|
+
command: 'projscan plugin list',
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function checkMcpStartup() {
|
|
369
|
+
return {
|
|
370
|
+
id: 'mcp-startup',
|
|
371
|
+
label: 'MCP startup',
|
|
372
|
+
status: 'pass',
|
|
373
|
+
summary: 'Use stdio startup for every MCP client.',
|
|
374
|
+
detail: INSTALL.mcpServerCommand,
|
|
375
|
+
command: 'npx -y projscan mcp',
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
function summarizeDiagnostics(diagnostics) {
|
|
379
|
+
if (diagnostics.some((diagnostic) => diagnostic.status === 'fail'))
|
|
380
|
+
return 'fail';
|
|
381
|
+
if (diagnostics.some((diagnostic) => diagnostic.status === 'warn'))
|
|
382
|
+
return 'warn';
|
|
383
|
+
return 'pass';
|
|
384
|
+
}
|
|
385
|
+
async function git(rootPath, args) {
|
|
386
|
+
return execFileAsync('git', args, {
|
|
387
|
+
cwd: rootPath,
|
|
388
|
+
timeout: 5000,
|
|
389
|
+
maxBuffer: 1024 * 1024,
|
|
390
|
+
});
|
|
391
|
+
}
|
|
392
|
+
//# sourceMappingURL=adoption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adoption.js","sourceRoot":"","sources":["../../src/core/adoption.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,o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ED,KAAK,UAAU,GAAG,CAAC,QAAgB,EAAE,IAAc;IACjD,OAAO,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE;QAChC,GAAG,EAAE,QAAQ;QACb,OAAO,EAAE,IAAI;QACb,SAAS,EAAE,IAAI,GAAG,IAAI;KACvB,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { CodeGraph } from './codeGraph.js';
|
|
2
|
+
import { type TaintConfig } from './taint.js';
|
|
3
|
+
import type { DataflowReport } from '../types.js';
|
|
4
|
+
export interface DataflowOptions {
|
|
5
|
+
maxDepth?: number;
|
|
6
|
+
}
|
|
7
|
+
export declare function computeDataflow(graph: CodeGraph, config?: TaintConfig, options?: DataflowOptions): DataflowReport;
|