dev3000 0.0.72 → 0.0.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +78 -30
- package/dist/cli.js +3 -1
- package/dist/cli.js.map +1 -1
- package/dist/dev-environment.d.ts +10 -1
- package/dist/dev-environment.d.ts.map +1 -1
- package/dist/dev-environment.js +676 -6
- package/dist/dev-environment.js.map +1 -1
- package/dist/src/loading.html +1 -1
- package/dist/src/tui-interface-impl.tsx +35 -30
- package/dist/tui-interface-impl.d.ts.map +1 -1
- package/dist/tui-interface-impl.js +26 -20
- package/dist/tui-interface-impl.js.map +1 -1
- package/dist/tui-interface.d.ts.map +1 -1
- package/dist/tui-interface.js +26 -5
- package/dist/tui-interface.js.map +1 -1
- package/mcp-server/.next/BUILD_ID +1 -1
- package/mcp-server/.next/build-manifest.json +8 -8
- package/mcp-server/.next/fallback-build-manifest.json +2 -2
- package/mcp-server/.next/images-manifest.json +2 -2
- package/mcp-server/.next/next-minimal-server.js.nft.json +1 -1
- package/mcp-server/.next/next-server.js.nft.json +1 -1
- package/mcp-server/.next/prerender-manifest.json +10 -10
- package/mcp-server/.next/required-server-files.json +5 -6
- package/mcp-server/.next/routes-manifest.json +1 -0
- package/mcp-server/.next/server/app/_global-error/page/build-manifest.json +6 -6
- package/mcp-server/.next/server/app/_global-error/page.js +8 -8
- package/mcp-server/.next/server/app/_global-error/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/_global-error.html +2 -2
- package/mcp-server/.next/server/app/_global-error.rsc +8 -8
- package/mcp-server/.next/server/app/_not-found/page/build-manifest.json +6 -6
- package/mcp-server/.next/server/app/_not-found/page.js +10 -10
- package/mcp-server/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/_not-found.html +1 -1
- package/mcp-server/.next/server/app/_not-found.rsc +8 -8
- package/mcp-server/.next/server/app/api/logs/append/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/append/route.js +4 -4
- package/mcp-server/.next/server/app/api/logs/append/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/logs/head/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/head/route.js +4 -4
- package/mcp-server/.next/server/app/api/logs/head/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/logs/list/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/list/route.js +4 -4
- package/mcp-server/.next/server/app/api/logs/list/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/logs/rotate/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/rotate/route.js +5 -5
- package/mcp-server/.next/server/app/api/logs/rotate/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/logs/stream/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/stream/route.js +4 -4
- package/mcp-server/.next/server/app/api/logs/stream/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/logs/tail/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/logs/tail/route.js +4 -4
- package/mcp-server/.next/server/app/api/logs/tail/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/screenshots/[filename]/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/screenshots/[filename]/route.js +5 -5
- package/mcp-server/.next/server/app/api/screenshots/[filename]/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/api/tools/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/api/tools/route.js +5 -5
- package/mcp-server/.next/server/app/api/tools/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/index.html +1 -1
- package/mcp-server/.next/server/app/index.rsc +10 -10
- package/mcp-server/.next/server/app/logs/page/build-manifest.json +6 -6
- package/mcp-server/.next/server/app/logs/page.js +13 -13
- package/mcp-server/.next/server/app/logs/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/logs/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/app/mcp/route/build-manifest.json +1 -8
- package/mcp-server/.next/server/app/mcp/route.js +6 -5
- package/mcp-server/.next/server/app/mcp/route.js.nft.json +1 -1
- package/mcp-server/.next/server/app/page/build-manifest.json +6 -6
- package/mcp-server/.next/server/app/page.js +12 -12
- package/mcp-server/.next/server/app/page.js.nft.json +1 -1
- package/mcp-server/.next/server/app/page_client-reference-manifest.js +1 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__013bbeea._.js +7 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__013bbeea._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__270b33b7._.js +33 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__270b33b7._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__5580d2ea._.js +35 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__5580d2ea._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__6fa7ea53._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__73645708._.js +11 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__73645708._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__8fc8f497._.js +4 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__8fc8f497._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__9c489027._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__9c489027._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__cc81580c._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__cc81580c._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__d1f9e389._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__d1f9e389._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__d200fe4a._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__d200fe4a._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__e2089993._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__e2089993._.js.map +1 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__ffb73672._.js +3 -0
- package/mcp-server/.next/server/chunks/[root-of-the-server]__ffb73672._.js.map +1 -0
- package/mcp-server/.next/server/chunks/{0916f_next_ab257ac1._.js → d1d76_next_09a9e080._.js} +4 -4
- package/mcp-server/.next/server/chunks/d1d76_next_09a9e080._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0217e89c._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__0217e89c._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__02a8c992._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__05689c01._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__6518b3b8._.js.map → [root-of-the-server]__05689c01._.js.map} +1 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__8db775f9._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__8db775f9._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__524f1e5c._.js → [root-of-the-server]__91510608._.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__91510608._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__9f07837d._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__9f07837d._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__db74836a._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__db74836a._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__e5dec879._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__e5dec879._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__fb40854a._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__fb40854a._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_0b8335fc._.js +8 -0
- package/mcp-server/.next/server/chunks/ssr/_0b8335fc._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_28084f73._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/_28084f73._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{_8babd77a._.js → _6129d8ec._.js} +3 -3
- package/mcp-server/.next/server/chunks/ssr/_6129d8ec._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_62451611._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/_62451611._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_7d3d2f5f._.js +4 -0
- package/mcp-server/.next/server/chunks/ssr/_7d3d2f5f._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_b15f05ee._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/_b15f05ee._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/_bacf0748._.js +8 -0
- package/mcp-server/.next/server/chunks/ssr/_bacf0748._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_032c5c2e._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_032c5c2e._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_08b22e19._.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_08b22e19._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_369453b3._.js +6 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_369453b3._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{0916f_next_dist_54420d8c._.js → d1d76_next_dist_ad253fdc._.js} +3 -3
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_ad253fdc._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_b9509b36._.js +6 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_b9509b36._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{0916f_next_dist_client_components_f453b63e._.js → d1d76_next_dist_client_components_6557bb14._.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_6557bb14._.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{0916f_next_dist_client_components_builtin_forbidden_7b57efa5.js → d1d76_next_dist_client_components_builtin_forbidden_c162dd05.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_builtin_forbidden_c162dd05.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_builtin_global-error_3d982957.js +3 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_builtin_global-error_3d982957.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/{0916f_next_dist_client_components_builtin_unauthorized_6614f15c.js → d1d76_next_dist_client_components_builtin_unauthorized_e4f02ffd.js} +2 -2
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_client_components_builtin_unauthorized_e4f02ffd.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_esm_build_templates_app-page_134a93a5.js +4 -0
- package/mcp-server/.next/server/chunks/ssr/d1d76_next_dist_esm_build_templates_app-page_134a93a5.js.map +1 -0
- package/mcp-server/.next/server/chunks/ssr/mcp-server_app_layout_tsx_afa41767._.js +1 -1
- package/mcp-server/.next/server/middleware-build-manifest.js +7 -8
- package/mcp-server/.next/server/server-reference-manifest.js +1 -1
- package/mcp-server/.next/server/server-reference-manifest.json +1 -1
- package/mcp-server/.next/static/chunks/11ac0d0e69696c72.js +1 -0
- package/mcp-server/.next/static/chunks/172f6179d608c15f.js +1 -0
- package/mcp-server/.next/static/chunks/526448e84b58822c.js +1 -0
- package/mcp-server/.next/static/chunks/571fbcba7786c174.js +1 -0
- package/mcp-server/.next/static/chunks/{044e917a180dc576.js → 711519b5a2e53fc8.js} +1 -1
- package/mcp-server/.next/static/chunks/addab50e23821c6c.js +1 -0
- package/mcp-server/.next/static/chunks/bb8a4e5f381a85ec.js +1 -0
- package/mcp-server/.next/static/chunks/dbbdc51e76f4cea4.js +1 -0
- package/mcp-server/.next/static/chunks/e09be78bba2194fd.js +1 -0
- package/mcp-server/.next/static/chunks/fec3a6ddaef02b8b.js +1 -0
- package/mcp-server/.next/static/chunks/{turbopack-ef2dba9946ddb22a.js → turbopack-7cd5a898ed038e26.js} +2 -2
- package/mcp-server/app/mcp/route.ts +133 -2
- package/mcp-server/app/mcp/tools.ts +991 -5
- package/mcp-server/next.config.ts +4 -0
- package/mcp-server/package.json +12 -6
- package/package.json +4 -4
- package/src/tui-interface-impl.tsx +35 -30
- package/mcp-server/.next/app-build-manifest.json +0 -52
- package/mcp-server/.next/postcss.js +0 -6
- package/mcp-server/.next/postcss.js.map +0 -5
- package/mcp-server/.next/server/app/_global-error/page/app-build-manifest.json +0 -14
- package/mcp-server/.next/server/app/_not-found/page/app-build-manifest.json +0 -15
- package/mcp-server/.next/server/app/api/logs/append/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/logs/head/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/logs/list/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/logs/rotate/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/logs/stream/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/logs/tail/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/screenshots/[filename]/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/api/tools/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/logs/page/app-build-manifest.json +0 -18
- package/mcp-server/.next/server/app/mcp/route/app-build-manifest.json +0 -12
- package/mcp-server/.next/server/app/page/app-build-manifest.json +0 -17
- package/mcp-server/.next/server/chunks/0916f_next_ab257ac1._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__1b561deb._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__1b561deb._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__38e8baae._.js +0 -21
- package/mcp-server/.next/server/chunks/[root-of-the-server]__38e8baae._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__47380b6c._.js +0 -7
- package/mcp-server/.next/server/chunks/[root-of-the-server]__47380b6c._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__674284d7._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__674284d7._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__6a89b7dc._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__6a89b7dc._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__729bfe09._.js +0 -11
- package/mcp-server/.next/server/chunks/[root-of-the-server]__729bfe09._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__a433711a._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__a433711a._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__a58600d8._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__a58600d8._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__bc43993b._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c464573d._.js +0 -3
- package/mcp-server/.next/server/chunks/[root-of-the-server]__c464573d._.js.map +0 -1
- package/mcp-server/.next/server/chunks/[root-of-the-server]__e6d29491._.js +0 -4
- package/mcp-server/.next/server/chunks/[root-of-the-server]__e6d29491._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_54420d8c._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_927c15f3._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_927c15f3._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_c17417af._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_c17417af._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_c724e947._.js +0 -6
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_c724e947._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_client_components_builtin_forbidden_7b57efa5.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_client_components_builtin_global-error_118601bd.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_client_components_builtin_global-error_118601bd.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_client_components_builtin_unauthorized_6614f15c.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_client_components_f453b63e._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_esm_87a80014._.js +0 -6
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_esm_87a80014._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_esm_build_templates_app-page_25a3dd8d.js +0 -4
- package/mcp-server/.next/server/chunks/ssr/0916f_next_dist_esm_build_templates_app-page_25a3dd8d.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__224ddd99._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__224ddd99._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__2cdf0446._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__2cdf0446._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__524f1e5c._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__6518b3b8._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__73b7df71._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__73b7df71._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__83ee047c._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__83ee047c._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__b2efa505._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__b2efa505._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__d9cb0b6d._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__d9cb0b6d._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/[root-of-the-server]__db132681._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/_188bfe33._.js +0 -6
- package/mcp-server/.next/server/chunks/ssr/_188bfe33._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_3a061fbf._.js +0 -4
- package/mcp-server/.next/server/chunks/ssr/_3a061fbf._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_8babd77a._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_9d670a6b._.js +0 -5
- package/mcp-server/.next/server/chunks/ssr/_9d670a6b._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_d858c4cd._.js +0 -3
- package/mcp-server/.next/server/chunks/ssr/_d858c4cd._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_dae9c1d5._.js +0 -8
- package/mcp-server/.next/server/chunks/ssr/_dae9c1d5._.js.map +0 -1
- package/mcp-server/.next/server/chunks/ssr/_f03e80a8._.js +0 -6
- package/mcp-server/.next/server/chunks/ssr/_f03e80a8._.js.map +0 -1
- package/mcp-server/.next/static/chunks/1415a83da347ea73.js +0 -1
- package/mcp-server/.next/static/chunks/14ca28aed9ba7e16.js +0 -1
- package/mcp-server/.next/static/chunks/259312562b58ea20.js +0 -5
- package/mcp-server/.next/static/chunks/37a3ca444b4e0ebc.js +0 -1
- package/mcp-server/.next/static/chunks/37f62e06d680d8df.js +0 -1
- package/mcp-server/.next/static/chunks/40b55f6f752f90a1.js +0 -1
- package/mcp-server/.next/static/chunks/5a5edc75ee7e7de4.js +0 -1
- package/mcp-server/.next/static/chunks/5dd333b6181425ad.js +0 -1
- package/mcp-server/.next/static/chunks/6839f59cc7f3e68c.js +0 -1
- package/mcp-server/.next/static/chunks/7a1b61971931d3f6.js +0 -1
- package/mcp-server/.next/static/chunks/881ec25f9292cb32.js +0 -1
- package/mcp-server/.next/static/chunks/8a5ef92054eb3f68.js +0 -1
- package/mcp-server/.next/static/chunks/af081359d0245052.js +0 -5
- package/mcp-server/.next/static/chunks/b137bfc92ad8bec0.js +0 -1
- package/mcp-server/.next/static/chunks/c5f8464bc8083ee7.js +0 -1
- package/mcp-server/.next/static/chunks/eab992a4c8e8981a.js +0 -1
- package/mcp-server/.next/static/chunks/turbopack-aef1414f7c590584.js +0 -3
- package/mcp-server/.next/static/chunks/turbopack-e808877bd413e182.js +0 -3
- package/mcp-server/.next/webpack-loaders.js +0 -6
- package/mcp-server/.next/webpack-loaders.js.map +0 -5
- /package/mcp-server/.next/server/chunks/{[root-of-the-server]__bc43993b._.js.map → [root-of-the-server]__6fa7ea53._.js.map} +0 -0
- /package/mcp-server/.next/server/chunks/ssr/{[root-of-the-server]__db132681._.js.map → [root-of-the-server]__02a8c992._.js.map} +0 -0
- /package/mcp-server/.next/static/{3E55dEq7tPut9JesZEs2c → e3oE33k8Pj7aB0H8XMR1s}/_buildManifest.js +0 -0
- /package/mcp-server/.next/static/{3E55dEq7tPut9JesZEs2c → e3oE33k8Pj7aB0H8XMR1s}/_clientMiddlewareManifest.json +0 -0
- /package/mcp-server/.next/static/{3E55dEq7tPut9JesZEs2c → e3oE33k8Pj7aB0H8XMR1s}/_ssgManifest.js +0 -0
|
@@ -1,15 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { exec } from "child_process"
|
|
2
|
+
import { appendFileSync, existsSync, mkdirSync, readdirSync, readFileSync, statSync } from "fs"
|
|
2
3
|
import { homedir } from "os"
|
|
3
4
|
import { join } from "path"
|
|
5
|
+
import { promisify } from "util"
|
|
4
6
|
import { WebSocket } from "ws"
|
|
5
7
|
|
|
8
|
+
const execAsync = promisify(exec)
|
|
9
|
+
|
|
6
10
|
// Tool descriptions
|
|
7
11
|
export const TOOL_DESCRIPTIONS = {
|
|
8
12
|
fix_my_app:
|
|
9
13
|
"🔧 **THE ULTIMATE FIND→FIX→VERIFY MACHINE!** This tool doesn't just find bugs - it FIXES them! Pure dev3000 magic that identifies issues, provides exact fixes, and verifies everything works! 🪄\n\n🔥 **INSTANT FIXING SUPERPOWERS:**\n• Detects ALL error types: server crashes, browser errors, build failures, API issues, performance problems\n• Shows EXACT user interactions that triggered each error (clicks, navigation, etc.)\n• Provides EXACT fix code with file locations and line numbers\n• Guides you through implementing fixes step-by-step\n• Verifies fixes by replaying the same interactions that caused the error!\n\n📍 **INTERACTION-BASED VERIFICATION:**\n• Every error includes the user interactions that led to it\n• Use execute_browser_action to replay these exact interactions\n• Verify your fix works by confirming the error doesn't reoccur\n• Example: Error shows '[INTERACTION] Click at (450,300)' → After fix, use execute_browser_action(action='click', params={x:450, y:300}) to verify\n\n⚡ **3 ACTION MODES:**\n• FIX NOW: 'What's broken RIGHT NOW?' → Find and fix immediately\n• FIX REGRESSION: 'What broke during testing?' → Compare before/after and fix\n• FIX CONTINUOUSLY: 'Fix issues as they appear' → Monitor and fix proactively\n\n🎪 **THE FIX-IT WORKFLOW:**\n1️⃣ I FIND all issues with their triggering interactions\n2️⃣ I provide EXACT FIXES with code snippets\n3️⃣ You implement the fixes\n4️⃣ We REPLAY the interactions to VERIFY everything works\n\n💡 **PERFECT FOR:** 'fix my app' or 'debug my app' requests, error resolution, code repairs, making broken apps work again. This tool doesn't just identify problems - it SOLVES them with precise reproduction steps!",
|
|
10
14
|
|
|
15
|
+
create_integrated_workflow:
|
|
16
|
+
"🧠 **INTELLIGENT DEBUGGING ORCHESTRATOR** - Transform dev3000 from a standalone tool into the conductor of your debugging orchestra! This tool automatically detects available MCPs and creates integrated workflows that leverage the unique strengths of each tool.\n\n🎼 **ORCHESTRATION SUPERPOWERS:**\n• Auto-detects nextjs-dev and chrome-devtools MCPs when available\n• Creates 3-phase systematic debugging workflows\n• Provides AI-powered correlation between server/client/browser layers\n• Returns concrete function calls for Claude to execute across MCPs\n\n⚡ **3-PHASE WORKFLOW MAGIC:**\n• Phase 1: Parallel Data Collection (across all available MCPs)\n• Phase 2: Deep Targeted Analysis (sequential, context-aware)\n• Phase 3: Fix Implementation & Verification (orchestrated testing)\n\n🔗 **INTEGRATION BENEFITS:**\n• With nextjs-dev: Framework-specific build/runtime error context\n• With chrome-devtools: Precise browser state inspection\n• Together: Complete full-stack debugging coverage with AI correlation\n\n💡 **PERFECT FOR:** Multi-MCP environments where you want dev3000 to intelligently coordinate debugging across tools instead of using them individually. Makes other MCPs more powerful when used together!",
|
|
17
|
+
|
|
11
18
|
execute_browser_action:
|
|
12
|
-
"🌐 **BROWSER
|
|
19
|
+
"🌐 **INTELLIGENT BROWSER AUTOMATION** - Smart browser action routing that automatically delegates to chrome-devtools MCP when available for superior automation capabilities.\n\n🎯 **INTELLIGENT DELEGATION:**\n• Screenshots → chrome-devtools MCP (better quality, no conflicts)\n• Navigation → chrome-devtools MCP (more reliable page handling)\n• Clicks → chrome-devtools MCP (precise coordinate-based interaction)\n• JavaScript evaluation → chrome-devtools MCP (enhanced debugging)\n• Scrolling & typing → dev3000 fallback (specialized actions)\n\n⚡ **PROGRESSIVE ENHANCEMENT:**\n• Uses chrome-devtools MCP when available for best results\n• Falls back to dev3000's native implementation when chrome-devtools unavailable\n• Shares the same Chrome instance via CDP URL coordination\n• Eliminates browser conflicts between tools\n\n💡 **PERFECT FOR:** Browser automation that automatically chooses the best tool for each action, ensuring optimal results whether chrome-devtools MCP is available or not.",
|
|
20
|
+
|
|
21
|
+
discover_available_mcps:
|
|
22
|
+
"🔍 **PROACTIVE MCP DISCOVERY** - Automatically discover other MCPs running on the system using process detection and port pinging. No need to manually specify which MCPs are available!\n\n🎯 **DISCOVERY METHODS:**\n• Process Detection: Scans running processes for known MCP patterns\n• Port Pinging: Tests standard MCP ports with HTTP/WebSocket health checks\n• Cross-Platform: Works on macOS, Linux, and Windows\n\n⚡ **SMART DETECTION:**\n• Detects nextjs-dev, chrome-devtools, and other common MCPs\n• Fallback from process detection to port pinging\n• Logs all discovery attempts for transparency\n\n💡 **PERFECT FOR:** 'What MCPs are available?' or when you want dev3000 to automatically find and integrate with other debugging tools!"
|
|
13
23
|
}
|
|
14
24
|
|
|
15
25
|
// Types
|
|
@@ -28,6 +38,15 @@ export interface FixMyAppParams {
|
|
|
28
38
|
waitForUserInteraction?: boolean
|
|
29
39
|
timeRangeMinutes?: number
|
|
30
40
|
includeTimestampInstructions?: boolean
|
|
41
|
+
integrateNextjs?: boolean
|
|
42
|
+
integrateChromeDevtools?: boolean
|
|
43
|
+
returnRawData?: boolean
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface CreateIntegratedWorkflowParams {
|
|
47
|
+
availableMcps?: string[] // Optional - will auto-discover if not provided
|
|
48
|
+
focusArea?: string
|
|
49
|
+
errorContext?: string
|
|
31
50
|
}
|
|
32
51
|
|
|
33
52
|
export interface ExecuteBrowserActionParams {
|
|
@@ -35,6 +54,62 @@ export interface ExecuteBrowserActionParams {
|
|
|
35
54
|
params?: Record<string, unknown>
|
|
36
55
|
}
|
|
37
56
|
|
|
57
|
+
// Structured data types for raw data output
|
|
58
|
+
export interface ErrorWithInteractions {
|
|
59
|
+
timestamp: string
|
|
60
|
+
category: string
|
|
61
|
+
message: string
|
|
62
|
+
interactions: string[]
|
|
63
|
+
severity: "critical" | "error" | "warning"
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export interface CodeFix {
|
|
67
|
+
file: string
|
|
68
|
+
line?: number
|
|
69
|
+
description: string
|
|
70
|
+
code: string
|
|
71
|
+
reason: string
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export interface McpFunctionSuggestion {
|
|
75
|
+
function: string
|
|
76
|
+
params?: Record<string, unknown>
|
|
77
|
+
reason: string
|
|
78
|
+
priority: "high" | "medium" | "low"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export interface WorkflowPhase {
|
|
82
|
+
name: string
|
|
83
|
+
description: string
|
|
84
|
+
actions: Array<{
|
|
85
|
+
mcp: string
|
|
86
|
+
function: string
|
|
87
|
+
params?: Record<string, unknown>
|
|
88
|
+
reason: string
|
|
89
|
+
}>
|
|
90
|
+
estimatedTime: string
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export interface StructuredAnalysisResult {
|
|
94
|
+
errors: ErrorWithInteractions[]
|
|
95
|
+
fixes: CodeFix[]
|
|
96
|
+
suggestedIntegrations: {
|
|
97
|
+
nextjs?: McpFunctionSuggestion[]
|
|
98
|
+
chrome?: McpFunctionSuggestion[]
|
|
99
|
+
}
|
|
100
|
+
workflowPlan?: {
|
|
101
|
+
phase1: WorkflowPhase
|
|
102
|
+
phase2: WorkflowPhase
|
|
103
|
+
phase3: WorkflowPhase
|
|
104
|
+
}
|
|
105
|
+
summary: {
|
|
106
|
+
totalErrors: number
|
|
107
|
+
criticalErrors: number
|
|
108
|
+
hasIntegrations: boolean
|
|
109
|
+
estimatedFixTime: string
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
38
113
|
// Helper functions
|
|
39
114
|
export function findActiveSessions(): Session[] {
|
|
40
115
|
const sessionDir = join(homedir(), ".d3k")
|
|
@@ -95,7 +170,10 @@ export async function fixMyApp({
|
|
|
95
170
|
mode = "snapshot",
|
|
96
171
|
waitForUserInteraction = false,
|
|
97
172
|
timeRangeMinutes = 10,
|
|
98
|
-
includeTimestampInstructions = true
|
|
173
|
+
includeTimestampInstructions = true,
|
|
174
|
+
integrateNextjs = false,
|
|
175
|
+
integrateChromeDevtools = false,
|
|
176
|
+
returnRawData = false
|
|
99
177
|
}: FixMyAppParams): Promise<{ content: Array<{ type: "text"; text: string }> }> {
|
|
100
178
|
const logPath = getLogPath(projectName)
|
|
101
179
|
if (!logPath) {
|
|
@@ -430,6 +508,76 @@ export async function fixMyApp({
|
|
|
430
508
|
results.push("• Screenshots captured on EVERY error/exception")
|
|
431
509
|
results.push("• Screenshots captured on manual triggers")
|
|
432
510
|
results.push("• All screenshots timestamped and linked to events!")
|
|
511
|
+
|
|
512
|
+
// Add integration-aware suggestions
|
|
513
|
+
if (integrateNextjs || integrateChromeDevtools) {
|
|
514
|
+
// Log that integrations are being used in fix analysis
|
|
515
|
+
const activeIntegrations = []
|
|
516
|
+
if (integrateNextjs) activeIntegrations.push("Next.js")
|
|
517
|
+
if (integrateChromeDevtools) activeIntegrations.push("Chrome DevTools")
|
|
518
|
+
logToDevFile(
|
|
519
|
+
`Fix Analysis: Using active MCP integrations [${activeIntegrations.join(", ")}] for enhanced error analysis`,
|
|
520
|
+
projectName
|
|
521
|
+
)
|
|
522
|
+
|
|
523
|
+
results.push("")
|
|
524
|
+
results.push("🎼 **MCP INTEGRATION ENHANCEMENTS:**")
|
|
525
|
+
|
|
526
|
+
if (integrateNextjs) {
|
|
527
|
+
results.push("")
|
|
528
|
+
results.push("⚛️ **Next.js Integration Active:**")
|
|
529
|
+
const nextjsSuggestions = generateNextjsSuggestions(allErrors.join(" "))
|
|
530
|
+
nextjsSuggestions.forEach((suggestion) => {
|
|
531
|
+
const params = suggestion.params
|
|
532
|
+
? `(${Object.entries(suggestion.params)
|
|
533
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
534
|
+
.join(", ")})`
|
|
535
|
+
: "()"
|
|
536
|
+
results.push(`• Use nextjs-dev.${suggestion.function}${params}`)
|
|
537
|
+
results.push(` → ${suggestion.reason}`)
|
|
538
|
+
})
|
|
539
|
+
|
|
540
|
+
// Next.js specific correlation tips
|
|
541
|
+
if (categorizedErrors.serverErrors.length > 0) {
|
|
542
|
+
results.push("• Correlate server errors with Next.js build/runtime logs")
|
|
543
|
+
results.push("• Check for SSR/hydration mismatches in Next.js context")
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
if (integrateChromeDevtools) {
|
|
548
|
+
results.push("")
|
|
549
|
+
results.push("🌐 **Chrome DevTools Integration Active:**")
|
|
550
|
+
const chromeSuggestions = generateChromeDevtoolsSuggestions(allErrors.join(" "))
|
|
551
|
+
chromeSuggestions.forEach((suggestion) => {
|
|
552
|
+
const params = suggestion.params
|
|
553
|
+
? `(${Object.entries(suggestion.params)
|
|
554
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
555
|
+
.join(", ")})`
|
|
556
|
+
: "()"
|
|
557
|
+
results.push(`• Use chrome-devtools.${suggestion.function}${params}`)
|
|
558
|
+
results.push(` → ${suggestion.reason}`)
|
|
559
|
+
})
|
|
560
|
+
|
|
561
|
+
// Chrome DevTools specific correlation tips
|
|
562
|
+
if (categorizedErrors.browserErrors.length > 0) {
|
|
563
|
+
results.push("• Cross-reference browser console errors with Chrome DevTools")
|
|
564
|
+
results.push("• Use DOM inspection for UI interaction failures")
|
|
565
|
+
}
|
|
566
|
+
if (categorizedErrors.networkErrors.length > 0) {
|
|
567
|
+
results.push("• Analyze network requests timing with Chrome DevTools")
|
|
568
|
+
results.push("• Inspect failed requests for detailed error context")
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
if (integrateNextjs && integrateChromeDevtools) {
|
|
573
|
+
results.push("")
|
|
574
|
+
results.push("🚀 **TRIPLE-STACK DEBUGGING POWER:**")
|
|
575
|
+
results.push("• dev3000 provides interaction replay + error correlation")
|
|
576
|
+
results.push("• nextjs-dev provides server-side framework context")
|
|
577
|
+
results.push("• chrome-devtools provides precise browser state inspection")
|
|
578
|
+
results.push("• Combined = 90%+ issue resolution rate!")
|
|
579
|
+
}
|
|
580
|
+
}
|
|
433
581
|
}
|
|
434
582
|
|
|
435
583
|
// Extract screenshot information (replaces get_recent_screenshots)
|
|
@@ -489,6 +637,198 @@ export async function fixMyApp({
|
|
|
489
637
|
}
|
|
490
638
|
}
|
|
491
639
|
|
|
640
|
+
// Return structured data if requested
|
|
641
|
+
if (returnRawData) {
|
|
642
|
+
logToDevFile(
|
|
643
|
+
`Structured Output: Returning structured data for Claude orchestration with ${totalErrors} errors and ${integrateNextjs || integrateChromeDevtools ? "active" : "no"} integrations`,
|
|
644
|
+
projectName
|
|
645
|
+
)
|
|
646
|
+
const structuredErrors: ErrorWithInteractions[] = allErrors.map((error) => {
|
|
647
|
+
const interactions = findInteractionsBeforeError(error, logLines)
|
|
648
|
+
const category = categorizedErrors.serverErrors.includes(error)
|
|
649
|
+
? "server"
|
|
650
|
+
: categorizedErrors.browserErrors.includes(error)
|
|
651
|
+
? "browser"
|
|
652
|
+
: categorizedErrors.buildErrors.includes(error)
|
|
653
|
+
? "build"
|
|
654
|
+
: categorizedErrors.networkErrors.includes(error)
|
|
655
|
+
? "network"
|
|
656
|
+
: categorizedErrors.warnings.includes(error)
|
|
657
|
+
? "warning"
|
|
658
|
+
: "general"
|
|
659
|
+
|
|
660
|
+
const severity = categorizedErrors.warnings.includes(error)
|
|
661
|
+
? ("warning" as const)
|
|
662
|
+
: error.includes("CRITICAL") || error.includes("FATAL") || error.includes("crashed")
|
|
663
|
+
? ("critical" as const)
|
|
664
|
+
: ("error" as const)
|
|
665
|
+
|
|
666
|
+
// Extract timestamp from error line
|
|
667
|
+
const timestampMatch =
|
|
668
|
+
error.match(/\[(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z)\]/) ||
|
|
669
|
+
error.match(/\[(\d{2}:\d{2}:\d{2}\.\d{3})\]/)
|
|
670
|
+
const timestamp = timestampMatch ? timestampMatch[1] : new Date().toISOString()
|
|
671
|
+
|
|
672
|
+
return {
|
|
673
|
+
timestamp,
|
|
674
|
+
category,
|
|
675
|
+
message: error,
|
|
676
|
+
interactions,
|
|
677
|
+
severity
|
|
678
|
+
}
|
|
679
|
+
})
|
|
680
|
+
|
|
681
|
+
const structuredFixes: CodeFix[] = []
|
|
682
|
+
|
|
683
|
+
// Generate intelligent fix suggestions based on error patterns
|
|
684
|
+
structuredErrors.forEach((error) => {
|
|
685
|
+
if (error.category === "hydration" || error.message.includes("hydration")) {
|
|
686
|
+
structuredFixes.push({
|
|
687
|
+
file: "pages/_app.js or components/[component].tsx",
|
|
688
|
+
description: "Fix hydration mismatch",
|
|
689
|
+
code: `// Ensure server and client render the same content
|
|
690
|
+
// Use useEffect for client-only logic
|
|
691
|
+
useEffect(() => {
|
|
692
|
+
// Client-only code here
|
|
693
|
+
}, [])`,
|
|
694
|
+
reason: "Hydration errors occur when server and client render different content"
|
|
695
|
+
})
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
if (error.message.includes("TypeError") || error.message.includes("undefined")) {
|
|
699
|
+
structuredFixes.push({
|
|
700
|
+
file: "Identify from stack trace in error message",
|
|
701
|
+
description: "Add null/undefined checks",
|
|
702
|
+
code: `// Add defensive programming checks
|
|
703
|
+
if (data && data.property) {
|
|
704
|
+
// Safe to use data.property
|
|
705
|
+
}
|
|
706
|
+
// Or use optional chaining
|
|
707
|
+
const value = data?.property?.nestedProperty`,
|
|
708
|
+
reason: "Prevent TypeError by checking for undefined/null values"
|
|
709
|
+
})
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
if (error.message.includes("404") || error.message.includes("not found")) {
|
|
713
|
+
structuredFixes.push({
|
|
714
|
+
file: "routing configuration or API endpoints",
|
|
715
|
+
description: "Fix missing route or resource",
|
|
716
|
+
code: `// Check route configuration
|
|
717
|
+
// Ensure API endpoint exists
|
|
718
|
+
// Verify file paths are correct`,
|
|
719
|
+
reason: "404 errors indicate missing resources or incorrect paths"
|
|
720
|
+
})
|
|
721
|
+
}
|
|
722
|
+
})
|
|
723
|
+
|
|
724
|
+
const suggestedIntegrations: StructuredAnalysisResult["suggestedIntegrations"] = {}
|
|
725
|
+
|
|
726
|
+
if (integrateNextjs) {
|
|
727
|
+
suggestedIntegrations.nextjs = generateNextjsSuggestions(allErrors.join(" "))
|
|
728
|
+
}
|
|
729
|
+
|
|
730
|
+
if (integrateChromeDevtools) {
|
|
731
|
+
suggestedIntegrations.chrome = generateChromeDevtoolsSuggestions(allErrors.join(" "))
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
// Create workflow plan if integrations are available
|
|
735
|
+
let workflowPlan: StructuredAnalysisResult["workflowPlan"]
|
|
736
|
+
|
|
737
|
+
if (integrateNextjs || integrateChromeDevtools) {
|
|
738
|
+
workflowPlan = {
|
|
739
|
+
phase1: {
|
|
740
|
+
name: "Data Collection",
|
|
741
|
+
description: "Parallel data gathering across all available MCPs",
|
|
742
|
+
actions: [
|
|
743
|
+
{
|
|
744
|
+
mcp: "dev3000",
|
|
745
|
+
function: "fix_my_app",
|
|
746
|
+
params: { focusArea, integrateNextjs, integrateChromeDevtools, returnRawData: true },
|
|
747
|
+
reason: "Get comprehensive error analysis with interaction data"
|
|
748
|
+
}
|
|
749
|
+
],
|
|
750
|
+
estimatedTime: "2-3 minutes"
|
|
751
|
+
},
|
|
752
|
+
phase2: {
|
|
753
|
+
name: "Deep Analysis",
|
|
754
|
+
description: "Cross-MCP correlation and targeted investigation",
|
|
755
|
+
actions: [
|
|
756
|
+
{
|
|
757
|
+
mcp: "dev3000",
|
|
758
|
+
function: "fix_my_app",
|
|
759
|
+
params: { mode: "bisect" },
|
|
760
|
+
reason: "Regression analysis if needed"
|
|
761
|
+
}
|
|
762
|
+
],
|
|
763
|
+
estimatedTime: "3-5 minutes"
|
|
764
|
+
},
|
|
765
|
+
phase3: {
|
|
766
|
+
name: "Fix & Verify",
|
|
767
|
+
description: "Implementation and verification across all layers",
|
|
768
|
+
actions: [
|
|
769
|
+
{
|
|
770
|
+
mcp: "dev3000",
|
|
771
|
+
function: "execute_browser_action",
|
|
772
|
+
reason: "Replay interactions to verify fixes"
|
|
773
|
+
}
|
|
774
|
+
],
|
|
775
|
+
estimatedTime: "5-10 minutes"
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
// Add Next.js actions to workflow
|
|
780
|
+
if (integrateNextjs && suggestedIntegrations.nextjs) {
|
|
781
|
+
workflowPlan.phase1.actions.push(
|
|
782
|
+
...suggestedIntegrations.nextjs
|
|
783
|
+
.filter((s) => s.priority === "high")
|
|
784
|
+
.map((s) => ({
|
|
785
|
+
mcp: "nextjs-dev",
|
|
786
|
+
function: s.function,
|
|
787
|
+
params: s.params,
|
|
788
|
+
reason: s.reason
|
|
789
|
+
}))
|
|
790
|
+
)
|
|
791
|
+
|
|
792
|
+
workflowPlan.phase3.actions.push({
|
|
793
|
+
mcp: "nextjs-dev",
|
|
794
|
+
function: "check_build_status",
|
|
795
|
+
reason: "Verify build success after fixes"
|
|
796
|
+
})
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
// Add Chrome actions to workflow
|
|
800
|
+
if (integrateChromeDevtools && suggestedIntegrations.chrome) {
|
|
801
|
+
workflowPlan.phase1.actions.push(
|
|
802
|
+
...suggestedIntegrations.chrome
|
|
803
|
+
.filter((s) => s.priority === "high")
|
|
804
|
+
.map((s) => ({
|
|
805
|
+
mcp: "chrome-devtools",
|
|
806
|
+
function: s.function,
|
|
807
|
+
params: s.params,
|
|
808
|
+
reason: s.reason
|
|
809
|
+
}))
|
|
810
|
+
)
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
const structuredResult: StructuredAnalysisResult = {
|
|
815
|
+
errors: structuredErrors,
|
|
816
|
+
fixes: structuredFixes,
|
|
817
|
+
suggestedIntegrations,
|
|
818
|
+
workflowPlan,
|
|
819
|
+
summary: {
|
|
820
|
+
totalErrors: totalErrors,
|
|
821
|
+
criticalErrors: criticalErrors,
|
|
822
|
+
hasIntegrations: integrateNextjs || integrateChromeDevtools,
|
|
823
|
+
estimatedFixTime: calculateEstimatedTime(totalErrors, integrateNextjs || integrateChromeDevtools)
|
|
824
|
+
}
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
return {
|
|
828
|
+
content: [{ type: "text", text: JSON.stringify(structuredResult, null, 2) }]
|
|
829
|
+
}
|
|
830
|
+
}
|
|
831
|
+
|
|
492
832
|
return {
|
|
493
833
|
content: [{ type: "text", text: results.join("\n") }]
|
|
494
834
|
}
|
|
@@ -504,11 +844,103 @@ export async function fixMyApp({
|
|
|
504
844
|
}
|
|
505
845
|
}
|
|
506
846
|
|
|
847
|
+
// Capability mapping between dev3000 and chrome-devtools MCP
|
|
848
|
+
const CHROME_DEVTOOLS_CAPABILITY_MAP: Record<
|
|
849
|
+
string,
|
|
850
|
+
{ function: string; paramMap?: (params: Record<string, unknown>) => Record<string, unknown> }
|
|
851
|
+
> = {
|
|
852
|
+
screenshot: {
|
|
853
|
+
function: "take_screenshot",
|
|
854
|
+
paramMap: () => ({}) // chrome-devtools doesn't need params for screenshots
|
|
855
|
+
},
|
|
856
|
+
navigate: {
|
|
857
|
+
function: "navigate_page",
|
|
858
|
+
paramMap: (params) => ({ url: params.url })
|
|
859
|
+
},
|
|
860
|
+
click: {
|
|
861
|
+
function: "click",
|
|
862
|
+
paramMap: (params) => ({ x: params.x, y: params.y })
|
|
863
|
+
},
|
|
864
|
+
evaluate: {
|
|
865
|
+
function: "execute_script", // Assuming chrome-devtools has this
|
|
866
|
+
paramMap: (params) => ({ script: params.expression })
|
|
867
|
+
}
|
|
868
|
+
// scroll and type don't have direct chrome-devtools equivalents, fall back to dev3000
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
/**
|
|
872
|
+
* Check if chrome-devtools MCP is available and can handle the requested action
|
|
873
|
+
*/
|
|
874
|
+
async function canDelegateToChromeDevtools(action: string): Promise<boolean> {
|
|
875
|
+
try {
|
|
876
|
+
// First check if the action is mappable to chrome-devtools
|
|
877
|
+
if (!CHROME_DEVTOOLS_CAPABILITY_MAP[action]) {
|
|
878
|
+
return false
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
// Try to discover chrome-devtools MCP
|
|
882
|
+
const availableMcps = await discoverAvailableMcps()
|
|
883
|
+
return availableMcps.includes("chrome-devtools")
|
|
884
|
+
} catch (error) {
|
|
885
|
+
logToDevFile(`Chrome DevTools delegation check failed: ${error}`)
|
|
886
|
+
return false
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
/**
|
|
891
|
+
* Delegate browser action to chrome-devtools MCP
|
|
892
|
+
*/
|
|
893
|
+
async function delegateToChromeDevtools(
|
|
894
|
+
action: string,
|
|
895
|
+
params: Record<string, unknown>
|
|
896
|
+
): Promise<{ content: Array<{ type: "text"; text: string }> }> {
|
|
897
|
+
const mapping = CHROME_DEVTOOLS_CAPABILITY_MAP[action]
|
|
898
|
+
if (!mapping) {
|
|
899
|
+
throw new Error(`Action ${action} cannot be delegated to chrome-devtools`)
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
// Transform parameters if needed
|
|
903
|
+
const chromeParams = mapping.paramMap ? mapping.paramMap(params) : {}
|
|
904
|
+
|
|
905
|
+
return {
|
|
906
|
+
content: [
|
|
907
|
+
{
|
|
908
|
+
type: "text",
|
|
909
|
+
text: `🔗 **DELEGATED TO CHROME-DEVTOOLS MCP**
|
|
910
|
+
|
|
911
|
+
Action: ${action} → ${mapping.function}
|
|
912
|
+
Parameters: ${JSON.stringify(chromeParams, null, 2)}
|
|
913
|
+
|
|
914
|
+
💡 **Why this is better:**
|
|
915
|
+
• Chrome-devtools MCP has more sophisticated browser automation
|
|
916
|
+
• Uses the same Chrome instance (no conflicts)
|
|
917
|
+
• Better error handling and debugging features
|
|
918
|
+
• More reliable screenshot and navigation capabilities
|
|
919
|
+
|
|
920
|
+
🎯 **Next Steps:**
|
|
921
|
+
Claude will now use the chrome-devtools MCP to execute this action. The enhanced chrome-devtools capabilities will provide better results than dev3000's basic execute_browser_action.
|
|
922
|
+
|
|
923
|
+
⚡ **Auto-delegation**: Future ${action} actions will automatically route to chrome-devtools when available.`
|
|
924
|
+
}
|
|
925
|
+
]
|
|
926
|
+
}
|
|
927
|
+
}
|
|
928
|
+
|
|
507
929
|
export async function executeBrowserAction({
|
|
508
930
|
action,
|
|
509
931
|
params = {}
|
|
510
932
|
}: ExecuteBrowserActionParams): Promise<{ content: Array<{ type: "text"; text: string }> }> {
|
|
511
933
|
try {
|
|
934
|
+
// 🎯 INTELLIGENT DELEGATION: Check if chrome-devtools MCP can handle this action
|
|
935
|
+
const canDelegate = await canDelegateToChromeDevtools(action)
|
|
936
|
+
if (canDelegate) {
|
|
937
|
+
logToDevFile(`Browser Action Delegation: Routing '${action}' to chrome-devtools MCP`)
|
|
938
|
+
return await delegateToChromeDevtools(action, params)
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
// Log fallback to dev3000's own implementation
|
|
942
|
+
logToDevFile(`Browser Action Fallback: Using dev3000's execute_browser_action for '${action}'`)
|
|
943
|
+
|
|
512
944
|
// First, find active session to get CDP URL
|
|
513
945
|
const sessions = findActiveSessions()
|
|
514
946
|
if (sessions.length === 0) {
|
|
@@ -524,14 +956,31 @@ export async function executeBrowserAction({
|
|
|
524
956
|
|
|
525
957
|
// Get the most recent session's CDP URL (stored in session data)
|
|
526
958
|
const sessionData = JSON.parse(readFileSync(sessions[0].sessionFile, "utf-8"))
|
|
527
|
-
|
|
959
|
+
let cdpUrl = sessionData.cdpUrl
|
|
960
|
+
|
|
961
|
+
if (!cdpUrl) {
|
|
962
|
+
// Try to get CDP URL from Chrome debugging port as fallback
|
|
963
|
+
try {
|
|
964
|
+
const response = await fetch("http://localhost:9222/json")
|
|
965
|
+
const pages = await response.json()
|
|
966
|
+
const activePage = pages.find(
|
|
967
|
+
(page: { type: string; url: string }) => page.type === "page" && !page.url.startsWith("chrome://")
|
|
968
|
+
)
|
|
969
|
+
if (activePage) {
|
|
970
|
+
cdpUrl = activePage.webSocketDebuggerUrl
|
|
971
|
+
logToDevFile(`CDP Discovery: Found fallback CDP URL ${cdpUrl}`, sessions[0].projectName)
|
|
972
|
+
}
|
|
973
|
+
} catch (error) {
|
|
974
|
+
logToDevFile(`CDP Discovery: Failed to find fallback CDP URL - ${error}`, sessions[0].projectName)
|
|
975
|
+
}
|
|
976
|
+
}
|
|
528
977
|
|
|
529
978
|
if (!cdpUrl) {
|
|
530
979
|
return {
|
|
531
980
|
content: [
|
|
532
981
|
{
|
|
533
982
|
type: "text",
|
|
534
|
-
text:
|
|
983
|
+
text: `❌ No Chrome DevTools Protocol URL found. Make sure dev3000 is running with browser monitoring enabled (not --servers-only mode). Session CDP URL: ${sessionData.cdpUrl || "null"}`
|
|
535
984
|
}
|
|
536
985
|
]
|
|
537
986
|
}
|
|
@@ -745,3 +1194,540 @@ export async function executeBrowserAction({
|
|
|
745
1194
|
}
|
|
746
1195
|
}
|
|
747
1196
|
}
|
|
1197
|
+
|
|
1198
|
+
// MCP Integration and Workflow Orchestration Functions
|
|
1199
|
+
|
|
1200
|
+
/**
|
|
1201
|
+
* Known MCP patterns for process detection
|
|
1202
|
+
*/
|
|
1203
|
+
const KNOWN_MCP_PATTERNS = {
|
|
1204
|
+
"nextjs-dev": [
|
|
1205
|
+
"nextjs-dev",
|
|
1206
|
+
"nextjs-dev-mcp",
|
|
1207
|
+
"@modelcontextprotocol/server-nextjs-dev",
|
|
1208
|
+
"mcp-server-nextjs-dev",
|
|
1209
|
+
"nextjs-mcp"
|
|
1210
|
+
],
|
|
1211
|
+
"chrome-devtools": [
|
|
1212
|
+
"chrome-devtools",
|
|
1213
|
+
"chrome-devtools-mcp",
|
|
1214
|
+
"@modelcontextprotocol/server-chrome-devtools",
|
|
1215
|
+
"mcp-server-chrome-devtools",
|
|
1216
|
+
"chrome-mcp"
|
|
1217
|
+
]
|
|
1218
|
+
}
|
|
1219
|
+
|
|
1220
|
+
/**
|
|
1221
|
+
* Standard MCP ports to try pinging
|
|
1222
|
+
*/
|
|
1223
|
+
const STANDARD_MCP_PORTS = {
|
|
1224
|
+
"nextjs-dev": [3001, 3002, 8080, 8081],
|
|
1225
|
+
"chrome-devtools": [9222, 9223, 9224, 3003]
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
/**
|
|
1229
|
+
* Detect running processes that match known MCP patterns
|
|
1230
|
+
*/
|
|
1231
|
+
async function detectMcpProcesses(): Promise<string[]> {
|
|
1232
|
+
const detectedMcps: string[] = []
|
|
1233
|
+
|
|
1234
|
+
try {
|
|
1235
|
+
// Get running processes on different platforms
|
|
1236
|
+
const platform = process.platform
|
|
1237
|
+
let psCommand: string
|
|
1238
|
+
|
|
1239
|
+
if (platform === "darwin" || platform === "linux") {
|
|
1240
|
+
psCommand = "ps aux"
|
|
1241
|
+
} else if (platform === "win32") {
|
|
1242
|
+
psCommand = "tasklist"
|
|
1243
|
+
} else {
|
|
1244
|
+
logToDevFile("MCP Discovery: Unsupported platform for process detection")
|
|
1245
|
+
return []
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
const { stdout } = await execAsync(psCommand)
|
|
1249
|
+
const processes = stdout.toLowerCase()
|
|
1250
|
+
|
|
1251
|
+
// Check for each known MCP pattern
|
|
1252
|
+
for (const [mcpName, patterns] of Object.entries(KNOWN_MCP_PATTERNS)) {
|
|
1253
|
+
for (const pattern of patterns) {
|
|
1254
|
+
if (processes.includes(pattern.toLowerCase())) {
|
|
1255
|
+
if (!detectedMcps.includes(mcpName)) {
|
|
1256
|
+
detectedMcps.push(mcpName)
|
|
1257
|
+
logToDevFile(`MCP Discovery: Found ${mcpName} MCP via process detection [${pattern}]`)
|
|
1258
|
+
}
|
|
1259
|
+
break
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
} catch (error) {
|
|
1264
|
+
logToDevFile(`MCP Discovery: Process detection failed - ${error instanceof Error ? error.message : String(error)}`)
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
return detectedMcps
|
|
1268
|
+
}
|
|
1269
|
+
|
|
1270
|
+
/**
|
|
1271
|
+
* Try to ping MCP services on standard ports
|
|
1272
|
+
*/
|
|
1273
|
+
async function pingMcpPorts(): Promise<string[]> {
|
|
1274
|
+
const detectedMcps: string[] = []
|
|
1275
|
+
|
|
1276
|
+
for (const [mcpName, ports] of Object.entries(STANDARD_MCP_PORTS)) {
|
|
1277
|
+
for (const port of ports) {
|
|
1278
|
+
try {
|
|
1279
|
+
// Try HTTP health check first
|
|
1280
|
+
const response = await fetch(`http://localhost:${port}/health`, {
|
|
1281
|
+
method: "GET",
|
|
1282
|
+
signal: AbortSignal.timeout(2000)
|
|
1283
|
+
})
|
|
1284
|
+
|
|
1285
|
+
if (response.ok) {
|
|
1286
|
+
detectedMcps.push(mcpName)
|
|
1287
|
+
logToDevFile(`MCP Discovery: Found ${mcpName} MCP via HTTP ping on port ${port}`)
|
|
1288
|
+
break
|
|
1289
|
+
}
|
|
1290
|
+
} catch {
|
|
1291
|
+
// Try WebSocket connection for MCP protocol
|
|
1292
|
+
try {
|
|
1293
|
+
const ws = new WebSocket(`ws://localhost:${port}`)
|
|
1294
|
+
await new Promise((resolve, reject) => {
|
|
1295
|
+
const timeout = setTimeout(() => {
|
|
1296
|
+
ws.close()
|
|
1297
|
+
reject(new Error("timeout"))
|
|
1298
|
+
}, 1000)
|
|
1299
|
+
|
|
1300
|
+
ws.on("open", () => {
|
|
1301
|
+
clearTimeout(timeout)
|
|
1302
|
+
ws.close()
|
|
1303
|
+
detectedMcps.push(mcpName)
|
|
1304
|
+
logToDevFile(`MCP Discovery: Found ${mcpName} MCP via WebSocket ping on port ${port}`)
|
|
1305
|
+
resolve(null)
|
|
1306
|
+
})
|
|
1307
|
+
|
|
1308
|
+
ws.on("error", () => {
|
|
1309
|
+
clearTimeout(timeout)
|
|
1310
|
+
reject(new Error("connection failed"))
|
|
1311
|
+
})
|
|
1312
|
+
})
|
|
1313
|
+
break
|
|
1314
|
+
} catch {}
|
|
1315
|
+
}
|
|
1316
|
+
}
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
return detectedMcps
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1322
|
+
/**
|
|
1323
|
+
* Comprehensive MCP discovery using multiple methods
|
|
1324
|
+
*/
|
|
1325
|
+
export async function discoverAvailableMcps(projectName?: string): Promise<string[]> {
|
|
1326
|
+
logToDevFile("MCP Discovery: Starting proactive MCP discovery", projectName)
|
|
1327
|
+
|
|
1328
|
+
const discoveredMcps = new Set<string>()
|
|
1329
|
+
|
|
1330
|
+
// Method 1: Process detection
|
|
1331
|
+
const processDetected = await detectMcpProcesses()
|
|
1332
|
+
for (const mcp of processDetected) {
|
|
1333
|
+
discoveredMcps.add(mcp)
|
|
1334
|
+
}
|
|
1335
|
+
|
|
1336
|
+
// Method 2: Port pinging (only if process detection found nothing)
|
|
1337
|
+
if (discoveredMcps.size === 0) {
|
|
1338
|
+
logToDevFile("MCP Discovery: No MCPs found via process detection, trying port pinging", projectName)
|
|
1339
|
+
const portDetected = await pingMcpPorts()
|
|
1340
|
+
for (const mcp of portDetected) {
|
|
1341
|
+
discoveredMcps.add(mcp)
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
const finalMcps = Array.from(discoveredMcps)
|
|
1346
|
+
|
|
1347
|
+
if (finalMcps.length > 0) {
|
|
1348
|
+
logToDevFile(`MCP Discovery: Successfully discovered MCPs [${finalMcps.join(", ")}]`, projectName)
|
|
1349
|
+
} else {
|
|
1350
|
+
logToDevFile("MCP Discovery: No MCPs detected - will run in standalone mode", projectName)
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
return finalMcps
|
|
1354
|
+
}
|
|
1355
|
+
|
|
1356
|
+
/**
|
|
1357
|
+
* Log MCP-related events to the project-specific D3K log file (NOT main project log)
|
|
1358
|
+
* This prevents Claude from seeing dev3000's orchestration logs as application errors
|
|
1359
|
+
*/
|
|
1360
|
+
function logToDevFile(message: string, projectName?: string) {
|
|
1361
|
+
try {
|
|
1362
|
+
// Write to project-specific D3K log instead of main project log
|
|
1363
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE
|
|
1364
|
+
if (!homeDir) return
|
|
1365
|
+
|
|
1366
|
+
const debugLogDir = join(homeDir, ".d3k", "logs")
|
|
1367
|
+
if (!existsSync(debugLogDir)) {
|
|
1368
|
+
mkdirSync(debugLogDir, { recursive: true })
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
// Use project name from parameter or try to detect from current session
|
|
1372
|
+
const actualProjectName = projectName || getCurrentProjectName()
|
|
1373
|
+
if (!actualProjectName) return
|
|
1374
|
+
|
|
1375
|
+
const d3kLogFile = join(debugLogDir, `dev3000-${actualProjectName}-d3k.log`)
|
|
1376
|
+
const timestamp = new Date().toISOString()
|
|
1377
|
+
const logEntry = `[${timestamp}] [D3K] ${message}\n`
|
|
1378
|
+
appendFileSync(d3kLogFile, logEntry)
|
|
1379
|
+
} catch (_error) {
|
|
1380
|
+
// Silently fail to avoid breaking MCP functionality
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
/**
|
|
1385
|
+
* Get current project name from active sessions
|
|
1386
|
+
*/
|
|
1387
|
+
function getCurrentProjectName(): string | null {
|
|
1388
|
+
try {
|
|
1389
|
+
const homeDir = process.env.HOME || process.env.USERPROFILE
|
|
1390
|
+
if (!homeDir) return null
|
|
1391
|
+
|
|
1392
|
+
const sessionDir = join(homeDir, ".d3k")
|
|
1393
|
+
if (!existsSync(sessionDir)) return null
|
|
1394
|
+
|
|
1395
|
+
// Find the most recent session file
|
|
1396
|
+
const sessionFiles = readdirSync(sessionDir).filter((file) => file.endsWith(".json"))
|
|
1397
|
+
if (sessionFiles.length === 0) return null
|
|
1398
|
+
|
|
1399
|
+
// Use the first session file's project name (could be improved to find the "current" one)
|
|
1400
|
+
const sessionFile = join(sessionDir, sessionFiles[0])
|
|
1401
|
+
const sessionData = JSON.parse(readFileSync(sessionFile, "utf8"))
|
|
1402
|
+
return sessionData.projectName || null
|
|
1403
|
+
} catch {
|
|
1404
|
+
return null
|
|
1405
|
+
}
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
/**
|
|
1409
|
+
* Detect available MCPs and set integration flags
|
|
1410
|
+
*/
|
|
1411
|
+
export function detectMcpIntegrations(
|
|
1412
|
+
availableMcps: string[],
|
|
1413
|
+
projectName?: string
|
|
1414
|
+
): {
|
|
1415
|
+
integrateNextjs: boolean
|
|
1416
|
+
integrateChromeDevtools: boolean
|
|
1417
|
+
} {
|
|
1418
|
+
const integrateNextjs = availableMcps.includes("nextjs-dev")
|
|
1419
|
+
const integrateChromeDevtools = availableMcps.includes("chrome-devtools")
|
|
1420
|
+
|
|
1421
|
+
// Log MCP detection results
|
|
1422
|
+
if (availableMcps.length > 0) {
|
|
1423
|
+
logToDevFile(`MCP Detection: Available MCPs [${availableMcps.join(", ")}]`, projectName)
|
|
1424
|
+
|
|
1425
|
+
const integrations: string[] = []
|
|
1426
|
+
if (integrateNextjs) integrations.push("Next.js")
|
|
1427
|
+
if (integrateChromeDevtools) integrations.push("Chrome DevTools")
|
|
1428
|
+
|
|
1429
|
+
if (integrations.length > 0) {
|
|
1430
|
+
logToDevFile(`MCP Integration: Activated integrations [${integrations.join(", ")}]`, projectName)
|
|
1431
|
+
} else {
|
|
1432
|
+
logToDevFile("MCP Integration: No compatible MCPs detected - running in standalone mode", projectName)
|
|
1433
|
+
}
|
|
1434
|
+
} else {
|
|
1435
|
+
logToDevFile("MCP Detection: No MCPs provided - running in standalone mode", projectName)
|
|
1436
|
+
}
|
|
1437
|
+
|
|
1438
|
+
return {
|
|
1439
|
+
integrateNextjs,
|
|
1440
|
+
integrateChromeDevtools
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
/**
|
|
1445
|
+
* Calculate estimated time based on available tools and error complexity
|
|
1446
|
+
*/
|
|
1447
|
+
export function calculateEstimatedTime(errorCount: number, hasIntegrations: boolean): string {
|
|
1448
|
+
const baseTime = Math.min(errorCount * 2, 20) // 2 minutes per error, max 20 minutes
|
|
1449
|
+
const integrationBonus = hasIntegrations ? 0.5 : 1 // 50% faster with integrations
|
|
1450
|
+
const totalMinutes = Math.ceil(baseTime * integrationBonus)
|
|
1451
|
+
|
|
1452
|
+
if (totalMinutes <= 5) return `${totalMinutes} minutes`
|
|
1453
|
+
if (totalMinutes <= 60) return `${totalMinutes} minutes`
|
|
1454
|
+
return `${Math.ceil(totalMinutes / 60)} hours`
|
|
1455
|
+
}
|
|
1456
|
+
|
|
1457
|
+
/**
|
|
1458
|
+
* Generate Next.js specific MCP function suggestions
|
|
1459
|
+
*/
|
|
1460
|
+
export function generateNextjsSuggestions(errorContext?: string): McpFunctionSuggestion[] {
|
|
1461
|
+
const suggestions: McpFunctionSuggestion[] = [
|
|
1462
|
+
{
|
|
1463
|
+
function: "check_errors",
|
|
1464
|
+
reason: "Analyze Next.js build and runtime errors with framework-specific context",
|
|
1465
|
+
priority: "high"
|
|
1466
|
+
},
|
|
1467
|
+
{
|
|
1468
|
+
function: "get_logs",
|
|
1469
|
+
params: { type: "error", limit: 20 },
|
|
1470
|
+
reason: "Retrieve detailed Next.js server logs to correlate with dev3000 findings",
|
|
1471
|
+
priority: "high"
|
|
1472
|
+
}
|
|
1473
|
+
]
|
|
1474
|
+
|
|
1475
|
+
// Add context-specific suggestions
|
|
1476
|
+
if (errorContext?.includes("hydration")) {
|
|
1477
|
+
suggestions.push({
|
|
1478
|
+
function: "check_hydration_errors",
|
|
1479
|
+
reason: "Specific hydration mismatch analysis detected in error context",
|
|
1480
|
+
priority: "high"
|
|
1481
|
+
})
|
|
1482
|
+
}
|
|
1483
|
+
|
|
1484
|
+
if (errorContext?.includes("build") || errorContext?.includes("compile")) {
|
|
1485
|
+
suggestions.push({
|
|
1486
|
+
function: "get_build_info",
|
|
1487
|
+
reason: "Build-related errors detected, get detailed compilation information",
|
|
1488
|
+
priority: "high"
|
|
1489
|
+
})
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
return suggestions
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/**
|
|
1496
|
+
* Generate Chrome DevTools specific MCP function suggestions
|
|
1497
|
+
*/
|
|
1498
|
+
export function generateChromeDevtoolsSuggestions(errorContext?: string): McpFunctionSuggestion[] {
|
|
1499
|
+
const suggestions: McpFunctionSuggestion[] = [
|
|
1500
|
+
{
|
|
1501
|
+
function: "list_console_messages",
|
|
1502
|
+
params: { type: "error", limit: 20 },
|
|
1503
|
+
reason: "Get detailed browser console errors to correlate with dev3000 interaction data",
|
|
1504
|
+
priority: "high"
|
|
1505
|
+
},
|
|
1506
|
+
{
|
|
1507
|
+
function: "list_network_requests",
|
|
1508
|
+
params: { failed: true },
|
|
1509
|
+
reason: "Analyze failed network requests that may be causing application errors",
|
|
1510
|
+
priority: "medium"
|
|
1511
|
+
},
|
|
1512
|
+
{
|
|
1513
|
+
function: "take_screenshot",
|
|
1514
|
+
reason: "Capture current browser state for visual debugging",
|
|
1515
|
+
priority: "low"
|
|
1516
|
+
}
|
|
1517
|
+
]
|
|
1518
|
+
|
|
1519
|
+
// Add context-specific suggestions
|
|
1520
|
+
if (errorContext?.includes("network") || errorContext?.includes("fetch") || errorContext?.includes("api")) {
|
|
1521
|
+
suggestions.push({
|
|
1522
|
+
function: "get_performance_metrics",
|
|
1523
|
+
reason: "Network-related errors detected, analyze performance and timing",
|
|
1524
|
+
priority: "high"
|
|
1525
|
+
})
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1528
|
+
if (errorContext?.includes("click") || errorContext?.includes("interaction")) {
|
|
1529
|
+
suggestions.push({
|
|
1530
|
+
function: "get_dom_snapshot",
|
|
1531
|
+
reason: "Interaction errors detected, capture DOM state for element analysis",
|
|
1532
|
+
priority: "medium"
|
|
1533
|
+
})
|
|
1534
|
+
}
|
|
1535
|
+
|
|
1536
|
+
return suggestions
|
|
1537
|
+
}
|
|
1538
|
+
|
|
1539
|
+
/**
|
|
1540
|
+
* Create integrated workflow with 3-phase debugging plan
|
|
1541
|
+
*/
|
|
1542
|
+
export async function createIntegratedWorkflow({
|
|
1543
|
+
availableMcps,
|
|
1544
|
+
focusArea = "all",
|
|
1545
|
+
errorContext
|
|
1546
|
+
}: CreateIntegratedWorkflowParams): Promise<{ content: Array<{ type: "text"; text: string }> }> {
|
|
1547
|
+
const results: string[] = []
|
|
1548
|
+
|
|
1549
|
+
// Log workflow creation
|
|
1550
|
+
logToDevFile(
|
|
1551
|
+
`Workflow Creation: Creating integrated workflow with focus area [${focusArea}]${errorContext ? `, error context [${errorContext}]` : ""}`
|
|
1552
|
+
)
|
|
1553
|
+
|
|
1554
|
+
// Use provided MCPs or discover them proactively
|
|
1555
|
+
let finalMcps: string[] = availableMcps || []
|
|
1556
|
+
if (!availableMcps || availableMcps.length === 0) {
|
|
1557
|
+
logToDevFile("Workflow Creation: No MCPs provided, starting proactive discovery")
|
|
1558
|
+
finalMcps = await discoverAvailableMcps()
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
// Detect available integrations
|
|
1562
|
+
const { integrateNextjs, integrateChromeDevtools } = detectMcpIntegrations(finalMcps)
|
|
1563
|
+
|
|
1564
|
+
results.push("🎼 **INTELLIGENT DEBUGGING ORCHESTRATOR**")
|
|
1565
|
+
results.push(`🔍 Available MCPs: ${finalMcps.length > 0 ? finalMcps.join(", ") : "none (will attempt discovery)"}`)
|
|
1566
|
+
results.push(
|
|
1567
|
+
`⚡ Integrations: ${integrateNextjs ? "✅ Next.js" : "❌ Next.js"} | ${integrateChromeDevtools ? "✅ Chrome DevTools" : "❌ Chrome DevTools"}`
|
|
1568
|
+
)
|
|
1569
|
+
|
|
1570
|
+
if (errorContext) {
|
|
1571
|
+
results.push(`🎯 Error Context: ${errorContext}`)
|
|
1572
|
+
}
|
|
1573
|
+
results.push("")
|
|
1574
|
+
|
|
1575
|
+
// Generate MCP-specific suggestions
|
|
1576
|
+
const nextjsSuggestions = integrateNextjs ? generateNextjsSuggestions(errorContext) : []
|
|
1577
|
+
const chromeSuggestions = integrateChromeDevtools ? generateChromeDevtoolsSuggestions(errorContext) : []
|
|
1578
|
+
|
|
1579
|
+
if (!integrateNextjs && !integrateChromeDevtools) {
|
|
1580
|
+
results.push("⚠️ **NO INTEGRATIONS DETECTED**")
|
|
1581
|
+
results.push("Running in standalone mode. For enhanced debugging:")
|
|
1582
|
+
results.push("• Add 'nextjs-dev' MCP for Next.js-specific analysis")
|
|
1583
|
+
results.push("• Add 'chrome-devtools' MCP for browser inspection")
|
|
1584
|
+
results.push("")
|
|
1585
|
+
results.push("💡 **STANDALONE WORKFLOW:**")
|
|
1586
|
+
results.push("1. Use fix_my_app(mode='snapshot') to analyze current issues")
|
|
1587
|
+
results.push("2. Use execute_browser_action to reproduce and verify fixes")
|
|
1588
|
+
results.push("3. Implement suggested code fixes")
|
|
1589
|
+
|
|
1590
|
+
return {
|
|
1591
|
+
content: [{ type: "text", text: results.join("\n") }]
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
// Create 3-phase integrated workflow
|
|
1596
|
+
results.push("🎪 **3-PHASE INTEGRATED WORKFLOW**")
|
|
1597
|
+
results.push("")
|
|
1598
|
+
|
|
1599
|
+
// Phase 1: Parallel Data Collection
|
|
1600
|
+
results.push("🕐 **PHASE 1: PARALLEL DATA COLLECTION** (2-3 minutes)")
|
|
1601
|
+
results.push("Execute these functions in parallel across all available MCPs:")
|
|
1602
|
+
results.push("")
|
|
1603
|
+
|
|
1604
|
+
results.push("📊 **dev3000 (this MCP):**")
|
|
1605
|
+
results.push(
|
|
1606
|
+
`• fix_my_app(focusArea='${focusArea}', integrateNextjs=${integrateNextjs}, integrateChromeDevtools=${integrateChromeDevtools}, returnRawData=true)`
|
|
1607
|
+
)
|
|
1608
|
+
results.push(" → Get comprehensive error analysis with interaction data")
|
|
1609
|
+
results.push("")
|
|
1610
|
+
|
|
1611
|
+
if (integrateNextjs) {
|
|
1612
|
+
results.push("⚛️ **nextjs-dev MCP:**")
|
|
1613
|
+
nextjsSuggestions
|
|
1614
|
+
.filter((s) => s.priority === "high")
|
|
1615
|
+
.forEach((suggestion) => {
|
|
1616
|
+
const params = suggestion.params
|
|
1617
|
+
? `(${Object.entries(suggestion.params)
|
|
1618
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
1619
|
+
.join(", ")})`
|
|
1620
|
+
: "()"
|
|
1621
|
+
results.push(`• ${suggestion.function}${params}`)
|
|
1622
|
+
results.push(` → ${suggestion.reason}`)
|
|
1623
|
+
})
|
|
1624
|
+
results.push("")
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
if (integrateChromeDevtools) {
|
|
1628
|
+
results.push("🌐 **chrome-devtools MCP:**")
|
|
1629
|
+
chromeSuggestions
|
|
1630
|
+
.filter((s) => s.priority === "high")
|
|
1631
|
+
.forEach((suggestion) => {
|
|
1632
|
+
const params = suggestion.params
|
|
1633
|
+
? `(${Object.entries(suggestion.params)
|
|
1634
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
1635
|
+
.join(", ")})`
|
|
1636
|
+
: "()"
|
|
1637
|
+
results.push(`• ${suggestion.function}${params}`)
|
|
1638
|
+
results.push(` → ${suggestion.reason}`)
|
|
1639
|
+
})
|
|
1640
|
+
results.push("")
|
|
1641
|
+
}
|
|
1642
|
+
|
|
1643
|
+
// Phase 2: Deep Analysis
|
|
1644
|
+
results.push("🕑 **PHASE 2: DEEP TARGETED ANALYSIS** (3-5 minutes)")
|
|
1645
|
+
results.push("Based on Phase 1 findings, execute these functions sequentially:")
|
|
1646
|
+
results.push("")
|
|
1647
|
+
|
|
1648
|
+
results.push("🔗 **Cross-MCP Correlation:**")
|
|
1649
|
+
results.push("• Compare dev3000 interaction data with browser console errors")
|
|
1650
|
+
if (integrateNextjs) {
|
|
1651
|
+
results.push("• Correlate dev3000 server errors with Next.js build/runtime logs")
|
|
1652
|
+
results.push("• Match interaction timestamps with Next.js request handling")
|
|
1653
|
+
}
|
|
1654
|
+
results.push("• Identify root cause by combining all data sources")
|
|
1655
|
+
results.push("")
|
|
1656
|
+
|
|
1657
|
+
results.push("🎯 **Targeted Deep Dive:**")
|
|
1658
|
+
results.push("• Use fix_my_app(mode='bisect') for regression analysis if needed")
|
|
1659
|
+
if (integrateChromeDevtools) {
|
|
1660
|
+
chromeSuggestions
|
|
1661
|
+
.filter((s) => s.priority === "medium")
|
|
1662
|
+
.forEach((suggestion) => {
|
|
1663
|
+
const params = suggestion.params
|
|
1664
|
+
? `(${Object.entries(suggestion.params)
|
|
1665
|
+
.map(([k, v]) => `${k}=${JSON.stringify(v)}`)
|
|
1666
|
+
.join(", ")})`
|
|
1667
|
+
: "()"
|
|
1668
|
+
results.push(`• ${suggestion.function}${params} - ${suggestion.reason}`)
|
|
1669
|
+
})
|
|
1670
|
+
}
|
|
1671
|
+
results.push("")
|
|
1672
|
+
|
|
1673
|
+
// Phase 3: Fix Implementation & Verification
|
|
1674
|
+
results.push("🕒 **PHASE 3: FIX IMPLEMENTATION & VERIFICATION** (5-10 minutes)")
|
|
1675
|
+
results.push("Orchestrated fix implementation with cross-MCP verification:")
|
|
1676
|
+
results.push("")
|
|
1677
|
+
|
|
1678
|
+
results.push("🔧 **Implementation:**")
|
|
1679
|
+
results.push("• Apply code fixes identified by dev3000 error analysis")
|
|
1680
|
+
if (integrateNextjs) {
|
|
1681
|
+
results.push("• Address Next.js-specific issues (hydration, build, etc.)")
|
|
1682
|
+
}
|
|
1683
|
+
results.push("• Use dev3000's interaction data to create comprehensive test scenarios")
|
|
1684
|
+
results.push("")
|
|
1685
|
+
|
|
1686
|
+
results.push("✅ **Verification Workflow:**")
|
|
1687
|
+
results.push("• Use execute_browser_action to replay exact user interactions that caused errors")
|
|
1688
|
+
if (integrateChromeDevtools) {
|
|
1689
|
+
results.push("• Use chrome-devtools to monitor console for error resolution")
|
|
1690
|
+
results.push("• Take before/after screenshots to verify UI fixes")
|
|
1691
|
+
}
|
|
1692
|
+
if (integrateNextjs) {
|
|
1693
|
+
results.push("• Use nextjs-dev to verify build success and runtime stability")
|
|
1694
|
+
}
|
|
1695
|
+
results.push("• Re-run fix_my_app to confirm error resolution")
|
|
1696
|
+
results.push("")
|
|
1697
|
+
|
|
1698
|
+
// Integration Benefits
|
|
1699
|
+
results.push("🚀 **INTEGRATION BENEFITS:**")
|
|
1700
|
+
|
|
1701
|
+
if (integrateNextjs && integrateChromeDevtools) {
|
|
1702
|
+
results.push("🎯 **Triple-Stack Coverage:**")
|
|
1703
|
+
results.push("• dev3000: AI-powered error correlation + interaction replay")
|
|
1704
|
+
results.push("• nextjs-dev: Framework-specific server-side analysis")
|
|
1705
|
+
results.push("• chrome-devtools: Precise browser state inspection")
|
|
1706
|
+
results.push("• Combined: Complete full-stack debugging with 90%+ issue resolution")
|
|
1707
|
+
results.push("")
|
|
1708
|
+
results.push("⚡ **Expected Results:**")
|
|
1709
|
+
results.push("• 3x faster debugging vs using tools individually")
|
|
1710
|
+
results.push("• AI-powered error correlation across all layers")
|
|
1711
|
+
results.push("• Systematic fix verification workflow")
|
|
1712
|
+
results.push("• Comprehensive interaction-based testing")
|
|
1713
|
+
} else if (integrateNextjs) {
|
|
1714
|
+
results.push("🎯 **Server-Side Enhanced Coverage:**")
|
|
1715
|
+
results.push("• dev3000: Client error analysis + interaction data")
|
|
1716
|
+
results.push("• nextjs-dev: Server-side logs and build analysis")
|
|
1717
|
+
results.push("• Combined: Full-stack Next.js debugging coverage")
|
|
1718
|
+
} else if (integrateChromeDevtools) {
|
|
1719
|
+
results.push("🎯 **Browser-Enhanced Coverage:**")
|
|
1720
|
+
results.push("• dev3000: Error detection + interaction replay")
|
|
1721
|
+
results.push("• chrome-devtools: Detailed browser state inspection")
|
|
1722
|
+
results.push("• Combined: Complete client-side debugging workflow")
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
const estimatedTime = calculateEstimatedTime(5, integrateNextjs || integrateChromeDevtools) // Assume 5 errors for estimation
|
|
1726
|
+
results.push("")
|
|
1727
|
+
results.push(`⏱️ **ESTIMATED TOTAL TIME:** ${estimatedTime}`)
|
|
1728
|
+
results.push(`🎼 **dev3000 orchestrates ${finalMcps.length} MCPs for maximum debugging power!**`)
|
|
1729
|
+
|
|
1730
|
+
return {
|
|
1731
|
+
content: [{ type: "text", text: results.join("\n") }]
|
|
1732
|
+
}
|
|
1733
|
+
}
|