@debugg-ai/debugg-ai-mcp 1.0.46 → 1.0.47
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.
|
@@ -132,72 +132,69 @@ export async function testPageChangesHandler(input, context, progressCallback) {
|
|
|
132
132
|
const executionUuid = executeResponse.executionUuid;
|
|
133
133
|
logger.info(`Execution queued: ${executionUuid}`);
|
|
134
134
|
// --- Poll ---
|
|
135
|
-
//
|
|
136
|
-
//
|
|
135
|
+
// Progress phases:
|
|
136
|
+
// 1-3: MCP setup (tunnel, template, queue) — already sent above
|
|
137
|
+
// 4-6: Backend setup (trigger, browser.setup, subworkflow starting)
|
|
138
|
+
// 7-27: Agent steps (mapped from state.stepsTaken)
|
|
139
|
+
// 28: Complete
|
|
140
|
+
const BACKEND_SETUP_END = 6;
|
|
137
141
|
let lastStepsTaken = 0;
|
|
138
|
-
let lastNodeCount = 0;
|
|
139
142
|
let observedMaxSteps = MAX_EXEC_STEPS;
|
|
140
143
|
const finalExecution = await client.workflows.pollExecution(executionUuid, async (exec) => {
|
|
141
144
|
// Keep the tunnel alive while the workflow is actively running
|
|
142
145
|
if (ctx.tunnelId)
|
|
143
146
|
touchTunnelById(ctx.tunnelId);
|
|
144
|
-
const
|
|
145
|
-
const
|
|
146
|
-
|
|
147
|
-
// Prefer actual brain.step node count over API stepsTaken (which may lag)
|
|
148
|
-
const stepsTaken = Math.max(brainStepCount, exec.state?.stepsTaken ?? 0);
|
|
149
|
-
if (nodeCount !== lastNodeCount || stepsTaken !== lastStepsTaken || exec.status !== 'pending') {
|
|
150
|
-
lastNodeCount = nodeCount;
|
|
147
|
+
const nodes = exec.nodeExecutions ?? [];
|
|
148
|
+
const stepsTaken = Math.max(nodes.filter(n => n.nodeType === 'brain.step').length, exec.state?.stepsTaken ?? 0);
|
|
149
|
+
if (stepsTaken !== lastStepsTaken) {
|
|
151
150
|
lastStepsTaken = stepsTaken;
|
|
152
|
-
logger.info(`Execution status: ${exec.status}, nodes: ${
|
|
151
|
+
logger.info(`Execution status: ${exec.status}, nodes: ${nodes.length}, steps: ${stepsTaken}`);
|
|
153
152
|
}
|
|
154
|
-
if (progressCallback)
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
if (!progressCallback)
|
|
154
|
+
return;
|
|
155
|
+
// --- Compute progress number ---
|
|
156
|
+
let execProgress;
|
|
157
|
+
let message;
|
|
158
|
+
if (stepsTaken > 0) {
|
|
159
|
+
// Agent is actively stepping — map into slots 7..27
|
|
160
|
+
if (stepsTaken > observedMaxSteps)
|
|
157
161
|
observedMaxSteps = stepsTaken + 5;
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
162
|
+
const stepSlots = TOTAL_STEPS - BACKEND_SETUP_END - 1; // 21 slots
|
|
163
|
+
execProgress = BACKEND_SETUP_END + Math.max(1, Math.round((stepsTaken / observedMaxSteps) * stepSlots));
|
|
164
|
+
execProgress = Math.min(execProgress, TOTAL_STEPS - 1);
|
|
165
|
+
// Use state.currentAction for the message (backend sends intent + actionType)
|
|
166
|
+
const ca = exec.state?.currentAction;
|
|
167
|
+
if (ca?.intent) {
|
|
168
|
+
const action = ca.actionType ?? ca.action_type ?? 'working';
|
|
169
|
+
message = `Step ${stepsTaken}: [${action}] ${ca.intent}`;
|
|
164
170
|
}
|
|
165
171
|
else {
|
|
166
|
-
|
|
167
|
-
execProgress = SETUP_STEPS + 1;
|
|
172
|
+
message = `Agent evaluating... (step ${stepsTaken})`;
|
|
168
173
|
}
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
message = `Agent evaluating app... (step ${stepsTaken})`;
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
else if (nodeCount === 0) {
|
|
190
|
-
message = 'Browser agent starting up...';
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
message = 'Browser ready, agent navigating...';
|
|
194
|
-
}
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
// No agent steps yet — show backend setup progress from node transitions
|
|
177
|
+
const hasSubworkflow = nodes.some(n => n.nodeType === 'subworkflow.run');
|
|
178
|
+
const hasBrowserSetup = nodes.some(n => n.nodeType === 'browser.setup');
|
|
179
|
+
const browserReady = nodes.some(n => n.nodeType === 'browser.setup' && n.status === 'success');
|
|
180
|
+
if (browserReady || hasSubworkflow) {
|
|
181
|
+
execProgress = BACKEND_SETUP_END;
|
|
182
|
+
message = 'Browser ready, agent starting...';
|
|
183
|
+
}
|
|
184
|
+
else if (hasBrowserSetup) {
|
|
185
|
+
execProgress = SETUP_STEPS + 2;
|
|
186
|
+
message = 'Launching browser...';
|
|
187
|
+
}
|
|
188
|
+
else if (nodes.length > 0) {
|
|
189
|
+
execProgress = SETUP_STEPS + 1;
|
|
190
|
+
message = 'Workflow triggered, preparing...';
|
|
195
191
|
}
|
|
196
192
|
else {
|
|
197
|
-
|
|
193
|
+
execProgress = SETUP_STEPS + 1;
|
|
194
|
+
message = 'Waiting for execution to start...';
|
|
198
195
|
}
|
|
199
|
-
await progressCallback({ progress: execProgress, total: TOTAL_STEPS, message });
|
|
200
196
|
}
|
|
197
|
+
await progressCallback({ progress: execProgress, total: TOTAL_STEPS, message });
|
|
201
198
|
}, abortController.signal);
|
|
202
199
|
const duration = Date.now() - startTime;
|
|
203
200
|
// --- Format result ---
|
|
@@ -68,11 +68,11 @@ export function buildTestPageChangesTool(ctx) {
|
|
|
68
68
|
},
|
|
69
69
|
username: {
|
|
70
70
|
type: "string",
|
|
71
|
-
description: "
|
|
71
|
+
description: "A real, existing account email for the target app. Do NOT invent or guess credentials — use one from the available credentials listed above, or ask the user. The browser agent will type this into the login form."
|
|
72
72
|
},
|
|
73
73
|
password: {
|
|
74
74
|
type: "string",
|
|
75
|
-
description: "
|
|
75
|
+
description: "The real password for the username above. Do NOT guess or use placeholder passwords — use credentials from the list above or ask the user."
|
|
76
76
|
},
|
|
77
77
|
repoName: {
|
|
78
78
|
type: "string",
|