@harness-engineering/cli 2.4.0 → 2.4.2

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.
Files changed (64) hide show
  1. package/dist/agents-md-2M46KG4F.js +10 -0
  2. package/dist/{architecture-I2G7PNQB.js → architecture-3ZSN5RDQ.js} +5 -5
  3. package/dist/{assess-project-LO6NCLE7.js → assess-project-KZWFQEJE.js} +5 -3
  4. package/dist/bin/harness-mcp.js +16 -16
  5. package/dist/bin/harness.js +29 -27
  6. package/dist/{check-phase-gate-52SQFNJB.js → check-phase-gate-EWV5VYTG.js} +5 -5
  7. package/dist/{chunk-GDJ2MRYH.js → chunk-2TGCYJMT.js} +259 -5
  8. package/dist/{chunk-TIQU5VY7.js → chunk-5FDBXUFW.js} +1 -1
  9. package/dist/{chunk-7BNK4M23.js → chunk-5XLLIYYL.js} +1 -1
  10. package/dist/{chunk-U4XK4BB3.js → chunk-73KZ2E47.js} +9 -9
  11. package/dist/{chunk-NGCM4B4V.js → chunk-7RZZV73V.js} +5 -5
  12. package/dist/{chunk-WY2J54IZ.js → chunk-B2ZYMQGT.js} +64 -30
  13. package/dist/{chunk-XPRGWHBL.js → chunk-BCFDGOMA.js} +1 -1
  14. package/dist/{chunk-27EHWQPK.js → chunk-GLKASJZE.js} +6 -6
  15. package/dist/{chunk-TCR5PKMU.js → chunk-GOSUZC5H.js} +514 -208
  16. package/dist/{chunk-MQRKPF46.js → chunk-I2KULMPD.js} +10 -10
  17. package/dist/{chunk-4XB37LST.js → chunk-IEHXZB6J.js} +9 -9
  18. package/dist/{chunk-5YOHXTK3.js → chunk-KOK7BFP2.js} +3 -3
  19. package/dist/{chunk-2L2A6W6I.js → chunk-KRQTN46U.js} +3 -3
  20. package/dist/{chunk-GN2CSZC6.js → chunk-LHHO7AH4.js} +3 -3
  21. package/dist/{chunk-OFMQEUYN.js → chunk-LJF6UY4R.js} +2 -2
  22. package/dist/{chunk-KPWUZSHL.js → chunk-MXOQEI72.js} +25 -8
  23. package/dist/{chunk-54JTO4NZ.js → chunk-NM3ZIWVN.js} +2 -2
  24. package/dist/{chunk-JGPOQJ73.js → chunk-NTOKQJOX.js} +2 -2
  25. package/dist/chunk-O63AAPIZ.js +190 -0
  26. package/dist/{chunk-TVJZX53C.js → chunk-OUXYITL5.js} +2 -2
  27. package/dist/{chunk-MSBVH6ER.js → chunk-PPQ3TY2R.js} +2 -2
  28. package/dist/{chunk-RYVL76ZF.js → chunk-QV5EBDWA.js} +1 -1
  29. package/dist/{chunk-FJJYQWUP.js → chunk-RRTTJ3VB.js} +2 -2
  30. package/dist/{chunk-Q43LM7CO.js → chunk-TPNA2I4J.js} +206 -97
  31. package/dist/{chunk-RZASDABE.js → chunk-UPV7VDUB.js} +2 -2
  32. package/dist/{chunk-DJRRTZGD.js → chunk-UQJV7NNM.js} +2 -2
  33. package/dist/ci-workflow-5TBUHJFC.js +10 -0
  34. package/dist/{dist-ZJGFXGIB.js → dist-HA6IIPRC.js} +39 -3
  35. package/dist/dist-O733ZU6I.js +49 -0
  36. package/dist/{dist-SQAOKWXM.js → dist-QPWXPCPL.js} +1 -1
  37. package/dist/{docs-7CW7WUFB.js → docs-D6WI2LCF.js} +5 -5
  38. package/dist/engine-GBEVIZZQ.js +10 -0
  39. package/dist/{entropy-P6QELTFA.js → entropy-V6M4KJDC.js} +4 -4
  40. package/dist/{feedback-PJWCDRRZ.js → feedback-22I4HHXM.js} +1 -1
  41. package/dist/{generate-agent-definitions-ONDIJHHK.js → generate-agent-definitions-UM7T3WLA.js} +5 -5
  42. package/dist/{glob-helper-JE3MO4UD.js → glob-helper-XE2UGEOV.js} +1 -1
  43. package/dist/{graph-loader-TJU4E7KL.js → graph-loader-EQBOIHFZ.js} +1 -1
  44. package/dist/index.d.ts +100 -10
  45. package/dist/index.js +26 -26
  46. package/dist/loader-5V72NYMF.js +12 -0
  47. package/dist/{mcp-UUNLS3MC.js → mcp-5KQGFG5U.js} +16 -16
  48. package/dist/{performance-7X3EFAOD.js → performance-MVORVVMG.js} +5 -5
  49. package/dist/{review-pipeline-GAJ22PBC.js → review-pipeline-JYSVCNGJ.js} +4 -4
  50. package/dist/runtime-KZC2OQI7.js +11 -0
  51. package/dist/{scan-SFX5U3TE.js → scan-4PPP6ZXT.js} +1 -1
  52. package/dist/{security-ZSU643D7.js → security-WOVOBLCI.js} +1 -1
  53. package/dist/{tool-tiers-7QGZ3FKY.js → tool-tiers-QVWKAZX4.js} +5 -1
  54. package/dist/{validate-IDX6RI3U.js → validate-55HGQKWR.js} +5 -5
  55. package/dist/validate-cross-check-H3PSV4VY.js +10 -0
  56. package/package.json +6 -6
  57. package/dist/agents-md-ROTDQOXM.js +0 -10
  58. package/dist/chunk-RL4VMEXL.js +0 -53
  59. package/dist/ci-workflow-MYBH64CR.js +0 -10
  60. package/dist/dist-3EWNRFFQ.js +0 -21
  61. package/dist/engine-Y75QZW6N.js +0 -10
  62. package/dist/loader-DQRNWKOZ.js +0 -12
  63. package/dist/runtime-6TK6U72R.js +0 -11
  64. package/dist/validate-cross-check-5YEWZ3EW.js +0 -10
