@vyuhlabs/dxkit 2.6.0 → 2.7.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/CHANGELOG.md +54 -13
- package/README.md +208 -459
- package/dist/analyzers/bom/discovery.d.ts +3 -4
- package/dist/analyzers/bom/discovery.d.ts.map +1 -1
- package/dist/analyzers/bom/discovery.js +3 -4
- package/dist/analyzers/bom/discovery.js.map +1 -1
- package/dist/analyzers/bom/types.d.ts +1 -1
- package/dist/analyzers/dashboard/index.d.ts.map +1 -1
- package/dist/analyzers/dashboard/index.js +42 -5
- package/dist/analyzers/dashboard/index.js.map +1 -1
- package/dist/analyzers/quality/detailed.d.ts +8 -1
- package/dist/analyzers/quality/detailed.d.ts.map +1 -1
- package/dist/analyzers/quality/detailed.js +43 -10
- package/dist/analyzers/quality/detailed.js.map +1 -1
- package/dist/analyzers/security/detailed.d.ts +8 -1
- package/dist/analyzers/security/detailed.d.ts.map +1 -1
- package/dist/analyzers/security/detailed.js +14 -1
- package/dist/analyzers/security/detailed.js.map +1 -1
- package/dist/analyzers/tests/detailed.d.ts +8 -1
- package/dist/analyzers/tests/detailed.d.ts.map +1 -1
- package/dist/analyzers/tests/detailed.js +26 -7
- package/dist/analyzers/tests/detailed.js.map +1 -1
- package/dist/analyzers/tools/cloc.js +3 -3
- package/dist/analyzers/tools/cloc.js.map +1 -1
- package/dist/analyzers/tools/exclusions.d.ts +12 -12
- package/dist/analyzers/tools/exclusions.d.ts.map +1 -1
- package/dist/analyzers/tools/exclusions.js +27 -13
- package/dist/analyzers/tools/exclusions.js.map +1 -1
- package/dist/analyzers/tools/graphify.d.ts +39 -5
- package/dist/analyzers/tools/graphify.d.ts.map +1 -1
- package/dist/analyzers/tools/graphify.js +609 -45
- package/dist/analyzers/tools/graphify.js.map +1 -1
- package/dist/analyzers/tools/nuget-package-reference.d.ts +4 -4
- package/dist/analyzers/tools/nuget-package-reference.js +4 -4
- package/dist/analyzers/tools/osv-scanner-fix.d.ts +4 -5
- package/dist/analyzers/tools/osv-scanner-fix.d.ts.map +1 -1
- package/dist/analyzers/tools/osv-scanner-fix.js +4 -5
- package/dist/analyzers/tools/osv-scanner-fix.js.map +1 -1
- package/dist/analyzers/tools/parallel.d.ts.map +1 -1
- package/dist/analyzers/tools/parallel.js +7 -0
- package/dist/analyzers/tools/parallel.js.map +1 -1
- package/dist/analyzers/tools/vendored-advisor.d.ts.map +1 -1
- package/dist/analyzers/tools/vendored-advisor.js +3 -4
- package/dist/analyzers/tools/vendored-advisor.js.map +1 -1
- package/dist/analyzers/xlsx/licenses.d.ts +7 -7
- package/dist/analyzers/xlsx/licenses.js +7 -7
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +80 -3
- package/dist/cli.js.map +1 -1
- package/dist/dashboard/graph-adapter.d.ts +151 -0
- package/dist/dashboard/graph-adapter.d.ts.map +1 -0
- package/dist/dashboard/graph-adapter.js +415 -0
- package/dist/dashboard/graph-adapter.js.map +1 -0
- package/dist/dashboard/graph-tab.d.ts +109 -0
- package/dist/dashboard/graph-tab.d.ts.map +1 -0
- package/dist/dashboard/graph-tab.js +297 -0
- package/dist/dashboard/graph-tab.js.map +1 -0
- package/dist/dashboard/vendor/vis-network.min.js +34 -0
- package/dist/explore/cli/api-surface.d.ts +12 -0
- package/dist/explore/cli/api-surface.d.ts.map +1 -0
- package/dist/explore/cli/api-surface.js +57 -0
- package/dist/explore/cli/api-surface.js.map +1 -0
- package/dist/explore/cli/communities.d.ts +10 -0
- package/dist/explore/cli/communities.d.ts.map +1 -0
- package/dist/explore/cli/communities.js +47 -0
- package/dist/explore/cli/communities.js.map +1 -0
- package/dist/explore/cli/context.d.ts +16 -0
- package/dist/explore/cli/context.d.ts.map +1 -0
- package/dist/explore/cli/context.js +118 -0
- package/dist/explore/cli/context.js.map +1 -0
- package/dist/explore/cli/entry-points.d.ts +12 -0
- package/dist/explore/cli/entry-points.d.ts.map +1 -0
- package/dist/explore/cli/entry-points.js +85 -0
- package/dist/explore/cli/entry-points.js.map +1 -0
- package/dist/explore/cli/feature.d.ts +16 -0
- package/dist/explore/cli/feature.d.ts.map +1 -0
- package/dist/explore/cli/feature.js +89 -0
- package/dist/explore/cli/feature.js.map +1 -0
- package/dist/explore/cli/file.d.ts +12 -0
- package/dist/explore/cli/file.d.ts.map +1 -0
- package/dist/explore/cli/file.js +139 -0
- package/dist/explore/cli/file.js.map +1 -0
- package/dist/explore/cli/hot-files.d.ts +11 -0
- package/dist/explore/cli/hot-files.d.ts.map +1 -0
- package/dist/explore/cli/hot-files.js +63 -0
- package/dist/explore/cli/hot-files.js.map +1 -0
- package/dist/explore/context-hook.d.ts +42 -0
- package/dist/explore/context-hook.d.ts.map +1 -0
- package/dist/explore/context-hook.js +131 -0
- package/dist/explore/context-hook.js.map +1 -0
- package/dist/explore/finding-context.d.ts +69 -0
- package/dist/explore/finding-context.d.ts.map +1 -0
- package/dist/explore/finding-context.js +102 -0
- package/dist/explore/finding-context.js.map +1 -0
- package/dist/explore/format.d.ts +64 -0
- package/dist/explore/format.d.ts.map +1 -0
- package/dist/explore/format.js +99 -0
- package/dist/explore/format.js.map +1 -0
- package/dist/explore/load.d.ts +50 -0
- package/dist/explore/load.d.ts.map +1 -0
- package/dist/explore/load.js +197 -0
- package/dist/explore/load.js.map +1 -0
- package/dist/explore/queries.d.ts +413 -0
- package/dist/explore/queries.d.ts.map +1 -0
- package/dist/explore/queries.js +855 -0
- package/dist/explore/queries.js.map +1 -0
- package/dist/explore/types.d.ts +130 -0
- package/dist/explore/types.d.ts.map +1 -0
- package/dist/explore/types.js +28 -0
- package/dist/explore/types.js.map +1 -0
- package/dist/explore-cli.d.ts +45 -0
- package/dist/explore-cli.d.ts.map +1 -0
- package/dist/explore-cli.js +213 -0
- package/dist/explore-cli.js.map +1 -0
- package/dist/generator.d.ts.map +1 -1
- package/dist/generator.js +19 -0
- package/dist/generator.js.map +1 -1
- package/dist/languages/csharp.d.ts.map +1 -1
- package/dist/languages/csharp.js +31 -11
- package/dist/languages/csharp.js.map +1 -1
- package/dist/languages/go.d.ts.map +1 -1
- package/dist/languages/go.js +4 -0
- package/dist/languages/go.js.map +1 -1
- package/dist/languages/index.d.ts +27 -0
- package/dist/languages/index.d.ts.map +1 -1
- package/dist/languages/index.js +35 -0
- package/dist/languages/index.js.map +1 -1
- package/dist/languages/java.d.ts.map +1 -1
- package/dist/languages/java.js +4 -0
- package/dist/languages/java.js.map +1 -1
- package/dist/languages/kotlin.d.ts.map +1 -1
- package/dist/languages/kotlin.js +4 -0
- package/dist/languages/kotlin.js.map +1 -1
- package/dist/languages/python.d.ts.map +1 -1
- package/dist/languages/python.js +4 -0
- package/dist/languages/python.js.map +1 -1
- package/dist/languages/ruby.d.ts.map +1 -1
- package/dist/languages/ruby.js +4 -0
- package/dist/languages/ruby.js.map +1 -1
- package/dist/languages/rust.d.ts.map +1 -1
- package/dist/languages/rust.js +4 -0
- package/dist/languages/rust.js.map +1 -1
- package/dist/languages/types.d.ts +54 -0
- package/dist/languages/types.d.ts.map +1 -1
- package/dist/languages/typescript.d.ts.map +1 -1
- package/dist/languages/typescript.js +5 -1
- package/dist/languages/typescript.js.map +1 -1
- package/package.json +2 -1
- package/templates/.claude/skills/dxkit-action/SKILL.md +21 -1
- package/templates/.claude/skills/dxkit-reports/SKILL.md +3 -1
- package/templates/AGENTS.md.template +8 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vyuh-dxkit explore api-surface` — exported symbols with no
|
|
3
|
+
* internal callers (likely public API or CLI entry points).
|
|
4
|
+
*
|
|
5
|
+
* Reads per-pack exportDetection reliability from the canonical
|
|
6
|
+
* registry helper. Packs declared 'unreliable' (today: ruby) are
|
|
7
|
+
* excluded with an explanatory note.
|
|
8
|
+
*/
|
|
9
|
+
import type { Graph } from '../types';
|
|
10
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
11
|
+
export declare function runApiSurface(graph: Graph, _positionals: ReadonlyArray<string>, values: ExploreCliValues): void;
|
|
12
|
+
//# sourceMappingURL=api-surface.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-surface.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/api-surface.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAgB,aAAa,CAC3B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,EACnC,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAuDN"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `vyuh-dxkit explore api-surface` — exported symbols with no
|
|
4
|
+
* internal callers (likely public API or CLI entry points).
|
|
5
|
+
*
|
|
6
|
+
* Reads per-pack exportDetection reliability from the canonical
|
|
7
|
+
* registry helper. Packs declared 'unreliable' (today: ruby) are
|
|
8
|
+
* excluded with an explanatory note.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.runApiSurface = runApiSurface;
|
|
12
|
+
const languages_1 = require("../../languages");
|
|
13
|
+
const queries_1 = require("../queries");
|
|
14
|
+
const format_1 = require("../format");
|
|
15
|
+
const DEFAULT_LIMIT = 25;
|
|
16
|
+
function runApiSurface(graph, _positionals, values) {
|
|
17
|
+
const limit = parseLimit(values.limit, DEFAULT_LIMIT);
|
|
18
|
+
const declarations = (0, languages_1.allExportDetectionDeclarations)();
|
|
19
|
+
const unreliablePacks = declarations
|
|
20
|
+
.filter((d) => d.reliability === 'unreliable')
|
|
21
|
+
.map((d) => ({ pack: d.pack, strategy: d.strategy }));
|
|
22
|
+
const packsExcluded = unreliablePacks.map((u) => u.pack);
|
|
23
|
+
const results = (0, queries_1.apiSurfaceQuery)(graph, packsExcluded, limit);
|
|
24
|
+
if (values.json) {
|
|
25
|
+
(0, format_1.printJson)((0, format_1.envelope)('explore.api-surface', { limit, excluded: unreliablePacks }, graph, results));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const sections = [];
|
|
29
|
+
sections.push((0, format_1.markdownHeader)('API surface', 'exported symbols with no internal callers', graph));
|
|
30
|
+
if (unreliablePacks.length > 0) {
|
|
31
|
+
sections.push(`*Excluded packs* (export detection unreliable): ` +
|
|
32
|
+
unreliablePacks.map((u) => `**${u.pack}** (${u.strategy})`).join('; '));
|
|
33
|
+
}
|
|
34
|
+
if (results.length === 0) {
|
|
35
|
+
sections.push('No exported symbols without internal callers found. Either the codebase has no public API surface graphify could detect, or every exported symbol has at least one internal caller.');
|
|
36
|
+
(0, format_1.printMarkdown)(...sections);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
sections.push((0, format_1.markdownTable)(['Path', 'Symbol', 'Kind', 'Pack'], results.map((r) => ({
|
|
40
|
+
Path: r.line ? `${r.sourceFile}:${r.line}` : r.sourceFile,
|
|
41
|
+
Symbol: r.symbol,
|
|
42
|
+
Kind: r.kind,
|
|
43
|
+
Pack: r.pack,
|
|
44
|
+
}))));
|
|
45
|
+
sections.push('These are likely public API or CLI entry points. Verify before deleting — a missing internal caller can mean "external consumer only" rather than "dead code." Future releases will add a dedicated dead-code analyzer with stronger heuristics.');
|
|
46
|
+
sections.push((0, format_1.markdownFooter)('Drill into one: `vyuh-dxkit explore file <path>`.'));
|
|
47
|
+
(0, format_1.printMarkdown)(...sections);
|
|
48
|
+
}
|
|
49
|
+
function parseLimit(raw, defaultValue) {
|
|
50
|
+
if (!raw)
|
|
51
|
+
return defaultValue;
|
|
52
|
+
const n = parseInt(raw, 10);
|
|
53
|
+
if (isNaN(n) || n < 1)
|
|
54
|
+
return defaultValue;
|
|
55
|
+
return Math.min(n, 1000);
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=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C,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vyuh-dxkit explore communities` — natural-module summary.
|
|
3
|
+
*
|
|
4
|
+
* Pure pipeline: parse args → call communitiesQuery → format output.
|
|
5
|
+
* Per CLAUDE.md Rule 12: graph traversal flows through queries.ts.
|
|
6
|
+
*/
|
|
7
|
+
import type { Graph } from '../types';
|
|
8
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
9
|
+
export declare function runCommunities(graph: Graph, _positionals: ReadonlyArray<string>, values: ExploreCliValues): void;
|
|
10
|
+
//# sourceMappingURL=communities.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communities.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/communities.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAWH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,EACnC,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAgCN"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `vyuh-dxkit explore communities` — natural-module summary.
|
|
4
|
+
*
|
|
5
|
+
* Pure pipeline: parse args → call communitiesQuery → format output.
|
|
6
|
+
* Per CLAUDE.md Rule 12: graph traversal flows through queries.ts.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.runCommunities = runCommunities;
|
|
10
|
+
const queries_1 = require("../queries");
|
|
11
|
+
const format_1 = require("../format");
|
|
12
|
+
const DEFAULT_LIMIT = 8;
|
|
13
|
+
function runCommunities(graph, _positionals, values) {
|
|
14
|
+
const limit = parseLimit(values.limit, DEFAULT_LIMIT);
|
|
15
|
+
const results = (0, queries_1.communitiesQuery)(graph, limit);
|
|
16
|
+
if (values.json) {
|
|
17
|
+
(0, format_1.printJson)((0, format_1.envelope)('explore.communities', { limit }, graph, results));
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
if (results.length === 0) {
|
|
21
|
+
(0, format_1.printMarkdown)((0, format_1.markdownHeader)('Communities', 'natural modules in this repo', graph), 'No communities found in the graph. Either the repo is too small for Louvain clustering to find structure, or the graph artifact is empty.');
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
const rows = results.map((r) => ({
|
|
25
|
+
ID: r.id,
|
|
26
|
+
Dir: r.dominantSourceDir || '—',
|
|
27
|
+
Pack: r.dominantPack || '—',
|
|
28
|
+
Nodes: r.nodeCount,
|
|
29
|
+
Cohesion: r.cohesion.toFixed(2),
|
|
30
|
+
'Top hot files': r.topHotFiles.map((f) => basename(f)).join(', ') || '—',
|
|
31
|
+
}));
|
|
32
|
+
const headers = ['ID', 'Dir', 'Pack', 'Nodes', 'Cohesion', 'Top hot files'];
|
|
33
|
+
(0, format_1.printMarkdown)((0, format_1.markdownHeader)('Communities', 'natural modules in this repo', graph), (0, format_1.markdownTable)(headers, rows), (0, format_1.markdownFooter)("Drill into a community's central file: `vyuh-dxkit explore file <path>`."));
|
|
34
|
+
}
|
|
35
|
+
function basename(p) {
|
|
36
|
+
const i = p.lastIndexOf('/');
|
|
37
|
+
return i >= 0 ? p.slice(i + 1) : p;
|
|
38
|
+
}
|
|
39
|
+
function parseLimit(raw, defaultValue) {
|
|
40
|
+
if (!raw)
|
|
41
|
+
return defaultValue;
|
|
42
|
+
const n = parseInt(raw, 10);
|
|
43
|
+
if (isNaN(n) || n < 1)
|
|
44
|
+
return defaultValue;
|
|
45
|
+
return Math.min(n, 1000);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=communities.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"communities.js","sourceRoot":"","sources":["../../../src/explore/cli/communities.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAgBH,wCAoCC;AAlDD,wCAA8C;AAC9C,sCAOmB;AAInB,MAAM,aAAa,GAAG,CAAC,CAAC;AAExB,SAAgB,cAAc,CAC5B,KAAY,EACZ,YAAmC,EACnC,MAAwB;IAExB,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,IAAA,0BAAgB,EAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IAE/C,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAA,kBAAS,EAAC,IAAA,iBAAQ,EAAC,qBAAqB,EAAE,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC;QACtE,OAAO;IACT,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,IAAA,sBAAa,EACX,IAAA,uBAAc,EAAC,aAAa,EAAE,8BAA8B,EAAE,KAAK,CAAC,EACpE,2IAA2I,CAC5I,CAAC;QACF,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;QAC/B,EAAE,EAAE,CAAC,CAAC,EAAE;QACR,GAAG,EAAE,CAAC,CAAC,iBAAiB,IAAI,GAAG;QAC/B,IAAI,EAAE,CAAC,CAAC,YAAY,IAAI,GAAG;QAC3B,KAAK,EAAE,CAAC,CAAC,SAAS;QAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/B,eAAe,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG;KACzE,CAAC,CAAC,CAAC;IACJ,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,CAAU,CAAC;IAErF,IAAA,sBAAa,EACX,IAAA,uBAAc,EAAC,aAAa,EAAE,8BAA8B,EAAE,KAAK,CAAC,EACpE,IAAA,sBAAa,EAAC,OAAO,EAAE,IAAI,CAAC,EAC5B,IAAA,uBAAc,EAAC,0EAA0E,CAAC,CAC3F,CAAC;AACJ,CAAC;AAED,SAAS,QAAQ,CAAC,CAAS;IACzB,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAC7B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,UAAU,CAAC,GAAuB,EAAE,YAAoB;IAC/D,IAAI,CAAC,GAAG;QAAE,OAAO,YAAY,CAAC;IAC9B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vyuh-dxkit context <query>` — the token-reduction surface. Returns
|
|
3
|
+
* a slim, relevance-ranked structural slice for a query instead of the
|
|
4
|
+
* full-file dump an agent would otherwise grep + read. Same payload
|
|
5
|
+
* serves the human at a terminal and the LLM via the PreToolUse hook.
|
|
6
|
+
*
|
|
7
|
+
* Output is lean markdown by default (LLMs parse it natively + it's
|
|
8
|
+
* more token-efficient than JSON); `--json` emits the stable envelope
|
|
9
|
+
* for pipelines. The content is anchor-first ("start here"), grouped
|
|
10
|
+
* by community for orientation, framed by blast radius, and honest
|
|
11
|
+
* about truncation + same-name conflation.
|
|
12
|
+
*/
|
|
13
|
+
import type { Graph } from '../types';
|
|
14
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
15
|
+
export declare function runContext(graph: Graph, positionals: ReadonlyArray<string>, values: ExploreCliValues): void;
|
|
16
|
+
//# sourceMappingURL=context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/context.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAgB,UAAU,CACxB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,MAAM,EAAE,gBAAgB,GACvB,IAAI,CAyGN"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `vyuh-dxkit context <query>` — the token-reduction surface. Returns
|
|
4
|
+
* a slim, relevance-ranked structural slice for a query instead of the
|
|
5
|
+
* full-file dump an agent would otherwise grep + read. Same payload
|
|
6
|
+
* serves the human at a terminal and the LLM via the PreToolUse hook.
|
|
7
|
+
*
|
|
8
|
+
* Output is lean markdown by default (LLMs parse it natively + it's
|
|
9
|
+
* more token-efficient than JSON); `--json` emits the stable envelope
|
|
10
|
+
* for pipelines. The content is anchor-first ("start here"), grouped
|
|
11
|
+
* by community for orientation, framed by blast radius, and honest
|
|
12
|
+
* about truncation + same-name conflation.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.runContext = runContext;
|
|
16
|
+
const queries_1 = require("../queries");
|
|
17
|
+
const format_1 = require("../format");
|
|
18
|
+
const DEFAULT_BUDGET = 2000;
|
|
19
|
+
function runContext(graph, positionals, values) {
|
|
20
|
+
const keyword = positionals[0];
|
|
21
|
+
if (!keyword) {
|
|
22
|
+
process.stderr.write('Usage: vyuh-dxkit context <query> [--substring] [--budget 2000] [--depth N] [--json]\n');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const budget = parsePositiveInt(values.budget, DEFAULT_BUDGET);
|
|
26
|
+
const depth = values.depth !== undefined ? parsePositiveInt(values.depth, Infinity) : undefined;
|
|
27
|
+
const substring = !!values.substring;
|
|
28
|
+
const result = (0, queries_1.contextQuery)(graph, keyword, { budget, substring, maxDepth: depth });
|
|
29
|
+
if (values.json) {
|
|
30
|
+
(0, format_1.printJson)((0, format_1.envelope)('context', { query: keyword, budget, substring, depth: depth ?? null }, graph, result));
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const sections = [(0, format_1.markdownHeader)('Context', `\`${keyword}\``, graph)];
|
|
34
|
+
if (!result.matched) {
|
|
35
|
+
if (result.suggestions.length > 0) {
|
|
36
|
+
const lines = result.suggestions
|
|
37
|
+
.map((s) => ` - \`${s.key}\` (${s.hits} hit${s.hits === 1 ? '' : 's'})`)
|
|
38
|
+
.join('\n');
|
|
39
|
+
sections.push(`No symbols matched \`${keyword}\`. Did you mean:\n\n${lines}\n\nRerun with \`--substring\` to expand from these, or pick one above.`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
sections.push(`No symbols matched \`${keyword}\` (no close alternatives either). Try a different keyword or \`--substring\` for broader matching.`);
|
|
43
|
+
}
|
|
44
|
+
(0, format_1.printMarkdown)(...sections);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Anchor — the "start here" line.
|
|
48
|
+
if (result.anchor) {
|
|
49
|
+
const a = result.anchor;
|
|
50
|
+
const where = a.line ? `${a.sourceFile}:${a.line}` : a.sourceFile;
|
|
51
|
+
sections.push(`**Start here:** \`${a.symbol}\` — \`${where}\` (called from ${a.calledFrom} place${a.calledFrom === 1 ? '' : 's'}).`);
|
|
52
|
+
}
|
|
53
|
+
// Blast radius — change-impact framing.
|
|
54
|
+
const { callers, callerFiles } = result.blastRadius;
|
|
55
|
+
if (callers > 0) {
|
|
56
|
+
sections.push(`**Blast radius:** changing the matched symbol${result.selection.some((s) => s.hop === 0) ? '(s)' : ''} touches ${callers} caller${callers === 1 ? '' : 's'} across ${callerFiles} file${callerFiles === 1 ? '' : 's'}.`);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
sections.push('**Blast radius:** no internal callers — likely an entry point or public API.');
|
|
60
|
+
}
|
|
61
|
+
// Community-grouped symbol listing (orientation). Each group is
|
|
62
|
+
// ranked seeds-first then by call in-degree, and capped for
|
|
63
|
+
// readability — the markdown is a scannable map, not an exhaustive
|
|
64
|
+
// dump. The full selection is always available via `--json`.
|
|
65
|
+
const PER_COMMUNITY_CAP = 12;
|
|
66
|
+
for (const group of result.byCommunity) {
|
|
67
|
+
const heading = group.communityId !== undefined
|
|
68
|
+
? `### ${group.role} (community ${group.communityId})`
|
|
69
|
+
: `### ${group.role}`;
|
|
70
|
+
const lines = [heading];
|
|
71
|
+
const groupSel = dedupeBySymbol(result.selection
|
|
72
|
+
.filter((s) => group.symbols.includes(s.symbol))
|
|
73
|
+
.sort((a, b) => a.hop - b.hop || b.callsIn - a.callsIn));
|
|
74
|
+
for (const s of groupSel.slice(0, PER_COMMUNITY_CAP)) {
|
|
75
|
+
const where = s.line ? `${s.sourceFile}:${s.line}` : s.sourceFile;
|
|
76
|
+
const seed = s.hop === 0 ? ' _[seed]_' : '';
|
|
77
|
+
lines.push(`- \`${s.symbol}\` — \`${where}\` (${s.callsIn} in / ${s.callsOut} out)${seed}`);
|
|
78
|
+
}
|
|
79
|
+
if (groupSel.length > PER_COMMUNITY_CAP) {
|
|
80
|
+
lines.push(`- _+${groupSel.length - PER_COMMUNITY_CAP} more in this cluster_`);
|
|
81
|
+
}
|
|
82
|
+
sections.push(lines.join('\n'));
|
|
83
|
+
}
|
|
84
|
+
// Honest truncation footer.
|
|
85
|
+
if (result.truncated) {
|
|
86
|
+
sections.push(`_+${result.omittedCount} more symbol${result.omittedCount === 1 ? '' : 's'} omitted to fit the ${result.budget}-token budget — narrow the query or raise \`--budget\`._`);
|
|
87
|
+
}
|
|
88
|
+
// Same-name conflation caveat — only when there's any risk worth noting.
|
|
89
|
+
sections.push('_Note: graphify conflates same-name symbols across files, so call counts are best-effort._');
|
|
90
|
+
(0, format_1.printMarkdown)(...sections);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Collapse repeated symbol names within a community group. The BFS can
|
|
94
|
+
* surface the same stripped label from two different files (graphify's
|
|
95
|
+
* same-name conflation); the listing keeps the first (lowest-hop)
|
|
96
|
+
* occurrence so the output stays scannable.
|
|
97
|
+
*/
|
|
98
|
+
function dedupeBySymbol(nodes) {
|
|
99
|
+
const seen = new Set();
|
|
100
|
+
const out = [];
|
|
101
|
+
for (const n of nodes) {
|
|
102
|
+
const key = `${n.symbol}\x00${n.sourceFile}`;
|
|
103
|
+
if (seen.has(key))
|
|
104
|
+
continue;
|
|
105
|
+
seen.add(key);
|
|
106
|
+
out.push(n);
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
function parsePositiveInt(raw, defaultValue) {
|
|
111
|
+
if (!raw)
|
|
112
|
+
return defaultValue;
|
|
113
|
+
const n = parseInt(raw, 10);
|
|
114
|
+
if (isNaN(n) || n < 1)
|
|
115
|
+
return defaultValue;
|
|
116
|
+
return n;
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=context.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1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GAAG,GAAkB,EAAE,CAAC;IAC9B,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,UAAU,EAAE,CAAC;QAC7C,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,SAAS;QAC5B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACd,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAuB,EAAE,YAAoB;IACrE,IAAI,CAAC,GAAG;QAAE,OAAO,YAAY,CAAC;IAC9B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IAC3C,OAAO,CAAC,CAAC;AACX,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vyuh-dxkit explore entry-points` — what does this repo do?
|
|
3
|
+
*
|
|
4
|
+
* Cross-references graph nodes with the active packs'
|
|
5
|
+
* architecturalShape (per CLAUDE.md Rule 8 — no hardcoded framework
|
|
6
|
+
* strings here). Detects the project's stack via `detect(cwd)` so
|
|
7
|
+
* only active-pack patterns contribute.
|
|
8
|
+
*/
|
|
9
|
+
import type { Graph } from '../types';
|
|
10
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
11
|
+
export declare function runEntryPoints(graph: Graph, _positionals: ReadonlyArray<string>, values: ExploreCliValues, cwd: string): void;
|
|
12
|
+
//# sourceMappingURL=entry-points.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-points.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/entry-points.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAaH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAgB,cAAc,CAC5B,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,aAAa,CAAC,MAAM,CAAC,EACnC,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,MAAM,GACV,IAAI,CAgFN"}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `vyuh-dxkit explore entry-points` — what does this repo do?
|
|
4
|
+
*
|
|
5
|
+
* Cross-references graph nodes with the active packs'
|
|
6
|
+
* architecturalShape (per CLAUDE.md Rule 8 — no hardcoded framework
|
|
7
|
+
* strings here). Detects the project's stack via `detect(cwd)` so
|
|
8
|
+
* only active-pack patterns contribute.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.runEntryPoints = runEntryPoints;
|
|
12
|
+
const detect_1 = require("../../detect");
|
|
13
|
+
const languages_1 = require("../../languages");
|
|
14
|
+
const queries_1 = require("../queries");
|
|
15
|
+
const format_1 = require("../format");
|
|
16
|
+
const DEFAULT_LIMIT = 10;
|
|
17
|
+
function runEntryPoints(graph, _positionals, values, cwd) {
|
|
18
|
+
const limit = parseLimit(values.limit, DEFAULT_LIMIT);
|
|
19
|
+
const stack = (0, detect_1.detect)(cwd);
|
|
20
|
+
const primaryPaths = (0, languages_1.allPrimaryComponentPaths)(stack.languages);
|
|
21
|
+
const routePaths = (0, languages_1.allRoutePaths)(stack.languages);
|
|
22
|
+
const vocabulary = (0, languages_1.dominantVocabulary)(stack.languages);
|
|
23
|
+
const results = (0, queries_1.entryPointsQuery)(graph, primaryPaths, routePaths, limit);
|
|
24
|
+
if (values.json) {
|
|
25
|
+
(0, format_1.printJson)((0, format_1.envelope)('explore.entry-points', { limit, primaryPaths, routePaths, packs: graph.meta.packs }, graph, results));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
if (primaryPaths.length === 0 && routePaths.length === 0) {
|
|
29
|
+
(0, format_1.printMarkdown)((0, format_1.markdownHeader)('Entry points', 'what does this repo do?', graph), `No entry-point patterns declared for the active packs (${graph.meta.packs.join(', ') || 'none detected'}).\n\n` +
|
|
30
|
+
'Each language pack declares its own primary-component / route path conventions in `LanguageSupport.architecturalShape` (CLAUDE.md Rule 8). Packs without conventional entry-point paths (e.g. Rust) intentionally omit them.');
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
if (results.length === 0) {
|
|
34
|
+
(0, format_1.printMarkdown)((0, format_1.markdownHeader)('Entry points', 'what does this repo do?', graph), `No source files matched the active packs' entry-point patterns.\n\n` +
|
|
35
|
+
`Patterns tried: ${[...primaryPaths, ...routePaths].map((p) => `\`${p}\``).join(', ')}\n\n` +
|
|
36
|
+
`Either this repo has no conventional entry points, or the patterns don't match this codebase's structure.`);
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
// Group by componentType + emit one table per group.
|
|
40
|
+
const grouped = new Map();
|
|
41
|
+
for (const r of results) {
|
|
42
|
+
const key = r.componentType;
|
|
43
|
+
const list = grouped.get(key) ?? [];
|
|
44
|
+
list.push(r);
|
|
45
|
+
grouped.set(key, list);
|
|
46
|
+
}
|
|
47
|
+
const sections = [];
|
|
48
|
+
sections.push((0, format_1.markdownHeader)('Entry points', 'what does this repo do?', graph));
|
|
49
|
+
// Vocabulary line so the reader knows the pack's framing.
|
|
50
|
+
const vocabLine = [];
|
|
51
|
+
if (vocabulary?.components)
|
|
52
|
+
vocabLine.push(`components → **${vocabulary.components}**`);
|
|
53
|
+
if (vocabulary?.routes)
|
|
54
|
+
vocabLine.push(`routes → **${vocabulary.routes}**`);
|
|
55
|
+
if (vocabulary?.models)
|
|
56
|
+
vocabLine.push(`models → **${vocabulary.models}**`);
|
|
57
|
+
if (vocabLine.length > 0) {
|
|
58
|
+
sections.push(`*Pack vocabulary*: ${vocabLine.join(', ')}.`);
|
|
59
|
+
}
|
|
60
|
+
for (const [type, rows] of grouped) {
|
|
61
|
+
sections.push(`### ${capitalize(type)} (${rows.length})`);
|
|
62
|
+
sections.push((0, format_1.markdownTable)(['Path', 'Symbol', 'Calls out', 'Pack'], rows.map((r) => ({
|
|
63
|
+
Path: r.line ? `${r.sourceFile}:${r.line}` : r.sourceFile,
|
|
64
|
+
Symbol: r.symbol,
|
|
65
|
+
'Calls out': r.callsOut,
|
|
66
|
+
Pack: r.pack,
|
|
67
|
+
}))));
|
|
68
|
+
}
|
|
69
|
+
sections.push((0, format_1.markdownFooter)('Drill into one: `vyuh-dxkit explore file <path>`.'));
|
|
70
|
+
(0, format_1.printMarkdown)(...sections);
|
|
71
|
+
}
|
|
72
|
+
function capitalize(s) {
|
|
73
|
+
if (!s)
|
|
74
|
+
return s;
|
|
75
|
+
return s[0].toUpperCase() + s.slice(1);
|
|
76
|
+
}
|
|
77
|
+
function parseLimit(raw, defaultValue) {
|
|
78
|
+
if (!raw)
|
|
79
|
+
return defaultValue;
|
|
80
|
+
const n = parseInt(raw, 10);
|
|
81
|
+
if (isNaN(n) || n < 1)
|
|
82
|
+
return defaultValue;
|
|
83
|
+
return Math.min(n, 1000);
|
|
84
|
+
}
|
|
85
|
+
//# sourceMappingURL=entry-points.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-points.js","sourceRoot":"","sources":["../../../src/explore/cli/entry-points.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;AAkBH,wCAqFC;AArGD,yCAAsC;AACtC,+CAA8F;AAC9F,wCAAqE;AACrE,sCAOmB;AAInB,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,SAAgB,cAAc,CAC5B,KAAY,EACZ,YAAmC,EACnC,MAAwB,EACxB,GAAW;IAEX,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,C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|
2
|
+
* `vyuh-dxkit explore feature <keyword>` — where is feature X
|
|
3
|
+
* implemented? The marquee query of the explore CLI.
|
|
4
|
+
*
|
|
5
|
+
* Three-stage resolution (per Sprint 0 spec):
|
|
6
|
+
* 1. Direct symbolIndex match
|
|
7
|
+
* 2. Substring expansion (opt-in via --substring; off by default)
|
|
8
|
+
* 3. Structural expansion (community + 1-hop callers/callees)
|
|
9
|
+
*
|
|
10
|
+
* On zero hits, prints "did you mean..." suggestions from
|
|
11
|
+
* edit-distance against symbolIndex keys.
|
|
12
|
+
*/
|
|
13
|
+
import type { Graph } from '../types';
|
|
14
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
15
|
+
export declare function runFeature(graph: Graph, positionals: ReadonlyArray<string>, values: ExploreCliValues): void;
|
|
16
|
+
//# sourceMappingURL=feature.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/feature.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAWH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAI1D,wBAAgB,UAAU,CACxB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,MAAM,EAAE,gBAAgB,GACvB,IAAI,CA4DN"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* `vyuh-dxkit explore feature <keyword>` — where is feature X
|
|
4
|
+
* implemented? The marquee query of the explore CLI.
|
|
5
|
+
*
|
|
6
|
+
* Three-stage resolution (per Sprint 0 spec):
|
|
7
|
+
* 1. Direct symbolIndex match
|
|
8
|
+
* 2. Substring expansion (opt-in via --substring; off by default)
|
|
9
|
+
* 3. Structural expansion (community + 1-hop callers/callees)
|
|
10
|
+
*
|
|
11
|
+
* On zero hits, prints "did you mean..." suggestions from
|
|
12
|
+
* edit-distance against symbolIndex keys.
|
|
13
|
+
*/
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.runFeature = runFeature;
|
|
16
|
+
const queries_1 = require("../queries");
|
|
17
|
+
const format_1 = require("../format");
|
|
18
|
+
const DEFAULT_LIMIT = 50;
|
|
19
|
+
function runFeature(graph, positionals, values) {
|
|
20
|
+
const keyword = positionals[0];
|
|
21
|
+
if (!keyword) {
|
|
22
|
+
process.stderr.write('Usage: vyuh-dxkit explore feature <keyword> [--substring] [--limit 50]\n');
|
|
23
|
+
process.exit(1);
|
|
24
|
+
}
|
|
25
|
+
const limit = parseLimit(values.limit, DEFAULT_LIMIT);
|
|
26
|
+
const substring = !!values.substring;
|
|
27
|
+
const result = (0, queries_1.featureQuery)(graph, keyword, { limit, substring });
|
|
28
|
+
if (values.json) {
|
|
29
|
+
(0, format_1.printJson)((0, format_1.envelope)('explore.feature', { keyword, limit, substring }, graph, result));
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
const sections = [];
|
|
33
|
+
sections.push((0, format_1.markdownHeader)('Feature', `\`${keyword}\``, graph));
|
|
34
|
+
if (result.results.length === 0) {
|
|
35
|
+
if (result.suggestions.length > 0) {
|
|
36
|
+
const lines = result.suggestions
|
|
37
|
+
.map((s) => ` - \`${s.key}\` (${s.hits} hit${s.hits === 1 ? '' : 's'})`)
|
|
38
|
+
.join('\n');
|
|
39
|
+
sections.push(`No exact symbol match for \`${keyword}\`. Related symbols (substring or typo-distance):\n\n${lines}\n\nRerun with \`--substring\` to expand structurally from these (the typical "where is X implemented?" workflow), or pick a specific symbol above.`);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
sections.push(`No symbols matched \`${keyword}\` (no close alternatives found either). Try a different keyword, rerun with \`--substring\` for broader matching, or check \`vyuh-dxkit explore communities\` to see the natural-module structure.`);
|
|
43
|
+
}
|
|
44
|
+
(0, format_1.printMarkdown)(...sections);
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
// Summary line + central entry point (if any).
|
|
48
|
+
const totalSeeds = result.results.reduce((sum, c) => sum + c.seedHits, 0);
|
|
49
|
+
sections.push(`**Seed matches**: ${totalSeeds} symbol${totalSeeds === 1 ? '' : 's'} across ${result.results.length} cluster${result.results.length === 1 ? '' : 's'}.`);
|
|
50
|
+
// Per-cluster sections.
|
|
51
|
+
for (const cluster of result.results) {
|
|
52
|
+
sections.push(buildClusterSection(cluster));
|
|
53
|
+
}
|
|
54
|
+
if (result.centralEntryPoint) {
|
|
55
|
+
const cep = result.centralEntryPoint;
|
|
56
|
+
const where = cep.line ? `${cep.sourceFile}:${cep.line}` : cep.sourceFile;
|
|
57
|
+
sections.push(`\nThe most-called seed symbol is **\`${cep.symbol}\`** at \`${where}\` — called from ${cep.calledFrom} place${cep.calledFrom === 1 ? '' : 's'}. A natural starting read.`);
|
|
58
|
+
}
|
|
59
|
+
sections.push((0, format_1.markdownFooter)('Drill into one: `vyuh-dxkit explore file <path>`.'));
|
|
60
|
+
(0, format_1.printMarkdown)(...sections);
|
|
61
|
+
}
|
|
62
|
+
function buildClusterSection(cluster) {
|
|
63
|
+
const lines = [];
|
|
64
|
+
const id = cluster.clusterId + 1;
|
|
65
|
+
const role = cluster.role;
|
|
66
|
+
const seedNote = cluster.seedHits === 0 ? ' (expansion only — no direct seed)' : '';
|
|
67
|
+
lines.push(`### Cluster ${id} — ${role}${seedNote}`);
|
|
68
|
+
if (cluster.communityId !== undefined) {
|
|
69
|
+
lines.push(`*Community*: ${cluster.communityId}${cluster.dominantSourceDir ? ` (${cluster.dominantSourceDir})` : ''}`);
|
|
70
|
+
}
|
|
71
|
+
if (cluster.keySymbols.length > 0) {
|
|
72
|
+
lines.push(`*Key symbols*: ${cluster.keySymbols.map((s) => `\`${s}\``).join(', ')}`);
|
|
73
|
+
}
|
|
74
|
+
lines.push('');
|
|
75
|
+
lines.push((0, format_1.markdownTable)(['File'], cluster.files.slice(0, 12).map((f) => ({ File: f }))));
|
|
76
|
+
if (cluster.files.length > 12) {
|
|
77
|
+
lines.push(`\n*+ ${cluster.files.length - 12} more file${cluster.files.length - 12 === 1 ? '' : 's'}*`);
|
|
78
|
+
}
|
|
79
|
+
return lines.join('\n');
|
|
80
|
+
}
|
|
81
|
+
function parseLimit(raw, defaultValue) {
|
|
82
|
+
if (!raw)
|
|
83
|
+
return defaultValue;
|
|
84
|
+
const n = parseInt(raw, 10);
|
|
85
|
+
if (isNaN(n) || n < 1)
|
|
86
|
+
return defaultValue;
|
|
87
|
+
return Math.min(n, 1000);
|
|
88
|
+
}
|
|
89
|
+
//# sourceMappingURL=feature.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../src/explore/cli/feature.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;AAgBH,gCAgEC;AA9ED,wCAA+D;AAC/D,sCAOmB;AAInB,MAAM,aAAa,GAAG,EAAE,CAAC;AAEzB,SAAgB,UAAU,CACxB,KAAY,EACZ,WAAkC,EAClC,MAAwB;IAExB,MAAM,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC/B,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,0EAA0E,CAC3E,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,KAAK,GAAG,UAAU,CAAC,MAAM,CAAC,KAAK,EAAE,aAAa,CAAC,CAAC;IACtD,MAAM,SAAS,GAAG,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC;IACrC,MAAM,MAAM,GAAG,IAAA,sBAAY,EAAC,KAAK,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC,CAAC;IAElE,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC;QAChB,IAAA,kBAAS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C,GAAuB,EAAE,YAAoB;IAC/D,IAAI,CAAC,GAAG;QAAE,OAAO,YAAY,CAAC;IAC9B,MAAM,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IAC5B,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAAE,OAAO,YAAY,CAAC;IAC3C,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;AAC3B,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vyuh-dxkit explore file <path>` — drill into a single file's
|
|
3
|
+
* neighborhood. Per CLAUDE.md Rule 12: graph traversal flows through
|
|
4
|
+
* queries.ts.
|
|
5
|
+
*
|
|
6
|
+
* If the user passes an absolute path, convert to project-relative
|
|
7
|
+
* (the graph artifact uses project-relative paths throughout).
|
|
8
|
+
*/
|
|
9
|
+
import type { Graph } from '../types';
|
|
10
|
+
import type { ExploreCliValues } from '../../explore-cli';
|
|
11
|
+
export declare function runFile(graph: Graph, positionals: ReadonlyArray<string>, values: ExploreCliValues, cwd: string): void;
|
|
12
|
+
//# sourceMappingURL=file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/explore/cli/file.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAYH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAE1D,wBAAgB,OAAO,CACrB,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,aAAa,CAAC,MAAM,CAAC,EAClC,MAAM,EAAE,gBAAgB,EACxB,GAAG,EAAE,MAAM,GACV,IAAI,CAqHN"}
|