@harness-engineering/cli 2.3.0 → 2.3.1
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/dist/{agents-md-N7YBQPE3.js → agents-md-5JG3AE5A.js} +3 -3
- package/dist/{architecture-PP7WERSV.js → architecture-544ISXDI.js} +4 -4
- package/dist/{assess-project-WXFCJQTX.js → assess-project-PBO6XFJC.js} +1 -1
- package/dist/bin/harness-mcp.js +15 -15
- package/dist/bin/harness.js +25 -25
- package/dist/{check-phase-gate-R3KQFBAH.js → check-phase-gate-BZU4DGF3.js} +4 -4
- package/dist/{chunk-MT2MMBUA.js → chunk-22OKI5QI.js} +9 -9
- package/dist/{chunk-6CHNY3NJ.js → chunk-2564TBT6.js} +1 -1
- package/dist/{chunk-YG4ZBGEH.js → chunk-7BNK4M23.js} +1 -1
- package/dist/{chunk-3LPOTTPX.js → chunk-A36MGB3V.js} +92 -92
- package/dist/{chunk-PW3U4YJV.js → chunk-DBJC4ULT.js} +9 -4
- package/dist/{chunk-MKPRB4PL.js → chunk-DHWFOHPX.js} +1 -1
- package/dist/{chunk-4NFV5UZO.js → chunk-EMJFHTPZ.js} +3 -3
- package/dist/{chunk-DLBMYLYR.js → chunk-IYA3NS5P.js} +1 -1
- package/dist/{chunk-LM4F5KBK.js → chunk-J4MX5DIA.js} +5 -5
- package/dist/{chunk-5KTTKXQN.js → chunk-JMACX5FN.js} +1 -1
- package/dist/{chunk-KWD6FF7M.js → chunk-KJR4Z2YC.js} +8 -8
- package/dist/{chunk-L3CEN42B.js → chunk-KT5PWWWO.js} +1 -1
- package/dist/{chunk-GUIX2TMZ.js → chunk-LBYGGNEZ.js} +1 -1
- package/dist/{chunk-YEBUFRTT.js → chunk-LYMPKO6N.js} +2 -2
- package/dist/{chunk-35FI23SO.js → chunk-N6DVSOLZ.js} +118 -112
- package/dist/{chunk-7PGYJO3L.js → chunk-QZ67TDLJ.js} +3 -3
- package/dist/{chunk-GTXUUGFG.js → chunk-R6GLLMRZ.js} +9 -9
- package/dist/{chunk-NP2ZI6E3.js → chunk-T2ZMHXCX.js} +1 -1
- package/dist/{chunk-EJPR5VCT.js → chunk-TIJXG4UB.js} +6 -6
- package/dist/{chunk-KTWKW6KJ.js → chunk-TIQU5VY7.js} +1 -1
- package/dist/{chunk-D2LZUJLP.js → chunk-U2SF3KAQ.js} +2 -2
- package/dist/{chunk-KUVPSUG4.js → chunk-WMZKZCCE.js} +1 -1
- package/dist/{chunk-BMM3GXV6.js → chunk-XPRGWHBL.js} +80 -37
- package/dist/{chunk-5PPV4WYY.js → chunk-YI6NTL72.js} +5 -5
- package/dist/{chunk-4DWOMGUM.js → chunk-YNG7BWGB.js} +396 -79
- package/dist/{ci-workflow-GFCXFJ4G.js → ci-workflow-ZO6FPO3V.js} +3 -3
- package/dist/{dist-D27LJR2T.js → dist-SQAOKWXM.js} +5 -3
- package/dist/{dist-I4LWG3IN.js → dist-ZS3Y3YWP.js} +8 -2
- package/dist/{docs-UXKDKPJF.js → docs-VW2KDPI3.js} +4 -4
- package/dist/{engine-A63FRDLF.js → engine-LFQ2JSHY.js} +3 -3
- package/dist/{entropy-IFIP4ZP4.js → entropy-P62LCVJI.js} +3 -3
- package/dist/{feedback-W36DSJQA.js → feedback-O3TZAPGX.js} +1 -1
- package/dist/{generate-agent-definitions-F4YMKQLP.js → generate-agent-definitions-WVCOZDKI.js} +4 -4
- package/dist/{glob-helper-FZPPTGJN.js → glob-helper-JE3MO4UD.js} +1 -1
- package/dist/{graph-loader-5MKHAJJF.js → graph-loader-TJU4E7KL.js} +1 -1
- package/dist/index.js +25 -25
- package/dist/{loader-4UAOGUSS.js → loader-UB2A65DN.js} +3 -3
- package/dist/{mcp-YW7PLXVQ.js → mcp-ST26QMDK.js} +15 -15
- package/dist/{performance-AZ5UYPOQ.js → performance-5HQG3IU6.js} +4 -4
- package/dist/{review-pipeline-OLQVGBWJ.js → review-pipeline-VRDL5A7J.js} +3 -3
- package/dist/{runtime-GG3U5HH5.js → runtime-TQQT2MWQ.js} +3 -3
- package/dist/{scan-BIJYHOE7.js → scan-SFX5U3TE.js} +1 -1
- package/dist/{security-MYTRFSR7.js → security-IMFAE6MW.js} +1 -1
- package/dist/{validate-QI4V4JY6.js → validate-GW2DG64P.js} +4 -4
- package/dist/{validate-cross-check-XRSSAXJP.js → validate-cross-check-F5YQVXLT.js} +3 -3
- package/package.json +6 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveProjectConfig
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2564TBT6.js";
|
|
4
4
|
import {
|
|
5
5
|
sanitizePath
|
|
6
6
|
} from "./chunk-W6Y7ZW3Y.js";
|
|
@@ -49,7 +49,7 @@ async function handleValidateProject(input) {
|
|
|
49
49
|
checks.config = "pass";
|
|
50
50
|
const config = configResult.value;
|
|
51
51
|
try {
|
|
52
|
-
const core = await import("./dist-
|
|
52
|
+
const core = await import("./dist-ZS3Y3YWP.js");
|
|
53
53
|
if (typeof core.validateFileStructure === "function" && Array.isArray(config.conventions)) {
|
|
54
54
|
const conventions = config.conventions;
|
|
55
55
|
const structureResult = await core.validateFileStructure(projectPath, conventions);
|
|
@@ -68,7 +68,7 @@ async function handleValidateProject(input) {
|
|
|
68
68
|
} catch {
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
|
-
const core = await import("./dist-
|
|
71
|
+
const core = await import("./dist-ZS3Y3YWP.js");
|
|
72
72
|
if (typeof core.validateAgentsMap === "function") {
|
|
73
73
|
const agentsMapPath = path.join(projectPath, "AGENTS.md");
|
|
74
74
|
const agentsResult = await core.validateAgentsMap(agentsMapPath);
|
|
@@ -33,7 +33,7 @@ var createSelfReviewDefinition = {
|
|
|
33
33
|
};
|
|
34
34
|
async function handleCreateSelfReview(input) {
|
|
35
35
|
try {
|
|
36
|
-
const { parseDiff, createSelfReview } = await import("./dist-
|
|
36
|
+
const { parseDiff, createSelfReview } = await import("./dist-ZS3Y3YWP.js");
|
|
37
37
|
const parseResult = parseDiff(input.diff);
|
|
38
38
|
if (!parseResult.ok) {
|
|
39
39
|
return resultToMcpResponse(parseResult);
|
|
@@ -53,11 +53,11 @@ async function handleCreateSelfReview(input) {
|
|
|
53
53
|
...input.maxFileCount !== void 0 ? { maxChangedFiles: input.maxFileCount } : {}
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
-
const { loadGraphStore } = await import("./graph-loader-
|
|
56
|
+
const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
|
|
57
57
|
const store = await loadGraphStore(projectPath);
|
|
58
58
|
let graphData;
|
|
59
59
|
if (store) {
|
|
60
|
-
const { GraphFeedbackAdapter } = await import("./dist-
|
|
60
|
+
const { GraphFeedbackAdapter } = await import("./dist-SQAOKWXM.js");
|
|
61
61
|
const adapter = new GraphFeedbackAdapter(store);
|
|
62
62
|
const changedFiles = parseResult.value.files.map((f) => f.path);
|
|
63
63
|
const impact = adapter.computeImpactData(changedFiles);
|
|
@@ -119,7 +119,7 @@ var analyzeDiffDefinition = {
|
|
|
119
119
|
};
|
|
120
120
|
async function handleAnalyzeDiff(input) {
|
|
121
121
|
try {
|
|
122
|
-
const { parseDiff, analyzeDiff } = await import("./dist-
|
|
122
|
+
const { parseDiff, analyzeDiff } = await import("./dist-ZS3Y3YWP.js");
|
|
123
123
|
const parseResult = parseDiff(input.diff);
|
|
124
124
|
if (!parseResult.ok) {
|
|
125
125
|
return resultToMcpResponse(parseResult);
|
|
@@ -139,10 +139,10 @@ async function handleAnalyzeDiff(input) {
|
|
|
139
139
|
let graphImpactData;
|
|
140
140
|
if (input.path) {
|
|
141
141
|
try {
|
|
142
|
-
const { loadGraphStore } = await import("./graph-loader-
|
|
142
|
+
const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
|
|
143
143
|
const store = await loadGraphStore(sanitizePath(input.path));
|
|
144
144
|
if (store) {
|
|
145
|
-
const { GraphFeedbackAdapter } = await import("./dist-
|
|
145
|
+
const { GraphFeedbackAdapter } = await import("./dist-SQAOKWXM.js");
|
|
146
146
|
const adapter = new GraphFeedbackAdapter(store);
|
|
147
147
|
const changedFiles = parseResult.value.files.map((f) => f.path);
|
|
148
148
|
const impact = adapter.computeImpactData(changedFiles);
|
|
@@ -195,7 +195,7 @@ var requestPeerReviewDefinition = {
|
|
|
195
195
|
};
|
|
196
196
|
async function handleRequestPeerReview(input) {
|
|
197
197
|
try {
|
|
198
|
-
const { parseDiff, requestPeerReview } = await import("./dist-
|
|
198
|
+
const { parseDiff, requestPeerReview } = await import("./dist-ZS3Y3YWP.js");
|
|
199
199
|
const parseResult = parseDiff(input.diff);
|
|
200
200
|
if (!parseResult.ok) {
|
|
201
201
|
return resultToMcpResponse(parseResult);
|
|
@@ -206,10 +206,10 @@ async function handleRequestPeerReview(input) {
|
|
|
206
206
|
...input.context ? { metadata: { context: input.context } } : {}
|
|
207
207
|
};
|
|
208
208
|
try {
|
|
209
|
-
const { loadGraphStore } = await import("./graph-loader-
|
|
209
|
+
const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
|
|
210
210
|
const store = await loadGraphStore(sanitizePath(input.path));
|
|
211
211
|
if (store) {
|
|
212
|
-
const { GraphFeedbackAdapter } = await import("./dist-
|
|
212
|
+
const { GraphFeedbackAdapter } = await import("./dist-SQAOKWXM.js");
|
|
213
213
|
const adapter = new GraphFeedbackAdapter(store);
|
|
214
214
|
const changedFiles = parseResult.value.files.map((f) => f.path);
|
|
215
215
|
const impactData = adapter.computeImpactData(changedFiles);
|
|
@@ -50,7 +50,7 @@ async function handleAssessProject(input) {
|
|
|
50
50
|
let validateResult = null;
|
|
51
51
|
if (checksToRun.has("validate")) {
|
|
52
52
|
try {
|
|
53
|
-
const { handleValidateProject } = await import("./validate-
|
|
53
|
+
const { handleValidateProject } = await import("./validate-GW2DG64P.js");
|
|
54
54
|
const result = await handleValidateProject({ path: projectPath });
|
|
55
55
|
const first = result.content[0];
|
|
56
56
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -75,7 +75,7 @@ async function handleAssessProject(input) {
|
|
|
75
75
|
parallelChecks.push(
|
|
76
76
|
(async () => {
|
|
77
77
|
try {
|
|
78
|
-
const { handleCheckDependencies } = await import("./architecture-
|
|
78
|
+
const { handleCheckDependencies } = await import("./architecture-544ISXDI.js");
|
|
79
79
|
const result = await handleCheckDependencies({ path: projectPath });
|
|
80
80
|
const first = result.content[0];
|
|
81
81
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -102,7 +102,7 @@ async function handleAssessProject(input) {
|
|
|
102
102
|
parallelChecks.push(
|
|
103
103
|
(async () => {
|
|
104
104
|
try {
|
|
105
|
-
const { handleCheckDocs } = await import("./docs-
|
|
105
|
+
const { handleCheckDocs } = await import("./docs-VW2KDPI3.js");
|
|
106
106
|
const result = await handleCheckDocs({ path: projectPath, scope: "coverage" });
|
|
107
107
|
const first = result.content[0];
|
|
108
108
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -129,7 +129,7 @@ async function handleAssessProject(input) {
|
|
|
129
129
|
parallelChecks.push(
|
|
130
130
|
(async () => {
|
|
131
131
|
try {
|
|
132
|
-
const { handleDetectEntropy } = await import("./entropy-
|
|
132
|
+
const { handleDetectEntropy } = await import("./entropy-P62LCVJI.js");
|
|
133
133
|
const result = await handleDetectEntropy({ path: projectPath, type: "all" });
|
|
134
134
|
const first = result.content[0];
|
|
135
135
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -156,7 +156,7 @@ async function handleAssessProject(input) {
|
|
|
156
156
|
parallelChecks.push(
|
|
157
157
|
(async () => {
|
|
158
158
|
try {
|
|
159
|
-
const { handleRunSecurityScan } = await import("./security-
|
|
159
|
+
const { handleRunSecurityScan } = await import("./security-IMFAE6MW.js");
|
|
160
160
|
const result = await handleRunSecurityScan({ path: projectPath });
|
|
161
161
|
const first = result.content[0];
|
|
162
162
|
const parsed = first ? JSON.parse(first.text) : {};
|
|
@@ -188,7 +188,7 @@ async function handleAssessProject(input) {
|
|
|
188
188
|
parallelChecks.push(
|
|
189
189
|
(async () => {
|
|
190
190
|
try {
|
|
191
|
-
const { handleCheckPerformance } = await import("./performance-
|
|
191
|
+
const { handleCheckPerformance } = await import("./performance-5HQG3IU6.js");
|
|
192
192
|
const result = await handleCheckPerformance({ path: projectPath });
|
|
193
193
|
if ("isError" in result && result.isError) {
|
|
194
194
|
const msg = result.content[0]?.text ?? "Performance check failed";
|
|
@@ -15,7 +15,7 @@ function evictIfNeeded() {
|
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
async function doLoadGraphStore(projectRoot) {
|
|
18
|
-
const { GraphStore } = await import("./dist-
|
|
18
|
+
const { GraphStore } = await import("./dist-SQAOKWXM.js");
|
|
19
19
|
const graphDir = path.join(projectRoot, ".harness", "graph");
|
|
20
20
|
const store = new GraphStore();
|
|
21
21
|
const loaded = await store.load(graphDir);
|
|
@@ -39,7 +39,7 @@ import * as path11 from "path";
|
|
|
39
39
|
import * as fs12 from "fs/promises";
|
|
40
40
|
import * as path13 from "path";
|
|
41
41
|
import { minimatch as minimatch2 } from "minimatch";
|
|
42
|
-
import { relative as
|
|
42
|
+
import { relative as relative6 } from "path";
|
|
43
43
|
import * as fs13 from "fs/promises";
|
|
44
44
|
import * as path14 from "path";
|
|
45
45
|
function streamGraphNdjson(filePath, nodes, edges) {
|
|
@@ -294,6 +294,9 @@ function resolveSkipDirs(options) {
|
|
|
294
294
|
}
|
|
295
295
|
return base;
|
|
296
296
|
}
|
|
297
|
+
function skipDirGlobs(skipDirs = DEFAULT_SKIP_DIRS) {
|
|
298
|
+
return Array.from(skipDirs, (name) => `**/${name}/**`);
|
|
299
|
+
}
|
|
297
300
|
function isExported(lang, line, name) {
|
|
298
301
|
if (lang === "go") return /^[A-Z]/.test(name);
|
|
299
302
|
if (lang === "rust") return /^\s*pub\b/.test(line);
|
|
@@ -395,6 +398,17 @@ function buildResult(nodesAdded, edgesAdded, errors, start) {
|
|
|
395
398
|
durationMs: Date.now() - start
|
|
396
399
|
};
|
|
397
400
|
}
|
|
401
|
+
function parseDocumentNode(nodeId, filePath, relPath, content) {
|
|
402
|
+
const titleMatch = content.match(/^#\s+(.+)$/m);
|
|
403
|
+
const title = titleMatch ? titleMatch[1].trim() : path3.basename(filePath, ".md");
|
|
404
|
+
return {
|
|
405
|
+
id: nodeId,
|
|
406
|
+
type: "document",
|
|
407
|
+
name: title,
|
|
408
|
+
path: filePath,
|
|
409
|
+
metadata: { relPath }
|
|
410
|
+
};
|
|
411
|
+
}
|
|
398
412
|
function parseADRNode(nodeId, filePath, filename, content) {
|
|
399
413
|
const titleMatch = content.match(/^#\s+(.+)$/m);
|
|
400
414
|
const title = titleMatch ? titleMatch[1].trim() : filename;
|
|
@@ -1629,7 +1643,7 @@ function parseAntiPatterns(content) {
|
|
|
1629
1643
|
}
|
|
1630
1644
|
return patterns;
|
|
1631
1645
|
}
|
|
1632
|
-
var NODE_TYPES, EDGE_TYPES, OBSERVABILITY_TYPES, CURRENT_SCHEMA_VERSION, NODE_STABILITY, GraphNodeSchema, GraphEdgeSchema, POISONED_KEYS, GraphStore, VectorStore, DEFAULT_TTL_MS, PackedSummaryCache, ContextQL, TEST_TYPES, DOC_TYPES, CODE_TYPES, DEFAULT_SKIP_DIRS, SKIP_METHOD_NAMES, FUNCTION_PATTERNS, CLASS_PATTERNS, INTERFACE_PATTERNS, METHOD_PATTERNS, GO_METHOD_PATTERN, VARIABLE_PATTERNS, SUPPORTED_EXTENSIONS, SKIP_EXTENSIONS, CodeIngestor, execFileAsync, GitIngestor, TopologicalLinker, CODE_NODE_TYPES, KnowledgeIngestor, BUG_TRACK_CATEGORIES, KNOWLEDGE_TRACK_CATEGORIES, ISO_DATE, SolutionBaseSchema, SolutionDocFrontmatterSchema, BUSINESS_KNOWLEDGE_TYPES, GOVERNS_SOURCE_TYPES, CODE_NODE_TYPES2, MEASURABLE_TYPES, BusinessKnowledgeIngestor, CODE_NODE_TYPES3, DecisionIngestor, REQUIREMENT_SECTIONS, SECTION_HEADING_RE, NUMBERED_ITEM_RE, CODE_NODE_TYPES4, RequirementIngestor, DEFAULT_PATTERNS, DEFAULT_BLOCKLIST, CODE_EXTENSIONS, MermaidParser, D2Parser, PlantUmlParser, DIAGRAM_EXTENSIONS,
|
|
1646
|
+
var NODE_TYPES, EDGE_TYPES, OBSERVABILITY_TYPES, CURRENT_SCHEMA_VERSION, NODE_STABILITY, GraphNodeSchema, GraphEdgeSchema, POISONED_KEYS, GraphStore, VectorStore, DEFAULT_TTL_MS, PackedSummaryCache, ContextQL, TEST_TYPES, DOC_TYPES, CODE_TYPES, DEFAULT_SKIP_DIRS, SKIP_METHOD_NAMES, FUNCTION_PATTERNS, CLASS_PATTERNS, INTERFACE_PATTERNS, METHOD_PATTERNS, GO_METHOD_PATTERN, VARIABLE_PATTERNS, SUPPORTED_EXTENSIONS, SKIP_EXTENSIONS, CodeIngestor, execFileAsync, GitIngestor, TopologicalLinker, CODE_NODE_TYPES, DOCS_OWNED_BY_OTHER_INGESTORS, KnowledgeIngestor, BUG_TRACK_CATEGORIES, KNOWLEDGE_TRACK_CATEGORIES, ISO_DATE, SolutionBaseSchema, SolutionDocFrontmatterSchema, BUSINESS_KNOWLEDGE_TYPES, GOVERNS_SOURCE_TYPES, CODE_NODE_TYPES2, MEASURABLE_TYPES, BusinessKnowledgeIngestor, CODE_NODE_TYPES3, DecisionIngestor, REQUIREMENT_SECTIONS, SECTION_HEADING_RE, NUMBERED_ITEM_RE, CODE_NODE_TYPES4, RequirementIngestor, DEFAULT_PATTERNS, DEFAULT_BLOCKLIST, CODE_EXTENSIONS, MermaidParser, D2Parser, PlantUmlParser, DIAGRAM_EXTENSIONS, DiagramParser, HEURISTIC_PATTERNS, SCANNABLE_TYPES, KnowledgeLinker, StructuralDriftDetector, BUSINESS_NODE_TYPES, KnowledgeStagingAggregator, EXT_TO_LANGUAGE, SKIP_EXTENSIONS2, EXTRACTOR_EDGE_TYPE, ExtractionRunner, PATTERNS, TestDescriptionExtractor, EnumConstantExtractor, ValidationRuleExtractor, ApiPathExtractor, ALL_EXTRACTORS, ImageAnalysisExtractor, KNOWLEDGE_NODE_TYPES, SIMILARITY_THRESHOLD, SEVERITY_MAP, ContradictionDetector, KNOWLEDGE_TYPES, CODE_TYPES2, KNOWLEDGE_EDGE_TYPES, CoverageScorer, VALID_BUSINESS_TYPES, DEFAULT_MAX_DOCS, MAX_COLLISION_SUFFIX, KnowledgeDocMaterializer, BUSINESS_NODE_TYPES2, SNAPSHOT_NODE_TYPES, KnowledgePipelineRunner, CODE_NODE_TYPES5, RETRYABLE_STATUSES, SANITIZE_RULES, SyncManager, SUMMARIZE_PROMPT, JiraConnector, SlackConnector, ConfluenceConnector, CIConnector, CONSTRAINT_KEYWORDS, FigmaConnector, MIN_CONTENT_LENGTH, CONCEPT_ITEM_TYPES, MiroConnector, STOP_WORDS, FusionLayer, CODE_NODE_TYPES6, GraphEntropyAdapter, GraphComplexityAdapter, GraphCouplingAdapter, DEFAULT_THRESHOLD, DEFAULT_METRICS, RECOGNIZED_METRICS, GraphAnomalyAdapter, INTENTS, SIGNAL_WEIGHTS, INTENT_SIGNALS, IntentClassifier, INTENT_KEYWORDS, STOP_WORDS2, PASCAL_OR_CAMEL_RE, FILE_PATH_RE, QUOTED_RE, EntityExtractor, EntityResolver, ResponseFormatter, CompositeProbabilityStrategy, DEFAULT_PROBABILITY_FLOOR, DEFAULT_MAX_DEPTH, CascadeSimulator, ENTITY_REQUIRED_INTENTS, classifier, extractor, formatter, PHASE_NODE_TYPES, CODE_NODE_TYPES7, Assembler, GraphConstraintAdapter, DesignIngestor, DesignConstraintAdapter, GraphFeedbackAdapter, DEFAULT_EDGE_TYPES, TaskIndependenceAnalyzer, ConflictPredictor, VERSION;
|
|
1633
1647
|
var init_dist = __esm({
|
|
1634
1648
|
"../graph/dist/index.mjs"() {
|
|
1635
1649
|
NODE_TYPES = [
|
|
@@ -3144,6 +3158,7 @@ var init_dist = __esm({
|
|
|
3144
3158
|
}
|
|
3145
3159
|
};
|
|
3146
3160
|
CODE_NODE_TYPES = ["file", "function", "class", "method", "interface", "variable"];
|
|
3161
|
+
DOCS_OWNED_BY_OTHER_INGESTORS = /* @__PURE__ */ new Set(["adr", "knowledge", "changes", "solutions"]);
|
|
3147
3162
|
KnowledgeIngestor = class {
|
|
3148
3163
|
constructor(store) {
|
|
3149
3164
|
this.store = store;
|
|
@@ -3215,15 +3230,53 @@ var init_dist = __esm({
|
|
|
3215
3230
|
}
|
|
3216
3231
|
return buildResult(nodesAdded, edgesAdded, [], start);
|
|
3217
3232
|
}
|
|
3233
|
+
async ingestGeneralDocs(projectPath) {
|
|
3234
|
+
const start = Date.now();
|
|
3235
|
+
const errors = [];
|
|
3236
|
+
let nodesAdded = 0;
|
|
3237
|
+
let edgesAdded = 0;
|
|
3238
|
+
const files = /* @__PURE__ */ new Set();
|
|
3239
|
+
try {
|
|
3240
|
+
const entries = await fs2.readdir(projectPath, { withFileTypes: true });
|
|
3241
|
+
for (const entry of entries) {
|
|
3242
|
+
if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3243
|
+
files.add(path3.join(projectPath, entry.name));
|
|
3244
|
+
}
|
|
3245
|
+
}
|
|
3246
|
+
} catch {
|
|
3247
|
+
return emptyResult(Date.now() - start);
|
|
3248
|
+
}
|
|
3249
|
+
const docsRoot = path3.join(projectPath, "docs");
|
|
3250
|
+
try {
|
|
3251
|
+
const scanned = await this.scanDocsDir(docsRoot);
|
|
3252
|
+
for (const f of scanned) files.add(f);
|
|
3253
|
+
} catch {
|
|
3254
|
+
}
|
|
3255
|
+
for (const filePath of files) {
|
|
3256
|
+
try {
|
|
3257
|
+
const content = await fs2.readFile(filePath, "utf-8");
|
|
3258
|
+
const relPath = path3.relative(projectPath, filePath).replaceAll("\\", "/");
|
|
3259
|
+
const nodeId = `doc:${relPath}`;
|
|
3260
|
+
if (this.store.getNode(nodeId)) continue;
|
|
3261
|
+
this.store.addNode(parseDocumentNode(nodeId, filePath, relPath, content));
|
|
3262
|
+
nodesAdded++;
|
|
3263
|
+
edgesAdded += this.linkToCode(content, nodeId, "documents");
|
|
3264
|
+
} catch (err) {
|
|
3265
|
+
errors.push(`${filePath}: ${err instanceof Error ? err.message : String(err)}`);
|
|
3266
|
+
}
|
|
3267
|
+
}
|
|
3268
|
+
return buildResult(nodesAdded, edgesAdded, errors, start);
|
|
3269
|
+
}
|
|
3218
3270
|
async ingestAll(projectPath, opts) {
|
|
3219
3271
|
const start = Date.now();
|
|
3220
3272
|
const adrDir = opts?.adrDir ?? path3.join(projectPath, "docs", "adr");
|
|
3221
|
-
const [adrResult, learningsResult, failuresResult] = await Promise.all([
|
|
3273
|
+
const [adrResult, learningsResult, failuresResult, docsResult] = await Promise.all([
|
|
3222
3274
|
this.ingestADRs(adrDir),
|
|
3223
3275
|
this.ingestLearnings(projectPath),
|
|
3224
|
-
this.ingestFailures(projectPath)
|
|
3276
|
+
this.ingestFailures(projectPath),
|
|
3277
|
+
this.ingestGeneralDocs(projectPath)
|
|
3225
3278
|
]);
|
|
3226
|
-
const merged = mergeResults(adrResult, learningsResult, failuresResult);
|
|
3279
|
+
const merged = mergeResults(adrResult, learningsResult, failuresResult, docsResult);
|
|
3227
3280
|
return { ...merged, durationMs: Date.now() - start };
|
|
3228
3281
|
}
|
|
3229
3282
|
linkToCode(content, sourceNodeId, edgeType) {
|
|
@@ -3258,7 +3311,22 @@ var init_dist = __esm({
|
|
|
3258
3311
|
const entries = await fs2.readdir(dir, { withFileTypes: true });
|
|
3259
3312
|
for (const entry of entries) {
|
|
3260
3313
|
const fullPath = path3.join(dir, entry.name);
|
|
3261
|
-
if (entry.isDirectory() &&
|
|
3314
|
+
if (entry.isDirectory() && !DEFAULT_SKIP_DIRS.has(entry.name)) {
|
|
3315
|
+
results.push(...await this.findMarkdownFiles(fullPath));
|
|
3316
|
+
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3317
|
+
results.push(fullPath);
|
|
3318
|
+
}
|
|
3319
|
+
}
|
|
3320
|
+
return results;
|
|
3321
|
+
}
|
|
3322
|
+
async scanDocsDir(docsRoot) {
|
|
3323
|
+
const results = [];
|
|
3324
|
+
const rootEntries = await fs2.readdir(docsRoot, { withFileTypes: true });
|
|
3325
|
+
for (const entry of rootEntries) {
|
|
3326
|
+
const fullPath = path3.join(docsRoot, entry.name);
|
|
3327
|
+
if (entry.isDirectory()) {
|
|
3328
|
+
if (DEFAULT_SKIP_DIRS.has(entry.name)) continue;
|
|
3329
|
+
if (DOCS_OWNED_BY_OTHER_INGESTORS.has(entry.name)) continue;
|
|
3262
3330
|
results.push(...await this.findMarkdownFiles(fullPath));
|
|
3263
3331
|
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3264
3332
|
results.push(fullPath);
|
|
@@ -3497,7 +3565,7 @@ var init_dist = __esm({
|
|
|
3497
3565
|
const entries = await fs3.readdir(dir, { withFileTypes: true });
|
|
3498
3566
|
for (const entry of entries) {
|
|
3499
3567
|
const fullPath = path4.join(dir, entry.name);
|
|
3500
|
-
if (entry.isDirectory() &&
|
|
3568
|
+
if (entry.isDirectory() && !DEFAULT_SKIP_DIRS.has(entry.name)) {
|
|
3501
3569
|
results.push(...await this.findMarkdownFiles(fullPath));
|
|
3502
3570
|
} else if (entry.isFile() && entry.name.endsWith(".md")) {
|
|
3503
3571
|
results.push(fullPath);
|
|
@@ -3930,7 +3998,6 @@ var init_dist = __esm({
|
|
|
3930
3998
|
}
|
|
3931
3999
|
};
|
|
3932
4000
|
DIAGRAM_EXTENSIONS = /* @__PURE__ */ new Set([".mmd", ".mermaid", ".d2", ".puml", ".plantuml"]);
|
|
3933
|
-
SKIP_DIRS = /* @__PURE__ */ new Set(["node_modules", ".git", "dist", "build", ".harness"]);
|
|
3934
4001
|
DiagramParser = class {
|
|
3935
4002
|
constructor(store) {
|
|
3936
4003
|
this.store = store;
|
|
@@ -4035,7 +4102,7 @@ var init_dist = __esm({
|
|
|
4035
4102
|
}
|
|
4036
4103
|
for (const entry of entries) {
|
|
4037
4104
|
if (entry.isDirectory()) {
|
|
4038
|
-
if (!
|
|
4105
|
+
if (!DEFAULT_SKIP_DIRS.has(entry.name)) {
|
|
4039
4106
|
await walk(path7.join(currentDir, entry.name));
|
|
4040
4107
|
}
|
|
4041
4108
|
} else if (entry.isFile()) {
|
|
@@ -4537,31 +4604,6 @@ var init_dist = __esm({
|
|
|
4537
4604
|
await fs8.writeFile(path9.join(gapsDir, "gaps.md"), lines.join("\n"), "utf-8");
|
|
4538
4605
|
}
|
|
4539
4606
|
};
|
|
4540
|
-
SKIP_DIRS2 = /* @__PURE__ */ new Set([
|
|
4541
|
-
"node_modules",
|
|
4542
|
-
"dist",
|
|
4543
|
-
"target",
|
|
4544
|
-
"build",
|
|
4545
|
-
".git",
|
|
4546
|
-
"__pycache__",
|
|
4547
|
-
".venv",
|
|
4548
|
-
".turbo",
|
|
4549
|
-
".harness",
|
|
4550
|
-
".next",
|
|
4551
|
-
".vscode",
|
|
4552
|
-
".idea",
|
|
4553
|
-
"vendor",
|
|
4554
|
-
"out",
|
|
4555
|
-
".gradle",
|
|
4556
|
-
".gradle-home",
|
|
4557
|
-
"bin",
|
|
4558
|
-
"obj",
|
|
4559
|
-
"venv",
|
|
4560
|
-
"_build",
|
|
4561
|
-
"deps",
|
|
4562
|
-
"coverage",
|
|
4563
|
-
".nyc_output"
|
|
4564
|
-
]);
|
|
4565
4607
|
EXT_TO_LANGUAGE = {
|
|
4566
4608
|
".ts": "typescript",
|
|
4567
4609
|
".tsx": "typescript",
|
|
@@ -4732,7 +4774,7 @@ var init_dist = __esm({
|
|
|
4732
4774
|
}
|
|
4733
4775
|
for (const entry of entries) {
|
|
4734
4776
|
const fullPath = path10.join(dir, entry.name);
|
|
4735
|
-
if (entry.isDirectory() && !
|
|
4777
|
+
if (entry.isDirectory() && !DEFAULT_SKIP_DIRS.has(entry.name)) {
|
|
4736
4778
|
results.push(...await this.findSourceFiles(fullPath));
|
|
4737
4779
|
} else if (entry.isFile() && detectLanguage(fullPath) !== void 0) {
|
|
4738
4780
|
results.push(fullPath);
|
|
@@ -8998,8 +9040,8 @@ ${replyLines.join("\n")}`;
|
|
|
8998
9040
|
const { edges } = this.computeDependencyGraph();
|
|
8999
9041
|
const violations = [];
|
|
9000
9042
|
for (const edge of edges) {
|
|
9001
|
-
const fromRelative =
|
|
9002
|
-
const toRelative =
|
|
9043
|
+
const fromRelative = relative6(rootDir, edge.from).replaceAll("\\", "/");
|
|
9044
|
+
const toRelative = relative6(rootDir, edge.to).replaceAll("\\", "/");
|
|
9003
9045
|
const fromLayer = this.resolveLayer(fromRelative, layers);
|
|
9004
9046
|
const toLayer = this.resolveLayer(toRelative, layers);
|
|
9005
9047
|
if (!fromLayer || !toLayer) continue;
|
|
@@ -9724,6 +9766,7 @@ export {
|
|
|
9724
9766
|
groupNodesByImpact,
|
|
9725
9767
|
DEFAULT_SKIP_DIRS,
|
|
9726
9768
|
resolveSkipDirs,
|
|
9769
|
+
skipDirGlobs,
|
|
9727
9770
|
CodeIngestor,
|
|
9728
9771
|
GitIngestor,
|
|
9729
9772
|
TopologicalLinker,
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
} from "./chunk-W6Y7ZW3Y.js";
|
|
7
7
|
import {
|
|
8
8
|
init_dist
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-YNG7BWGB.js";
|
|
10
10
|
import {
|
|
11
11
|
Ok
|
|
12
12
|
} from "./chunk-RL4VMEXL.js";
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
// src/mcp/tools/entropy.ts
|
|
15
15
|
init_dist();
|
|
16
16
|
async function loadEntropyGraphOptions(projectPath) {
|
|
17
|
-
const { loadGraphStore } = await import("./graph-loader-
|
|
17
|
+
const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
|
|
18
18
|
const store = await loadGraphStore(projectPath);
|
|
19
19
|
if (!store) return void 0;
|
|
20
|
-
const { GraphEntropyAdapter } = await import("./dist-
|
|
20
|
+
const { GraphEntropyAdapter } = await import("./dist-SQAOKWXM.js");
|
|
21
21
|
const adapter = new GraphEntropyAdapter(store);
|
|
22
22
|
const driftData = adapter.computeDriftData();
|
|
23
23
|
const deadCodeData = adapter.computeDeadCodeData();
|
|
@@ -127,7 +127,7 @@ function buildSummaryResponse(report) {
|
|
|
127
127
|
}
|
|
128
128
|
async function handleDetectEntropy(input) {
|
|
129
129
|
try {
|
|
130
|
-
const { EntropyAnalyzer } = await import("./dist-
|
|
130
|
+
const { EntropyAnalyzer } = await import("./dist-ZS3Y3YWP.js");
|
|
131
131
|
const typeFilter = input.type ?? "all";
|
|
132
132
|
const analyzer = new EntropyAnalyzer({
|
|
133
133
|
rootDir: sanitizePath(input.path),
|
|
@@ -146,7 +146,7 @@ async function handleDetectEntropy(input) {
|
|
|
146
146
|
return resultToMcpResponse(result);
|
|
147
147
|
}
|
|
148
148
|
if (!result.ok) return resultToMcpResponse(result);
|
|
149
|
-
const { createFixes, applyFixes, generateSuggestions } = await import("./dist-
|
|
149
|
+
const { createFixes, applyFixes, generateSuggestions } = await import("./dist-ZS3Y3YWP.js");
|
|
150
150
|
const report = result.value;
|
|
151
151
|
const deadCode = report.deadCode;
|
|
152
152
|
const fixTypesConfig = input.fixTypes ? { fixTypes: input.fixTypes } : void 0;
|