dev3000 0.0.114 → 0.0.116
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/cdp-monitor.d.ts.map +1 -1
- package/dist/cdp-monitor.js +20 -28
- package/dist/cdp-monitor.js.map +1 -1
- package/dist/cli.js +74 -22
- package/dist/cli.js.map +1 -1
- package/dist/dev-environment.d.ts.map +1 -1
- package/dist/dev-environment.js +43 -11
- package/dist/dev-environment.js.map +1 -1
- package/dist/src/tui-interface-impl.tsx +175 -127
- package/dist/tui-interface-impl.d.ts.map +1 -1
- package/dist/tui-interface-impl.js +113 -74
- package/dist/tui-interface-impl.js.map +1 -1
- package/mcp-server/.next/BUILD_ID +1 -1
- package/mcp-server/.next/build-manifest.json +2 -2
- package/mcp-server/.next/fallback-build-manifest.json +2 -2
- package/mcp-server/.next/prerender-manifest.json +3 -3
- package/mcp-server/.next/server/app/_global-error.html +2 -2
- package/mcp-server/.next/server/app/_global-error.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/_not-found.html +1 -1
- package/mcp-server/.next/server/app/_not-found.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/mcp-server/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/api/cloud/start-fix/route.js +2 -2
- package/mcp-server/.next/server/app/api/cloud/start-fix/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/auth/error/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/auth/error.html +1 -1
- package/mcp-server/.next/server/app/auth/error.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_full.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/auth/error.segments/auth/error/__PAGE__.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/auth/error.segment.rsc +1 -1
- package/mcp-server/.next/server/app/auth/error.segments/auth.segment.rsc +1 -1
- package/mcp-server/.next/server/app/index.html +1 -1
- package/mcp-server/.next/server/app/index.rsc +3 -3
- package/mcp-server/.next/server/app/index.segments/__PAGE__.segment.rsc +2 -2
- package/mcp-server/.next/server/app/index.segments/_full.segment.rsc +3 -3
- package/mcp-server/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/mcp-server/.next/server/app/index.segments/_index.segment.rsc +2 -2
- package/mcp-server/.next/server/app/index.segments/_tree.segment.rsc +2 -2
- package/mcp-server/.next/server/app/logs/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/mcp/route.js +2 -2
- package/mcp-server/.next/server/app/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/signin/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/video/[session]/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/[id]/report/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/new/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/workflows/new/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/workflows/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js +284 -37
- package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js.map +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__730a8fd0._.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__730a8fd0._.js.map +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__748f411f._.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__748f411f._.js.map +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__8a84f9f4._.js +20 -20
- package/mcp-server/.next/server/chunks/[root-of-the-server]__8a84f9f4._.js.map +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c1681338._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c1681338._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__ec6a1335._.js.map +1 -1
- package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js +5 -5
- package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js.map +1 -1
- package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js +121 -27
- package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js.map +1 -1
- package/mcp-server/.next/server/chunks/node_modules__pnpm_85ddbe9c._.js +1 -1
- package/mcp-server/.next/server/chunks/node_modules__pnpm_85ddbe9c._.js.map +1 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__2e44f0db._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__2e44f0db._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__3585c949._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__3585c949._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__477c3bbb._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__477c3bbb._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__570677dc._.js → [root-of-the-server]__880839a0._.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__880839a0._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_41b8f993._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/_41b8f993._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_9ba0ef29._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/_9ba0ef29._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_cd4dc25e._.js.map +1 -1
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_new_new-workflow-client_tsx_1312c046._.js +2 -2
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_new_new-workflow-client_tsx_1312c046._.js.map +1 -1
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_workflows-client_tsx_268cfd4a._.js +7 -0
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_workflows_workflows-client_tsx_268cfd4a._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_961f21c4._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_961f21c4._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_a82244bf._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_a82244bf._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{node_modules__pnpm_07527699._.js → node_modules__pnpm_eb98e511._.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_eb98e511._.js.map +1 -0
- package/mcp-server/.next/server/server-reference-manifest.js +1 -1
- package/mcp-server/.next/server/server-reference-manifest.json +1 -1
- package/mcp-server/.next/static/chunks/000849a6a897f531.css +1 -0
- package/mcp-server/.next/static/chunks/048cee2510ddb1a0.js +1 -0
- package/mcp-server/.next/static/chunks/0622bd0e093adee7.js +3 -0
- package/mcp-server/.next/static/chunks/{46f60efee5f19794.js → 16359f64918a93f3.js} +1 -1
- package/mcp-server/.next/static/chunks/1851a3e70d7efc10.js +1 -0
- package/mcp-server/.next/static/chunks/{cc6addc4bb10fa11.js → 2ad16eeb719786f1.js} +1 -1
- package/mcp-server/.next/static/chunks/57feca7a4e06545e.js +7 -0
- package/mcp-server/.next/static/chunks/93db5737a327ab0c.js +6 -0
- package/mcp-server/.next/static/chunks/9fd3c715ecfb4d05.js +1 -0
- package/mcp-server/.next/static/chunks/b4b1ec6435790587.js +1 -0
- package/mcp-server/.next/static/chunks/cfe150cb2048b7e8.js +1 -0
- package/mcp-server/app/api/cloud/fix-workflow/steps.ts +359 -28
- package/mcp-server/app/api/cloud/fix-workflow/workflow.ts +16 -8
- package/mcp-server/app/api/cloud/start-fix/route.ts +2 -2
- package/mcp-server/app/api/tools/route.ts +11 -12
- package/mcp-server/app/api/workflows/route.ts +45 -1
- package/mcp-server/app/mcp/tools.ts +58 -98
- package/mcp-server/app/workflows/workflows-client.tsx +259 -100
- package/package.json +1 -1
- package/src/tui-interface-impl.tsx +175 -127
- package/mcp-server/.next/server/chunks/[root-of-the-server]__75d68567._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__75d68567._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0ff05d72._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0ff05d72._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__27cc5956._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__27cc5956._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__570677dc._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__ef510343._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__ef510343._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_07527699._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_7cc36047._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/node_modules__pnpm_7cc36047._.js.map +0 -1
- package/mcp-server/.next/static/chunks/07848f6bd2a7e5f6.js +0 -3
- package/mcp-server/.next/static/chunks/637a66565f27572f.js +0 -6
- package/mcp-server/.next/static/chunks/aed4fb5252a4bc95.js +0 -3
- package/mcp-server/.next/static/chunks/e8d521464b0c96ca.css +0 -1
- package/mcp-server/.next/static/chunks/ff53279afa939907.js +0 -1
- package/mcp-server/.next/static/chunks/ffa2ecb6845be49c.js +0 -1
- /package/mcp-server/.next/static/{ZvLsxTWoDyQzaSsr_VeX6 → G5taiQ-Jp0B_MdvkQuoIT}/_buildManifest.js +0 -0
- /package/mcp-server/.next/static/{ZvLsxTWoDyQzaSsr_VeX6 → G5taiQ-Jp0B_MdvkQuoIT}/_clientMiddlewareManifest.json +0 -0
- /package/mcp-server/.next/static/{ZvLsxTWoDyQzaSsr_VeX6 → G5taiQ-Jp0B_MdvkQuoIT}/_ssgManifest.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { listWorkflowRuns } from "@/lib/workflow-storage"
|
|
1
|
+
import { deleteWorkflowRuns, listWorkflowRuns } from "@/lib/workflow-storage"
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* GET /api/workflows
|
|
@@ -37,3 +37,47 @@ export async function GET(request: Request) {
|
|
|
37
37
|
)
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* DELETE /api/workflows
|
|
43
|
+
* Deletes workflow runs and their associated blobs
|
|
44
|
+
*
|
|
45
|
+
* Body:
|
|
46
|
+
* - userId: Required. The user ID
|
|
47
|
+
* - runIds: Required. Array of run IDs to delete
|
|
48
|
+
*/
|
|
49
|
+
export async function DELETE(request: Request) {
|
|
50
|
+
try {
|
|
51
|
+
const body = await request.json()
|
|
52
|
+
const { userId, runIds } = body
|
|
53
|
+
|
|
54
|
+
if (!userId) {
|
|
55
|
+
return Response.json({ error: "userId is required" }, { status: 400 })
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (!runIds || !Array.isArray(runIds) || runIds.length === 0) {
|
|
59
|
+
return Response.json({ error: "runIds array is required" }, { status: 400 })
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
console.log(`[Workflows API] Deleting ${runIds.length} runs for user: ${userId}`)
|
|
63
|
+
|
|
64
|
+
const result = await deleteWorkflowRuns(userId, runIds)
|
|
65
|
+
|
|
66
|
+
console.log(`[Workflows API] Deleted ${result.deleted} runs, ${result.errors.length} errors`)
|
|
67
|
+
|
|
68
|
+
return Response.json({
|
|
69
|
+
success: true,
|
|
70
|
+
deleted: result.deleted,
|
|
71
|
+
errors: result.errors
|
|
72
|
+
})
|
|
73
|
+
} catch (error) {
|
|
74
|
+
console.error("[Workflows API] Error deleting workflow runs:", error)
|
|
75
|
+
return Response.json(
|
|
76
|
+
{
|
|
77
|
+
success: false,
|
|
78
|
+
error: error instanceof Error ? error.message : String(error)
|
|
79
|
+
},
|
|
80
|
+
{ status: 500 }
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
}
|
|
@@ -12,22 +12,22 @@ const execAsync = promisify(exec)
|
|
|
12
12
|
// Tool descriptions
|
|
13
13
|
export const TOOL_DESCRIPTIONS = {
|
|
14
14
|
fix_my_app:
|
|
15
|
-
"
|
|
15
|
+
"Diagnoses application errors from dev3000 logs. Returns a prioritized list of issues requiring fixes.\n\n**CRITICAL: You MUST use this tool in a loop until all errors are resolved:**\n\n```\nwhile (errors exist) {\n 1. DIAGNOSE: Call fix_my_app to get current errors\n 2. FIX: Implement a fix for the highest-priority error\n 3. VERIFY: Call fix_my_app again to confirm the error is gone\n 4. REPEAT: Continue until no errors remain\n}\n```\n\n**This tool does NOT fix anything automatically.** It returns diagnostic data. You must:\n- Read the error output\n- Investigate and fix each issue\n- Call this tool again to verify your fix worked\n- Keep looping until the app is healthy\n\n**What it analyzes:**\n• Server logs, browser console, network requests\n• Categorizes: build errors, server crashes, browser errors, network issues, warnings\n• Prioritizes by severity (fix build errors first, then server, then browser, etc.)\n• Shows user interactions that triggered each error\n\n**Parameters:**\n• focusArea: 'build', 'runtime', 'network', 'ui', 'performance', or 'all' (default)\n• mode: 'snapshot' (current state), 'bisect' (before/after comparison), 'monitor' (continuous)\n• timeRangeMinutes: How far back to analyze (default: 10)\n• createPR: If true, creates a PR branch for the highest-priority issue\n\n**Framework support:** Auto-detects Next.js for framework-specific analysis.\n\n**Attribution for commits/PRs:**\n```\nGenerated with Claude Code using d3k (https://d3k.dev)\nCo-Authored-By: Claude <noreply@anthropic.com>\n```",
|
|
16
16
|
|
|
17
17
|
execute_browser_action:
|
|
18
|
-
"
|
|
18
|
+
"Executes browser actions (click, navigate, scroll, type, evaluate JS) in the dev3000-managed Chrome instance.\n\n**Routing behavior:**\n• Delegates to chrome-devtools MCP when available for screenshots, navigation, clicks, and JS evaluation\n• Falls back to dev3000's native CDP implementation otherwise\n• Shares the same Chrome instance - no conflicts between tools\n\n**Available actions:**\n• screenshot: Capture current page state\n• navigate: Go to a URL\n• click: Click at coordinates {x, y}\n• scroll: Scroll by {x, y} pixels\n• type: Type text into focused element\n• evaluate: Execute JavaScript (read-only operations recommended)\n\n**Use cases:**\n• Reproducing user interactions that triggered errors\n• Verifying fixes by replaying the error scenario\n• Testing specific UI workflows",
|
|
19
19
|
|
|
20
20
|
analyze_visual_diff:
|
|
21
|
-
"
|
|
21
|
+
"Compares two screenshots and returns analysis instructions for identifying visual differences.\n\n**What it provides:**\n• Instructions to load both images for comparison\n• Context about what visual changes to look for\n• Guidance on identifying layout shift causes\n\n**Use cases:**\n• Analyzing before/after frames from CLS detection\n• Identifying elements that appeared, moved, or resized\n• Debugging visual regressions",
|
|
22
22
|
|
|
23
23
|
find_component_source:
|
|
24
|
-
"
|
|
24
|
+
"Maps a DOM element to its React component source code location.\n\n**How it works:**\n1. Inspects the element via Chrome DevTools Protocol\n2. Extracts the React component function source\n3. Identifies unique code patterns (JSX, classNames, etc.)\n4. Returns grep patterns to locate the source file\n\n**Use cases:**\n• Finding which file contains a specific UI element\n• Locating components responsible for layout shifts\n• Tracing DOM elements back to source code",
|
|
25
25
|
|
|
26
26
|
restart_dev_server:
|
|
27
|
-
"
|
|
27
|
+
"Restarts the development server while preserving dev3000's monitoring infrastructure.\n\n**Restart process:**\n1. Tries nextjs-dev MCP restart if available\n2. Falls back to killing and respawning the server process\n3. Preserves: MCP server, browser connection, log capture, screenshots\n\n**When to use:**\n• After modifying config files (next.config.js, middleware, .env)\n• To clear persistent server state\n• For changes that HMR cannot handle\n\n**Important:**\n• Do NOT manually kill the dev server with pkill/kill commands\n• Do NOT manually start the server with npm/pnpm/yarn\n• Server will be offline briefly during restart\n• Most code changes are handled by HMR - only restart when necessary",
|
|
28
28
|
|
|
29
29
|
crawl_app:
|
|
30
|
-
"
|
|
30
|
+
"Discovers URLs in the application by crawling links from the homepage.\n\n**Parameters:**\n• depth: How many link levels to follow (1, 2, 3, or 'all')\n• limit: Max links per page (default: 3)\n\n**Behavior:**\n• Starts at localhost homepage\n• Follows same-origin links only\n• Deduplicates discovered URLs\n• Returns list of all found pages\n\n**Use cases:**\n• Discovering all routes before running diagnostics\n• Site-wide testing coverage\n• Verifying all pages load without errors"
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
// Types
|
|
@@ -727,134 +727,115 @@ export async function fixMyApp({
|
|
|
727
727
|
}
|
|
728
728
|
|
|
729
729
|
if (totalErrors === 0 && !recentErrorsOutsideTimeRange) {
|
|
730
|
-
results.push(
|
|
731
|
-
results.push("
|
|
730
|
+
results.push(`No errors found in last ${timeRangeMinutes} minutes.`)
|
|
731
|
+
results.push("Application appears healthy.")
|
|
732
732
|
|
|
733
733
|
if (includeTimestampInstructions && mode !== "monitor") {
|
|
734
734
|
results.push("")
|
|
735
|
-
results.push("
|
|
736
|
-
results.push("• Use mode='bisect'
|
|
737
|
-
results.push("• Use mode='monitor' for continuous
|
|
738
|
-
results.push("• Increase timeRangeMinutes to analyze longer
|
|
735
|
+
results.push("Options:")
|
|
736
|
+
results.push("• Use mode='bisect' to compare before/after states during testing")
|
|
737
|
+
results.push("• Use mode='monitor' for continuous monitoring")
|
|
738
|
+
results.push("• Increase timeRangeMinutes to analyze a longer period")
|
|
739
739
|
}
|
|
740
740
|
} else if (totalErrors === 0 && recentErrorsOutsideTimeRange) {
|
|
741
741
|
results.push(
|
|
742
|
-
|
|
742
|
+
`No errors in last ${timeRangeMinutes} minutes, but found ${allLogErrors.length} errors in full log.`
|
|
743
743
|
)
|
|
744
744
|
results.push("")
|
|
745
|
-
results.push("
|
|
745
|
+
results.push("Older errors (outside time range):")
|
|
746
746
|
// Show last 5 errors from the full log with their interactions
|
|
747
747
|
allLogErrors.slice(-5).forEach((error) => {
|
|
748
748
|
const interactions = findInteractionsBeforeError(error, logLines)
|
|
749
749
|
if (interactions.length > 0) {
|
|
750
|
-
results.push("
|
|
750
|
+
results.push(" Preceding interactions:")
|
|
751
751
|
for (const interaction of interactions) {
|
|
752
752
|
results.push(` ${interaction}`)
|
|
753
753
|
}
|
|
754
754
|
}
|
|
755
|
-
results.push(`
|
|
755
|
+
results.push(` - ${error}`)
|
|
756
756
|
results.push("")
|
|
757
757
|
})
|
|
758
|
-
results.push("
|
|
759
|
-
results.push("💡 **TIP:** Or use timeRangeMinutes=60 to check the last hour")
|
|
758
|
+
results.push("To analyze these errors, increase timeRangeMinutes (e.g., timeRangeMinutes=60)")
|
|
760
759
|
} else {
|
|
761
760
|
results.push(
|
|
762
|
-
|
|
761
|
+
`**${totalErrors} ISSUES DETECTED** (${criticalErrors} critical, ${categorizedErrors.warnings.length} warnings)`
|
|
763
762
|
)
|
|
764
763
|
results.push("")
|
|
764
|
+
results.push("**ACTION REQUIRED:** Fix the highest-priority error below, then call fix_my_app again to verify.")
|
|
765
|
+
results.push("")
|
|
765
766
|
|
|
766
767
|
// Show categorized errors with their preceding interactions
|
|
767
768
|
if (categorizedErrors.serverErrors.length > 0) {
|
|
768
|
-
results.push("
|
|
769
|
+
results.push("SERVER ERRORS:")
|
|
769
770
|
categorizedErrors.serverErrors.slice(-5).forEach((error) => {
|
|
770
771
|
const interactions = findInteractionsBeforeError(error, logLines)
|
|
771
772
|
if (interactions.length > 0) {
|
|
772
|
-
results.push("
|
|
773
|
+
results.push(" Preceding interactions:")
|
|
773
774
|
for (const interaction of interactions) {
|
|
774
775
|
results.push(` ${interaction}`)
|
|
775
776
|
}
|
|
776
777
|
}
|
|
777
|
-
results.push(`
|
|
778
|
+
results.push(` - ${error}`)
|
|
778
779
|
results.push("")
|
|
779
780
|
})
|
|
780
781
|
}
|
|
781
782
|
|
|
782
783
|
if (categorizedErrors.browserErrors.length > 0) {
|
|
783
|
-
results.push("
|
|
784
|
+
results.push("BROWSER/CONSOLE ERRORS:")
|
|
784
785
|
categorizedErrors.browserErrors.slice(-5).forEach((error) => {
|
|
785
786
|
const interactions = findInteractionsBeforeError(error, logLines)
|
|
786
787
|
if (interactions.length > 0) {
|
|
787
|
-
results.push("
|
|
788
|
+
results.push(" Preceding interactions:")
|
|
788
789
|
for (const interaction of interactions) {
|
|
789
790
|
results.push(` ${interaction}`)
|
|
790
791
|
}
|
|
791
792
|
}
|
|
792
|
-
results.push(`
|
|
793
|
+
results.push(` - ${error}`)
|
|
793
794
|
results.push("")
|
|
794
795
|
})
|
|
795
796
|
}
|
|
796
797
|
|
|
797
798
|
if (categorizedErrors.buildErrors.length > 0) {
|
|
798
|
-
results.push("
|
|
799
|
+
results.push("BUILD/COMPILATION ERRORS:")
|
|
799
800
|
categorizedErrors.buildErrors.slice(-5).forEach((error) => {
|
|
800
801
|
const interactions = findInteractionsBeforeError(error, logLines)
|
|
801
802
|
if (interactions.length > 0) {
|
|
802
|
-
results.push("
|
|
803
|
+
results.push(" Preceding interactions:")
|
|
803
804
|
for (const interaction of interactions) {
|
|
804
805
|
results.push(` ${interaction}`)
|
|
805
806
|
}
|
|
806
807
|
}
|
|
807
|
-
results.push(`
|
|
808
|
+
results.push(` - ${error}`)
|
|
808
809
|
results.push("")
|
|
809
810
|
})
|
|
810
811
|
}
|
|
811
812
|
|
|
812
813
|
if (categorizedErrors.networkErrors.length > 0) {
|
|
813
|
-
results.push("
|
|
814
|
+
results.push("NETWORK/API ERRORS:")
|
|
814
815
|
categorizedErrors.networkErrors.slice(-5).forEach((error) => {
|
|
815
816
|
const interactions = findInteractionsBeforeError(error, logLines)
|
|
816
817
|
if (interactions.length > 0) {
|
|
817
|
-
results.push("
|
|
818
|
+
results.push(" Preceding interactions:")
|
|
818
819
|
for (const interaction of interactions) {
|
|
819
820
|
results.push(` ${interaction}`)
|
|
820
821
|
}
|
|
821
822
|
}
|
|
822
|
-
results.push(`
|
|
823
|
+
results.push(` - ${error}`)
|
|
823
824
|
results.push("")
|
|
824
825
|
})
|
|
825
826
|
}
|
|
826
827
|
|
|
827
828
|
if (categorizedErrors.warnings.length > 0 && focusArea === "all") {
|
|
828
|
-
results.push(
|
|
829
|
+
results.push(`WARNINGS (${categorizedErrors.warnings.length} found, showing recent):`)
|
|
829
830
|
results.push(categorizedErrors.warnings.slice(-3).join("\n"))
|
|
830
831
|
results.push("")
|
|
831
832
|
}
|
|
832
833
|
|
|
833
|
-
// Show the
|
|
834
|
-
results.push("
|
|
835
|
-
results.push("
|
|
836
|
-
results.push("")
|
|
837
|
-
results.push("📍 **INTERACTION-BASED VERIFICATION WORKFLOW:**")
|
|
838
|
-
results.push("• Each error shows the EXACT user interactions that triggered it")
|
|
839
|
-
results.push("• Use these interactions to reproduce the error with execute_browser_action")
|
|
840
|
-
results.push("• After fixing, replay the SAME interactions to verify the fix works")
|
|
841
|
-
results.push("• Example: If error shows [INTERACTION] Click at (x:450, y:300), use:")
|
|
842
|
-
results.push(" execute_browser_action(action='click', params={x:450, y:300})")
|
|
834
|
+
// Show the diagnose-fix-verify loop
|
|
835
|
+
results.push("---")
|
|
836
|
+
results.push("**NEXT: Fix the highest-priority issue, then call fix_my_app again to verify.**")
|
|
843
837
|
results.push("")
|
|
844
|
-
results.push("
|
|
845
|
-
results.push("1. Analyze error patterns and preceding interactions")
|
|
846
|
-
results.push("2. Provide exact fix code with file locations")
|
|
847
|
-
results.push("3. Guide you through implementing the fixes")
|
|
848
|
-
results.push("4. Use execute_browser_action to replay the interactions")
|
|
849
|
-
results.push("5. Verify the error no longer occurs!")
|
|
850
|
-
results.push("• Dev3000 AUTO-CAPTURES screenshots during all interactions!")
|
|
851
|
-
results.push("• No manual screenshots needed - dev3000 handles it all!")
|
|
852
|
-
results.push("")
|
|
853
|
-
results.push("📸 **AUTO-SCREENSHOT MAGIC:**")
|
|
854
|
-
results.push("• Screenshots captured on EVERY page navigation")
|
|
855
|
-
results.push("• Screenshots captured on EVERY error/exception")
|
|
856
|
-
results.push("• Screenshots captured on manual triggers")
|
|
857
|
-
results.push("• All screenshots timestamped and linked to events!")
|
|
838
|
+
results.push("Keep calling fix_my_app after each fix until no errors remain.")
|
|
858
839
|
|
|
859
840
|
// Add integration-aware suggestions
|
|
860
841
|
if (integrateNextjs || integrateChromeDevtools) {
|
|
@@ -868,11 +849,11 @@ export async function fixMyApp({
|
|
|
868
849
|
)
|
|
869
850
|
|
|
870
851
|
results.push("")
|
|
871
|
-
results.push("
|
|
852
|
+
results.push("**Available MCP integrations:**")
|
|
872
853
|
|
|
873
854
|
if (integrateNextjs) {
|
|
874
855
|
results.push("")
|
|
875
|
-
results.push("
|
|
856
|
+
results.push("Next.js MCP (nextjs-dev):")
|
|
876
857
|
const nextjsSuggestions = await generateNextjsSuggestions(allErrors.join(" "))
|
|
877
858
|
nextjsSuggestions.forEach((suggestion) => {
|
|
878
859
|
const params = suggestion.params
|
|
@@ -880,20 +861,18 @@ export async function fixMyApp({
|
|
|
880
861
|
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
881
862
|
.join(", ")})`
|
|
882
863
|
: "()"
|
|
883
|
-
results.push(
|
|
884
|
-
results.push(`
|
|
864
|
+
results.push(` • nextjs-dev.${suggestion.function}${params}`)
|
|
865
|
+
results.push(` Reason: ${suggestion.reason}`)
|
|
885
866
|
})
|
|
886
867
|
|
|
887
|
-
// Next.js specific correlation tips
|
|
888
868
|
if (categorizedErrors.serverErrors.length > 0) {
|
|
889
|
-
results.push("•
|
|
890
|
-
results.push("• Check for SSR/hydration mismatches in Next.js context")
|
|
869
|
+
results.push(" • Check Next.js build/runtime logs for SSR/hydration issues")
|
|
891
870
|
}
|
|
892
871
|
}
|
|
893
872
|
|
|
894
873
|
if (integrateChromeDevtools) {
|
|
895
874
|
results.push("")
|
|
896
|
-
results.push("
|
|
875
|
+
results.push("Chrome DevTools MCP (chrome-devtools):")
|
|
897
876
|
const chromeSuggestions = await generateChromeDevtoolsSuggestions(allErrors.join(" "))
|
|
898
877
|
chromeSuggestions.forEach((suggestion) => {
|
|
899
878
|
const params = suggestion.params
|
|
@@ -901,69 +880,50 @@ export async function fixMyApp({
|
|
|
901
880
|
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
902
881
|
.join(", ")})`
|
|
903
882
|
: "()"
|
|
904
|
-
results.push(
|
|
905
|
-
results.push(`
|
|
883
|
+
results.push(` • chrome-devtools.${suggestion.function}${params}`)
|
|
884
|
+
results.push(` Reason: ${suggestion.reason}`)
|
|
906
885
|
})
|
|
907
886
|
|
|
908
|
-
// Chrome DevTools specific correlation tips
|
|
909
887
|
if (categorizedErrors.browserErrors.length > 0) {
|
|
910
|
-
results.push("•
|
|
911
|
-
results.push("• Use DOM inspection for UI interaction failures")
|
|
888
|
+
results.push(" • Use DOM inspection for UI issues")
|
|
912
889
|
}
|
|
913
890
|
if (categorizedErrors.networkErrors.length > 0) {
|
|
914
|
-
results.push("•
|
|
915
|
-
results.push("• Inspect failed requests for detailed error context")
|
|
891
|
+
results.push(" • Inspect network requests for detailed error context")
|
|
916
892
|
}
|
|
917
893
|
}
|
|
918
|
-
|
|
919
|
-
if (integrateNextjs && integrateChromeDevtools) {
|
|
920
|
-
results.push("")
|
|
921
|
-
results.push("🚀 **TRIPLE-STACK DEBUGGING POWER:**")
|
|
922
|
-
results.push("• dev3000 provides interaction replay + error correlation")
|
|
923
|
-
results.push("• nextjs-dev provides server-side framework context")
|
|
924
|
-
results.push("• chrome-devtools provides precise browser state inspection")
|
|
925
|
-
results.push("• Combined = 90%+ issue resolution rate!")
|
|
926
|
-
}
|
|
927
894
|
}
|
|
928
895
|
|
|
929
|
-
// 🎯 PRIORITIZATION & PR CREATION
|
|
930
896
|
// Find the single highest priority error and optionally create a PR
|
|
931
897
|
const highestPriorityError = findHighestPriorityError(categorizedErrors, actionableErrors, logLines)
|
|
932
898
|
|
|
933
899
|
if (highestPriorityError) {
|
|
934
900
|
results.push("")
|
|
935
|
-
results.push("
|
|
936
|
-
results.push(
|
|
937
|
-
results.push(
|
|
938
|
-
results.push(
|
|
901
|
+
results.push("---")
|
|
902
|
+
results.push("**HIGHEST PRIORITY ISSUE (fix this first):**")
|
|
903
|
+
results.push(`Priority Score: ${highestPriorityError.priorityScore}`)
|
|
904
|
+
results.push(`Category: ${highestPriorityError.category.toUpperCase()}`)
|
|
905
|
+
results.push(`Severity: ${highestPriorityError.severity.toUpperCase()}`)
|
|
939
906
|
results.push("")
|
|
940
|
-
results.push("
|
|
941
|
-
results.push(`
|
|
907
|
+
results.push("Error:")
|
|
908
|
+
results.push(` ${highestPriorityError.error}`)
|
|
942
909
|
|
|
943
910
|
if (highestPriorityError.interactions.length > 0) {
|
|
944
911
|
results.push("")
|
|
945
|
-
results.push("
|
|
912
|
+
results.push("Reproduction steps:")
|
|
946
913
|
highestPriorityError.interactions.forEach((interaction, idx) => {
|
|
947
|
-
results.push(`
|
|
914
|
+
results.push(` ${idx + 1}. ${interaction}`)
|
|
948
915
|
})
|
|
949
916
|
}
|
|
950
917
|
|
|
951
918
|
// Create PR if requested
|
|
952
919
|
if (createPR) {
|
|
953
920
|
results.push("")
|
|
954
|
-
results.push("
|
|
921
|
+
results.push("Creating PR branch for this issue...")
|
|
955
922
|
const prResult = await createPRForIssue(highestPriorityError, projectName || "")
|
|
956
923
|
results.push(prResult)
|
|
957
924
|
} else {
|
|
958
925
|
results.push("")
|
|
959
|
-
results.push("
|
|
960
|
-
results.push(" Run: fix_my_app(createPR=true)")
|
|
961
|
-
results.push("")
|
|
962
|
-
results.push(" This will:")
|
|
963
|
-
results.push(" • Create a new branch for the fix")
|
|
964
|
-
results.push(" • Generate a PR with full error context")
|
|
965
|
-
results.push(" • Include reproduction steps")
|
|
966
|
-
results.push(" • Focus on fixing just this ONE issue")
|
|
926
|
+
results.push("To create a PR branch for this issue, run: fix_my_app(createPR=true)")
|
|
967
927
|
}
|
|
968
928
|
}
|
|
969
929
|
}
|