dev3000 0.0.112 → 0.0.113

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.
Files changed (102) hide show
  1. package/dist/cdp-monitor.d.ts +2 -1
  2. package/dist/cdp-monitor.d.ts.map +1 -1
  3. package/dist/cdp-monitor.js +23 -6
  4. package/dist/cdp-monitor.js.map +1 -1
  5. package/dist/cli.js +1 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/dev-environment.d.ts +1 -0
  8. package/dist/dev-environment.d.ts.map +1 -1
  9. package/dist/dev-environment.js +2 -1
  10. package/dist/dev-environment.js.map +1 -1
  11. package/mcp-server/.next/BUILD_ID +1 -1
  12. package/mcp-server/.next/build-manifest.json +2 -2
  13. package/mcp-server/.next/fallback-build-manifest.json +2 -2
  14. package/mcp-server/.next/prerender-manifest.json +3 -3
  15. package/mcp-server/.next/server/app/_global-error/page.js.nft.json +1 -1
  16. package/mcp-server/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  17. package/mcp-server/.next/server/app/_global-error.html +2 -2
  18. package/mcp-server/.next/server/app/_global-error.rsc +1 -1
  19. package/mcp-server/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  20. package/mcp-server/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  21. package/mcp-server/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  22. package/mcp-server/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  23. package/mcp-server/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  24. package/mcp-server/.next/server/app/_not-found/page.js.nft.json +1 -1
  25. package/mcp-server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  26. package/mcp-server/.next/server/app/_not-found.html +1 -1
  27. package/mcp-server/.next/server/app/_not-found.rsc +2 -2
  28. package/mcp-server/.next/server/app/_not-found.segments/_full.segment.rsc +2 -2
  29. package/mcp-server/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  30. package/mcp-server/.next/server/app/_not-found.segments/_index.segment.rsc +2 -2
  31. package/mcp-server/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  32. package/mcp-server/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  33. package/mcp-server/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  34. package/mcp-server/.next/server/app/auth/error/page.js.nft.json +1 -1
  35. package/mcp-server/.next/server/app/auth/error/page_client-reference-manifest.js +1 -1
  36. package/mcp-server/.next/server/app/auth/error.html +1 -1
  37. package/mcp-server/.next/server/app/auth/error.rsc +2 -2
  38. package/mcp-server/.next/server/app/auth/error.segments/_full.segment.rsc +2 -2
  39. package/mcp-server/.next/server/app/auth/error.segments/_head.segment.rsc +1 -1
  40. package/mcp-server/.next/server/app/auth/error.segments/_index.segment.rsc +2 -2
  41. package/mcp-server/.next/server/app/auth/error.segments/_tree.segment.rsc +2 -2
  42. package/mcp-server/.next/server/app/auth/error.segments/auth/error/__PAGE__.segment.rsc +1 -1
  43. package/mcp-server/.next/server/app/auth/error.segments/auth/error.segment.rsc +1 -1
  44. package/mcp-server/.next/server/app/auth/error.segments/auth.segment.rsc +1 -1
  45. package/mcp-server/.next/server/app/index.html +1 -1
  46. package/mcp-server/.next/server/app/index.rsc +2 -2
  47. package/mcp-server/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  48. package/mcp-server/.next/server/app/index.segments/_full.segment.rsc +2 -2
  49. package/mcp-server/.next/server/app/index.segments/_head.segment.rsc +1 -1
  50. package/mcp-server/.next/server/app/index.segments/_index.segment.rsc +2 -2
  51. package/mcp-server/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  52. package/mcp-server/.next/server/app/logs/page.js.nft.json +1 -1
  53. package/mcp-server/.next/server/app/logs/page_client-reference-manifest.js +1 -1
  54. package/mcp-server/.next/server/app/page.js.nft.json +1 -1
  55. package/mcp-server/.next/server/app/page_client-reference-manifest.js +1 -1
  56. package/mcp-server/.next/server/app/signin/page.js.nft.json +1 -1
  57. package/mcp-server/.next/server/app/signin/page_client-reference-manifest.js +1 -1
  58. package/mcp-server/.next/server/app/video/[session]/page.js.nft.json +1 -1
  59. package/mcp-server/.next/server/app/video/[session]/page_client-reference-manifest.js +1 -1
  60. package/mcp-server/.next/server/app/workflows/[id]/report/page.js.nft.json +1 -1
  61. package/mcp-server/.next/server/app/workflows/[id]/report/page_client-reference-manifest.js +1 -1
  62. package/mcp-server/.next/server/app/workflows/new/page.js.nft.json +1 -1
  63. package/mcp-server/.next/server/app/workflows/new/page_client-reference-manifest.js +1 -1
  64. package/mcp-server/.next/server/app/workflows/page.js.nft.json +1 -1
  65. package/mcp-server/.next/server/app/workflows/page_client-reference-manifest.js +1 -1
  66. package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js +38 -32
  67. package/mcp-server/.next/server/chunks/[root-of-the-server]__157de66b._.js.map +1 -1
  68. package/mcp-server/.next/server/chunks/[root-of-the-server]__446f0436._.js.map +1 -1
  69. package/mcp-server/.next/server/chunks/[root-of-the-server]__730a8fd0._.js.map +1 -1
  70. package/mcp-server/.next/server/chunks/[root-of-the-server]__c508da18._.js +1 -1
  71. package/mcp-server/.next/server/chunks/[root-of-the-server]__c508da18._.js.map +1 -1
  72. package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js +6 -5
  73. package/mcp-server/.next/server/chunks/bee4f_next_dist_esm_build_templates_app-route_1ece9366.js.map +1 -1
  74. package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js +29 -23
  75. package/mcp-server/.next/server/chunks/mcp-server_app_api_cloud_fix-workflow_steps_ts_b65f3271._.js.map +1 -1
  76. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0ff05d72._.js +3 -0
  77. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0ff05d72._.js.map +1 -0
  78. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__9a29b768._.js → [root-of-the-server]__27cc5956._.js} +2 -2
  79. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__9a29b768._.js.map → [root-of-the-server]__27cc5956._.js.map} +1 -1
  80. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__8ce53954._.js → [root-of-the-server]__34731fcf._.js} +2 -2
  81. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__34731fcf._.js.map +1 -0
  82. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__97dbdf3d._.js → [root-of-the-server]__570677dc._.js} +2 -2
  83. package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__97dbdf3d._.js.map → [root-of-the-server]__570677dc._.js.map} +1 -1
  84. package/mcp-server/.next/server/chunks/ssr/_cd4dc25e._.js.map +1 -1
  85. package/mcp-server/.next/server/server-reference-manifest.js +1 -1
  86. package/mcp-server/.next/server/server-reference-manifest.json +1 -1
  87. package/mcp-server/.next/static/chunks/{8d5a57e1de949e9f.js → 07848f6bd2a7e5f6.js} +2 -2
  88. package/mcp-server/.next/static/chunks/aed4fb5252a4bc95.js +3 -0
  89. package/mcp-server/.next/static/chunks/e8d521464b0c96ca.css +1 -0
  90. package/mcp-server/app/api/cloud/fix-workflow/steps.ts +236 -63
  91. package/mcp-server/app/api/cloud/fix-workflow/workflow.ts +19 -6
  92. package/mcp-server/app/api/cloud/start-fix/route.ts +2 -1
  93. package/mcp-server/app/workflows/workflows-client.tsx +35 -0
  94. package/package.json +1 -1
  95. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__3a2dacc6._.js +0 -3
  96. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__3a2dacc6._.js.map +0 -1
  97. package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__8ce53954._.js.map +0 -1
  98. package/mcp-server/.next/static/chunks/2bcc973e2858aaba.js +0 -1
  99. package/mcp-server/.next/static/chunks/a0e4d9b8d2f627cf.css +0 -1
  100. /package/mcp-server/.next/static/{aFliqsQDgiIm8sdHtWiID → UcmWUkU-l9iLeWRnSUybj}/_buildManifest.js +0 -0
  101. /package/mcp-server/.next/static/{aFliqsQDgiIm8sdHtWiID → UcmWUkU-l9iLeWRnSUybj}/_clientMiddlewareManifest.json +0 -0
  102. /package/mcp-server/.next/static/{aFliqsQDgiIm8sdHtWiID → UcmWUkU-l9iLeWRnSUybj}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../mcp-server/app/api/cloud/fix-workflow/steps.ts"],"sourcesContent":["/**\n * Step functions for fix-workflow\n * Separated into their own module to avoid workflow bundler issues\n */ /**__internal_workflows{\"steps\":{\"app/api/cloud/fix-workflow/steps.ts\":{\"analyzeLogsWithAgent\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//analyzeLogsWithAgent\"},\"cleanupSandbox\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//cleanupSandbox\"},\"createD3kSandbox\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//createD3kSandbox\"},\"createGitHubPR\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//createGitHubPR\"},\"fetchRealLogs\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//fetchRealLogs\"},\"uploadToBlob\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//uploadToBlob\"}}}}*/;\n/**\n * Step 0: Create d3k sandbox with MCP tools pre-configured\n */ export async function createD3kSandbox(repoUrl, branch, projectName, vercelToken, vercelOidcToken) {\n console.log(`[Step 0] Creating d3k sandbox for ${projectName}...`);\n console.log(`[Step 0] Repository: ${repoUrl}`);\n console.log(`[Step 0] Branch: ${branch}`);\n // Log available token types\n console.log(`[Step 0] VERCEL_OIDC_TOKEN from env: ${!!process.env.VERCEL_OIDC_TOKEN}`);\n console.log(`[Step 0] VERCEL_OIDC_TOKEN passed as param: ${!!vercelOidcToken}`);\n console.log(`[Step 0] VERCEL_TOKEN available: ${!!process.env.VERCEL_TOKEN}`);\n console.log(`[Step 0] User access token provided: ${!!vercelToken}`);\n // Set VERCEL_OIDC_TOKEN if passed from workflow context\n // This is necessary because workflow steps don't automatically inherit environment variables\n if (vercelOidcToken && !process.env.VERCEL_OIDC_TOKEN) {\n process.env.VERCEL_OIDC_TOKEN = vercelOidcToken;\n console.log(`[Step 0] Set VERCEL_OIDC_TOKEN from workflow context`);\n }\n const sandboxResult = await createD3kSandboxUtil({\n repoUrl,\n branch,\n projectDir: \"\",\n packageManager: \"pnpm\",\n debug: true\n });\n console.log(`[Step 0] Sandbox created successfully`);\n console.log(`[Step 0] Dev URL: ${sandboxResult.devUrl}`);\n console.log(`[Step 0] MCP URL: ${sandboxResult.mcpUrl}`);\n // Now capture CLS and errors using MCP from INSIDE the sandbox\n // We must do this in Step 0 while we have the sandbox object\n console.log(`[Step 0] Capturing CLS metrics from inside sandbox...`);\n let clsData = null;\n let mcpError = null;\n try {\n // Call fix_my_app MCP tool via curl from inside the sandbox\n // This avoids network isolation issues - we're calling localhost:3684 from within the sandbox\n const mcpCommand = `curl -s -X POST http://localhost:3684/mcp \\\\\n -H \"Content-Type: application/json\" \\\\\n -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"fix_my_app\",\"arguments\":{\"mode\":\"snapshot\",\"focusArea\":\"performance\",\"returnRawData\":true}}}'`;\n console.log(`[Step 0] Executing MCP command inside sandbox...`);\n const mcpResult = await sandboxResult.sandbox.runCommand({\n cmd: \"bash\",\n args: [\n \"-c\",\n mcpCommand\n ]\n });\n console.log(`[Step 0] MCP command exit code: ${mcpResult.exitCode}`);\n // Handle stdout which can be a string or a function\n // The Vercel Sandbox SDK types stdout as a union of string | function\n let stdout;\n const rawStdout = mcpResult.stdout;\n if (typeof rawStdout === \"string\") {\n stdout = rawStdout;\n } else if (typeof rawStdout === \"function\") {\n stdout = await rawStdout();\n } else {\n stdout = String(rawStdout || \"\");\n }\n console.log(`[Step 0] MCP stdout length: ${stdout.length} bytes`);\n if (mcpResult.exitCode === 0 && stdout) {\n try {\n const mcpResponse = JSON.parse(stdout);\n if (mcpResponse.result?.content) {\n // Extract the actual data from MCP response\n const contentArray = mcpResponse.result.content;\n for (const item of contentArray){\n if (item.type === \"text\" && item.text) {\n // Try to parse the text as JSON if it contains structured data\n try {\n clsData = JSON.parse(item.text);\n console.log(`[Step 0] Successfully parsed CLS data`);\n break;\n } catch {\n // If not JSON, treat as plain text\n clsData = {\n rawOutput: item.text\n };\n }\n }\n }\n }\n console.log(`[Step 0] CLS data captured:`, JSON.stringify(clsData).substring(0, 500));\n } catch (parseError) {\n mcpError = `Failed to parse MCP response: ${parseError instanceof Error ? parseError.message : String(parseError)}`;\n console.log(`[Step 0] ${mcpError}`);\n console.log(`[Step 0] Raw stdout: ${stdout.substring(0, 1000)}`);\n }\n } else {\n mcpError = `MCP command failed with exit code ${mcpResult.exitCode}`;\n console.log(`[Step 0] ${mcpError}`);\n if (mcpResult.stderr) {\n console.log(`[Step 0] stderr: ${mcpResult.stderr}`);\n }\n }\n } catch (error) {\n mcpError = `MCP execution error: ${error instanceof Error ? error.message : String(error)}`;\n console.log(`[Step 0] ${mcpError}`);\n }\n // Note: We cannot return the cleanup function or sandbox object as they're not serializable\n // Sandbox cleanup will happen automatically when the sandbox times out\n return {\n mcpUrl: sandboxResult.mcpUrl,\n devUrl: sandboxResult.devUrl,\n bypassToken: sandboxResult.bypassToken,\n clsData,\n mcpError\n };\n}\n/**\n * Step 1: Use browser automation to capture real errors\n * Uses d3k MCP server in sandbox (if available) or AI Gateway for browser automation\n */ export async function fetchRealLogs(mcpUrlOrDevUrl, bypassToken, sandboxDevUrl, clsData, mcpError) {\n // If we already have CLS data from Step 0, use it\n if (clsData) {\n console.log(\"[Step 1] Using CLS data captured in Step 0\");\n return JSON.stringify(clsData, null, 2);\n }\n // If there was an MCP error in Step 0, log it\n if (mcpError) {\n console.log(`[Step 1] Note: MCP error from Step 0: ${mcpError}`);\n }\n // Determine if we're using sandbox MCP or direct dev URL\n const isSandbox = !!sandboxDevUrl;\n const devUrl = sandboxDevUrl || mcpUrlOrDevUrl;\n const mcpUrl = isSandbox ? mcpUrlOrDevUrl : null;\n console.log(`[Step 1] Fetching logs from: ${devUrl}`);\n console.log(`[Step 1] Using sandbox: ${isSandbox ? \"yes\" : \"no\"}`);\n if (mcpUrl) {\n console.log(`[Step 1] MCP URL: ${mcpUrl}`);\n }\n console.log(`[Step 1] Bypass token: ${bypassToken ? \"provided\" : \"not provided\"}`);\n try {\n // Construct URL with bypass token if provided\n const urlWithBypass = bypassToken ? `${devUrl}?x-vercel-protection-bypass=${bypassToken}` : devUrl;\n console.log(`[Step 1] Final URL: ${urlWithBypass.replace(bypassToken || \"\", \"***\")}`);\n if (isSandbox && mcpUrl) {\n // Use d3k MCP server in sandbox - capture CLS metrics and errors\n console.log(\"[Step 1] Using d3k MCP server to capture CLS metrics and errors...\");\n // First, validate MCP server access and list available tools\n console.log(\"[Step 1] Validating d3k MCP server access...\");\n try {\n const toolsResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 0,\n method: \"tools/list\"\n })\n });\n if (toolsResponse.ok) {\n const toolsText = await toolsResponse.text();\n try {\n const toolsData = JSON.parse(toolsText);\n const toolNames = toolsData.result?.tools?.map((t)=>t.name) || [];\n console.log(`[Step 1] ✅ d3k MCP server accessible`);\n console.log(`[Step 1] Available tools (${toolNames.length}): ${toolNames.join(\", \")}`);\n // Check for expected chrome-devtools and nextjs-dev tools\n const hasChrome = toolNames.some((name)=>name.includes(\"chrome-devtools\"));\n const hasNextjs = toolNames.some((name)=>name.includes(\"nextjs\"));\n const hasFixMyApp = toolNames.includes(\"fix_my_app\");\n console.log(`[Step 1] Chrome DevTools MCP: ${hasChrome ? \"✅\" : \"❌\"}`);\n console.log(`[Step 1] Next.js DevTools MCP: ${hasNextjs ? \"✅\" : \"❌\"}`);\n console.log(`[Step 1] fix_my_app tool: ${hasFixMyApp ? \"✅\" : \"❌\"}`);\n } catch {\n console.log(`[Step 1] MCP server responded but couldn't parse tools list: ${toolsText.substring(0, 200)}`);\n }\n } else {\n console.log(`[Step 1] ⚠️ MCP server not accessible: ${toolsResponse.status}`);\n }\n } catch (error) {\n console.log(`[Step 1] ⚠️ Failed to validate MCP server: ${error instanceof Error ? error.message : String(error)}`);\n }\n // Navigate to the app to generate logs\n console.log(\"[Step 1] Navigating browser to app URL...\");\n const navResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 0,\n method: \"tools/call\",\n params: {\n name: \"execute_browser_action\",\n arguments: {\n action: \"navigate\",\n params: {\n url: urlWithBypass\n }\n }\n }\n })\n });\n if (navResponse.ok) {\n console.log(\"[Step 1] Browser navigation completed\");\n } else {\n console.log(`[Step 1] Browser navigation failed: ${navResponse.status}`);\n }\n // Wait for page to fully load\n console.log(\"[Step 1] Waiting 5s for page load...\");\n await new Promise((resolve)=>setTimeout(resolve, 5000));\n // Check d3k logs to see if it's capturing data\n console.log(\"[Step 1] Fetching d3k logs from sandbox to verify it's working...\");\n try {\n const logsResponse = await fetch(`${mcpUrl}/api/logs`);\n if (logsResponse.ok) {\n const logsText = await logsResponse.text();\n console.log(`[Step 1] d3k logs (last 1000 chars):\\n${logsText.slice(-1000)}`);\n } else {\n console.log(`[Step 1] Could not fetch d3k logs: ${logsResponse.status}`);\n }\n } catch (error) {\n console.log(`[Step 1] Failed to fetch d3k logs: ${error instanceof Error ? error.message : String(error)}`);\n }\n // Call fix_my_app with focusArea='performance' to capture CLS and jank\n console.log(\"[Step 1] Calling fix_my_app with focusArea='performance'...\");\n // Set a 3-minute timeout for the MCP call\n const controller = new AbortController();\n const timeoutId = setTimeout(()=>controller.abort(), 3 * 60 * 1000);\n try {\n const mcpResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 1,\n method: \"tools/call\",\n params: {\n name: \"fix_my_app\",\n arguments: {\n mode: \"snapshot\",\n focusArea: \"performance\",\n timeRangeMinutes: 5,\n returnRawData: false\n }\n }\n }),\n signal: controller.signal\n });\n clearTimeout(timeoutId);\n if (!mcpResponse.ok) {\n throw new Error(`MCP request failed: ${mcpResponse.status}`);\n }\n // Parse SSE response\n const text = await mcpResponse.text();\n console.log(`[Step 1] fix_my_app response length: ${text.length} bytes`);\n console.log(`[Step 1] fix_my_app response preview (first 500 chars):\\n${text.substring(0, 500)}`);\n const lines = text.split(\"\\n\");\n console.log(`[Step 1] Response split into ${lines.length} lines`);\n let logAnalysis = \"\";\n let linesProcessed = 0;\n let contentBlocks = 0;\n for (const line of lines){\n if (line.startsWith(\"data: \")) {\n linesProcessed++;\n try {\n const json = JSON.parse(line.substring(6));\n console.log(`[Step 1] Parsed JSON line ${linesProcessed}:`, JSON.stringify(json).substring(0, 200));\n if (json.result?.content) {\n for (const content of json.result.content){\n if (content.type === \"text\") {\n contentBlocks++;\n logAnalysis += content.text;\n console.log(`[Step 1] Added text content block ${contentBlocks}, length: ${content.text.length}`);\n }\n }\n } else if (json.error) {\n console.log(`[Step 1] ERROR in response: ${JSON.stringify(json.error)}`);\n }\n } catch (error) {\n console.log(`[Step 1] Failed to parse JSON line ${linesProcessed}: ${error instanceof Error ? error.message : String(error)}`);\n console.log(`[Step 1] Problem line: ${line.substring(0, 200)}`);\n }\n }\n }\n console.log(`[Step 1] Processed ${linesProcessed} data lines, ${contentBlocks} content blocks`);\n console.log(`[Step 1] Got ${logAnalysis.length} chars from fix_my_app (performance analysis)`);\n if (logAnalysis.length === 0) {\n console.log(`[Step 1] WARNING: fix_my_app returned NO data. Full response:\\n${text}`);\n }\n return `d3k Performance Analysis for ${devUrl}\\n\\n${logAnalysis}`;\n } catch (error) {\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === \"AbortError\") {\n console.log(\"[Step 1] fix_my_app timed out after 3 minutes, using fallback method\");\n // Fall through to fallback method below\n } else {\n console.log(`[Step 1] fix_my_app error: ${error instanceof Error ? error.message : String(error)}`);\n // Fall through to fallback method below\n }\n }\n }\n // Fallback: Use AI Gateway with browser automation prompting\n console.log(\"[Step 1] Using AI Gateway with browser automation...\");\n const gateway = createGateway({\n apiKey: process.env.AI_GATEWAY_API_KEY,\n baseURL: \"https://ai-gateway.vercel.sh/v1/ai\"\n });\n const model = gateway(\"anthropic/claude-sonnet-4-20250514\");\n const prompt = `You are a web application debugger with access to browser automation tools via Playwright MCP.\n\nYour task is to visit this URL and capture any errors, warnings, or issues:\n${urlWithBypass}\n\nSteps to follow:\n1. Use browser_eval with action=\"start\" to start the browser\n2. Use browser_eval with action=\"navigate\" and params={url: \"${urlWithBypass}\"} to navigate to the page\n3. Wait a few seconds for the page to fully load and JavaScript to execute\n4. Use browser_eval with action=\"console_messages\" to get all browser console output (errors, warnings, logs)\n5. Use browser_eval with action=\"screenshot\" to capture a screenshot\n6. Use browser_eval with action=\"close\" to close the browser\n\nAnalyze the console messages and provide a detailed report including:\n- All console errors (with full stack traces if available)\n- All console warnings\n- HTTP status codes or network errors\n- Any visual issues you can identify from the screenshot\n- Screenshot URL if captured\n\nFormat your response as a clear, structured report that helps identify what's broken in the application.`;\n const { text } = await generateText({\n model,\n prompt,\n toolChoice: \"auto\",\n // @ts-expect-error - AI SDK types for maxTokens are incomplete\n maxTokens: 4000\n });\n console.log(`[Step 1] Browser automation response (first 500 chars): ${text.substring(0, 500)}...`);\n return `Browser Automation Analysis for ${devUrl}\\n\\n${text}`;\n } catch (error) {\n console.error(\"[Step 1] Error with browser automation:\", error);\n // Fallback to simple fetch if browser automation fails\n console.log(\"[Step 1] Falling back to simple HTTP fetch...\");\n try {\n const urlWithBypass = bypassToken ? `${devUrl}?x-vercel-protection-bypass=${bypassToken}` : devUrl;\n const headers = {\n \"User-Agent\": \"dev3000-cloud-fix/1.0\",\n Accept: \"text/html,application/json,*/*\"\n };\n if (bypassToken) {\n headers[\"x-vercel-protection-bypass\"] = bypassToken;\n }\n const response = await fetch(urlWithBypass, {\n method: \"GET\",\n headers\n });\n const body = await response.text();\n let logAnalysis = `Dev Server URL: ${devUrl}\\n`;\n logAnalysis += `HTTP Status: ${response.status} ${response.statusText}\\n\\n`;\n logAnalysis += `Note: Browser automation failed, using fallback HTTP fetch.\\n\\n`;\n if (!response.ok) {\n logAnalysis += `ERROR: HTTP ${response.status} ${response.statusText}\\n\\n`;\n }\n if (body.includes(\"ReferenceError\") || body.includes(\"Error\") || body.includes(\"error\")) {\n logAnalysis += `Response body contains error information:\\n${body.substring(0, 5000)}\\n\\n`;\n } else if (!response.ok) {\n logAnalysis += `Response body:\\n${body.substring(0, 2000)}\\n\\n`;\n } else {\n logAnalysis += \"No errors detected in response.\\n\";\n }\n return logAnalysis;\n } catch (fallbackError) {\n const errorMessage = fallbackError instanceof Error ? fallbackError.message : String(fallbackError);\n return `Failed to fetch logs from ${devUrl}\\n\\nError: ${errorMessage}\\n\\nThis may indicate the dev server is not accessible or has crashed.`;\n }\n }\n}\n/**\n * Step 2: Invoke AI agent to analyze logs and propose fixes\n * Uses AI SDK with AI Gateway for multi-model support\n */ export async function analyzeLogsWithAgent(logAnalysis, devUrl) {\n console.log(\"[Step 2] Invoking AI agent to analyze logs...\");\n // Create AI Gateway instance\n const gateway = createGateway({\n apiKey: process.env.AI_GATEWAY_API_KEY,\n baseURL: \"https://ai-gateway.vercel.sh/v1/ai\"\n });\n // Use Claude Sonnet 4 via AI Gateway\n const model = gateway(\"anthropic/claude-sonnet-4-20250514\");\n const prompt = `You are a skilled software engineer debugging an application.\n\nThe dev server is running at: ${devUrl}\n\nHere's the log analysis from the MCP fix_my_app tool:\n${logAnalysis}\n\nYour task:\n1. Identify the most critical error or issue from the logs\n2. Determine the root cause\n3. Propose a specific code fix with file paths and changes\n4. Create a git-style unified diff that can be applied with 'git apply'\n5. Explain why this fix will resolve the issue\n\nFormat your response EXACTLY as follows:\n\n## Issue\n[Brief description of the issue]\n\n## Root Cause\n[Explanation of what's causing the issue]\n\n## Proposed Fix\n[High-level explanation of the fix]\n\n## Git Patch\n\\`\\`\\`diff\n[Full unified diff format that can be applied with 'git apply' or 'patch']\n[Include file paths, line numbers, and exact changes]\n[Example format:]\n[diff --git a/path/to/file.ts b/path/to/file.ts]\n[index abc123..def456 100644]\n[--- a/path/to/file.ts]\n[+++ b/path/to/file.ts]\n[@@ -10,7 +10,7 @@ function example() {]\n[ unchanged line]\n[- old line to remove]\n[+ new line to add]\n[ unchanged line]\n\\`\\`\\`\n\n## Reasoning\n[Why this fix will work]\n\nIMPORTANT:\n- The Git Patch section must be a valid unified diff that can be applied directly with 'git apply'.\n- If no errors are found, respond with \"✅ **SYSTEM HEALTHY** - No errors found\" and do NOT include a Git Patch section.\n- Only include a Git Patch if there are actual issues that need fixing.`;\n const { text } = await generateText({\n model,\n prompt\n });\n console.log(`[Step 2] AI agent response (first 500 chars): ${text.substring(0, 500)}...`);\n return text;\n}\n/**\n * Step 3: Upload fix proposal to blob storage and return URL\n */ export async function uploadToBlob(fixProposal, projectName, logAnalysis, devUrl) {\n console.log(\"[Step 3] Uploading fix proposal to blob storage...\");\n // Create enhanced markdown with full context and attribution\n const timestamp = new Date().toISOString();\n const enhancedMarkdown = `# Fix Proposal for ${projectName}\n\n**Generated**: ${timestamp}\n**Powered by**: [dev3000](https://github.com/vercel-labs/dev3000) with Claude Code\n**Dev Server**: ${devUrl}\n\n---\n\n## Original Log Analysis\n\n\\`\\`\\`\n${logAnalysis}\n\\`\\`\\`\n\n---\n\n${fixProposal}\n\n---\n\n## Attribution\n\nThis fix proposal was automatically generated by [dev3000](https://github.com/vercel-labs/dev3000),\nan AI-powered debugging tool that analyzes your application logs and suggests fixes.\n\n**Co-Authored-By**: Claude (dev3000) <noreply@anthropic.com>\n\n### About dev3000\n\ndev3000 monitors your development server, captures errors in real-time, and uses AI to:\n- Analyze error logs and stack traces\n- Identify root causes\n- Generate actionable fix proposals with git patches\n- Suggest specific code changes\n\nLearn more at https://github.com/vercel-labs/dev3000\n`;\n // Upload to Vercel Blob Storage\n const filenameTimestamp = timestamp.replace(/[:.]/g, \"-\");\n const filename = `fix-${projectName}-${filenameTimestamp}.md`;\n const blob = await put(filename, enhancedMarkdown, {\n access: \"public\",\n contentType: \"text/markdown\"\n });\n console.log(`[Step 3] Fix proposal uploaded to: ${blob.url}`);\n return {\n success: true,\n projectName,\n fixProposal,\n blobUrl: blob.url,\n message: \"Fix analysis completed and uploaded to blob storage\"\n };\n}\n/**\n * Step 4: Create GitHub PR with the fix\n * Uses GitHub API to create a branch, commit the patch, and open a PR\n */ export async function createGitHubPR(fixProposal, blobUrl, repoOwner, repoName, baseBranch, projectName) {\n console.log(`[Step 4] Creating GitHub PR for ${repoOwner}/${repoName}...`);\n const githubToken = process.env.GITHUB_TOKEN;\n if (!githubToken) {\n console.error(\"[Step 4] GITHUB_TOKEN not found in environment\");\n return {\n success: false,\n error: \"GitHub token not configured\"\n };\n }\n try {\n // Extract the git patch from the fix proposal\n const patchMatch = fixProposal.match(/```diff\\n([\\s\\S]*?)\\n```/);\n if (!patchMatch) {\n console.error(\"[Step 4] No git patch found in fix proposal\");\n return {\n success: false,\n error: \"No git patch found in fix proposal\"\n };\n }\n const patch = patchMatch[1];\n console.log(`[Step 4] Extracted patch (${patch.length} chars)`);\n // Parse the patch to extract file changes\n const fileChanges = parsePatchToFileChanges(patch);\n if (fileChanges.length === 0) {\n console.error(\"[Step 4] Failed to parse any file changes from patch\");\n return {\n success: false,\n error: \"Failed to parse file changes from patch\"\n };\n }\n console.log(`[Step 4] Parsed ${fileChanges.length} file change(s)`);\n // Create a unique branch name\n const branchName = `dev3000-fix-${projectName}-${Date.now()}`;\n console.log(`[Step 4] Branch name: ${branchName}`);\n // Get the base branch SHA\n const baseRef = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/git/ref/heads/${baseBranch}`, {\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\"\n }\n });\n if (!baseRef.ok) {\n const error = await baseRef.text();\n console.error(`[Step 4] Failed to get base branch: ${error}`);\n return {\n success: false,\n error: `Failed to get base branch: ${baseRef.status}`\n };\n }\n const baseData = await baseRef.json();\n const baseSha = baseData.object.sha;\n console.log(`[Step 4] Base SHA: ${baseSha}`);\n // Create new branch\n const createBranch = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/git/refs`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n ref: `refs/heads/${branchName}`,\n sha: baseSha\n })\n });\n if (!createBranch.ok) {\n const error = await createBranch.text();\n console.error(`[Step 4] Failed to create branch: ${error}`);\n return {\n success: false,\n error: `Failed to create branch: ${createBranch.status}`\n };\n }\n console.log(`[Step 4] Created branch: ${branchName}`);\n // For each file, fetch current content, apply changes, and commit\n for (const fileChange of fileChanges){\n console.log(`[Step 4] Processing file: ${fileChange.path}`);\n // Get current file content\n const fileResp = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/contents/${fileChange.path}?ref=${branchName}`, {\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\"\n }\n });\n let currentContent = \"\";\n let currentSha = \"\";\n if (fileResp.ok) {\n const fileData = await fileResp.json();\n currentSha = fileData.sha;\n currentContent = Buffer.from(fileData.content, \"base64\").toString(\"utf-8\");\n } else {\n console.log(`[Step 4] File doesn't exist, will create new file`);\n }\n // Apply the patch changes to the content\n const newContent = applyPatchChanges(currentContent, fileChange.changes);\n // Update file\n const updateFile = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/contents/${fileChange.path}`, {\n method: \"PUT\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n message: `Fix: Apply dev3000 fix for ${projectName}`,\n content: Buffer.from(newContent).toString(\"base64\"),\n branch: branchName,\n ...currentSha && {\n sha: currentSha\n }\n })\n });\n if (!updateFile.ok) {\n const error = await updateFile.text();\n console.error(`[Step 4] Failed to update file ${fileChange.path}: ${error}`);\n return {\n success: false,\n error: `Failed to update file ${fileChange.path}: ${updateFile.status}`\n };\n }\n console.log(`[Step 4] Updated file: ${fileChange.path}`);\n }\n // Create PR\n const prBody = `## Automated Fix Proposal\n\nThis PR was automatically generated by [dev3000](https://github.com/vercel-labs/dev3000) after analyzing your application.\n\n### Fix Details\nView the full analysis: [${blobUrl}](${blobUrl})\n\n${fixProposal}\n\n---\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude (dev3000) <noreply@anthropic.com>`;\n const createPR = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/pulls`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n title: `Fix: ${projectName} - Automated fix from dev3000`,\n head: branchName,\n base: baseBranch,\n body: prBody\n })\n });\n if (!createPR.ok) {\n const error = await createPR.text();\n console.error(`[Step 4] Failed to create PR: ${error}`);\n return {\n success: false,\n error: `Failed to create PR: ${createPR.status}`\n };\n }\n const prData = await createPR.json();\n console.log(`[Step 4] Created PR: ${prData.html_url}`);\n return {\n success: true,\n prUrl: prData.html_url,\n prNumber: prData.number,\n branch: branchName\n };\n } catch (error) {\n console.error(\"[Step 4] Error creating PR:\", error);\n return {\n success: false,\n error: error instanceof Error ? error.message : String(error)\n };\n }\n}\n/**\n * Cleanup step: Stop the sandbox\n */ export async function cleanupSandbox(cleanup) {\n console.log(\"[Cleanup] Stopping sandbox...\");\n try {\n await cleanup();\n console.log(\"[Cleanup] Sandbox stopped successfully\");\n } catch (error) {\n console.error(\"[Cleanup] Error stopping sandbox:\", error);\n // Don't throw - cleanup errors shouldn't fail the workflow\n }\n}\n"],"names":[],"mappings":"sCAMW,eAAe,EAAiB,CAAO,CAAE,CAAM,CAAE,CAAW,CAAE,CAAW,CAAE,CAAe,EACjG,QAAQ,GAAG,CAAC,CAAC,kCAAkC,EAAE,EAAY,GAAG,CAAC,EACjE,QAAQ,GAAG,CAAC,CAAC,qBAAqB,EAAE,EAAA,CAAS,EAC7C,QAAQ,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAA,CAAQ,EAExC,QAAQ,GAAG,CAAC,CAAC,qCAAqC,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,iBAAiB,CAAA,CAAE,EACrF,QAAQ,GAAG,CAAC,CAAC,4CAA4C,EAAE,CAAC,CAAC,EAAA,CAAiB,EAC9E,QAAQ,GAAG,CAAC,CAAC,iCAAiC,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,YAAY,CAAA,CAAE,EAC5E,QAAQ,GAAG,CAAC,CAAC,qCAAqC,EAAE,CAAC,CAAC,EAAA,CAAa,EAG/D,GAAmB,CAAC,QAAQ,GAAG,CAAC,iBAAiB,EAAE,CACnD,QAAQ,GAAG,CAAC,iBAAiB,CAAG,EAChC,QAAQ,GAAG,CAAC,CAAC,oDAAoD,CAAC,GAEtE,IAAM,EAAgB,MAAM,qBAAqB,SAC7C,EACA,SACA,WAAY,GACZ,eAAgB,OAChB,OAAO,CACX,GACA,QAAQ,GAAG,CAAC,CAAC,qCAAqC,CAAC,EACnD,QAAQ,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAc,MAAM,CAAA,CAAE,EACvD,QAAQ,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAc,MAAM,CAAA,CAAE,EAGvD,QAAQ,GAAG,CAAC,CAAC,qDAAqD,CAAC,EACnE,IAAI,EAAU,KACV,EAAW,KAC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M,EAAS,IAAI,GAEjC,OADA,QAAQ,KAAK,CAAC,CAAC,8BAA8B,EAAE,EAAA,CAAO,EAC/C,CACH,SAAS,EACT,MAAO,CAAC,qBAAqB,EAAE,EAAS,MAAM,CAAA,CAAE,AACpD,CACJ,CACA,IAAM,EAAS,MAAM,EAAS,IAAI,GAElC,OADA,QAAQ,GAAG,CAAC,CAAC,qBAAqB,EAAE,EAAO,QAAQ,CAAA,CAAE,EAC9C,CACH,SAAS,EACT,MAAO,EAAO,QAAQ,CACtB,SAAU,EAAO,MAAM,CACvB,OAAQ,CACZ,CACJ,CAAE,MAAO,EAAO,CAEZ,OADA,QAAQ,KAAK,CAAC,8BAA+B,GACtC,CACH,SAAS,EACT,MAAO,aAAiB,MAAQ,EAAM,OAAO,CAAG,OAAO,EAC3D,CACJ,CACJ,CAGW,eAAe,EAAe,CAAO,EAC5C,QAAQ,GAAG,CAAC,iCACZ,GAAI,CACA,MAAM,IACN,QAAQ,GAAG,CAAC,yCAChB,CAAE,MAAO,EAAO,CACZ,QAAQ,KAAK,CAAC,oCAAqC,EAEvD,CACJ"}
1
+ {"version":3,"sources":["../../../../mcp-server/app/api/cloud/fix-workflow/steps.ts"],"sourcesContent":["/**\n * Step functions for fix-workflow\n * Separated into their own module to avoid workflow bundler issues\n */ /**__internal_workflows{\"steps\":{\"app/api/cloud/fix-workflow/steps.ts\":{\"analyzeLogsWithAgent\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//analyzeLogsWithAgent\"},\"cleanupSandbox\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//cleanupSandbox\"},\"createD3kSandbox\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//createD3kSandbox\"},\"createGitHubPR\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//createGitHubPR\"},\"fetchRealLogs\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//fetchRealLogs\"},\"uploadToBlob\":{\"stepId\":\"step//app/api/cloud/fix-workflow/steps.ts//uploadToBlob\"}}}}*/;\n/**\n * Step 0: Create d3k sandbox with MCP tools pre-configured\n */ export async function createD3kSandbox(repoUrl, branch, projectName, vercelToken, vercelOidcToken) {\n console.log(`[Step 0] Creating d3k sandbox for ${projectName}...`);\n console.log(`[Step 0] Repository: ${repoUrl}`);\n console.log(`[Step 0] Branch: ${branch}`);\n // Log available token types\n console.log(`[Step 0] VERCEL_OIDC_TOKEN from env: ${!!process.env.VERCEL_OIDC_TOKEN}`);\n console.log(`[Step 0] VERCEL_OIDC_TOKEN passed as param: ${!!vercelOidcToken}`);\n console.log(`[Step 0] VERCEL_TOKEN available: ${!!process.env.VERCEL_TOKEN}`);\n console.log(`[Step 0] User access token provided: ${!!vercelToken}`);\n // Set VERCEL_OIDC_TOKEN if passed from workflow context\n // This is necessary because workflow steps don't automatically inherit environment variables\n if (vercelOidcToken && !process.env.VERCEL_OIDC_TOKEN) {\n process.env.VERCEL_OIDC_TOKEN = vercelOidcToken;\n console.log(`[Step 0] Set VERCEL_OIDC_TOKEN from workflow context`);\n }\n const sandboxResult = await createD3kSandboxUtil({\n repoUrl,\n branch,\n projectDir: \"\",\n packageManager: \"pnpm\",\n debug: true\n });\n console.log(`[Step 0] Sandbox created successfully`);\n console.log(`[Step 0] Dev URL: ${sandboxResult.devUrl}`);\n console.log(`[Step 0] MCP URL: ${sandboxResult.mcpUrl}`);\n // Now capture CLS and errors using MCP from INSIDE the sandbox\n // We must do this in Step 0 while we have the sandbox object\n console.log(`[Step 0] Capturing CLS metrics from inside sandbox...`);\n let clsData = null;\n let mcpError = null;\n // Helper function to properly consume sandbox command output\n // The Vercel Sandbox SDK returns a result object with an async logs() iterator\n async function runSandboxCommand(sandbox, cmd, args) {\n const result = await sandbox.runCommand({\n cmd,\n args\n });\n let stdout = \"\";\n let stderr = \"\";\n for await (const log of result.logs()){\n if (log.stream === \"stdout\") {\n stdout += log.data;\n } else {\n stderr += log.data;\n }\n }\n await result.wait();\n return {\n exitCode: result.exitCode,\n stdout,\n stderr\n };\n }\n try {\n // Call fix_my_app MCP tool via curl from inside the sandbox\n // This avoids network isolation issues - we're calling localhost:3684 from within the sandbox\n const mcpCommand = `curl -s -X POST http://localhost:3684/mcp -H \"Content-Type: application/json\" -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"fix_my_app\",\"arguments\":{\"mode\":\"snapshot\",\"focusArea\":\"performance\",\"returnRawData\":true}}}'`;\n console.log(`[Step 0] Executing MCP command inside sandbox...`);\n console.log(`[Step 0] MCP command: ${mcpCommand.substring(0, 200)}...`);\n let stdout = \"\";\n let stderr = \"\";\n let exitCode = -1;\n try {\n const result = await runSandboxCommand(sandboxResult.sandbox, \"bash\", [\n \"-c\",\n mcpCommand\n ]);\n stdout = result.stdout;\n stderr = result.stderr;\n exitCode = result.exitCode;\n console.log(`[Step 0] MCP command exit code: ${exitCode}`);\n console.log(`[Step 0] MCP stdout length: ${stdout.length} bytes`);\n if (stderr) {\n console.log(`[Step 0] MCP stderr: ${stderr.substring(0, 500)}`);\n }\n } catch (runCommandError) {\n const errorMsg = runCommandError instanceof Error ? runCommandError.message : String(runCommandError);\n console.log(`[Step 0] sandbox.runCommand threw: ${errorMsg}`);\n mcpError = `sandbox.runCommand failed: ${errorMsg}`;\n }\n if (exitCode === 0 && stdout) {\n try {\n const mcpResponse = JSON.parse(stdout);\n if (mcpResponse.result?.content) {\n // Extract the actual data from MCP response\n const contentArray = mcpResponse.result.content;\n for (const item of contentArray){\n if (item.type === \"text\" && item.text) {\n // Try to parse the text as JSON if it contains structured data\n try {\n clsData = JSON.parse(item.text);\n console.log(`[Step 0] Successfully parsed CLS data`);\n break;\n } catch {\n // If not JSON, treat as plain text\n clsData = {\n rawOutput: item.text\n };\n }\n }\n }\n }\n console.log(`[Step 0] CLS data captured:`, JSON.stringify(clsData).substring(0, 500));\n } catch (parseError) {\n mcpError = `Failed to parse MCP response: ${parseError instanceof Error ? parseError.message : String(parseError)}`;\n console.log(`[Step 0] ${mcpError}`);\n console.log(`[Step 0] Raw stdout: ${stdout.substring(0, 1000)}`);\n }\n } else if (exitCode !== 0 && !mcpError) {\n mcpError = `MCP command failed with exit code ${exitCode}`;\n console.log(`[Step 0] ${mcpError}`);\n if (stderr) {\n console.log(`[Step 0] stderr: ${stderr}`);\n }\n }\n } catch (error) {\n mcpError = `MCP execution error: ${error instanceof Error ? error.message : String(error)}`;\n console.log(`[Step 0] ${mcpError}`);\n }\n // Dump all sandbox logs before returning for debugging\n console.log(`[Step 0] === Dumping sandbox logs before returning ===`);\n try {\n const logsResult = await runSandboxCommand(sandboxResult.sandbox, \"sh\", [\n \"-c\",\n 'for log in /home/vercel-sandbox/.d3k/logs/*.log; do [ -f \"$log\" ] && echo \"=== $log ===\" && tail -100 \"$log\" || true; done 2>/dev/null || echo \"No log files found\"'\n ]);\n console.log(logsResult.stdout);\n } catch (logsError) {\n console.log(`[Step 0] Failed to dump logs: ${logsError instanceof Error ? logsError.message : String(logsError)}`);\n }\n console.log(`[Step 0] === End sandbox log dump ===`);\n // Note: We cannot return the cleanup function or sandbox object as they're not serializable\n // Sandbox cleanup will happen automatically when the sandbox times out\n return {\n mcpUrl: sandboxResult.mcpUrl,\n devUrl: sandboxResult.devUrl,\n bypassToken: sandboxResult.bypassToken,\n clsData,\n mcpError\n };\n}\n/**\n * Step 1: Use browser automation to capture real errors\n * Uses d3k MCP server in sandbox (if available) or AI Gateway for browser automation\n */ export async function fetchRealLogs(mcpUrlOrDevUrl, bypassToken, sandboxDevUrl, clsData, mcpError) {\n // If we already have CLS data from Step 0, use it\n if (clsData) {\n console.log(\"[Step 1] Using CLS data captured in Step 0\");\n return {\n logAnalysis: JSON.stringify(clsData, null, 2),\n beforeScreenshotUrl: null\n };\n }\n // If there was an MCP error in Step 0, log it\n if (mcpError) {\n console.log(`[Step 1] Note: MCP error from Step 0: ${mcpError}`);\n }\n // Determine if we're using sandbox MCP or direct dev URL\n const isSandbox = !!sandboxDevUrl;\n const devUrl = sandboxDevUrl || mcpUrlOrDevUrl;\n const mcpUrl = isSandbox ? mcpUrlOrDevUrl : null;\n console.log(`[Step 1] Fetching logs from: ${devUrl}`);\n console.log(`[Step 1] Using sandbox: ${isSandbox ? \"yes\" : \"no\"}`);\n if (mcpUrl) {\n console.log(`[Step 1] MCP URL: ${mcpUrl}`);\n }\n console.log(`[Step 1] Bypass token: ${bypassToken ? \"provided\" : \"not provided\"}`);\n try {\n // Construct URL with bypass token if provided\n const urlWithBypass = bypassToken ? `${devUrl}?x-vercel-protection-bypass=${bypassToken}` : devUrl;\n console.log(`[Step 1] Final URL: ${urlWithBypass.replace(bypassToken || \"\", \"***\")}`);\n if (isSandbox && mcpUrl) {\n // Use d3k MCP server in sandbox - capture CLS metrics and errors\n console.log(\"[Step 1] Using d3k MCP server to capture CLS metrics and errors...\");\n // First, validate MCP server access and list available tools\n // Use a 30-second timeout to avoid hanging the entire workflow\n console.log(\"[Step 1] Validating d3k MCP server access...\");\n const validationController = new AbortController();\n const validationTimeout = setTimeout(()=>validationController.abort(), 30000);\n try {\n const toolsResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 0,\n method: \"tools/list\"\n }),\n signal: validationController.signal\n });\n clearTimeout(validationTimeout);\n if (toolsResponse.ok) {\n const toolsText = await toolsResponse.text();\n try {\n // Parse SSE response format: \"event: message\\ndata: {...}\\n\\n\"\n let toolsData = null;\n const lines = toolsText.split(\"\\n\");\n for (const line of lines){\n if (line.startsWith(\"data: \")) {\n try {\n toolsData = JSON.parse(line.substring(6));\n break;\n } catch {\n // Continue to next line\n }\n }\n }\n // Fallback: try parsing the whole response as JSON (non-SSE format)\n if (!toolsData) {\n toolsData = JSON.parse(toolsText);\n }\n const toolNames = toolsData.result?.tools?.map((t)=>t.name) || [];\n console.log(`[Step 1] ✅ d3k MCP server accessible`);\n console.log(`[Step 1] Available tools (${toolNames.length}): ${toolNames.join(\", \")}`);\n // Check for expected chrome-devtools and nextjs-dev tools\n const hasChrome = toolNames.some((name)=>name.includes(\"chrome-devtools\"));\n const hasNextjs = toolNames.some((name)=>name.includes(\"nextjs\"));\n const hasFixMyApp = toolNames.includes(\"fix_my_app\");\n console.log(`[Step 1] Chrome DevTools MCP: ${hasChrome ? \"✅\" : \"❌\"}`);\n console.log(`[Step 1] Next.js DevTools MCP: ${hasNextjs ? \"✅\" : \"❌\"}`);\n console.log(`[Step 1] fix_my_app tool: ${hasFixMyApp ? \"✅\" : \"❌\"}`);\n } catch {\n console.log(`[Step 1] MCP server responded but couldn't parse tools list: ${toolsText.substring(0, 200)}`);\n }\n } else {\n console.log(`[Step 1] ⚠️ MCP server not accessible: ${toolsResponse.status}`);\n }\n } catch (error) {\n clearTimeout(validationTimeout);\n const errorMsg = error instanceof Error ? error.message : String(error);\n const isTimeout = error instanceof Error && error.name === \"AbortError\";\n console.log(`[Step 1] ⚠️ Failed to validate MCP server: ${isTimeout ? \"Timed out after 30s\" : errorMsg}`);\n }\n // Navigate to the app to generate logs (with 30s timeout)\n console.log(\"[Step 1] Navigating browser to app URL...\");\n const navController = new AbortController();\n const navTimeout = setTimeout(()=>navController.abort(), 30000);\n try {\n const navResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 0,\n method: \"tools/call\",\n params: {\n name: \"execute_browser_action\",\n arguments: {\n action: \"navigate\",\n params: {\n url: urlWithBypass\n }\n }\n }\n }),\n signal: navController.signal\n });\n clearTimeout(navTimeout);\n if (navResponse.ok) {\n console.log(\"[Step 1] Browser navigation completed\");\n } else {\n console.log(`[Step 1] Browser navigation failed: ${navResponse.status}`);\n }\n } catch (navError) {\n clearTimeout(navTimeout);\n const isTimeout = navError instanceof Error && navError.name === \"AbortError\";\n console.log(`[Step 1] Browser navigation error: ${isTimeout ? \"Timed out after 30s\" : navError instanceof Error ? navError.message : String(navError)}`);\n }\n // Wait for page to fully load\n console.log(\"[Step 1] Waiting 5s for page load...\");\n await new Promise((resolve)=>setTimeout(resolve, 5000));\n // Capture \"before\" screenshot to prove the page loaded and for later comparison\n let beforeScreenshotUrl = null;\n console.log(\"[Step 1] Capturing 'before' screenshot...\");\n const screenshotController = new AbortController();\n const screenshotTimeout = setTimeout(()=>screenshotController.abort(), 30000);\n try {\n const screenshotResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 0,\n method: \"tools/call\",\n params: {\n name: \"chrome-devtools_take_snapshot\",\n arguments: {}\n }\n }),\n signal: screenshotController.signal\n });\n clearTimeout(screenshotTimeout);\n if (screenshotResponse.ok) {\n const screenshotText = await screenshotResponse.text();\n // Parse SSE response to get screenshot data\n const lines = screenshotText.split(\"\\n\");\n for (const line of lines){\n if (line.startsWith(\"data: \")) {\n try {\n const json = JSON.parse(line.substring(6));\n if (json.result?.content) {\n for (const content of json.result.content){\n if (content.type === \"image\" && content.data) {\n // Upload base64 image to Vercel Blob\n const imageBuffer = Buffer.from(content.data, \"base64\");\n const timestamp = new Date().toISOString().replace(/[:.]/g, \"-\");\n const filename = `screenshot-before-${timestamp}.png`;\n const blob = await put(filename, imageBuffer, {\n access: \"public\",\n contentType: \"image/png\"\n });\n beforeScreenshotUrl = blob.url;\n console.log(`[Step 1] ✅ Before screenshot uploaded: ${beforeScreenshotUrl}`);\n }\n }\n }\n } catch {\n // Continue parsing other lines\n }\n }\n }\n if (!beforeScreenshotUrl) {\n console.log(`[Step 1] Screenshot response received but no image data found`);\n console.log(`[Step 1] Response preview: ${screenshotText.substring(0, 500)}`);\n }\n } else {\n console.log(`[Step 1] Screenshot request failed: ${screenshotResponse.status}`);\n }\n } catch (error) {\n clearTimeout(screenshotTimeout);\n const isTimeout = error instanceof Error && error.name === \"AbortError\";\n console.log(`[Step 1] Screenshot capture error: ${isTimeout ? \"Timed out after 30s\" : error instanceof Error ? error.message : String(error)}`);\n }\n // Check d3k logs to see if it's capturing data (with 15s timeout)\n console.log(\"[Step 1] Fetching d3k logs from sandbox to verify it's working...\");\n const logsController = new AbortController();\n const logsTimeout = setTimeout(()=>logsController.abort(), 15000);\n try {\n const logsResponse = await fetch(`${mcpUrl}/api/logs`, {\n signal: logsController.signal\n });\n clearTimeout(logsTimeout);\n if (logsResponse.ok) {\n const logsText = await logsResponse.text();\n console.log(`[Step 1] d3k logs (last 1000 chars):\\n${logsText.slice(-1000)}`);\n } else {\n console.log(`[Step 1] Could not fetch d3k logs: ${logsResponse.status}`);\n }\n } catch (error) {\n clearTimeout(logsTimeout);\n const isTimeout = error instanceof Error && error.name === \"AbortError\";\n console.log(`[Step 1] Failed to fetch d3k logs: ${isTimeout ? \"Timed out after 15s\" : error instanceof Error ? error.message : String(error)}`);\n }\n // Call fix_my_app with focusArea='performance' to capture CLS and jank\n console.log(\"[Step 1] Calling fix_my_app with focusArea='performance'...\");\n // Set a 3-minute timeout for the MCP call\n const controller = new AbortController();\n const timeoutId = setTimeout(()=>controller.abort(), 3 * 60 * 1000);\n try {\n const mcpResponse = await fetch(`${mcpUrl}/mcp`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n Accept: \"application/json, text/event-stream\"\n },\n body: JSON.stringify({\n jsonrpc: \"2.0\",\n id: 1,\n method: \"tools/call\",\n params: {\n name: \"fix_my_app\",\n arguments: {\n mode: \"snapshot\",\n focusArea: \"performance\",\n timeRangeMinutes: 5,\n returnRawData: false\n }\n }\n }),\n signal: controller.signal\n });\n clearTimeout(timeoutId);\n if (!mcpResponse.ok) {\n throw new Error(`MCP request failed: ${mcpResponse.status}`);\n }\n // Parse SSE response\n const text = await mcpResponse.text();\n console.log(`[Step 1] fix_my_app response length: ${text.length} bytes`);\n console.log(`[Step 1] fix_my_app response preview (first 500 chars):\\n${text.substring(0, 500)}`);\n const lines = text.split(\"\\n\");\n console.log(`[Step 1] Response split into ${lines.length} lines`);\n let logAnalysis = \"\";\n let linesProcessed = 0;\n let contentBlocks = 0;\n for (const line of lines){\n if (line.startsWith(\"data: \")) {\n linesProcessed++;\n try {\n const json = JSON.parse(line.substring(6));\n console.log(`[Step 1] Parsed JSON line ${linesProcessed}:`, JSON.stringify(json).substring(0, 200));\n if (json.result?.content) {\n for (const content of json.result.content){\n if (content.type === \"text\") {\n contentBlocks++;\n logAnalysis += content.text;\n console.log(`[Step 1] Added text content block ${contentBlocks}, length: ${content.text.length}`);\n }\n }\n } else if (json.error) {\n console.log(`[Step 1] ERROR in response: ${JSON.stringify(json.error)}`);\n }\n } catch (error) {\n console.log(`[Step 1] Failed to parse JSON line ${linesProcessed}: ${error instanceof Error ? error.message : String(error)}`);\n console.log(`[Step 1] Problem line: ${line.substring(0, 200)}`);\n }\n }\n }\n console.log(`[Step 1] Processed ${linesProcessed} data lines, ${contentBlocks} content blocks`);\n console.log(`[Step 1] Got ${logAnalysis.length} chars from fix_my_app (performance analysis)`);\n if (logAnalysis.length === 0) {\n console.log(`[Step 1] WARNING: fix_my_app returned NO data. Full response:\\n${text}`);\n }\n return {\n logAnalysis: `d3k Performance Analysis for ${devUrl}\\n\\n${logAnalysis}`,\n beforeScreenshotUrl\n };\n } catch (error) {\n clearTimeout(timeoutId);\n if (error instanceof Error && error.name === \"AbortError\") {\n console.log(\"[Step 1] fix_my_app timed out after 3 minutes, using fallback method\");\n // Fall through to fallback method below\n } else {\n console.log(`[Step 1] fix_my_app error: ${error instanceof Error ? error.message : String(error)}`);\n // Fall through to fallback method below\n }\n }\n }\n // Fallback: Use AI Gateway with browser automation prompting\n console.log(\"[Step 1] Using AI Gateway with browser automation...\");\n const gateway = createGateway({\n apiKey: process.env.AI_GATEWAY_API_KEY,\n baseURL: \"https://ai-gateway.vercel.sh/v1/ai\"\n });\n const model = gateway(\"anthropic/claude-sonnet-4-20250514\");\n const prompt = `You are a web application debugger with access to browser automation tools via Playwright MCP.\n\nYour task is to visit this URL and capture any errors, warnings, or issues:\n${urlWithBypass}\n\nSteps to follow:\n1. Use browser_eval with action=\"start\" to start the browser\n2. Use browser_eval with action=\"navigate\" and params={url: \"${urlWithBypass}\"} to navigate to the page\n3. Wait a few seconds for the page to fully load and JavaScript to execute\n4. Use browser_eval with action=\"console_messages\" to get all browser console output (errors, warnings, logs)\n5. Use browser_eval with action=\"screenshot\" to capture a screenshot\n6. Use browser_eval with action=\"close\" to close the browser\n\nAnalyze the console messages and provide a detailed report including:\n- All console errors (with full stack traces if available)\n- All console warnings\n- HTTP status codes or network errors\n- Any visual issues you can identify from the screenshot\n- Screenshot URL if captured\n\nFormat your response as a clear, structured report that helps identify what's broken in the application.`;\n const { text } = await generateText({\n model,\n prompt,\n toolChoice: \"auto\",\n // @ts-expect-error - AI SDK types for maxTokens are incomplete\n maxTokens: 4000\n });\n console.log(`[Step 1] Browser automation response (first 500 chars): ${text.substring(0, 500)}...`);\n return {\n logAnalysis: `Browser Automation Analysis for ${devUrl}\\n\\n${text}`,\n beforeScreenshotUrl: null\n };\n } catch (error) {\n console.error(\"[Step 1] Error with browser automation:\", error);\n // Fallback to simple fetch if browser automation fails\n console.log(\"[Step 1] Falling back to simple HTTP fetch...\");\n try {\n const urlWithBypass = bypassToken ? `${devUrl}?x-vercel-protection-bypass=${bypassToken}` : devUrl;\n const headers = {\n \"User-Agent\": \"dev3000-cloud-fix/1.0\",\n Accept: \"text/html,application/json,*/*\"\n };\n if (bypassToken) {\n headers[\"x-vercel-protection-bypass\"] = bypassToken;\n }\n const response = await fetch(urlWithBypass, {\n method: \"GET\",\n headers\n });\n const body = await response.text();\n let logAnalysis = `Dev Server URL: ${devUrl}\\n`;\n logAnalysis += `HTTP Status: ${response.status} ${response.statusText}\\n\\n`;\n logAnalysis += `Note: Browser automation failed, using fallback HTTP fetch.\\n\\n`;\n if (!response.ok) {\n logAnalysis += `ERROR: HTTP ${response.status} ${response.statusText}\\n\\n`;\n }\n if (body.includes(\"ReferenceError\") || body.includes(\"Error\") || body.includes(\"error\")) {\n logAnalysis += `Response body contains error information:\\n${body.substring(0, 5000)}\\n\\n`;\n } else if (!response.ok) {\n logAnalysis += `Response body:\\n${body.substring(0, 2000)}\\n\\n`;\n } else {\n logAnalysis += \"No errors detected in response.\\n\";\n }\n return {\n logAnalysis,\n beforeScreenshotUrl: null\n };\n } catch (fallbackError) {\n const errorMessage = fallbackError instanceof Error ? fallbackError.message : String(fallbackError);\n return {\n logAnalysis: `Failed to fetch logs from ${devUrl}\\n\\nError: ${errorMessage}\\n\\nThis may indicate the dev server is not accessible or has crashed.`,\n beforeScreenshotUrl: null\n };\n }\n }\n}\n/**\n * Step 2: Invoke AI agent to analyze logs and propose fixes\n * Uses AI SDK with AI Gateway for multi-model support\n */ export async function analyzeLogsWithAgent(logAnalysis, devUrl) {\n console.log(\"[Step 2] Invoking AI agent to analyze logs...\");\n // Create AI Gateway instance\n const gateway = createGateway({\n apiKey: process.env.AI_GATEWAY_API_KEY,\n baseURL: \"https://ai-gateway.vercel.sh/v1/ai\"\n });\n // Use Claude Sonnet 4 via AI Gateway\n const model = gateway(\"anthropic/claude-sonnet-4-20250514\");\n const prompt = `You are a skilled software engineer debugging an application.\n\nThe dev server is running at: ${devUrl}\n\nHere's the log analysis from the MCP fix_my_app tool:\n${logAnalysis}\n\nYour task:\n1. Identify the most critical error or issue from the logs\n2. Determine the root cause\n3. Propose a specific code fix with file paths and changes\n4. Create a git-style unified diff that can be applied with 'git apply'\n5. Explain why this fix will resolve the issue\n\nFormat your response EXACTLY as follows:\n\n## Issue\n[Brief description of the issue]\n\n## Root Cause\n[Explanation of what's causing the issue]\n\n## Proposed Fix\n[High-level explanation of the fix]\n\n## Git Patch\n\\`\\`\\`diff\n[Full unified diff format that can be applied with 'git apply' or 'patch']\n[Include file paths, line numbers, and exact changes]\n[Example format:]\n[diff --git a/path/to/file.ts b/path/to/file.ts]\n[index abc123..def456 100644]\n[--- a/path/to/file.ts]\n[+++ b/path/to/file.ts]\n[@@ -10,7 +10,7 @@ function example() {]\n[ unchanged line]\n[- old line to remove]\n[+ new line to add]\n[ unchanged line]\n\\`\\`\\`\n\n## Reasoning\n[Why this fix will work]\n\nIMPORTANT:\n- The Git Patch section must be a valid unified diff that can be applied directly with 'git apply'.\n- If no errors are found, respond with \"✅ **SYSTEM HEALTHY** - No errors found\" and do NOT include a Git Patch section.\n- Only include a Git Patch if there are actual issues that need fixing.`;\n const { text } = await generateText({\n model,\n prompt\n });\n console.log(`[Step 2] AI agent response (first 500 chars): ${text.substring(0, 500)}...`);\n return text;\n}\n/**\n * Step 3: Upload fix proposal to blob storage and return URL\n */ export async function uploadToBlob(fixProposal, projectName, logAnalysis, devUrl, beforeScreenshotUrl) {\n console.log(\"[Step 3] Uploading fix proposal to blob storage...\");\n if (beforeScreenshotUrl) {\n console.log(`[Step 3] Including before screenshot: ${beforeScreenshotUrl}`);\n }\n // Create screenshot section if we have a screenshot\n const screenshotSection = beforeScreenshotUrl ? `## Before Screenshot\n\nThis screenshot was captured when the sandbox dev server first loaded, proving the page rendered successfully.\n\n![Before Screenshot](${beforeScreenshotUrl})\n\n---\n\n` : \"\";\n // Create enhanced markdown with full context and attribution\n const timestamp = new Date().toISOString();\n const enhancedMarkdown = `# Fix Proposal for ${projectName}\n\n**Generated**: ${timestamp}\n**Powered by**: [dev3000](https://github.com/vercel-labs/dev3000) with Claude Code\n**Dev Server**: ${devUrl}\n\n---\n\n${screenshotSection}## Original Log Analysis\n\n\\`\\`\\`\n${logAnalysis}\n\\`\\`\\`\n\n---\n\n${fixProposal}\n\n---\n\n## Attribution\n\nThis fix proposal was automatically generated by [dev3000](https://github.com/vercel-labs/dev3000),\nan AI-powered debugging tool that analyzes your application logs and suggests fixes.\n\n**Co-Authored-By**: Claude (dev3000) <noreply@anthropic.com>\n\n### About dev3000\n\ndev3000 monitors your development server, captures errors in real-time, and uses AI to:\n- Analyze error logs and stack traces\n- Identify root causes\n- Generate actionable fix proposals with git patches\n- Suggest specific code changes\n\nLearn more at https://github.com/vercel-labs/dev3000\n`;\n // Upload to Vercel Blob Storage\n const filenameTimestamp = timestamp.replace(/[:.]/g, \"-\");\n const filename = `fix-${projectName}-${filenameTimestamp}.md`;\n const blob = await put(filename, enhancedMarkdown, {\n access: \"public\",\n contentType: \"text/markdown\"\n });\n console.log(`[Step 3] Fix proposal uploaded to: ${blob.url}`);\n return {\n success: true,\n projectName,\n fixProposal,\n blobUrl: blob.url,\n beforeScreenshotUrl: beforeScreenshotUrl || null,\n message: \"Fix analysis completed and uploaded to blob storage\"\n };\n}\n/**\n * Step 4: Create GitHub PR with the fix\n * Uses GitHub API to create a branch, commit the patch, and open a PR\n */ export async function createGitHubPR(fixProposal, blobUrl, repoOwner, repoName, baseBranch, projectName) {\n console.log(`[Step 4] Creating GitHub PR for ${repoOwner}/${repoName}...`);\n const githubToken = process.env.GITHUB_TOKEN;\n if (!githubToken) {\n console.error(\"[Step 4] GITHUB_TOKEN not found in environment\");\n return {\n success: false,\n error: \"GitHub token not configured\"\n };\n }\n try {\n // Extract the git patch from the fix proposal\n const patchMatch = fixProposal.match(/```diff\\n([\\s\\S]*?)\\n```/);\n if (!patchMatch) {\n console.error(\"[Step 4] No git patch found in fix proposal\");\n return {\n success: false,\n error: \"No git patch found in fix proposal\"\n };\n }\n const patch = patchMatch[1];\n console.log(`[Step 4] Extracted patch (${patch.length} chars)`);\n // Parse the patch to extract file changes\n const fileChanges = parsePatchToFileChanges(patch);\n if (fileChanges.length === 0) {\n console.error(\"[Step 4] Failed to parse any file changes from patch\");\n return {\n success: false,\n error: \"Failed to parse file changes from patch\"\n };\n }\n console.log(`[Step 4] Parsed ${fileChanges.length} file change(s)`);\n // Create a unique branch name\n const branchName = `dev3000-fix-${projectName}-${Date.now()}`;\n console.log(`[Step 4] Branch name: ${branchName}`);\n // Get the base branch SHA\n const baseRef = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/git/ref/heads/${baseBranch}`, {\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\"\n }\n });\n if (!baseRef.ok) {\n const error = await baseRef.text();\n console.error(`[Step 4] Failed to get base branch: ${error}`);\n return {\n success: false,\n error: `Failed to get base branch: ${baseRef.status}`\n };\n }\n const baseData = await baseRef.json();\n const baseSha = baseData.object.sha;\n console.log(`[Step 4] Base SHA: ${baseSha}`);\n // Create new branch\n const createBranch = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/git/refs`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n ref: `refs/heads/${branchName}`,\n sha: baseSha\n })\n });\n if (!createBranch.ok) {\n const error = await createBranch.text();\n console.error(`[Step 4] Failed to create branch: ${error}`);\n return {\n success: false,\n error: `Failed to create branch: ${createBranch.status}`\n };\n }\n console.log(`[Step 4] Created branch: ${branchName}`);\n // For each file, fetch current content, apply changes, and commit\n for (const fileChange of fileChanges){\n console.log(`[Step 4] Processing file: ${fileChange.path}`);\n // Get current file content\n const fileResp = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/contents/${fileChange.path}?ref=${branchName}`, {\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\"\n }\n });\n let currentContent = \"\";\n let currentSha = \"\";\n if (fileResp.ok) {\n const fileData = await fileResp.json();\n currentSha = fileData.sha;\n currentContent = Buffer.from(fileData.content, \"base64\").toString(\"utf-8\");\n } else {\n console.log(`[Step 4] File doesn't exist, will create new file`);\n }\n // Apply the patch changes to the content\n const newContent = applyPatchChanges(currentContent, fileChange.changes);\n // Update file\n const updateFile = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/contents/${fileChange.path}`, {\n method: \"PUT\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n message: `Fix: Apply dev3000 fix for ${projectName}`,\n content: Buffer.from(newContent).toString(\"base64\"),\n branch: branchName,\n ...currentSha && {\n sha: currentSha\n }\n })\n });\n if (!updateFile.ok) {\n const error = await updateFile.text();\n console.error(`[Step 4] Failed to update file ${fileChange.path}: ${error}`);\n return {\n success: false,\n error: `Failed to update file ${fileChange.path}: ${updateFile.status}`\n };\n }\n console.log(`[Step 4] Updated file: ${fileChange.path}`);\n }\n // Create PR\n const prBody = `## Automated Fix Proposal\n\nThis PR was automatically generated by [dev3000](https://github.com/vercel-labs/dev3000) after analyzing your application.\n\n### Fix Details\nView the full analysis: [${blobUrl}](${blobUrl})\n\n${fixProposal}\n\n---\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nCo-Authored-By: Claude (dev3000) <noreply@anthropic.com>`;\n const createPR = await fetch(`https://api.github.com/repos/${repoOwner}/${repoName}/pulls`, {\n method: \"POST\",\n headers: {\n Authorization: `Bearer ${githubToken}`,\n Accept: \"application/vnd.github.v3+json\",\n \"Content-Type\": \"application/json\"\n },\n body: JSON.stringify({\n title: `Fix: ${projectName} - Automated fix from dev3000`,\n head: branchName,\n base: baseBranch,\n body: prBody\n })\n });\n if (!createPR.ok) {\n const error = await createPR.text();\n console.error(`[Step 4] Failed to create PR: ${error}`);\n return {\n success: false,\n error: `Failed to create PR: ${createPR.status}`\n };\n }\n const prData = await createPR.json();\n console.log(`[Step 4] Created PR: ${prData.html_url}`);\n return {\n success: true,\n prUrl: prData.html_url,\n prNumber: prData.number,\n branch: branchName\n };\n } catch (error) {\n console.error(\"[Step 4] Error creating PR:\", error);\n return {\n success: false,\n error: error instanceof Error ? error.message : String(error)\n };\n }\n}\n/**\n * Cleanup step: Stop the sandbox\n */ export async function cleanupSandbox(cleanup) {\n console.log(\"[Cleanup] Stopping sandbox...\");\n try {\n await cleanup();\n console.log(\"[Cleanup] Sandbox stopped successfully\");\n } catch (error) {\n console.error(\"[Cleanup] Error stopping sandbox:\", error);\n // Don't throw - cleanup errors shouldn't fail the workflow\n }\n}\n"],"names":[],"mappings":"sCAMW,eAAe,EAAiB,CAAO,CAAE,CAAM,CAAE,CAAW,CAAE,CAAW,CAAE,CAAe,EACjG,QAAQ,GAAG,CAAC,CAAC,kCAAkC,EAAE,EAAY,GAAG,CAAC,EACjE,QAAQ,GAAG,CAAC,CAAC,qBAAqB,EAAE,EAAA,CAAS,EAC7C,QAAQ,GAAG,CAAC,CAAC,iBAAiB,EAAE,EAAA,CAAQ,EAExC,QAAQ,GAAG,CAAC,CAAC,qCAAqC,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,iBAAiB,CAAA,CAAE,EACrF,QAAQ,GAAG,CAAC,CAAC,4CAA4C,EAAE,CAAC,CAAC,EAAA,CAAiB,EAC9E,QAAQ,GAAG,CAAC,CAAC,iCAAiC,EAAE,CAAC,CAAC,QAAQ,GAAG,CAAC,YAAY,CAAA,CAAE,EAC5E,QAAQ,GAAG,CAAC,CAAC,qCAAqC,EAAE,CAAC,CAAC,EAAA,CAAa,EAG/D,GAAmB,CAAC,QAAQ,GAAG,CAAC,iBAAiB,EAAE,CACnD,QAAQ,GAAG,CAAC,iBAAiB,CAAG,EAChC,QAAQ,GAAG,CAAC,CAAC,oDAAoD,CAAC,GAEtE,IAAM,EAAgB,MAAM,qBAAqB,SAC7C,SACA,EACA,WAAY,GACZ,eAAgB,OAChB,MAAO,EACX,GACA,QAAQ,GAAG,CAAC,CAAC,qCAAqC,CAAC,EACnD,QAAQ,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAc,MAAM,CAAA,CAAE,EACvD,QAAQ,GAAG,CAAC,CAAC,kBAAkB,EAAE,EAAc,MAAM,CAAA,CAAE,EAGvD,QAAQ,GAAG,CAAC,CAAC,qDAAqD,CAAC,EACnE,IAAI,EAAU,KACV,EAAW,KAGf,eAAe,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A6B,CAAC,CACzD,KAAM,EACN,KAAM,EACN,KAAM,CACV,EACJ,GACA,GAAI,CAAC,EAAS,EAAE,CAAE,CACd,IAAM,EAAQ,MAAM,EAAS,IAAI,GAEjC,OADA,QAAQ,KAAK,CAAC,CAAC,8BAA8B,EAAE,EAAA,CAAO,EAC/C,CACH,SAAS,EACT,MAAO,CAAC,qBAAqB,EAAE,EAAS,MAAM,CAAA,CAClD,AADoD,CAExD,CACA,IAAM,EAAS,MAAM,EAAS,IAAI,GAElC,OADA,QAAQ,GAAG,CAAC,CAAC,qBAAqB,EAAE,EAAO,QAAQ,CAAA,CAAE,EAC9C,CACH,SAAS,EACT,MAAO,EAAO,QAAQ,CACtB,SAAU,EAAO,MAAM,CACvB,OAAQ,CACZ,CACJ,CAAE,MAAO,EAAO,CAEZ,OADA,QAAQ,KAAK,CAAC,8BAA+B,GACtC,CACH,SAAS,EACT,MAAO,aAAiB,MAAQ,EAAM,OAAO,CAAG,OAAO,EAC3D,CACJ,CACJ,CAGW,eAAe,EAAe,CAAO,EAC5C,QAAQ,GAAG,CAAC,iCACZ,GAAI,CACA,MAAM,IACN,QAAQ,GAAG,CAAC,yCAChB,CAAE,MAAO,EAAO,CACZ,QAAQ,KAAK,CAAC,oCAAqC,EAEvD,CACJ"}
@@ -0,0 +1,3 @@
1
+ module.exports=[18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},48293,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactDOM},65071,(a,b,c)=>{"use strict";b.exports=a.r(18622)},55205,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactJsxRuntime},33857,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].React},27125,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.AppRouterContext},77279,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactServerDOMTurbopackClient},32570,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return d}});let d=a=>{}},3988,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},71075,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=a.r(33857);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16274,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__"},60019,a=>{"use strict";var b=a.i(55205),c=a.i(77696),d=a.i(42261),e=a.i(18749);let f=(0,d.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:a,variant:d,size:g,asChild:h=!1,...i}){let j=h?c.Slot:"button";return(0,b.jsx)(j,{"data-slot":"button",className:(0,e.cn)(f({variant:d,size:g,className:a})),...i})}a.s(["Button",()=>g])},25988,a=>{"use strict";var b=a.i(55205),c=a.i(18749);function d({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card",className:(0,c.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",a),...d})}function e({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-header",className:(0,c.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",a),...d})}function f({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-title",className:(0,c.cn)("leading-none font-semibold",a),...d})}function g({className:a,...d}){return(0,b.jsx)("div",{"data-slot":"card-content",className:(0,c.cn)("px-6",a),...d})}a.s(["Card",()=>d,"CardContent",()=>g,"CardHeader",()=>e,"CardTitle",()=>f])},24501,a=>{"use strict";var b=a.i(55205),c=a.i(14957),d=a.i(7287),e=a.i(33857),f=a.i(77696),g=a.i(42261),h=a.i(18749);let i=(0,g.cva)("inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90",destructive:"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function j({className:a,variant:c,asChild:d=!1,...e}){let g=d?f.Slot:"span";return(0,b.jsx)(g,{"data-slot":"badge",className:(0,h.cn)(i({variant:c}),a),...e})}var k=a.i(60019),l=a.i(25988);function m({className:a,...c}){return(0,b.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:(0,b.jsx)("table",{"data-slot":"table",className:(0,h.cn)("w-full caption-bottom text-sm",a),...c})})}function n({className:a,...c}){return(0,b.jsx)("thead",{"data-slot":"table-header",className:(0,h.cn)("[&_tr]:border-b",a),...c})}function o({className:a,...c}){return(0,b.jsx)("tbody",{"data-slot":"table-body",className:(0,h.cn)("[&_tr:last-child]:border-0",a),...c})}function p({className:a,...c}){return(0,b.jsx)("tr",{"data-slot":"table-row",className:(0,h.cn)("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...c})}function q({className:a,...c}){return(0,b.jsx)("th",{"data-slot":"table-head",className:(0,h.cn)("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...c})}function r({className:a,...c}){return(0,b.jsx)("td",{"data-slot":"table-cell",className:(0,h.cn)("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...c})}function s({user:a,initialRuns:f}){let[g,h]=(0,e.useState)(!1);async function i(){h(!0);try{await fetch("/api/auth/signout",{method:"POST"}),window.location.href="/"}catch(a){console.error("Failed to sign out:",a),h(!1)}}return(0,b.jsx)("div",{className:"min-h-screen bg-gray-50 py-8",children:(0,b.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[(0,b.jsxs)("div",{className:"mb-8 flex justify-between items-start",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h1",{className:"text-3xl font-bold text-gray-900",children:"d3k Workflow Runs"}),(0,b.jsx)("p",{className:"mt-2 text-gray-600",children:"View all your d3k workflow fix proposals and PRs"}),(0,b.jsxs)("p",{className:"mt-1 text-sm text-gray-500",children:["Signed in as ",a.email]})]}),(0,b.jsxs)("div",{className:"flex gap-3",children:[(0,b.jsx)(k.Button,{asChild:!0,children:(0,b.jsx)(d.default,{href:"/workflows/new",children:"New Workflow"})}),(0,b.jsx)(k.Button,{variant:"outline",onClick:i,disabled:g,children:g?"Signing out...":"Sign out"})]})]}),0===f.length?(0,b.jsx)(l.Card,{className:"p-12 text-center",children:(0,b.jsxs)(l.CardContent,{children:[(0,b.jsx)("p",{className:"text-muted-foreground",children:"No workflow runs yet"}),(0,b.jsx)("p",{className:"text-sm text-muted-foreground/70 mt-2",children:"Run a workflow from the CLI to see it appear here"})]})}):(0,b.jsx)(l.Card,{children:(0,b.jsxs)(m,{children:[(0,b.jsx)(n,{children:(0,b.jsxs)(p,{children:[(0,b.jsx)(q,{children:"Project"}),(0,b.jsx)(q,{children:"Status"}),(0,b.jsx)(q,{children:"Timestamp"}),(0,b.jsx)(q,{children:"Before"}),(0,b.jsx)(q,{children:"After"}),(0,b.jsx)(q,{children:"Report"}),(0,b.jsx)(q,{children:"PR"})]})}),(0,b.jsx)(o,{children:f.map(a=>(0,b.jsxs)(p,{children:[(0,b.jsxs)(r,{children:[(0,b.jsx)("div",{className:"font-medium",children:a.projectName}),(0,b.jsx)("div",{className:"text-xs text-muted-foreground",children:a.id})]}),(0,b.jsx)(r,{children:(0,b.jsx)(j,{variant:"success"===a.status?"secondary":"running"===a.status?"default":"destructive",className:"success"===a.status?"bg-green-100 text-green-800 hover:bg-green-100":"running"===a.status?"bg-blue-100 text-blue-800 hover:bg-blue-100":"",children:a.status})}),(0,b.jsx)(r,{className:"text-muted-foreground",children:new Date(a.timestamp).toLocaleString()}),(0,b.jsx)(r,{children:a.beforeScreenshotUrl?(0,b.jsx)("a",{href:a.beforeScreenshotUrl,target:"_blank",rel:"noopener noreferrer",children:(0,b.jsx)(c.default,{src:a.beforeScreenshotUrl,alt:"Before",width:64,height:40,className:"object-cover rounded border hover:opacity-80 transition-opacity",unoptimized:!0})}):(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:"-"})}),(0,b.jsx)(r,{children:a.afterScreenshotUrl?(0,b.jsx)("a",{href:a.afterScreenshotUrl,target:"_blank",rel:"noopener noreferrer",children:(0,b.jsx)(c.default,{src:a.afterScreenshotUrl,alt:"After",width:64,height:40,className:"object-cover rounded border hover:opacity-80 transition-opacity",unoptimized:!0})}):(0,b.jsx)("span",{className:"text-muted-foreground text-xs",children:"-"})}),(0,b.jsx)(r,{children:a.reportBlobUrl?(0,b.jsx)(d.default,{href:`/workflows/${a.id}/report`,className:"text-primary hover:underline",children:"View Report"}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"No report"})}),(0,b.jsx)(r,{children:a.prUrl?(0,b.jsx)("a",{href:a.prUrl,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:underline",children:"View PR"}):(0,b.jsx)("span",{className:"text-muted-foreground",children:"No PR"})})]},`${a.id}-${a.timestamp}`))})]})})]})})}a.s(["default",()=>s],24501)}];
2
+
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__0ff05d72._.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-dom.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/module.compiled.js","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-jsx-runtime.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/vendored/contexts/app-router-context.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/server/route-modules/app-page/vendored/ssr/react-server-dom-turbopack-client.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/shared/lib/utils/warn-once.ts","../../../../../node_modules/.pnpm/%40swc%2Bhelpers%400.5.15/node_modules/%40swc/helpers/cjs/_interop_require_wildcard.cjs","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/client/use-merged-ref.ts","../../../../../node_modules/.pnpm/next%4016.1.0-canary.9_%40opentelemetry%2Bapi%401.9.0_babel-plugin-react-compiler%401.0.0_react-d_e89f05fa6262f945d2946e6441ada21f/node_modules/next/src/shared/lib/segment.ts","../../../../../mcp-server/components/ui/button.tsx","../../../../../mcp-server/components/ui/card.tsx","../../../../../mcp-server/app/workflows/workflows-client.tsx","../../../../../mcp-server/components/ui/badge.tsx","../../../../../mcp-server/components/ui/table.tsx"],"sourcesContent":["module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactDOM\n","if (process.env.NEXT_RUNTIME === 'edge') {\n module.exports = require('next/dist/server/route-modules/app-page/module.js')\n} else {\n if (process.env.__NEXT_EXPERIMENTAL_REACT) {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo-experimental.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page-experimental.runtime.prod.js')\n }\n }\n } else {\n if (process.env.NODE_ENV === 'development') {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.dev.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.dev.js')\n }\n } else {\n if (process.env.TURBOPACK) {\n module.exports = require('next/dist/compiled/next-server/app-page-turbo.runtime.prod.js')\n } else {\n module.exports = require('next/dist/compiled/next-server/app-page.runtime.prod.js')\n }\n }\n }\n}\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactJsxRuntime\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.React\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['contexts'].AppRouterContext\n","module.exports = (\n require('../../module.compiled') as typeof import('../../module.compiled')\n).vendored['react-ssr']!.ReactServerDOMTurbopackClient\n","let warnOnce = (_: string) => {}\nif (process.env.NODE_ENV !== 'production') {\n const warnings = new Set<string>()\n warnOnce = (msg: string) => {\n if (!warnings.has(msg)) {\n console.warn(msg)\n }\n warnings.add(msg)\n }\n}\n\nexport { warnOnce }\n","\"use strict\";\n\nfunction _getRequireWildcardCache(nodeInterop) {\n if (typeof WeakMap !== \"function\") return null;\n\n var cacheBabelInterop = new WeakMap();\n var cacheNodeInterop = new WeakMap();\n\n return (_getRequireWildcardCache = function(nodeInterop) {\n return nodeInterop ? cacheNodeInterop : cacheBabelInterop;\n })(nodeInterop);\n}\nfunction _interop_require_wildcard(obj, nodeInterop) {\n if (!nodeInterop && obj && obj.__esModule) return obj;\n if (obj === null || typeof obj !== \"object\" && typeof obj !== \"function\") return { default: obj };\n\n var cache = _getRequireWildcardCache(nodeInterop);\n\n if (cache && cache.has(obj)) return cache.get(obj);\n\n var newObj = { __proto__: null };\n var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;\n\n for (var key in obj) {\n if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) {\n var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;\n if (desc && (desc.get || desc.set)) Object.defineProperty(newObj, key, desc);\n else newObj[key] = obj[key];\n }\n }\n\n newObj.default = obj;\n\n if (cache) cache.set(obj, newObj);\n\n return newObj;\n}\nexports._ = _interop_require_wildcard;\n","import { useCallback, useRef, type Ref } from 'react'\n\n// This is a compatibility hook to support React 18 and 19 refs.\n// In 19, a cleanup function from refs may be returned.\n// In 18, returning a cleanup function creates a warning.\n// Since we take userspace refs, we don't know ahead of time if a cleanup function will be returned.\n// This implements cleanup functions with the old behavior in 18.\n// We know refs are always called alternating with `null` and then `T`.\n// So a call with `null` means we need to call the previous cleanup functions.\nexport function useMergedRef<TElement>(\n refA: Ref<TElement>,\n refB: Ref<TElement>\n): Ref<TElement> {\n const cleanupA = useRef<(() => void) | null>(null)\n const cleanupB = useRef<(() => void) | null>(null)\n\n // NOTE: In theory, we could skip the wrapping if only one of the refs is non-null.\n // (this happens often if the user doesn't pass a ref to Link/Form/Image)\n // But this can cause us to leak a cleanup-ref into user code (previously via `<Link legacyBehavior>`),\n // and the user might pass that ref into ref-merging library that doesn't support cleanup refs\n // (because it hasn't been updated for React 19)\n // which can then cause things to blow up, because a cleanup-returning ref gets called with `null`.\n // So in practice, it's safer to be defensive and always wrap the ref, even on React 19.\n return useCallback(\n (current: TElement | null): void => {\n if (current === null) {\n const cleanupFnA = cleanupA.current\n if (cleanupFnA) {\n cleanupA.current = null\n cleanupFnA()\n }\n const cleanupFnB = cleanupB.current\n if (cleanupFnB) {\n cleanupB.current = null\n cleanupFnB()\n }\n } else {\n if (refA) {\n cleanupA.current = applyRef(refA, current)\n }\n if (refB) {\n cleanupB.current = applyRef(refB, current)\n }\n }\n },\n [refA, refB]\n )\n}\n\nfunction applyRef<TElement>(\n refA: NonNullable<Ref<TElement>>,\n current: TElement\n) {\n if (typeof refA === 'function') {\n const cleanup = refA(current)\n if (typeof cleanup === 'function') {\n return cleanup\n } else {\n return () => refA(null)\n }\n } else {\n refA.current = current\n return () => {\n refA.current = null\n }\n }\n}\n","import type { FlightRouterState, Segment } from './app-router-types'\n\nexport function getSegmentValue(segment: Segment) {\n return Array.isArray(segment) ? segment[1] : segment\n}\n\nexport function isGroupSegment(segment: string) {\n // Use array[0] for performant purpose\n return segment[0] === '(' && segment.endsWith(')')\n}\n\nexport function isParallelRouteSegment(segment: string) {\n return segment.startsWith('@') && segment !== '@children'\n}\n\nexport function addSearchParamsIfPageSegment(\n segment: Segment,\n searchParams: Record<string, string | string[] | undefined>\n) {\n const isPageSegment = segment.includes(PAGE_SEGMENT_KEY)\n\n if (isPageSegment) {\n const stringifiedQuery = JSON.stringify(searchParams)\n return stringifiedQuery !== '{}'\n ? PAGE_SEGMENT_KEY + '?' + stringifiedQuery\n : PAGE_SEGMENT_KEY\n }\n\n return segment\n}\n\nexport function computeSelectedLayoutSegment(\n segments: string[] | null,\n parallelRouteKey: string\n): string | null {\n if (!segments || segments.length === 0) {\n return null\n }\n\n // For 'children', use first segment; for other parallel routes, use last segment\n const rawSegment =\n parallelRouteKey === 'children'\n ? segments[0]\n : segments[segments.length - 1]\n\n // If the default slot is showing, return null since it's not technically \"selected\" (it's a fallback)\n // Returning an internal value like `__DEFAULT__` would be confusing\n return rawSegment === DEFAULT_SEGMENT_KEY ? null : rawSegment\n}\n\n/** Get the canonical parameters from the current level to the leaf node. */\nexport function getSelectedLayoutSegmentPath(\n tree: FlightRouterState,\n parallelRouteKey: string,\n first = true,\n segmentPath: string[] = []\n): string[] {\n let node: FlightRouterState\n if (first) {\n // Use the provided parallel route key on the first parallel route\n node = tree[1][parallelRouteKey]\n } else {\n // After first parallel route prefer children, if there's no children pick the first parallel route.\n const parallelRoutes = tree[1]\n node = parallelRoutes.children ?? Object.values(parallelRoutes)[0]\n }\n\n if (!node) return segmentPath\n const segment = node[0]\n\n let segmentValue = getSegmentValue(segment)\n\n if (!segmentValue || segmentValue.startsWith(PAGE_SEGMENT_KEY)) {\n return segmentPath\n }\n\n segmentPath.push(segmentValue)\n\n return getSelectedLayoutSegmentPath(\n node,\n parallelRouteKey,\n false,\n segmentPath\n )\n}\n\nexport const PAGE_SEGMENT_KEY = '__PAGE__'\nexport const DEFAULT_SEGMENT_KEY = '__DEFAULT__'\n","\"use client\"\n\nimport { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst buttonVariants = cva(\n \"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive\",\n {\n variants: {\n variant: {\n default: \"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90\",\n destructive:\n \"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline:\n \"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50\",\n secondary: \"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80\",\n ghost: \"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50\",\n link: \"text-primary underline-offset-4 hover:underline\"\n },\n size: {\n default: \"h-9 px-4 py-2 has-[>svg]:px-3\",\n sm: \"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5\",\n lg: \"h-10 rounded-md px-6 has-[>svg]:px-4\",\n icon: \"size-9\"\n }\n },\n defaultVariants: {\n variant: \"default\",\n size: \"default\"\n }\n }\n)\n\nfunction Button({\n className,\n variant,\n size,\n asChild = false,\n ...props\n}: React.ComponentProps<\"button\"> &\n VariantProps<typeof buttonVariants> & {\n asChild?: boolean\n }) {\n const Comp = asChild ? Slot : \"button\"\n\n return <Comp data-slot=\"button\" className={cn(buttonVariants({ variant, size, className }))} {...props} />\n}\n\nexport { Button, buttonVariants }\n","import type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Card({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card\"\n className={cn(\"bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm\", className)}\n {...props}\n />\n )\n}\n\nfunction CardHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-header\"\n className={cn(\n \"@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction CardTitle({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-title\" className={cn(\"leading-none font-semibold\", className)} {...props} />\n}\n\nfunction CardDescription({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-description\" className={cn(\"text-muted-foreground text-sm\", className)} {...props} />\n}\n\nfunction CardAction({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"card-action\"\n className={cn(\"col-start-2 row-span-2 row-start-1 self-start justify-self-end\", className)}\n {...props}\n />\n )\n}\n\nfunction CardContent({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-content\" className={cn(\"px-6\", className)} {...props} />\n}\n\nfunction CardFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return <div data-slot=\"card-footer\" className={cn(\"flex items-center px-6 [.border-t]:pt-6\", className)} {...props} />\n}\n\nexport { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }\n","\"use client\"\n\nimport Image from \"next/image\"\nimport Link from \"next/link\"\nimport { useState } from \"react\"\nimport { Badge } from \"@/components/ui/badge\"\nimport { Button } from \"@/components/ui/button\"\nimport { Card, CardContent } from \"@/components/ui/card\"\nimport { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from \"@/components/ui/table\"\nimport type { WorkflowRun } from \"@/lib/workflow-storage\"\n\ninterface UserInfo {\n id: string\n email: string\n name: string\n username: string\n}\n\ninterface WorkflowsClientProps {\n user: UserInfo\n initialRuns: WorkflowRun[]\n}\n\nexport default function WorkflowsClient({ user, initialRuns }: WorkflowsClientProps) {\n const [isSigningOut, setIsSigningOut] = useState(false)\n\n async function handleSignOut() {\n setIsSigningOut(true)\n try {\n await fetch(\"/api/auth/signout\", { method: \"POST\" })\n window.location.href = \"/\"\n } catch (error) {\n console.error(\"Failed to sign out:\", error)\n setIsSigningOut(false)\n }\n }\n\n return (\n <div className=\"min-h-screen bg-gray-50 py-8\">\n <div className=\"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8\">\n <div className=\"mb-8 flex justify-between items-start\">\n <div>\n <h1 className=\"text-3xl font-bold text-gray-900\">d3k Workflow Runs</h1>\n <p className=\"mt-2 text-gray-600\">View all your d3k workflow fix proposals and PRs</p>\n <p className=\"mt-1 text-sm text-gray-500\">Signed in as {user.email}</p>\n </div>\n <div className=\"flex gap-3\">\n <Button asChild>\n <Link href=\"/workflows/new\">New Workflow</Link>\n </Button>\n <Button variant=\"outline\" onClick={handleSignOut} disabled={isSigningOut}>\n {isSigningOut ? \"Signing out...\" : \"Sign out\"}\n </Button>\n </div>\n </div>\n\n {initialRuns.length === 0 ? (\n <Card className=\"p-12 text-center\">\n <CardContent>\n <p className=\"text-muted-foreground\">No workflow runs yet</p>\n <p className=\"text-sm text-muted-foreground/70 mt-2\">Run a workflow from the CLI to see it appear here</p>\n </CardContent>\n </Card>\n ) : (\n <Card>\n <Table>\n <TableHeader>\n <TableRow>\n <TableHead>Project</TableHead>\n <TableHead>Status</TableHead>\n <TableHead>Timestamp</TableHead>\n <TableHead>Before</TableHead>\n <TableHead>After</TableHead>\n <TableHead>Report</TableHead>\n <TableHead>PR</TableHead>\n </TableRow>\n </TableHeader>\n <TableBody>\n {initialRuns.map((run) => (\n <TableRow key={`${run.id}-${run.timestamp}`}>\n <TableCell>\n <div className=\"font-medium\">{run.projectName}</div>\n <div className=\"text-xs text-muted-foreground\">{run.id}</div>\n </TableCell>\n <TableCell>\n <Badge\n variant={\n run.status === \"success\" ? \"secondary\" : run.status === \"running\" ? \"default\" : \"destructive\"\n }\n className={\n run.status === \"success\"\n ? \"bg-green-100 text-green-800 hover:bg-green-100\"\n : run.status === \"running\"\n ? \"bg-blue-100 text-blue-800 hover:bg-blue-100\"\n : \"\"\n }\n >\n {run.status}\n </Badge>\n </TableCell>\n <TableCell className=\"text-muted-foreground\">{new Date(run.timestamp).toLocaleString()}</TableCell>\n <TableCell>\n {run.beforeScreenshotUrl ? (\n <a href={run.beforeScreenshotUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n <Image\n src={run.beforeScreenshotUrl}\n alt=\"Before\"\n width={64}\n height={40}\n className=\"object-cover rounded border hover:opacity-80 transition-opacity\"\n unoptimized\n />\n </a>\n ) : (\n <span className=\"text-muted-foreground text-xs\">-</span>\n )}\n </TableCell>\n <TableCell>\n {run.afterScreenshotUrl ? (\n <a href={run.afterScreenshotUrl} target=\"_blank\" rel=\"noopener noreferrer\">\n <Image\n src={run.afterScreenshotUrl}\n alt=\"After\"\n width={64}\n height={40}\n className=\"object-cover rounded border hover:opacity-80 transition-opacity\"\n unoptimized\n />\n </a>\n ) : (\n <span className=\"text-muted-foreground text-xs\">-</span>\n )}\n </TableCell>\n <TableCell>\n {run.reportBlobUrl ? (\n <Link href={`/workflows/${run.id}/report`} className=\"text-primary hover:underline\">\n View Report\n </Link>\n ) : (\n <span className=\"text-muted-foreground\">No report</span>\n )}\n </TableCell>\n <TableCell>\n {run.prUrl ? (\n <a\n href={run.prUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n className=\"text-primary hover:underline\"\n >\n View PR\n </a>\n ) : (\n <span className=\"text-muted-foreground\">No PR</span>\n )}\n </TableCell>\n </TableRow>\n ))}\n </TableBody>\n </Table>\n </Card>\n )}\n </div>\n </div>\n )\n}\n","import { Slot } from \"@radix-ui/react-slot\"\nimport { cva, type VariantProps } from \"class-variance-authority\"\nimport type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst badgeVariants = cva(\n \"inline-flex items-center justify-center rounded-full border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden\",\n {\n variants: {\n variant: {\n default: \"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90\",\n secondary: \"border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90\",\n destructive:\n \"border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60\",\n outline: \"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground\"\n }\n },\n defaultVariants: {\n variant: \"default\"\n }\n }\n)\n\nfunction Badge({\n className,\n variant,\n asChild = false,\n ...props\n}: React.ComponentProps<\"span\"> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {\n const Comp = asChild ? Slot : \"span\"\n\n return <Comp data-slot=\"badge\" className={cn(badgeVariants({ variant }), className)} {...props} />\n}\n\nexport { Badge, badgeVariants }\n","\"use client\"\n\nimport type * as React from \"react\"\n\nimport { cn } from \"@/lib/utils\"\n\nfunction Table({ className, ...props }: React.ComponentProps<\"table\">) {\n return (\n <div data-slot=\"table-container\" className=\"relative w-full overflow-x-auto\">\n <table data-slot=\"table\" className={cn(\"w-full caption-bottom text-sm\", className)} {...props} />\n </div>\n )\n}\n\nfunction TableHeader({ className, ...props }: React.ComponentProps<\"thead\">) {\n return <thead data-slot=\"table-header\" className={cn(\"[&_tr]:border-b\", className)} {...props} />\n}\n\nfunction TableBody({ className, ...props }: React.ComponentProps<\"tbody\">) {\n return <tbody data-slot=\"table-body\" className={cn(\"[&_tr:last-child]:border-0\", className)} {...props} />\n}\n\nfunction TableFooter({ className, ...props }: React.ComponentProps<\"tfoot\">) {\n return (\n <tfoot\n data-slot=\"table-footer\"\n className={cn(\"bg-muted/50 border-t font-medium [&>tr]:last:border-b-0\", className)}\n {...props}\n />\n )\n}\n\nfunction TableRow({ className, ...props }: React.ComponentProps<\"tr\">) {\n return (\n <tr\n data-slot=\"table-row\"\n className={cn(\"hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors\", className)}\n {...props}\n />\n )\n}\n\nfunction TableHead({ className, ...props }: React.ComponentProps<\"th\">) {\n return (\n <th\n data-slot=\"table-head\"\n className={cn(\n \"text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCell({ className, ...props }: React.ComponentProps<\"td\">) {\n return (\n <td\n data-slot=\"table-cell\"\n className={cn(\n \"p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction TableCaption({ className, ...props }: React.ComponentProps<\"caption\">) {\n return (\n <caption data-slot=\"table-caption\" className={cn(\"text-muted-foreground mt-4 text-sm\", className)} {...props} />\n )\n}\n\nexport { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }\n"],"names":["module","exports","require","vendored","ReactDOM","process","env","NEXT_RUNTIME","__NEXT_EXPERIMENTAL_REACT","NODE_ENV","TURBOPACK","ReactJsxRuntime","React","AppRouterContext","ReactServerDOMTurbopackClient","warnOnce","_","warnings","Set","msg","has","console","warn","add","useMergedRef","refA","refB","cleanupA","useRef","cleanupB","useCallback","current","cleanupFnA","cleanupFnB","applyRef","cleanup","DEFAULT_SEGMENT_KEY","PAGE_SEGMENT_KEY","addSearchParamsIfPageSegment","computeSelectedLayoutSegment","getSegmentValue","getSelectedLayoutSegmentPath","isGroupSegment","isParallelRouteSegment","segment","Array","isArray","endsWith","startsWith","searchParams","isPageSegment","includes","stringifiedQuery","JSON","stringify","segments","parallelRouteKey","length","rawSegment","tree","first","segmentPath","node","parallelRoutes","children","Object","values","segmentValue","push"],"mappings":"0NAAAA,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEC,QAAQ,+BCwBzBJ,EAAOC,OAAO,CAAGC,EAAQ,CAAA,CAAA,IAAA,iCC1BjCF,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEQ,eAAe,+BCFxCX,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAES,KAAK,8BCF9BZ,GAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,QAAW,CAACU,gBAAgB,+BCFvCb,EAAOC,OAAO,CACZC,EAAQ,CAAA,CAAA,IAAA,GACRC,QAAQ,CAAC,YAAY,CAAEW,6BAA6B,wGCS7CC,WAAAA,qCAAAA,KAXT,IAAI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ACR,UAAU,kEACV,WAAW,CAAA,CAAA,MAIf,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,yCAAgC,QAGpD,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,UACE,EAAI,aAAa,CAChB,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,OAAI,CAAA,CAAC,KAAM,CAAC,WAAW,EAAE,EAAI,EAAE,CAAC,OAAO,CAAC,CAAE,UAAU,wCAA+B,gBAIpF,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,iCAAwB,gBAG5C,CAAA,EAAA,EAAA,GAAA,EAAC,EAAA,UACE,EAAI,KAAK,CACR,CAAA,EAAA,EAAA,GAAA,EAAC,IAAA,CACC,KAAM,EAAI,KAAK,CACf,OAAO,SACP,IAAI,sBACJ,UAAU,wCACX,YAID,CAAA,EAAA,EAAA,GAAA,EAAC,OAAA,CAAK,UAAU,iCAAwB,cA1E/B,CAAA,EAAG,EAAI,EAAE,CAAC,CAAC,EAAE,EAAI,SAAS,CAAA,CAAE,cAsF7D","ignoreList":[0,1,2,3,4,5,6,7,8,9]}
@@ -1,3 +1,3 @@
1
- module.exports=[65071,(a,b,c)=>{"use strict";b.exports=a.r(18622)},55205,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactJsxRuntime},33857,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].React},27125,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.AppRouterContext},48293,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactDOM},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},61645,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.HooksClientContext},35534,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.ServerInsertedHtml},32570,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return d}});let d=a=>{}},3988,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},71075,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=a.r(33857);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16274,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__"},26268,a=>{"use strict";var b=a.i(33857);let c=a=>{let b=a.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,b,c)=>c?c.toUpperCase():b.toLowerCase());return b.charAt(0).toUpperCase()+b.slice(1)},d=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim();var e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let f=(0,b.forwardRef)(({color:a="currentColor",size:c=24,strokeWidth:f=2,absoluteStrokeWidth:g,className:h="",children:i,iconNode:j,...k},l)=>(0,b.createElement)("svg",{ref:l,...e,width:c,height:c,stroke:a,strokeWidth:g?24*Number(f)/Number(c):f,className:d("lucide",h),...!i&&!(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0})(k)&&{"aria-hidden":"true"},...k},[...j.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(i)?i:[i]])),g=(a,e)=>{let g=(0,b.forwardRef)(({className:g,...h},i)=>(0,b.createElement)(f,{ref:i,iconNode:e,className:d(`lucide-${c(a).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${a}`,g),...h}));return g.displayName=c(a),g};a.s(["default",()=>g],26268)},60019,a=>{"use strict";var b=a.i(55205),c=a.i(77696),d=a.i(42261),e=a.i(18749);let f=(0,d.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:a,variant:d,size:g,asChild:h=!1,...i}){let j=h?c.Slot:"button";return(0,b.jsx)(j,{"data-slot":"button",className:(0,e.cn)(f({variant:d,size:g,className:a})),...i})}a.s(["Button",()=>g])},87896,37825,a=>{"use strict";var b=a.i(55205),c=a.i(26268);let d=(0,c.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),e=(0,c.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var f=a.i(60019);function g({darkMode:a,setDarkMode:c,className:g}){return(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",onClick:()=>c(!a),className:g,"aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?(0,b.jsx)(e,{className:"h-5 w-5 transition-all"}):(0,b.jsx)(d,{className:"h-5 w-5 transition-all"})})}a.s(["DarkModeToggle",()=>g],87896);var h=a.i(33857);function i(){let[a,b]=(0,h.useState)(()=>!1);return(0,h.useEffect)(()=>{localStorage.setItem("dev3000-dark-mode",JSON.stringify(a)),a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[a]),(0,h.useEffect)(()=>{let a=window.matchMedia("(prefers-color-scheme: dark)"),c=a=>{null===localStorage.getItem("dev3000-dark-mode")&&b(a.matches)};return a.addEventListener("change",c),()=>a.removeEventListener("change",c)},[]),[a,b]}a.s(["useDarkMode",()=>i],37825)}];
1
+ module.exports=[61645,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.HooksClientContext},35534,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.ServerInsertedHtml},18622,(a,b,c)=>{b.exports=a.x("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js",()=>require("next/dist/compiled/next-server/app-page-turbo.runtime.prod.js"))},56704,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-async-storage.external.js",()=>require("next/dist/server/app-render/work-async-storage.external.js"))},32319,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/work-unit-async-storage.external.js",()=>require("next/dist/server/app-render/work-unit-async-storage.external.js"))},20635,(a,b,c)=>{b.exports=a.x("next/dist/server/app-render/action-async-storage.external.js",()=>require("next/dist/server/app-render/action-async-storage.external.js"))},65071,(a,b,c)=>{"use strict";b.exports=a.r(18622)},55205,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactJsxRuntime},33857,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].React},27125,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored.contexts.AppRouterContext},48293,(a,b,c)=>{"use strict";b.exports=a.r(65071).vendored["react-ssr"].ReactDOM},32570,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"warnOnce",{enumerable:!0,get:function(){return d}});let d=a=>{}},3988,(a,b,c)=>{"use strict";function d(a){if("function"!=typeof WeakMap)return null;var b=new WeakMap,c=new WeakMap;return(d=function(a){return a?c:b})(a)}c._=function(a,b){if(!b&&a&&a.__esModule)return a;if(null===a||"object"!=typeof a&&"function"!=typeof a)return{default:a};var c=d(b);if(c&&c.has(a))return c.get(a);var e={__proto__:null},f=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var g in a)if("default"!==g&&Object.prototype.hasOwnProperty.call(a,g)){var h=f?Object.getOwnPropertyDescriptor(a,g):null;h&&(h.get||h.set)?Object.defineProperty(e,g,h):e[g]=a[g]}return e.default=a,c&&c.set(a,e),e}},71075,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0}),Object.defineProperty(c,"useMergedRef",{enumerable:!0,get:function(){return e}});let d=a.r(33857);function e(a,b){let c=(0,d.useRef)(null),e=(0,d.useRef)(null);return(0,d.useCallback)(d=>{if(null===d){let a=c.current;a&&(c.current=null,a());let b=e.current;b&&(e.current=null,b())}else a&&(c.current=f(a,d)),b&&(e.current=f(b,d))},[a,b])}function f(a,b){if("function"!=typeof a)return a.current=b,()=>{a.current=null};{let c=a(b);return"function"==typeof c?c:()=>a(null)}}("function"==typeof c.default||"object"==typeof c.default&&null!==c.default)&&void 0===c.default.__esModule&&(Object.defineProperty(c.default,"__esModule",{value:!0}),Object.assign(c.default,c),b.exports=c.default)},16274,(a,b,c)=>{"use strict";Object.defineProperty(c,"__esModule",{value:!0});var d={DEFAULT_SEGMENT_KEY:function(){return l},PAGE_SEGMENT_KEY:function(){return k},addSearchParamsIfPageSegment:function(){return i},computeSelectedLayoutSegment:function(){return j},getSegmentValue:function(){return f},getSelectedLayoutSegmentPath:function(){return function a(b,c,d=!0,e=[]){let g;if(d)g=b[1][c];else{let a=b[1];g=a.children??Object.values(a)[0]}if(!g)return e;let h=f(g[0]);return!h||h.startsWith(k)?e:(e.push(h),a(g,c,!1,e))}},isGroupSegment:function(){return g},isParallelRouteSegment:function(){return h}};for(var e in d)Object.defineProperty(c,e,{enumerable:!0,get:d[e]});function f(a){return Array.isArray(a)?a[1]:a}function g(a){return"("===a[0]&&a.endsWith(")")}function h(a){return a.startsWith("@")&&"@children"!==a}function i(a,b){if(a.includes(k)){let a=JSON.stringify(b);return"{}"!==a?k+"?"+a:k}return a}function j(a,b){if(!a||0===a.length)return null;let c="children"===b?a[0]:a[a.length-1];return c===l?null:c}let k="__PAGE__",l="__DEFAULT__"},26268,a=>{"use strict";var b=a.i(33857);let c=a=>{let b=a.replace(/^([A-Z])|[\s-_]+(\w)/g,(a,b,c)=>c?c.toUpperCase():b.toLowerCase());return b.charAt(0).toUpperCase()+b.slice(1)},d=(...a)=>a.filter((a,b,c)=>!!a&&""!==a.trim()&&c.indexOf(a)===b).join(" ").trim();var e={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let f=(0,b.forwardRef)(({color:a="currentColor",size:c=24,strokeWidth:f=2,absoluteStrokeWidth:g,className:h="",children:i,iconNode:j,...k},l)=>(0,b.createElement)("svg",{ref:l,...e,width:c,height:c,stroke:a,strokeWidth:g?24*Number(f)/Number(c):f,className:d("lucide",h),...!i&&!(a=>{for(let b in a)if(b.startsWith("aria-")||"role"===b||"title"===b)return!0})(k)&&{"aria-hidden":"true"},...k},[...j.map(([a,c])=>(0,b.createElement)(a,c)),...Array.isArray(i)?i:[i]])),g=(a,e)=>{let g=(0,b.forwardRef)(({className:g,...h},i)=>(0,b.createElement)(f,{ref:i,iconNode:e,className:d(`lucide-${c(a).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${a}`,g),...h}));return g.displayName=c(a),g};a.s(["default",()=>g],26268)},60019,a=>{"use strict";var b=a.i(55205),c=a.i(77696),d=a.i(42261),e=a.i(18749);let f=(0,d.cva)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function g({className:a,variant:d,size:g,asChild:h=!1,...i}){let j=h?c.Slot:"button";return(0,b.jsx)(j,{"data-slot":"button",className:(0,e.cn)(f({variant:d,size:g,className:a})),...i})}a.s(["Button",()=>g])},87896,37825,a=>{"use strict";var b=a.i(55205),c=a.i(26268);let d=(0,c.default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]),e=(0,c.default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);var f=a.i(60019);function g({darkMode:a,setDarkMode:c,className:g}){return(0,b.jsx)(f.Button,{variant:"ghost",size:"icon",onClick:()=>c(!a),className:g,"aria-label":a?"Switch to light mode":"Switch to dark mode",children:a?(0,b.jsx)(e,{className:"h-5 w-5 transition-all"}):(0,b.jsx)(d,{className:"h-5 w-5 transition-all"})})}a.s(["DarkModeToggle",()=>g],87896);var h=a.i(33857);function i(){let[a,b]=(0,h.useState)(()=>!1);return(0,h.useEffect)(()=>{localStorage.setItem("dev3000-dark-mode",JSON.stringify(a)),a?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[a]),(0,h.useEffect)(()=>{let a=window.matchMedia("(prefers-color-scheme: dark)"),c=a=>{null===localStorage.getItem("dev3000-dark-mode")&&b(a.matches)};return a.addEventListener("change",c),()=>a.removeEventListener("change",c)},[]),[a,b]}a.s(["useDarkMode",()=>i],37825)}];
2
2
 
3
- //# sourceMappingURL=%5Broot-of-the-server%5D__9a29b768._.js.map
3
+ //# sourceMappingURL=%5Broot-of-the-server%5D__27cc5956._.js.map