@debugg-ai/debugg-ai-mcp 1.0.21 → 1.0.22

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.
@@ -2,10 +2,26 @@
2
2
  * Centralized configuration management for DebuggAI MCP Server
3
3
  */
4
4
  import { z } from 'zod';
5
- import { createRequire } from 'module';
6
- import { resolve } from 'path';
7
- const _require = createRequire(import.meta.url);
8
- const _pkg = _require(resolve(process.cwd(), 'package.json'));
5
+ import { readFileSync } from 'fs';
6
+ import { fileURLToPath } from 'url';
7
+ import { dirname, join } from 'path';
8
+ function findPackageVersion() {
9
+ const __dir = dirname(fileURLToPath(import.meta.url));
10
+ let dir = __dir;
11
+ while (true) {
12
+ try {
13
+ const pkg = JSON.parse(readFileSync(join(dir, 'package.json'), 'utf-8'));
14
+ if (pkg.name === '@debugg-ai/debugg-ai-mcp')
15
+ return pkg.version;
16
+ }
17
+ catch { /* keep walking */ }
18
+ const parent = dirname(dir);
19
+ if (parent === dir)
20
+ return 'unknown';
21
+ dir = parent;
22
+ }
23
+ }
24
+ const _version = findPackageVersion();
9
25
  const configSchema = z.object({
10
26
  server: z.object({
11
27
  name: z.string().default('DebuggAI MCP Server'),
@@ -32,7 +48,7 @@ export function loadConfig() {
32
48
  const rawConfig = {
33
49
  server: {
34
50
  name: 'DebuggAI MCP Server',
35
- version: _pkg.version,
51
+ version: _version,
36
52
  },
37
53
  api: {
38
54
  // Priority: DEBUGGAI_API_TOKEN → DEBUGGAI_JWT_TOKEN → DEBUGGAI_API_KEY
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugg-ai/debugg-ai-mcp",
3
- "version": "1.0.21",
3
+ "version": "1.0.22",
4
4
  "description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
5
5
  "type": "module",
6
6
  "bin": {