@harness-engineering/cli 1.20.0 → 1.20.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/bin/harness-mcp.js +1 -1
- package/dist/bin/harness.js +2 -2
- package/dist/{chunk-RJFWCL6M.js → chunk-HAJD5LTI.js} +2 -2
- package/dist/{chunk-YL4UHE52.js → chunk-SQY4AAKP.js} +31 -22
- package/dist/index.d.ts +10 -8
- package/dist/index.js +2 -2
- package/dist/{mcp-I7UP73GV.js → mcp-KEY575NJ.js} +1 -1
- package/package.json +4 -4
package/dist/bin/harness-mcp.js
CHANGED
package/dist/bin/harness.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
createProgram,
|
|
4
4
|
printFirstRunWelcome
|
|
5
|
-
} from "../chunk-
|
|
5
|
+
} from "../chunk-HAJD5LTI.js";
|
|
6
6
|
import "../chunk-SD3SQOZ2.js";
|
|
7
7
|
import "../chunk-PDOSLTWP.js";
|
|
8
8
|
import "../chunk-6KWBH4EO.js";
|
|
@@ -16,7 +16,7 @@ import "../chunk-DBSOCI3G.js";
|
|
|
16
16
|
import "../chunk-FIAPHX37.js";
|
|
17
17
|
import "../chunk-KET4QQZB.js";
|
|
18
18
|
import "../chunk-OD3S2NHN.js";
|
|
19
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-SQY4AAKP.js";
|
|
20
20
|
import "../chunk-4U4V7A6U.js";
|
|
21
21
|
import "../chunk-PDEEQJHH.js";
|
|
22
22
|
import "../chunk-V73TEHIF.js";
|
|
@@ -50,7 +50,7 @@ import {
|
|
|
50
50
|
handleGetImpact,
|
|
51
51
|
handleOrphanDeletion,
|
|
52
52
|
persistToolingConfig
|
|
53
|
-
} from "./chunk-
|
|
53
|
+
} from "./chunk-SQY4AAKP.js";
|
|
54
54
|
import {
|
|
55
55
|
VALID_PLATFORMS
|
|
56
56
|
} from "./chunk-CJDVBBPB.js";
|
|
@@ -5095,7 +5095,7 @@ function createGraphCommand() {
|
|
|
5095
5095
|
import { Command as Command50 } from "commander";
|
|
5096
5096
|
function createMcpCommand() {
|
|
5097
5097
|
return new Command50("mcp").description("Start the MCP (Model Context Protocol) server on stdio").option("--tools <tools...>", "Only register the specified tools (used by Cursor integration)").action(async (opts) => {
|
|
5098
|
-
const { startServer: startServer2 } = await import("./mcp-
|
|
5098
|
+
const { startServer: startServer2 } = await import("./mcp-KEY575NJ.js");
|
|
5099
5099
|
await startServer2(opts.tools);
|
|
5100
5100
|
});
|
|
5101
5101
|
}
|
|
@@ -150,6 +150,7 @@ function isDestructiveOperation(toolName, toolInput, workspaceRoot) {
|
|
|
150
150
|
function wrapWithInjectionGuard(toolName, handler, options = {}) {
|
|
151
151
|
const projectRoot = options.projectRoot ?? process.cwd();
|
|
152
152
|
const sessionId = options.sessionId ?? "default";
|
|
153
|
+
const trustedOutput = options.trustedOutputTools?.has(toolName) ?? false;
|
|
153
154
|
return async (input) => {
|
|
154
155
|
try {
|
|
155
156
|
const taintCheck = checkTaint(projectRoot, sessionId);
|
|
@@ -181,29 +182,31 @@ function wrapWithInjectionGuard(toolName, handler, options = {}) {
|
|
|
181
182
|
}
|
|
182
183
|
}
|
|
183
184
|
const result = await handler(input);
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
if (actionableOutput.length > 0) {
|
|
191
|
-
writeTaint(
|
|
192
|
-
projectRoot,
|
|
193
|
-
sessionId,
|
|
194
|
-
`Injection pattern detected in MCP:${toolName} result`,
|
|
195
|
-
actionableOutput,
|
|
196
|
-
`MCP:${toolName}:output`
|
|
197
|
-
);
|
|
198
|
-
const warningLines = actionableOutput.map(
|
|
199
|
-
(f) => `Sentinel [${f.severity}] ${f.ruleId}: detected in ${toolName} output`
|
|
185
|
+
if (!trustedOutput) {
|
|
186
|
+
const outputText = extractResultText(result);
|
|
187
|
+
if (outputText) {
|
|
188
|
+
const outputFindings = scanForInjection(outputText);
|
|
189
|
+
const actionableOutput = outputFindings.filter(
|
|
190
|
+
(f) => f.severity === "high" || f.severity === "medium"
|
|
200
191
|
);
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
192
|
+
if (actionableOutput.length > 0) {
|
|
193
|
+
writeTaint(
|
|
194
|
+
projectRoot,
|
|
195
|
+
sessionId,
|
|
196
|
+
`Injection pattern detected in MCP:${toolName} result`,
|
|
197
|
+
actionableOutput,
|
|
198
|
+
`MCP:${toolName}:output`
|
|
199
|
+
);
|
|
200
|
+
const warningLines = actionableOutput.map(
|
|
201
|
+
(f) => `Sentinel [${f.severity}] ${f.ruleId}: detected in ${toolName} output`
|
|
202
|
+
);
|
|
203
|
+
result.content.push({
|
|
204
|
+
type: "text",
|
|
205
|
+
text: `
|
|
204
206
|
---
|
|
205
207
|
Sentinel Warning: ${warningLines.join("; ")}`
|
|
206
|
-
|
|
208
|
+
});
|
|
209
|
+
}
|
|
207
210
|
}
|
|
208
211
|
}
|
|
209
212
|
return result;
|
|
@@ -5325,7 +5328,7 @@ var TOOL_DEFINITIONS = [
|
|
|
5325
5328
|
codeOutlineDefinition,
|
|
5326
5329
|
codeSearchDefinition,
|
|
5327
5330
|
codeUnfoldDefinition
|
|
5328
|
-
];
|
|
5331
|
+
].map((def) => ({ ...def, trustedOutput: true }));
|
|
5329
5332
|
var TOOL_HANDLERS = {
|
|
5330
5333
|
validate_project: handleValidateProject,
|
|
5331
5334
|
check_dependencies: handleCheckDependencies,
|
|
@@ -5493,7 +5496,13 @@ function createHarnessServer(projectRoot, toolFilter) {
|
|
|
5493
5496
|
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
5494
5497
|
tools: filteredDefinitions
|
|
5495
5498
|
}));
|
|
5496
|
-
const
|
|
5499
|
+
const trustedOutputTools = new Set(
|
|
5500
|
+
filteredDefinitions.filter((t) => t.trustedOutput === true).map((t) => t.name)
|
|
5501
|
+
);
|
|
5502
|
+
const guardedHandlers = applyInjectionGuard(filteredHandlers, {
|
|
5503
|
+
projectRoot: resolvedRoot,
|
|
5504
|
+
trustedOutputTools
|
|
5505
|
+
});
|
|
5497
5506
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
5498
5507
|
const { name, arguments: args } = request.params;
|
|
5499
5508
|
const handler = guardedHandlers[name];
|
package/dist/index.d.ts
CHANGED
|
@@ -713,15 +713,15 @@ declare const HarnessConfigSchema: z.ZodObject<{
|
|
|
713
713
|
thresholds: z.ZodDefault<z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>;
|
|
714
714
|
modules: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodEnum<["circular-deps", "layer-violations", "complexity", "coupling", "forbidden-imports", "module-size", "dependency-depth"]>, z.ZodUnion<[z.ZodNumber, z.ZodRecord<z.ZodString, z.ZodNumber>]>>>>;
|
|
715
715
|
}, "strip", z.ZodTypeAny, {
|
|
716
|
+
thresholds: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
|
|
717
|
+
modules: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
|
|
716
718
|
enabled: boolean;
|
|
717
719
|
baselinePath: string;
|
|
718
|
-
thresholds: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
|
|
719
|
-
modules: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
|
|
720
720
|
}, {
|
|
721
|
+
thresholds?: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
|
|
722
|
+
modules?: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
|
|
721
723
|
enabled?: boolean | undefined;
|
|
722
724
|
baselinePath?: string | undefined;
|
|
723
|
-
thresholds?: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
|
|
724
|
-
modules?: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
|
|
725
725
|
}>>;
|
|
726
726
|
/** Skill loading, suggestion, and tier override settings */
|
|
727
727
|
skills: z.ZodOptional<z.ZodObject<{
|
|
@@ -900,10 +900,10 @@ declare const HarnessConfigSchema: z.ZodObject<{
|
|
|
900
900
|
dismissed: string[];
|
|
901
901
|
} | undefined;
|
|
902
902
|
architecture?: {
|
|
903
|
+
thresholds: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
|
|
904
|
+
modules: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
|
|
903
905
|
enabled: boolean;
|
|
904
906
|
baselinePath: string;
|
|
905
|
-
thresholds: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>;
|
|
906
|
-
modules: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>>;
|
|
907
907
|
} | undefined;
|
|
908
908
|
roadmap?: {
|
|
909
909
|
tracker?: {
|
|
@@ -1029,10 +1029,10 @@ declare const HarnessConfigSchema: z.ZodObject<{
|
|
|
1029
1029
|
dismissed?: string[] | undefined;
|
|
1030
1030
|
} | undefined;
|
|
1031
1031
|
architecture?: {
|
|
1032
|
+
thresholds?: Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
|
|
1033
|
+
modules?: Record<string, Partial<Record<"complexity" | "coupling" | "circular-deps" | "layer-violations" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
|
|
1032
1034
|
enabled?: boolean | undefined;
|
|
1033
1035
|
baselinePath?: string | undefined;
|
|
1034
|
-
thresholds?: Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>> | undefined;
|
|
1035
|
-
modules?: Record<string, Partial<Record<"circular-deps" | "layer-violations" | "complexity" | "coupling" | "forbidden-imports" | "module-size" | "dependency-depth", number | Record<string, number>>>> | undefined;
|
|
1036
1036
|
} | undefined;
|
|
1037
1037
|
roadmap?: {
|
|
1038
1038
|
tracker?: {
|
|
@@ -1504,6 +1504,8 @@ type ToolDefinition = {
|
|
|
1504
1504
|
name: string;
|
|
1505
1505
|
description: string;
|
|
1506
1506
|
inputSchema: Record<string, unknown>;
|
|
1507
|
+
/** When true, output scanning is skipped for this tool (internal content, not external). */
|
|
1508
|
+
trustedOutput?: boolean;
|
|
1507
1509
|
};
|
|
1508
1510
|
declare function getToolDefinitions(): ToolDefinition[];
|
|
1509
1511
|
declare function createHarnessServer(projectRoot?: string, toolFilter?: string[]): Server;
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
runScan,
|
|
13
13
|
runUninstall,
|
|
14
14
|
runUninstallConstraints
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HAJD5LTI.js";
|
|
16
16
|
import {
|
|
17
17
|
generateCIWorkflow
|
|
18
18
|
} from "./chunk-SD3SQOZ2.js";
|
|
@@ -63,7 +63,7 @@ import {
|
|
|
63
63
|
generateSlashCommands,
|
|
64
64
|
getToolDefinitions,
|
|
65
65
|
startServer
|
|
66
|
-
} from "./chunk-
|
|
66
|
+
} from "./chunk-SQY4AAKP.js";
|
|
67
67
|
import "./chunk-4U4V7A6U.js";
|
|
68
68
|
import "./chunk-PDEEQJHH.js";
|
|
69
69
|
import "./chunk-V73TEHIF.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@harness-engineering/cli",
|
|
3
|
-
"version": "1.20.
|
|
3
|
+
"version": "1.20.1",
|
|
4
4
|
"description": "CLI for Harness Engineering toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"web-tree-sitter": "^0.24.7",
|
|
38
38
|
"yaml": "^2.8.3",
|
|
39
39
|
"zod": "^3.25.76",
|
|
40
|
-
"@harness-engineering/core": "0.19.0",
|
|
41
40
|
"@harness-engineering/graph": "0.3.5",
|
|
42
41
|
"@harness-engineering/linter-gen": "0.1.4",
|
|
43
|
-
"@harness-engineering/
|
|
44
|
-
"@harness-engineering/orchestrator": "0.2.5"
|
|
42
|
+
"@harness-engineering/core": "0.19.0",
|
|
43
|
+
"@harness-engineering/orchestrator": "0.2.5",
|
|
44
|
+
"@harness-engineering/types": "0.8.0"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"@types/node": "^22.19.15",
|