projscan 3.8.0 → 4.1.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 +337 -38
- package/dist/cli/commands/route.js +1 -0
- package/dist/cli/commands/route.js.map +1 -1
- package/dist/cli/commands/semanticGraph.js +27 -0
- package/dist/cli/commands/semanticGraph.js.map +1 -1
- package/dist/cli/commands/start.js +74 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/index.js +0 -2
- package/dist/cli/index.js.map +1 -1
- package/dist/core/dependencyAnalyzer.js +172 -0
- package/dist/core/dependencyAnalyzer.js.map +1 -1
- package/dist/core/fixSuggest.js +5 -5
- package/dist/core/fixSuggest.js.map +1 -1
- package/dist/core/graphQuery.d.ts +23 -0
- package/dist/core/graphQuery.js +48 -0
- package/dist/core/graphQuery.js.map +1 -0
- package/dist/core/intentRouter.d.ts +8 -1
- package/dist/core/intentRouter.js +2186 -22
- package/dist/core/intentRouter.js.map +1 -1
- package/dist/core/issueEngine.js +6 -7
- package/dist/core/issueEngine.js.map +1 -1
- package/dist/core/onboarding.d.ts +2 -2
- package/dist/core/onboarding.js +29 -5
- package/dist/core/onboarding.js.map +1 -1
- package/dist/core/start.d.ts +1 -0
- package/dist/core/start.js +2010 -10
- package/dist/core/start.js.map +1 -1
- package/dist/mcp/server.d.ts +1 -1
- package/dist/mcp/server.js +14 -5
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/costSummary.js +0 -2
- package/dist/mcp/tools/costSummary.js.map +1 -1
- package/dist/mcp/tools/semanticGraph.js +28 -3
- package/dist/mcp/tools/semanticGraph.js.map +1 -1
- package/dist/mcp/tools/start.js +6 -1
- package/dist/mcp/tools/start.js.map +1 -1
- package/dist/mcp/tools.js +0 -4
- package/dist/mcp/tools.js.map +1 -1
- package/dist/projscan-sbom.cdx.json +6 -6
- package/dist/reporters/consoleReporter.js +19 -0
- package/dist/reporters/consoleReporter.js.map +1 -1
- package/dist/reporters/markdownReporter.js +19 -0
- package/dist/reporters/markdownReporter.js.map +1 -1
- package/dist/tool-manifest.json +41 -60
- package/dist/types.d.ts +83 -0
- package/docs/GUIDE.md +1565 -0
- package/docs/ROADMAP.md +219 -0
- package/docs/demos/projscan-4-1-demo.html +648 -0
- package/docs/projscan-mission-control.png +0 -0
- package/docs/projscan-proof-router.png +0 -0
- package/package.json +8 -1
- package/scripts/capture-readme-assets.mjs +60 -0
- package/dist/cli/commands/explain.d.ts +0 -1
- package/dist/cli/commands/explain.js +0 -48
- package/dist/cli/commands/explain.js.map +0 -1
- package/dist/mcp/tools/explain.d.ts +0 -2
- package/dist/mcp/tools/explain.js +0 -34
- package/dist/mcp/tools/explain.js.map +0 -1
- package/dist/mcp/tools/graph.d.ts +0 -2
- package/dist/mcp/tools/graph.js +0 -79
- package/dist/mcp/tools/graph.js.map +0 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Targeted code-graph queries (4.0 consolidation).
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the (removed) `projscan_graph` tool so the capability lives in
|
|
5
|
+
* one tested place and folds into `projscan_semantic_graph` — which previously
|
|
6
|
+
* only dumped the whole graph. This is what makes semantic_graph a true
|
|
7
|
+
* superset of the old graph tool: it answers the same targeted "who imports X",
|
|
8
|
+
* "what does X export", "where is symbol S defined" questions without serializing
|
|
9
|
+
* the entire graph.
|
|
10
|
+
*/
|
|
11
|
+
import { type CodeGraph } from './codeGraph.js';
|
|
12
|
+
export type GraphQueryDirection = 'imports' | 'exports' | 'importers' | 'symbol_defs' | 'package_importers';
|
|
13
|
+
export interface GraphQueryInput {
|
|
14
|
+
direction: GraphQueryDirection;
|
|
15
|
+
/** Repo-relative file path (for imports/exports/importers). */
|
|
16
|
+
file?: string;
|
|
17
|
+
/** Symbol or package name (for symbol_defs/package_importers). */
|
|
18
|
+
symbol?: string;
|
|
19
|
+
/** Max entries returned (1–500, default 50). */
|
|
20
|
+
limit?: number;
|
|
21
|
+
}
|
|
22
|
+
/** Run one targeted query against a built code graph. Throws on missing args. */
|
|
23
|
+
export declare function runGraphQuery(graph: CodeGraph, input: GraphQueryInput): Record<string, unknown>;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Targeted code-graph queries (4.0 consolidation).
|
|
3
|
+
*
|
|
4
|
+
* Extracted from the (removed) `projscan_graph` tool so the capability lives in
|
|
5
|
+
* one tested place and folds into `projscan_semantic_graph` — which previously
|
|
6
|
+
* only dumped the whole graph. This is what makes semantic_graph a true
|
|
7
|
+
* superset of the old graph tool: it answers the same targeted "who imports X",
|
|
8
|
+
* "what does X export", "where is symbol S defined" questions without serializing
|
|
9
|
+
* the entire graph.
|
|
10
|
+
*/
|
|
11
|
+
import { filesImportingFile, filesImportingPackage, filesDefiningSymbol, exportsOf, importsOf, } from './codeGraph.js';
|
|
12
|
+
const DEFAULT_LIMIT = 50;
|
|
13
|
+
/** Run one targeted query against a built code graph. Throws on missing args. */
|
|
14
|
+
export function runGraphQuery(graph, input) {
|
|
15
|
+
const { direction, file, symbol } = input;
|
|
16
|
+
const limit = Math.max(1, Math.min(500, typeof input.limit === 'number' ? input.limit : DEFAULT_LIMIT));
|
|
17
|
+
switch (direction) {
|
|
18
|
+
case 'imports': {
|
|
19
|
+
if (!file)
|
|
20
|
+
throw new Error('direction=imports requires a `file` argument (repo-relative path, e.g. "src/auth.ts").');
|
|
21
|
+
return { file, imports: importsOf(graph, file).slice(0, limit) };
|
|
22
|
+
}
|
|
23
|
+
case 'exports': {
|
|
24
|
+
if (!file)
|
|
25
|
+
throw new Error('direction=exports requires a `file` argument (repo-relative path).');
|
|
26
|
+
return { file, exports: exportsOf(graph, file).slice(0, limit) };
|
|
27
|
+
}
|
|
28
|
+
case 'importers': {
|
|
29
|
+
if (!file)
|
|
30
|
+
throw new Error('direction=importers requires a `file` argument (repo-relative path).');
|
|
31
|
+
return { file, importers: filesImportingFile(graph, file).slice(0, limit) };
|
|
32
|
+
}
|
|
33
|
+
case 'symbol_defs': {
|
|
34
|
+
if (!symbol)
|
|
35
|
+
throw new Error('direction=symbol_defs requires a `symbol` argument (the exported name, e.g. "authenticate").');
|
|
36
|
+
return { symbol, definedIn: filesDefiningSymbol(graph, symbol).slice(0, limit) };
|
|
37
|
+
}
|
|
38
|
+
case 'package_importers': {
|
|
39
|
+
const pkg = symbol ?? file;
|
|
40
|
+
if (!pkg)
|
|
41
|
+
throw new Error('direction=package_importers requires a `symbol` (or `file`) arg (the npm package name, e.g. "chalk").');
|
|
42
|
+
return { package: pkg, importers: filesImportingPackage(graph, pkg).slice(0, limit) };
|
|
43
|
+
}
|
|
44
|
+
default:
|
|
45
|
+
throw new Error(`unknown direction "${String(direction)}". Valid: imports, exports, importers, symbol_defs, package_importers.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=graphQuery.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphQuery.js","sourceRoot":"","sources":["../../src/core/graphQuery.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EACL,kBAAkB,EAClB,qBAAqB,EACrB,mBAAmB,EACnB,SAAS,EACT,SAAS,GAEV,MAAM,gBAAgB,CAAC;AAmBxB,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,iFAAiF;AACjF,MAAM,UAAU,aAAa,CAAC,KAAgB,EAAE,KAAsB;IACpE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,KAAK,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC;IAExG,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,SAAS,CAAC,C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KAAK,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QACxF,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,sBAAsB,MAAM,CAAC,SAAS,CAAC,wEAAwE,CAAC,CAAC;IACrI,CAAC;AACH,CAAC"}
|
|
@@ -26,10 +26,17 @@ export interface RouteEntry {
|
|
|
26
26
|
/** Terms that signal this intent. */
|
|
27
27
|
keywords: string[];
|
|
28
28
|
}
|
|
29
|
+
export type RouteConfidence = 'high' | 'medium' | 'low';
|
|
30
|
+
export interface RouteMatch extends RouteEntry {
|
|
31
|
+
score: number;
|
|
32
|
+
rank: number;
|
|
33
|
+
confidence: RouteConfidence;
|
|
34
|
+
matchedKeywords: string[];
|
|
35
|
+
}
|
|
29
36
|
export interface RouteResult {
|
|
30
37
|
intent: string | null;
|
|
31
38
|
matched: boolean;
|
|
32
|
-
matches:
|
|
39
|
+
matches: RouteMatch[];
|
|
33
40
|
}
|
|
34
41
|
export declare const ROUTE_CATALOG: RouteEntry[];
|
|
35
42
|
/**
|