@greenarmor/ges 0.6.0 → 0.6.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.
- package/dist/commands/mcp-setup.js +62 -7
- package/dist/commands/scan.js +11 -3
- package/package.json +12 -12
|
@@ -23,6 +23,9 @@ const CLIENTS = [
|
|
|
23
23
|
name: "VS Code (Copilot)",
|
|
24
24
|
configPaths: [
|
|
25
25
|
path.join(".vscode", "mcp.json"),
|
|
26
|
+
path.join(os.homedir(), "Library", "Application Support", "Code", "User", "mcp.json"),
|
|
27
|
+
path.join(os.homedir(), ".config", "Code", "User", "mcp.json"),
|
|
28
|
+
path.join(os.homedir(), "AppData", "Roaming", "Code", "User", "mcp.json"),
|
|
26
29
|
],
|
|
27
30
|
configKey: "servers",
|
|
28
31
|
format: "servers",
|
|
@@ -44,7 +47,7 @@ const CLIENTS = [
|
|
|
44
47
|
path.join(".config", "opencode", "opencode.json"),
|
|
45
48
|
],
|
|
46
49
|
configKey: "mcp",
|
|
47
|
-
format: "
|
|
50
|
+
format: "opencode",
|
|
48
51
|
},
|
|
49
52
|
{
|
|
50
53
|
id: "crush",
|
|
@@ -66,14 +69,27 @@ const CLIENTS = [
|
|
|
66
69
|
},
|
|
67
70
|
];
|
|
68
71
|
function resolveServerPath() {
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
|
|
72
|
+
const searchPaths = [
|
|
73
|
+
path.resolve(__dirname, "..", "..", "..", "mcp-server", "dist", "server.js"),
|
|
74
|
+
path.resolve(__dirname, "..", "..", "mcp-server", "dist", "server.js"),
|
|
75
|
+
path.resolve(__dirname, "..", "..", "mcp-server", "bundle", "server.js"),
|
|
76
|
+
];
|
|
77
|
+
for (const serverPath of searchPaths) {
|
|
78
|
+
if (fs.existsSync(serverPath)) {
|
|
79
|
+
return { command: "node", args: [serverPath] };
|
|
80
|
+
}
|
|
72
81
|
}
|
|
73
82
|
return { command: "npx", args: ["-y", "@greenarmor/ges-mcp-server"] };
|
|
74
83
|
}
|
|
75
84
|
function buildServerEntry(client) {
|
|
76
85
|
const { command, args } = resolveServerPath();
|
|
86
|
+
if (client.format === "opencode") {
|
|
87
|
+
return {
|
|
88
|
+
type: "local",
|
|
89
|
+
command: [command, ...args],
|
|
90
|
+
enabled: true,
|
|
91
|
+
};
|
|
92
|
+
}
|
|
77
93
|
const entry = { command, args };
|
|
78
94
|
if (client.format === "servers" || client.format === "mcp") {
|
|
79
95
|
entry.type = "stdio";
|
|
@@ -123,7 +139,8 @@ function printSetupInstructions(client, configPath) {
|
|
|
123
139
|
console.log(" Restart Claude Desktop to load the server.");
|
|
124
140
|
break;
|
|
125
141
|
case "vscode":
|
|
126
|
-
console.log(" Reload the VS Code window (Cmd+Shift+P → Developer: Reload Window).");
|
|
142
|
+
console.log(" Reload the VS Code window (Cmd+Shift+P / Ctrl+Shift+P → Developer: Reload Window).");
|
|
143
|
+
console.log(" Verify: Open Copilot Chat → Agent mode → tools icon (🔨) → look for 'gesf'.");
|
|
127
144
|
break;
|
|
128
145
|
case "cursor":
|
|
129
146
|
console.log(" Restart Cursor to load the server.");
|
|
@@ -139,12 +156,16 @@ function printSetupInstructions(client, configPath) {
|
|
|
139
156
|
break;
|
|
140
157
|
}
|
|
141
158
|
}
|
|
142
|
-
async function setupClient(clientId) {
|
|
159
|
+
async function setupClient(clientId, defaultToGlobal = false) {
|
|
143
160
|
const client = CLIENTS.find((c) => c.id === clientId);
|
|
144
161
|
if (!client) {
|
|
145
162
|
console.error(`Unknown client: ${clientId}`);
|
|
146
163
|
process.exit(1);
|
|
147
164
|
}
|
|
165
|
+
if (client.id === "vscode") {
|
|
166
|
+
await setupVsCode(client, defaultToGlobal);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
148
169
|
const configPath = getConfigPath(client);
|
|
149
170
|
const existing = readJsonFile(configPath) || {};
|
|
150
171
|
const updated = addServerToConfig(existing, client);
|
|
@@ -153,12 +174,46 @@ async function setupClient(clientId) {
|
|
|
153
174
|
console.log(` Status: configured\n`);
|
|
154
175
|
await showNextStepsMenu("mcp-setup");
|
|
155
176
|
}
|
|
177
|
+
async function setupVsCode(client, defaultToGlobal = false) {
|
|
178
|
+
const globalPaths = client.configPaths.slice(1);
|
|
179
|
+
const globalPath = globalPaths.find((p) => fs.existsSync(p)) || globalPaths[0];
|
|
180
|
+
const projectPath = client.configPaths[0];
|
|
181
|
+
let choice;
|
|
182
|
+
if (defaultToGlobal) {
|
|
183
|
+
choice = "global";
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
console.log("\n VS Code MCP Setup\n");
|
|
187
|
+
console.log(" Choose configuration scope:\n");
|
|
188
|
+
console.log(` 1) Global — available in all projects (${globalPath})`);
|
|
189
|
+
console.log(` 2) Project — current project only (${projectPath})`);
|
|
190
|
+
console.log("");
|
|
191
|
+
choice = await select({
|
|
192
|
+
message: "Configuration scope:",
|
|
193
|
+
choices: [
|
|
194
|
+
{ name: "Global (recommended — all projects)", value: "global" },
|
|
195
|
+
{ name: "Project (current project only)", value: "project" },
|
|
196
|
+
],
|
|
197
|
+
});
|
|
198
|
+
}
|
|
199
|
+
const configPath = choice === "global" ? globalPath : projectPath;
|
|
200
|
+
const existing = readJsonFile(configPath) || {};
|
|
201
|
+
if (existing.inputs) {
|
|
202
|
+
delete existing.inputs;
|
|
203
|
+
console.log(" Removed invalid 'inputs' section from existing config.");
|
|
204
|
+
}
|
|
205
|
+
const updated = addServerToConfig(existing, client);
|
|
206
|
+
writeJsonFile(configPath, updated);
|
|
207
|
+
printSetupInstructions(client, configPath);
|
|
208
|
+
console.log(` Status: configured\n`);
|
|
209
|
+
await showNextStepsMenu("mcp-setup");
|
|
210
|
+
}
|
|
156
211
|
async function setupAll() {
|
|
157
212
|
console.log("\n GESF MCP Server Setup\n");
|
|
158
213
|
console.log(" ─────────────────────\n");
|
|
159
214
|
for (const client of CLIENTS) {
|
|
160
215
|
try {
|
|
161
|
-
await setupClient(client.id);
|
|
216
|
+
await setupClient(client.id, true);
|
|
162
217
|
}
|
|
163
218
|
catch (err) {
|
|
164
219
|
console.log(` ${client.name}: skipped (${err instanceof Error ? err.message : String(err)})\n`);
|
package/dist/commands/scan.js
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { ensureGESInitialized } from "../utils/project.js";
|
|
3
|
-
import {
|
|
3
|
+
import { runAllScansWithSbom, formatScanResults, formatSbomResults, detectProject } from "@greenarmor/ges-scanner-integration";
|
|
4
4
|
import { showNextStepsMenu } from "../utils/next-steps.js";
|
|
5
5
|
export const scanCommand = new Command("scan")
|
|
6
6
|
.description("Run security scans")
|
|
7
7
|
.option("--ci", "CI mode")
|
|
8
8
|
.action(async (options) => {
|
|
9
9
|
const root = ensureGESInitialized();
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
const detection = detectProject(root);
|
|
11
|
+
const detail = detection.ecosystem === "node" && detection.nodePackageManager
|
|
12
|
+
? `node (${detection.nodePackageManager})`
|
|
13
|
+
: detection.ecosystem === "python" && detection.pythonToolchain
|
|
14
|
+
? `python (${detection.pythonToolchain})`
|
|
15
|
+
: detection.ecosystem;
|
|
16
|
+
console.log(`\n Detected ecosystem: ${detail}`);
|
|
17
|
+
console.log(" Running security scans...\n");
|
|
18
|
+
const results = runAllScansWithSbom(detection);
|
|
12
19
|
console.log(formatScanResults(results));
|
|
20
|
+
console.log(formatSbomResults(results));
|
|
13
21
|
if (options.ci) {
|
|
14
22
|
const failed = results.filter(r => r.status === "fail");
|
|
15
23
|
if (failed.length > 0) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@greenarmor/ges",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -13,17 +13,17 @@
|
|
|
13
13
|
],
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"commander": "^13.0.0",
|
|
16
|
-
"@greenarmor/ges-
|
|
17
|
-
"@greenarmor/ges-
|
|
18
|
-
"@greenarmor/ges-doc-generator": "0.6.
|
|
19
|
-
"@greenarmor/ges-
|
|
20
|
-
"@greenarmor/ges-scanner-integration": "0.6.
|
|
21
|
-
"@greenarmor/ges-
|
|
22
|
-
"@greenarmor/ges-
|
|
23
|
-
"@greenarmor/ges-
|
|
24
|
-
"@greenarmor/ges-
|
|
25
|
-
"@greenarmor/ges-mcp-server": "0.6.
|
|
26
|
-
"@greenarmor/ges-
|
|
16
|
+
"@greenarmor/ges-audit-engine": "0.6.2",
|
|
17
|
+
"@greenarmor/ges-cicd-generator": "0.6.2",
|
|
18
|
+
"@greenarmor/ges-doc-generator": "0.6.2",
|
|
19
|
+
"@greenarmor/ges-report-generator": "0.6.2",
|
|
20
|
+
"@greenarmor/ges-scanner-integration": "0.6.2",
|
|
21
|
+
"@greenarmor/ges-compliance-engine": "0.6.2",
|
|
22
|
+
"@greenarmor/ges-core": "0.6.2",
|
|
23
|
+
"@greenarmor/ges-scoring-engine": "0.6.2",
|
|
24
|
+
"@greenarmor/ges-rules-engine": "0.6.2",
|
|
25
|
+
"@greenarmor/ges-mcp-server": "0.6.2",
|
|
26
|
+
"@greenarmor/ges-policy-engine": "0.6.2"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/node": "^22.0.0",
|