@debugg-ai/debugg-ai-mcp 1.0.38 → 1.0.40
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/config/index.js
CHANGED
|
@@ -32,13 +32,7 @@ const configSchema = z.object({
|
|
|
32
32
|
tokenType: z.enum(['token', 'bearer']).default('token'),
|
|
33
33
|
baseUrl: z.string().url().default('https://api.debugg.ai'),
|
|
34
34
|
}),
|
|
35
|
-
defaults: z.object({
|
|
36
|
-
localPort: z.number().int().min(1).max(65535).optional(),
|
|
37
|
-
repoName: z.string().optional(),
|
|
38
|
-
branchName: z.string().optional(),
|
|
39
|
-
repoPath: z.string().optional(),
|
|
40
|
-
filePath: z.string().optional(),
|
|
41
|
-
}),
|
|
35
|
+
defaults: z.object({}),
|
|
42
36
|
logging: z.object({
|
|
43
37
|
level: z.enum(['error', 'warn', 'info', 'debug']).default('info'),
|
|
44
38
|
format: z.enum(['json', 'simple']).default('simple'),
|
|
@@ -60,13 +54,7 @@ export function loadConfig() {
|
|
|
60
54
|
tokenType: process.env.DEBUGGAI_TOKEN_TYPE || 'token',
|
|
61
55
|
baseUrl: process.env.DEBUGGAI_API_URL || 'https://api.debugg.ai',
|
|
62
56
|
},
|
|
63
|
-
defaults: {
|
|
64
|
-
localPort: process.env.DEBUGGAI_LOCAL_PORT ? parseInt(process.env.DEBUGGAI_LOCAL_PORT, 10) : undefined,
|
|
65
|
-
repoName: process.env.DEBUGGAI_LOCAL_REPO_NAME || undefined,
|
|
66
|
-
branchName: process.env.DEBUGGAI_LOCAL_BRANCH_NAME || undefined,
|
|
67
|
-
repoPath: process.env.DEBUGGAI_LOCAL_REPO_PATH || undefined,
|
|
68
|
-
filePath: process.env.DEBUGGAI_LOCAL_FILE_PATH || undefined,
|
|
69
|
-
},
|
|
57
|
+
defaults: {},
|
|
70
58
|
logging: {
|
|
71
59
|
level: process.env.LOG_LEVEL || 'info',
|
|
72
60
|
format: process.env.LOG_FORMAT || 'simple',
|
|
@@ -10,9 +10,9 @@ import { fetchImageAsBase64, imageContentBlock } from '../utils/imageUtils.js';
|
|
|
10
10
|
import { DebuggAIServerClient } from '../services/index.js';
|
|
11
11
|
import { resolveTargetUrl, buildContext, findExistingTunnel, ensureTunnel, sanitizeResponseUrls, touchTunnelById, } from '../utils/tunnelContext.js';
|
|
12
12
|
const logger = new Logger({ module: 'testPageChangesHandler' });
|
|
13
|
-
// Cache the template UUID and project
|
|
13
|
+
// Cache the template UUID and project UUIDs within a server session to avoid re-fetching
|
|
14
14
|
let cachedTemplateUuid = null;
|
|
15
|
-
|
|
15
|
+
const projectUuidCache = new Map();
|
|
16
16
|
export async function testPageChangesHandler(input, context, progressCallback) {
|
|
17
17
|
const startTime = Date.now();
|
|
18
18
|
logger.toolStart('check_app_in_browser', input);
|
|
@@ -79,28 +79,33 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
79
79
|
logger.info(`Using workflow template: ${template.name} (${template.uuid})`);
|
|
80
80
|
}
|
|
81
81
|
// --- Resolve project UUID (best-effort, non-blocking) ---
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
82
|
+
let projectUuid;
|
|
83
|
+
if (input.repoName) {
|
|
84
|
+
projectUuid = projectUuidCache.get(input.repoName);
|
|
85
|
+
if (!projectUuid) {
|
|
86
|
+
try {
|
|
87
|
+
const project = await client.findProjectByRepoName(input.repoName);
|
|
88
|
+
if (project) {
|
|
89
|
+
projectUuid = project.uuid;
|
|
90
|
+
projectUuidCache.set(input.repoName, projectUuid);
|
|
91
|
+
logger.info(`Resolved project: ${project.name} (${project.uuid})`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
logger.info(`No project found for repo "${input.repoName}" — proceeding without project_id`);
|
|
95
|
+
}
|
|
88
96
|
}
|
|
89
|
-
|
|
90
|
-
logger.
|
|
97
|
+
catch (err) {
|
|
98
|
+
logger.warn(`Failed to look up project for repo "${input.repoName}": ${err}`);
|
|
91
99
|
}
|
|
92
100
|
}
|
|
93
|
-
catch (err) {
|
|
94
|
-
logger.warn(`Failed to look up project for repo "${config.defaults.repoName}": ${err}`);
|
|
95
|
-
}
|
|
96
101
|
}
|
|
97
|
-
// --- Build context data (
|
|
102
|
+
// --- Build context data (camelCase here — axiosTransport auto-converts to snake_case) ---
|
|
98
103
|
const contextData = {
|
|
99
104
|
targetUrl: ctx.targetUrl ?? originalUrl,
|
|
100
|
-
|
|
105
|
+
question: input.description,
|
|
101
106
|
};
|
|
102
|
-
if (
|
|
103
|
-
contextData.projectId =
|
|
107
|
+
if (projectUuid) {
|
|
108
|
+
contextData.projectId = projectUuid;
|
|
104
109
|
}
|
|
105
110
|
// --- Build env (credentials/environment) ---
|
|
106
111
|
const env = {};
|
|
@@ -115,6 +120,7 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
115
120
|
if (input.password)
|
|
116
121
|
env.password = input.password;
|
|
117
122
|
// --- Execute ---
|
|
123
|
+
logger.info('Sending contextData', { contextData, env: Object.keys(env).length > 0 ? env : undefined });
|
|
118
124
|
if (progressCallback) {
|
|
119
125
|
await progressCallback({ progress: 3, total: TOTAL_STEPS, message: 'Queuing workflow execution...' });
|
|
120
126
|
}
|
|
@@ -43,6 +43,10 @@ export const testPageChangesTool = {
|
|
|
43
43
|
type: "string",
|
|
44
44
|
description: "Password to log in with (used together with username)"
|
|
45
45
|
},
|
|
46
|
+
repoName: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "GitHub repository name (e.g. 'my-org/my-repo' or 'my-repo'). Used to link this test to a DebuggAI project for tracking and history."
|
|
49
|
+
},
|
|
46
50
|
},
|
|
47
51
|
required: ["description", "url"],
|
|
48
52
|
additionalProperties: false
|
package/dist/types/index.js
CHANGED