@ulpi/cli 0.1.11 → 0.1.12

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 (192) hide show
  1. package/dist/{chunk-GSFWS32F.js → chunk-3YFN5ZOR.js} +1 -1
  2. package/dist/{ci-RMMSML3A.js → ci-EXYAXQVI.js} +1 -1
  3. package/dist/{doctor-ILXW63Q2.js → doctor-2EHFGL6W.js} +1 -1
  4. package/dist/{history-TKPFJAL3.js → history-MXKIYCX4.js} +1 -1
  5. package/dist/index.js +8 -8
  6. package/dist/portal/apps/portal/.next/BUILD_ID +1 -1
  7. package/dist/portal/apps/portal/.next/app-build-manifest.json +113 -113
  8. package/dist/portal/apps/portal/.next/app-path-routes-manifest.json +25 -25
  9. package/dist/portal/apps/portal/.next/build-manifest.json +2 -2
  10. package/dist/portal/apps/portal/.next/prerender-manifest.json +106 -106
  11. package/dist/portal/apps/portal/.next/server/app/(dashboard)/billing/page_client-reference-manifest.js +1 -1
  12. package/dist/portal/apps/portal/.next/server/app/(dashboard)/codemap/page_client-reference-manifest.js +1 -1
  13. package/dist/portal/apps/portal/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  14. package/dist/portal/apps/portal/.next/server/app/(dashboard)/history/[sha]/transcript/page_client-reference-manifest.js +1 -1
  15. package/dist/portal/apps/portal/.next/server/app/(dashboard)/history/page_client-reference-manifest.js +1 -1
  16. package/dist/portal/apps/portal/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  17. package/dist/portal/apps/portal/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  18. package/dist/portal/apps/portal/.next/server/app/(dashboard)/loop/page_client-reference-manifest.js +1 -1
  19. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/[name]/page_client-reference-manifest.js +1 -1
  20. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/catalog/page_client-reference-manifest.js +1 -1
  21. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/page_client-reference-manifest.js +1 -1
  22. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/secrets/page_client-reference-manifest.js +1 -1
  23. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/submissions/page_client-reference-manifest.js +1 -1
  24. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/usage/page_client-reference-manifest.js +1 -1
  25. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  26. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/settings/page_client-reference-manifest.js +1 -1
  27. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/timeline/page_client-reference-manifest.js +1 -1
  28. package/dist/portal/apps/portal/.next/server/app/(dashboard)/notifications/page_client-reference-manifest.js +1 -1
  29. package/dist/portal/apps/portal/.next/server/app/(dashboard)/parallel/page_client-reference-manifest.js +1 -1
  30. package/dist/portal/apps/portal/.next/server/app/(dashboard)/prd/page_client-reference-manifest.js +1 -1
  31. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/[id]/guards/page_client-reference-manifest.js +1 -1
  32. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/[id]/page_client-reference-manifest.js +1 -1
  33. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/page_client-reference-manifest.js +1 -1
  34. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/config/page_client-reference-manifest.js +1 -1
  35. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/page_client-reference-manifest.js +1 -1
  36. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/plan/page_client-reference-manifest.js +1 -1
  37. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/queue/page_client-reference-manifest.js +1 -1
  38. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/[id]/page_client-reference-manifest.js +1 -1
  39. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/new/page_client-reference-manifest.js +1 -1
  40. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/page_client-reference-manifest.js +1 -1
  41. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/pipelines/page_client-reference-manifest.js +1 -1
  42. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sessions/[sessionId]/page_client-reference-manifest.js +1 -1
  43. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sessions/page_client-reference-manifest.js +1 -1
  44. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/github/page_client-reference-manifest.js +1 -1
  45. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/installations/page_client-reference-manifest.js +1 -1
  46. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/keys/page_client-reference-manifest.js +1 -1
  47. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/members/page_client-reference-manifest.js +1 -1
  48. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/orgs/new/page_client-reference-manifest.js +1 -1
  49. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  50. package/dist/portal/apps/portal/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  51. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sprints/[batchId]/page_client-reference-manifest.js +1 -1
  52. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sprints/page_client-reference-manifest.js +1 -1
  53. package/dist/portal/apps/portal/.next/server/app/(dashboard)/templates/page_client-reference-manifest.js +1 -1
  54. package/dist/portal/apps/portal/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  55. package/dist/portal/apps/portal/.next/server/app/_not-found.html +1 -1
  56. package/dist/portal/apps/portal/.next/server/app/_not-found.rsc +1 -1
  57. package/dist/portal/apps/portal/.next/server/app/auth/callback/page_client-reference-manifest.js +1 -1
  58. package/dist/portal/apps/portal/.next/server/app/auth/callback.html +1 -1
  59. package/dist/portal/apps/portal/.next/server/app/auth/callback.rsc +1 -1
  60. package/dist/portal/apps/portal/.next/server/app/billing.html +1 -1
  61. package/dist/portal/apps/portal/.next/server/app/billing.rsc +3 -3
  62. package/dist/portal/apps/portal/.next/server/app/codemap.html +1 -1
  63. package/dist/portal/apps/portal/.next/server/app/codemap.rsc +3 -3
  64. package/dist/portal/apps/portal/.next/server/app/dashboard.html +1 -1
  65. package/dist/portal/apps/portal/.next/server/app/dashboard.rsc +3 -3
  66. package/dist/portal/apps/portal/.next/server/app/history.html +1 -1
  67. package/dist/portal/apps/portal/.next/server/app/history.rsc +3 -3
  68. package/dist/portal/apps/portal/.next/server/app/jobs.html +1 -1
  69. package/dist/portal/apps/portal/.next/server/app/jobs.rsc +3 -3
  70. package/dist/portal/apps/portal/.next/server/app/loop.html +1 -1
  71. package/dist/portal/apps/portal/.next/server/app/loop.rsc +3 -3
  72. package/dist/portal/apps/portal/.next/server/app/mcps/catalog.html +1 -1
  73. package/dist/portal/apps/portal/.next/server/app/mcps/catalog.rsc +3 -3
  74. package/dist/portal/apps/portal/.next/server/app/mcps/secrets.html +1 -1
  75. package/dist/portal/apps/portal/.next/server/app/mcps/secrets.rsc +3 -3
  76. package/dist/portal/apps/portal/.next/server/app/mcps/submissions.html +1 -1
  77. package/dist/portal/apps/portal/.next/server/app/mcps/submissions.rsc +3 -3
  78. package/dist/portal/apps/portal/.next/server/app/mcps/usage.html +1 -1
  79. package/dist/portal/apps/portal/.next/server/app/mcps/usage.rsc +3 -3
  80. package/dist/portal/apps/portal/.next/server/app/mcps.html +1 -1
  81. package/dist/portal/apps/portal/.next/server/app/mcps.rsc +3 -3
  82. package/dist/portal/apps/portal/.next/server/app/memory/settings.html +1 -1
  83. package/dist/portal/apps/portal/.next/server/app/memory/settings.rsc +3 -3
  84. package/dist/portal/apps/portal/.next/server/app/memory/timeline.html +1 -1
  85. package/dist/portal/apps/portal/.next/server/app/memory/timeline.rsc +3 -3
  86. package/dist/portal/apps/portal/.next/server/app/memory.html +1 -1
  87. package/dist/portal/apps/portal/.next/server/app/memory.rsc +3 -3
  88. package/dist/portal/apps/portal/.next/server/app/notifications.html +1 -1
  89. package/dist/portal/apps/portal/.next/server/app/notifications.rsc +3 -3
  90. package/dist/portal/apps/portal/.next/server/app/parallel.html +1 -1
  91. package/dist/portal/apps/portal/.next/server/app/parallel.rsc +3 -3
  92. package/dist/portal/apps/portal/.next/server/app/prd.html +1 -1
  93. package/dist/portal/apps/portal/.next/server/app/prd.rsc +3 -3
  94. package/dist/portal/apps/portal/.next/server/app/repos.html +1 -1
  95. package/dist/portal/apps/portal/.next/server/app/repos.rsc +3 -3
  96. package/dist/portal/apps/portal/.next/server/app/review/config.html +1 -1
  97. package/dist/portal/apps/portal/.next/server/app/review/config.rsc +3 -3
  98. package/dist/portal/apps/portal/.next/server/app/review/plan.html +1 -1
  99. package/dist/portal/apps/portal/.next/server/app/review/plan.rsc +3 -3
  100. package/dist/portal/apps/portal/.next/server/app/review/queue.html +1 -1
  101. package/dist/portal/apps/portal/.next/server/app/review/queue.rsc +3 -3
  102. package/dist/portal/apps/portal/.next/server/app/review.html +1 -1
  103. package/dist/portal/apps/portal/.next/server/app/review.meta +2 -0
  104. package/dist/portal/apps/portal/.next/server/app/review.rsc +2 -2
  105. package/dist/portal/apps/portal/.next/server/app/rules/new.html +1 -1
  106. package/dist/portal/apps/portal/.next/server/app/rules/new.rsc +3 -3
  107. package/dist/portal/apps/portal/.next/server/app/rules/pipelines.html +1 -1
  108. package/dist/portal/apps/portal/.next/server/app/rules/pipelines.rsc +3 -3
  109. package/dist/portal/apps/portal/.next/server/app/rules.html +1 -1
  110. package/dist/portal/apps/portal/.next/server/app/rules.rsc +3 -3
  111. package/dist/portal/apps/portal/.next/server/app/sessions.html +1 -1
  112. package/dist/portal/apps/portal/.next/server/app/sessions.rsc +3 -3
  113. package/dist/portal/apps/portal/.next/server/app/settings/github.html +1 -1
  114. package/dist/portal/apps/portal/.next/server/app/settings/github.rsc +3 -3
  115. package/dist/portal/apps/portal/.next/server/app/settings/installations.html +1 -1
  116. package/dist/portal/apps/portal/.next/server/app/settings/installations.rsc +2 -2
  117. package/dist/portal/apps/portal/.next/server/app/settings/keys.html +1 -1
  118. package/dist/portal/apps/portal/.next/server/app/settings/keys.rsc +3 -3
  119. package/dist/portal/apps/portal/.next/server/app/settings/members.html +1 -1
  120. package/dist/portal/apps/portal/.next/server/app/settings/members.rsc +3 -3
  121. package/dist/portal/apps/portal/.next/server/app/settings/orgs/new.html +1 -1
  122. package/dist/portal/apps/portal/.next/server/app/settings/orgs/new.rsc +3 -3
  123. package/dist/portal/apps/portal/.next/server/app/settings.html +1 -1
  124. package/dist/portal/apps/portal/.next/server/app/settings.rsc +3 -3
  125. package/dist/portal/apps/portal/.next/server/app/skills.html +1 -1
  126. package/dist/portal/apps/portal/.next/server/app/skills.rsc +3 -3
  127. package/dist/portal/apps/portal/.next/server/app/sprints.html +1 -1
  128. package/dist/portal/apps/portal/.next/server/app/sprints.rsc +3 -3
  129. package/dist/portal/apps/portal/.next/server/app/templates.html +1 -1
  130. package/dist/portal/apps/portal/.next/server/app/templates.rsc +3 -3
  131. package/dist/portal/apps/portal/.next/server/app-paths-manifest.json +25 -25
  132. package/dist/portal/apps/portal/.next/server/chunks/1522.js +1 -1
  133. package/dist/portal/apps/portal/.next/server/pages/404.html +1 -1
  134. package/dist/portal/apps/portal/.next/server/pages/500.html +1 -1
  135. package/dist/portal/apps/portal/.next/static/chunks/380-71bdca6a9260da3e.js +1 -0
  136. package/dist/portal/apps/portal/.next/static/chunks/3958-9975252472a218aa.js +1 -0
  137. package/dist/portal/apps/portal/.next/static/chunks/7525-85f4ca4276511230.js +1 -0
  138. package/dist/portal/apps/portal/.next/static/chunks/7889-a8be276e20a74863.js +1 -0
  139. package/dist/portal/apps/portal/.next/static/chunks/8744-29d969a2ddf40afe.js +1 -0
  140. package/dist/portal/apps/portal/.next/static/chunks/{8934-bb365eb647fb2d5a.js → 8934-9fbad2b348b6ada1.js} +1 -1
  141. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/codemap/page-e85b24075b2ae8e9.js +1 -0
  142. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/dashboard/page-701be25e4930fcb6.js +1 -0
  143. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/jobs/[id]/page-b0ac38d08f846f50.js +1 -0
  144. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/layout-4232b69653c5fbbf.js +1 -0
  145. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/[name]/page-f5283ca4a2a1141b.js +1 -0
  146. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/catalog/page-9b228ecfe1982eba.js +1 -0
  147. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/page-d8028301dcd11348.js +1 -0
  148. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/page-34fe9bf93ef853d0.js +1 -0
  149. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/settings/page-5c9c471c9425d814.js +1 -0
  150. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/timeline/page-590f707b60b9ba47.js +1 -0
  151. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/notifications/page-46a9b033af7430e6.js +1 -0
  152. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/repos/page-155cd1007250e5da.js +1 -0
  153. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/config/page-5ffb558d24a57b2c.js +1 -0
  154. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/queue/page-9fe0df848d23c383.js +1 -0
  155. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/page-e17685f3220da942.js +1 -0
  156. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/pipelines/page-589f30a41f066568.js +1 -0
  157. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/sessions/page-4ff5d7490cc0d260.js +1 -0
  158. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/settings/page-045a30e0bd843279.js +1 -0
  159. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/skills/page-2bd816bd8e62dc04.js +1 -0
  160. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/templates/page-28a51e2788c5798d.js +1 -0
  161. package/dist/portal/apps/portal/package.json +0 -1
  162. package/dist/{start-BRB2XW3T.js → start-6SLTMLI4.js} +1 -1
  163. package/dist/{update-HBWHFHUW.js → update-563P3ZIS.js} +1 -1
  164. package/dist/{version-checker-BQP7DVQ4.js → version-checker-JHHM4OTR.js} +1 -1
  165. package/package.json +1 -1
  166. package/dist/portal/apps/portal/.next/static/chunks/380-52bab5fc966d7cf9.js +0 -1
  167. package/dist/portal/apps/portal/.next/static/chunks/3958-eebe9ad88e40b2c1.js +0 -1
  168. package/dist/portal/apps/portal/.next/static/chunks/7525-8d416b046f9add2a.js +0 -1
  169. package/dist/portal/apps/portal/.next/static/chunks/7889-a3331988a8344d05.js +0 -1
  170. package/dist/portal/apps/portal/.next/static/chunks/8744-d545a53c9709467b.js +0 -1
  171. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/codemap/page-bf1ece66c1b05822.js +0 -1
  172. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/dashboard/page-936391d6b330f0cc.js +0 -1
  173. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/jobs/[id]/page-dba3c6050ccf9243.js +0 -1
  174. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/layout-05fc9732a636a609.js +0 -1
  175. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/[name]/page-f24841b78e8c05c0.js +0 -1
  176. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/catalog/page-2ff0e6b6a5d76dac.js +0 -1
  177. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/page-2476b9c29c44c372.js +0 -1
  178. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/page-afe7f7a5b78650f2.js +0 -1
  179. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/settings/page-a3be96ef297c8e33.js +0 -1
  180. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/timeline/page-4e3dd7e30a9946f0.js +0 -1
  181. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/notifications/page-df5f393a51d8e17b.js +0 -1
  182. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/repos/page-a0bcc68a119f63e1.js +0 -1
  183. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/config/page-770321f5a71a29a3.js +0 -1
  184. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/queue/page-33687733a5398264.js +0 -1
  185. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/page-ac19551ab9f2128d.js +0 -1
  186. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/pipelines/page-96ecfcce3a60ebb2.js +0 -1
  187. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/sessions/page-0b140fb8bbc53097.js +0 -1
  188. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/settings/page-ec4076cedf8df275.js +0 -1
  189. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/skills/page-81f63d5d894b0b03.js +0 -1
  190. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/templates/page-263e03b6690d36f5.js +0 -1
  191. /package/dist/portal/apps/portal/.next/static/{SG8tUyluXEA9HzEKtf-oo → p-7mo3JdIgTzhlpqhShmK}/_buildManifest.js +0 -0
  192. /package/dist/portal/apps/portal/.next/static/{SG8tUyluXEA9HzEKtf-oo → p-7mo3JdIgTzhlpqhShmK}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6337],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>l,h:()=>a});var r=s(7811);function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},1457:(e,t,s)=>{"use strict";s.d(t,{H:()=>r,N:()=>a});let r={free:{maxWorkers:0,maxRepos:0,maxMinutes:0,mcpGatewayEnabled:!1,maxConcurrentMcpBackends:0},starter:{maxWorkers:2,maxRepos:5,maxMinutes:500,mcpGatewayEnabled:!0,maxConcurrentMcpBackends:20},pro:{maxWorkers:5,maxRepos:20,maxMinutes:2e3,mcpGatewayEnabled:!0,maxConcurrentMcpBackends:50},team:{maxWorkers:10,maxRepos:1/0,maxMinutes:5e3,mcpGatewayEnabled:!0,maxConcurrentMcpBackends:100}},a=[{tier:"free",name:"Free Forever",price:0,description:"The complete intelligence layer. No limits.",badge:"FREE",features:["Guard Rules — all 4 types + 28 templates","CodeMap — 11 MCP tools, hybrid search","DepGraph — 35 languages, PageRank, cycles","Memory — 6 MCP tools, 8 memory types","History — shadow branches, transcripts","Plan & Code Review — 8-dimension scoring","Session Tracking — real-time events","Web UI — 20-page local dashboard","Unlimited projects & sessions","Embedding: ULPI Cloud (free tier), Ollama, or OpenAI"],limits:r.free},{tier:"starter",name:"Starter",price:49,betaPrice:29,description:"Cloud CI for small teams getting started.",badge:"BETA",features:["Everything in Free","GitHub App integration","2 concurrent workers","5 repositories","500 CI minutes / month","AI code review on PRs","PR comments with structured results","MCP Gateway — cloud multiplexing proxy"],limits:r.starter},{tier:"pro",name:"Pro",price:149,betaPrice:79,description:"Full cloud CI for growing engineering teams.",badge:"POPULAR",features:["Everything in Starter","5 concurrent workers","20 repositories","2,000 CI minutes / month","Check run status reporting","Priority job queue","Team collaboration"],limits:r.pro,highlighted:!0},{tier:"team",name:"Team",price:349,betaPrice:199,description:"For large teams with heavy CI workloads.",badge:"BETA",features:["Everything in Pro","10 concurrent workers","Unlimited repositories","5,000 CI minutes / month","Dedicated support","SSO (coming soon)"],limits:r.team}]},2248:(e,t,s)=>{Promise.resolve().then(s.bind(s,6188))},3090:(e,t,s)=>{"use strict";s.d(t,{S:()=>l});var r=s(8111);function a(e){let{label:t,current:s,max:a,unit:l=""}=e,n=!isFinite(a),i=n?0:a>0?Math.min(s/a,1):0,o=Math.round(100*i);return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,r.jsx)("span",{className:"text-xs text-gray-400",children:t}),(0,r.jsxs)("span",{className:"text-xs font-medium ".concat(n?"text-emerald-400":i>.9?"text-red-400":i>.7?"text-yellow-400":"text-emerald-400"),children:[s.toLocaleString(),l," / ",n?"Unlimited":"".concat(a.toLocaleString()).concat(l)]})]}),(0,r.jsx)("div",{className:"h-1.5 overflow-hidden rounded-full bg-surface-700",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-gradient-to-r transition-all duration-500 ".concat(n?"from-emerald-500 to-emerald-400":i>.9?"from-red-500 to-red-400":i>.7?"from-yellow-500 to-orange-400":"from-emerald-500 to-emerald-400"),style:{width:n?"5%":"".concat(o,"%")}})}),(0,r.jsx)("p",{className:"mt-1 text-[10px] text-gray-600",children:n?"Unlimited":"".concat(o,"% used")})]})}function l(e){let{workers:t,repos:s,minutes:l}=e;return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("h3",{className:"text-xs font-semibold text-gray-400 uppercase tracking-wider mb-3",children:"Usage This Month"}),(0,r.jsx)(a,{label:"Workers",current:t.current,max:t.max}),(0,r.jsx)(a,{label:"Repos",current:s.current,max:s.max}),(0,r.jsx)(a,{label:"CI Minutes",current:l.current,max:l.max,unit:" min"})]})}},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>c,HI:()=>x,Xk:()=>d,yC:()=>u});var r=s(8111),a=s(5271),l=s(422),n=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=n.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,l.h)()}}let o=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,s=(0,a.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(o,{value:s,children:t})}function d(){return(0,a.useContext)(o).mode}function u(){let{localClient:e}=(0,a.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,a.useContext)(o)}},6188:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var r=s(8111),a=s(5271),l=s(8934),n=s(2928),i=s(422),o=s(3446),c=s(1457),d=s(3090),u=s(6971),x=s(5935),m=s.n(x);function h(e){let{label:t,value:s,subtitle:a,icon:l}=e;return(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-4",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:t}),l&&(0,r.jsx)("span",{className:"text-gray-600",children:l})]}),(0,r.jsx)("p",{className:"mt-2 text-2xl font-semibold text-white",children:s}),a&&(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-300",children:a})]})}function p(e){let{href:t,label:s,icon:a}=e;return(0,r.jsxs)(m(),{href:t,className:"flex items-center gap-2.5 rounded-lg border border-white/[0.06] bg-surface-900 px-4 py-3 text-sm text-gray-400 transition-colors hover:border-white/[0.1] hover:text-white",children:[(0,r.jsx)("span",{className:"text-gray-500",children:a}),s,(0,r.jsx)("svg",{className:"ml-auto h-3.5 w-3.5 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"})})]})}function g(){var e,t,s;let{localClient:l}=(0,o.HI)(),[n,i]=(0,a.useState)(null),[c,d]=(0,a.useState)(!0);return((0,a.useEffect)(()=>{l&&e();async function e(){try{var e;let t=null!=(e=(await l.get("/api/rules")).rules)?e:[];i({rulesCount:t.length,enabledCount:t.filter(e=>e.enabled).length,disabledCount:t.filter(e=>!e.enabled).length})}catch(e){}finally{d(!1)}}},[l]),c)?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,r.jsx)("div",{className:"h-24 animate-pulse rounded-xl border border-white/[0.06] bg-surface-900"},t))})]}):(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-300",children:"Local mode -- connected to your ULPI API server"})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-3",children:[(0,r.jsx)(h,{label:"Total Rules",value:null!=(e=null==n?void 0:n.rulesCount)?e:0,subtitle:"Configured in guards.yml",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})})}),(0,r.jsx)(h,{label:"Active Rules",value:null!=(t=null==n?void 0:n.enabledCount)?t:0,subtitle:"Currently enabled",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})}),(0,r.jsx)(h,{label:"Disabled Rules",value:null!=(s=null==n?void 0:n.disabledCount)?s:0,subtitle:"Inactive",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"})})})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"mb-3 text-base font-semibold text-white",children:"Quick Actions"}),(0,r.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-3",children:[(0,r.jsx)(p,{href:"/rules",label:"View Rules",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})})}),(0,r.jsx)(p,{href:"/templates",label:"Browse Templates",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})})}),(0,r.jsx)(p,{href:"/skills",label:"Browse Skills",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456Z"})})}),(0,r.jsx)(p,{href:"/repos",label:"Manage Repos",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})})}),(0,r.jsx)(p,{href:"/sessions",label:"View Sessions",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})})}),(0,r.jsx)(p,{href:"/notifications",label:"Notification Settings",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"})})})]})]})]})}function b(e){let{number:t,title:s,description:a,href:l,linkLabel:n,done:i}=e;return(0,r.jsxs)("div",{className:"flex items-start gap-3",children:[(0,r.jsx)("div",{className:"flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-bold ".concat(i?"bg-emerald-500/15 text-emerald-400":"border border-primary-500/30 bg-primary-500/10 text-primary-400"),children:i?(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}):t}),(0,r.jsxs)("div",{className:"flex-1",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-white",children:s}),(0,r.jsx)("p",{className:"mt-0.5 text-xs text-gray-500",children:a}),!i&&(0,r.jsxs)(m(),{href:l,className:"mt-1.5 inline-flex text-xs font-medium text-primary-400 transition-colors hover:text-primary-300",children:[n," →"]})]})]})}function j(e){let{completed:t,total:s}=e,a=s>0?Math.round(t/s*100):0;return(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-1.5 flex-1 overflow-hidden rounded-full bg-surface-800",children:(0,r.jsx)("div",{className:"h-full rounded-full bg-primary-500 transition-all",style:{width:"".concat(a,"%")}})}),(0,r.jsxs)("span",{className:"text-[10px] tabular-nums text-gray-500",children:[t,"/",s]})]})}function v(){var e,t,s,i,o,x,g,v,f;let{org:y}=(0,l.As)(),[w,k]=(0,a.useState)(null),[N,C]=(0,a.useState)([]),[L,M]=(0,a.useState)([]),[A,_]=(0,a.useState)(!0);if((0,a.useEffect)(()=>{y&&e();async function e(){try{let[e,t,s]=await Promise.all([n.uE.getDashboardStats(y.id),n.uE.getRecentJobs(y.id,10),n.uE.listBatchJobs(y.id,{status:"running"}).then(e=>e.batch_jobs).catch(()=>[])]);k(e),C(t),M(s)}catch(e){}finally{_(!1)}}},[y]),A)return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),(0,r.jsx)("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:Array.from({length:4}).map((e,t)=>(0,r.jsx)("div",{className:"h-24 animate-pulse rounded-xl border border-white/[0.06] bg-surface-900"},t))})]});let P=c.H.free,E=(null!=(e=null==w?void 0:w.total_repos)?e:0)===0;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Dashboard"}),E&&(0,r.jsxs)("div",{className:"relative overflow-hidden rounded-2xl border border-primary-500/20 bg-gradient-to-br from-primary-500/[0.06] via-surface-900 to-surface-900 p-6",children:[(0,r.jsx)("div",{className:"pointer-events-none absolute -right-20 -top-20 h-40 w-40 rounded-full bg-primary-500/10 blur-3xl"}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.jsx)("h2",{className:"text-lg font-bold text-white",children:"Welcome to ULPI Cloud"}),(0,r.jsx)("p",{className:"mt-1 max-w-lg text-sm text-gray-400",children:"Connect your repositories and start running AI-powered sprints. Follow these steps to get up and running."}),(0,r.jsxs)("div",{className:"mt-5 space-y-4",children:[(0,r.jsx)(b,{number:1,title:"Connect GitHub",description:"Install the ULPI GitHub App on your repositories.",href:"/settings/github",linkLabel:"Install GitHub App"}),(0,r.jsx)(b,{number:2,title:"Add a Repository",description:"Activate a repository from your GitHub installations.",href:"/repos",linkLabel:"Add Repository"}),(0,r.jsx)(b,{number:3,title:"Run Your First Sprint",description:"Create a batch job to execute tasks with AI agents.",href:"/sprints",linkLabel:"Create Sprint"})]})]})]}),(0,r.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[(0,r.jsx)(h,{label:"Active Jobs",value:null!=(t=null==w?void 0:w.active_jobs)?t:0,subtitle:"Currently running"}),(0,r.jsx)(h,{label:"Repositories",value:null!=(s=null==w?void 0:w.total_repos)?s:0,subtitle:"Connected"}),(0,r.jsx)(h,{label:"Jobs Today",value:null!=(i=null==w?void 0:w.jobs_today)?i:0}),(0,r.jsx)(h,{label:"Jobs This Week",value:null!=(o=null==w?void 0:w.jobs_this_week)?o:0})]}),(0,r.jsx)(d.S,{workers:{current:null!=(x=null==w?void 0:w.active_jobs)?x:0,max:P.maxWorkers},repos:{current:null!=(g=null==w?void 0:w.total_repos)?g:0,max:P.maxRepos},minutes:{current:null!=(v=null==w?void 0:w.minutes_used)?v:0,max:null!=(f=null==w?void 0:w.minutes_limit)?f:P.maxMinutes}}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"mb-3 text-base font-semibold text-white",children:"Quick Actions"}),(0,r.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2 lg:grid-cols-4",children:[(0,r.jsx)(p,{href:"/sprints",label:"New Sprint",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})}),(0,r.jsx)(p,{href:"/mcps/catalog",label:"MCP Catalog",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})}),(0,r.jsx)(p,{href:"/settings/members",label:"Team Members",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})})}),(0,r.jsx)(p,{href:"/settings/keys",label:"API Keys",icon:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})})})]})]}),(0,r.jsxs)("div",{className:"grid gap-6 lg:grid-cols-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:"Active Sprints"}),(0,r.jsx)(m(),{href:"/sprints",className:"text-xs text-gray-400 transition-colors hover:text-primary-400",children:"View all →"})]}),(0,r.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900",children:0===L.length?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-10",children:[(0,r.jsx)("svg",{className:"h-7 w-7 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"No active sprints."}),(0,r.jsx)(m(),{href:"/sprints",className:"mt-1 text-xs font-medium text-primary-400 transition-colors hover:text-primary-300",children:"Create a sprint →"})]}):(0,r.jsx)("div",{className:"divide-y divide-white/[0.04]",children:L.map(e=>(0,r.jsxs)(m(),{href:"/sprints/".concat(e.id),className:"block px-4 py-3 transition-colors hover:bg-white/[0.02]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("span",{className:"truncate text-sm font-medium text-gray-200",children:e.repo_id.slice(0,16)}),(0,r.jsx)("span",{className:"ml-2 shrink-0 rounded-full bg-primary-500/10 px-2 py-0.5 text-[10px] font-medium text-primary-400",children:e.status})]}),(0,r.jsx)("div",{className:"mt-2",children:(0,r.jsx)(j,{completed:e.jobs_completed,total:e.jobs_total})}),e.agent_type&&(0,r.jsxs)("p",{className:"mt-1 text-[10px] text-gray-600",children:["Agent: ",e.agent_type]})]},e.id))})})]}),(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:"Recent Activity"}),(0,r.jsx)(m(),{href:"/jobs",className:"text-xs text-gray-400 transition-colors hover:text-primary-400",children:"View all jobs →"})]}),(0,r.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900",children:0===N.length?(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2 py-10",children:[(0,r.jsx)("svg",{className:"h-7 w-7 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7m16 0v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-5m16 0h-2.586a1 1 0 0 0-.707.293l-2.414 2.414a1 1 0 0 1-.707.293h-3.172a1 1 0 0 1-.707-.293l-2.414-2.414A1 1 0 0 0 6.586 13H4"})}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"No jobs yet. Connect a repository to get started."})]}):(0,r.jsx)("div",{className:"divide-y divide-white/[0.04]",children:N.map(e=>(0,r.jsxs)(m(),{href:"/jobs/".concat(e.id),className:"flex items-center gap-3 px-4 py-2.5 transition-colors hover:bg-white/[0.02]",children:[(0,r.jsx)(u.P,{status:e.status}),(0,r.jsx)("span",{className:"flex-1 truncate text-sm font-medium text-gray-200",children:e.repo_id.slice(0,12)}),(0,r.jsx)("span",{className:"rounded-md bg-surface-800 px-1.5 py-0.5 text-[10px] font-medium text-gray-500",children:e.trigger.replace(/_/g," ")}),e.github_pr_number&&(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:["#",e.github_pr_number]}),(0,r.jsx)("span",{className:"text-xs text-gray-600",children:function(e){let t=Math.floor((Date.now()-new Date(e).getTime())/1e3);if(t<60)return"just now";let s=Math.floor(t/60);if(s<60)return"".concat(s,"m ago");let r=Math.floor(s/60);if(r<24)return"".concat(r,"h ago");let a=Math.floor(r/24);return"".concat(a,"d ago")}(e.queued_at)})]},e.id))})})]})]})]})}function f(){return(0,i.J)()?(0,r.jsx)(g,{}):(0,r.jsx)(v,{})}},6971:(e,t,s)=>{"use strict";s.d(t,{P:()=>l});var r=s(8111);let a={queued:{label:"Queued",bg:"bg-yellow-500/10",text:"text-yellow-400",dot:"bg-yellow-400"},running:{label:"Running",bg:"bg-blue-500/10",text:"text-blue-400",dot:"bg-blue-400 animate-pulse"},completed:{label:"Completed",bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"bg-emerald-400"},failed:{label:"Failed",bg:"bg-red-500/10",text:"text-red-400",dot:"bg-red-400"},canceled:{label:"Canceled",bg:"bg-gray-500/10",text:"text-gray-400",dot:"bg-gray-400"}};function l(e){let{status:t,size:s="sm"}=e,l=a[t];return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full ".concat(l.bg," ").concat(l.text," ").concat("sm"===s?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm"),children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(l.dot)}),l.label]})}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=2248)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2771],{334:(e,t,s)=>{Promise.resolve().then(s.bind(s,4721))},4721:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>m});var r=s(8111),a=s(5271),l=s(4736),n=s(8934),i=s(2928),c=s(6971);function o(e){let{streamUrl:t,lines:s,live:l=!1,maxHeight:n=600}=e,[i,c]=(0,a.useState)(null!=s?s:[]),[o,d]=(0,a.useState)(!1),[x,u]=(0,a.useState)(!0),m=(0,a.useRef)(null),h=(0,a.useRef)(null);return(0,a.useEffect)(()=>{if(!t)return;let e=new EventSource(t,{withCredentials:!0});return e.onopen=()=>{d(!0)},e.onmessage=e=>{try{let t=JSON.parse(e.data);c(e=>[...e,t])}catch(t){c(t=>[...t,{timestamp:new Date().toISOString(),text:e.data}])}},e.addEventListener("done",()=>{e.close(),d(!1)}),e.onerror=()=>{d(!1),e.close()},()=>{e.close()}},[t]),(0,a.useEffect)(()=>{x&&h.current&&h.current.scrollIntoView({behavior:"smooth"})},[i,x]),(0,r.jsxs)("div",{className:"overflow-hidden rounded-xl border border-white/[0.06] bg-surface-950",children:[(0,r.jsxs)("div",{className:"glass flex items-center justify-between px-4 py-2.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("svg",{className:"h-3.5 w-3.5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3"})}),(0,r.jsx)("span",{className:"text-xs font-medium text-gray-400",children:"Logs"}),(l||o)&&(0,r.jsxs)("span",{className:"flex items-center gap-1.5 text-xs text-emerald-400",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 animate-pulse rounded-full bg-emerald-400"}),"Live"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsxs)("span",{className:"text-xs text-gray-600",children:[i.length," line",1!==i.length?"s":""]}),!x&&(0,r.jsxs)("button",{onClick:()=>{var e;u(!0),null==(e=h.current)||e.scrollIntoView({behavior:"smooth"})},className:"flex items-center gap-1 rounded-md px-2 py-1 text-xs text-gray-400 transition-colors hover:bg-white/[0.04] hover:text-white",children:[(0,r.jsx)("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 13.5 12 21m0 0-7.5-7.5M12 21V3"})}),"Bottom"]})]})]}),(0,r.jsxs)("div",{ref:m,onScroll:function(){let e=m.current;e&&u(e.scrollHeight-e.scrollTop-e.clientHeight<50)},className:"overflow-y-auto font-mono text-xs leading-6",style:{maxHeight:n},children:[0===i.length&&(0,r.jsx)("div",{className:"flex items-center justify-center py-16 text-gray-600",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[(0,r.jsx)("svg",{className:"h-6 w-6",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3M4.5 19.5h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15A2.25 2.25 0 0 0 2.25 6.75v10.5A2.25 2.25 0 0 0 4.5 19.5Z"})}),(0,r.jsx)("span",{className:"text-xs",children:l||t?"Waiting for logs...":"No logs available."})]})}),i.map((e,t)=>(0,r.jsxs)("div",{className:"flex hover:bg-white/[0.02] px-4",children:[(0,r.jsx)("span",{className:"w-10 shrink-0 select-none pr-4 text-right text-gray-700",children:t+1}),(0,r.jsx)("span",{className:"w-20 shrink-0 text-gray-600",children:e.timestamp?new Date(e.timestamp).toLocaleTimeString():""}),(0,r.jsx)("span",{className:"whitespace-pre-wrap break-all ".concat(function(e){switch(e){case"error":return"text-red-400";case"warn":return"text-yellow-400";case"debug":return"text-gray-500";default:return"text-gray-300"}}(e.level)),children:e.text})]},t)),(0,r.jsx)("div",{ref:h})]})]})}var d=s(5935),x=s.n(d);function u(e){let{label:t,children:s}=e;return(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:t}),(0,r.jsx)("div",{className:"text-sm text-gray-200",children:s})]})}function m(){let e=(0,l.useParams)(),{org:t}=(0,n.As)(),[s,d]=(0,a.useState)(null),[m,h]=(0,a.useState)(!0),[g,p]=(0,a.useState)(!1),b=(0,a.useCallback)(async()=>{if(t&&(null==e?void 0:e.id))try{let s=await i.uE.getJob(t.id,e.id);d(s)}catch(e){}finally{h(!1)}},[t,null==e?void 0:e.id]);async function f(){if(t&&s){p(!0);try{await i.uE.cancelJob(t.id,s.id),await b()}catch(e){}finally{p(!1)}}}async function j(){if(t&&s){p(!0);try{let e=await i.uE.retryJob(t.id,s.id);window.location.href="/jobs/".concat(e.job_id)}catch(e){}finally{p(!1)}}}if((0,a.useEffect)(()=>{b()},[b]),(0,a.useEffect)(()=>{if(!s||"running"!==s.status)return;let e=setInterval(()=>{b()},5e3);return()=>clearInterval(e)},[s,b]),m)return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"h-6 w-48 animate-pulse rounded bg-surface-800"}),(0,r.jsx)("div",{className:"h-48 animate-pulse rounded-xl border border-white/[0.06] bg-surface-900"}),(0,r.jsx)("div",{className:"h-72 animate-pulse rounded-xl border border-white/[0.06] bg-surface-900"})]});if(!s)return(0,r.jsxs)("div",{className:"py-20 text-center",children:[(0,r.jsx)("svg",{className:"mx-auto h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20 13V6a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v7m16 0v5a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-5m16 0h-2.586a1 1 0 0 0-.707.293l-2.414 2.414a1 1 0 0 1-.707.293h-3.172a1 1 0 0 1-.707-.293l-2.414-2.414A1 1 0 0 0 6.586 13H4"})}),(0,r.jsx)("h2",{className:"mt-3 text-base font-medium text-gray-300",children:"Job not found"}),(0,r.jsx)(x(),{href:"/jobs",className:"mt-4 inline-flex text-sm text-primary-400 hover:text-primary-300",children:"← Back to jobs"})]});let v="running"===s.status,y=v&&t?i.uE.getJobLogStreamUrl(t.id,s.id):void 0;return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsxs)("nav",{className:"flex items-center gap-1.5 text-sm",children:[(0,r.jsx)(x(),{href:"/jobs",className:"text-gray-400 transition-colors hover:text-gray-200",children:"Jobs"}),(0,r.jsx)("svg",{className:"h-3 w-3 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})}),(0,r.jsx)("span",{className:"font-mono text-sm text-white",children:s.id.slice(0,8)})]}),(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-3",children:[(0,r.jsxs)("h1",{className:"text-xl font-semibold text-white",children:["Job ",s.id.slice(0,8)]}),(0,r.jsx)(c.P,{status:s.status,size:"md"})]})]}),(0,r.jsx)("div",{className:"flex gap-2",children:"running"===s.status||"queued"===s.status?(0,r.jsx)("button",{onClick:()=>void f(),disabled:g,className:"rounded-lg border border-red-500/20 bg-red-500/5 px-3.5 py-1.5 text-sm font-medium text-red-400 transition-colors hover:bg-red-500/10 disabled:opacity-50",children:"Cancel"}):"failed"===s.status||"canceled"===s.status?(0,r.jsx)("button",{onClick:()=>void j(),disabled:g,className:"rounded-lg bg-primary-500 px-3.5 py-1.5 text-sm font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50",children:"Retry"}):null})]}),(0,r.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-x-8 gap-y-5 md:grid-cols-4",children:[(0,r.jsx)(u,{label:"Status",children:(0,r.jsx)(c.P,{status:s.status})}),(0,r.jsx)(u,{label:"Repository",children:(0,r.jsxs)(x(),{href:"/repos/".concat(s.repo_id),className:"text-primary-400 hover:underline",children:[s.repo_id.slice(0,12),"..."]})}),(0,r.jsx)(u,{label:"Trigger",children:(0,r.jsx)("span",{className:"capitalize",children:s.trigger.replace(/_/g," ")})}),s.github_pr_number?(0,r.jsx)(u,{label:"PR Number",children:(0,r.jsxs)("span",{className:"text-primary-400",children:["#",s.github_pr_number]})}):(0,r.jsx)(u,{label:"PR Number",children:(0,r.jsx)("span",{className:"text-gray-600",children:"—"})}),(0,r.jsx)(u,{label:"Queued At",children:new Date(s.queued_at).toLocaleString()}),s.started_at&&(0,r.jsx)(u,{label:"Started At",children:new Date(s.started_at).toLocaleString()}),s.duration_ms?(0,r.jsx)(u,{label:"Duration",children:function(e){let t=Math.floor(e/1e3);if(t<60)return"".concat(t,"s");let s=Math.floor(t/60);return"".concat(s,"m ").concat(t%60,"s")}(s.duration_ms)}):v?(0,r.jsx)(u,{label:"Duration",children:(0,r.jsx)("span",{className:"text-blue-400",children:"In progress..."})}):null,s.worker_container_id&&(0,r.jsx)(u,{label:"Container",children:(0,r.jsx)("span",{className:"font-mono text-xs",children:s.worker_container_id.slice(0,12)})})]})}),s.result_summary&&(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:"Result Summary"}),(0,r.jsx)("p",{className:"mt-2 text-sm leading-relaxed text-gray-300",children:s.result_summary})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"mb-3 text-base font-semibold text-white",children:"Logs"}),(0,r.jsx)(o,{streamUrl:y,live:v,maxHeight:500})]}),s.artifacts_path&&(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,r.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-500",children:"Artifacts"}),(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-2.5",children:[(0,r.jsx)("svg",{className:"h-4 w-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),(0,r.jsx)("span",{className:"text-sm text-gray-400",children:s.artifacts_path})]})]})]})}},4736:(e,t,s)=>{"use strict";var r=s(1504);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},6971:(e,t,s)=>{"use strict";s.d(t,{P:()=>l});var r=s(8111);let a={queued:{label:"Queued",bg:"bg-yellow-500/10",text:"text-yellow-400",dot:"bg-yellow-400"},running:{label:"Running",bg:"bg-blue-500/10",text:"text-blue-400",dot:"bg-blue-400 animate-pulse"},completed:{label:"Completed",bg:"bg-emerald-500/10",text:"text-emerald-400",dot:"bg-emerald-400"},failed:{label:"Failed",bg:"bg-red-500/10",text:"text-red-400",dot:"bg-red-400"},canceled:{label:"Canceled",bg:"bg-gray-500/10",text:"text-gray-400",dot:"bg-gray-400"}};function l(e){let{status:t,size:s="sm"}=e,l=a[t];return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full ".concat(l.bg," ").concat(l.text," ").concat("sm"===s?"px-2 py-0.5 text-xs":"px-2.5 py-1 text-sm"),children:[(0,r.jsx)("span",{className:"inline-block h-1.5 w-1.5 rounded-full ".concat(l.dot)}),l.label]})}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=334)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9305],{422:(e,t,r)=>{"use strict";r.d(t,{J:()=>o,h:()=>n});var s=r(7811);function n(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function o(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},1270:(e,t,r)=>{Promise.resolve().then(r.bind(r,8535))},3446:(e,t,r)=>{"use strict";r.d(t,{Kv:()=>c,HI:()=>u,Xk:()=>d,yC:()=>h});var s=r(8111),n=r(5271),o=r(422),a=r(7811);class l{async request(e,t){let r="".concat(this.baseUrl).concat(e);if(this.repo){let e=r.includes("?")?"&":"?";r="".concat(r).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let s=a.env.NEXT_PUBLIC_ULPI_API_SECRET,n=await fetch(r,{...t,headers:{"Content-Type":"application/json",...s?{"X-Ulpi-Secret":s}:{},...null==t?void 0:t.headers}});if(!n.ok)throw Error((await n.json().catch(()=>({error:n.statusText}))).error||"API error: ".concat(n.status));return n.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,o.h)()}}let i=(0,n.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,r=(0,n.useMemo)(()=>{let e=(0,o.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new l:null}},[]);return(0,s.jsx)(i,{value:r,children:t})}function d(){return(0,n.useContext)(i).mode}function h(){let{localClient:e}=(0,n.useContext)(i);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function u(){return(0,n.useContext)(i)}},4736:(e,t,r)=>{"use strict";var s=r(1504);r.o(s,"useParams")&&r.d(t,{useParams:function(){return s.useParams}}),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}})},8535:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>V});var s=r(8111),n=r(8934),o=r(3446),a=r(5271),l=r(422);let i=(0,a.createContext)({repos:[],selected:null,loading:!0,select:()=>{},refresh:async()=>{}}),c="ulpi_selected_repo";function d(){let e=new URLSearchParams(window.location.search).get("repo");if(e)return e;try{return localStorage.getItem(c)}catch(e){return null}}function h(e){try{localStorage.setItem(c,e)}catch(e){}let t=new URL(window.location.href);t.searchParams.set("repo",e),window.history.replaceState(window.history.state,"",t.toString())}function u(e){var t;let{children:r}=e,{localClient:n}=(0,o.HI)(),[c,u]=(0,a.useState)([]),[x,m]=(0,a.useState)(()=>d()),[p,f]=(0,a.useState)(!0),v=(0,a.useCallback)(async()=>{if(!n||!(0,l.J)())return void f(!1);try{var e,t,r;let s=n.repo;n.repo=null;let o=await n.get("/api/repos");n.repo=s;let a=null!=(e=o.repos)?e:[];if(u(a),x)if(a.find(e=>e.id===x))n.repo=x;else{let e=null!=(r=a.find(e=>e.isDefault))?r:a[0];e&&(m(e.id),n.repo=e.id,h(e.id))}else{let e=d(),r=e?a.find(t=>t.id===e):null,s=null!=(t=null!=r?r:a.find(e=>e.isDefault))?t:a[0];s&&(m(s.id),n.repo=s.id,h(s.id))}}catch(e){}finally{f(!1)}},[n,x]);(0,a.useEffect)(()=>{v()},[v]);let j=(0,a.useCallback)(e=>{m(e),n&&(n.repo=e),h(e)},[n]),g=null!=(t=c.find(e=>e.id===x))?t:null;return(0,s.jsx)(i,{value:{repos:c,selected:g,loading:p,select:j,refresh:v},children:r})}function x(){return(0,a.useContext)(i)}var m=r(2928),p=r(5935),f=r.n(p),v=r(4736);function j(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 9V5.25A2.25 2.25 0 0 0 13.5 3h-6a2.25 2.25 0 0 0-2.25 2.25v13.5A2.25 2.25 0 0 0 7.5 21h6a2.25 2.25 0 0 0 2.25-2.25V15m3 0 3-3m0 0-3-3m3 3H9"})})}function g(){return(0,s.jsx)("svg",{className:"h-3 w-3 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})}function k(){return(0,s.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25h16.5"})})}function w(){return(0,s.jsx)("svg",{className:"h-5 w-5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})}function b(){return(0,s.jsx)("span",{className:"ml-auto rounded-full bg-primary-500/15 px-1.5 py-0.5 text-[9px] font-medium text-primary-400",children:"Cloud"})}let y=[{label:"Overview",items:[{label:"Dashboard",href:"/dashboard",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"})})},{}),shortcut:"D"}]},{label:"Execution",items:[{label:"PRD",href:"/prd",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})})},{}),shortcut:"Q"},{label:"Loop",href:"/loop",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"})})},{}),shortcut:"L"},{label:"Parallel",href:"/parallel",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5-6L16.5 15m0 0L12 10.5m4.5 4.5V1.5"})})},{}),shortcut:"A"},{label:"Jobs",href:"/jobs",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})})},{}),shortcut:"J",cloudOnly:!0},{label:"Sprints",href:"/sprints",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})},{}),shortcut:"X",cloudOnly:!0}]},{label:"Governance",items:[{label:"Rules",href:"/rules",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})})},{}),shortcut:"R"},{label:"Templates",href:"/templates",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})})},{}),shortcut:"T"},{label:"Skills",href:"/skills",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456Z"})})},{}),shortcut:"K"}]},{label:"Intelligence",items:[{label:"CodeMap",href:"/codemap",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})})},{}),shortcut:"C"},{label:"Memory",href:"/memory",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Z"})})},{}),shortcut:"M"},{label:"MCP Tools",href:"/mcps",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})},{}),shortcut:"I"}]},{label:"Monitoring",items:[{label:"Sessions",href:"/sessions",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})})},{}),shortcut:"E"},{label:"History",href:"/history",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})},{}),shortcut:"H"}]},{label:"Review",items:[{label:"Review Queue",href:"/review",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15a2.25 2.25 0 0 1 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})})},{}),shortcut:"V"}]},{label:"Repos",items:[{label:"Repos",href:"/repos",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})})},{}),shortcut:"P"}]},{label:"Settings",items:[{label:"Settings",href:"/settings",icon:(0,s.jsx)(function(){return(0,s.jsxs)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]})},{}),shortcut:"S"},{label:"Notifications",href:"/notifications",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"})})},{}),shortcut:"N"},{label:"Billing",href:"/billing",icon:(0,s.jsx)(function(){return(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"})})},{}),shortcut:"B",cloudOnly:!0}]}],N=["bg-primary-500","bg-blue-500","bg-emerald-500","bg-orange-500","bg-pink-500","bg-cyan-500"];function L(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);return N[Math.abs(t)%N.length]}function C(){var e;let t=(0,v.usePathname)(),{org:r,orgs:o,switchOrg:i,user:c,logout:d}=(0,n.As)(),{repos:h,selected:u,select:m}=x(),[p,N]=(0,a.useState)(!1),[C,M]=(0,a.useState)(!1),[A,B]=(0,a.useState)(!1),[H,V]=(0,a.useState)(!1),[P,W]=(0,a.useState)(!1),S=(0,l.J)(),Z=(0,s.jsxs)("div",{className:"flex h-full flex-col",children:[(0,s.jsxs)("div",{className:"relative border-b border-white/[0.06] px-3 py-3",children:[S&&!p&&(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("button",{onClick:()=>V(!H),className:"flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 transition-colors hover:bg-white/[0.04]",children:[(0,s.jsx)("div",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded bg-primary-500",children:(0,s.jsx)("span",{className:"text-[10px] font-bold text-white",children:u?u.name.charAt(0).toUpperCase():"U"})}),(0,s.jsx)("span",{className:"flex-1 truncate text-left text-sm font-medium text-gray-200",children:null!=(e=null==u?void 0:u.name)?e:"No repo"}),(0,s.jsx)("span",{className:"rounded-full bg-primary-500/20 px-1.5 py-0.5 text-[9px] font-medium text-primary-400",children:"Local"}),h.length>1&&(0,s.jsx)(g,{})]})}),S&&H&&!p&&h.length>1&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-10",onClick:()=>V(!1)}),(0,s.jsx)("div",{className:"absolute left-3 right-3 top-full z-20 mt-1 rounded-lg border border-white/[0.08] bg-surface-850 py-1 shadow-xl",children:h.map(e=>(0,s.jsxs)("button",{onClick:()=>{m(e.id),V(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm transition-colors hover:bg-white/[0.04] ".concat(e.id===(null==u?void 0:u.id)?"text-white":"text-gray-400"),children:[(0,s.jsx)("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded ".concat(L(e.name)),children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white",children:e.name.charAt(0).toUpperCase()})}),(0,s.jsx)("span",{className:"flex-1 truncate",children:e.name}),(0,s.jsx)("span",{className:"truncate text-[10px] text-gray-600",children:e.path.split("/").pop()}),e.id===(null==u?void 0:u.id)&&(0,s.jsx)("svg",{className:"ml-auto h-3.5 w-3.5 shrink-0 text-primary-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})]},e.id))})]}),r&&!S&&(0,s.jsxs)("button",{onClick:()=>!p&&B(!A),className:"flex w-full items-center gap-2.5 rounded-lg px-2 py-1.5 transition-colors hover:bg-white/[0.04] ".concat(p?"justify-center":""),children:[(0,s.jsx)("div",{className:"flex h-6 w-6 shrink-0 items-center justify-center rounded ".concat(L(r.name)),children:(0,s.jsx)("span",{className:"text-[10px] font-bold text-white",children:r.name.charAt(0).toUpperCase()})}),!p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex-1 truncate text-left text-sm font-medium text-gray-200",children:r.name}),(0,s.jsx)(g,{})]})]}),A&&!p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"fixed inset-0 z-10",onClick:()=>B(!1)}),(0,s.jsxs)("div",{className:"absolute left-3 right-3 top-full z-20 mt-1 rounded-lg border border-white/[0.08] bg-surface-850 py-1 shadow-xl",children:[o.map(e=>(0,s.jsxs)("button",{onClick:()=>{i(e.id),B(!1)},className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm transition-colors hover:bg-white/[0.04] ".concat(e.id===(null==r?void 0:r.id)?"text-white":"text-gray-400"),children:[(0,s.jsx)("div",{className:"flex h-5 w-5 shrink-0 items-center justify-center rounded ".concat(L(e.name)),children:(0,s.jsx)("span",{className:"text-[9px] font-bold text-white",children:e.name.charAt(0).toUpperCase()})}),(0,s.jsx)("span",{className:"truncate",children:e.name}),e.id===(null==r?void 0:r.id)&&(0,s.jsx)("svg",{className:"ml-auto h-3.5 w-3.5 text-primary-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})})]},e.id)),(0,s.jsx)("div",{className:"border-t border-white/[0.06] mt-1 pt-1",children:(0,s.jsxs)("a",{href:"/settings/orgs/new",onClick:()=>B(!1),className:"flex w-full items-center gap-2.5 px-3 py-2 text-left text-sm text-gray-500 transition-colors hover:bg-white/[0.04] hover:text-gray-300",children:[(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),(0,s.jsx)("span",{children:"Create organization"})]})})]})]})]}),(0,s.jsx)("nav",{className:"flex-1 overflow-y-auto px-3 pt-3 pb-2",children:y.map(e=>{let r=e.items.filter(e=>!0);return 0===r.length?null:(0,s.jsxs)("div",{className:"mt-4 first:mt-0",children:[!p&&(0,s.jsx)("p",{className:"mb-1.5 px-2 text-[10px] font-medium uppercase tracking-widest text-gray-600",children:e.label}),(0,s.jsx)("div",{className:"space-y-0.5",children:r.map(e=>{var r,n;let o=S&&e.cloudOnly,a=(r=e.href,!!t&&("/dashboard"===r?"/dashboard"===t:t.startsWith(r)));return o?(0,s.jsxs)("div",{className:"group flex items-center rounded-md text-sm opacity-50 pointer-events-none text-gray-500 ".concat(p?"justify-center px-1 py-2":"gap-2.5 px-2 py-1.5"),children:[(0,s.jsx)("span",{className:"text-gray-600 ".concat(p?"[&>svg]:h-8 [&>svg]:w-8":""),children:e.icon}),!p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex-1",children:e.label}),(0,s.jsx)(b,{})]})]},e.href):(0,s.jsxs)(f(),{href:(n=e.href,S&&(null==u?void 0:u.id)?"".concat(n,"?repo=").concat(u.id):n),onClick:()=>M(!1),className:"group flex items-center rounded-md text-sm transition-colors ".concat(p?"justify-center px-1 py-2":"gap-2.5 px-2 py-1.5"," ").concat(a?p?"bg-white/[0.04] text-white":"border-l-2 border-primary-500 bg-white/[0.04] pl-[6px] text-white":"text-gray-400 hover:bg-white/[0.03] hover:text-gray-200"),children:[(0,s.jsx)("span",{className:"".concat(a?"text-primary-400":"text-gray-500 group-hover:text-gray-400"," ").concat(p?"[&>svg]:h-8 [&>svg]:w-8":""),children:e.icon}),!p&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("span",{className:"flex-1",children:e.label}),e.shortcut&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("kbd",{className:"inline-flex h-4 min-w-[16px] items-center justify-center rounded border border-white/[0.06] bg-surface-800 px-1 text-[9px] font-medium text-gray-600 group-hover:text-gray-500",children:"⌘"}),(0,s.jsx)("kbd",{className:"inline-flex h-4 min-w-[16px] items-center justify-center rounded border border-white/[0.06] bg-surface-800 px-1 text-[9px] font-medium text-gray-600 group-hover:text-gray-500",children:e.shortcut})]})]})]},e.href)})})]},e.label)})}),c&&!p&&(0,s.jsx)("div",{className:"border-t border-white/[0.06] px-3 py-3",onMouseEnter:()=>W(!0),onMouseLeave:()=>W(!1),children:(0,s.jsxs)("div",{className:"flex items-center gap-2.5 rounded-md px-2 py-1.5",children:[c.avatar_url?(0,s.jsx)("img",{src:c.avatar_url,alt:c.name,className:"h-6 w-6 rounded-full"}):(0,s.jsx)("div",{className:"flex h-6 w-6 items-center justify-center rounded-full bg-surface-700 text-[10px] font-medium text-gray-300",children:c.name.charAt(0).toUpperCase()}),(0,s.jsx)("span",{className:"flex-1 truncate text-sm text-gray-300",children:c.name}),P&&(0,s.jsx)("button",{onClick:()=>void d(),className:"rounded p-1 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",title:"Sign out",children:(0,s.jsx)(j,{})})]})}),(0,s.jsx)("div",{className:"hidden border-t border-white/[0.06] px-3 py-2 lg:block",children:(0,s.jsx)("button",{onClick:()=>N(!p),className:"flex w-full items-center justify-center rounded-md py-1 text-gray-600 transition-colors hover:bg-white/[0.03] hover:text-gray-400",children:(0,s.jsx)("svg",{className:"h-3.5 w-3.5 transition-transform ".concat(p?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})})})]});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("button",{onClick:()=>M(!0),className:"fixed left-4 top-4 z-40 rounded-lg bg-surface-800 p-2 text-gray-400 shadow-lg lg:hidden",children:(0,s.jsx)(k,{})}),C&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/60 backdrop-blur-sm lg:hidden",onClick:()=>M(!1)}),(0,s.jsxs)("aside",{className:"fixed inset-y-0 left-0 z-50 w-60 border-r border-white/[0.06] bg-surface-900 transition-transform lg:hidden ".concat(C?"translate-x-0":"-translate-x-full"),children:[(0,s.jsx)("button",{onClick:()=>M(!1),className:"absolute right-3 top-3 rounded p-1 text-gray-500 hover:text-white",children:(0,s.jsx)(w,{})}),Z]}),(0,s.jsx)("aside",{className:"hidden shrink-0 border-r border-white/[0.06] bg-surface-900 lg:block ".concat(p?"w-12":"w-60"," transition-all duration-200"),children:Z})]})}function M(){return(0,s.jsx)("svg",{className:"h-4 w-4 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})})}function A(e){let{onClose:t}=e,r=(0,v.useRouter)(),n=(0,v.usePathname)(),[o,i]=(0,a.useState)(""),[c,d]=(0,a.useState)(0),h=(0,a.useRef)(null),u=(0,l.J)(),{selected:m}=x(),p=[{id:"dashboard",label:"Dashboard",category:"Pages",href:"/dashboard",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 6A2.25 2.25 0 0 1 6 3.75h2.25A2.25 2.25 0 0 1 10.5 6v2.25a2.25 2.25 0 0 1-2.25 2.25H6a2.25 2.25 0 0 1-2.25-2.25V6ZM3.75 15.75A2.25 2.25 0 0 1 6 13.5h2.25a2.25 2.25 0 0 1 2.25 2.25V18a2.25 2.25 0 0 1-2.25 2.25H6A2.25 2.25 0 0 1 3.75 18v-2.25ZM13.5 6a2.25 2.25 0 0 1 2.25-2.25H18A2.25 2.25 0 0 1 20.25 6v2.25A2.25 2.25 0 0 1 18 10.5h-2.25a2.25 2.25 0 0 1-2.25-2.25V6ZM13.5 15.75a2.25 2.25 0 0 1 2.25-2.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-2.25a2.25 2.25 0 0 1-2.25-2.25v-2.25Z"})}),shortcut:"D"},{id:"prd",label:"PRD",category:"Pages",href:"/prd",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m3.75 9v6m3-3H9m1.5-12H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),shortcut:"Q"},{id:"loop",label:"Loop",category:"Pages",href:"/loop",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182M21.015 4.356v4.992"})}),shortcut:"L"},{id:"parallel",label:"Parallel",category:"Pages",href:"/parallel",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 7.5L7.5 3m0 0L12 7.5M7.5 3v13.5m13.5-6L16.5 15m0 0L12 10.5m4.5 4.5V1.5"})}),shortcut:"A"},{id:"jobs",label:"Jobs",category:"Pages",href:"/jobs",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})}),shortcut:"J"},{id:"sprints",label:"Sprints",category:"Pages",href:"/sprints",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 12h16.5m-16.5 3.75h16.5M3.75 19.5h16.5M5.625 4.5h12.75a1.875 1.875 0 0 1 0 3.75H5.625a1.875 1.875 0 0 1 0-3.75Z"})})},{id:"rules",label:"Rules",category:"Pages",href:"/rules",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})}),shortcut:"R"},{id:"templates",label:"Templates",category:"Pages",href:"/templates",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})}),shortcut:"T"},{id:"skills",label:"Skills",category:"Pages",href:"/skills",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 13.5l10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})}),shortcut:"K"},{id:"codemap",label:"CodeMap",category:"Pages",href:"/codemap",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 6.75V15m6-6v8.25m.503 3.498 4.875-2.437c.381-.19.622-.58.622-1.006V4.82c0-.836-.88-1.38-1.628-.1l-3.869 1.934c-.317.159-.69.159-1.006 0L9.503 3.252a1.125 1.125 0 0 0-1.006 0L3.622 5.689C3.24 5.88 3 6.27 3 6.695V19.18c0 .836.88 1.38 1.628.1l3.869-1.934c.317-.159.69-.159 1.006 0l4.994 2.497c.317.158.69.158 1.006 0Z"})}),shortcut:"C"},{id:"memory",label:"Memory",category:"Pages",href:"/memory",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Z"})}),shortcut:"M"},{id:"mcps",label:"MCP Tools",category:"Pages",href:"/mcps",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})}),shortcut:"I"},{id:"secrets",label:"Secrets",category:"Pages",href:"/mcps/secrets",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})})},{id:"sessions",label:"Sessions",category:"Pages",href:"/sessions",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 7.5l3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})}),shortcut:"E"},{id:"history",label:"History",category:"Pages",href:"/history",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),shortcut:"H"},{id:"review",label:"Review Queue",category:"Pages",href:"/review",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15a2.25 2.25 0 0 1 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})}),shortcut:"V"},{id:"repos",label:"Repos",category:"Pages",href:"/repos",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})}),shortcut:"P"},{id:"settings",label:"Settings",category:"Pages",href:"/settings",icon:(0,s.jsxs)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:[(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),shortcut:"S"},{id:"notifications",label:"Notifications",category:"Pages",href:"/notifications",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.857 17.082a23.848 23.848 0 0 0 5.454-1.31A8.967 8.967 0 0 1 18 9.75V9A6 6 0 0 0 6 9v.75a8.967 8.967 0 0 1-2.312 6.022c1.733.64 3.56 1.085 5.455 1.31m5.714 0a24.255 24.255 0 0 1-5.714 0m5.714 0a3 3 0 1 1-5.714 0"})}),shortcut:"N"},{id:"billing",label:"Billing",category:"Pages",href:"/billing",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 8.25h19.5M2.25 9h19.5m-16.5 5.25h6m-6 2.25h3m-3.75 3h15a2.25 2.25 0 0 0 2.25-2.25V6.75A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25v10.5A2.25 2.25 0 0 0 4.5 19.5Z"})}),shortcut:"B"},{id:"docs",label:"View Documentation",category:"Actions",href:"/docs",icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"})})},{id:"github",label:"Visit GitHub",category:"Actions",action:()=>window.open("https://github.com/ulpi-dev/ulpi","_blank"),icon:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 0c-6.626 0-12 5.373-12 12 0 5.302 3.438 9.8 8.207 11.387.599.111.793-.261.793-.577v-2.234c-3.338.726-4.033-1.416-4.033-1.416-.546-1.387-1.333-1.756-1.333-1.756-1.089-.745.083-.729.083-.729 1.205.084 1.839 1.237 1.839 1.237 1.07 1.834 2.807 1.304 3.492.997.107-.775.418-1.305.762-1.604-2.665-.305-5.467-1.334-5.467-5.931 0-1.311.469-2.381 1.236-3.221-.124-.303-.535-1.524.117-3.176 0 0 1.008-.322 3.301 1.23.957-.266 1.983-.399 3.003-.404 1.02.005 2.047.138 3.006.404 2.291-1.552 3.297-1.23 3.297-1.23.653 1.653.242 2.874.118 3.176.77.84 1.235 1.911 1.235 3.221 0 4.609-2.807 5.624-5.479 5.921.43.372.823 1.102.823 2.222v3.293c0 .319.192.694.801.576 4.765-1.589 8.199-6.086 8.199-11.386 0-6.627-5.373-12-12-12z"})})}],f=new Set(["billing","jobs","sprints"]),j=u?p.filter(e=>!f.has(e.id)):p,g=o.trim()?j.filter(e=>e.label.toLowerCase().includes(o.toLowerCase())):j,k=[],w=new Set;for(let e of g)w.has(e.category)||(w.add(e.category),k.push({category:e.category,items:g.filter(t=>t.category===e.category)}));let b=(0,a.useCallback)(e=>{if(t(),e.action)e.action();else{var s;e.href&&r.push((s=e.href,u&&(null==m?void 0:m.id)?"".concat(s,"?repo=").concat(m.id):s))}},[t,r]);(0,a.useEffect)(()=>{function e(e){if("Escape"===e.key)return void t();if("ArrowDown"===e.key&&(e.preventDefault(),d(e=>(e+1)%g.length)),"ArrowUp"===e.key&&(e.preventDefault(),d(e=>(e-1+g.length)%g.length)),"Enter"===e.key){e.preventDefault();let t=g[c];t&&b(t)}}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[g,c,b,t]),(0,a.useEffect)(()=>{var e;null==(e=h.current)||e.focus()},[]),(0,a.useEffect)(()=>{d(0)},[o]);let y=-1;return(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-start justify-center pt-[20vh]",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:t}),(0,s.jsxs)("div",{className:"relative z-10 w-full max-w-lg animate-in rounded-xl border border-white/[0.08] bg-surface-900/95 shadow-2xl backdrop-blur-xl",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3 border-b border-white/[0.06] px-4 py-3",children:[(0,s.jsx)(M,{}),(0,s.jsx)("input",{ref:h,type:"text",placeholder:"Search pages and actions...",value:o,onChange:e=>i(e.target.value),className:"flex-1 bg-transparent text-sm text-gray-200 placeholder-gray-500 outline-none"}),(0,s.jsx)("kbd",{className:"rounded border border-white/[0.08] bg-surface-800 px-1.5 py-0.5 text-[10px] text-gray-500",children:"ESC"})]}),(0,s.jsxs)("div",{className:"max-h-72 overflow-y-auto py-2",children:[0===g.length&&(0,s.jsx)("div",{className:"px-4 py-8 text-center text-sm text-gray-500",children:"No results found."}),k.map(e=>(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"px-4 pb-1 pt-2 text-[10px] font-medium uppercase tracking-widest text-gray-600",children:e.category}),e.items.map(e=>{let t=++y,r=n===e.href;return(0,s.jsxs)("button",{onClick:()=>b(e),onMouseEnter:()=>d(t),className:"flex w-full items-center gap-3 px-4 py-2 text-left text-sm transition-colors ".concat(t===c?"bg-white/[0.06] text-white":"text-gray-400 hover:bg-white/[0.03]"),children:[(0,s.jsx)("span",{className:t===c?"text-primary-400":"text-gray-500",children:e.icon}),(0,s.jsx)("span",{className:"flex-1",children:e.label}),r&&(0,s.jsx)("span",{className:"text-[10px] text-gray-600",children:"Current"}),e.shortcut&&(0,s.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,s.jsx)("kbd",{className:"inline-flex h-4 min-w-[16px] items-center justify-center rounded border border-white/[0.06] bg-surface-800 px-1 text-[9px] font-medium text-gray-600",children:"⌘"}),(0,s.jsx)("kbd",{className:"inline-flex h-4 min-w-[16px] items-center justify-center rounded border border-white/[0.06] bg-surface-800 px-1 text-[9px] font-medium text-gray-600",children:e.shortcut})]})]},e.id)})]},e.category))]})]})]})}function B(e){let{onCreated:t}=e,{session:r}=(0,n.As)(),[o,l]=(0,a.useState)(""),[i,c]=(0,a.useState)(""),[d,h]=(0,a.useState)(!1),[u,x]=(0,a.useState)(null);async function p(){if(o.trim()&&i.trim()){h(!0),x(null);try{await m.uE.createOrg({name:o.trim(),slug:i.trim()}),t()}catch(t){var e,r;x(t&&"object"==typeof t&&"body"in t?String(null!=(r=null==(e=t.body)?void 0:e.error)?r:"Failed to create organization"):"Failed to create organization"),h(!1)}}}return(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-surface-950 px-6",children:(0,s.jsx)("div",{className:"w-full max-w-md",children:(0,s.jsxs)("div",{className:"rounded-2xl border border-white/[0.06] bg-surface-900 p-8",children:[(0,s.jsx)("div",{className:"flex justify-center",children:(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-xl bg-primary-500",children:(0,s.jsx)("span",{className:"text-base font-bold text-white",children:"U"})})}),(0,s.jsx)("h1",{className:"mt-5 text-center text-xl font-bold text-white",children:"Create your organization"}),(0,s.jsxs)("p",{className:"mt-2 text-center text-sm text-gray-400",children:["Welcome",(null==r?void 0:r.name)?", ".concat(r.name):"","! Create an organization to get started with ULPI Cloud CI."]}),(0,s.jsxs)("div",{className:"mt-6 space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Organization name"}),(0,s.jsx)("input",{type:"text",value:o,onChange:e=>{var t;l(t=e.target.value),c(t.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,""))},placeholder:"My Team",className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Slug"}),(0,s.jsx)("input",{type:"text",value:i,onChange:e=>c(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),placeholder:"my-team",className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),(0,s.jsx)("p",{className:"mt-1 text-[11px] text-gray-600",children:"Lowercase letters, numbers, and hyphens only."})]}),u&&(0,s.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:u}),(0,s.jsx)("button",{onClick:()=>void p(),disabled:d||!o.trim()||!i.trim(),className:"w-full rounded-lg bg-primary-500 px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:d?"Creating...":"Create Organization"})]})]})})})}function H(e){let{children:t}=e,{session:r,loading:o,org:i,refresh:c}=(0,n.As)(),d=(0,v.useRouter)(),[h,u]=(0,a.useState)(!1),x=(0,l.J)();return((0,a.useEffect)(()=>{!x&&(o||r||d.replace("/login"))},[o,r,d,x]),(0,a.useEffect)(()=>{function e(e){(e.metaKey||e.ctrlKey)&&"k"===e.key&&(e.preventDefault(),u(e=>!e))}return window.addEventListener("keydown",e),()=>window.removeEventListener("keydown",e)},[]),x)?(0,s.jsxs)("div",{className:"flex h-screen bg-surface-950",children:[(0,s.jsx)(C,{}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)("div",{className:"px-4 py-4 lg:px-6",children:t})}),h&&(0,s.jsx)(A,{onClose:()=>u(!1)})]}):o?(0,s.jsx)("div",{className:"flex h-screen items-center justify-center bg-surface-950",children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-4",children:[(0,s.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsx)("p",{className:"text-sm text-gray-400",children:"Loading..."})]})}):r?i?(0,s.jsxs)("div",{className:"flex h-screen bg-surface-950",children:[(0,s.jsx)(C,{}),(0,s.jsx)("main",{className:"flex-1 overflow-y-auto",children:(0,s.jsx)("div",{className:"px-4 py-4 lg:px-6",children:t})}),h&&(0,s.jsx)(A,{onClose:()=>u(!1)})]}):(0,s.jsx)(B,{onCreated:()=>void c()}):null}function V(e){let{children:t}=e;return(0,s.jsx)(n.OJ,{children:(0,s.jsx)(o.Kv,{children:(0,s.jsx)(u,{children:(0,s.jsx)(H,{children:t})})})})}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=1270)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3906],{422:(e,t,a)=>{"use strict";a.d(t,{J:()=>n,h:()=>r});var s=a(7811);function r(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function n(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},509:(e,t,a)=>{Promise.resolve().then(a.bind(a,6191))},1802:(e,t,a)=>{"use strict";a.d(t,{Hg:()=>c,L2:()=>i,PL:()=>d,tO:()=>o});var s=a(5271),r=a(3446),n=a(8934),l=a(2928);function i(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,c]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{l(!0),c(null);try{let t=await e.get("/api/mcps/library");a(Array.isArray(t)?t:[])}catch(e){c(e instanceof Error?e.message:"Failed to fetch MCP library")}finally{l(!1)}},[e]);(0,s.useEffect)(()=>{o()},[o]);let d=(0,s.useCallback)(async t=>{await e.post("/api/mcps/library",t),await o()},[e,o]),u=(0,s.useCallback)(async t=>{await e.delete("/api/mcps/library/".concat(encodeURIComponent(t))),await o()},[e,o]),x=(0,s.useCallback)(async(t,a)=>{await e.put("/api/mcps/library/".concat(encodeURIComponent(t)),a),await o()},[e,o]);return{mcps:t,loading:n,error:i,refresh:o,addMcp:d,removeMcp:u,updateMcp:x}}function c(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,c]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{l(!0),c(null);try{let t=await e.get("/api/mcps/catalog");a(Array.isArray(t)?t:[])}catch(e){c(e instanceof Error?e.message:"Failed to fetch MCP catalog")}finally{l(!1)}},[e]);return(0,s.useEffect)(()=>{o()},[o]),{catalog:t,loading:n,error:i,refresh:o}}function o(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,c]=(0,s.useState)(null),o=(0,s.useCallback)(async()=>{l(!0),c(null);try{let t=await e.get("/api/mcps/activations");a(Array.isArray(t)?t:[])}catch(e){c(e instanceof Error?e.message:"Failed to fetch activations")}finally{l(!1)}},[e]);(0,s.useEffect)(()=>{o()},[o]);let d=(0,s.useCallback)(async(t,a)=>{await e.post("/api/mcps/activations",{name:t,config:a}),await o()},[e,o]),u=(0,s.useCallback)(async t=>{await e.delete("/api/mcps/activations/".concat(encodeURIComponent(t))),await o()},[e,o]),x=(0,s.useCallback)(async(t,a)=>{await e.put("/api/mcps/activations/".concat(encodeURIComponent(t)),{config:a}),await o()},[e,o]);return{activations:t,loading:n,error:i,refresh:o,enableMcp:d,disableMcp:u,updateConfig:x}}function d(){let{org:e}=(0,n.As)(),[t,a]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null);return{installMcp:(0,s.useCallback)(async(t,s,r)=>{if(!e)return null;a(!0),i(null);try{return await l.uE.installMcp(e.id,t,s,r)}catch(e){return i(e instanceof Error?e.message:"Install failed"),null}finally{a(!1)}},[e]),installing:t,error:r}}},3446:(e,t,a)=>{"use strict";a.d(t,{Kv:()=>o,HI:()=>x,Xk:()=>d,yC:()=>u});var s=a(8111),r=a(5271),n=a(422),l=a(7811);class i{async request(e,t){let a="".concat(this.baseUrl).concat(e);if(this.repo){let e=a.includes("?")?"&":"?";a="".concat(a).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let s=l.env.NEXT_PUBLIC_ULPI_API_SECRET,r=await fetch(a,{...t,headers:{"Content-Type":"application/json",...s?{"X-Ulpi-Secret":s}:{},...null==t?void 0:t.headers}});if(!r.ok)throw Error((await r.json().catch(()=>({error:r.statusText}))).error||"API error: ".concat(r.status));return r.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,n.h)()}}let c=(0,r.createContext)({mode:"cloud",localClient:null});function o(e){let{children:t}=e,a=(0,r.useMemo)(()=>{let e=(0,n.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,s.jsx)(c,{value:a,children:t})}function d(){return(0,r.useContext)(c).mode}function u(){let{localClient:e}=(0,r.useContext)(c);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,r.useContext)(c)}},3951:(e,t,a)=>{"use strict";a.d(t,{G:()=>r});var s=a(8111);function r(e){let{rows:t=3,variant:a="skeleton",className:r=""}=e;return"spinner"===a?(0,s.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(r),children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,s.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,s.jsx)("div",{className:"space-y-3 ".concat(r),children:Array.from({length:t}).map((e,t)=>(0,s.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,s.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,s.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},4736:(e,t,a)=>{"use strict";var s=a(1504);a.o(s,"useParams")&&a.d(t,{useParams:function(){return s.useParams}}),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}})},6191:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>m});var s=a(8111),r=a(5271),n=a(4736),l=a(5935),i=a.n(l),c=a(3446),o=a(1802),d=a(3951),u=a(9841);let x={database:"bg-blue-500/10 text-blue-400",api:"bg-emerald-500/10 text-emerald-400",devtools:"bg-orange-500/10 text-orange-400",comms:"bg-pink-500/10 text-pink-400",analytics:"bg-cyan-500/10 text-cyan-400",cloud:"bg-violet-500/10 text-violet-400",ai:"bg-primary-500/10 text-primary-400",search:"bg-yellow-500/10 text-yellow-400",monitoring:"bg-red-500/10 text-red-400","project-management":"bg-indigo-500/10 text-indigo-400",design:"bg-fuchsia-500/10 text-fuchsia-400",custom:"bg-gray-500/10 text-gray-400"};function m(){var e,t,a;let l=(0,n.useParams)(),m=null!=(e=null==l?void 0:l.name)?e:"",p=(0,c.yC)(),{activations:h,enableMcp:g,disableMcp:f,updateConfig:b}=(0,o.tO)(),[y,v]=(0,r.useState)(null),[j,w]=(0,r.useState)(!0),[N,C]=(0,r.useState)(null),[k,S]=(0,r.useState)({}),[E,P]=(0,r.useState)(!1),[_,L]=(0,r.useState)(null),U=h.find(e=>e.name===m),I=null!=(t=null==U?void 0:U.activation.enabled)&&t,A=(0,r.useCallback)(async()=>{w(!0),C(null);try{let e=await p.get("/api/mcps/library/".concat(encodeURIComponent(m)));if(v(e),e.config_schema){let t={};for(let[a,s]of Object.entries(e.config_schema))void 0!==s.default&&(t[a]=s.default);S(t)}}catch(e){C(e instanceof Error?e.message:"Failed to load MCP details")}finally{w(!1)}},[p,m]);async function R(){P(!0),L(null);try{I?(await f(m),L("Disabled for current repo.")):(await g(m,k),L("Enabled for current repo."))}catch(e){L(e instanceof Error?e.message:"Failed to update activation")}finally{P(!1),setTimeout(()=>L(null),3e3)}}async function T(){P(!0),L(null);try{await b(m,k),L("Configuration saved.")}catch(e){L(e instanceof Error?e.message:"Failed to save configuration")}finally{P(!1),setTimeout(()=>L(null),3e3)}}return((0,r.useEffect)(()=>{A()},[A]),(0,r.useEffect)(()=>{(null==U?void 0:U.activation.config)&&S(e=>({...e,...U.activation.config}))},[U]),j)?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i(),{href:"/mcps",className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",children:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})}),(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:decodeURIComponent(m)})]}),(0,s.jsx)(d.G,{rows:3})]}):N||!y?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i(),{href:"/mcps",className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",children:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})}),(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:decodeURIComponent(m)})]}),(0,s.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] p-4",children:(0,s.jsx)("p",{className:"text-sm text-red-400",children:null!=N?N:"MCP not found"})})]}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(i(),{href:"/mcps",className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",title:"Back to library",children:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:y.display_name||y.name}),(0,s.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ".concat(null!=(a=x[y.category])?a:x.custom),children:y.category})]}),y.display_name&&y.display_name!==y.name&&(0,s.jsx)("p",{className:"mt-0.5 font-mono text-xs text-gray-500",children:y.name})]})]}),_&&(0,s.jsx)("div",{className:"rounded-lg border border-blue-500/20 bg-blue-500/[0.06] px-3 py-2 text-xs text-blue-400",children:_}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,s.jsx)("h3",{className:"mb-4 text-sm font-semibold text-white",children:"Details"}),(0,s.jsxs)("div",{className:"space-y-3",children:[y.description&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Description"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-300",children:y.description})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Command"}),(0,s.jsx)("p",{className:"mt-1 font-mono text-sm text-gray-300",children:y.command})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Transport"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-300",children:y.transport})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Source"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-300",children:y.source})]})]}),y.args.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Arguments"}),(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:y.args.map((e,t)=>(0,s.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 font-mono text-xs text-gray-400",children:e},t))})]}),y.tags.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Tags"}),(0,s.jsx)("div",{className:"mt-1 flex flex-wrap gap-1.5",children:y.tags.map(e=>(0,s.jsx)("span",{className:"rounded bg-surface-800 px-2 py-0.5 text-xs text-gray-500",children:e},e))})]}),y.added_at&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Added"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:new Date(y.added_at).toLocaleString()})]})]})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Repo Activation"}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-gray-500",children:"Enable this MCP server for the current repository."})]}),(0,s.jsx)("button",{onClick:()=>void R(),disabled:E,className:"relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ".concat(I?"bg-primary-500":"bg-surface-700"," ").concat(E?"cursor-not-allowed opacity-50":""),children:(0,s.jsx)("span",{className:"pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition-transform ".concat(I?"translate-x-5":"translate-x-0")})})]}),(0,s.jsxs)("div",{className:"mt-2 flex items-center gap-2",children:[(0,s.jsx)("span",{className:"h-2 w-2 rounded-full ".concat(I?"bg-emerald-400":"bg-gray-600")}),(0,s.jsx)("span",{className:"text-xs ".concat(I?"text-emerald-400":"text-gray-500"),children:I?"Enabled":"Disabled"})]})]}),y.config_schema&&Object.keys(y.config_schema).length>0&&(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,s.jsx)("h3",{className:"mb-4 text-sm font-semibold text-white",children:"Configuration"}),(0,s.jsx)(u.x,{schema:y.config_schema,values:k,onChange:(e,t)=>{S(a=>({...a,[e]:t}))},disabled:!I}),I&&(0,s.jsx)("div",{className:"mt-4 pt-4 border-t border-white/[0.04]",children:(0,s.jsx)("button",{onClick:()=>void T(),disabled:E,className:"rounded-lg bg-primary-500 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:E?"Saving...":"Save Configuration"})})]})]})}},9841:(e,t,a)=>{"use strict";a.d(t,{x:()=>r});var s=a(8111);function r(e){let{schema:t,values:a,onChange:r,disabled:n}=e,l=Object.entries(t);return 0===l.length?(0,s.jsx)("p",{className:"text-xs text-gray-500 italic",children:"No configuration fields defined."}):(0,s.jsx)("div",{className:"space-y-3",children:l.map(e=>{let[t,l]=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"mb-1 flex items-center gap-2 text-xs font-medium text-gray-400",children:[(0,s.jsx)("span",{children:t}),l.required&&(0,s.jsx)("span",{className:"text-red-400",children:"*"}),"env-ref"===l.format&&(0,s.jsx)("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium text-amber-400",children:"ENV"}),l.sensitive&&(0,s.jsx)("span",{className:"rounded bg-red-500/10 px-1.5 py-0.5 text-[9px] font-medium text-red-400",children:"SECRET"})]}),l.description&&(0,s.jsx)("p",{className:"mb-1.5 text-[11px] text-gray-600",children:l.description}),"boolean"===l.type?(0,s.jsx)("button",{onClick:()=>{n||r(t,!a[t])},disabled:n,className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ".concat(a[t]?"bg-primary-500":"bg-surface-700"," ").concat(n?"cursor-not-allowed opacity-50":""),children:(0,s.jsx)("span",{className:"pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition-transform ".concat(a[t]?"translate-x-4":"translate-x-0")})}):"number"===l.type?(0,s.jsx)("input",{type:"number",value:void 0!==a[t]?String(a[t]):void 0!==l.default?String(l.default):"",onChange:e=>r(t,e.target.value?Number(e.target.value):0),disabled:n,placeholder:void 0!==l.default?String(l.default):"",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50 disabled:cursor-not-allowed disabled:opacity-50"}):(0,s.jsx)("input",{type:l.sensitive?"password":"text",value:void 0!==a[t]?String(a[t]):"",onChange:e=>r(t,e.target.value),disabled:n,placeholder:"env-ref"===l.format?"e.g. $DATABASE_URL":void 0!==l.default?String(l.default):"",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50 disabled:cursor-not-allowed disabled:opacity-50"})]},t)})})}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=509)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6982],{422:(e,t,a)=>{"use strict";a.d(t,{J:()=>n,h:()=>r});var s=a(7811);function r(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function n(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},1131:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>f});var s=a(8111),r=a(5271),n=a(5935),l=a.n(n),i=a(1802),o=a(8934),c=a(2928),d=a(3951),u=a(9841);let m={database:"bg-blue-500/10 text-blue-400",api:"bg-emerald-500/10 text-emerald-400",devtools:"bg-orange-500/10 text-orange-400",comms:"bg-pink-500/10 text-pink-400",analytics:"bg-cyan-500/10 text-cyan-400",cloud:"bg-violet-500/10 text-violet-400",ai:"bg-primary-500/10 text-primary-400",search:"bg-yellow-500/10 text-yellow-400",monitoring:"bg-red-500/10 text-red-400","project-management":"bg-indigo-500/10 text-indigo-400",design:"bg-fuchsia-500/10 text-fuchsia-400",custom:"bg-gray-500/10 text-gray-400"};function x(e){var t,a,n,l,i,o,c,d,x,p,h,g;let{entry:f,alreadyInstalled:b,onInstall:y,repos:v,isPaidPlan:j=!0}=e,[w,N]=(0,r.useState)(!1),[C,k]=(0,r.useState)(b),[S,_]=(0,r.useState)(!1),[E,L]=(0,r.useState)(()=>f.config_schema?function(e){let t={};for(let[a,s]of Object.entries(e))void 0!==s.default&&(t[a]=s.default);return t}(f.config_schema):{}),[A,I]=(0,r.useState)(new Set),[P,M]=(0,r.useState)(null),U=!!(h=f.config_schema)&&Object.values(h).some(e=>e.required&&void 0===e.default),O=f.config_schema&&Object.keys(f.config_schema).length>0;async function T(e,t){N(!0),M(null);try{await y(f,e,t),k(!0),_(!1)}catch(e){M(e instanceof Error?e.message:"Install failed")}finally{N(!1)}}let B=f.detect_signals,R=(null!=(c=null==B||null==(t=B.dependencies)?void 0:t.length)?c:0)>0||(null!=(d=null==B||null==(a=B.env_vars)?void 0:a.length)?d:0)>0||(null!=(x=null==B||null==(n=B.docker_services)?void 0:n.length)?x:0)>0;return(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-4 transition-colors hover:border-white/[0.1]",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-white",children:f.display_name||f.name}),(0,s.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ".concat(null!=(p=m[f.category])?p:m.custom),children:f.category})]}),f.display_name&&f.display_name!==f.name&&(0,s.jsx)("p",{className:"mt-0.5 font-mono text-[11px] text-gray-600",children:f.name})]}),(0,s.jsx)("div",{className:"shrink-0",children:C?(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium text-emerald-400 bg-emerald-500/10",children:[(0,s.jsx)("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),"Installed"]}):S?null:j?(0,s.jsxs)("button",{onClick:function(){j&&(U||v&&v.length>0?_(!0):T())},disabled:w,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary-500 px-3 py-1.5 text-xs font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:[w?(0,s.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-white border-t-transparent"}):(0,s.jsx)("svg",{className:"h-3 w-3",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})}),"Install"]}):(0,s.jsx)("span",{className:"inline-flex items-center gap-1 rounded-lg px-3 py-1.5 text-xs font-medium text-amber-400 bg-amber-500/10",children:"Upgrade to install"})})]}),f.description&&(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-gray-400",children:f.description}),S&&!C&&(0,s.jsxs)("div",{className:"mt-3 rounded-lg border border-white/[0.06] bg-surface-800/50 p-3 space-y-3",children:[O&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{className:"text-xs font-medium text-gray-300",children:"Configuration"}),(0,s.jsx)(u.x,{schema:f.config_schema,values:E,onChange:(e,t)=>L(a=>({...a,[e]:t})),disabled:w})]}),v&&v.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-1.5 text-xs font-medium text-gray-300",children:"Activate for repos"}),(0,s.jsx)("div",{className:"max-h-32 space-y-1 overflow-y-auto rounded-lg border border-white/[0.06] bg-surface-900 p-2",children:v.map(e=>{var t,a;return(0,s.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 rounded px-2 py-1 text-xs text-gray-400 hover:bg-white/[0.04]",children:[(0,s.jsx)("input",{type:"checkbox",checked:A.has(e.id),onChange:()=>{var t;return t=e.id,void I(e=>{let a=new Set(e);return a.has(t)?a.delete(t):a.add(t),a})},disabled:w,className:"h-3.5 w-3.5 rounded border-white/20 bg-surface-800 text-primary-500 focus:ring-primary-500/30"}),null!=(a=null!=(t=e.full_name)?t:e.name)?a:e.id]},e.id)})})]}),P&&(0,s.jsx)("p",{className:"text-xs text-red-400",children:P}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsxs)("button",{onClick:function(){T(E,v?Array.from(A):void 0)},disabled:w||O&&(g=f.config_schema,!Object.entries(g).every(e=>{let[t,a]=e;if(!a.required)return!0;let s=E[t];return void 0!==s&&""!==s})),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary-500 px-3 py-1.5 text-xs font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:[w&&(0,s.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Install"]}),(0,s.jsx)("button",{onClick:()=>_(!1),disabled:w,className:"rounded-lg px-3 py-1.5 text-xs text-gray-400 transition-colors hover:text-gray-300 disabled:opacity-50",children:"Cancel"})]})]}),P&&!S&&(0,s.jsx)("p",{className:"mt-2 text-xs text-red-400",children:P}),f.tags.length>0&&(0,s.jsx)("div",{className:"mt-2.5 flex flex-wrap gap-1",children:f.tags.map(e=>(0,s.jsx)("span",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-[10px] text-gray-500",children:e},e))}),R&&(0,s.jsxs)("div",{className:"mt-2.5 border-t border-white/[0.04] pt-2.5",children:[(0,s.jsx)("p",{className:"mb-1 text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Auto-detect signals"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-1.5 text-[10px] text-gray-500",children:[null==B||null==(l=B.dependencies)?void 0:l.slice(0,4).map(e=>(0,s.jsx)("span",{className:"rounded bg-blue-500/5 px-1.5 py-0.5 text-blue-400/60",children:e},e)),null==B||null==(i=B.env_vars)?void 0:i.slice(0,2).map(e=>(0,s.jsxs)("span",{className:"rounded bg-amber-500/5 px-1.5 py-0.5 text-amber-400/60",children:["$",e]},e)),null==B||null==(o=B.docker_services)?void 0:o.slice(0,2).map(e=>(0,s.jsx)("span",{className:"rounded bg-cyan-500/5 px-1.5 py-0.5 text-cyan-400/60",children:e},e))]})]})]})}let p={all:"All",database:"Database",api:"API",devtools:"DevTools",comms:"Comms","project-management":"Project Mgmt",design:"Design",analytics:"Analytics",cloud:"Cloud",ai:"AI",search:"Search",monitoring:"Monitoring",custom:"Custom"};function h(e){let{categories:t,selected:a,onChange:r}=e;return(0,s.jsx)("div",{className:"flex items-center gap-1 overflow-x-auto pb-1 scrollbar-none",children:t.map(e=>{var t;let n=e===a;return(0,s.jsx)("button",{onClick:()=>r(e),className:"shrink-0 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ".concat(n?"bg-primary-500/15 text-primary-400":"text-gray-500 hover:bg-white/[0.04] hover:text-gray-300"),children:null!=(t=p[e])?t:e},e)})})}let g=["all","database","devtools","api","comms","project-management","design","monitoring","search","ai","cloud","analytics","custom"];function f(){let{catalog:e,loading:t,error:a}=(0,i.Hg)(),{mcps:n,loading:u,addMcp:m}=(0,i.L2)(),{activations:p,loading:f,enableMcp:b}=(0,i.tO)(),{installMcp:y}=(0,i.PL)(),{org:v}=(0,o.As)(),[j,w]=(0,r.useState)("all"),[N,C]=(0,r.useState)(""),[k,S]=(0,r.useState)([]),[_,E]=(0,r.useState)(!0);(0,r.useEffect)(()=>{v&&c.uE.listRepos(v.id).then(e=>{S(e.map(e=>({id:e.id,full_name:e.full_name,name:e.full_name.split("/").pop()})))}).catch(()=>{})},[v]),(0,r.useEffect)(()=>{v&&"free"===v.plan_tier&&E(!1)},[v]);let L=(0,r.useMemo)(()=>{let e=new Set(p.filter(e=>e.activation.enabled).map(e=>e.name));return new Set([...new Set(n.map(e=>e.name))].filter(t=>e.has(t)))},[n,p]),A=(0,r.useMemo)(()=>{let t=e;if("all"!==j&&(t=t.filter(e=>e.category===j)),N.trim()){let e=N.toLowerCase();t=t.filter(t=>{var a,s,r,n;return t.name.toLowerCase().includes(e)||null!=(r=null==(a=t.display_name)?void 0:a.toLowerCase().includes(e))&&r||null!=(n=null==(s=t.description)?void 0:s.toLowerCase().includes(e))&&n||t.tags.some(t=>t.toLowerCase().includes(e))})}return t},[e,j,N]),I=(0,r.useMemo)(()=>{let t=new Set(e.map(e=>e.category));return g.filter(e=>"all"===e||t.has(e))},[e]),P=(0,r.useCallback)(async(e,t,a)=>{if(v&&void 0!==a){let s={};if(t)for(let[e,a]of Object.entries(t))s[e]=String(a);await y(e.name,a,s);return}await m({name:e.name,display_name:e.display_name,description:e.description,command:e.command,args:e.args,transport:e.transport,category:e.category,config_schema:e.config_schema,tags:e.tags,source:"catalog"}),await b(e.name,t)},[v,y,m,b]);return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("div",{className:"flex items-center justify-between",children:(0,s.jsx)("div",{children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)(l(),{href:"/mcps",className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",title:"Back to library",children:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 19.5 8.25 12l7.5-7.5"})})}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"MCP Catalog"}),(0,s.jsxs)("p",{className:"mt-0.5 text-sm text-gray-500",children:[e.length," available MCP server",1!==e.length?"s":""]})]})]})})}),(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("svg",{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),(0,s.jsx)("input",{type:"text",value:N,onChange:e=>C(e.target.value),placeholder:"Search MCPs by name, description, or tags...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 py-2.5 pl-10 pr-3 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,s.jsx)(h,{categories:I,selected:j,onChange:w})]}),t||u||f?(0,s.jsx)(d.G,{rows:6}):a?(0,s.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] p-4",children:(0,s.jsxs)("p",{className:"text-sm text-red-400",children:["Failed to load catalog: ",a]})}):0===A.length?(0,s.jsxs)("div",{className:"rounded-xl border border-dashed border-white/[0.06] bg-surface-800/30 py-16 text-center",children:[(0,s.jsx)("svg",{className:"mx-auto h-8 w-8 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),(0,s.jsx)("p",{className:"mt-3 text-sm text-gray-400",children:"No MCPs found matching your filters."}),(0,s.jsx)("button",{onClick:()=>{C(""),w("all")},className:"mt-2 text-xs text-primary-400 hover:text-primary-300",children:"Clear filters"})]}):(0,s.jsx)("div",{className:"grid gap-3 sm:grid-cols-2",children:A.map(e=>(0,s.jsx)(x,{entry:e,alreadyInstalled:L.has(e.name),onInstall:P,repos:k,isPaidPlan:_},e.name))})]})}},1802:(e,t,a)=>{"use strict";a.d(t,{Hg:()=>o,L2:()=>i,PL:()=>d,tO:()=>c});var s=a(5271),r=a(3446),n=a(8934),l=a(2928);function i(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),c=(0,s.useCallback)(async()=>{l(!0),o(null);try{let t=await e.get("/api/mcps/library");a(Array.isArray(t)?t:[])}catch(e){o(e instanceof Error?e.message:"Failed to fetch MCP library")}finally{l(!1)}},[e]);(0,s.useEffect)(()=>{c()},[c]);let d=(0,s.useCallback)(async t=>{await e.post("/api/mcps/library",t),await c()},[e,c]),u=(0,s.useCallback)(async t=>{await e.delete("/api/mcps/library/".concat(encodeURIComponent(t))),await c()},[e,c]),m=(0,s.useCallback)(async(t,a)=>{await e.put("/api/mcps/library/".concat(encodeURIComponent(t)),a),await c()},[e,c]);return{mcps:t,loading:n,error:i,refresh:c,addMcp:d,removeMcp:u,updateMcp:m}}function o(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),c=(0,s.useCallback)(async()=>{l(!0),o(null);try{let t=await e.get("/api/mcps/catalog");a(Array.isArray(t)?t:[])}catch(e){o(e instanceof Error?e.message:"Failed to fetch MCP catalog")}finally{l(!1)}},[e]);return(0,s.useEffect)(()=>{c()},[c]),{catalog:t,loading:n,error:i,refresh:c}}function c(){let e=(0,r.yC)(),[t,a]=(0,s.useState)([]),[n,l]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),c=(0,s.useCallback)(async()=>{l(!0),o(null);try{let t=await e.get("/api/mcps/activations");a(Array.isArray(t)?t:[])}catch(e){o(e instanceof Error?e.message:"Failed to fetch activations")}finally{l(!1)}},[e]);(0,s.useEffect)(()=>{c()},[c]);let d=(0,s.useCallback)(async(t,a)=>{await e.post("/api/mcps/activations",{name:t,config:a}),await c()},[e,c]),u=(0,s.useCallback)(async t=>{await e.delete("/api/mcps/activations/".concat(encodeURIComponent(t))),await c()},[e,c]),m=(0,s.useCallback)(async(t,a)=>{await e.put("/api/mcps/activations/".concat(encodeURIComponent(t)),{config:a}),await c()},[e,c]);return{activations:t,loading:n,error:i,refresh:c,enableMcp:d,disableMcp:u,updateConfig:m}}function d(){let{org:e}=(0,n.As)(),[t,a]=(0,s.useState)(!1),[r,i]=(0,s.useState)(null);return{installMcp:(0,s.useCallback)(async(t,s,r)=>{if(!e)return null;a(!0),i(null);try{return await l.uE.installMcp(e.id,t,s,r)}catch(e){return i(e instanceof Error?e.message:"Install failed"),null}finally{a(!1)}},[e]),installing:t,error:r}}},3446:(e,t,a)=>{"use strict";a.d(t,{Kv:()=>c,HI:()=>m,Xk:()=>d,yC:()=>u});var s=a(8111),r=a(5271),n=a(422),l=a(7811);class i{async request(e,t){let a="".concat(this.baseUrl).concat(e);if(this.repo){let e=a.includes("?")?"&":"?";a="".concat(a).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let s=l.env.NEXT_PUBLIC_ULPI_API_SECRET,r=await fetch(a,{...t,headers:{"Content-Type":"application/json",...s?{"X-Ulpi-Secret":s}:{},...null==t?void 0:t.headers}});if(!r.ok)throw Error((await r.json().catch(()=>({error:r.statusText}))).error||"API error: ".concat(r.status));return r.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,n.h)()}}let o=(0,r.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,a=(0,r.useMemo)(()=>{let e=(0,n.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,s.jsx)(o,{value:a,children:t})}function d(){return(0,r.useContext)(o).mode}function u(){let{localClient:e}=(0,r.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function m(){return(0,r.useContext)(o)}},3951:(e,t,a)=>{"use strict";a.d(t,{G:()=>r});var s=a(8111);function r(e){let{rows:t=3,variant:a="skeleton",className:r=""}=e;return"spinner"===a?(0,s.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(r),children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,s.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,s.jsx)("div",{className:"space-y-3 ".concat(r),children:Array.from({length:t}).map((e,t)=>(0,s.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,s.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,s.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},9341:(e,t,a)=>{Promise.resolve().then(a.bind(a,1131))},9841:(e,t,a)=>{"use strict";a.d(t,{x:()=>r});var s=a(8111);function r(e){let{schema:t,values:a,onChange:r,disabled:n}=e,l=Object.entries(t);return 0===l.length?(0,s.jsx)("p",{className:"text-xs text-gray-500 italic",children:"No configuration fields defined."}):(0,s.jsx)("div",{className:"space-y-3",children:l.map(e=>{let[t,l]=e;return(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"mb-1 flex items-center gap-2 text-xs font-medium text-gray-400",children:[(0,s.jsx)("span",{children:t}),l.required&&(0,s.jsx)("span",{className:"text-red-400",children:"*"}),"env-ref"===l.format&&(0,s.jsx)("span",{className:"rounded bg-amber-500/10 px-1.5 py-0.5 text-[9px] font-medium text-amber-400",children:"ENV"}),l.sensitive&&(0,s.jsx)("span",{className:"rounded bg-red-500/10 px-1.5 py-0.5 text-[9px] font-medium text-red-400",children:"SECRET"})]}),l.description&&(0,s.jsx)("p",{className:"mb-1.5 text-[11px] text-gray-600",children:l.description}),"boolean"===l.type?(0,s.jsx)("button",{onClick:()=>{n||r(t,!a[t])},disabled:n,className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ".concat(a[t]?"bg-primary-500":"bg-surface-700"," ").concat(n?"cursor-not-allowed opacity-50":""),children:(0,s.jsx)("span",{className:"pointer-events-none inline-block h-4 w-4 transform rounded-full bg-white shadow ring-0 transition-transform ".concat(a[t]?"translate-x-4":"translate-x-0")})}):"number"===l.type?(0,s.jsx)("input",{type:"number",value:void 0!==a[t]?String(a[t]):void 0!==l.default?String(l.default):"",onChange:e=>r(t,e.target.value?Number(e.target.value):0),disabled:n,placeholder:void 0!==l.default?String(l.default):"",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50 disabled:cursor-not-allowed disabled:opacity-50"}):(0,s.jsx)("input",{type:l.sensitive?"password":"text",value:void 0!==a[t]?String(a[t]):"",onChange:e=>r(t,e.target.value),disabled:n,placeholder:"env-ref"===l.format?"e.g. $DATABASE_URL":void 0!==l.default?String(l.default):"",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50 disabled:cursor-not-allowed disabled:opacity-50"})]},t)})})}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=9341)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8206],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>n,h:()=>a});var r=s(7811);function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function n(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},1802:(e,t,s)=>{"use strict";s.d(t,{Hg:()=>l,L2:()=>i,PL:()=>d,tO:()=>c});var r=s(5271),a=s(3446),n=s(8934),o=s(2928);function i(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[n,o]=(0,r.useState)(!0),[i,l]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{o(!0),l(null);try{let t=await e.get("/api/mcps/library");s(Array.isArray(t)?t:[])}catch(e){l(e instanceof Error?e.message:"Failed to fetch MCP library")}finally{o(!1)}},[e]);(0,r.useEffect)(()=>{c()},[c]);let d=(0,r.useCallback)(async t=>{await e.post("/api/mcps/library",t),await c()},[e,c]),m=(0,r.useCallback)(async t=>{await e.delete("/api/mcps/library/".concat(encodeURIComponent(t))),await c()},[e,c]),x=(0,r.useCallback)(async(t,s)=>{await e.put("/api/mcps/library/".concat(encodeURIComponent(t)),s),await c()},[e,c]);return{mcps:t,loading:n,error:i,refresh:c,addMcp:d,removeMcp:m,updateMcp:x}}function l(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[n,o]=(0,r.useState)(!0),[i,l]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{o(!0),l(null);try{let t=await e.get("/api/mcps/catalog");s(Array.isArray(t)?t:[])}catch(e){l(e instanceof Error?e.message:"Failed to fetch MCP catalog")}finally{o(!1)}},[e]);return(0,r.useEffect)(()=>{c()},[c]),{catalog:t,loading:n,error:i,refresh:c}}function c(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[n,o]=(0,r.useState)(!0),[i,l]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{o(!0),l(null);try{let t=await e.get("/api/mcps/activations");s(Array.isArray(t)?t:[])}catch(e){l(e instanceof Error?e.message:"Failed to fetch activations")}finally{o(!1)}},[e]);(0,r.useEffect)(()=>{c()},[c]);let d=(0,r.useCallback)(async(t,s)=>{await e.post("/api/mcps/activations",{name:t,config:s}),await c()},[e,c]),m=(0,r.useCallback)(async t=>{await e.delete("/api/mcps/activations/".concat(encodeURIComponent(t))),await c()},[e,c]),x=(0,r.useCallback)(async(t,s)=>{await e.put("/api/mcps/activations/".concat(encodeURIComponent(t)),{config:s}),await c()},[e,c]);return{activations:t,loading:n,error:i,refresh:c,enableMcp:d,disableMcp:m,updateConfig:x}}function d(){let{org:e}=(0,n.As)(),[t,s]=(0,r.useState)(!1),[a,i]=(0,r.useState)(null);return{installMcp:(0,r.useCallback)(async(t,r,a)=>{if(!e)return null;s(!0),i(null);try{return await o.uE.installMcp(e.id,t,r,a)}catch(e){return i(e instanceof Error?e.message:"Install failed"),null}finally{s(!1)}},[e]),installing:t,error:a}}},3381:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>b});var r=s(8111),a=s(5271),n=s(5935),o=s.n(n),i=s(1802),l=s(3951),c=s(4632),d=s(6028);let m={database:"bg-blue-500/10 text-blue-400",api:"bg-emerald-500/10 text-emerald-400",devtools:"bg-orange-500/10 text-orange-400",comms:"bg-pink-500/10 text-pink-400",analytics:"bg-cyan-500/10 text-cyan-400",cloud:"bg-violet-500/10 text-violet-400",ai:"bg-primary-500/10 text-primary-400",search:"bg-yellow-500/10 text-yellow-400",monitoring:"bg-red-500/10 text-red-400","project-management":"bg-indigo-500/10 text-indigo-400",design:"bg-fuchsia-500/10 text-fuchsia-400",custom:"bg-gray-500/10 text-gray-400"},x={stdio:"stdio",sse:"SSE",http:"HTTP"},u={ready:"bg-emerald-500/10 text-emerald-400","needs-config":"bg-amber-500/10 text-amber-400","no-repos":"bg-gray-500/10 text-gray-400"},h={ready:"Ready","needs-config":"Needs Config","no-repos":"No Repos"};function p(e){var t,s;let{name:n,displayName:i,description:l,transport:c,category:d,addedAt:p,readinessStatus:g,onRemove:f}=e,[b,v]=(0,a.useState)(!1);return(0,r.jsx)("div",{className:"group rounded-xl border border-white/[0.06] bg-surface-900 p-4 transition-colors hover:border-white/[0.1]",children:(0,r.jsxs)("div",{className:"flex items-start gap-4",children:[(0,r.jsx)("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-surface-800",children:(0,r.jsx)("svg",{className:"h-5 w-5 text-gray-500",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})})}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(o(),{href:"/mcps/".concat(encodeURIComponent(n)),className:"text-sm font-semibold text-white hover:text-primary-400 transition-colors",children:i||n}),(0,r.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ".concat(null!=(t=m[d])?t:m.custom),children:d}),(0,r.jsx)("span",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-[10px] text-gray-500",children:null!=(s=x[c])?s:c}),g&&(0,r.jsx)(o(),{href:"needs-config"===g?"/mcps/".concat(encodeURIComponent(n)):"#",className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium ".concat(u[g]," ").concat("needs-config"===g?"hover:underline":""),onClick:"needs-config"!==g?e=>e.preventDefault():void 0,children:h[g]})]}),l&&(0,r.jsx)("p",{className:"mt-1 truncate text-xs text-gray-500",children:l}),p&&(0,r.jsxs)("p",{className:"mt-0.5 text-[10px] text-gray-600",children:["Added ",new Date(p).toLocaleDateString()]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[(0,r.jsx)(o(),{href:"/mcps/".concat(encodeURIComponent(n)),className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",title:"View details",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"})})}),(0,r.jsx)("button",{onClick:()=>{v(!0),f(n)},disabled:b,className:"rounded-lg p-1.5 transition-colors ".concat(b?"text-gray-600 cursor-not-allowed":"text-gray-500 hover:bg-white/[0.06] hover:text-red-400"),title:"Remove from library",children:(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"})})})]})]})})}function g(e){let{mcps:t,activations:s}=e,n=(0,a.useMemo)(()=>s.filter(e=>e.activation.enabled),[s]),i=(0,a.useMemo)(()=>t.filter(e=>{let t=s.find(t=>t.name===e.name);return!!(null==t?void 0:t.activation.enabled)&&!!e.config_schema&&Object.entries(e.config_schema).filter(e=>{let[,t]=e;return t.required}).map(e=>{let[t]=e;return t}).some(e=>!t.activation.config[e])}),[t,s]),l=t.length,c=n.length,d=i.length,m=t.filter(e=>!s.some(t=>t.name===e.name&&t.activation.enabled)).length,x=c-d,u=0===d&&0===m;return 0===l?null:(0,r.jsxs)("div",{className:"rounded-xl border p-4 ".concat(u?"border-emerald-500/20 bg-emerald-500/[0.04]":"border-amber-500/20 bg-amber-500/[0.04]"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-full ".concat(u?"bg-emerald-500/10":"bg-amber-500/10"),children:u?(0,r.jsx)("svg",{className:"h-4 w-4 text-emerald-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}):(0,r.jsx)("svg",{className:"h-4 w-4 text-amber-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-sm font-semibold ".concat(u?"text-emerald-400":"text-amber-400"),children:u?"All MCPs ready":"".concat(x," of ").concat(l," MCPs ready")}),(0,r.jsxs)("p",{className:"mt-0.5 text-[11px] text-gray-500",children:[c," of ",l," enabled",d>0&&" \xb7 ".concat(d," missing required config"),m>0&&" \xb7 ".concat(m," not activated")]})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-800 px-3 py-1.5 text-center",children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-white",children:c}),(0,r.jsx)("p",{className:"text-[10px] text-gray-500",children:"Enabled"})]}),(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-800 px-3 py-1.5 text-center",children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-white",children:l-c}),(0,r.jsx)("p",{className:"text-[10px] text-gray-500",children:"Inactive"})]}),d>0&&(0,r.jsxs)("div",{className:"rounded-lg border border-amber-500/20 bg-amber-500/[0.08] px-3 py-1.5 text-center",children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-amber-400",children:d}),(0,r.jsx)("p",{className:"text-[10px] text-amber-600",children:"Needs Config"})]}),m>0&&(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-800 px-3 py-1.5 text-center",children:[(0,r.jsx)("p",{className:"text-xs font-semibold text-gray-400",children:m}),(0,r.jsx)("p",{className:"text-[10px] text-gray-500",children:"No Repos"})]})]})]}),d>0&&(0,r.jsx)("div",{className:"mt-3 space-y-1.5 border-t border-white/[0.04] pt-3",children:i.map(e=>{let t=s.find(t=>t.name===e.name),a=e.config_schema?Object.entries(e.config_schema).filter(e=>{let[s,r]=e;return r.required&&!(null==t?void 0:t.activation.config[s])}).map(e=>{let[t]=e;return t}):[];return(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 shrink-0 rounded-full bg-amber-400"}),(0,r.jsx)(o(),{href:"/mcps/".concat(encodeURIComponent(e.name)),className:"truncate text-xs text-gray-300 hover:text-white transition-colors",children:e.display_name||e.name})]}),(0,r.jsx)("div",{className:"flex shrink-0 flex-wrap gap-1",children:a.map(e=>(0,r.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 font-mono text-[10px] text-amber-500",children:e},e))})]},e.name)})})]})}function f(e){let{onAdd:t,onClose:s}=e,[n,o]=(0,a.useState)(""),[i,l]=(0,a.useState)(""),[c,d]=(0,a.useState)(""),[m,x]=(0,a.useState)(""),[u,h]=(0,a.useState)("custom"),[p,g]=(0,a.useState)(!1),[f,b]=(0,a.useState)(null);async function v(){if(n.trim()&&i.trim()){if(!/^[a-z0-9][a-z0-9_-]*$/.test(n.trim()))return void b("Name must start with a letter or number and contain only lowercase letters, numbers, hyphens, and underscores.");g(!0),b(null);try{await t({name:n.trim(),command:i.trim(),args:c.trim()?c.trim().split(/\s+/):[],description:m.trim()||void 0,category:u}),s()}catch(e){b(e instanceof Error?e.message:"Failed to add MCP")}finally{g(!1)}}}return(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",children:"Name"}),(0,r.jsx)("input",{type:"text",value:n,onChange:e=>o(e.target.value),placeholder:"my-custom-mcp",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),(0,r.jsx)("p",{className:"mt-1 text-[11px] text-gray-600",children:"Lowercase letters, numbers, hyphens, and underscores only."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",children:"Command"}),(0,r.jsx)("input",{type:"text",value:i,onChange:e=>l(e.target.value),placeholder:"npx",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",children:"Arguments"}),(0,r.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"-y @my/mcp-server",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),(0,r.jsx)("p",{className:"mt-1 text-[11px] text-gray-600",children:"Space-separated arguments passed to the command."})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",children:"Description"}),(0,r.jsx)("input",{type:"text",value:m,onChange:e=>x(e.target.value),placeholder:"Optional description...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"mb-1.5 block text-xs font-medium text-gray-400",children:"Category"}),(0,r.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-gray-200 outline-none focus:border-primary-500/50",children:[(0,r.jsx)("option",{value:"custom",children:"Custom"}),(0,r.jsx)("option",{value:"database",children:"Database"}),(0,r.jsx)("option",{value:"api",children:"API"}),(0,r.jsx)("option",{value:"devtools",children:"DevTools"}),(0,r.jsx)("option",{value:"comms",children:"Comms"}),(0,r.jsx)("option",{value:"project-management",children:"Project Management"}),(0,r.jsx)("option",{value:"design",children:"Design"}),(0,r.jsx)("option",{value:"analytics",children:"Analytics"}),(0,r.jsx)("option",{value:"cloud",children:"Cloud"}),(0,r.jsx)("option",{value:"ai",children:"AI"}),(0,r.jsx)("option",{value:"search",children:"Search"}),(0,r.jsx)("option",{value:"monitoring",children:"Monitoring"})]})]}),f&&(0,r.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:f}),(0,r.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,r.jsx)("button",{onClick:()=>void v(),disabled:p||!n.trim()||!i.trim(),className:"rounded-lg bg-primary-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:p?"Adding...":"Add MCP"}),(0,r.jsx)("button",{onClick:s,className:"rounded-lg px-4 py-2 text-sm font-medium text-gray-400 transition-colors hover:text-gray-200",children:"Cancel"})]})]})}function b(){let{mcps:e,loading:t,error:s,addMcp:n,removeMcp:m}=(0,i.L2)(),{activations:x}=(0,i.tO)(),[u,h]=(0,a.useState)(!1),b=(0,a.useMemo)(()=>{let t=new Map;for(let s of e){let e=x.find(e=>e.name===s.name);if(!(null==e?void 0:e.activation.enabled)){t.set(s.name,"no-repos");continue}if(s.config_schema&&Object.entries(s.config_schema).some(t=>{let[s,r]=t;return r.required&&!e.activation.config[s]})){t.set(s.name,"needs-config");continue}t.set(s.name,"ready")}return t},[e,x]);return t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"MCP Tools"}),(0,r.jsx)(l.G,{rows:4})]}):s?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"MCP Tools"}),(0,r.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] p-4",children:(0,r.jsxs)("p",{className:"text-sm text-red-400",children:["Failed to load MCP library: ",s]})})]}):(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"MCP Tools"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-400",children:[e.length," tool",1!==e.length?"s":""," in your library"]})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsxs)(o(),{href:"/mcps/usage",className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] px-4 py-2 text-sm font-medium text-gray-300 transition-colors hover:border-white/[0.15] hover:text-white",children:[(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 13.125C3 12.504 3.504 12 4.125 12h2.25c.621 0 1.125.504 1.125 1.125v6.75C7.5 20.496 6.996 21 6.375 21h-2.25A1.125 1.125 0 0 1 3 19.875v-6.75ZM9.75 8.625c0-.621.504-1.125 1.125-1.125h2.25c.621 0 1.125.504 1.125 1.125v11.25c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V8.625ZM16.5 4.125c0-.621.504-1.125 1.125-1.125h2.25C20.496 3 21 3.504 21 4.125v15.75c0 .621-.504 1.125-1.125 1.125h-2.25a1.125 1.125 0 0 1-1.125-1.125V4.125Z"})}),"Usage"]}),(0,r.jsxs)(o(),{href:"/mcps/secrets",className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] px-4 py-2 text-sm font-medium text-gray-300 transition-colors hover:border-white/[0.15] hover:text-white",children:[(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"})}),"Secrets"]}),(0,r.jsxs)(o(),{href:"/mcps/catalog",className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] px-4 py-2 text-sm font-medium text-gray-300 transition-colors hover:border-white/[0.15] hover:text-white",children:[(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6.042A8.967 8.967 0 0 0 6 3.75c-1.052 0-2.062.18-3 .512v14.25A8.987 8.987 0 0 1 6 18c2.305 0 4.408.867 6 2.292m0-14.25a8.966 8.966 0 0 1 6-2.292c1.052 0 2.062.18 3 .512v14.25A8.987 8.987 0 0 0 18 18a8.967 8.967 0 0 0-6 2.292m0-14.25v14.25"})}),"Browse Catalog"]}),(0,r.jsxs)(o(),{href:"/mcps/submissions",className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] px-4 py-2 text-sm font-medium text-gray-300 transition-colors hover:border-white/[0.15] hover:text-white",children:[(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})}),"Submissions"]}),(0,r.jsxs)("button",{onClick:()=>h(!0),className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-4 py-2 text-sm font-semibold text-white transition-colors hover:bg-primary-600",children:[(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),"Add Custom"]})]})]}),e.length>0&&(0,r.jsx)(g,{mcps:e,activations:x}),0===e.length?(0,r.jsx)(c.p,{icon:(0,r.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.959.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})}),title:"No MCP tools in your library",description:"Add MCP servers from the catalog or create a custom definition to extend your AI agent capabilities.",action:{label:"Browse Catalog",onClick:()=>{window.location.href="/mcps/catalog"}}}):(0,r.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,r.jsx)(p,{name:e.name,displayName:e.display_name,description:e.description,transport:e.transport,category:e.category,addedAt:e.added_at,readinessStatus:b.get(e.name),onRemove:e=>void m(e)},e.name))}),(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-4",children:[(0,r.jsx)("h3",{className:"mb-3 text-sm font-semibold text-white",children:"CLI Reference"}),(0,r.jsxs)("div",{className:"space-y-1.5 font-mono text-xs text-gray-500",children:[(0,r.jsxs)("p",{children:[(0,r.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-gray-400",children:"ulpi mcp-setup"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- Auto-detect and configure MCP servers"})]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-gray-400",children:"ulpi codemap serve"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- Start CodeMap MCP server"})]}),(0,r.jsxs)("p",{children:[(0,r.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-gray-400",children:"ulpi memory serve"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- Start Memory MCP server"})]})]})]}),(0,r.jsx)(d.a,{open:u,onClose:()=>h(!1),title:"Add Custom MCP",description:"Register a custom MCP server with a command and arguments.",children:(0,r.jsx)(f,{onAdd:n,onClose:()=>h(!1)})})]})}},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>c,HI:()=>x,Xk:()=>d,yC:()=>m});var r=s(8111),a=s(5271),n=s(422),o=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=o.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,n.h)()}}let l=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,s=(0,a.useMemo)(()=>{let e=(0,n.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(l,{value:s,children:t})}function d(){return(0,a.useContext)(l).mode}function m(){let{localClient:e}=(0,a.useContext)(l);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,a.useContext)(l)}},3951:(e,t,s)=>{"use strict";s.d(t,{G:()=>a});var r=s(8111);function a(e){let{rows:t=3,variant:s="skeleton",className:a=""}=e;return"spinner"===s?(0,r.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(a),children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,r.jsx)("div",{className:"space-y-3 ".concat(a),children:Array.from({length:t}).map((e,t)=>(0,r.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,r.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,r.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},4632:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var r=s(8111);function a(){return(0,r.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})})}function n(e){let{icon:t,title:s,description:n,action:o,className:i=""}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/[0.06] bg-surface-800/30 px-6 py-16 text-center ".concat(i),children:[(0,r.jsx)("div",{className:"mb-4",children:null!=t?t:(0,r.jsx)(a,{})}),(0,r.jsx)("h3",{className:"text-sm font-medium text-gray-300",children:s}),n&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:n}),o&&(0,r.jsx)("button",{onClick:o.onClick,className:"mt-5 rounded-lg bg-primary-500 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600",children:o.label})]})}},5855:(e,t,s)=>{Promise.resolve().then(s.bind(s,3381))},6028:(e,t,s)=>{"use strict";s.d(t,{a:()=>n});var r=s(8111),a=s(5271);function n(e){let{open:t,onClose:s,title:n,description:o,children:i,maxWidth:l="max-w-lg"}=e,c=(0,a.useRef)(null),d=(0,a.useCallback)(e=>{"Escape"===e.key&&s()},[s]);return((0,a.useEffect)(()=>{if(t)return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,d]),(0,a.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t)?(0,r.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[(0,r.jsx)("div",{ref:c,className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:s}),(0,r.jsxs)("div",{className:"relative z-10 w-full ".concat(l," animate-in rounded-2xl border border-white/[0.08] bg-surface-900 shadow-2xl"),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between border-b border-white/[0.06] px-6 py-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:n}),o&&(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:o})]}),(0,r.jsx)("button",{onClick:s,className:"ml-4 rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",children:(0,r.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),(0,r.jsx)("div",{className:"px-6 py-4",children:i})]})]}):null}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=5855)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9796],{422:(e,t,r)=>{"use strict";r.d(t,{J:()=>l,h:()=>a});var s=r(7811);function a(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},3446:(e,t,r)=>{"use strict";r.d(t,{Kv:()=>c,HI:()=>u,Xk:()=>d,yC:()=>x});var s=r(8111),a=r(5271),l=r(422),n=r(7811);class i{async request(e,t){let r="".concat(this.baseUrl).concat(e);if(this.repo){let e=r.includes("?")?"&":"?";r="".concat(r).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let s=n.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(r,{...t,headers:{"Content-Type":"application/json",...s?{"X-Ulpi-Secret":s}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,l.h)()}}let o=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,r=(0,a.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,s.jsx)(o,{value:r,children:t})}function d(){return(0,a.useContext)(o).mode}function x(){let{localClient:e}=(0,a.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function u(){return(0,a.useContext)(o)}},3951:(e,t,r)=>{"use strict";r.d(t,{G:()=>a});var s=r(8111);function a(e){let{rows:t=3,variant:r="skeleton",className:a=""}=e;return"spinner"===r?(0,s.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(a),children:(0,s.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,s.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,s.jsx)("div",{className:"space-y-3 ".concat(a),children:Array.from({length:t}).map((e,t)=>(0,s.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,s.jsxs)("div",{className:"flex items-center gap-4",children:[(0,s.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,s.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,s.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,s.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,s.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},4409:(e,t,r)=>{Promise.resolve().then(r.bind(r,7099))},4632:(e,t,r)=>{"use strict";r.d(t,{p:()=>l});var s=r(8111);function a(){return(0,s.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})})}function l(e){let{icon:t,title:r,description:l,action:n,className:i=""}=e;return(0,s.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/[0.06] bg-surface-800/30 px-6 py-16 text-center ".concat(i),children:[(0,s.jsx)("div",{className:"mb-4",children:null!=t?t:(0,s.jsx)(a,{})}),(0,s.jsx)("h3",{className:"text-sm font-medium text-gray-300",children:r}),l&&(0,s.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:l}),n&&(0,s.jsx)("button",{onClick:n.onClick,className:"mt-5 rounded-lg bg-primary-500 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600",children:n.label})]})}},6028:(e,t,r)=>{"use strict";r.d(t,{a:()=>l});var s=r(8111),a=r(5271);function l(e){let{open:t,onClose:r,title:l,description:n,children:i,maxWidth:o="max-w-lg"}=e,c=(0,a.useRef)(null),d=(0,a.useCallback)(e=>{"Escape"===e.key&&r()},[r]);return((0,a.useEffect)(()=>{if(t)return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t,d]),(0,a.useEffect)(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[t]),t)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center px-4",children:[(0,s.jsx)("div",{ref:c,className:"absolute inset-0 bg-black/60 backdrop-blur-sm",onClick:r}),(0,s.jsxs)("div",{className:"relative z-10 w-full ".concat(o," animate-in rounded-2xl border border-white/[0.08] bg-surface-900 shadow-2xl"),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between border-b border-white/[0.06] px-6 py-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-white",children:l}),n&&(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:n})]}),(0,s.jsx)("button",{onClick:r,className:"ml-4 rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",children:(0,s.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),(0,s.jsx)("div",{className:"px-6 py-4",children:i})]})]}):null}},7099:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>g});var s=r(8111),a=r(5271),l=r(8984),n=r(7102);let i=["DECISION","PATTERN","BUG_ROOT_CAUSE","PREFERENCE","CONSTRAINT","CONTEXT","LESSON","RELATIONSHIP"],o=["critical","high","medium","low"];function c(e){let{onSubmit:t,onCancel:r}=e,[l,n]=(0,a.useState)(""),[c,d]=(0,a.useState)("DECISION"),[x,u]=(0,a.useState)("medium"),[m,p]=(0,a.useState)(""),[h,g]=(0,a.useState)(""),[b,y]=(0,a.useState)(!1),[f,j]=(0,a.useState)(null);async function v(e){if(e.preventDefault(),l.trim()){y(!0),j(null);try{let e=m.split(",").map(e=>e.trim()).filter(Boolean);await t({summary:l.trim(),type:c,importance:x,tags:e,detail:h.trim()||void 0})}catch(e){j(e instanceof Error?e.message:"Failed to save memory")}finally{y(!1)}}}return(0,s.jsxs)("form",{onSubmit:e=>void v(e),className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Summary"}),(0,s.jsx)("input",{type:"text",value:l,onChange:e=>n(e.target.value),placeholder:"What should be remembered?",className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Type"}),(0,s.jsx)("select",{value:c,onChange:e=>d(e.target.value),className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white outline-none focus:border-primary-500/50",children:i.map(e=>(0,s.jsx)("option",{value:e,children:e.replace(/_/g," ")},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Importance"}),(0,s.jsx)("select",{value:x,onChange:e=>u(e.target.value),className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white outline-none focus:border-primary-500/50",children:o.map(e=>(0,s.jsx)("option",{value:e,children:e},e))})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-400",children:["Tags ",(0,s.jsx)("span",{className:"text-gray-600",children:"(comma-separated)"})]}),(0,s.jsx)("input",{type:"text",value:m,onChange:e=>p(e.target.value),placeholder:"architecture, performance, security",className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-xs font-medium text-gray-400",children:["Detail ",(0,s.jsx)("span",{className:"text-gray-600",children:"(optional)"})]}),(0,s.jsx)("textarea",{value:h,onChange:e=>g(e.target.value),placeholder:"Additional context or explanation...",rows:3,className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50 resize-none"})]}),f&&(0,s.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:f}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,s.jsx)("button",{type:"button",onClick:r,className:"rounded-lg px-4 py-2 text-xs font-medium text-gray-400 transition-colors hover:bg-white/[0.04] hover:text-gray-300",children:"Cancel"}),(0,s.jsx)("button",{type:"submit",disabled:b||!l.trim(),className:"rounded-lg bg-primary-500 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:b?"Saving...":"Remember"})]})]})}var d=r(3951),x=r(4632),u=r(6028);let m=["DECISION","PATTERN","BUG_ROOT_CAUSE","PREFERENCE","CONSTRAINT","CONTEXT","LESSON","RELATIONSHIP"],p=["critical","high","medium","low"],h={DECISION:"bg-blue-500/15 text-blue-400 border-blue-500/20",PATTERN:"bg-green-500/15 text-green-400 border-green-500/20",BUG_ROOT_CAUSE:"bg-red-500/15 text-red-400 border-red-500/20",PREFERENCE:"bg-yellow-500/15 text-yellow-400 border-yellow-500/20",CONSTRAINT:"bg-orange-500/15 text-orange-400 border-orange-500/20",CONTEXT:"bg-purple-500/15 text-purple-400 border-purple-500/20",LESSON:"bg-pink-500/15 text-pink-400 border-pink-500/20",RELATIONSHIP:"bg-cyan-500/15 text-cyan-400 border-cyan-500/20"};function g(){var e,t,r,i;let{status:o,loading:g,refresh:y,toggleEnabled:f}=(0,l.XB)(),{results:j,searching:v,search:N}=(0,l.nu)(),{remember:w,forget:k,runAction:C,getTimeline:E}=(0,l.wC)(),[S,T]=(0,a.useState)(""),[R,I]=(0,a.useState)([]),[L,O]=(0,a.useState)([]),[P,M]=(0,a.useState)(!1),[_,A]=(0,a.useState)(!1),[U,B]=(0,a.useState)(null),[D,F]=(0,a.useState)(null),[X,H]=(0,a.useState)(null),[W,G]=(0,a.useState)([]),[q,z]=(0,a.useState)(!0),J=(0,a.useCallback)(async()=>{try{var e;let t=await E(20);G(null!=(e=t.entries)?e:[])}catch(e){}finally{z(!1)}},[E]);(0,a.useEffect)(()=>{J()},[J]);let V=(0,a.useCallback)(async e=>{null==e||e.preventDefault(),S.trim()&&(M(!0),await N(S.trim()))},[S,N]),Z=(0,a.useCallback)(async e=>{try{await k(e),y(),J()}catch(e){}},[k,y,J]),K=(0,a.useCallback)(async e=>{await w(e.summary,e.type),A(!1),y(),J()},[w,y,J]),Q=(null==o?void 0:o.reindexing)===!0,Y=(0,a.useCallback)(async(e,t)=>{B(e),F(null);try{var r;let s=await C(e);F(null!=(r=null==s?void 0:s.message)?r:"".concat(t," started.")),y()}catch(e){F(e instanceof Error?e.message:"".concat(t," failed"))}finally{B(null)}},[C,y]),$=j.filter(e=>(!(R.length>0)||!e.type||!!R.includes(e.type))&&(!(L.length>0)||!e.importance||!!L.includes(e.importance)));return(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Memory"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Search and manage agent memories across sessions."})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[[{action:"classify-all",label:"Classify"},{action:"reindex",label:"Reindex"},{action:"export",label:"Export"}].map(e=>{let{action:t,label:r}=e,a=null!==U||"reindex"===t&&Q,l=U===t||"reindex"===t&&Q,n="reindex"===t&&Q?"Reindexing...":r;return(0,s.jsxs)("button",{onClick:()=>void Y(t,r),disabled:a,className:"inline-flex items-center gap-1.5 rounded-lg border border-white/[0.08] bg-surface-900 px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:bg-surface-800 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",children:[l&&(0,s.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),n]},t)}),(0,s.jsxs)("button",{onClick:()=>A(!0),className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-3 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600",children:[(0,s.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 4.5v15m7.5-7.5h-15"})}),"Remember"]})]})]}),D&&(0,s.jsx)("div",{className:"rounded-lg border border-blue-500/20 bg-blue-500/[0.06] px-3 py-2 text-xs text-blue-400",children:D}),Q&&o.reindexProgress&&(0,s.jsxs)("div",{className:"rounded-xl border border-primary-500/20 bg-primary-500/[0.06] p-5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsxs)("h2",{className:"text-sm font-semibold text-white",children:["Reindexing — ",o.reindexProgress.phase]})]}),(0,s.jsx)("span",{className:"text-xs text-gray-400",children:o.reindexProgress.total>0?"".concat(o.reindexProgress.current," / ").concat(o.reindexProgress.total):"".concat(o.reindexProgress.current," processed")})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-400",children:o.reindexProgress.message}),o.reindexProgress.total>0&&(0,s.jsx)("div",{className:"mt-3 h-2 w-full overflow-hidden rounded-full bg-surface-800",children:(0,s.jsx)("div",{className:"h-full rounded-full bg-primary-500 transition-all duration-500 ease-out",style:{width:"".concat(Math.min(100,Math.round(o.reindexProgress.current/o.reindexProgress.total*100)),"%")}})})]}),Q&&!o.reindexProgress&&(0,s.jsx)("div",{className:"rounded-xl border border-primary-500/20 bg-primary-500/[0.06] p-5",children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:[(0,s.jsx)("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,s.jsx)("h2",{className:"text-sm font-semibold text-white",children:"Starting reindex pipeline..."})]})}),(null==o?void 0:o.lastReindexError)&&!Q&&o.lastReindexError!==X&&(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-red-500/20 bg-red-500/[0.06] px-3 py-2 text-xs text-red-400",children:[(0,s.jsxs)("span",{children:["Reindex failed: ",o.lastReindexError]}),(0,s.jsx)("button",{onClick:()=>H(o.lastReindexError),className:"ml-2 shrink-0 text-red-400/60 hover:text-red-400 transition-colors",children:(0,s.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5 space-y-4",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-white",children:"Search Memories"}),(0,s.jsxs)("form",{onSubmit:e=>void V(e),className:"flex items-end gap-3",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"block text-xs font-medium text-gray-400",children:"Query"}),(0,s.jsx)("input",{type:"text",value:S,onChange:e=>T(e.target.value),placeholder:"Why did we choose this architecture?",className:"mt-1 w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2.5 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]}),(0,s.jsxs)("button",{type:"submit",disabled:v||!S.trim(),className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-4 py-2.5 text-sm font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:[v?(0,s.jsx)("span",{className:"h-3.5 w-3.5 animate-spin rounded-full border-2 border-white border-t-transparent"}):(0,s.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})}),"Search"]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Type Filter"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:m.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>{I(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:"inline-flex items-center rounded-full border px-2.5 py-1 text-[10px] font-semibold uppercase tracking-wide transition-colors ".concat(R.includes(e)?h[e]:"border-transparent bg-surface-800 text-gray-500 hover:text-gray-400"),children:e.replace(/_/g," ")},e))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"mb-2 text-[10px] font-medium uppercase tracking-widest text-gray-600",children:"Importance Filter"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:p.map(e=>(0,s.jsx)("button",{type:"button",onClick:()=>{O(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},className:"inline-flex items-center rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ".concat(L.includes(e)?"border-primary-500/30 bg-primary-500/10 text-primary-400":"border-transparent bg-surface-800 text-gray-500 hover:text-gray-400"),children:e},e))})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-1 gap-6 lg:grid-cols-12",children:[(0,s.jsxs)("div",{className:"lg:col-span-8",children:[(0,s.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,s.jsx)("h2",{className:"text-base font-semibold text-white",children:P?"Search Results":"Recent Memories"}),P&&$.length>0&&(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:[$.length," results"]}),!P&&W.length>0&&(0,s.jsxs)("span",{className:"text-xs text-gray-500",children:["Last ",W.length]})]}),v?(0,s.jsx)(d.G,{rows:3}):P?0===$.length?(0,s.jsx)(x.p,{title:"No results found",description:"Try a different query or adjust the filters."}):(0,s.jsx)("div",{className:"space-y-3",children:$.map(e=>(0,s.jsx)(n._,{entry:e,score:e.score,onForget:Z},e.id))}):q?(0,s.jsx)(d.G,{rows:3}):0===W.length?(0,s.jsx)(x.p,{title:"No memories yet",description:"Memories will appear here as the agent captures decisions, patterns, and lessons.",icon:(0,s.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Z"})})}):(0,s.jsx)("div",{className:"space-y-3",children:W.map(e=>(0,s.jsx)(n._,{entry:e,onForget:Z},e.id))})]}),(0,s.jsxs)("div",{className:"lg:col-span-4 space-y-4",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Stats"}),g?(0,s.jsx)(d.G,{rows:1,variant:"spinner"}):o?(0,s.jsxs)("div",{className:"mt-3 space-y-2.5",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:"Enabled"}),(0,s.jsx)("button",{onClick:()=>{var e;f(!(null==(e=o.config)?void 0:e.enabled))},className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full transition-colors ".concat((null==(e=o.config)?void 0:e.enabled)?"bg-primary-500":"bg-surface-700"),children:(0,s.jsx)("span",{className:"inline-block h-3.5 w-3.5 rounded-full bg-white transition-transform ".concat((null==(t=o.config)?void 0:t.enabled)?"translate-x-[18px]":"translate-x-[3px]")})})]}),(0,s.jsx)(b,{label:"Total Memories",value:String(null!=(i=null==(r=o.stats)?void 0:r.totalMemories)?i:0)}),(0,s.jsx)(b,{label:"Initialized",value:o.initialized?"Yes":"No"})]}):(0,s.jsx)("p",{className:"mt-2 text-xs text-gray-500",children:"Unable to fetch status."})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-white",children:"About Memory"}),(0,s.jsx)("p",{className:"mt-2 text-xs leading-relaxed text-gray-400",children:"Agent Memory captures decisions, patterns, and lessons learned across coding sessions. Memories are semantically indexed and surfaced to the agent at session start for context continuity."})]})]})]}),(0,s.jsx)(u.a,{open:_,onClose:()=>A(!1),title:"Remember",description:"Create a new memory for the agent to recall.",children:(0,s.jsx)(c,{onSubmit:K,onCancel:()=>A(!1)})})]})}function b(e){let{label:t,value:r}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between text-sm",children:[(0,s.jsx)("span",{className:"text-gray-400",children:t}),(0,s.jsx)("span",{className:"font-medium text-white",children:r})]})}},7102:(e,t,r)=>{"use strict";r.d(t,{_:()=>o});var s=r(8111),a=r(5271);let l={DECISION:"bg-blue-500/15 text-blue-400 border-blue-500/20",PATTERN:"bg-green-500/15 text-green-400 border-green-500/20",BUG_ROOT_CAUSE:"bg-red-500/15 text-red-400 border-red-500/20",PREFERENCE:"bg-yellow-500/15 text-yellow-400 border-yellow-500/20",CONSTRAINT:"bg-orange-500/15 text-orange-400 border-orange-500/20",CONTEXT:"bg-purple-500/15 text-purple-400 border-purple-500/20",LESSON:"bg-pink-500/15 text-pink-400 border-pink-500/20",RELATIONSHIP:"bg-cyan-500/15 text-cyan-400 border-cyan-500/20"},n={critical:"text-red-400",high:"text-orange-400",medium:"text-yellow-400",low:"text-gray-500"};function i(e){var t;let{type:r}=e,a=null!=(t=l[r])?t:"bg-gray-500/15 text-gray-400 border-gray-500/20";return(0,s.jsx)("span",{className:"inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ".concat(a),children:r.replace(/_/g," ")})}function o(e){var t,r,l,o;let{entry:c,score:d,onForget:x}=e,[u,m]=(0,a.useState)(!1),p=!!c.detail,h=(null==(t=c.relatedFiles)?void 0:t.length)>0,g=p||h;return(0,s.jsxs)("div",{className:"rounded-xl border bg-surface-800/50 p-4 space-y-2 transition-colors ".concat(g?"cursor-pointer hover:border-white/[0.08]":""," ").concat(u?"border-primary-500/30":"border-white/[0.04]"),onClick:()=>g&&m(e=>!e),children:[(0,s.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g&&(0,s.jsx)("svg",{className:"h-3.5 w-3.5 text-gray-500 transition-transform ".concat(u?"rotate-0":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,s.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}),(0,s.jsx)(i,{type:c.type}),(0,s.jsx)("span",{className:"text-xs font-medium ".concat(n[c.importance]),children:c.importance}),void 0!==d&&(0,s.jsxs)("span",{className:"text-xs font-medium text-primary-400",children:[(100*d).toFixed(0),"% match"]})]}),x&&(0,s.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),x(c.id)},className:"rounded px-1.5 py-0.5 text-[10px] text-gray-600 transition-colors hover:bg-red-500/10 hover:text-red-400",title:"Mark as superseded",children:"forget"})]}),(0,s.jsx)("p",{className:"text-sm leading-relaxed text-gray-200",children:c.summary}),p&&(0,s.jsx)("p",{className:"text-xs leading-relaxed text-gray-400 whitespace-pre-wrap ".concat(u?"":"line-clamp-2"),children:c.detail}),u&&(0,s.jsxs)("div",{className:"space-y-2 border-t border-white/[0.04] pt-2",children:[h&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-600",children:"Related Files"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.relatedFiles.map(e=>(0,s.jsx)("span",{className:"inline-flex items-center gap-1 rounded bg-surface-800 px-2 py-0.5 font-mono text-[11px] text-gray-400",children:e.split("/").pop()},e))})]}),(null==(r=c.tags)?void 0:r.length)>0&&(0,s.jsxs)("div",{className:"space-y-1",children:[(0,s.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-600",children:"Tags"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.tags.map(e=>(0,s.jsxs)("span",{className:"inline-flex items-center rounded-full bg-surface-800 px-2 py-0.5 text-[10px] text-gray-400",children:["#",e]},e))})]}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 pt-1 text-[11px] text-gray-600",children:[(null==(l=c.source)?void 0:l.sessionId)&&(0,s.jsxs)("span",{children:["Session: ",c.source.sessionId.slice(0,12),"..."]}),(0,s.jsxs)("span",{children:["Created: ",new Date(c.createdAt).toLocaleString()]}),(0,s.jsxs)("span",{className:"font-mono text-[10px]",children:["ID: ",c.id.slice(0,12)]})]})]}),!u&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-600",children:[(null==(o=c.tags)?void 0:o.length)>0&&(0,s.jsxs)("span",{children:["#",c.tags.slice(0,3).join(", #"),c.tags.length>3&&" +".concat(c.tags.length-3)]}),(0,s.jsx)("span",{children:function(e){let t=new Date(e);if(isNaN(t.getTime()))return e;let r=Date.now()-t.getTime();return r<6e4?"just now":r<36e5?"".concat(Math.floor(r/6e4),"m ago"):r<864e5?"".concat(Math.floor(r/36e5),"h ago"):r<6048e5?"".concat(Math.floor(r/864e5),"d ago"):t.toLocaleDateString()}(c.createdAt)}),h&&(0,s.jsxs)("span",{children:[c.relatedFiles.length," files"]})]})]})}},8984:(e,t,r)=>{"use strict";r.d(t,{XB:()=>l,nu:()=>n,wC:()=>i});var s=r(5271),a=r(3446);function l(){let e=(0,a.yC)(),[t,r]=(0,s.useState)(null),[l,n]=(0,s.useState)(!0),[i,o]=(0,s.useState)(null),c=(0,s.useRef)(null),d=(0,s.useCallback)(async()=>{o(null);try{let t=await e.get("/api/memory/status");return r(t),t}catch(e){return o(e instanceof Error?e.message:"Failed to fetch memory status"),null}finally{n(!1)}},[e]);(0,s.useEffect)(()=>{let e=!1;async function t(){var r;if(e)return;let s=await d();e||(c.current=setTimeout(()=>void t(),null!=(r=null==s?void 0:s.pollIntervalMs)?r:3e4))}return n(!0),t(),()=>{e=!0,c.current&&clearTimeout(c.current)}},[d]);let x=(0,s.useCallback)(async t=>{await e.put("/api/memory/config",{enabled:t}),await d()},[e,d]);return{status:t,loading:l,error:i,refresh:d,toggleEnabled:x}}function n(){let e=(0,a.yC)(),[t,r]=(0,s.useState)([]),[l,n]=(0,s.useState)(!1);return{results:t,searching:l,search:(0,s.useCallback)(async t=>{n(!0);try{var s;let a=(null!=(s=(await e.post("/api/memory/search",{query:t})).results)?s:[]).map(e=>e.entry);return r(a),a}catch(e){return r([]),[]}finally{n(!1)}},[e])}}function i(){let e=(0,a.yC)(),t=(0,s.useCallback)(async(t,r)=>e.post("/api/memory/remember",{summary:t,type:null!=r?r:"CONTEXT"}),[e]),r=(0,s.useCallback)(async t=>e.get("/api/memory/timeline".concat(t?"?limit=".concat(t):"")),[e]);return{remember:t,getTimeline:r,forget:(0,s.useCallback)(async t=>e.post("/api/memory/entries/".concat(t,"/forget")),[e]),runAction:(0,s.useCallback)(async t=>e.post("/api/memory/action",{action:t}),[e])}}}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=4409)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9756],{422:(e,t,r)=>{"use strict";r.d(t,{J:()=>l,h:()=>s});var a=r(7811);function s(){return"local"===a.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===a.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},3446:(e,t,r)=>{"use strict";r.d(t,{Kv:()=>c,HI:()=>m,Xk:()=>d,yC:()=>u});var a=r(8111),s=r(5271),l=r(422),n=r(7811);class i{async request(e,t){let r="".concat(this.baseUrl).concat(e);if(this.repo){let e=r.includes("?")?"&":"?";r="".concat(r).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let a=n.env.NEXT_PUBLIC_ULPI_API_SECRET,s=await fetch(r,{...t,headers:{"Content-Type":"application/json",...a?{"X-Ulpi-Secret":a}:{},...null==t?void 0:t.headers}});if(!s.ok)throw Error((await s.json().catch(()=>({error:s.statusText}))).error||"API error: ".concat(s.status));return s.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,l.h)()}}let o=(0,s.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,r=(0,s.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,a.jsx)(o,{value:r,children:t})}function d(){return(0,s.useContext)(o).mode}function u(){let{localClient:e}=(0,s.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function m(){return(0,s.useContext)(o)}},3951:(e,t,r)=>{"use strict";r.d(t,{G:()=>s});var a=r(8111);function s(e){let{rows:t=3,variant:r="skeleton",className:s=""}=e;return"spinner"===r?(0,a.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(s),children:(0,a.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,a.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,a.jsx)("div",{className:"space-y-3 ".concat(s),children:Array.from({length:t}).map((e,t)=>(0,a.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,a.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,a.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,a.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,a.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},5317:(e,t,r)=>{Promise.resolve().then(r.bind(r,6317))},5605:(e,t,r)=>{"use strict";r.d(t,{W:()=>n});var a=r(8111);let s={pending:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",queued:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",active:"bg-blue-500/10 text-blue-400 border-blue-500/20",running:"bg-blue-500/10 text-blue-400 border-blue-500/20",in_progress:"bg-blue-500/10 text-blue-400 border-blue-500/20",completed:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",success:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",approved:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",error:"bg-red-500/10 text-red-400 border-red-500/20",failed:"bg-red-500/10 text-red-400 border-red-500/20",rejected:"bg-red-500/10 text-red-400 border-red-500/20",cancelled:"bg-gray-500/10 text-gray-400 border-gray-500/20",idle:"bg-gray-500/10 text-gray-400 border-gray-500/20"},l={pending:"bg-yellow-400",queued:"bg-yellow-400",active:"bg-blue-400",running:"bg-blue-400",in_progress:"bg-blue-400",completed:"bg-emerald-400",success:"bg-emerald-400",approved:"bg-emerald-400",error:"bg-red-400",failed:"bg-red-400",rejected:"bg-red-400",cancelled:"bg-gray-400",idle:"bg-gray-400"};function n(e){var t,r;let{status:n,label:i,showDot:o=!0,size:c="sm",className:d=""}=e,u=n.toLowerCase().replace(/\s+/g,"_"),m=null!=(t=s[u])?t:"bg-gray-500/10 text-gray-400 border-gray-500/20",x=null!=(r=l[u])?r:"bg-gray-400",b=null!=i?i:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," ");return(0,a.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border font-medium ".concat(m," ").concat("sm"===c?"px-2 py-0.5 text-[11px]":"px-2.5 py-1 text-xs"," ").concat(d),children:[o&&(0,a.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(x)}),b]})}},6317:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var a=r(8111),s=r(5271),l=r(3446),n=r(8984),i=r(3951),o=r(5605);function c(){var e,t;let r=(0,l.yC)(),{status:c,loading:d,refresh:u}=(0,n.XB)(),[m,x]=(0,s.useState)(null),[b,p]=(0,s.useState)(!0),[h,g]=(0,s.useState)(!1),[f,y]=(0,s.useState)(null),[v,w]=(0,s.useState)(null),j=(0,s.useCallback)(async()=>{p(!0);try{let e=await r.get("/api/memory/config");x(e)}catch(e){x(null)}finally{p(!1)}},[r]);(0,s.useEffect)(()=>{j()},[j]);let N=(0,s.useCallback)(async e=>{if(m){g(!0),y(null);try{let t={...m,...e};await r.put("/api/memory/config",t),x(t),y("Configuration updated.")}catch(e){y(e instanceof Error?e.message:"Failed to update config")}finally{g(!1)}}},[r,m]),C=(0,s.useCallback)(async(e,t)=>{w(e),y(null);try{var a;let s=await r.post("/api/memory/action",{action:e});y(null!=(a=s.message)?a:"".concat(t," completed.")),u()}catch(e){y(e instanceof Error?e.message:"".concat(t," failed"))}finally{w(null)}},[r,u]);return(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Memory Settings"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Configure memory capture, classification, and storage."})]}),f&&(0,a.jsx)("div",{className:"rounded-lg border border-blue-500/20 bg-blue-500/[0.06] px-3 py-2 text-xs text-blue-400",children:f}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-white",children:"Status"}),c&&(0,a.jsx)(o.W,{status:c.initialized?"active":"idle",label:c.initialized?"Initialized":"Not Initialized"})]}),d?(0,a.jsx)(i.G,{rows:1,variant:"spinner",className:"mt-4"}):c?(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-2 gap-3 sm:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-lg border border-white/[0.04] bg-surface-800/50 p-3",children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-600",children:"Memories"}),(0,a.jsx)("p",{className:"mt-1 text-xl font-semibold text-white",children:String(null!=(t=null==(e=c.stats)?void 0:e.totalMemories)?t:0)})]}),(0,a.jsxs)("div",{className:"rounded-lg border border-white/[0.04] bg-surface-800/50 p-3",children:[(0,a.jsx)("p",{className:"text-xs font-medium uppercase tracking-wider text-gray-600",children:"Initialized"}),(0,a.jsx)("p",{className:"mt-1 text-sm font-medium text-white",children:c.initialized?"Yes":"No"})]})]}):(0,a.jsx)("p",{className:"mt-4 text-xs text-gray-500",children:"Unable to fetch memory status."})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-white",children:"Configuration"}),b?(0,a.jsx)(i.G,{rows:2,variant:"spinner",className:"mt-4"}):m?(0,a.jsxs)("div",{className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Memory Capture"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Enable or disable memory capture from sessions."})]}),(0,a.jsx)("button",{onClick:()=>void N({enabled:!m.enabled}),disabled:h,className:"relative h-6 w-11 rounded-full transition-colors ".concat(m.enabled?"bg-primary-500":"bg-surface-700"),children:(0,a.jsx)("span",{className:"absolute top-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform ".concat(m.enabled?"translate-x-[22px]":"translate-x-0.5")})})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-200",children:"Auto-Classify"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"Automatically classify new sessions to discover memories."})]}),(0,a.jsx)("button",{onClick:()=>void N({autoClassify:!m.autoClassify}),disabled:h,className:"relative h-6 w-11 rounded-full transition-colors ".concat(m.autoClassify?"bg-primary-500":"bg-surface-700"),children:(0,a.jsx)("span",{className:"absolute top-0.5 h-5 w-5 rounded-full bg-white shadow transition-transform ".concat(m.autoClassify?"translate-x-[22px]":"translate-x-0.5")})})]})]}):(0,a.jsx)("p",{className:"mt-4 text-xs text-gray-500",children:"Unable to fetch configuration."})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,a.jsx)("h2",{className:"text-base font-semibold text-white",children:"Actions"}),(0,a.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"Manage the memory index and data."}),(0,a.jsx)("div",{className:"mt-4 flex flex-wrap gap-2",children:[{action:"reindex",label:"Reindex",description:"Rebuild the vector search index"},{action:"export",label:"Export",description:"Export memories to git branch"},{action:"import",label:"Import",description:"Import memories from git branch"}].map(e=>{let{action:t,label:r}=e;return(0,a.jsxs)("button",{onClick:()=>void C(t,r),disabled:null!==v,className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-xs font-medium text-gray-300 transition-colors hover:bg-surface-700 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",children:[v===t&&(0,a.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),r]},t)})})]})]})}},8984:(e,t,r)=>{"use strict";r.d(t,{XB:()=>l,nu:()=>n,wC:()=>i});var a=r(5271),s=r(3446);function l(){let e=(0,s.yC)(),[t,r]=(0,a.useState)(null),[l,n]=(0,a.useState)(!0),[i,o]=(0,a.useState)(null),c=(0,a.useRef)(null),d=(0,a.useCallback)(async()=>{o(null);try{let t=await e.get("/api/memory/status");return r(t),t}catch(e){return o(e instanceof Error?e.message:"Failed to fetch memory status"),null}finally{n(!1)}},[e]);(0,a.useEffect)(()=>{let e=!1;async function t(){var r;if(e)return;let a=await d();e||(c.current=setTimeout(()=>void t(),null!=(r=null==a?void 0:a.pollIntervalMs)?r:3e4))}return n(!0),t(),()=>{e=!0,c.current&&clearTimeout(c.current)}},[d]);let u=(0,a.useCallback)(async t=>{await e.put("/api/memory/config",{enabled:t}),await d()},[e,d]);return{status:t,loading:l,error:i,refresh:d,toggleEnabled:u}}function n(){let e=(0,s.yC)(),[t,r]=(0,a.useState)([]),[l,n]=(0,a.useState)(!1);return{results:t,searching:l,search:(0,a.useCallback)(async t=>{n(!0);try{var a;let s=(null!=(a=(await e.post("/api/memory/search",{query:t})).results)?a:[]).map(e=>e.entry);return r(s),s}catch(e){return r([]),[]}finally{n(!1)}},[e])}}function i(){let e=(0,s.yC)(),t=(0,a.useCallback)(async(t,r)=>e.post("/api/memory/remember",{summary:t,type:null!=r?r:"CONTEXT"}),[e]),r=(0,a.useCallback)(async t=>e.get("/api/memory/timeline".concat(t?"?limit=".concat(t):"")),[e]);return{remember:t,getTimeline:r,forget:(0,a.useCallback)(async t=>e.post("/api/memory/entries/".concat(t,"/forget")),[e]),runAction:(0,a.useCallback)(async t=>e.post("/api/memory/action",{action:t}),[e])}}}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=5317)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5438],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>n,h:()=>a});var r=s(7811);function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function n(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},2603:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>c});var r=s(8111),a=s(5271),n=s(3446),l=s(7102),i=s(3951),o=s(4632);function c(){let e=(0,n.yC)(),[t,s]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[x,p]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),m=(0,a.useCallback)(async()=>{d(!0),p(null);try{var t;let r=u?"?type=".concat(u):"",a=await e.get("/api/memory/timeline".concat(r));s(null!=(t=a.entries)?t:[])}catch(e){p(e instanceof Error?e.message:"Failed to fetch timeline")}finally{d(!1)}},[e,u]);(0,a.useEffect)(()=>{m()},[m]);let g=(0,a.useCallback)(async t=>{try{await e.delete("/api/memory/entries/".concat(t)),s(e=>e.filter(e=>e.id!==t))}catch(e){}},[e]),f=function(e){let t=new Map;for(let s of e){let e=function(e){let t=new Date(e),s=new Date().getTime()-t.getTime();return s<864e5?"Today":s<1728e5?"Yesterday":s<6048e5?"This Week":t.toLocaleDateString(void 0,{month:"long",day:"numeric",year:"numeric"})}(s.createdAt),r=t.get(e);r?r.push(s):t.set(e,[s])}return Array.from(t.entries()).map(e=>{let[t,s]=e;return{label:t,entries:s}})}(t);return(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Memory Timeline"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Chronological view of all agent memories."})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("select",{value:u,onChange:e=>h(e.target.value),className:"rounded-lg border border-white/[0.08] bg-surface-900 px-3 py-2 text-xs text-white outline-none focus:border-primary-500/50",children:[(0,r.jsx)("option",{value:"",children:"All Types"}),(0,r.jsx)("option",{value:"DECISION",children:"Decision"}),(0,r.jsx)("option",{value:"PATTERN",children:"Pattern"}),(0,r.jsx)("option",{value:"BUG_ROOT_CAUSE",children:"Bug Root Cause"}),(0,r.jsx)("option",{value:"PREFERENCE",children:"Preference"}),(0,r.jsx)("option",{value:"CONSTRAINT",children:"Constraint"}),(0,r.jsx)("option",{value:"CONTEXT",children:"Context"}),(0,r.jsx)("option",{value:"LESSON",children:"Lesson"}),(0,r.jsx)("option",{value:"RELATIONSHIP",children:"Relationship"})]})})]}),c?(0,r.jsx)(i.G,{rows:5}):x?(0,r.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] p-4",children:(0,r.jsx)("p",{className:"text-sm text-red-400",children:x})}):0===t.length?(0,r.jsx)(o.p,{title:"No memories yet",description:u?"No memories of this type found. Try removing the filter.":"Memories will appear here as the agent captures knowledge from sessions.",icon:(0,r.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})})}):(0,r.jsx)("div",{className:"space-y-8",children:f.map(e=>(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-3",children:[(0,r.jsx)("h2",{className:"text-sm font-semibold text-gray-300",children:e.label}),(0,r.jsx)("div",{className:"h-px flex-1 bg-white/[0.04]"}),(0,r.jsxs)("span",{className:"text-[10px] text-gray-600",children:[e.entries.length," ",1===e.entries.length?"entry":"entries"]})]}),(0,r.jsx)("div",{className:"space-y-3",children:e.entries.map(e=>(0,r.jsx)(l._,{entry:e,onForget:g},e.id))})]},e.label))})]})}},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>c,HI:()=>p,Xk:()=>d,yC:()=>x});var r=s(8111),a=s(5271),n=s(422),l=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=l.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,n.h)()}}let o=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,s=(0,a.useMemo)(()=>{let e=(0,n.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(o,{value:s,children:t})}function d(){return(0,a.useContext)(o).mode}function x(){let{localClient:e}=(0,a.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function p(){return(0,a.useContext)(o)}},3951:(e,t,s)=>{"use strict";s.d(t,{G:()=>a});var r=s(8111);function a(e){let{rows:t=3,variant:s="skeleton",className:a=""}=e;return"spinner"===s?(0,r.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(a),children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-3",children:[(0,r.jsx)("div",{className:"h-7 w-7 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Loading..."})]})}):(0,r.jsx)("div",{className:"space-y-3 ".concat(a),children:Array.from({length:t}).map((e,t)=>(0,r.jsx)("div",{className:"animate-pulse rounded-xl border border-white/[0.04] bg-surface-800/50 p-4",children:(0,r.jsxs)("div",{className:"flex items-center gap-4",children:[(0,r.jsx)("div",{className:"h-8 w-8 rounded-lg bg-white/[0.06]"}),(0,r.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,r.jsx)("div",{className:"h-3.5 w-1/3 rounded bg-white/[0.06]"}),(0,r.jsx)("div",{className:"h-3 w-2/3 rounded bg-white/[0.04]"})]}),(0,r.jsx)("div",{className:"h-5 w-16 rounded-full bg-white/[0.04]"})]})},t))})}},4616:(e,t,s)=>{Promise.resolve().then(s.bind(s,2603))},4632:(e,t,s)=>{"use strict";s.d(t,{p:()=>n});var r=s(8111);function a(){return(0,r.jsx)("svg",{className:"h-10 w-10 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 7.5l-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m6 4.125 2.25 2.25m0 0 2.25 2.25M12 13.875l2.25-2.25M12 13.875l-2.25 2.25M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})})}function n(e){let{icon:t,title:s,description:n,action:l,className:i=""}=e;return(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center rounded-2xl border border-dashed border-white/[0.06] bg-surface-800/30 px-6 py-16 text-center ".concat(i),children:[(0,r.jsx)("div",{className:"mb-4",children:null!=t?t:(0,r.jsx)(a,{})}),(0,r.jsx)("h3",{className:"text-sm font-medium text-gray-300",children:s}),n&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:n}),l&&(0,r.jsx)("button",{onClick:l.onClick,className:"mt-5 rounded-lg bg-primary-500 px-4 py-2 text-xs font-semibold text-white transition-colors hover:bg-primary-600",children:l.label})]})}},7102:(e,t,s)=>{"use strict";s.d(t,{_:()=>o});var r=s(8111),a=s(5271);let n={DECISION:"bg-blue-500/15 text-blue-400 border-blue-500/20",PATTERN:"bg-green-500/15 text-green-400 border-green-500/20",BUG_ROOT_CAUSE:"bg-red-500/15 text-red-400 border-red-500/20",PREFERENCE:"bg-yellow-500/15 text-yellow-400 border-yellow-500/20",CONSTRAINT:"bg-orange-500/15 text-orange-400 border-orange-500/20",CONTEXT:"bg-purple-500/15 text-purple-400 border-purple-500/20",LESSON:"bg-pink-500/15 text-pink-400 border-pink-500/20",RELATIONSHIP:"bg-cyan-500/15 text-cyan-400 border-cyan-500/20"},l={critical:"text-red-400",high:"text-orange-400",medium:"text-yellow-400",low:"text-gray-500"};function i(e){var t;let{type:s}=e,a=null!=(t=n[s])?t:"bg-gray-500/15 text-gray-400 border-gray-500/20";return(0,r.jsx)("span",{className:"inline-flex items-center rounded-full border px-2 py-0.5 text-[10px] font-semibold uppercase tracking-wide ".concat(a),children:s.replace(/_/g," ")})}function o(e){var t,s,n,o;let{entry:c,score:d,onForget:x}=e,[p,u]=(0,a.useState)(!1),h=!!c.detail,m=(null==(t=c.relatedFiles)?void 0:t.length)>0,g=h||m;return(0,r.jsxs)("div",{className:"rounded-xl border bg-surface-800/50 p-4 space-y-2 transition-colors ".concat(g?"cursor-pointer hover:border-white/[0.08]":""," ").concat(p?"border-primary-500/30":"border-white/[0.04]"),onClick:()=>g&&u(e=>!e),children:[(0,r.jsxs)("div",{className:"flex items-start justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[g&&(0,r.jsx)("svg",{className:"h-3.5 w-3.5 text-gray-500 transition-transform ".concat(p?"rotate-0":"-rotate-90"),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})}),(0,r.jsx)(i,{type:c.type}),(0,r.jsx)("span",{className:"text-xs font-medium ".concat(l[c.importance]),children:c.importance}),void 0!==d&&(0,r.jsxs)("span",{className:"text-xs font-medium text-primary-400",children:[(100*d).toFixed(0),"% match"]})]}),x&&(0,r.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),x(c.id)},className:"rounded px-1.5 py-0.5 text-[10px] text-gray-600 transition-colors hover:bg-red-500/10 hover:text-red-400",title:"Mark as superseded",children:"forget"})]}),(0,r.jsx)("p",{className:"text-sm leading-relaxed text-gray-200",children:c.summary}),h&&(0,r.jsx)("p",{className:"text-xs leading-relaxed text-gray-400 whitespace-pre-wrap ".concat(p?"":"line-clamp-2"),children:c.detail}),p&&(0,r.jsxs)("div",{className:"space-y-2 border-t border-white/[0.04] pt-2",children:[m&&(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-600",children:"Related Files"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.relatedFiles.map(e=>(0,r.jsx)("span",{className:"inline-flex items-center gap-1 rounded bg-surface-800 px-2 py-0.5 font-mono text-[11px] text-gray-400",children:e.split("/").pop()},e))})]}),(null==(s=c.tags)?void 0:s.length)>0&&(0,r.jsxs)("div",{className:"space-y-1",children:[(0,r.jsx)("p",{className:"text-[10px] font-semibold uppercase tracking-wide text-gray-600",children:"Tags"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:c.tags.map(e=>(0,r.jsxs)("span",{className:"inline-flex items-center rounded-full bg-surface-800 px-2 py-0.5 text-[10px] text-gray-400",children:["#",e]},e))})]}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-x-4 gap-y-1 pt-1 text-[11px] text-gray-600",children:[(null==(n=c.source)?void 0:n.sessionId)&&(0,r.jsxs)("span",{children:["Session: ",c.source.sessionId.slice(0,12),"..."]}),(0,r.jsxs)("span",{children:["Created: ",new Date(c.createdAt).toLocaleString()]}),(0,r.jsxs)("span",{className:"font-mono text-[10px]",children:["ID: ",c.id.slice(0,12)]})]})]}),!p&&(0,r.jsxs)("div",{className:"flex flex-wrap items-center gap-3 text-xs text-gray-600",children:[(null==(o=c.tags)?void 0:o.length)>0&&(0,r.jsxs)("span",{children:["#",c.tags.slice(0,3).join(", #"),c.tags.length>3&&" +".concat(c.tags.length-3)]}),(0,r.jsx)("span",{children:function(e){let t=new Date(e);if(isNaN(t.getTime()))return e;let s=Date.now()-t.getTime();return s<6e4?"just now":s<36e5?"".concat(Math.floor(s/6e4),"m ago"):s<864e5?"".concat(Math.floor(s/36e5),"h ago"):s<6048e5?"".concat(Math.floor(s/864e5),"d ago"):t.toLocaleDateString()}(c.createdAt)}),m&&(0,r.jsxs)("span",{children:[c.relatedFiles.length," files"]})]})]})}}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=4616)),_N_E=e.O()}]);