@mndrk/agx 1.4.40 → 1.4.41

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 (108) hide show
  1. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/BUILD_ID +1 -1
  2. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-build-manifest.json +63 -63
  3. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/app-path-routes-manifest.json +11 -11
  4. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/build-manifest.json +2 -2
  5. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/prerender-manifest.json +18 -18
  6. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  7. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.html +2 -2
  8. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/_not-found.rsc +2 -2
  9. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/audit/route_client-reference-manifest.js +1 -1
  10. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/[...nextauth]/route_client-reference-manifest.js +1 -1
  11. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/daemon-secret/route.js +1 -1
  12. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/daemon-secret/route.js.nft.json +1 -1
  13. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/daemon-secret/route_client-reference-manifest.js +1 -1
  14. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/code/route_client-reference-manifest.js +1 -1
  15. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/device/token/route_client-reference-manifest.js +1 -1
  16. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/refresh/route_client-reference-manifest.js +1 -1
  17. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/auth/status/route_client-reference-manifest.js +1 -1
  18. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/[id]/route_client-reference-manifest.js +1 -1
  19. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/domains/route_client-reference-manifest.js +1 -1
  20. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/health/route_client-reference-manifest.js +1 -1
  21. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/learnings/route_client-reference-manifest.js +1 -1
  22. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/logs/stream/route_client-reference-manifest.js +1 -1
  23. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/cancel/route_client-reference-manifest.js +1 -1
  24. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/signal/route_client-reference-manifest.js +1 -1
  25. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/start/route_client-reference-manifest.js +1 -1
  26. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/orchestrator/tasks/[taskId]/status/route_client-reference-manifest.js +1 -1
  27. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/[id]/route_client-reference-manifest.js +1 -1
  28. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/projects/route_client-reference-manifest.js +1 -1
  29. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
  30. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/complete/route_client-reference-manifest.js +1 -1
  31. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/route.js +1 -1
  32. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/route.js.nft.json +1 -1
  33. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/queue/route_client-reference-manifest.js +1 -1
  34. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/stage-prompts/route_client-reference-manifest.js +1 -1
  35. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js +1 -1
  36. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/[commentId]/route.js.nft.json +1 -1
  37. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/[commentId]/route_client-reference-manifest.js +1 -1
  38. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/route.js +1 -1
  39. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/route.js.nft.json +1 -1
  40. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/comments/route_client-reference-manifest.js +1 -1
  41. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/heartbeat/route_client-reference-manifest.js +1 -1
  42. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/history/route_client-reference-manifest.js +1 -1
  43. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/logs/route_client-reference-manifest.js +1 -1
  44. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/route.js +2 -2
  45. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/route.js.nft.json +1 -1
  46. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/[id]/route_client-reference-manifest.js +1 -1
  47. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/route.js +1 -1
  48. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/route.js.nft.json +1 -1
  49. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/route_client-reference-manifest.js +1 -1
  50. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/tasks/stream/route_client-reference-manifest.js +1 -1
  51. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/user-settings/route_client-reference-manifest.js +1 -1
  52. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/nodes/route_client-reference-manifest.js +1 -1
  53. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/[id]/route_client-reference-manifest.js +1 -1
  54. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/api/workflows/route_client-reference-manifest.js +1 -1
  55. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/callback/route_client-reference-manifest.js +1 -1
  56. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page.js +4 -4
  57. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device/page_client-reference-manifest.js +1 -1
  58. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.html +1 -1
  59. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/auth/device.rsc +3 -3
  60. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page.js +5 -11
  61. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard/page_client-reference-manifest.js +1 -1
  62. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.html +2 -2
  63. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/dashboard.rsc +3 -3
  64. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.html +2 -2
  65. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/index.rsc +2 -2
  66. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login/page_client-reference-manifest.js +1 -1
  67. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.html +2 -2
  68. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/login.rsc +2 -2
  69. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/page_client-reference-manifest.js +1 -1
  70. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page.js +3 -3
  71. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/page_client-reference-manifest.js +1 -1
  72. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page.js +5 -11
  73. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/tasks/page_client-reference-manifest.js +1 -1
  74. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/[slug]/workflow/page_client-reference-manifest.js +1 -1
  75. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page.js +5 -11
  76. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects/page_client-reference-manifest.js +1 -1
  77. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.html +2 -2
  78. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/projects.rsc +3 -3
  79. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings/page_client-reference-manifest.js +1 -1
  80. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.html +2 -2
  81. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app/settings.rsc +2 -2
  82. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/app-paths-manifest.json +11 -11
  83. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/3009.js +6 -9
  84. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/middleware-manifest.json +5 -5
  85. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/middleware.js +2 -2
  86. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/404.html +1 -1
  87. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/pages/500.html +1 -1
  88. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.js +1 -1
  89. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/server-reference-manifest.json +1 -1
  90. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/9337-bb6c612aafce3a9c.js +1 -0
  91. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-545a62f1fc051864.js +1 -0
  92. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/dashboard/{page-73c51d10d4d6750b.js → page-161065be9ecc1540.js} +1 -1
  93. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/page-8465be2213d5814e.js +1 -0
  94. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/tasks/page-1c83613d7bdd6e4d.js +1 -0
  95. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/page-daef2760bde2a1c2.js +1 -0
  96. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/css/6873fedf803c523e.css +1 -0
  97. package/lib/cli/cloudArtifacts.js +15 -0
  98. package/package.json +1 -1
  99. package/templates/stack/postgres/init/001_agx_board_schema.sql +3 -0
  100. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/server/chunks/1240.js +0 -1
  101. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/9337-09000d8a6c85f40c.js +0 -1
  102. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/auth/device/page-1fc7f0932678564a.js +0 -1
  103. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/page-7b3bab16f3cd2c6e.js +0 -1
  104. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/[slug]/tasks/page-7fa40666ec1be39a.js +0 -1
  105. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/chunks/app/projects/page-4700b9b5d3d5d10e.js +0 -1
  106. package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/css/d85185e3bba6ece1.css +0 -1
  107. /package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/{BOJ5sZptp00NauQlpjT44 → mCUmhM9IAwdWuR54NbH0-}/_buildManifest.js +0 -0
  108. /package/cloud-runtime/standalone/Projects/Agents/agx-cloud/.next/static/{BOJ5sZptp00NauQlpjT44 → mCUmhM9IAwdWuR54NbH0-}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><!--BOJ5sZptp00NauQlpjT44--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/d85185e3bba6ece1.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d282787ed3063711.js"/><script src="/_next/static/chunks/4bd1b696-f785427dddbba9fb.js" async=""></script><script src="/_next/static/chunks/1255-a390e12b70b4a9fb.js" async=""></script><script src="/_next/static/chunks/main-app-c3d1ac80a13099fb.js" async=""></script><script src="/_next/static/chunks/app/layout-449a81ecf8041b29.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-DVQQG95LNL" as="script"/><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>AGX Board - Agent Task Orchestration</title><meta name="description" content="Orchestrate and manage AI agent tasks on AGX Board"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="antialiased min-h-screen bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]"><div hidden=""><!--$--><!--/$--></div><div class="fixed inset-0 -z-10 h-full w-full bg-[radial-gradient(#27272a_1px,transparent_1px)] [background-size:16px_16px] opacity-20"></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d282787ed3063711.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[3396,[\"7177\",\"static/chunks/app/layout-449a81ecf8041b29.js\"],\"GoogleAnalytics\"]\n3:I[4647,[\"7177\",\"static/chunks/app/layout-449a81ecf8041b29.js\"],\"AuthProvider\"]\n4:I[9766,[],\"\"]\n5:I[8924,[],\"\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/css/d85185e3bba6ece1.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"BOJ5sZptp00NauQlpjT44\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/d85185e3bba6ece1.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"$L2\",null,{}]}],[\"$\",\"body\",null,{\"className\":\"antialiased min-h-screen bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]\",\"children\":[[\"$\",\"div\",null,{\"className\":\"fixed inset-0 -z-10 h-full w-full bg-[radial-gradient(#27272a_1px,transparent_1px)] [background-size:16px_16px] opacity-20\"}],[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],null],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"AGX Board - Agent Task Orchestration\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Orchestrate and manage AI agent tasks on AGX Board\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
1
+ <!DOCTYPE html><!--mCUmhM9IAwdWuR54NbH0_--><html lang="en" class="dark"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/_next/static/css/6873fedf803c523e.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/_next/static/chunks/webpack-d282787ed3063711.js"/><script src="/_next/static/chunks/4bd1b696-f785427dddbba9fb.js" async=""></script><script src="/_next/static/chunks/1255-a390e12b70b4a9fb.js" async=""></script><script src="/_next/static/chunks/main-app-c3d1ac80a13099fb.js" async=""></script><script src="/_next/static/chunks/app/layout-449a81ecf8041b29.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-DVQQG95LNL" as="script"/><meta name="robots" content="noindex"/><title>404: This page could not be found.</title><title>AGX Board - Agent Task Orchestration</title><meta name="description" content="Orchestrate and manage AI agent tasks on AGX Board"/><script src="/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="antialiased min-h-screen bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]"><div hidden=""><!--$--><!--/$--></div><div class="fixed inset-0 -z-10 h-full w-full bg-[radial-gradient(#27272a_1px,transparent_1px)] [background-size:16px_16px] opacity-20"></div><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding:0 23px 0 0;font-size:24px;font-weight:500;vertical-align:top;line-height:49px">404</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:49px;margin:0">This page could not be found.</h2></div></div></div><!--$--><!--/$--><script src="/_next/static/chunks/webpack-d282787ed3063711.js" id="_R_" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0])</script><script>self.__next_f.push([1,"1:\"$Sreact.fragment\"\n2:I[3396,[\"7177\",\"static/chunks/app/layout-449a81ecf8041b29.js\"],\"GoogleAnalytics\"]\n3:I[4647,[\"7177\",\"static/chunks/app/layout-449a81ecf8041b29.js\"],\"AuthProvider\"]\n4:I[9766,[],\"\"]\n5:I[8924,[],\"\"]\n6:I[4431,[],\"OutletBoundary\"]\n8:I[5278,[],\"AsyncMetadataOutlet\"]\na:I[4431,[],\"ViewportBoundary\"]\nc:I[4431,[],\"MetadataBoundary\"]\nd:\"$Sreact.suspense\"\nf:I[7150,[],\"\"]\n:HL[\"/_next/static/css/6873fedf803c523e.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"0:{\"P\":null,\"b\":\"mCUmhM9IAwdWuR54NbH0-\",\"p\":\"\",\"c\":[\"\",\"_not-found\"],\"i\":false,\"f\":[[[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],[\"\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/_next/static/css/6873fedf803c523e.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\",\"nonce\":\"$undefined\"}]],[\"$\",\"html\",null,{\"lang\":\"en\",\"className\":\"dark\",\"children\":[[\"$\",\"head\",null,{\"children\":[\"$\",\"$L2\",null,{}]}],[\"$\",\"body\",null,{\"className\":\"antialiased min-h-screen bg-[var(--background)] text-[var(--foreground)] selection:bg-[var(--primary)] selection:text-[var(--primary-foreground)]\",\"children\":[[\"$\",\"div\",null,{\"className\":\"fixed inset-0 -z-10 h-full w-full bg-[radial-gradient(#27272a_1px,transparent_1px)] [background-size:16px_16px] opacity-20\"}],[\"$\",\"$L3\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]}]]}]]}]]}],{\"children\":[\"/_not-found\",[\"$\",\"$1\",\"c\",{\"children\":[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"forbidden\":\"$undefined\",\"unauthorized\":\"$undefined\"}]]}],{\"children\":[\"__PAGE__\",[\"$\",\"$1\",\"c\",{\"children\":[[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":404}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null,[\"$\",\"$L6\",null,{\"children\":[\"$L7\",[\"$\",\"$L8\",null,{\"promise\":\"$@9\"}]]}]]}],{},null,false]},null,false]},null,false],[\"$\",\"$1\",\"h\",{\"children\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],[[\"$\",\"$La\",null,{\"children\":\"$Lb\"}],null],[\"$\",\"$Lc\",null,{\"children\":[\"$\",\"div\",null,{\"hidden\":true,\"children\":[\"$\",\"$d\",null,{\"fallback\":null,\"children\":\"$Le\"}]}]}]]}],false]],\"m\":\"$undefined\",\"G\":[\"$f\",[]],\"s\":false,\"S\":true}\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"charSet\":\"utf-8\"}],[\"$\",\"meta\",\"1\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}]]\n7:null\n"])</script><script>self.__next_f.push([1,"9:{\"metadata\":[[\"$\",\"title\",\"0\",{\"children\":\"AGX Board - Agent Task Orchestration\"}],[\"$\",\"meta\",\"1\",{\"name\":\"description\",\"content\":\"Orchestrate and manage AI agent tasks on AGX Board\"}]],\"error\":null,\"digest\":\"$undefined\"}\n"])</script><script>self.__next_f.push([1,"e:\"$9:metadata\"\n"])</script></body></html>
@@ -1 +1 @@
1
- <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-d282787ed3063711.js" defer=""></script><script src="/_next/static/chunks/framework-e60c938074ff7136.js" defer=""></script><script src="/_next/static/chunks/main-8c662602f1324852.js" defer=""></script><script src="/_next/static/chunks/pages/_app-6c8c2371b16a04b8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94812ad32cad7365.js" defer=""></script><script src="/_next/static/BOJ5sZptp00NauQlpjT44/_buildManifest.js" defer=""></script><script src="/_next/static/BOJ5sZptp00NauQlpjT44/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"BOJ5sZptp00NauQlpjT44","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
1
+ <!DOCTYPE html><html><head><meta charSet="utf-8" data-next-head=""/><meta name="viewport" content="width=device-width" data-next-head=""/><title data-next-head="">500: Internal Server Error</title><noscript data-n-css=""></noscript><script defer="" noModule="" src="/_next/static/chunks/polyfills-42372ed130431b0a.js"></script><script src="/_next/static/chunks/webpack-d282787ed3063711.js" defer=""></script><script src="/_next/static/chunks/framework-e60c938074ff7136.js" defer=""></script><script src="/_next/static/chunks/main-8c662602f1324852.js" defer=""></script><script src="/_next/static/chunks/pages/_app-6c8c2371b16a04b8.js" defer=""></script><script src="/_next/static/chunks/pages/_error-94812ad32cad7365.js" defer=""></script><script src="/_next/static/mCUmhM9IAwdWuR54NbH0-/_buildManifest.js" defer=""></script><script src="/_next/static/mCUmhM9IAwdWuR54NbH0-/_ssgManifest.js" defer=""></script></head><body><div id="__next"><div style="font-family:system-ui,&quot;Segoe UI&quot;,Roboto,Helvetica,Arial,sans-serif,&quot;Apple Color Emoji&quot;,&quot;Segoe UI Emoji&quot;;height:100vh;text-align:center;display:flex;flex-direction:column;align-items:center;justify-content:center"><div style="line-height:48px"><style>body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}</style><h1 class="next-error-h1" style="display:inline-block;margin:0 20px 0 0;padding-right:23px;font-size:24px;font-weight:500;vertical-align:top">500</h1><div style="display:inline-block"><h2 style="font-size:14px;font-weight:400;line-height:28px">Internal Server Error<!-- -->.</h2></div></div></div></div><script id="__NEXT_DATA__" type="application/json">{"props":{"pageProps":{"statusCode":500}},"page":"/_error","query":{},"buildId":"mCUmhM9IAwdWuR54NbH0-","nextExport":true,"isFallback":false,"gip":true,"scriptLoader":[]}</script></body></html>
@@ -1 +1 @@
1
- self.__RSC_SERVER_MANIFEST="{\"node\":{\"40072f01714e6842d5d36da366e8d82a8d198e41d2\":{\"workers\":{\"app/auth/device/page\":{\"moduleId\":\"31669\",\"async\":true}},\"layer\":{\"app/auth/device/page\":\"action-browser\"},\"filename\":\"lib/device-actions.ts\",\"exportedName\":\"approveDeviceCode\"}},\"edge\":{},\"encryptionKey\":\"process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY\"}"
1
+ self.__RSC_SERVER_MANIFEST="{\"node\":{\"4079ee8df08e3a0b0d8d2aef65e271182ce95899cc\":{\"workers\":{\"app/auth/device/page\":{\"moduleId\":\"32394\",\"async\":true}},\"layer\":{\"app/auth/device/page\":\"action-browser\"},\"filename\":\"lib/device-actions.ts\",\"exportedName\":\"approveDeviceCode\"}},\"edge\":{},\"encryptionKey\":\"process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY\"}"
@@ -1 +1 @@
1
- {"node":{"40072f01714e6842d5d36da366e8d82a8d198e41d2":{"workers":{"app/auth/device/page":{"moduleId":"31669","async":true}},"layer":{"app/auth/device/page":"action-browser"},"filename":"lib/device-actions.ts","exportedName":"approveDeviceCode"}},"edge":{},"encryptionKey":"fNQD/5rYU7eB2yOuDnFu3K/OxflY2qV00F66WLY7hZc="}
1
+ {"node":{"4079ee8df08e3a0b0d8d2aef65e271182ce95899cc":{"workers":{"app/auth/device/page":{"moduleId":"32394","async":true}},"layer":{"app/auth/device/page":"action-browser"},"filename":"lib/device-actions.ts","exportedName":"approveDeviceCode"}},"edge":{},"encryptionKey":"zD7aZ+gxpt9BMd4UQu6U84n2vYmK1l41medzhDJiufE="}
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9337],{2835:(e,r,t)=>{t.d(r,{A:()=>o});var a=t(5155),s=t(2115);function o(e){let{tasks:r,onTaskClick:t,onStop:o,onRetry:l,cancellingTaskId:n}=e,i=(0,s.useMemo)(()=>r.filter(e=>"in_progress"===e.status),[r]),[d,c]=(0,s.useState)({});return((0,s.useEffect)(()=>{let e=()=>{let e={};i.forEach(r=>{let t=new Date(r.updated_at).getTime(),a=Math.floor((Date.now()-t)/6e4);a<1?e[r.id]="< 1m":a<60?e[r.id]="".concat(a,"m"):e[r.id]="".concat(Math.floor(a/60),"h")}),c(e)};e();let r=setInterval(e,6e4);return()=>clearInterval(r)},[i]),0===i.length)?null:(0,a.jsx)("div",{className:"w-full bg-[var(--card-bg)] border-b border-[var(--border)] mb-6 animate-fade-in-down",children:(0,a.jsx)("div",{className:"max-w-full overflow-x-auto no-scrollbar",children:(0,a.jsxs)("div",{className:"flex items-center gap-4 p-4 min-w-max",children:[(0,a.jsxs)("div",{className:"flex flex-col justify-center pr-4 border-r border-[var(--border)]",children:[(0,a.jsxs)("h3",{className:"text-sm font-bold text-[var(--foreground)] whitespace-nowrap flex items-center gap-2",children:[(0,a.jsxs)("span",{className:"relative flex h-2 w-2",children:[(0,a.jsx)("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-green-400 opacity-75"}),(0,a.jsx)("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-green-500"})]}),"Now Running"]}),(0,a.jsxs)("span",{className:"text-[10px] text-[var(--muted-foreground)] uppercase tracking-wider font-semibold",children:[i.length," Active"]})]}),(0,a.jsx)("div",{className:"flex items-center gap-3",children:i.map(e=>{let r=e.id===n;return(0,a.jsxs)("div",{onClick:()=>null==t?void 0:t(e),className:"group flex items-center gap-3 pl-3 pr-2 py-2 bg-[var(--background)] border border-[var(--border)] rounded-lg hover:border-[var(--primary)] transition-all cursor-pointer shadow-sm hover:shadow-md min-w-[280px]",children:[(0,a.jsx)("div",{className:"w-8 h-8 rounded-full bg-[var(--muted)] flex items-center justify-center text-xs font-bold border border-[var(--border)] shrink-0",children:e.provider?e.provider.substring(0,2).toUpperCase():"AG"}),(0,a.jsxs)("div",{className:"flex flex-col flex-1 min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs mb-0.5",children:[(0,a.jsxs)("span",{className:"font-semibold text-[var(--foreground)] truncate max-w-[120px]",children:[e.provider||"Agent"," ",e.model?"• ".concat(e.model):""]}),(0,a.jsx)("span",{className:"font-mono text-[var(--muted-foreground)]",children:d[e.id]||"0m"})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-[11px] text-[var(--muted-foreground)] truncate max-w-[140px]",children:e.title||e.content.substring(0,30)}),(0,a.jsx)("div",{className:"w-12 h-1 bg-[var(--muted)] rounded-full overflow-hidden",children:(0,a.jsx)("div",{className:"h-full bg-[var(--primary)] animate-pulse rounded-full",style:{width:"".concat(40*Math.random()+30,"%")}})})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity pl-2 border-l border-[var(--border)]",children:[(0,a.jsx)("button",{type:"button",onClick:t=>{t.stopPropagation(),r||null==o||o(e.id)},disabled:r,className:"p-1 rounded transition-all ".concat(r?"cursor-wait text-[var(--destructive)]/80 opacity-80":"hover:bg-[var(--destructive)]/10 text-[var(--muted-foreground)] hover:text-[var(--destructive)]"),title:r?"Stopping...":"Stop Task",children:r?(0,a.jsx)("span",{className:"inline-flex h-3 w-3 rounded-full border border-[var(--destructive)] border-t-transparent animate-spin"}):(0,a.jsx)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"currentColor",children:(0,a.jsx)("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"})})}),(0,a.jsx)("button",{type:"button",onClick:r=>{r.stopPropagation(),null==l||l(e.id)},className:"p-1 hover:bg-[var(--primary)]/10 text-[var(--muted-foreground)] hover:text-[var(--primary)] rounded",title:"Retry / Restart",children:(0,a.jsxs)("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round",children:[(0,a.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),(0,a.jsx)("path",{d:"M3 3v5h5"}),(0,a.jsx)("path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16"}),(0,a.jsx)("path",{d:"M16 21h5v-5"})]})})]})]},e.id)})})]})})})}},6779:(e,r,t)=>{t.d(r,{A:()=>m});var a=t(5155),s=t(2115),o=t(7787),l=t(9027),n=t(7587);let i={queued:{borderColor:"var(--status-queued)",bgColor:"var(--status-queued-bg)",textColor:"var(--status-queued)"},in_progress:{borderColor:"var(--status-in-progress)",bgColor:"var(--status-in-progress-bg)",textColor:"var(--status-in-progress)"},blocked:{borderColor:"var(--status-blocked)",bgColor:"var(--status-blocked-bg)",textColor:"var(--status-blocked)"},completed:{borderColor:"var(--status-completed)",bgColor:"var(--status-completed-bg)",textColor:"var(--status-completed)"},failed:{borderColor:"var(--status-failed)",bgColor:"var(--status-failed-bg)",textColor:"var(--status-failed)"},done:{borderColor:"var(--status-completed)",bgColor:"var(--status-completed-bg)",textColor:"var(--status-completed)"}};function d(e){let{task:r,onClick:t}=e,{attributes:s,listeners:o,setNodeRef:d,transform:c,transition:u,isDragging:x}=(0,l.gl)({id:r.id}),m={transform:n.Ks.Transform.toString(c),transition:u},p=i[r.status||"queued"];return(0,a.jsxs)("div",{ref:d,...s,...o,onClick:t,className:"\n group relative flex items-center gap-2 p-1.5 rounded-md\n hover:bg-[var(--item-hover-bg)] transition-all duration-150 cursor-default\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2\n ".concat(x?"opacity-50 bg-[var(--item-hover-bg)]":"","\n "),style:{transform:m.transform,transition:m.transition,touchAction:"none"},children:[(0,a.jsx)("div",{className:"w-2 h-2 rounded-full flex-shrink-0 cursor-grab active:cursor-grabbing hover:scale-125 transition-transform",style:{backgroundColor:p.textColor}}),(0,a.jsxs)("div",{className:"flex-1 min-w-0 flex items-center justify-between gap-3",children:[(0,a.jsx)("h4",{className:"text-sm text-[var(--foreground)] truncate leading-tight\n ".concat("completed"===r.status?"text-[var(--muted-foreground)] line-through":"","\n "),children:r.title||"Untitled Task"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 opacity-0 group-hover:opacity-100 transition-opacity",children:[void 0!==r.priority&&(0,a.jsxs)("span",{className:"text-[10px] font-mono ".concat(0===r.priority?"text-red-500 font-bold":"text-[var(--muted-foreground)]"),children:["P",r.priority]}),(0,a.jsx)("button",{className:"p-0.5 text-[var(--muted-foreground)] hover:text-[var(--foreground)] rounded",children:(0,a.jsx)("svg",{className:"w-3.5 h-3.5",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M8.49999 4.10001V8.49999H12.9V9.49999H8.49999V13.9H7.49999V9.49999H3.1V8.49999H7.49999V4.10001H8.49999Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})})]})]})]})}let c={queued:{borderColor:"var(--status-queued)",bgColor:"var(--status-queued-bg)",textColor:"var(--status-queued)"},in_progress:{borderColor:"var(--status-in-progress)",bgColor:"var(--status-in-progress-bg)",textColor:"var(--status-in-progress)"},blocked:{borderColor:"var(--status-blocked)",bgColor:"var(--status-blocked-bg)",textColor:"var(--status-blocked)"},completed:{borderColor:"var(--status-completed)",bgColor:"var(--status-completed-bg)",textColor:"var(--status-completed)"},failed:{borderColor:"var(--status-failed)",bgColor:"var(--status-failed-bg)",textColor:"var(--status-failed)"},done:{borderColor:"var(--status-completed)",bgColor:"var(--status-completed-bg)",textColor:"var(--status-completed)"}};function u(e){let{task:r}=e,t=c[r.status||"queued"];return(0,a.jsxs)("div",{className:"w-72 p-3 bg-[var(--background)] rounded-lg border-l-[3px] shadow-2xl cursor-grabbing ring-2 ring-[var(--primary)] ring-offset-2 ring-offset-[var(--background)] rotate-2 scale-105",style:{borderLeftColor:t.borderColor},children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[(0,a.jsx)("div",{className:"flex items-center gap-1.5",children:void 0!==r.priority&&(0,a.jsxs)("span",{className:"text-[10px] font-mono font-semibold text-[var(--muted-foreground)] bg-[var(--muted)] px-1.5 py-0.5 rounded",children:["P",r.priority]})}),r.project&&(0,a.jsx)("span",{className:"text-[10px] px-1.5 py-0.5 bg-[var(--accent-muted)] text-[var(--accent)] rounded-full font-medium truncate max-w-[100px]",children:r.project})]}),(0,a.jsx)("h4",{className:"text-sm font-medium line-clamp-2 text-[var(--primary)] leading-snug",children:r.title||"Untitled"}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-2 text-[10px] text-[var(--muted-foreground)]",children:[r.engine&&(0,a.jsxs)("span",{className:"flex items-center gap-1",children:[(0,a.jsx)("span",{children:"\uD83E\uDD16"}),(0,a.jsx)("span",{className:"capitalize",children:r.engine})]}),r.status&&(0,a.jsx)("span",{className:"px-1.5 py-0.5 rounded font-medium",style:{background:t.bgColor,color:t.textColor},children:r.status.replace("_"," ")})]})]})}var x=t(2325);function m(e){let{tasks:r,onTasksChange:t,onSelectTask:n,onTaskUpdate:i,onAddTask:d,stages:c,stageConfig:m,isValidTransition:v,isCreatingTask:f,creatingStage:g}=e,b=c||x.Tw,h=m||x.ls,j=v||((e,r)=>{if(e===r)return!0;let t=b.indexOf(e),a=b.indexOf(r);return a<t||a===t+1}),[y,w]=(0,s.useState)(null),[N,C]=(0,s.useState)(r);(0,s.useEffect)(()=>{y||C(r)},[r,y]);let k=(0,s.useMemo)(()=>{let e={};for(let r of b)e[r]=N.filter(e=>e.stage===r).sort((e,r)=>(e.priority||0)-(r.priority||0));return e},[N,b]),M=(0,o.FR)((0,o.MS)(o.AN,{activationConstraint:{distance:8}}));async function q(e){let{active:a,over:s}=e;if(w(null),!s)return void C(r);let o=a.id,n=s.id,d=N.find(e=>e.id===o);if(!d)return;let c=d.stage,u=d.priority||0;if(b.includes(n)){let e=k[c=n];u=e.length>0?Math.max(...e.map(e=>e.priority||0))+1:0}else{let e=N.find(e=>e.id===n);if(e){c=e.stage;let r=N.filter(e=>e.stage===c),a=r.findIndex(e=>e.id===o),s=r.findIndex(e=>e.id===n);if(-1!==a&&-1!==s&&a!==s){let e=(0,l.be)(r,a,s),o=N.map(r=>{let t=e.findIndex(e=>e.id===r.id);return -1!==t?{...r,priority:t}:r});C(o),null==t||t(o)}u=e.priority||0}}let x=r.find(e=>e.id===o);if(x&&!j(x.stage||"",c))return void C(r);if(i&&(d.stage!==c||d.priority!==u))try{await i(o,{stage:c,priority:u,status:"done"===c?"completed":"ideation"===c?"queued":"in_progress"}),null==t||t(N)}catch(e){console.error("Failed to update task:",e),C(r)}}return(0,a.jsxs)(o.Mp,{sensors:M,collisionDetection:o.y$,onDragStart:function(e){let r=N.find(r=>r.id===e.active.id);r&&w(r)},onDragOver:function(e){let r,{active:t,over:a}=e;if(!a)return;let s=t.id,o=a.id,l=N.find(e=>e.id===s);if(l){if(b.includes(o))r=o;else{let e=N.find(e=>e.id===o);if(!e)return;r=e.stage}if(l.stage!==r){if(!j(l.stage||"",r))return;C(e=>e.map(e=>e.id===s?{...e,stage:r}:e))}}},onDragEnd:q,children:[(0,a.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-4 px-4 scrollbar-thin h-full items-stretch",children:b.map((e,r)=>(0,a.jsx)(p,{stage:e,tasks:k[e]||[],onSelectTask:n,index:r,onAddTask:d,config:h[e]||{icon:"\uD83D\uDCCC",label:e,color:"var(--primary)"},isCreating:!!(f&&g===e)},e))}),(0,a.jsx)(o.Hd,{dropAnimation:{duration:200,easing:"cubic-bezier(0.18, 0.67, 0.6, 1.22)"},children:y?(0,a.jsx)(u,{task:y}):null})]})}function p(e){let{stage:r,tasks:t,onSelectTask:s,index:n,onAddTask:i,config:c,isCreating:u=!1}=e,{setNodeRef:x,isOver:m}=(0,o.zM)({id:r}),p=!i||u;return(0,a.jsxs)("div",{ref:x,id:r,className:"\n kanban-column flex-shrink-0 w-80 \n flex flex-col h-full max-h-full\n bg-[var(--column-bg)] rounded-xl border border-[var(--border)]\n transition-colors duration-200\n ".concat(m?"ring-2 ring-[var(--primary)] ring-opacity-50 bg-[var(--primary-muted)]":"","\n "),style:{animationDelay:"".concat(50*n,"ms")},children:[(0,a.jsxs)("div",{className:"p-3 flex items-center justify-between border-b border-[var(--border)] bg-[var(--column-header-bg)] rounded-t-xl sticky top-0 z-10",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"font-semibold text-sm text-[var(--foreground)]",children:c.label}),(0,a.jsx)("span",{className:"px-2 py-0.5 rounded-full bg-white border border-[var(--border)] text-xs font-medium text-[var(--muted-foreground)] tabular-nums shadow-sm",children:t.length})]}),(0,a.jsx)("button",{onClick:()=>null==i?void 0:i(r),disabled:p,className:"\n w-8 h-8 rounded-lg flex items-center justify-center text-lg leading-none transition-all\n ".concat(p?"opacity-40 cursor-not-allowed text-[var(--muted-foreground)]":"hover:bg-[var(--primary)] hover:text-white hover:shadow-md text-[var(--muted-foreground)] active:scale-95","\n "),title:"Add task to ".concat(c.label),children:u?(0,a.jsx)("span",{className:"spinner w-3 h-3 border-2 border-[var(--muted-foreground)] border-t-[var(--primary)] rounded-full"}):"+"})]}),(0,a.jsx)(l.gB,{items:t.map(e=>e.id),strategy:l._G,children:(0,a.jsx)("div",{className:"flex-1 p-2 overflow-y-auto scrollbar-thin space-y-2.5",children:0===t.length?(0,a.jsxs)("div",{className:"h-full min-h-[120px] flex flex-col items-center justify-center border-2 border-dashed border-[var(--border)] rounded-lg m-1 opacity-60 hover:opacity-100 transition-opacity bg-[var(--background)]",children:[(0,a.jsx)("span",{className:"text-2xl mb-2 opacity-50 grayscale",children:c.icon}),(0,a.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] font-medium",children:"No tasks"})]}):t.map((e,r)=>(0,a.jsx)("div",{className:"animate-fade-in-up",style:{animationDelay:"".concat(30*r,"ms")},children:(0,a.jsx)(d,{task:e,onClick:()=>null==s?void 0:s(e)})},e.id))})})]})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8008],{63:(e,t,r)=>{"use strict";var s=r(7260);r.o(s,"usePathname")&&r.d(t,{usePathname:function(){return s.usePathname}}),r.o(s,"useRouter")&&r.d(t,{useRouter:function(){return s.useRouter}}),r.o(s,"useSearchParams")&&r.d(t,{useSearchParams:function(){return s.useSearchParams}})},926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),!function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{callServer:function(){return s.callServer},createServerReference:function(){return c.createServerReference},findSourceMapURL:function(){return n.findSourceMapURL}});let s=r(1209),n=r(5153),c=r(7197)},4956:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(5155),n=r(2115),c=r(63),a=r(926);let l=(0,a.createServerReference)("4079ee8df08e3a0b0d8d2aef65e271182ce95899cc",a.callServer,void 0,a.findSourceMapURL,"approveDeviceCode");function o(){let e=(0,c.useSearchParams)(),t=(0,c.useRouter)(),r=e.get("user_code")||"",[a,o]=(0,n.useState)(r),[u,i]=(0,n.useState)(!1),[d,f]=(0,n.useState)(null),[x,h]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(x){let e=setTimeout(()=>{t.push("/projects")},3e3);return()=>clearTimeout(e)}},[x,t]);let m=async e=>{e.preventDefault(),i(!0),f(null);try{let e=await l(a);if(!e.success)throw Error(e.error);h(!0)}catch(e){f(e.message)}finally{i(!1)}};return x?(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-neutral-900 text-white p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full bg-neutral-800 p-8 rounded-xl shadow-2xl text-center",children:[(0,s.jsx)("h1",{className:"text-3xl font-bold mb-4 text-green-400",children:"Success!"}),(0,s.jsx)("p",{className:"text-gray-300 mb-2",children:"You have successfully authenticated your device."}),(0,s.jsx)("p",{className:"text-gray-400 text-sm mb-6 italic",children:"Redirecting to projects in a few seconds..."}),(0,s.jsx)("button",{onClick:()=>t.push("/projects"),className:"w-full py-3 px-4 bg-white text-black font-semibold rounded-lg hover:bg-gray-200 transition-colors",children:"Go to Projects"})]})}):(0,s.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-neutral-900 text-white p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full bg-neutral-800 p-8 rounded-xl shadow-2xl",children:[(0,s.jsx)("h1",{className:"text-2xl font-bold mb-6 text-center",children:"Connect Device"}),(0,s.jsx)("p",{className:"text-gray-400 mb-8 text-center text-sm",children:"Enter the code displayed on your device to authorize it."}),(0,s.jsxs)("form",{onSubmit:m,className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{htmlFor:"code",className:"block text-sm font-medium text-gray-400 mb-2",children:"Device Code"}),(0,s.jsx)("input",{type:"text",id:"code",value:a,onChange:e=>o(e.target.value.toUpperCase()),placeholder:"BCDF-XXXX",className:"w-full px-4 py-3 bg-neutral-900 border border-neutral-700 rounded-lg text-white placeholder-neutral-600 focus:outline-none focus:ring-2 focus:ring-blue-500 font-mono text-center tracking-widest text-lg uppercase",required:!0})]}),d&&(0,s.jsx)("div",{className:"p-3 bg-red-900/50 border border-red-800 rounded-lg text-red-200 text-center text-sm",children:d}),(0,s.jsx)("button",{type:"submit",disabled:u,className:"w-full py-3 px-4 bg-white text-black font-semibold rounded-lg hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:u?"Verifying...":"Authorize Device"})]})]})})}function u(){return(0,s.jsx)(n.Suspense,{fallback:(0,s.jsx)("div",{children:"Loading..."}),children:(0,s.jsx)(o,{})})}},5109:(e,t,r)=>{Promise.resolve().then(r.bind(r,4956))}},e=>{e.O(0,[8441,1255,7358],()=>e(e.s=5109)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{63:(e,a,t)=>{"use strict";var s=t(7260);t.o(s,"usePathname")&&t.d(a,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(a,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(a,{useSearchParams:function(){return s.useSearchParams}})},415:(e,a,t)=>{"use strict";t.r(a),t.d(a,{default:()=>f});var s=t(5155),r=t(2115),l=t(63),n=t(1460),o=t(2888),d=t(6779),i=t(2835),c=t(5826),u=t(2325),m=t(8545);function x(e){let{onClose:a,workflowId:t}=e,{workflow:l,isLoading:n,refetch:o}=(0,u.mP)({workflowId:t}),{providers:d}=(0,m.u)(),[i,c]=(0,r.useState)([]),[x,p]=(0,r.useState)(null),[v,h]=(0,r.useState)(!1),[g,b]=(0,r.useState)({}),f=e=>u.ls[e]||{icon:"\uD83D\uDCCC",label:e.charAt(0).toUpperCase()+e.slice(1),color:"var(--primary)"};(0,r.useEffect)(()=>{let e=(Array.isArray(null==l?void 0:l.nodes)?l.nodes:[]).slice().sort((e,a)=>(e.position||0)-(a.position||0)).map(e=>{var a,t;return{id:e.id,name:e.name,label:e.label||e.name,prompt:e.prompt||"",provider:e.provider||"codex",model:e.model||"",swarm:!!(null==e||null==(a=e.metadata)?void 0:a.swarm),swarm_models:Array.isArray(null==e||null==(t=e.metadata)?void 0:t.swarm_models)?e.metadata.swarm_models:[],metadata:(null==e?void 0:e.metadata)&&"object"==typeof e.metadata?e.metadata:{}}});c(e),b({}),p(a=>a&&e.some(e=>e.id===a)?a:e.length?e[0].id:null)},[null==l?void 0:l.id,null==l?void 0:l.nodes]);let j=i.findIndex(e=>e.id===x),w=j>=0?i[j]:null,N=w?{...w,...g[w.id]||{}}:null,y=(e,a)=>{w&&b(t=>({...t,[w.id]:{...t[w.id]||{},[e]:a}}))},k=async()=>{if(l){h(!0);try{let e=i.map(e=>{let a={...e,...g[e.id]||{}};return{...a,metadata:{...a.metadata||{},swarm:!!a.swarm,swarm_models:a.swarm_models||[]}}}),t=await fetch("/api/workflows/".concat(l.id,"/nodes"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodes:e.map(e=>({id:e.id,prompt:e.prompt,provider:e.provider,model:e.model,metadata:e.metadata}))})});if(!t.ok)throw Error("Failed to save workflow");await t.json(),o(),b({}),a()}catch(e){console.error("Error saving workflow:",e)}finally{h(!1)}}};return n&&!l?(0,s.jsx)("div",{className:"modal-backdrop p-4 flex items-center justify-center",children:(0,s.jsx)("span",{className:"spinner w-8 h-8 border-2 border-white/20 border-t-white"})}):(0,s.jsx)("div",{className:"modal-backdrop p-4",onClick:e=>e.target===e.currentTarget&&a(),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-5xl h-[85vh] flex flex-col animate-scale-in p-0 bg-[var(--card-bg)] overflow-hidden rounded-xl border border-[var(--card-border)] shadow-2xl",children:[(0,s.jsxs)("div",{className:"px-6 py-4 border-b border-[var(--border)] flex items-center justify-between bg-[var(--background)]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-lg font-bold flex items-center gap-2",children:[(0,s.jsx)("span",{children:"⚙️"})," Workflow Configuration"]}),(0,s.jsxs)("p",{className:"text-xs text-[var(--muted-foreground)] mt-0.5",children:["Editing: ",(0,s.jsx)("span",{className:"font-mono text-[var(--foreground)]",children:(null==l?void 0:l.name)||"Loading..."})]})]}),(0,s.jsx)("button",{onClick:a,className:"btn-ghost p-2 rounded",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,s.jsxs)("div",{className:"w-64 bg-[var(--muted)]/30 border-r border-[var(--border)] overflow-y-auto p-4 flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2 px-2",children:(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--muted-foreground)]",children:"Steps"})}),0===i.length&&(0,s.jsx)("div",{className:"text-sm text-[var(--muted-foreground)] px-2 italic",children:"No steps defined in this workflow."}),i.map(e=>{let a=f(e.name),t=!!g[e.id];return(0,s.jsxs)("button",{onClick:()=>p(e.id),className:"w-full text-left px-3 py-2.5 rounded-lg text-sm font-medium transition-all flex items-center gap-3 ".concat(x===e.id?"bg-[var(--card-bg)] text-[var(--foreground)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:bg-[var(--card-bg)]/50"),children:[(0,s.jsx)("span",{className:"text-base",children:a.icon}),(0,s.jsx)("span",{className:"flex-1 truncate",children:e.label||a.label}),t&&(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--accent)]"})]},e.id)})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-8 relative bg-[var(--card-bg)]",children:[N?(0,s.jsxs)("div",{className:"max-w-3xl mx-auto space-y-8 animate-fade-in",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 pb-6 border-b border-[var(--border)]",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--muted)]/50 flex items-center justify-center text-2xl shadow-inner",children:f(N.name).icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:N.label}),(0,s.jsxs)("p",{className:"text-sm text-[var(--muted-foreground)] font-mono opacity-70",children:["ID: ",N.id," • Key: ",N.name]})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("label",{className:"text-sm font-semibold uppercase tracking-wider text-[var(--muted-foreground)]",children:"System Prompt"}),(0,s.jsx)("span",{className:"text-xs text-[var(--muted-foreground)] bg-[var(--muted)]/50 px-2 py-0.5 rounded",children:"Markdown Supported"})]}),(0,s.jsx)("textarea",{value:N.prompt||"",onChange:e=>y("prompt",e.target.value),className:"input w-full h-64 font-mono text-sm leading-relaxed resize-y p-4",placeholder:"Define the agent's behavior, constraints, and output format for this stage..."})]}),(0,s.jsxs)("div",{className:"p-6 rounded-xl bg-[var(--muted)]/20 border border-[var(--border)] space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h4",{className:"font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{children:"\uD83E\uDD16"})," Model Settings"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 bg-[var(--card-bg)] px-3 py-1.5 rounded-lg border border-[var(--border)]",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Swarm Mode"}),(0,s.jsx)("button",{onClick:()=>y("swarm",!N.swarm),className:"w-9 h-5 rounded-full transition-colors relative ".concat(N.swarm?"bg-[var(--primary)]":"bg-[var(--muted-foreground)]/30"),children:(0,s.jsx)("span",{className:"absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform ".concat(N.swarm?"translate-x-4":"translate-x-0")})})]})]}),N.swarm?(0,s.jsxs)("div",{className:"space-y-4 animate-fade-in",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-[var(--muted-foreground)]",children:"Swarm Models"}),(0,s.jsx)("button",{onClick:()=>{y("swarm_models",[...N.swarm_models||[],{provider:"gemini",model:""}])},className:"btn-secondary text-xs px-2 py-1",children:"+ Add Model"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[0===(N.swarm_models||[]).length&&(0,s.jsx)("div",{className:"text-center py-8 border-2 border-dashed border-[var(--border)] rounded-lg text-sm text-[var(--muted-foreground)]",children:"No models configured for swarm. Add one to enable."}),(N.swarm_models||[]).map((e,a)=>(0,s.jsxs)("div",{className:"flex gap-2 items-center group",children:[(0,s.jsx)("select",{value:e.provider,onChange:e=>{let t=[...N.swarm_models||[]];t[a].provider=e.target.value,y("swarm_models",t)},className:"input text-sm py-1.5 w-32",children:d.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,s.jsx)("input",{value:e.model,onChange:e=>{let t=[...N.swarm_models||[]];t[a].model=e.target.value,y("swarm_models",t)},placeholder:"Model name (e.g. gemini-1.5-pro)",className:"input text-sm py-1.5 flex-1"}),(0,s.jsx)("button",{onClick:()=>{y("swarm_models",(N.swarm_models||[]).filter((e,t)=>t!==a))},className:"text-[var(--muted-foreground)] hover:text-[var(--destructive)] hover:bg-[var(--destructive)]/10 p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",children:"✕"})]},a))]})]}):(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 animate-fade-in",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold text-[var(--muted-foreground)] uppercase",children:"Provider"}),(0,s.jsx)("select",{value:N.provider||"gemini",onChange:e=>y("provider",e.target.value),className:"input w-full text-sm py-2",children:d.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold text-[var(--muted-foreground)] uppercase",children:"Model"}),(0,s.jsx)("input",{value:N.model||"",onChange:e=>y("model",e.target.value),placeholder:"e.g. gemini-2.0-flash",className:"input w-full text-sm py-2"})]})]})]})]}):null,!w&&i.length>0&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-[var(--muted-foreground)]",children:[(0,s.jsx)("span",{className:"text-4xl mb-4 opacity-30",children:"\uD83D\uDC48"}),(0,s.jsx)("p",{children:"Select a step from the sidebar to configure it."})]})]})]}),(0,s.jsxs)("div",{className:"px-6 py-4 border-t border-[var(--border)] bg-[var(--background)] flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:a,className:"btn-ghost px-4 py-2",children:"Cancel"}),(0,s.jsxs)("button",{onClick:k,disabled:v||0===Object.keys(g).length,className:"btn-primary px-6 py-2 flex items-center gap-2",children:[v&&(0,s.jsx)("span",{className:"spinner w-4 h-4 border-2 border-white/20 border-t-white"}),v?"Saving...":"Save Changes"]})]})]})})}var p=t(577),v=t(91);function h(){return(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-[var(--card-bg)] border border-[var(--card-border)]",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex gap-2 mb-2",children:[(0,s.jsx)("div",{className:"skeleton h-4 w-8 rounded"}),(0,s.jsx)("div",{className:"skeleton h-4 w-16 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-3/4 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-20 rounded-full"})]}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("div",{className:"skeleton h-4 w-24 rounded"}),(0,s.jsx)("div",{className:"skeleton h-4 w-12 rounded"})]})]})}function g(){return(0,s.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-4 px-4",children:[1,2,3,4,5].map(e=>(0,s.jsxs)("div",{className:"flex-shrink-0 w-72 kanban-column",children:[(0,s.jsx)("div",{className:"kanban-column-header",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"skeleton h-6 w-6 rounded"}),(0,s.jsx)("div",{className:"skeleton h-5 w-20 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-6 rounded-full"})]})}),(0,s.jsx)("div",{className:"p-2 space-y-2",children:[1,2].map(e=>(0,s.jsxs)("div",{className:"p-3 rounded-lg bg-[var(--background)] border-l-2 border-[var(--card-border)]",children:[(0,s.jsx)("div",{className:"skeleton h-3 w-12 rounded mb-2"}),(0,s.jsx)("div",{className:"skeleton h-4 w-full rounded mb-2"}),(0,s.jsx)("div",{className:"skeleton h-3 w-20 rounded"})]},e))})]},e))})}function b(){var e,a,t,b;let f=(0,l.useRouter)(),j=(0,l.useSearchParams)(),w=(0,l.usePathname)(),N=(null==j?void 0:j.get("project"))||void 0,y=j.get("view")||"kanban",k=j.get("sort")||"newest",[C,_]=(0,r.useState)(y),[S,A]=(0,r.useState)(k),[T,D]=(0,r.useState)("all"),[E,L]=(0,r.useState)(""),[P,R]=(0,r.useState)(null),[M,I]=(0,r.useState)(null),[B,q]=(0,r.useState)(!1),[U,F]=(0,r.useState)(null),[O,X]=(0,r.useState)(!1),[z,W]=(0,r.useState)(""),[G,V]=(0,r.useState)(!1),[K,Q]=(0,r.useState)("single"),[H,Y]=(0,r.useState)("gemini"),[J,Z]=(0,r.useState)(""),[$,ee]=(0,r.useState)([]),[ea,et]=(0,r.useState)("gemini"),[es,er]=(0,r.useState)(""),[el,en]=(0,r.useState)(null),[eo,ed]=(0,r.useState)(!1),[ei,ec]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(null),{providers:ex}=(0,m.u)();(0,r.useEffect)(()=>{let e=e=>{let a=e.target,t=["INPUT","TEXTAREA","SELECT"].includes(a.tagName)||a.isContentEditable;if("n"!==e.key||t||(e.preventDefault(),X(!0)),"/"===e.key&&!t){var s;e.preventDefault(),null==(s=document.getElementById("task-search"))||s.focus()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let{tasks:ep,isLoading:ev,createTask:eh,updateTask:eg,deleteTask:eb,completeTaskStage:ef,cancelWorkflow:ej,refetch:ew,cancellingTaskId:eN,fetchTask:ey}=(0,p.si)({realtime:!0,project:N}),{projects:ek,isLoading:eC}=(0,v.Y)(),{comments:e_,addComment:eS,deleteComment:eA}=(0,p.LU)((null==P?void 0:P.id)||null),{learnings:eT,addLearning:eD}=(0,p.dF)((null==P?void 0:P.id)||void 0),{workflow:eE,stages:eL,stageConfig:eP,isValidTransition:eR,isLoading:eM}=(0,u.mP)(),eI=(0,r.useMemo)(()=>eL.map(e=>{var a;let t=eP[e],s=null==eE||null==(a=eE.nodes)?void 0:a.find(a=>a.name===e);return{id:e,label:(null==t?void 0:t.label)||e,icon:(null==t?void 0:t.icon)||"\uD83D\uDCCC",color:(null==t?void 0:t.color)||"var(--primary)",prompt:(null==s?void 0:s.prompt)||void 0}}),[eL,eP,eE]),eB=e=>{_(e);let a=new URLSearchParams(j);a.set("view",e),f.push("".concat(w,"?").concat(a.toString()))},eq=(0,r.useMemo)(()=>{let e=[...ep];if(E){let a=E.toLowerCase();e=e.filter(e=>{var t,s,r;return(null==(t=e.title)?void 0:t.toLowerCase().includes(a))||(null==(s=e.description)?void 0:s.toLowerCase().includes(a))||e.id.toLowerCase().includes(a)||(null==(r=e.project)?void 0:r.toLowerCase().includes(a))})}return"all"!==T&&(e="active"===T?e.filter(e=>"completed"!==e.status&&"failed"!==e.status):e.filter(e=>e.status===T)),e.sort((e,a)=>{switch(S){case"newest":return new Date(a.created_at).getTime()-new Date(e.created_at).getTime();case"oldest":return new Date(e.created_at).getTime()-new Date(a.created_at).getTime();case"priority":return(e.priority||0)-(a.priority||0);case"updated":return new Date(a.updated_at).getTime()-new Date(e.updated_at).getTime();default:return 0}}),e},[ep,E,T,S]),eU=(0,r.useCallback)(async(e,a)=>{a&&R(a);try{let a=await ey(e);return R(a),a}catch(e){return console.error("Failed to load task details:",e),a||R(null),null!=a?a:null}},[ey]),eF=(0,r.useCallback)(async e=>{await eU(e.id,e)},[eU]),eO=(0,r.useCallback)(async e=>{var a,t;let s=N?ek.find(e=>e.slug===N):null;I({stage:e,project:null!=(a=null==s?void 0:s.slug)?a:null,project_id:null!=(t=null==s?void 0:s.id)?t:null})},[N,ek]),eX=(0,r.useCallback)(async e=>{var a,t;let s=(e.description||"").trim();if(!s)return;ec(!0);let r=e.stage||(null==M?void 0:M.stage)||"ideation";em(r);let l="done"===r?"completed":"ideation"===r?"queued":"in_progress",n=(null==eP||null==(a=eP[r])?void 0:a.label)||r,o=(e.title||"").trim()||s.split("\n")[0].replace(/^#\s*/,"")||"New Task (".concat(n,")"),d=["status: ".concat(l),"stage: ".concat(r)],i=e.project_id&&ek.find(a=>a.id===e.project_id)||e.project&&ek.find(a=>a.slug===e.project)||(N?ek.find(e=>e.slug===N):null);i&&(d.push("project: ".concat(i.slug)),d.push("project_id: ".concat(i.id)),d.push("workflow_id: ".concat(i.workflow_id||u.ou))),e.provider&&d.push("provider: ".concat(e.provider)),e.model&&d.push("model: ".concat(e.model)),void 0!==e.swarm&&d.push("swarm: ".concat(e.swarm?"true":"false"));let c="---\n".concat(d.join("\n"),"\n---\n\n# ").concat(o,"\n\n").concat(s);try{let a=e.swarm?null!=(t=e.swarm_models)?t:[]:null,s=await eh(c,a);I(null),await eU(s.id,s)}catch(e){console.error("Failed to create task:",e)}finally{ec(!1),em(null)}},[eh,M,eU,N,ek,eP]),ez=(0,r.useCallback)(async(e,a)=>{await eg(e,a)},[eg]),eW=async e=>{let a=ep.find(a=>a.id===e);F(null);try{var t;await ej({taskId:e}),await ew(),F({type:"success",message:"Cancellation requested for ".concat((null==a?void 0:a.title)||(null==a||null==(t=a.content)?void 0:t.slice(0,30))||e,".")})}catch(s){console.error("Failed to stop task",s);let t=s instanceof Error?s.message:"unknown error";F({type:"error",message:"Unable to stop ".concat((null==a?void 0:a.title)||e,": ").concat(t,".")})}},eG=async e=>{try{await ef({taskId:e,decision:"not_done",final_result:"Manual retry requested.",explanation:"Manual retry requested."})}catch(e){console.error("Failed to retry task",e)}};(0,r.useEffect)(()=>{if(!U)return;let e=setTimeout(()=>F(null),5e3);return()=>clearTimeout(e)},[U]);let eV=async()=>{if(z.trim()&&!G){V(!0);try{var e;let a=["status: queued","stage: ideation"];"single"!==K&&a.push("swarm: true");let t=el||(N?null==(e=ek.find(e=>e.slug===N))?void 0:e.id:null);if(t){let e=ek.find(e=>e.id===t);e&&(a.push("project: ".concat(e.slug)),a.push("project_id: ".concat(e.id)),a.push("workflow_id: ".concat(e.workflow_id||u.ou)))}let s="---\n".concat(a.join("\n"),"\n---\n\n# ").concat(z,"\n");await eh(s,"swarm"===K?$:null),W(""),Q("single"),Y("gemini"),Z(""),ee([]),et("gemini"),er(""),X(!1),en(null)}catch(e){console.error("Failed to create task:",e)}finally{V(!1)}}},eK=async(e,a)=>{let t="---\n".concat(["status: ".concat("ideation"===a?"queued":"in_progress"),"stage: ".concat(a)].join("\n"),"\n---\n\n# ").concat(e,"\n");await eh(t,null),ed(!1)},eQ=async e=>{P&&await eS(e)},eH=async(e,a,t)=>{var s,r;let l=(null==P||null==(r=P.project_context)||null==(s=r.project)?void 0:s.id)||(null==P?void 0:P.project_id)||(null==P?void 0:P.project)||void 0,n=null!=t?t:"global"===a?void 0:"task"===a?null==P?void 0:P.id:l;await eD(e,a,n)},eY=async e=>{P&&(R(a=>a?{...a,...e}:null),await eg(P.id,e))};return(ep.length,ep.filter(e=>"in_progress"===e.status).length,ep.filter(e=>"queued"===e.status).length,ep.filter(e=>"completed"===e.status).length,(ev||eM)&&0===ep.length)?(0,s.jsxs)("div",{className:"h-full flex flex-col p-6 animate-pulse",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,s.jsx)("div",{className:"h-8 w-48 bg-[var(--card-border)] rounded"}),(0,s.jsx)("div",{className:"h-10 w-32 bg-[var(--card-border)] rounded"})]}),(0,s.jsx)("div",{className:"h-12 w-full bg-[var(--card-border)] rounded mb-8"}),"kanban"===C?(0,s.jsx)(g,{}):(0,s.jsx)("div",{className:"space-y-4",children:[1,2,3].map(e=>(0,s.jsx)(h,{},e))})]}):(0,s.jsx)(n.A,{fullWidth:!0,noFooter:!0,children:(0,s.jsxs)("div",{className:"flex flex-col h-full ".concat("kanban"===C?"max-w-full":"max-w-6xl mx-auto w-full px-4"),children:[(0,s.jsxs)("div",{className:"relative flex items-center justify-center gap-4 py-3 px-4 border-b border-[var(--border)] bg-[var(--background)] flex-shrink-0 z-20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"relative w-80",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)("svg",{className:"h-5 w-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})})}),(0,s.jsx)("input",{id:"task-search",type:"text",placeholder:"Search tasks... (/)",className:"block w-full rounded-md border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 bg-white shadow-sm",value:E,onChange:e=>L(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex items-center bg-gray-100 p-1 rounded-lg border border-gray-200",children:[(0,s.jsx)("button",{onClick:()=>eB("list"),className:"px-3 py-1 text-xs font-medium rounded transition-all ".concat("list"===C?"bg-white shadow-sm text-gray-900":"text-gray-500 hover:text-gray-700"),children:"List"}),(0,s.jsx)("button",{onClick:()=>eB("kanban"),className:"px-3 py-1 text-xs font-medium rounded transition-all ".concat("kanban"===C?"bg-white shadow-sm text-gray-900":"text-gray-500 hover:text-gray-700"),children:"Board"})]}),(0,s.jsxs)("button",{onClick:()=>q(!0),className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium text-gray-700 bg-white border border-gray-200 rounded-lg shadow-sm hover:bg-gray-50 transition-all",title:"Configure Workflow",children:[(0,s.jsx)("span",{className:"text-base leading-none",children:"⚙️"}),(0,s.jsx)("span",{children:"Workflow"})]})]}),(0,s.jsx)("div",{className:"absolute right-4 flex items-center gap-3"})]}),U&&(0,s.jsx)("div",{className:"px-4 mt-3",children:(0,s.jsx)("div",{role:"status",className:"rounded-xl px-4 py-2 text-xs font-semibold ".concat("success"===U.type?"bg-[var(--success-muted)] text-[var(--success)]":"bg-[var(--destructive-muted)] text-[var(--destructive)]"),children:U.message})}),(0,s.jsx)("div",{className:"flex-shrink-0 mt-2 px-4",children:(0,s.jsx)(i.A,{tasks:ep,onTaskClick:R,onStop:eW,onRetry:eG,cancellingTaskId:eN})}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col pt-2",children:"list"===C?(0,s.jsx)("div",{className:"overflow-y-auto h-full px-4",children:(0,s.jsx)(o.A,{tasks:eq,onSelectTask:eF})}):(0,s.jsx)(d.A,{tasks:eq,onSelectTask:eF,onTasksChange:()=>{},onTaskUpdate:ez,onAddTask:eO,stages:eL,stageConfig:eP,isValidTransition:eR,isCreatingTask:ei,creatingStage:eu})}),P&&(0,s.jsx)(c.A,{task:P,comments:P?e_:[],learnings:eT,projectContext:P.project_context,projects:ek,stages:eI,onClose:()=>R(null),onAddComment:eQ,onDeleteComment:eA,onAddLearning:eH,onUpdate:eY,onDelete:async()=>{await eb(P.id),R(null)}}),M&&(0,s.jsx)(c.A,{task:{id:"draft",title:"",description:"",content:"",stage:M.stage,status:"done"===M.stage?"completed":"ideation"===M.stage?"queued":"in_progress",created_at:new Date().toISOString(),project:null!=(t=null!=(a=M.project)?a:N)?t:void 0,project_id:null!=(b=M.project_id)?b:N?null==(e=ek.find(e=>e.slug===N))?void 0:e.id:void 0,provider:M.provider,model:M.model,swarm:M.swarm,swarm_models:M.swarm_models},comments:[],learnings:[],projectContext:null,projects:ek,stages:eI,isDraft:!0,isCreating:ei,onClose:()=>I(null),onAddComment:()=>{},onAddLearning:()=>{},onUpdate:async e=>{if(M){if(e.description||e.title)return void await eX({...M,...e});I(a=>a?{...a,...e}:a)}}}),eo&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-[var(--card-bg)] p-6 rounded-xl w-full max-w-md shadow-2xl border border-[var(--card-border)] animate-scale-in",children:[(0,s.jsx)("h3",{className:"text-lg font-bold mb-4",children:"New Task"}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let a=e.target;eK(a.elements.namedItem("title").value,a.elements.namedItem("stage").value)},children:[(0,s.jsx)("input",{name:"title",autoFocus:!0,placeholder:"Task title...",className:"w-full mb-4 px-3 py-2 bg-[var(--background)] border border-[var(--card-border)] rounded focus:border-[var(--primary)] outline-none",required:!0}),(0,s.jsx)("select",{name:"stage",className:"w-full mb-6 px-3 py-2 bg-[var(--background)] border border-[var(--card-border)] rounded focus:border-[var(--primary)] outline-none",children:eL.map(e=>{var a;return(0,s.jsx)("option",{value:e,children:(null==(a=eP[e])?void 0:a.label)||e},e)})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ed(!1),className:"btn-ghost",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",className:"btn-primary",children:"Create Task"})]})]})]})}),B&&(0,s.jsx)(x,{onClose:()=>q(!1),workflowId:null==eE?void 0:eE.id}),O&&(0,s.jsx)("div",{className:"modal-backdrop p-4",onClick:e=>e.target===e.currentTarget&&X(!1),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-lg p-6 animate-scale-in",children:[(0,s.jsxs)("h2",{className:"text-xl font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)("span",{children:"✨"})," New Task"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)("button",{onClick:()=>Q("single"),className:"px-3 py-1.5 text-xs font-semibold rounded-md uppercase tracking-wide transition-all ".concat("single"===K?"bg-[var(--card-bg)] text-[var(--primary)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:text-[var(--foreground)] border border-transparent"),children:"Single Agent"}),(0,s.jsx)("button",{onClick:()=>Q("swarm"),className:"px-3 py-1.5 text-xs font-semibold rounded-md uppercase tracking-wide transition-all ".concat("swarm"===K?"bg-[var(--card-bg)] text-[var(--primary)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:text-[var(--foreground)] border border-transparent"),children:"Swarm"})]}),(0,s.jsx)("textarea",{value:z,onChange:e=>W(e.target.value),placeholder:"Describe what needs to be done...",className:"input h-32 resize-none mb-4",autoFocus:!0,disabled:G}),(0,s.jsxs)("label",{className:"text-xs font-semibold mb-3 block",children:["Attach to project",(0,s.jsxs)("select",{value:null!=el?el:"",onChange:e=>en(e.target.value||null),className:"input text-sm mt-1",disabled:eC,children:[(0,s.jsxs)("option",{value:"",children:["None (Current: ",N||"All",")"]}),ek.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),"single"===K?(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-1",children:"Provider"}),(0,s.jsx)("select",{value:H,onChange:e=>Y(e.target.value),className:"input text-xs py-1.5 appearance-none",children:ex.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-1",children:"Model"}),(0,s.jsx)("input",{value:J,onChange:e=>Z(e.target.value),placeholder:"e.g. gpt-4.1-mini",className:"input text-xs py-1.5"})]})]}):(0,s.jsx)("div",{className:"mb-4 space-y-3",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-2",children:"Swarm Models"}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.2fr_auto] gap-2",children:[(0,s.jsx)("select",{value:ea,onChange:e=>et(e.target.value),className:"input text-xs py-1.5 appearance-none",children:ex.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,s.jsx)("input",{value:es,onChange:e=>er(e.target.value),placeholder:"model name",className:"input text-xs py-1.5"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=es.trim();if(!e)return;let a={provider:ea,model:e};$.some(e=>e.provider.toLowerCase()===a.provider.toLowerCase()&&e.model.toLowerCase()===a.model.toLowerCase())||(ee(e=>[...e,a]),er(""))},className:"btn-ghost px-3 py-1.5 text-xs",children:"Add"})]}),$.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:$.map((e,a)=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 rounded-md border text-xs bg-[var(--background)] border-[var(--border)]",children:[(0,s.jsxs)("span",{className:"truncate",children:[(0,s.jsx)("span",{className:"text-[var(--muted-foreground)]",children:e.provider}),(0,s.jsx)("span",{className:"mx-1",children:"\xb7"}),(0,s.jsx)("span",{children:e.model})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{ee(e=>e.filter((e,t)=>t!==a))},className:"text-[var(--destructive)] hover:underline",children:"Remove"})]},"".concat(e.provider,"-").concat(e.model,"-").concat(a)))})]})]})}),(0,s.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:()=>{X(!1),W(""),Q("single"),Y("gemini"),Z(""),ee([]),et("gemini"),er("")},disabled:G,className:"btn-ghost px-4 py-2",children:"Cancel"}),(0,s.jsx)("button",{onClick:eV,disabled:!z.trim()||G||"swarm"===K&&0===$.length,className:"btn-primary px-4 py-2 flex items-center gap-2",children:G?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"spinner w-4 h-4 border-2 border-white/20 border-t-white"}),"Creating..."]}):"Create Task"})]})]})})]})})}function f(){return(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)("div",{className:"p-8",children:"Loading..."}),children:(0,s.jsx)(b,{})})}},1460:(e,a,t)=>{"use strict";t.d(a,{A:()=>m});var s=t(5155),r=t(2619),l=t.n(r),n=t(63),o=t(4647),d=t(91),i=t(2115);function c(e){let{children:a,fullWidth:t=!1,noFooter:r=!1}=e;(0,n.usePathname)(),(0,n.useRouter)();let c=(0,n.useSearchParams)(),{user:u,loading:m,signOut:x}=(0,o.A)(),{projects:p,isLoading:v}=(0,d.Y)(),h=null==c?void 0:c.get("project");return(0,i.useMemo)(()=>h?p.find(e=>e.slug===h):null,[p,h]),(0,s.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden",children:[(0,s.jsx)("nav",{className:"flex-shrink-0 border-b border-[var(--card-border)] bg-[var(--card-bg)]/80 backdrop-blur-lg z-30",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,s.jsx)("div",{className:"flex items-center gap-8",children:(0,s.jsxs)(l(),{href:"/",className:"flex items-center gap-3 group",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-[var(--primary)] to-[var(--accent)] flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-[var(--primary)]/20 group-hover:shadow-[var(--primary)]/40 transition-shadow",children:"A"}),(0,s.jsx)("span",{className:"text-lg font-bold tracking-tight gradient-text hidden sm:block",children:"AGX Board"})]})}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(l(),{href:"/settings",className:"text-sm font-medium text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors",children:"Settings"})})]})})}),(0,s.jsx)("main",{className:"flex-1 min-h-0 flex flex-col ".concat(t?"p-0":"p-4 sm:p-6 lg:p-8 overflow-y-auto"),children:a}),!r&&(0,s.jsx)("footer",{className:"flex-shrink-0 border-t border-[var(--card-border)] bg-[var(--card-bg)]/50 py-4",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between text-xs text-[var(--muted-foreground)]",children:[(0,s.jsx)("span",{children:"AGX Board • Autonomous Agent Orchestration"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Built with Next.js + Db"})]})})]})}function u(e){return(0,s.jsx)(i.Suspense,{fallback:(0,s.jsx)("div",{className:"h-screen flex items-center justify-center bg-[var(--background)]",children:(0,s.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"})}),children:(0,s.jsx)(c,{...e})})}function m(e){let{children:a,fullWidth:t=!1,noFooter:r=!1}=e;return(0,s.jsx)(u,{fullWidth:t,noFooter:r,children:a})}},2888:(e,a,t)=>{"use strict";t.d(a,{A:()=>d});var s=t(5155);let r={queued:{className:"badge-status-queued",label:"Queued",dotColor:"bg-[var(--status-queued)]"},in_progress:{className:"badge-status-in_progress",label:"In Progress",dotColor:"bg-[var(--status-in-progress)]"},blocked:{className:"badge-status-blocked",label:"Blocked",dotColor:"bg-[var(--status-blocked)]"},completed:{className:"badge-status-completed",label:"Completed",dotColor:"bg-[var(--status-completed)]"},failed:{className:"badge-status-failed",label:"Failed",dotColor:"bg-[var(--status-failed)]"}},l={ideation:{icon:"\uD83D\uDCA1",label:"Ideation",prompt:"Research and scope. Define approach, estimate effort."},planning:{icon:"\uD83D\uDCCB",label:"Planning",prompt:"Create detailed plan with tasks, milestones, and dependencies."},execution:{icon:"\uD83D\uDCBB",label:"Execution",prompt:"Implement based on all the context/history/research/plan. Write clean, tested code."},verification:{icon:"\uD83E\uDDEA",label:"Verification",prompt:"Test thoroughly. Find edge cases. Fix bugs. Verify requirements are met."},coding:{icon:"\uD83D\uDCBB",label:"Coding",prompt:"Write clean, tested code based on plan."},qa:{icon:"\uD83E\uDDEA",label:"QA",prompt:"Test thoroughly. Find edge cases. Fix bugs."},acceptance:{icon:"✓",label:"Acceptance",prompt:"Demo to user. Get sign-off. Address feedback."},pr:{icon:"\uD83D\uDD00",label:"PR",prompt:"Create and review pull request. Ensure all checks pass and merge."},pr_review:{icon:"\uD83D\uDC40",label:"PR Review",prompt:"Review the PR. Verify code quality and functionality. Approve or request changes."},merge:{icon:"\uD83D\uDE80",label:"Merge",prompt:"Merge the PR and verify deployment."},done:{icon:"✅",label:"Done",prompt:"Task finished and shipped."}};function n(e){let{task:a,onClick:t,compact:n=!1}=e,o=r[a.status||"queued"],d=a.stage?l[a.stage]:null,i=function(e){let a=new Date(e),t=Math.floor((new Date().getTime()-a.getTime())/1e3);return t<60?"just now":t<3600?"".concat(Math.floor(t/60),"m"):t<86400?"".concat(Math.floor(t/3600),"h"):"".concat(Math.floor(t/86400),"d")}(a.created_at);return n?(0,s.jsx)("div",{onClick:t,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&(null==t?void 0:t()),className:"group relative p-3 rounded-lg bg-[var(--card-bg)] border \n ".concat("failed"===a.status?"border-[var(--status-failed)] bg-[var(--status-failed-bg)]":"border-[var(--card-border)]","\n hover:border-[color-mix(in_srgb,var(--primary)_40%,var(--card-border))] \n hover:shadow-[var(--shadow-md)] \n transition-all duration-200 cursor-pointer\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2"),children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full ".concat(o.dotColor," flex-shrink-0")}),(0,s.jsx)("div",{className:"flex-1 min-w-0",children:(0,s.jsx)("h3",{className:"text-sm font-medium text-[var(--foreground)] truncate group-hover:text-[var(--primary)] transition-colors",children:a.title||"Untitled Task"})}),"failed"===a.status?(0,s.jsx)("span",{className:"text-xs text-[var(--status-failed)]",title:a.error,children:"⚠️"}):d&&(0,s.jsx)("span",{className:"text-xs opacity-60 flex-shrink-0",children:d.icon})]})}):(0,s.jsx)("div",{onClick:t,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&(null==t?void 0:t()),className:"group relative p-4 rounded-lg bg-[var(--card-bg)] border \n ".concat("failed"===a.status?"border-[var(--status-failed)] shadow-[0_0_0_1px_var(--status-failed)]":"border-[var(--card-border)]","\n hover:border-[var(--primary)] \n hover:shadow-sm\n transition-all duration-200 cursor-pointer\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2\n animate-fade-in-up"),children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex justify-between items-start gap-2",children:[(0,s.jsx)("h3",{className:"text-base font-semibold text-[var(--foreground)] leading-snug group-hover:text-[var(--primary)] transition-colors line-clamp-3",children:a.title||"Untitled Task"}),"failed"===a.status&&(0,s.jsx)("span",{className:"text-xs px-1.5 py-0.5 rounded bg-[var(--status-failed-bg)] text-[var(--status-failed)] font-bold border border-[var(--status-failed)]",children:"FAILED"})]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 text-xs text-[var(--muted-foreground)] mt-1",children:[void 0!==a.priority&&(0,s.jsxs)("span",{className:"font-mono font-medium ".concat(0===a.priority?"text-[var(--primary)]":""),children:["P",a.priority]}),(0,s.jsx)("span",{className:"w-0.5 h-0.5 rounded-full bg-[var(--muted-foreground)] opacity-50"}),(0,s.jsx)("span",{className:"truncate max-w-[100px]",children:a.project||"No Project"}),(0,s.jsx)("span",{className:"w-0.5 h-0.5 rounded-full bg-[var(--muted-foreground)] opacity-50"}),(0,s.jsx)("span",{className:"capitalize",children:a.swarm?"Swarm":a.provider||a.engine||"No Provider"}),(0,s.jsx)("span",{className:"w-0.5 h-0.5 rounded-full bg-[var(--muted-foreground)] opacity-50"}),(0,s.jsx)("span",{children:i})]})]})})}let o={in_progress:{title:"In Progress",icon:"\uD83D\uDD04",color:"var(--status-in-progress)",description:"Currently being worked on by the daemon"},blocked:{title:"Blocked",icon:"\uD83D\uDEA7",color:"var(--status-blocked)",description:"Waiting for input or resolution"},queued:{title:"Queued",icon:"\uD83D\uDCCB",color:"var(--status-queued)",description:"Ready to be picked up"},completed:{title:"Completed",icon:"✅",color:"var(--status-completed)",description:"Successfully finished"}};function d(e){let{tasks:a,onSelectTask:t}=e;if(0===a.length)return(0,s.jsxs)("div",{className:"text-center py-20 animate-fade-in",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-[var(--card-bg)] border border-[var(--card-border)] mb-4",children:(0,s.jsx)("span",{className:"text-3xl",children:"\uD83D\uDCCB"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No tasks yet"}),(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] text-sm max-w-md mx-auto",children:"Create your first task to get started. Tasks will appear here organized by status."})]});let r=a.filter(e=>"in_progress"===e.status),l=a.filter(e=>"queued"===e.status),d=a.filter(e=>"blocked"===e.status),i=a.filter(e=>"completed"===e.status||"failed"===e.status),c=(e,a)=>{if(0===a.length)return null;let r=o[e];return(0,s.jsxs)("section",{className:"mb-8 animate-fade-in-up",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:"color-mix(in srgb, ".concat(r.color," 10%, transparent)")},children:[(0,s.jsx)("span",{className:"text-lg",children:r.icon}),(0,s.jsx)("h3",{className:"text-sm font-semibold",style:{color:r.color},children:r.title}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, ".concat(r.color," 15%, transparent)"),color:r.color},children:a.length})]}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] hidden sm:block",children:r.description})]}),(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:a.map((e,a)=>(0,s.jsx)("div",{className:"animate-fade-in-up",style:{animationDelay:"".concat(50*a,"ms")},children:(0,s.jsx)(n,{task:e,onClick:()=>null==t?void 0:t(e)})},e.id))})]})};return(0,s.jsxs)("div",{children:[c("in_progress",r),c("blocked",d),c("queued",l),c("completed",i)]})}},4647:(e,a,t)=>{"use strict";t.d(a,{A:()=>i,AuthProvider:()=>d});var s=t(5155),r=t(2115),l=t(1483),n=t(5704);let o=(0,r.createContext)({user:null,loading:!0,signOut:async()=>{}});function d(e){let{children:a}=e,t="1"===n.env.NEXT_PUBLIC_AGX_BOARD_DISABLE_AUTH,[d,i]=(0,r.useState)(null),[c,u]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(t){i({id:n.env.NEXT_PUBLIC_AGX_BOARD_USER_ID||"00000000-0000-0000-0000-000000000001",email:n.env.NEXT_PUBLIC_AGX_BOARD_USER_EMAIL||"local@agx.board",user_metadata:{name:n.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User",full_name:n.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User"},app_metadata:{},aud:"authenticated",created_at:new Date().toISOString()}),u(!1);return}let e=(0,l.O)();e.auth.getSession().then(e=>{var a,t;i(null!=(t=null==(a=e.data.session)?void 0:a.user)?t:null),u(!1)});let{data:{subscription:a}}=e.auth.onAuthStateChange((e,a)=>{var t;i(null!=(t=null==a?void 0:a.user)?t:null),u(!1)});return()=>a.unsubscribe()},[t]);let m=async()=>{if(t)return;let e=(0,l.O)();await e.auth.signOut(),i(null)};return(0,s.jsx)(o.Provider,{value:{user:d,loading:c,signOut:m},children:a})}function i(){return(0,r.useContext)(o)}},9620:(e,a,t)=>{Promise.resolve().then(t.bind(t,415))}},e=>{e.O(0,[5004,277,2619,650,9027,9719,2456,9337,8441,1255,7358],()=>e(e.s=9620)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5105],{63:(e,t,a)=>{"use strict";var s=a(7260);a.o(s,"usePathname")&&a.d(t,{usePathname:function(){return s.usePathname}}),a.o(s,"useRouter")&&a.d(t,{useRouter:function(){return s.useRouter}}),a.o(s,"useSearchParams")&&a.d(t,{useSearchParams:function(){return s.useSearchParams}})},415:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var s=a(5155),r=a(2115),l=a(63),n=a(1460),o=a(2888),i=a(6779),d=a(2835),c=a(5826),u=a(2325),m=a(8545);function x(e){let{onClose:t,workflowId:a}=e,{workflow:l,isLoading:n,refetch:o}=(0,u.mP)({workflowId:a}),{providers:i}=(0,m.u)(),[d,c]=(0,r.useState)([]),[x,p]=(0,r.useState)(null),[h,v]=(0,r.useState)(!1),[g,b]=(0,r.useState)({}),f=e=>u.ls[e]||{icon:"\uD83D\uDCCC",label:e.charAt(0).toUpperCase()+e.slice(1),color:"var(--primary)"};(0,r.useEffect)(()=>{let e=(Array.isArray(null==l?void 0:l.nodes)?l.nodes:[]).slice().sort((e,t)=>(e.position||0)-(t.position||0)).map(e=>{var t,a;return{id:e.id,name:e.name,label:e.label||e.name,prompt:e.prompt||"",provider:e.provider||"codex",model:e.model||"",swarm:!!(null==e||null==(t=e.metadata)?void 0:t.swarm),swarm_models:Array.isArray(null==e||null==(a=e.metadata)?void 0:a.swarm_models)?e.metadata.swarm_models:[],metadata:(null==e?void 0:e.metadata)&&"object"==typeof e.metadata?e.metadata:{}}});c(e),b({}),p(t=>t&&e.some(e=>e.id===t)?t:e.length?e[0].id:null)},[null==l?void 0:l.id,null==l?void 0:l.nodes]);let j=d.findIndex(e=>e.id===x),w=j>=0?d[j]:null,N=w?{...w,...g[w.id]||{}}:null,y=(e,t)=>{w&&b(a=>({...a,[w.id]:{...a[w.id]||{},[e]:t}}))},k=async()=>{if(l){v(!0);try{let e=d.map(e=>{let t={...e,...g[e.id]||{}};return{...t,metadata:{...t.metadata||{},swarm:!!t.swarm,swarm_models:t.swarm_models||[]}}}),a=await fetch("/api/workflows/".concat(l.id,"/nodes"),{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({nodes:e.map(e=>({id:e.id,prompt:e.prompt,provider:e.provider,model:e.model,metadata:e.metadata}))})});if(!a.ok)throw Error("Failed to save workflow");await a.json(),o(),b({}),t()}catch(e){console.error("Error saving workflow:",e)}finally{v(!1)}}};return n&&!l?(0,s.jsx)("div",{className:"modal-backdrop p-4 flex items-center justify-center",children:(0,s.jsx)("span",{className:"spinner w-8 h-8 border-2 border-white/20 border-t-white"})}):(0,s.jsx)("div",{className:"modal-backdrop p-4",onClick:e=>e.target===e.currentTarget&&t(),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-5xl h-[85vh] flex flex-col animate-scale-in p-0 bg-[var(--card-bg)] overflow-hidden rounded-xl border border-[var(--card-border)] shadow-2xl",children:[(0,s.jsxs)("div",{className:"px-6 py-4 border-b border-[var(--border)] flex items-center justify-between bg-[var(--background)]",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-lg font-bold flex items-center gap-2",children:[(0,s.jsx)("span",{children:"⚙️"})," Workflow Configuration"]}),(0,s.jsxs)("p",{className:"text-xs text-[var(--muted-foreground)] mt-0.5",children:["Editing: ",(0,s.jsx)("span",{className:"font-mono text-[var(--foreground)]",children:(null==l?void 0:l.name)||"Loading..."})]})]}),(0,s.jsx)("button",{onClick:t,className:"btn-ghost p-2 rounded",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,s.jsxs)("div",{className:"w-64 bg-[var(--muted)]/30 border-r border-[var(--border)] overflow-y-auto p-4 flex flex-col gap-1",children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-2 px-2",children:(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--muted-foreground)]",children:"Steps"})}),0===d.length&&(0,s.jsx)("div",{className:"text-sm text-[var(--muted-foreground)] px-2 italic",children:"No steps defined in this workflow."}),d.map(e=>{let t=f(e.name),a=!!g[e.id];return(0,s.jsxs)("button",{onClick:()=>p(e.id),className:"w-full text-left px-3 py-2.5 rounded-lg text-sm font-medium transition-all flex items-center gap-3 ".concat(x===e.id?"bg-[var(--card-bg)] text-[var(--foreground)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:bg-[var(--card-bg)]/50"),children:[(0,s.jsx)("span",{className:"text-base",children:t.icon}),(0,s.jsx)("span",{className:"flex-1 truncate",children:e.label||t.label}),a&&(0,s.jsx)("span",{className:"w-1.5 h-1.5 rounded-full bg-[var(--accent)]"})]},e.id)})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-8 relative bg-[var(--card-bg)]",children:[N?(0,s.jsxs)("div",{className:"max-w-3xl mx-auto space-y-8 animate-fade-in",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4 pb-6 border-b border-[var(--border)]",children:[(0,s.jsx)("div",{className:"w-12 h-12 rounded-xl bg-[var(--muted)]/50 flex items-center justify-center text-2xl shadow-inner",children:f(N.name).icon}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-xl font-bold",children:N.label}),(0,s.jsxs)("p",{className:"text-sm text-[var(--muted-foreground)] font-mono opacity-70",children:["ID: ",N.id," • Key: ",N.name]})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("label",{className:"text-sm font-semibold uppercase tracking-wider text-[var(--muted-foreground)]",children:"System Prompt"}),(0,s.jsx)("span",{className:"text-xs text-[var(--muted-foreground)] bg-[var(--muted)]/50 px-2 py-0.5 rounded",children:"Markdown Supported"})]}),(0,s.jsx)("textarea",{value:N.prompt||"",onChange:e=>y("prompt",e.target.value),className:"input w-full h-64 font-mono text-sm leading-relaxed resize-y p-4",placeholder:"Define the agent's behavior, constraints, and output format for this stage..."})]}),(0,s.jsxs)("div",{className:"p-6 rounded-xl bg-[var(--muted)]/20 border border-[var(--border)] space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("h4",{className:"font-semibold flex items-center gap-2",children:[(0,s.jsx)("span",{children:"\uD83E\uDD16"})," Model Settings"]}),(0,s.jsxs)("div",{className:"flex items-center gap-3 bg-[var(--card-bg)] px-3 py-1.5 rounded-lg border border-[var(--border)]",children:[(0,s.jsx)("span",{className:"text-sm font-medium",children:"Swarm Mode"}),(0,s.jsx)("button",{onClick:()=>y("swarm",!N.swarm),className:"w-9 h-5 rounded-full transition-colors relative ".concat(N.swarm?"bg-[var(--primary)]":"bg-[var(--muted-foreground)]/30"),children:(0,s.jsx)("span",{className:"absolute top-0.5 left-0.5 w-4 h-4 bg-white rounded-full transition-transform ".concat(N.swarm?"translate-x-4":"translate-x-0")})})]})]}),N.swarm?(0,s.jsxs)("div",{className:"space-y-4 animate-fade-in",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm font-medium text-[var(--muted-foreground)]",children:"Swarm Models"}),(0,s.jsx)("button",{onClick:()=>{y("swarm_models",[...N.swarm_models||[],{provider:"gemini",model:""}])},className:"btn-secondary text-xs px-2 py-1",children:"+ Add Model"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[0===(N.swarm_models||[]).length&&(0,s.jsx)("div",{className:"text-center py-8 border-2 border-dashed border-[var(--border)] rounded-lg text-sm text-[var(--muted-foreground)]",children:"No models configured for swarm. Add one to enable."}),(N.swarm_models||[]).map((e,t)=>(0,s.jsxs)("div",{className:"flex gap-2 items-center group",children:[(0,s.jsx)("select",{value:e.provider,onChange:e=>{let a=[...N.swarm_models||[]];a[t].provider=e.target.value,y("swarm_models",a)},className:"input text-sm py-1.5 w-32",children:i.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,s.jsx)("input",{value:e.model,onChange:e=>{let a=[...N.swarm_models||[]];a[t].model=e.target.value,y("swarm_models",a)},placeholder:"Model name (e.g. gemini-1.5-pro)",className:"input text-sm py-1.5 flex-1"}),(0,s.jsx)("button",{onClick:()=>{y("swarm_models",(N.swarm_models||[]).filter((e,a)=>a!==t))},className:"text-[var(--muted-foreground)] hover:text-[var(--destructive)] hover:bg-[var(--destructive)]/10 p-1.5 rounded opacity-0 group-hover:opacity-100 transition-all",children:"✕"})]},t))]})]}):(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 animate-fade-in",children:[(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold text-[var(--muted-foreground)] uppercase",children:"Provider"}),(0,s.jsx)("select",{value:N.provider||"gemini",onChange:e=>y("provider",e.target.value),className:"input w-full text-sm py-2",children:i.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))})]}),(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("label",{className:"text-xs font-semibold text-[var(--muted-foreground)] uppercase",children:"Model"}),(0,s.jsx)("input",{value:N.model||"",onChange:e=>y("model",e.target.value),placeholder:"e.g. gemini-2.0-flash",className:"input w-full text-sm py-2"})]})]})]})]}):null,!w&&d.length>0&&(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-[var(--muted-foreground)]",children:[(0,s.jsx)("span",{className:"text-4xl mb-4 opacity-30",children:"\uD83D\uDC48"}),(0,s.jsx)("p",{children:"Select a step from the sidebar to configure it."})]})]})]}),(0,s.jsxs)("div",{className:"px-6 py-4 border-t border-[var(--border)] bg-[var(--background)] flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:t,className:"btn-ghost px-4 py-2",children:"Cancel"}),(0,s.jsxs)("button",{onClick:k,disabled:h||0===Object.keys(g).length,className:"btn-primary px-6 py-2 flex items-center gap-2",children:[h&&(0,s.jsx)("span",{className:"spinner w-4 h-4 border-2 border-white/20 border-t-white"}),h?"Saving...":"Save Changes"]})]})]})})}var p=a(577),h=a(91);function v(){return(0,s.jsxs)("div",{className:"p-4 rounded-xl bg-[var(--card-bg)] border border-[var(--card-border)]",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between mb-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex gap-2 mb-2",children:[(0,s.jsx)("div",{className:"skeleton h-4 w-8 rounded"}),(0,s.jsx)("div",{className:"skeleton h-4 w-16 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-3/4 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-20 rounded-full"})]}),(0,s.jsxs)("div",{className:"flex justify-between",children:[(0,s.jsx)("div",{className:"skeleton h-4 w-24 rounded"}),(0,s.jsx)("div",{className:"skeleton h-4 w-12 rounded"})]})]})}function g(){return(0,s.jsx)("div",{className:"flex gap-4 overflow-x-auto pb-4 px-4",children:[1,2,3,4,5].map(e=>(0,s.jsxs)("div",{className:"flex-shrink-0 w-72 kanban-column",children:[(0,s.jsx)("div",{className:"kanban-column-header",children:(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("div",{className:"skeleton h-6 w-6 rounded"}),(0,s.jsx)("div",{className:"skeleton h-5 w-20 rounded"})]}),(0,s.jsx)("div",{className:"skeleton h-5 w-6 rounded-full"})]})}),(0,s.jsx)("div",{className:"p-2 space-y-2",children:[1,2].map(e=>(0,s.jsxs)("div",{className:"p-3 rounded-lg bg-[var(--background)] border-l-2 border-[var(--card-border)]",children:[(0,s.jsx)("div",{className:"skeleton h-3 w-12 rounded mb-2"}),(0,s.jsx)("div",{className:"skeleton h-4 w-full rounded mb-2"}),(0,s.jsx)("div",{className:"skeleton h-3 w-20 rounded"})]},e))})]},e))})}function b(){var e,t,a,b;let f=(0,l.useRouter)(),j=(0,l.useSearchParams)(),w=(0,l.usePathname)(),N=(null==j?void 0:j.get("project"))||void 0,y=j.get("view")||"kanban",k=j.get("sort")||"newest",[C,_]=(0,r.useState)(y),[S,A]=(0,r.useState)(k),[T,D]=(0,r.useState)("all"),[E,L]=(0,r.useState)(""),[P,R]=(0,r.useState)(null),[I,B]=(0,r.useState)(null),[M,q]=(0,r.useState)(!1),[U,F]=(0,r.useState)(null),[O,X]=(0,r.useState)(!1),[W,z]=(0,r.useState)(""),[G,V]=(0,r.useState)(!1),[Q,H]=(0,r.useState)("single"),[K,Y]=(0,r.useState)("gemini"),[J,Z]=(0,r.useState)(""),[$,ee]=(0,r.useState)([]),[et,ea]=(0,r.useState)("gemini"),[es,er]=(0,r.useState)(""),[el,en]=(0,r.useState)(null),[eo,ei]=(0,r.useState)(!1),[ed,ec]=(0,r.useState)(!1),[eu,em]=(0,r.useState)(null),{providers:ex}=(0,m.u)();(0,r.useEffect)(()=>{let e=e=>{let t=e.target,a=["INPUT","TEXTAREA","SELECT"].includes(t.tagName)||t.isContentEditable;if("n"!==e.key||a||(e.preventDefault(),X(!0)),"/"===e.key&&!a){var s;e.preventDefault(),null==(s=document.getElementById("task-search"))||s.focus()}};return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]);let{tasks:ep,isLoading:eh,createTask:ev,updateTask:eg,deleteTask:eb,completeTaskStage:ef,cancelWorkflow:ej,refetch:ew,cancellingTaskId:eN,fetchTask:ey}=(0,p.si)({realtime:!0,project:N}),{projects:ek,isLoading:eC}=(0,h.Y)(),{comments:e_,addComment:eS,deleteComment:eA}=(0,p.LU)((null==P?void 0:P.id)||null),{learnings:eT,addLearning:eD}=(0,p.dF)((null==P?void 0:P.id)||void 0),{workflow:eE,stages:eL,stageConfig:eP,isValidTransition:eR,isLoading:eI}=(0,u.mP)(),eB=(0,r.useMemo)(()=>eL.map(e=>{var t;let a=eP[e],s=null==eE||null==(t=eE.nodes)?void 0:t.find(t=>t.name===e);return{id:e,label:(null==a?void 0:a.label)||e,icon:(null==a?void 0:a.icon)||"\uD83D\uDCCC",color:(null==a?void 0:a.color)||"var(--primary)",prompt:(null==s?void 0:s.prompt)||void 0}}),[eL,eP,eE]),eM=e=>{_(e);let t=new URLSearchParams(j);t.set("view",e),f.push("".concat(w,"?").concat(t.toString()))},eq=(0,r.useMemo)(()=>{let e=[...ep];if(E){let t=E.toLowerCase();e=e.filter(e=>{var a,s,r;return(null==(a=e.title)?void 0:a.toLowerCase().includes(t))||(null==(s=e.description)?void 0:s.toLowerCase().includes(t))||e.id.toLowerCase().includes(t)||(null==(r=e.project)?void 0:r.toLowerCase().includes(t))})}return"all"!==T&&(e="active"===T?e.filter(e=>"completed"!==e.status&&"failed"!==e.status):e.filter(e=>e.status===T)),e.sort((e,t)=>{switch(S){case"newest":return new Date(t.created_at).getTime()-new Date(e.created_at).getTime();case"oldest":return new Date(e.created_at).getTime()-new Date(t.created_at).getTime();case"priority":return(e.priority||0)-(t.priority||0);case"updated":return new Date(t.updated_at).getTime()-new Date(e.updated_at).getTime();default:return 0}}),e},[ep,E,T,S]),eU=(0,r.useCallback)(async(e,t)=>{t&&R(t);try{let t=await ey(e);return R(t),t}catch(e){return console.error("Failed to load task details:",e),t||R(null),null!=t?t:null}},[ey]),eF=(0,r.useCallback)(async e=>{await eU(e.id,e)},[eU]),eO=(0,r.useCallback)(async e=>{var t,a;let s=N?ek.find(e=>e.slug===N):null;B({stage:e,project:null!=(t=null==s?void 0:s.slug)?t:null,project_id:null!=(a=null==s?void 0:s.id)?a:null})},[N,ek]),eX=(0,r.useCallback)(async e=>{var t,a;let s=(e.description||"").trim();if(!s)return;ec(!0);let r=e.stage||(null==I?void 0:I.stage)||"ideation";em(r);let l="done"===r?"completed":"ideation"===r?"queued":"in_progress",n=(null==eP||null==(t=eP[r])?void 0:t.label)||r,o=(e.title||"").trim()||s.split("\n")[0].replace(/^#\s*/,"")||"New Task (".concat(n,")"),i=["status: ".concat(l),"stage: ".concat(r)],d=e.project_id&&ek.find(t=>t.id===e.project_id)||e.project&&ek.find(t=>t.slug===e.project)||(N?ek.find(e=>e.slug===N):null);d&&(i.push("project: ".concat(d.slug)),i.push("project_id: ".concat(d.id)),i.push("workflow_id: ".concat(d.workflow_id||u.ou))),e.provider&&i.push("provider: ".concat(e.provider)),e.model&&i.push("model: ".concat(e.model)),void 0!==e.swarm&&i.push("swarm: ".concat(e.swarm?"true":"false"));let c="---\n".concat(i.join("\n"),"\n---\n\n# ").concat(o,"\n\n").concat(s);try{let t=e.swarm?null!=(a=e.swarm_models)?a:[]:null,s=await ev(c,t);B(null),await eU(s.id,s)}catch(e){console.error("Failed to create task:",e)}finally{ec(!1),em(null)}},[ev,I,eU,N,ek,eP]),eW=(0,r.useCallback)(async(e,t)=>{await eg(e,t)},[eg]),ez=async e=>{let t=ep.find(t=>t.id===e);F(null);try{var a;await ej({taskId:e}),await ew(),F({type:"success",message:"Cancellation requested for ".concat((null==t?void 0:t.title)||(null==t||null==(a=t.content)?void 0:a.slice(0,30))||e,".")})}catch(s){console.error("Failed to stop task",s);let a=s instanceof Error?s.message:"unknown error";F({type:"error",message:"Unable to stop ".concat((null==t?void 0:t.title)||e,": ").concat(a,".")})}},eG=async e=>{try{await ef({taskId:e,decision:"not_done",final_result:"Manual retry requested.",explanation:"Manual retry requested."})}catch(e){console.error("Failed to retry task",e)}};(0,r.useEffect)(()=>{if(!U)return;let e=setTimeout(()=>F(null),5e3);return()=>clearTimeout(e)},[U]);let eV=async()=>{if(W.trim()&&!G){V(!0);try{var e;let t=["status: queued","stage: ideation"];"single"!==Q&&t.push("swarm: true");let a=el||(N?null==(e=ek.find(e=>e.slug===N))?void 0:e.id:null);if(a){let e=ek.find(e=>e.id===a);e&&(t.push("project: ".concat(e.slug)),t.push("project_id: ".concat(e.id)),t.push("workflow_id: ".concat(e.workflow_id||u.ou)))}let s="---\n".concat(t.join("\n"),"\n---\n\n# ").concat(W,"\n");await ev(s,"swarm"===Q?$:null),z(""),H("single"),Y("gemini"),Z(""),ee([]),ea("gemini"),er(""),X(!1),en(null)}catch(e){console.error("Failed to create task:",e)}finally{V(!1)}}},eQ=async(e,t)=>{let a="---\n".concat(["status: ".concat("ideation"===t?"queued":"in_progress"),"stage: ".concat(t)].join("\n"),"\n---\n\n# ").concat(e,"\n");await ev(a,null),ei(!1)},eH=async e=>{P&&await eS(e)},eK=async(e,t,a)=>{var s,r;let l=(null==P||null==(r=P.project_context)||null==(s=r.project)?void 0:s.id)||(null==P?void 0:P.project_id)||(null==P?void 0:P.project)||void 0,n=null!=a?a:"global"===t?void 0:"task"===t?null==P?void 0:P.id:l;await eD(e,t,n)},eY=async e=>{P&&(R(t=>t?{...t,...e}:null),await eg(P.id,e))};return(ep.length,ep.filter(e=>"in_progress"===e.status).length,ep.filter(e=>"queued"===e.status).length,ep.filter(e=>"completed"===e.status).length,(eh||eI)&&0===ep.length)?(0,s.jsxs)("div",{className:"h-full flex flex-col p-6 animate-pulse",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center mb-8",children:[(0,s.jsx)("div",{className:"h-8 w-48 bg-[var(--card-border)] rounded"}),(0,s.jsx)("div",{className:"h-10 w-32 bg-[var(--card-border)] rounded"})]}),(0,s.jsx)("div",{className:"h-12 w-full bg-[var(--card-border)] rounded mb-8"}),"kanban"===C?(0,s.jsx)(g,{}):(0,s.jsx)("div",{className:"space-y-4",children:[1,2,3].map(e=>(0,s.jsx)(v,{},e))})]}):(0,s.jsx)(n.A,{fullWidth:!0,noFooter:!0,children:(0,s.jsxs)("div",{className:"flex flex-col h-full ".concat("kanban"===C?"max-w-full":"max-w-6xl mx-auto w-full px-4"),children:[(0,s.jsxs)("div",{className:"relative flex items-center justify-center gap-4 py-3 px-4 border-b border-[var(--border)] bg-[var(--background)] flex-shrink-0 z-20",children:[(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsxs)("div",{className:"relative w-80",children:[(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,s.jsx)("svg",{className:"h-5 w-5 text-gray-400",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",children:(0,s.jsx)("path",{fillRule:"evenodd",d:"M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z",clipRule:"evenodd"})})}),(0,s.jsx)("input",{id:"task-search",type:"text",placeholder:"Search tasks... (/)",className:"block w-full rounded-md border-0 py-1.5 pl-10 text-gray-900 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6 bg-white shadow-sm",value:E,onChange:e=>L(e.target.value)})]}),(0,s.jsxs)("div",{className:"flex items-center bg-gray-100 p-1 rounded-lg border border-gray-200",children:[(0,s.jsx)("button",{onClick:()=>eM("list"),className:"px-3 py-1 text-xs font-medium rounded transition-all ".concat("list"===C?"bg-white shadow-sm text-gray-900":"text-gray-500 hover:text-gray-700"),children:"List"}),(0,s.jsx)("button",{onClick:()=>eM("kanban"),className:"px-3 py-1 text-xs font-medium rounded transition-all ".concat("kanban"===C?"bg-white shadow-sm text-gray-900":"text-gray-500 hover:text-gray-700"),children:"Board"})]}),(0,s.jsxs)("button",{onClick:()=>q(!0),className:"flex items-center gap-2 px-3 py-1.5 text-xs font-medium text-gray-700 bg-white border border-gray-200 rounded-lg shadow-sm hover:bg-gray-50 transition-all",title:"Configure Workflow",children:[(0,s.jsx)("span",{className:"text-base leading-none",children:"⚙️"}),(0,s.jsx)("span",{children:"Workflow"})]})]}),(0,s.jsx)("div",{className:"absolute right-4 flex items-center gap-3"})]}),U&&(0,s.jsx)("div",{className:"px-4 mt-3",children:(0,s.jsx)("div",{role:"status",className:"rounded-xl px-4 py-2 text-xs font-semibold ".concat("success"===U.type?"bg-[var(--success-muted)] text-[var(--success)]":"bg-[var(--destructive-muted)] text-[var(--destructive)]"),children:U.message})}),(0,s.jsx)("div",{className:"flex-shrink-0 mt-2 px-4",children:(0,s.jsx)(d.A,{tasks:ep,onTaskClick:R,onStop:ez,onRetry:eG,cancellingTaskId:eN})}),(0,s.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden flex flex-col pt-2",children:"list"===C?(0,s.jsx)("div",{className:"overflow-y-auto h-full px-4",children:(0,s.jsx)(o.A,{tasks:eq,onSelectTask:eF})}):(0,s.jsx)(i.A,{tasks:eq,onSelectTask:eF,onTasksChange:()=>{},onTaskUpdate:eW,onAddTask:eO,stages:eL,stageConfig:eP,isValidTransition:eR,isCreatingTask:ed,creatingStage:eu})}),P&&(0,s.jsx)(c.A,{task:P,comments:P?e_:[],learnings:eT,projectContext:P.project_context,projects:ek,stages:eB,onClose:()=>R(null),onAddComment:eH,onDeleteComment:eA,onAddLearning:eK,onUpdate:eY,onDelete:async()=>{await eb(P.id),R(null)}}),I&&(0,s.jsx)(c.A,{task:{id:"draft",title:"",description:"",content:"",stage:I.stage,status:"done"===I.stage?"completed":"ideation"===I.stage?"queued":"in_progress",created_at:new Date().toISOString(),project:null!=(a=null!=(t=I.project)?t:N)?a:void 0,project_id:null!=(b=I.project_id)?b:N?null==(e=ek.find(e=>e.slug===N))?void 0:e.id:void 0,provider:I.provider,model:I.model,swarm:I.swarm,swarm_models:I.swarm_models},comments:[],learnings:[],projectContext:null,projects:ek,stages:eB,isDraft:!0,isCreating:ed,onClose:()=>B(null),onAddComment:()=>{},onAddLearning:()=>{},onUpdate:async e=>{if(I){if(e.description||e.title)return void await eX({...I,...e});B(t=>t?{...t,...e}:t)}}}),eo&&(0,s.jsx)("div",{className:"fixed inset-0 bg-black/50 flex items-center justify-center z-50",children:(0,s.jsxs)("div",{className:"bg-[var(--card-bg)] p-6 rounded-xl w-full max-w-md shadow-2xl border border-[var(--card-border)] animate-scale-in",children:[(0,s.jsx)("h3",{className:"text-lg font-bold mb-4",children:"New Task"}),(0,s.jsxs)("form",{onSubmit:e=>{e.preventDefault();let t=e.target;eQ(t.elements.namedItem("title").value,t.elements.namedItem("stage").value)},children:[(0,s.jsx)("input",{name:"title",autoFocus:!0,placeholder:"Task title...",className:"w-full mb-4 px-3 py-2 bg-[var(--background)] border border-[var(--card-border)] rounded focus:border-[var(--primary)] outline-none",required:!0}),(0,s.jsx)("select",{name:"stage",className:"w-full mb-6 px-3 py-2 bg-[var(--background)] border border-[var(--card-border)] rounded focus:border-[var(--primary)] outline-none",children:eL.map(e=>{var t;return(0,s.jsx)("option",{value:e,children:(null==(t=eP[e])?void 0:t.label)||e},e)})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:()=>ei(!1),className:"btn-ghost",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",className:"btn-primary",children:"Create Task"})]})]})]})}),M&&(0,s.jsx)(x,{onClose:()=>q(!1),workflowId:null==eE?void 0:eE.id}),O&&(0,s.jsx)("div",{className:"modal-backdrop p-4",onClick:e=>e.target===e.currentTarget&&X(!1),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-lg p-6 animate-scale-in",children:[(0,s.jsxs)("h2",{className:"text-xl font-bold mb-4 flex items-center gap-2",children:[(0,s.jsx)("span",{children:"✨"})," New Task"]}),(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,s.jsx)("button",{onClick:()=>H("single"),className:"px-3 py-1.5 text-xs font-semibold rounded-md uppercase tracking-wide transition-all ".concat("single"===Q?"bg-[var(--card-bg)] text-[var(--primary)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:text-[var(--foreground)] border border-transparent"),children:"Single Agent"}),(0,s.jsx)("button",{onClick:()=>H("swarm"),className:"px-3 py-1.5 text-xs font-semibold rounded-md uppercase tracking-wide transition-all ".concat("swarm"===Q?"bg-[var(--card-bg)] text-[var(--primary)] shadow-sm border border-[var(--border)]":"text-[var(--muted-foreground)] hover:text-[var(--foreground)] border border-transparent"),children:"Swarm"})]}),(0,s.jsx)("textarea",{value:W,onChange:e=>z(e.target.value),placeholder:"Describe what needs to be done...",className:"input h-32 resize-none mb-4",autoFocus:!0,disabled:G}),(0,s.jsxs)("label",{className:"text-xs font-semibold mb-3 block",children:["Attach to project",(0,s.jsxs)("select",{value:null!=el?el:"",onChange:e=>en(e.target.value||null),className:"input text-sm mt-1",disabled:eC,children:[(0,s.jsxs)("option",{value:"",children:["None (Current: ",N||"All",")"]}),ek.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})]}),"single"===Q?(0,s.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 mb-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-1",children:"Provider"}),(0,s.jsx)("select",{value:K,onChange:e=>Y(e.target.value),className:"input text-xs py-1.5 appearance-none",children:ex.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-1",children:"Model"}),(0,s.jsx)("input",{value:J,onChange:e=>Z(e.target.value),placeholder:"e.g. gpt-4.1-mini",className:"input text-xs py-1.5"})]})]}):(0,s.jsx)("div",{className:"mb-4 space-y-3",children:(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-[11px] font-medium text-[var(--muted-foreground)] mb-2",children:"Swarm Models"}),(0,s.jsxs)("div",{className:"grid gap-2",children:[(0,s.jsxs)("div",{className:"grid grid-cols-[1fr_1.2fr_auto] gap-2",children:[(0,s.jsx)("select",{value:et,onChange:e=>ea(e.target.value),className:"input text-xs py-1.5 appearance-none",children:ex.map(e=>(0,s.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,s.jsx)("input",{value:es,onChange:e=>er(e.target.value),placeholder:"model name",className:"input text-xs py-1.5"}),(0,s.jsx)("button",{type:"button",onClick:()=>{let e=es.trim();if(!e)return;let t={provider:et,model:e};$.some(e=>e.provider.toLowerCase()===t.provider.toLowerCase()&&e.model.toLowerCase()===t.model.toLowerCase())||(ee(e=>[...e,t]),er(""))},className:"btn-ghost px-3 py-1.5 text-xs",children:"Add"})]}),$.length>0&&(0,s.jsx)("div",{className:"space-y-1",children:$.map((e,t)=>(0,s.jsxs)("div",{className:"flex items-center justify-between px-3 py-1.5 rounded-md border text-xs bg-[var(--background)] border-[var(--border)]",children:[(0,s.jsxs)("span",{className:"truncate",children:[(0,s.jsx)("span",{className:"text-[var(--muted-foreground)]",children:e.provider}),(0,s.jsx)("span",{className:"mx-1",children:"\xb7"}),(0,s.jsx)("span",{children:e.model})]}),(0,s.jsx)("button",{type:"button",onClick:()=>{ee(e=>e.filter((e,a)=>a!==t))},className:"text-[var(--destructive)] hover:underline",children:"Remove"})]},"".concat(e.provider,"-").concat(e.model,"-").concat(t)))})]})]})}),(0,s.jsxs)("div",{className:"flex justify-end gap-3",children:[(0,s.jsx)("button",{onClick:()=>{X(!1),z(""),H("single"),Y("gemini"),Z(""),ee([]),ea("gemini"),er("")},disabled:G,className:"btn-ghost px-4 py-2",children:"Cancel"}),(0,s.jsx)("button",{onClick:eV,disabled:!W.trim()||G||"swarm"===Q&&0===$.length,className:"btn-primary px-4 py-2 flex items-center gap-2",children:G?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"spinner w-4 h-4 border-2 border-white/20 border-t-white"}),"Creating..."]}):"Create Task"})]})]})})]})})}function f(){return(0,s.jsx)(r.Suspense,{fallback:(0,s.jsx)("div",{className:"p-8",children:"Loading..."}),children:(0,s.jsx)(b,{})})}},1460:(e,t,a)=>{"use strict";a.d(t,{A:()=>m});var s=a(5155),r=a(2619),l=a.n(r),n=a(63),o=a(4647),i=a(91),d=a(2115);function c(e){let{children:t,fullWidth:a=!1,noFooter:r=!1}=e;(0,n.usePathname)(),(0,n.useRouter)();let c=(0,n.useSearchParams)(),{user:u,loading:m,signOut:x}=(0,o.A)(),{projects:p,isLoading:h}=(0,i.Y)(),v=null==c?void 0:c.get("project");return(0,d.useMemo)(()=>v?p.find(e=>e.slug===v):null,[p,v]),(0,s.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden",children:[(0,s.jsx)("nav",{className:"flex-shrink-0 border-b border-[var(--card-border)] bg-[var(--card-bg)]/80 backdrop-blur-lg z-30",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,s.jsx)("div",{className:"flex items-center gap-8",children:(0,s.jsxs)(l(),{href:"/",className:"flex items-center gap-3 group",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-[var(--primary)] to-[var(--accent)] flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-[var(--primary)]/20 group-hover:shadow-[var(--primary)]/40 transition-shadow",children:"A"}),(0,s.jsx)("span",{className:"text-lg font-bold tracking-tight gradient-text hidden sm:block",children:"AGX Board"})]})}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(l(),{href:"/settings",className:"text-sm font-medium text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors",children:"Settings"})})]})})}),(0,s.jsx)("main",{className:"flex-1 min-h-0 flex flex-col ".concat(a?"p-0":"p-4 sm:p-6 lg:p-8 overflow-y-auto"),children:t}),!r&&(0,s.jsx)("footer",{className:"flex-shrink-0 border-t border-[var(--card-border)] bg-[var(--card-bg)]/50 py-4",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between text-xs text-[var(--muted-foreground)]",children:[(0,s.jsx)("span",{children:"AGX Board • Autonomous Agent Orchestration"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Built with Next.js + Db"})]})})]})}function u(e){return(0,s.jsx)(d.Suspense,{fallback:(0,s.jsx)("div",{className:"h-screen flex items-center justify-center bg-[var(--background)]",children:(0,s.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"})}),children:(0,s.jsx)(c,{...e})})}function m(e){let{children:t,fullWidth:a=!1,noFooter:r=!1}=e;return(0,s.jsx)(u,{fullWidth:a,noFooter:r,children:t})}},2888:(e,t,a)=>{"use strict";a.d(t,{A:()=>i});var s=a(5155);let r={queued:{className:"badge-status-queued",label:"Queued",dotColor:"bg-[var(--status-queued)]"},in_progress:{className:"badge-status-in_progress",label:"In Progress",dotColor:"bg-[var(--status-in-progress)]"},blocked:{className:"badge-status-blocked",label:"Blocked",dotColor:"bg-[var(--status-blocked)]"},completed:{className:"badge-status-completed",label:"Completed",dotColor:"bg-[var(--status-completed)]"},failed:{className:"badge-status-failed",label:"Failed",dotColor:"bg-[var(--status-failed)]"}},l={ideation:{icon:"\uD83D\uDCA1",label:"Ideation",prompt:"Research and scope. Define approach, estimate effort."},planning:{icon:"\uD83D\uDCCB",label:"Planning",prompt:"Create detailed plan with tasks, milestones, and dependencies."},execution:{icon:"\uD83D\uDCBB",label:"Execution",prompt:"Implement based on all the context/history/research/plan. Write clean, tested code."},verification:{icon:"\uD83E\uDDEA",label:"Verification",prompt:"Test thoroughly. Find edge cases. Fix bugs. Verify requirements are met."},coding:{icon:"\uD83D\uDCBB",label:"Coding",prompt:"Write clean, tested code based on plan."},qa:{icon:"\uD83E\uDDEA",label:"QA",prompt:"Test thoroughly. Find edge cases. Fix bugs."},acceptance:{icon:"✓",label:"Acceptance",prompt:"Demo to user. Get sign-off. Address feedback."},pr:{icon:"\uD83D\uDD00",label:"PR",prompt:"Create and review pull request. Ensure all checks pass and merge."},pr_review:{icon:"\uD83D\uDC40",label:"PR Review",prompt:"Review the PR. Verify code quality and functionality. Approve or request changes."},merge:{icon:"\uD83D\uDE80",label:"Merge",prompt:"Merge the PR and verify deployment."},done:{icon:"✅",label:"Done",prompt:"Task finished and shipped."}};function n(e){let{task:t,onClick:a,compact:n=!1}=e,o=r[t.status||"queued"],i=t.stage?l[t.stage]:null;return(0,s.jsxs)("div",{onClick:a,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&(null==a?void 0:a()),className:"group relative flex items-center gap-2 p-1.5 rounded-md \n hover:bg-[var(--item-hover-bg)] transition-colors cursor-pointer\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2\n ".concat("failed"===t.status?"bg-[var(--status-failed-bg)]":""),children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full flex-shrink-0 ".concat(o.dotColor),title:o.label}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex items-baseline gap-2",children:[(0,s.jsx)("h3",{className:"text-sm text-[var(--foreground)] truncate leading-tight\n ".concat("completed"===t.status?"text-[var(--muted-foreground)] line-through":"","\n "),children:t.title||"Untitled Task"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-[var(--muted-foreground)] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap",children:[void 0!==t.priority&&(0,s.jsxs)("span",{className:0===t.priority?"text-[var(--primary)] font-bold":"",children:["P",t.priority]}),t.project&&(0,s.jsx)("span",{className:"max-w-[80px] truncate",children:t.project})]})]}),(0,s.jsx)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:"failed"===t.status?(0,s.jsx)("span",{className:"text-[10px] text-[var(--status-failed)] font-bold",children:"FAILED"}):i&&(0,s.jsx)("span",{className:"text-[10px] opacity-40",children:i.icon})})]})}let o={in_progress:{title:"In Progress",icon:"\uD83D\uDD04",color:"var(--status-in-progress)",description:"Currently being worked on by the daemon"},blocked:{title:"Blocked",icon:"\uD83D\uDEA7",color:"var(--status-blocked)",description:"Waiting for input or resolution"},queued:{title:"Queued",icon:"\uD83D\uDCCB",color:"var(--status-queued)",description:"Ready to be picked up"},completed:{title:"Completed",icon:"✅",color:"var(--status-completed)",description:"Successfully finished"}};function i(e){let{tasks:t,onSelectTask:a}=e;if(0===t.length)return(0,s.jsxs)("div",{className:"text-center py-20 animate-fade-in",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-[var(--card-bg)] border border-[var(--card-border)] mb-4",children:(0,s.jsx)("span",{className:"text-3xl",children:"\uD83D\uDCCB"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No tasks yet"}),(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] text-sm max-w-md mx-auto",children:"Create your first task to get started. Tasks will appear here organized by status."})]});let r=t.filter(e=>"in_progress"===e.status),l=t.filter(e=>"queued"===e.status),i=t.filter(e=>"blocked"===e.status),d=t.filter(e=>"completed"===e.status||"failed"===e.status),c=(e,t)=>{if(0===t.length)return null;let r=o[e];return(0,s.jsxs)("section",{className:"mb-8 animate-fade-in-up",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:"color-mix(in srgb, ".concat(r.color," 10%, transparent)")},children:[(0,s.jsx)("span",{className:"text-lg",children:r.icon}),(0,s.jsx)("h3",{className:"text-sm font-semibold",style:{color:r.color},children:r.title}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, ".concat(r.color," 15%, transparent)"),color:r.color},children:t.length})]}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] hidden sm:block",children:r.description})]}),(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map((e,t)=>(0,s.jsx)("div",{className:"animate-fade-in-up",style:{animationDelay:"".concat(50*t,"ms")},children:(0,s.jsx)(n,{task:e,onClick:()=>null==a?void 0:a(e)})},e.id))})]})};return(0,s.jsxs)("div",{children:[c("in_progress",r),c("blocked",i),c("queued",l),c("completed",d)]})}},4647:(e,t,a)=>{"use strict";a.d(t,{A:()=>d,AuthProvider:()=>i});var s=a(5155),r=a(2115),l=a(1483),n=a(5704);let o=(0,r.createContext)({user:null,loading:!0,signOut:async()=>{}});function i(e){let{children:t}=e,a="1"===n.env.NEXT_PUBLIC_AGX_BOARD_DISABLE_AUTH,[i,d]=(0,r.useState)(null),[c,u]=(0,r.useState)(!0);(0,r.useEffect)(()=>{if(a){d({id:n.env.NEXT_PUBLIC_AGX_BOARD_USER_ID||"00000000-0000-0000-0000-000000000001",email:n.env.NEXT_PUBLIC_AGX_BOARD_USER_EMAIL||"local@agx.board",user_metadata:{name:n.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User",full_name:n.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User"},app_metadata:{},aud:"authenticated",created_at:new Date().toISOString()}),u(!1);return}let e=(0,l.O)();e.auth.getSession().then(e=>{var t,a;d(null!=(a=null==(t=e.data.session)?void 0:t.user)?a:null),u(!1)});let{data:{subscription:t}}=e.auth.onAuthStateChange((e,t)=>{var a;d(null!=(a=null==t?void 0:t.user)?a:null),u(!1)});return()=>t.unsubscribe()},[a]);let m=async()=>{if(a)return;let e=(0,l.O)();await e.auth.signOut(),d(null)};return(0,s.jsx)(o.Provider,{value:{user:i,loading:c,signOut:m},children:t})}function d(){return(0,r.useContext)(o)}},9620:(e,t,a)=>{Promise.resolve().then(a.bind(a,415))}},e=>{e.O(0,[5004,277,2619,650,9027,9719,2456,9337,8441,1255,7358],()=>e(e.s=9620)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8419],{6190:(e,t,r)=>{Promise.resolve().then(r.bind(r,8354))},8354:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var l=r(5155),a=r(2115);let n=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()},o=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var s={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 i=(0,a.forwardRef)((e,t)=>{let{color:r="currentColor",size:l=24,strokeWidth:o=2,absoluteStrokeWidth:i,className:d="",children:c,iconNode:u,...p}=e;return(0,a.createElement)("svg",{ref:t,...s,width:l,height:l,stroke:r,strokeWidth:i?24*Number(o)/Number(l):o,className:n("lucide",d),...!c&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1})(p)&&{"aria-hidden":"true"},...p},[...u.map(e=>{let[t,r]=e;return(0,a.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),d=((e,t)=>{let r=(0,a.forwardRef)((r,l)=>{let{className:s,...d}=r;return(0,a.createElement)(i,{ref:l,iconNode:t,className:n("lucide-".concat(o(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),"lucide-".concat(e),s),...d})});return r.displayName=o(e),r})("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);var c=r(577),u=r(91),p=r(2325),m=r(6779),v=r(5826),f=r(2835);function g(e){var t,r;let{params:n}=e,{slug:o}=(0,a.use)(n),{tasks:s,isLoading:i,createTask:g,updateTask:w,deleteTask:h,completeTaskStage:j,cancelWorkflow:k,refetch:x,cancellingTaskId:y,fetchTask:C}=(0,c.si)({realtime:!0,project:o}),{projects:b}=(0,u.Y)(),{workflow:_,stages:N,stageConfig:A,isValidTransition:L,isLoading:S}=(0,p.mP)(),[T,E]=(0,a.useState)(null),[U,q]=(0,a.useState)(""),[D,M]=(0,a.useState)(!1),[O,F]=(0,a.useState)(!1),[R,W]=(0,a.useState)(null),[I,P]=(0,a.useState)(null),{comments:Z,addComment:$,deleteComment:z}=(0,c.LU)((null==T?void 0:T.id)||null),{learnings:B,addLearning:V}=(0,c.dF)((null==T?void 0:T.id)||void 0),Y=(0,a.useMemo)(()=>N.map(e=>{var t;let r=A[e],l=null==_||null==(t=_.nodes)?void 0:t.find(t=>t.name===e);return{id:e,label:(null==r?void 0:r.label)||e,icon:(null==r?void 0:r.icon)||"\uD83D\uDCCC",color:(null==r?void 0:r.color)||"var(--primary)",prompt:(null==l?void 0:l.prompt)||void 0}}),[N,A,_]),G=b.find(e=>e.slug===o),H=(0,a.useMemo)(()=>{if(!U.trim())return s;let e=U.toLowerCase();return s.filter(t=>(t.title||"").toLowerCase().includes(e)||(t.content||"").toLowerCase().includes(e))},[s,U]),J=(0,a.useCallback)(async(e,t)=>{t&&E(t);try{let t=await C(e);return E(t),t}catch(e){return console.error("Failed to load task details:",e),t||E(null),null!=t?t:null}},[C]),K=(0,a.useCallback)(async e=>{await J(e.id,e)},[J]),Q=(0,a.useCallback)(async e=>{var t,r;P({stage:e,project:null!=(t=null==G?void 0:G.slug)?t:null,project_id:null!=(r=null==G?void 0:G.id)?r:null})},[G]),X=(0,a.useCallback)(async e=>{var t,r;let l=(e.description||"").trim();if(!l)return;F(!0);let a=e.stage||(null==I?void 0:I.stage)||"ideation",n=(null==A||null==(t=A[a])?void 0:t.label)||a,o=(e.title||"").trim()||l.split("\n")[0].replace(/^#\s*/,"")||"New Task (".concat(n,")"),s=["status: ".concat("done"===a?"completed":"ideation"===a?"queued":"in_progress"),"stage: ".concat(a)],i=e.project_id&&b.find(t=>t.id===e.project_id)||e.project&&b.find(t=>t.slug===e.project)||G||null;i&&(s.push("project: ".concat(i.slug)),s.push("project_id: ".concat(i.id)),s.push("workflow_id: ".concat(i.workflow_id||p.ou))),e.provider&&s.push("provider: ".concat(e.provider)),e.model&&s.push("model: ".concat(e.model)),void 0!==e.swarm&&s.push("swarm: ".concat(e.swarm?"true":"false"));let d="---\n".concat(s.join("\n"),"\n---\n\n# ").concat(o,"\n\n").concat(l);try{let t=e.swarm?null!=(r=e.swarm_models)?r:[]:null,l=await g(d,t);P(null),await J(l.id,l)}catch(e){console.error("Failed to create task:",e)}finally{F(!1)}},[g,G,I,J,b,A]),ee=(0,a.useCallback)(async(e,t)=>{await w(e,t)},[w]),et=async e=>{T&&await $(e)},er=async(e,t,r)=>{var l,a;let n=(null==T||null==(a=T.project_context)||null==(l=a.project)?void 0:l.id)||(null==T?void 0:T.project_id)||(null==T?void 0:T.project)||void 0,o=null!=r?r:"global"===t?void 0:"task"===t?null==T?void 0:T.id:n;await V(e,t,o)},el=async e=>{T&&(E(t=>t?{...t,...e}:null),await w(T.id,e))};return i||S?(0,l.jsx)("div",{className:"h-full flex items-center justify-center",children:(0,l.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,l.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"}),(0,l.jsx)("p",{className:"text-sm text-[var(--muted-foreground)]",children:"Loading board..."})]})}):(0,l.jsxs)("div",{className:"h-full flex flex-col p-4",children:[(0,l.jsxs)("div",{className:"flex-shrink-0 mb-4 space-y-4",children:[(0,l.jsxs)("div",{className:"relative",children:[(0,l.jsx)(d,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-[var(--muted-foreground)]"}),(0,l.jsx)("input",{type:"text",placeholder:"Search",value:U,onChange:e=>q(e.target.value),className:"w-full pl-9 pr-4 py-2 bg-[var(--card-bg)] border border-[var(--border)] rounded-lg text-sm focus:outline-none focus:ring-2 focus:ring-[var(--primary)] focus:border-transparent transition-all"})]}),(0,l.jsx)(f.A,{tasks:H,onTaskClick:E,onStop:async e=>{await k({taskId:e}),await x()},onRetry:async e=>{await j({taskId:e,decision:"not_done",final_result:"Manual retry requested.",explanation:"Manual retry requested."})},cancellingTaskId:y})]}),(0,l.jsx)("div",{className:"flex-1 min-h-0 overflow-hidden",children:(0,l.jsx)(m.A,{tasks:H,onSelectTask:K,onTasksChange:()=>{},onTaskUpdate:ee,onAddTask:Q,stages:N,stageConfig:A,isValidTransition:L})}),T&&(0,l.jsx)(v.A,{task:T,comments:T?Z:[],learnings:B,projectContext:T.project_context,projects:b,stages:Y,onClose:()=>E(null),onAddComment:et,onDeleteComment:z,onAddLearning:er,onUpdate:el,onDelete:async()=>{await h(T.id),E(null)}}),I&&(0,l.jsx)(v.A,{task:{id:"draft",title:"",description:"",content:"",stage:I.stage,status:"done"===I.stage?"completed":"ideation"===I.stage?"queued":"in_progress",created_at:new Date().toISOString(),project:null!=(t=I.project)?t:null==G?void 0:G.slug,project_id:null!=(r=I.project_id)?r:null==G?void 0:G.id,provider:I.provider,model:I.model,swarm:I.swarm,swarm_models:I.swarm_models},comments:[],learnings:[],projectContext:null,projects:b,stages:Y,isDraft:!0,isCreating:O,onClose:()=>P(null),onAddComment:()=>{},onAddLearning:()=>{},onUpdate:async e=>{if(I){if(e.description||e.title)return void await X({...I,...e});P(t=>t?{...t,...e}:t)}}})]})}}},e=>{e.O(0,[5004,277,2619,650,9027,9719,2456,9337,8441,1255,7358],()=>e(e.s=6190)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4382],{1986:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var l=s(5155),a=s(2115),o=s(577),r=s(2888),n=s(5826),i=s(91),d=s(2325);function c(e){let{params:t}=e,{slug:s}=(0,a.use)(t),{tasks:c,isLoading:u,fetchTask:p,updateTask:m,deleteTask:x,createTask:g}=(0,o.si)({realtime:!0,project:s}),{projects:v}=(0,i.Y)(),{workflow:b,stages:f,stageConfig:h}=(0,d.mP)(),[j,y]=(0,a.useState)(null),[N,k]=(0,a.useState)(""),{comments:C,addComment:w,deleteComment:D}=(0,o.LU)((null==j?void 0:j.id)||null),{learnings:_,addLearning:q}=(0,o.dF)((null==j?void 0:j.id)||void 0),A=(0,a.useMemo)(()=>f.map(e=>{var t;let s=h[e],l=null==b||null==(t=b.nodes)?void 0:t.find(t=>t.name===e);return{id:e,label:(null==s?void 0:s.label)||e,icon:(null==s?void 0:s.icon)||"\uD83D\uDCCC",color:(null==s?void 0:s.color)||"var(--primary)",prompt:(null==l?void 0:l.prompt)||void 0}}),[f,h,b]),P=(0,a.useMemo)(()=>{if(!N)return c;let e=N.toLowerCase();return c.filter(t=>{var s,l;return(null==(s=t.title)?void 0:s.toLowerCase().includes(e))||(null==(l=t.description)?void 0:l.toLowerCase().includes(e))||t.id.toLowerCase().includes(e)})},[c,N]),L=(0,a.useCallback)(async e=>{try{let t=await p(e.id);y(t)}catch(t){console.error("Failed to load task details:",t),y(e)}},[p]),E=async e=>{j&&(y(t=>t?{...t,...e}:null),await m(j.id,e))},F=async e=>{j&&await w(e)},R=async(e,t,s)=>{var l,a;let o=(null==j||null==(a=j.project_context)||null==(l=a.project)?void 0:l.id)||(null==j?void 0:j.project_id)||(null==j?void 0:j.project)||void 0,r=null!=s?s:"global"===t?void 0:"task"===t?null==j?void 0:j.id:o;await q(e,t,r)};return(0,l.jsxs)("div",{className:"h-full flex flex-col p-4 sm:p-6 lg:p-8",children:[(0,l.jsx)("div",{className:"flex items-center gap-4 mb-6",children:(0,l.jsxs)("div",{className:"relative max-w-md w-full",children:[(0,l.jsx)("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:(0,l.jsx)("span",{className:"text-gray-400",children:"\uD83D\uDD0D"})}),(0,l.jsx)("input",{type:"text",placeholder:"Search project tasks...",className:"input pl-10 w-full",value:N,onChange:e=>k(e.target.value)})]})}),(0,l.jsx)("div",{className:"flex-1 overflow-y-auto min-h-0 bg-[var(--card-bg)] rounded-xl border border-[var(--card-border)]",children:u?(0,l.jsx)("div",{className:"p-8 text-center text-[var(--muted-foreground)]",children:"Loading tasks..."}):0===c.length?(0,l.jsx)("div",{className:"p-12 text-center",children:(0,l.jsx)("p",{className:"text-[var(--muted-foreground)] mb-4",children:"No tasks found for this project."})}):(0,l.jsx)(r.A,{tasks:P,onSelectTask:L})}),j&&(0,l.jsx)(n.A,{task:j,comments:j?C:[],learnings:_,projectContext:j.project_context,projects:v,stages:A,onClose:()=>y(null),onAddComment:F,onDeleteComment:D,onAddLearning:R,onUpdate:E,onDelete:async()=>{await x(j.id),y(null)}})]})}},2888:(e,t,s)=>{"use strict";s.d(t,{A:()=>i});var l=s(5155);let a={queued:{className:"badge-status-queued",label:"Queued",dotColor:"bg-[var(--status-queued)]"},in_progress:{className:"badge-status-in_progress",label:"In Progress",dotColor:"bg-[var(--status-in-progress)]"},blocked:{className:"badge-status-blocked",label:"Blocked",dotColor:"bg-[var(--status-blocked)]"},completed:{className:"badge-status-completed",label:"Completed",dotColor:"bg-[var(--status-completed)]"},failed:{className:"badge-status-failed",label:"Failed",dotColor:"bg-[var(--status-failed)]"}},o={ideation:{icon:"\uD83D\uDCA1",label:"Ideation",prompt:"Research and scope. Define approach, estimate effort."},planning:{icon:"\uD83D\uDCCB",label:"Planning",prompt:"Create detailed plan with tasks, milestones, and dependencies."},execution:{icon:"\uD83D\uDCBB",label:"Execution",prompt:"Implement based on all the context/history/research/plan. Write clean, tested code."},verification:{icon:"\uD83E\uDDEA",label:"Verification",prompt:"Test thoroughly. Find edge cases. Fix bugs. Verify requirements are met."},coding:{icon:"\uD83D\uDCBB",label:"Coding",prompt:"Write clean, tested code based on plan."},qa:{icon:"\uD83E\uDDEA",label:"QA",prompt:"Test thoroughly. Find edge cases. Fix bugs."},acceptance:{icon:"✓",label:"Acceptance",prompt:"Demo to user. Get sign-off. Address feedback."},pr:{icon:"\uD83D\uDD00",label:"PR",prompt:"Create and review pull request. Ensure all checks pass and merge."},pr_review:{icon:"\uD83D\uDC40",label:"PR Review",prompt:"Review the PR. Verify code quality and functionality. Approve or request changes."},merge:{icon:"\uD83D\uDE80",label:"Merge",prompt:"Merge the PR and verify deployment."},done:{icon:"✅",label:"Done",prompt:"Task finished and shipped."}};function r(e){let{task:t,onClick:s,compact:r=!1}=e,n=a[t.status||"queued"],i=t.stage?o[t.stage]:null;return(0,l.jsxs)("div",{onClick:s,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&(null==s?void 0:s()),className:"group relative flex items-center gap-2 p-1.5 rounded-md \n hover:bg-[var(--item-hover-bg)] transition-colors cursor-pointer\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2\n ".concat("failed"===t.status?"bg-[var(--status-failed-bg)]":""),children:[(0,l.jsx)("div",{className:"w-2 h-2 rounded-full flex-shrink-0 ".concat(n.dotColor),title:n.label}),(0,l.jsxs)("div",{className:"flex-1 min-w-0 flex items-baseline gap-2",children:[(0,l.jsx)("h3",{className:"text-sm text-[var(--foreground)] truncate leading-tight\n ".concat("completed"===t.status?"text-[var(--muted-foreground)] line-through":"","\n "),children:t.title||"Untitled Task"}),(0,l.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-[var(--muted-foreground)] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap",children:[void 0!==t.priority&&(0,l.jsxs)("span",{className:0===t.priority?"text-[var(--primary)] font-bold":"",children:["P",t.priority]}),t.project&&(0,l.jsx)("span",{className:"max-w-[80px] truncate",children:t.project})]})]}),(0,l.jsx)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:"failed"===t.status?(0,l.jsx)("span",{className:"text-[10px] text-[var(--status-failed)] font-bold",children:"FAILED"}):i&&(0,l.jsx)("span",{className:"text-[10px] opacity-40",children:i.icon})})]})}let n={in_progress:{title:"In Progress",icon:"\uD83D\uDD04",color:"var(--status-in-progress)",description:"Currently being worked on by the daemon"},blocked:{title:"Blocked",icon:"\uD83D\uDEA7",color:"var(--status-blocked)",description:"Waiting for input or resolution"},queued:{title:"Queued",icon:"\uD83D\uDCCB",color:"var(--status-queued)",description:"Ready to be picked up"},completed:{title:"Completed",icon:"✅",color:"var(--status-completed)",description:"Successfully finished"}};function i(e){let{tasks:t,onSelectTask:s}=e;if(0===t.length)return(0,l.jsxs)("div",{className:"text-center py-20 animate-fade-in",children:[(0,l.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-[var(--card-bg)] border border-[var(--card-border)] mb-4",children:(0,l.jsx)("span",{className:"text-3xl",children:"\uD83D\uDCCB"})}),(0,l.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No tasks yet"}),(0,l.jsx)("p",{className:"text-[var(--muted-foreground)] text-sm max-w-md mx-auto",children:"Create your first task to get started. Tasks will appear here organized by status."})]});let a=t.filter(e=>"in_progress"===e.status),o=t.filter(e=>"queued"===e.status),i=t.filter(e=>"blocked"===e.status),d=t.filter(e=>"completed"===e.status||"failed"===e.status),c=(e,t)=>{if(0===t.length)return null;let a=n[e];return(0,l.jsxs)("section",{className:"mb-8 animate-fade-in-up",children:[(0,l.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:"color-mix(in srgb, ".concat(a.color," 10%, transparent)")},children:[(0,l.jsx)("span",{className:"text-lg",children:a.icon}),(0,l.jsx)("h3",{className:"text-sm font-semibold",style:{color:a.color},children:a.title}),(0,l.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, ".concat(a.color," 15%, transparent)"),color:a.color},children:t.length})]}),(0,l.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] hidden sm:block",children:a.description})]}),(0,l.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:t.map((e,t)=>(0,l.jsx)("div",{className:"animate-fade-in-up",style:{animationDelay:"".concat(50*t,"ms")},children:(0,l.jsx)(r,{task:e,onClick:()=>null==s?void 0:s(e)})},e.id))})]})};return(0,l.jsxs)("div",{children:[c("in_progress",a),c("blocked",i),c("queued",o),c("completed",d)]})}},9263:(e,t,s)=>{Promise.resolve().then(s.bind(s,1986))}},e=>{e.O(0,[5004,277,2619,650,9719,2456,8441,1255,7358],()=>e(e.s=9263)),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[893],{63:(e,r,t)=>{"use strict";var s=t(7260);t.o(s,"usePathname")&&t.d(r,{usePathname:function(){return s.usePathname}}),t.o(s,"useRouter")&&t.d(r,{useRouter:function(){return s.useRouter}}),t.o(s,"useSearchParams")&&t.d(r,{useSearchParams:function(){return s.useSearchParams}})},1460:(e,r,t)=>{"use strict";t.d(r,{A:()=>m});var s=t(5155),a=t(2619),n=t.n(a),l=t(63),o=t(4647),i=t(91),d=t(2115);function c(e){let{children:r,fullWidth:t=!1,noFooter:a=!1}=e;(0,l.usePathname)(),(0,l.useRouter)();let c=(0,l.useSearchParams)(),{user:u,loading:m,signOut:x}=(0,o.A)(),{projects:p,isLoading:h}=(0,i.Y)(),b=null==c?void 0:c.get("project");return(0,d.useMemo)(()=>b?p.find(e=>e.slug===b):null,[p,b]),(0,s.jsxs)("div",{className:"h-screen flex flex-col overflow-hidden",children:[(0,s.jsx)("nav",{className:"flex-shrink-0 border-b border-[var(--card-border)] bg-[var(--card-bg)]/80 backdrop-blur-lg z-30",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:(0,s.jsxs)("div",{className:"flex items-center justify-between h-16",children:[(0,s.jsx)("div",{className:"flex items-center gap-8",children:(0,s.jsxs)(n(),{href:"/",className:"flex items-center gap-3 group",children:[(0,s.jsx)("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-[var(--primary)] to-[var(--accent)] flex items-center justify-center text-white font-bold text-sm shadow-lg shadow-[var(--primary)]/20 group-hover:shadow-[var(--primary)]/40 transition-shadow",children:"A"}),(0,s.jsx)("span",{className:"text-lg font-bold tracking-tight gradient-text hidden sm:block",children:"AGX Board"})]})}),(0,s.jsx)("div",{className:"flex items-center gap-3",children:(0,s.jsx)(n(),{href:"/settings",className:"text-sm font-medium text-[var(--muted-foreground)] hover:text-[var(--foreground)] transition-colors",children:"Settings"})})]})})}),(0,s.jsx)("main",{className:"flex-1 min-h-0 flex flex-col ".concat(t?"p-0":"p-4 sm:p-6 lg:p-8 overflow-y-auto"),children:r}),!a&&(0,s.jsx)("footer",{className:"flex-shrink-0 border-t border-[var(--card-border)] bg-[var(--card-bg)]/50 py-4",children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 flex items-center justify-between text-xs text-[var(--muted-foreground)]",children:[(0,s.jsx)("span",{children:"AGX Board • Autonomous Agent Orchestration"}),(0,s.jsx)("span",{className:"hidden sm:inline",children:"Built with Next.js + Db"})]})})]})}function u(e){return(0,s.jsx)(d.Suspense,{fallback:(0,s.jsx)("div",{className:"h-screen flex items-center justify-center bg-[var(--background)]",children:(0,s.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"})}),children:(0,s.jsx)(c,{...e})})}function m(e){let{children:r,fullWidth:t=!1,noFooter:a=!1}=e;return(0,s.jsx)(u,{fullWidth:t,noFooter:a,children:r})}},2888:(e,r,t)=>{"use strict";t.d(r,{A:()=>i});var s=t(5155);let a={queued:{className:"badge-status-queued",label:"Queued",dotColor:"bg-[var(--status-queued)]"},in_progress:{className:"badge-status-in_progress",label:"In Progress",dotColor:"bg-[var(--status-in-progress)]"},blocked:{className:"badge-status-blocked",label:"Blocked",dotColor:"bg-[var(--status-blocked)]"},completed:{className:"badge-status-completed",label:"Completed",dotColor:"bg-[var(--status-completed)]"},failed:{className:"badge-status-failed",label:"Failed",dotColor:"bg-[var(--status-failed)]"}},n={ideation:{icon:"\uD83D\uDCA1",label:"Ideation",prompt:"Research and scope. Define approach, estimate effort."},planning:{icon:"\uD83D\uDCCB",label:"Planning",prompt:"Create detailed plan with tasks, milestones, and dependencies."},execution:{icon:"\uD83D\uDCBB",label:"Execution",prompt:"Implement based on all the context/history/research/plan. Write clean, tested code."},verification:{icon:"\uD83E\uDDEA",label:"Verification",prompt:"Test thoroughly. Find edge cases. Fix bugs. Verify requirements are met."},coding:{icon:"\uD83D\uDCBB",label:"Coding",prompt:"Write clean, tested code based on plan."},qa:{icon:"\uD83E\uDDEA",label:"QA",prompt:"Test thoroughly. Find edge cases. Fix bugs."},acceptance:{icon:"✓",label:"Acceptance",prompt:"Demo to user. Get sign-off. Address feedback."},pr:{icon:"\uD83D\uDD00",label:"PR",prompt:"Create and review pull request. Ensure all checks pass and merge."},pr_review:{icon:"\uD83D\uDC40",label:"PR Review",prompt:"Review the PR. Verify code quality and functionality. Approve or request changes."},merge:{icon:"\uD83D\uDE80",label:"Merge",prompt:"Merge the PR and verify deployment."},done:{icon:"✅",label:"Done",prompt:"Task finished and shipped."}};function l(e){let{task:r,onClick:t,compact:l=!1}=e,o=a[r.status||"queued"],i=r.stage?n[r.stage]:null;return(0,s.jsxs)("div",{onClick:t,role:"button",tabIndex:0,onKeyDown:e=>"Enter"===e.key&&(null==t?void 0:t()),className:"group relative flex items-center gap-2 p-1.5 rounded-md \n hover:bg-[var(--item-hover-bg)] transition-colors cursor-pointer\n focus-visible:outline-2 focus-visible:outline-[var(--ring)] focus-visible:outline-offset-2\n ".concat("failed"===r.status?"bg-[var(--status-failed-bg)]":""),children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full flex-shrink-0 ".concat(o.dotColor),title:o.label}),(0,s.jsxs)("div",{className:"flex-1 min-w-0 flex items-baseline gap-2",children:[(0,s.jsx)("h3",{className:"text-sm text-[var(--foreground)] truncate leading-tight\n ".concat("completed"===r.status?"text-[var(--muted-foreground)] line-through":"","\n "),children:r.title||"Untitled Task"}),(0,s.jsxs)("div",{className:"flex items-center gap-2 text-[10px] text-[var(--muted-foreground)] opacity-0 group-hover:opacity-100 transition-opacity whitespace-nowrap",children:[void 0!==r.priority&&(0,s.jsxs)("span",{className:0===r.priority?"text-[var(--primary)] font-bold":"",children:["P",r.priority]}),r.project&&(0,s.jsx)("span",{className:"max-w-[80px] truncate",children:r.project})]})]}),(0,s.jsx)("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:"failed"===r.status?(0,s.jsx)("span",{className:"text-[10px] text-[var(--status-failed)] font-bold",children:"FAILED"}):i&&(0,s.jsx)("span",{className:"text-[10px] opacity-40",children:i.icon})})]})}let o={in_progress:{title:"In Progress",icon:"\uD83D\uDD04",color:"var(--status-in-progress)",description:"Currently being worked on by the daemon"},blocked:{title:"Blocked",icon:"\uD83D\uDEA7",color:"var(--status-blocked)",description:"Waiting for input or resolution"},queued:{title:"Queued",icon:"\uD83D\uDCCB",color:"var(--status-queued)",description:"Ready to be picked up"},completed:{title:"Completed",icon:"✅",color:"var(--status-completed)",description:"Successfully finished"}};function i(e){let{tasks:r,onSelectTask:t}=e;if(0===r.length)return(0,s.jsxs)("div",{className:"text-center py-20 animate-fade-in",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-[var(--card-bg)] border border-[var(--card-border)] mb-4",children:(0,s.jsx)("span",{className:"text-3xl",children:"\uD83D\uDCCB"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"No tasks yet"}),(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] text-sm max-w-md mx-auto",children:"Create your first task to get started. Tasks will appear here organized by status."})]});let a=r.filter(e=>"in_progress"===e.status),n=r.filter(e=>"queued"===e.status),i=r.filter(e=>"blocked"===e.status),d=r.filter(e=>"completed"===e.status||"failed"===e.status),c=(e,r)=>{if(0===r.length)return null;let a=o[e];return(0,s.jsxs)("section",{className:"mb-8 animate-fade-in-up",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 mb-4",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 px-3 py-1.5 rounded-lg",style:{backgroundColor:"color-mix(in srgb, ".concat(a.color," 10%, transparent)")},children:[(0,s.jsx)("span",{className:"text-lg",children:a.icon}),(0,s.jsx)("h3",{className:"text-sm font-semibold",style:{color:a.color},children:a.title}),(0,s.jsx)("span",{className:"px-2 py-0.5 rounded-full text-xs font-medium",style:{backgroundColor:"color-mix(in srgb, ".concat(a.color," 15%, transparent)"),color:a.color},children:r.length})]}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] hidden sm:block",children:a.description})]}),(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:r.map((e,r)=>(0,s.jsx)("div",{className:"animate-fade-in-up",style:{animationDelay:"".concat(50*r,"ms")},children:(0,s.jsx)(l,{task:e,onClick:()=>null==t?void 0:t(e)})},e.id))})]})};return(0,s.jsxs)("div",{children:[c("in_progress",a),c("blocked",i),c("queued",n),c("completed",d)]})}},4647:(e,r,t)=>{"use strict";t.d(r,{A:()=>d,AuthProvider:()=>i});var s=t(5155),a=t(2115),n=t(1483),l=t(5704);let o=(0,a.createContext)({user:null,loading:!0,signOut:async()=>{}});function i(e){let{children:r}=e,t="1"===l.env.NEXT_PUBLIC_AGX_BOARD_DISABLE_AUTH,[i,d]=(0,a.useState)(null),[c,u]=(0,a.useState)(!0);(0,a.useEffect)(()=>{if(t){d({id:l.env.NEXT_PUBLIC_AGX_BOARD_USER_ID||"00000000-0000-0000-0000-000000000001",email:l.env.NEXT_PUBLIC_AGX_BOARD_USER_EMAIL||"local@agx.board",user_metadata:{name:l.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User",full_name:l.env.NEXT_PUBLIC_AGX_BOARD_USER_NAME||"Local Board User"},app_metadata:{},aud:"authenticated",created_at:new Date().toISOString()}),u(!1);return}let e=(0,n.O)();e.auth.getSession().then(e=>{var r,t;d(null!=(t=null==(r=e.data.session)?void 0:r.user)?t:null),u(!1)});let{data:{subscription:r}}=e.auth.onAuthStateChange((e,r)=>{var t;d(null!=(t=null==r?void 0:r.user)?t:null),u(!1)});return()=>r.unsubscribe()},[t]);let m=async()=>{if(t)return;let e=(0,n.O)();await e.auth.signOut(),d(null)};return(0,s.jsx)(o.Provider,{value:{user:i,loading:c,signOut:m},children:r})}function d(){return(0,a.useContext)(o)}},7966:(e,r,t)=>{Promise.resolve().then(t.bind(t,9842))},9842:(e,r,t)=>{"use strict";t.r(r),t.d(r,{default:()=>x});var s=t(5155),a=t(2115),n=t(63),l=t(1460);function o(e){var r;let{project:t,onEdit:a,onDelete:n,onClick:l,onManageTasks:o}=e,i=t.repos&&t.repos.length>0;return(0,s.jsxs)("div",{onClick:()=>null==l?void 0:l(t),className:"p-5 rounded-2xl border border-[var(--card-border)] bg-[var(--card-bg)] shadow-sm space-y-4 transition-all\n ".concat(l?"cursor-pointer hover:border-[var(--primary)] hover:shadow-md active:scale-[0.99]":""),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-lg font-semibold",children:t.name}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] tracking-wide uppercase",children:t.slug})]}),(0,s.jsxs)("div",{className:"flex flex-col items-end gap-2",children:[(0,s.jsxs)("span",{className:"text-[11px] font-semibold text-[var(--muted-foreground)]",children:["Updated ",new Date(t.updated_at).toLocaleDateString()]}),(a||n||o)&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[o&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),o(t)},className:"text-[11px] font-semibold px-2 py-1 rounded-full border border-[var(--card-border)] bg-[var(--background)] hover:border-[var(--primary)] hover:text-[var(--primary)] transition-all",children:"Tasks"}),a&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),a(t)},className:"text-[11px] font-semibold px-2 py-1 rounded-full border border-[var(--card-border)] hover:border-[var(--primary)] hover:text-[var(--primary)] transition-all bg-[var(--background)]",children:"Edit"}),n&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),n(t)},className:"text-[11px] font-semibold px-2 py-1 rounded-full border border-[var(--card-border)] text-[var(--destructive)] hover:border-[var(--destructive)] transition-all bg-[var(--background)]",children:"Delete"})]})]})]}),t.description&&(0,s.jsx)("p",{className:"text-sm text-[var(--foreground)] line-clamp-2",children:t.description}),t.ci_cd_info&&(0,s.jsxs)("div",{className:"text-sm",children:[(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] text-[12px] uppercase tracking-wide",children:"CI / CD"}),(0,s.jsx)("p",{className:"text-[14px] text-[var(--accent)] font-medium truncate",children:t.ci_cd_info})]}),t.metadata&&Object.keys(t.metadata).length>0&&(0,s.jsxs)("div",{className:"p-3 rounded-lg bg-[var(--muted)]/20 border border-dashed border-[var(--card-border)] space-y-1",children:[(0,s.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-[var(--muted-foreground)]",children:"Metadata"}),(0,s.jsx)("div",{className:"space-y-1",children:Object.entries(null!=(r=t.metadata)?r:{}).filter(e=>{let[r]=e;return"undefined"!==r&&""!==r}).map(e=>{let[r,t]=e;return(0,s.jsxs)("div",{className:"text-[12px] text-[var(--muted-foreground)] flex justify-between",children:[(0,s.jsx)("span",{className:"font-semibold",children:r}),(0,s.jsx)("span",{className:"truncate text-right",children:"string"==typeof t?t:JSON.stringify(t)})]},r)})})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-[12px] uppercase tracking-wider text-[var(--muted-foreground)]",children:"Repositories"}),(0,s.jsx)("span",{className:"text-[12px] text-[var(--muted-foreground)]",children:i?"".concat(t.repos.length," connected"):"Unlinked"})]}),i?(0,s.jsxs)("div",{className:"mt-3 space-y-2",children:[t.repos.slice(0,2).map(e=>(0,s.jsxs)("div",{className:"p-2 rounded-lg border border-[var(--card-border)] bg-[var(--background)] text-[11px]",children:[(0,s.jsx)("div",{className:"font-semibold truncate",children:e.name}),e.path&&(0,s.jsx)("p",{className:"text-[10px] text-[var(--muted-foreground)] truncate",children:e.path})]},e.id)),t.repos.length>2&&(0,s.jsxs)("p",{className:"text-[10px] text-center text-[var(--muted-foreground)]",children:["+ ",t.repos.length-2," more"]})]}):(0,s.jsx)("p",{className:"mt-3 text-[12px] text-[var(--muted-foreground)]",children:"No repositories added yet."})]})]})}var i=t(2888),d=t(577),c=t(91);let u={name:"",description:""},m={name:"",path:"",notes:""};function x(){let e=(0,n.useRouter)(),{projects:r,isLoading:t,error:i,refetch:d,createProject:x,updateProject:p,deleteProject:v}=(0,c.Y)(),f=function(){let[e,r]=(0,a.useState)(u),[t,s]=(0,a.useState)([m]),[n,l]=(0,a.useState)(!1),[o,i]=(0,a.useState)(null),d=(0,a.useCallback)((e,r,t)=>{s(s=>s.map((s,a)=>a===e?{...s,[r]:t}:s))},[]),c=(0,a.useCallback)(()=>{s(e=>[...e,{...m}])},[]),x=(0,a.useCallback)(e=>{s(r=>r.filter((r,t)=>t!==e))},[]),p=(0,a.useCallback)(()=>{r(u),s([m]),i(null)},[]),h=(0,a.useCallback)(e=>{r({name:e.name||"",description:e.description||""}),e.repos&&e.repos.length>0?s(e.repos.map(e=>({name:e.name||"",path:e.path||"",notes:e.notes||""}))):s([m]),i(null)},[]);return{form:e,setForm:r,repos:t,handleRepoChange:d,addRepo:c,removeRepo:x,resetForm:p,hydrateFromProject:h,isSubmitting:n,setIsSubmitting:l,formError:o,setFormError:i}}(),[g,j]=(0,a.useState)(null),[N,y]=(0,a.useState)(!1),[k,w]=(0,a.useState)(null),{form:C,repos:_,handleRepoChange:R,addRepo:A,removeRepo:P,resetForm:S,hydrateFromProject:D,isSubmitting:E,setIsSubmitting:L,formError:B,setFormError:I,setForm:O}=f,T=()=>{j(null),S(),y(!0)},F=e=>{j(e),D(e),y(!0)},U=(0,a.useCallback)(r=>{r.slug&&e.push("/projects/".concat(r.slug))},[e]),q=(0,a.useCallback)(e=>{w(e)},[]),M=(0,a.useCallback)(()=>{w(null)},[]),X=()=>{S(),y(!1),j(null)},G=async()=>{if(!C.name.trim())return void I("Project name is required");let e=_.find(e=>e.name.trim()&&!e.path.trim());if(e)return void I('Local path is required for repository "'.concat(e.name,'"'));I(null),L(!0);let r=function(e,r){let t=r.filter(e=>e.name.trim()&&e.path.trim()).map(e=>({name:e.name.trim(),path:e.path.trim(),notes:e.notes.trim()||void 0}));return{name:e.name.trim(),description:e.description.trim()||void 0,repos:t.length?t:void 0}}(C,_);try{g?await p(g.id,r):await x(r),X()}catch(e){I(e instanceof Error?e.message:"Failed to save project")}finally{L(!1)}},W=async e=>{if(window.confirm('Delete project "'.concat(e.name,'"? This cannot be undone.')))try{await v(e.id)}catch(e){alert(e instanceof Error?e.message:"Failed to delete project")}};return(0,s.jsx)(l.A,{children:(0,s.jsxs)("div",{className:"max-w-7xl mx-auto w-full flex flex-col min-h-full",children:[(0,s.jsxs)("header",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 py-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-3xl font-bold tracking-tight",children:"Projects"}),(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] mt-1",children:"Manage your projects and their repository contexts."})]}),(0,s.jsxs)("div",{className:"flex gap-3",children:[(0,s.jsx)("button",{onClick:d,className:"px-4 py-2 rounded-xl border border-[var(--card-border)] bg-[var(--card-bg)] hover:border-[var(--primary)] transition-all text-sm font-medium",children:"Refresh"}),(0,s.jsx)("button",{onClick:T,className:"btn-primary px-6 py-2 shadow-lg shadow-[var(--primary)]/20",children:"+ New Project"})]})]}),t?(0,s.jsx)("div",{className:"flex-1 flex items-center justify-center py-20",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full"}),(0,s.jsx)("p",{className:"text-sm text-[var(--muted-foreground)] animate-pulse",children:"Loading projects..."})]})}):0===r.length?(0,s.jsxs)("div",{className:"flex-1 flex flex-col items-center justify-center py-20 animate-fade-in",children:[(0,s.jsx)("div",{className:"w-24 h-24 rounded-3xl bg-[var(--card-bg)] border border-[var(--card-border)] flex items-center justify-center text-4xl mb-6 shadow-xl",children:"\uD83D\uDCC2"}),(0,s.jsx)("h2",{className:"text-2xl font-bold mb-2",children:"You have no projects"}),(0,s.jsx)("p",{className:"text-[var(--muted-foreground)] text-center max-w-sm mb-8 leading-relaxed",children:"Create your first project to start organizing your tasks and connecting your repositories."}),(0,s.jsx)("button",{onClick:T,className:"btn-primary px-8 py-3 text-lg shadow-xl shadow-[var(--primary)]/20",children:"Create a Project"})]}):(0,s.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6 pb-20",children:r.map(e=>(0,s.jsx)(o,{project:e,onEdit:F,onDelete:W,onManageTasks:q,onClick:U},e.id))}),(0,s.jsx)(h,{isOpen:N,onClose:X,onSubmit:G,editingProject:g,form:C,repos:_,isSubmitting:E,formError:B,onFieldChange:(e,r)=>O(t=>({...t,[e]:r})),onRepoChange:R,onAddRepo:A,onRemoveRepo:P}),k&&(0,s.jsx)(b,{project:k,onClose:M})]})})}function p(e){let{form:r,repos:t,isSubmitting:a,onFieldChange:n,onRepoChange:l,onAddRepo:o,onRemoveRepo:i}=e;return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"grid gap-4",children:(0,s.jsxs)("label",{className:"space-y-1.5 block",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--muted-foreground)]",children:"Project Name"}),(0,s.jsx)("input",{value:r.name,onChange:e=>n("name",e.target.value),className:"input w-full",placeholder:"e.g. AGX Cloud",disabled:a})]})}),(0,s.jsxs)("label",{className:"space-y-1.5 block",children:[(0,s.jsx)("span",{className:"text-xs font-bold uppercase tracking-wider text-[var(--muted-foreground)]",children:"Description"}),(0,s.jsx)("textarea",{value:r.description,onChange:e=>n("description",e.target.value),className:"input w-full h-24 resize-none",placeholder:"What is this project about?",disabled:a})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between border-b border-[var(--card-border)] pb-2",children:[(0,s.jsx)("h3",{className:"text-sm font-bold uppercase tracking-widest text-[var(--muted-foreground)]",children:"Repositories"}),(0,s.jsx)("button",{type:"button",onClick:o,className:"text-xs font-semibold text-[var(--primary)] hover:underline",disabled:a,children:"+ Add Repository"})]}),(0,s.jsx)("div",{className:"space-y-4",children:t.map((e,r)=>(0,s.jsxs)("div",{className:"p-4 rounded-2xl border border-[var(--card-border)] bg-[var(--muted)]/20 space-y-3 relative group",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("span",{className:"text-xs font-bold text-[var(--foreground)] uppercase",children:["Repo #",r+1]}),t.length>1&&(0,s.jsx)("button",{type:"button",onClick:()=>i(r),className:"text-xs font-semibold text-[var(--destructive)] hover:underline",disabled:a,children:"Remove"})]}),(0,s.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,s.jsx)("input",{value:e.name,onChange:e=>l(r,"name",e.target.value),placeholder:"Name (e.g. Frontend)",className:"input text-sm",disabled:a}),(0,s.jsx)("input",{value:e.path,onChange:e=>l(r,"path",e.target.value),placeholder:"Local path (mandatory)",className:"input text-sm",disabled:a}),(0,s.jsx)("div",{className:"md:col-span-2",children:(0,s.jsx)("input",{value:e.notes,onChange:e=>l(r,"notes",e.target.value),placeholder:"Notes/Instructions",className:"input text-sm w-full",disabled:a})})]})]},r))})]})]})}function h(e){let{isOpen:r,onClose:t,onSubmit:a,editingProject:n,form:l,repos:o,isSubmitting:i,formError:d,onFieldChange:c,onRepoChange:u,onAddRepo:m,onRemoveRepo:x}=e;return r?(0,s.jsx)("div",{className:"modal-backdrop p-4 z-50 overflow-y-auto flex items-center justify-center",onClick:e=>e.target===e.currentTarget&&t(),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-4xl bg-[var(--card-bg)] rounded-3xl border border-[var(--card-border)] shadow-2xl animate-scale-in flex flex-col max-h-[90vh]",children:[(0,s.jsxs)("div",{className:"px-8 py-6 border-b border-[var(--card-border)] flex items-center justify-between flex-shrink-0",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-xl font-bold",children:n?"Edit Project":"Create New Project"}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] mt-0.5",children:n?"Update your project settings and repositories.":"Define a new project and connect repositories."})]}),(0,s.jsx)("button",{onClick:t,className:"p-2 rounded-xl hover:bg-[var(--muted)]/50 transition-colors",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"flex-1 overflow-y-auto p-8",children:[(0,s.jsx)(p,{form:l,repos:o,isSubmitting:i,onFieldChange:c,onRepoChange:u,onAddRepo:m,onRemoveRepo:x}),d&&(0,s.jsx)("div",{className:"mt-6 p-4 rounded-xl bg-[var(--destructive-muted)] border border-[var(--destructive)]/20 text-sm text-[var(--destructive)]",children:d})]}),(0,s.jsxs)("div",{className:"px-8 py-6 border-t border-[var(--card-border)] flex items-center justify-end gap-3 flex-shrink-0",children:[(0,s.jsx)("button",{onClick:t,className:"px-6 py-2 rounded-xl border border-[var(--card-border)] hover:bg-[var(--muted)]/50 transition-colors text-sm font-medium",children:"Cancel"}),(0,s.jsx)("button",{onClick:a,disabled:i,className:"btn-primary px-8 py-2 shadow-lg shadow-[var(--primary)]/20 min-w-[120px]",children:i?(0,s.jsxs)("span",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"spinner w-3 h-3 border-2 border-white/20 border-t-white"}),"Saving..."]}):n?"Save Changes":"Create Project"})]})]})}):null}function b(e){let{project:r,onClose:t}=e,{tasks:a,isLoading:n}=(0,d.si)({project:r.slug});return(0,s.jsx)("div",{className:"modal-backdrop p-4 z-50 overflow-y-auto flex items-center justify-center",onClick:e=>e.target===e.currentTarget&&t(),children:(0,s.jsxs)("div",{className:"modal-content w-full max-w-5xl bg-[var(--card-bg)] rounded-3xl border border-[var(--card-border)] shadow-2xl animate-scale-in flex flex-col max-h-[90vh]",children:[(0,s.jsxs)("div",{className:"px-8 py-6 border-b border-[var(--card-border)] flex items-center justify-between flex-shrink-0",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h2",{className:"text-xl font-bold",children:["Tasks for ",r.name]}),(0,s.jsx)("p",{className:"text-xs text-[var(--muted-foreground)] mt-0.5",children:"Viewing all tasks associated with this project."})]}),(0,s.jsx)("button",{onClick:t,className:"p-2 rounded-xl hover:bg-[var(--muted)]/50 transition-colors",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})})})]}),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto p-8",children:n?(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center py-20",children:[(0,s.jsx)("span",{className:"spinner w-8 h-8 border-3 border-[var(--primary)] border-t-transparent rounded-full mb-4"}),(0,s.jsx)("p",{className:"text-sm text-[var(--muted-foreground)]",children:"Loading project tasks..."})]}):(0,s.jsx)(i.A,{tasks:a})}),(0,s.jsx)("div",{className:"px-8 py-6 border-t border-[var(--card-border)] flex justify-end flex-shrink-0",children:(0,s.jsx)("button",{onClick:t,className:"px-6 py-2 rounded-xl border border-[var(--card-border)] hover:bg-[var(--muted)]/50 transition-colors text-sm font-medium",children:"Close"})})]})})}}},e=>{e.O(0,[2619,9719,8441,1255,7358],()=>e(e.s=7966)),_N_E=e.O()}]);