mcp-lab-agent 2.1.10 → 2.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-lab-agent",
3
- "version": "2.1.10",
3
+ "version": "2.2.0",
4
4
  "description": "Sistema de Inteligência em Qualidade de Software: executa, analisa, prevê, recomenda e aprende. Memória local + Learning Hub.",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,6 +24,7 @@
24
24
  "test:watch": "vitest",
25
25
  "test:coverage": "vitest run --coverage",
26
26
  "test:report": "vitest run --reporter=default --reporter=json --outputFile=test-results/results.json",
27
+ "resume:html": "node curriculos/generate-pdf.mjs",
27
28
  "prepublishOnly": "npm run build"
28
29
  },
29
30
  "keywords": [
@@ -59,7 +60,7 @@
59
60
  "zod": "^3.25.0"
60
61
  },
61
62
  "optionalDependencies": {
62
- "playwright": "^1.49.0"
63
+ "playwright": "^1.58.2"
63
64
  },
64
65
  "devDependencies": {
65
66
  "@vitest/coverage-v8": "^2.1.0",
@@ -6,6 +6,7 @@
6
6
  import { config } from "dotenv";
7
7
  import { readFileSync, existsSync } from "node:fs";
8
8
  import path from "node:path";
9
+ import os from "node:os";
9
10
  import { fileURLToPath } from "node:url";
10
11
 
11
12
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -23,11 +24,18 @@ for (const p of envPaths) {
23
24
  break;
24
25
  }
25
26
  }
27
+ function expandTilde(filePath) {
28
+ if (!filePath || typeof filePath !== "string") return filePath;
29
+ if (filePath.startsWith("~/")) return path.join(os.homedir(), filePath.slice(2));
30
+ if (filePath === "~") return os.homedir();
31
+ return filePath;
32
+ }
26
33
  function getMcpJsonPath() {
27
- const home = process.env.HOME || process.env.USERPROFILE;
28
- return home ? path.join(home, ".cursor", "mcp.json") : null;
34
+ const envPath = process.env.QA_LAB_MCP_CONFIG;
35
+ if (envPath) return expandTilde(envPath);
36
+ return path.join(os.homedir(), ".cursor", "mcp.json");
29
37
  }
30
- const mcpPath = process.env.QA_LAB_MCP_CONFIG || getMcpJsonPath();
38
+ const mcpPath = getMcpJsonPath();
31
39
 
32
40
  console.log("\n🔧 QA Lab Slack Bot - Diagnóstico\n");
33
41
  console.log("1. Origens de config (mcp.json ou .env):");
@@ -1,6 +1,7 @@
1
1
  import { config } from "dotenv";
2
2
  import { readFileSync, existsSync } from "node:fs";
3
3
  import path from "node:path";
4
+ import os from "node:os";
4
5
  import { fileURLToPath } from "node:url";
5
6
 
6
7
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -21,14 +22,27 @@ for (const p of envPaths) {
21
22
  }
22
23
  }
23
24
 
25
+ function expandTilde(filePath) {
26
+ if (!filePath || typeof filePath !== "string") return filePath;
27
+ if (filePath.startsWith("~/")) {
28
+ return path.join(os.homedir(), filePath.slice(2));
29
+ }
30
+ if (filePath === "~") {
31
+ return os.homedir();
32
+ }
33
+ return filePath;
34
+ }
35
+
24
36
  function getMcpJsonPath() {
25
- const home = process.env.HOME || process.env.USERPROFILE;
26
- if (!home) return null;
27
- return path.join(home, ".cursor", "mcp.json");
37
+ const envPath = process.env.QA_LAB_MCP_CONFIG;
38
+ if (envPath) {
39
+ return expandTilde(envPath);
40
+ }
41
+ return path.join(os.homedir(), ".cursor", "mcp.json");
28
42
  }
29
43
 
30
44
  function loadMcpConfig() {
31
- const mcpPath = process.env.QA_LAB_MCP_CONFIG || getMcpJsonPath();
45
+ const mcpPath = getMcpJsonPath();
32
46
  if (!mcpPath || !existsSync(mcpPath)) return null;
33
47
  try {
34
48
  return JSON.parse(readFileSync(mcpPath, "utf8"));
@@ -40,7 +54,10 @@ function loadMcpConfig() {
40
54
  function getSlackConfigFromMcp() {
41
55
  const mcp = loadMcpConfig();
42
56
  const qa = mcp?.["qa-lab-agent"];
43
- const slack = qa?.slack;
57
+ const slack =
58
+ qa?.slack ||
59
+ mcp?.mcpServers?.["qa-lab-agent"]?.slack ||
60
+ mcp?.mcpServers?.["qa-lab-agent"];
44
61
  if (!slack) return null;
45
62
  return {
46
63
  id: slack.id || slack.channelId,