@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
- // Track execution progress via state.stepsTaken from the API.
136
- // Setup is steps 1-3, execution maps stepsTaken into steps 4-28 (25 slots).
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 nodeCount = exec.nodeExecutions?.length ?? 0;
145
- const brainStepCount = (exec.nodeExecutions ?? [])
146
- .filter(n => n.nodeType === 'brain.step').length;
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: ${nodeCount}, steps: ${stepsTaken}`);
151
+ logger.info(`Execution status: ${exec.status}, nodes: ${nodes.length}, steps: ${stepsTaken}`);
153
152
  }
154
- if (progressCallback) {
155
- // If we see steps > our assumed max, bump our ceiling so progress never goes backwards
156
- if (stepsTaken > observedMaxSteps) {
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
- // Map stepsTaken (0..observedMaxSteps) into progress (SETUP_STEPS+1 .. TOTAL_STEPS-1)
160
- // Reserve the last tick for the "Complete" message
161
- let execProgress;
162
- if (stepsTaken > 0) {
163
- execProgress = SETUP_STEPS + Math.round((stepsTaken / observedMaxSteps) * (MAX_EXEC_STEPS - 1));
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
- // No steps yet show we're past setup but execution is starting
167
- execProgress = SETUP_STEPS + 1;
172
+ message = `Agent evaluating... (step ${stepsTaken})`;
168
173
  }
169
- execProgress = Math.min(execProgress, TOTAL_STEPS - 1);
170
- let message;
171
- if (exec.status === 'running') {
172
- if (stepsTaken > 0) {
173
- // Extract the latest brain.step to show what the agent is doing
174
- const latestStep = (exec.nodeExecutions ?? [])
175
- .filter(n => n.nodeType === 'brain.step' && n.outputData)
176
- .sort((a, b) => b.executionOrder - a.executionOrder)[0];
177
- const d = latestStep?.outputData?.decision ?? latestStep?.outputData;
178
- if (d) {
179
- const action = d.actionType ?? d.action_type ?? 'working';
180
- const intent = d.intent;
181
- message = intent
182
- ? `Step ${stepsTaken}: [${action}] ${intent}`
183
- : `Step ${stepsTaken}: ${action}`;
184
- }
185
- else {
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
- message = exec.status;
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: "Username to log in with (alternative to credentialIdcreates or updates a credential idempotently)"
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: "Password to log in with (used together with username)"
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",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@debugg-ai/debugg-ai-mcp",
3
- "version": "1.0.46",
3
+ "version": "1.0.47",
4
4
  "description": "Zero-Config, Fully AI-Managed End-to-End Testing for all code gen platforms.",
5
5
  "type": "module",
6
6
  "bin": {