@@ -7,13 +7,13 @@ import {
7
7
  import {
8
8
  findConfigFile,
9
9
  loadConfig
10
- } from "./chunk-KPWUZSHL.js";
10
+ } from "./chunk-MXOQEI72.js";
11
11
  import {
12
12
  init_dist
13
- } from "./chunk-GDJ2MRYH.js";
13
+ } from "./chunk-2TGCYJMT.js";
14
14
  import {
15
15
  Ok
16
- } from "./chunk-RL4VMEXL.js";
16
+ } from "./chunk-O63AAPIZ.js";
17
17
 
18
18
  // src/mcp/tools/performance.ts
19
19
  init_dist();
@@ -35,7 +35,7 @@ var checkPerformanceDefinition = {
35
35
  };
36
36
  async function handleCheckPerformance(input) {
37
37
  try {
38
- const { EntropyAnalyzer } = await import("./dist-ZJGFXGIB.js");
38
+ const { EntropyAnalyzer } = await import("./dist-HA6IIPRC.js");
39
39
  const typeFilter = input.type ?? "all";
40
40
  const projectPath = sanitizePath(input.path);
41
41
  let entryPoints;
@@ -58,10 +58,10 @@ async function handleCheckPerformance(input) {
58
58
  });
59
59
  let graphOptions;
60
60
  try {
61
- const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
61
+ const { loadGraphStore } = await import("./graph-loader-EQBOIHFZ.js");
62
62
  const store = await loadGraphStore(projectPath);
63
63
  if (store) {
64
- const { GraphComplexityAdapter, GraphCouplingAdapter } = await import("./dist-SQAOKWXM.js");
64
+ const { GraphComplexityAdapter, GraphCouplingAdapter } = await import("./dist-QPWXPCPL.js");
65
65
  const complexityAdapter = new GraphComplexityAdapter(store);
66
66
  const couplingAdapter = new GraphCouplingAdapter(store);
67
67
  graphOptions = {
@@ -98,7 +98,7 @@ var getPerfBaselinesDefinition = {
98
98
  };
99
99
  async function handleGetPerfBaselines(input) {
100
100
  try {
101
- const { BaselineManager } = await import("./dist-ZJGFXGIB.js");
101
+ const { BaselineManager } = await import("./dist-HA6IIPRC.js");
102
102
  const manager = new BaselineManager(sanitizePath(input.path));
103
103
  const baselines = manager.load();
104
104
  return resultToMcpResponse(
@@ -146,7 +146,7 @@ var updatePerfBaselinesDefinition = {
146
146
  };
147
147
  async function handleUpdatePerfBaselines(input) {
148
148
  try {
149
- const { BaselineManager } = await import("./dist-ZJGFXGIB.js");
149
+ const { BaselineManager } = await import("./dist-HA6IIPRC.js");
150
150
  const manager = new BaselineManager(sanitizePath(input.path));
151
151
  manager.save(input.results, input.commitHash);
152
152
  const updated = manager.load();
@@ -176,7 +176,7 @@ var getCriticalPathsDefinition = {
176
176
  };
177
177
  async function handleGetCriticalPaths(input) {
178
178
  try {
179
- const { CriticalPathResolver } = await import("./dist-ZJGFXGIB.js");
179
+ const { CriticalPathResolver } = await import("./dist-HA6IIPRC.js");
180
180
  const resolver = new CriticalPathResolver(sanitizePath(input.path));
181
181
  const result = await resolver.resolve();
182
182
  return resultToMcpResponse(Ok(result));
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveProjectConfig
3
- } from "./chunk-OFMQEUYN.js";
3
+ } from "./chunk-LJF6UY4R.js";
4
4
  import {
5
5
  resultToMcpResponse
6
6
  } from "./chunk-EPUKTTJZ.js";
@@ -38,7 +38,7 @@ async function handleCheckDependencies(input) {
38
38
  const configResult = resolveProjectConfig(projectPath);
39
39
  if (!configResult.ok) return resultToMcpResponse(configResult);
40
40
  try {
41
- const { validateDependencies, TypeScriptParser } = await import("./dist-ZJGFXGIB.js");
41
+ const { validateDependencies, TypeScriptParser } = await import("./dist-HA6IIPRC.js");
42
42
  const config = configResult.value;
43
43
  const rawLayers = Array.isArray(config.layers) ? config.layers : [];
44
44
  const layers = rawLayers.map((l) => ({
@@ -47,11 +47,11 @@ async function handleCheckDependencies(input) {
47
47
  allowedDependencies: l.allowedDependencies
48
48
  }));
49
49
  const parser = new TypeScriptParser();
50
- const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
50
+ const { loadGraphStore } = await import("./graph-loader-EQBOIHFZ.js");
51
51
  const store = await loadGraphStore(projectPath);
52
52
  let graphDependencyData;
53
53
  if (store) {
54
- const { GraphConstraintAdapter } = await import("./dist-SQAOKWXM.js");
54
+ const { GraphConstraintAdapter } = await import("./dist-QPWXPCPL.js");
55
55
  const adapter = new GraphConstraintAdapter(store);
56
56
  const graphData = adapter.computeDependencyGraph();
57
57
  graphDependencyData = {
@@ -69,7 +69,7 @@ async function handleCheckDependencies(input) {
69
69
  if (store) {
70
70
  const designTokenNodes = store.findNodes({ type: "design_token" });
71
71
  if (designTokenNodes.length > 0) {
72
- const { DesignConstraintAdapter } = await import("./dist-SQAOKWXM.js");
72
+ const { DesignConstraintAdapter } = await import("./dist-QPWXPCPL.js");
73
73
  const designAdapter = new DesignConstraintAdapter(store);
74
74
  const fileNodes = store.findNodes({ type: "file" });
75
75
  for (const fileNode of fileNodes) {
@@ -27,6 +27,28 @@ var assessProjectDefinition = {
27
27
  required: ["path"]
28
28
  }
29
29
  };
30
+ function parseToolResponse(result, checkName) {
31
+ if ("isError" in result && result.isError) {
32
+ const msg = result.content[0]?.text ?? `${checkName} check failed`;
33
+ return {
34
+ error: { name: checkName, passed: false, issueCount: 1, topIssue: msg }
35
+ };
36
+ }
37
+ const first = result.content[0];
38
+ try {
39
+ const parsed = first ? JSON.parse(first.text) : {};
40
+ return { parsed };
41
+ } catch {
42
+ return {
43
+ error: {
44
+ name: checkName,
45
+ passed: false,
46
+ issueCount: 1,
47
+ topIssue: first?.text ?? `Invalid ${checkName} output`
48
+ }
49
+ };
50
+ }
51
+ }
30
52
  async function handleAssessProject(input) {
31
53
  const start = Date.now();
32
54
  let projectPath;
@@ -50,17 +72,21 @@ async function handleAssessProject(input) {
50
72
  let validateResult = null;
51
73
  if (checksToRun.has("validate")) {
52
74
  try {
53
- const { handleValidateProject } = await import("./validate-IDX6RI3U.js");
75
+ const { handleValidateProject } = await import("./validate-55HGQKWR.js");
54
76
  const result = await handleValidateProject({ path: projectPath });
55
- const first = result.content[0];
56
- const parsed = first ? JSON.parse(first.text) : {};
57
- validateResult = {
58
- name: "validate",
59
- passed: parsed.valid === true,
60
- issueCount: parsed.errors?.length ?? 0,
61
- ...parsed.errors?.length > 0 ? { topIssue: parsed.errors[0] } : {},
62
- ...mode === "detailed" ? { detailed: parsed } : {}
63
- };
77
+ const out = parseToolResponse(result, "validate");
78
+ if ("error" in out) {
79
+ validateResult = out.error;
80
+ } else {
81
+ const { parsed } = out;
82
+ validateResult = {
83
+ name: "validate",
84
+ passed: parsed.valid === true,
85
+ issueCount: parsed.errors?.length ?? 0,
86
+ ...parsed.errors?.length ? { topIssue: parsed.errors[0] } : {},
87
+ ...mode === "detailed" ? { detailed: parsed } : {}
88
+ };
89
+ }
64
90
  } catch (error) {
65
91
  validateResult = {
66
92
  name: "validate",
@@ -75,16 +101,17 @@ async function handleAssessProject(input) {
75
101
  parallelChecks.push(
76
102
  (async () => {
77
103
  try {
78
- const { handleCheckDependencies } = await import("./architecture-I2G7PNQB.js");
104
+ const { handleCheckDependencies } = await import("./architecture-3ZSN5RDQ.js");
79
105
  const result = await handleCheckDependencies({ path: projectPath });
80
- const first = result.content[0];
81
- const parsed = first ? JSON.parse(first.text) : {};
106
+ const out = parseToolResponse(result, "deps");
107
+ if ("error" in out) return out.error;
108
+ const { parsed } = out;
82
109
  const violations = parsed.violations ?? [];
83
110
  return {
84
111
  name: "deps",
85
- passed: !result.isError && violations.length === 0,
112
+ passed: violations.length === 0,
86
113
  issueCount: violations.length,
87
- ...violations.length > 0 ? { topIssue: violations[0]?.message ?? String(violations[0]) } : {},
114
+ ...violations.length > 0 ? { topIssue: violations[0]?.message ?? JSON.stringify(violations[0]) } : {},
88
115
  ...mode === "detailed" ? { detailed: parsed } : {}
89
116
  };
90
117
  } catch (error) {
@@ -102,16 +129,17 @@ async function handleAssessProject(input) {
102
129
  parallelChecks.push(
103
130
  (async () => {
104
131
  try {
105
- const { handleCheckDocs } = await import("./docs-7CW7WUFB.js");
132
+ const { handleCheckDocs } = await import("./docs-D6WI2LCF.js");
106
133
  const result = await handleCheckDocs({ path: projectPath, scope: "coverage" });
107
- const first = result.content[0];
108
- const parsed = first ? JSON.parse(first.text) : {};
134
+ const out = parseToolResponse(result, "docs");
135
+ if ("error" in out) return out.error;
136
+ const { parsed } = out;
109
137
  const undocumented = parsed.undocumented ?? parsed.files?.undocumented ?? [];
110
138
  return {
111
139
  name: "docs",
112
- passed: !result.isError,
140
+ passed: true,
113
141
  issueCount: Array.isArray(undocumented) ? undocumented.length : 0,
114
- ...Array.isArray(undocumented) && undocumented.length > 0 ? { topIssue: `Undocumented: ${undocumented[0]}` } : {},
142
+ ...Array.isArray(undocumented) && undocumented.length > 0 ? { topIssue: `Undocumented: ${String(undocumented[0])}` } : {},
115
143
  ...mode === "detailed" ? { detailed: parsed } : {}
116
144
  };
117
145
  } catch (error) {
@@ -129,14 +157,18 @@ async function handleAssessProject(input) {
129
157
  parallelChecks.push(
130
158
  (async () => {
131
159
  try {
132
- const { handleDetectEntropy } = await import("./entropy-P6QELTFA.js");
160
+ const { handleDetectEntropy } = await import("./entropy-V6M4KJDC.js");
133
161
  const result = await handleDetectEntropy({ path: projectPath, type: "all" });
134
- const first = result.content[0];
135
- const parsed = first ? JSON.parse(first.text) : {};
136
- const issues = (parsed.drift?.staleReferences?.length ?? 0) + (parsed.drift?.missingTargets?.length ?? 0) + (parsed.deadCode?.unusedImports?.length ?? 0) + (parsed.deadCode?.unusedExports?.length ?? 0) + (parsed.patterns?.violations?.length ?? 0);
162
+ const out = parseToolResponse(result, "entropy");
163
+ if ("error" in out) return out.error;
164
+ const { parsed } = out;
165
+ const drift = parsed.drift;
166
+ const deadCode = parsed.deadCode;
167
+ const patterns = parsed.patterns;
168
+ const issues = (drift?.staleReferences?.length ?? 0) + (drift?.missingTargets?.length ?? 0) + (deadCode?.unusedImports?.length ?? 0) + (deadCode?.unusedExports?.length ?? 0) + (patterns?.violations?.length ?? 0);
137
169
  return {
138
170
  name: "entropy",
139
- passed: !("isError" in result && result.isError) && issues === 0,
171
+ passed: issues === 0,
140
172
  issueCount: issues,
141
173
  ...issues > 0 ? { topIssue: "Entropy detected -- run detect_entropy for details" } : {},
142
174
  ...mode === "detailed" ? { detailed: parsed } : {}
@@ -156,17 +188,18 @@ async function handleAssessProject(input) {
156
188
  parallelChecks.push(
157
189
  (async () => {
158
190
  try {
159
- const { handleRunSecurityScan } = await import("./security-ZSU643D7.js");
191
+ const { handleRunSecurityScan } = await import("./security-WOVOBLCI.js");
160
192
  const result = await handleRunSecurityScan({ path: projectPath });
161
- const first = result.content[0];
162
- const parsed = first ? JSON.parse(first.text) : {};
193
+ const out = parseToolResponse(result, "security");
194
+ if ("error" in out) return out.error;
195
+ const { parsed } = out;
163
196
  const findings = parsed.findings ?? [];
164
197
  const errorCount = findings.filter(
165
198
  (f) => f.severity === "error"
166
199
  ).length;
167
200
  return {
168
201
  name: "security",
169
- passed: !result.isError && errorCount === 0,
202
+ passed: errorCount === 0,
170
203
  issueCount: findings.length,
171
204
  ...findings.length > 0 ? {
172
205
  topIssue: `${findings[0]?.rule ?? findings[0]?.type ?? "finding"}: ${findings[0]?.message ?? ""}`
@@ -188,7 +221,7 @@ async function handleAssessProject(input) {
188
221
  parallelChecks.push(
189
222
  (async () => {
190
223
  try {
191
- const { handleCheckPerformance } = await import("./performance-7X3EFAOD.js");
224
+ const { handleCheckPerformance } = await import("./performance-MVORVVMG.js");
192
225
  const result = await handleCheckPerformance({ path: projectPath });
193
226
  if ("isError" in result && result.isError) {
194
227
  const msg = result.content[0]?.text ?? "Performance check failed";
@@ -289,5 +322,6 @@ async function handleAssessProject(input) {
289
322
 
290
323
  export {
291
324
  assessProjectDefinition,
325
+ parseToolResponse,
292
326
  handleAssessProject
293
327
  };
@@ -9741,7 +9741,7 @@ ${replyLines.join("\n")}`;
9741
9741
  return parts.join(" ");
9742
9742
  }
9743
9743
  };
9744
- VERSION = "0.6.0";
9744
+ VERSION = "0.9.0";
9745
9745
  }
9746
9746
  });
9747
9747
 
@@ -6,18 +6,18 @@ import {
6
6
  } from "./chunk-W6Y7ZW3Y.js";
7
7
  import {
8
8
  init_dist
9
- } from "./chunk-GDJ2MRYH.js";
9
+ } from "./chunk-2TGCYJMT.js";
10
10
  import {
11
11
  Ok
12
- } from "./chunk-RL4VMEXL.js";
12
+ } from "./chunk-O63AAPIZ.js";
13
13
 
14
14
  // src/mcp/tools/entropy.ts
15
15
  init_dist();
16
16
  async function loadEntropyGraphOptions(projectPath) {
17
- const { loadGraphStore } = await import("./graph-loader-TJU4E7KL.js");
17
+ const { loadGraphStore } = await import("./graph-loader-EQBOIHFZ.js");
18
18
  const store = await loadGraphStore(projectPath);
19
19
  if (!store) return void 0;
20
- const { GraphEntropyAdapter } = await import("./dist-SQAOKWXM.js");
20
+ const { GraphEntropyAdapter } = await import("./dist-QPWXPCPL.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-ZJGFXGIB.js");
130
+ const { EntropyAnalyzer } = await import("./dist-HA6IIPRC.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-ZJGFXGIB.js");
149
+ const { createFixes, applyFixes, generateSuggestions } = await import("./dist-HA6IIPRC.js");
150
150
  const report = result.value;
151
151
  const deadCode = report.deadCode;
152
152
  const fixTypesConfig = input.fixTypes ? { fixTypes: input.fixTypes } : void 0;