@greenarmor/ges 0.6.1 → 0.6.3

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.
@@ -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",
@@ -78,8 +81,36 @@ function resolveServerPath() {
78
81
  }
79
82
  return { command: "npx", args: ["-y", "@greenarmor/ges-mcp-server"] };
80
83
  }
84
+ function resolveAbsoluteCommand(command) {
85
+ if (command === "node") {
86
+ return process.execPath;
87
+ }
88
+ if (command === "npx") {
89
+ const nodeDir = path.dirname(process.execPath);
90
+ const ext = process.platform === "win32" ? ".cmd" : "";
91
+ const npxPath = path.join(nodeDir, `npx${ext}`);
92
+ if (fs.existsSync(npxPath))
93
+ return npxPath;
94
+ }
95
+ return command;
96
+ }
97
+ function resolveServerPathAbsolute() {
98
+ const resolved = resolveServerPath();
99
+ if (resolved.command === "node") {
100
+ return { command: process.execPath, args: resolved.args };
101
+ }
102
+ if (resolved.command === "npx") {
103
+ const nodeDir = path.dirname(process.execPath);
104
+ const ext = process.platform === "win32" ? ".cmd" : "";
105
+ const npxPath = path.join(nodeDir, `npx${ext}`);
106
+ if (fs.existsSync(npxPath)) {
107
+ return { command: npxPath, args: resolved.args };
108
+ }
109
+ }
110
+ return resolved;
111
+ }
81
112
  function buildServerEntry(client) {
82
- const { command, args } = resolveServerPath();
113
+ const { command, args } = resolveServerPathAbsolute();
83
114
  if (client.format === "opencode") {
84
115
  return {
85
116
  type: "local",
@@ -136,7 +167,8 @@ function printSetupInstructions(client, configPath) {
136
167
  console.log(" Restart Claude Desktop to load the server.");
137
168
  break;
138
169
  case "vscode":
139
- console.log(" Reload the VS Code window (Cmd+Shift+P → Developer: Reload Window).");
170
+ console.log(" Reload the VS Code window (Cmd+Shift+P / Ctrl+Shift+P → Developer: Reload Window).");
171
+ console.log(" Verify: Open Copilot Chat → Agent mode → tools icon (🔨) → look for 'gesf'.");
140
172
  break;
141
173
  case "cursor":
142
174
  console.log(" Restart Cursor to load the server.");
@@ -152,12 +184,16 @@ function printSetupInstructions(client, configPath) {
152
184
  break;
153
185
  }
154
186
  }
155
- async function setupClient(clientId) {
187
+ async function setupClient(clientId, defaultToGlobal = false) {
156
188
  const client = CLIENTS.find((c) => c.id === clientId);
157
189
  if (!client) {
158
190
  console.error(`Unknown client: ${clientId}`);
159
191
  process.exit(1);
160
192
  }
193
+ if (client.id === "vscode") {
194
+ await setupVsCode(client, defaultToGlobal);
195
+ return;
196
+ }
161
197
  const configPath = getConfigPath(client);
162
198
  const existing = readJsonFile(configPath) || {};
163
199
  const updated = addServerToConfig(existing, client);
@@ -166,12 +202,46 @@ async function setupClient(clientId) {
166
202
  console.log(` Status: configured\n`);
167
203
  await showNextStepsMenu("mcp-setup");
168
204
  }
205
+ async function setupVsCode(client, defaultToGlobal = false) {
206
+ const globalPaths = client.configPaths.slice(1);
207
+ const globalPath = globalPaths.find((p) => fs.existsSync(p)) || globalPaths[0];
208
+ const projectPath = client.configPaths[0];
209
+ let choice;
210
+ if (defaultToGlobal) {
211
+ choice = "global";
212
+ }
213
+ else {
214
+ console.log("\n VS Code MCP Setup\n");
215
+ console.log(" Choose configuration scope:\n");
216
+ console.log(` 1) Global — available in all projects (${globalPath})`);
217
+ console.log(` 2) Project — current project only (${projectPath})`);
218
+ console.log("");
219
+ choice = await select({
220
+ message: "Configuration scope:",
221
+ choices: [
222
+ { name: "Global (recommended — all projects)", value: "global" },
223
+ { name: "Project (current project only)", value: "project" },
224
+ ],
225
+ });
226
+ }
227
+ const configPath = choice === "global" ? globalPath : projectPath;
228
+ const existing = readJsonFile(configPath) || {};
229
+ if (existing.inputs) {
230
+ delete existing.inputs;
231
+ console.log(" Removed invalid 'inputs' section from existing config.");
232
+ }
233
+ const updated = addServerToConfig(existing, client);
234
+ writeJsonFile(configPath, updated);
235
+ printSetupInstructions(client, configPath);
236
+ console.log(` Status: configured\n`);
237
+ await showNextStepsMenu("mcp-setup");
238
+ }
169
239
  async function setupAll() {
170
240
  console.log("\n GESF MCP Server Setup\n");
171
241
  console.log(" ─────────────────────\n");
172
242
  for (const client of CLIENTS) {
173
243
  try {
174
- await setupClient(client.id);
244
+ await setupClient(client.id, true);
175
245
  }
176
246
  catch (err) {
177
247
  console.log(` ${client.name}: skipped (${err instanceof Error ? err.message : String(err)})\n`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@greenarmor/ges",
3
- "version": "0.6.1",
3
+ "version": "0.6.3",
4
4
  "description": "Green Engineering Standard Framework - Compliance-as-Code CLI",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -13,24 +13,24 @@
13
13
  ],
14
14
  "dependencies": {
15
15
  "commander": "^13.0.0",
16
- "@greenarmor/ges-audit-engine": "0.6.1",
17
- "@greenarmor/ges-cicd-generator": "0.6.1",
18
- "@greenarmor/ges-core": "0.6.1",
19
- "@greenarmor/ges-policy-engine": "0.6.1",
20
- "@greenarmor/ges-doc-generator": "0.6.1",
21
- "@greenarmor/ges-report-generator": "0.6.1",
22
- "@greenarmor/ges-scanner-integration": "0.6.1",
23
- "@greenarmor/ges-scoring-engine": "0.6.1",
24
- "@greenarmor/ges-mcp-server": "0.6.1",
25
- "@greenarmor/ges-rules-engine": "0.6.1",
26
- "@greenarmor/ges-compliance-engine": "0.6.1"
16
+ "@greenarmor/ges-audit-engine": "0.6.3",
17
+ "@greenarmor/ges-cicd-generator": "0.6.3",
18
+ "@greenarmor/ges-doc-generator": "0.6.3",
19
+ "@greenarmor/ges-report-generator": "0.6.3",
20
+ "@greenarmor/ges-policy-engine": "0.6.3",
21
+ "@greenarmor/ges-compliance-engine": "0.6.3",
22
+ "@greenarmor/ges-rules-engine": "0.6.3",
23
+ "@greenarmor/ges-scanner-integration": "0.6.3",
24
+ "@greenarmor/ges-scoring-engine": "0.6.3",
25
+ "@greenarmor/ges-mcp-server": "0.6.3",
26
+ "@greenarmor/ges-core": "0.6.3"
27
27
  },
28
28
  "devDependencies": {
29
29
  "@types/node": "^22.0.0",
30
30
  "typescript": "^6.0.0"
31
31
  },
32
32
  "engines": {
33
- "node": ">=22.0.0"
33
+ "node": ">=20.0.0"
34
34
  },
35
35
  "keywords": [
36
36
  "compliance",