@ulpi/cli 0.1.10 → 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 (199) hide show
  1. package/dist/{chunk-F32YQRFR.js → chunk-3YFN5ZOR.js} +1 -1
  2. package/dist/{ci-QBXWR3GW.js → ci-EXYAXQVI.js} +1 -1
  3. package/dist/{doctor-SRJIZM2T.js → doctor-2EHFGL6W.js} +1 -1
  4. package/dist/{history-UGYO7Z3U.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 +107 -107
  8. package/dist/portal/apps/portal/.next/app-path-routes-manifest.json +18 -18
  9. package/dist/portal/apps/portal/.next/build-manifest.json +2 -2
  10. package/dist/portal/apps/portal/.next/prerender-manifest.json +109 -109
  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.js +1 -1
  16. package/dist/portal/apps/portal/.next/server/app/(dashboard)/history/page_client-reference-manifest.js +1 -1
  17. package/dist/portal/apps/portal/.next/server/app/(dashboard)/jobs/[id]/page_client-reference-manifest.js +1 -1
  18. package/dist/portal/apps/portal/.next/server/app/(dashboard)/jobs/page_client-reference-manifest.js +1 -1
  19. package/dist/portal/apps/portal/.next/server/app/(dashboard)/loop/page.js +1 -1
  20. package/dist/portal/apps/portal/.next/server/app/(dashboard)/loop/page_client-reference-manifest.js +1 -1
  21. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/[name]/page_client-reference-manifest.js +1 -1
  22. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/catalog/page_client-reference-manifest.js +1 -1
  23. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/page_client-reference-manifest.js +1 -1
  24. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/secrets/page_client-reference-manifest.js +1 -1
  25. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/submissions/page_client-reference-manifest.js +1 -1
  26. package/dist/portal/apps/portal/.next/server/app/(dashboard)/mcps/usage/page_client-reference-manifest.js +1 -1
  27. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/page_client-reference-manifest.js +1 -1
  28. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/settings/page_client-reference-manifest.js +1 -1
  29. package/dist/portal/apps/portal/.next/server/app/(dashboard)/memory/timeline/page_client-reference-manifest.js +1 -1
  30. package/dist/portal/apps/portal/.next/server/app/(dashboard)/notifications/page_client-reference-manifest.js +1 -1
  31. package/dist/portal/apps/portal/.next/server/app/(dashboard)/parallel/page.js +1 -1
  32. package/dist/portal/apps/portal/.next/server/app/(dashboard)/parallel/page_client-reference-manifest.js +1 -1
  33. package/dist/portal/apps/portal/.next/server/app/(dashboard)/prd/page_client-reference-manifest.js +1 -1
  34. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/[id]/guards/page_client-reference-manifest.js +1 -1
  35. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/[id]/page_client-reference-manifest.js +1 -1
  36. package/dist/portal/apps/portal/.next/server/app/(dashboard)/repos/page_client-reference-manifest.js +1 -1
  37. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/config/page_client-reference-manifest.js +1 -1
  38. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/page_client-reference-manifest.js +1 -1
  39. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/plan/page_client-reference-manifest.js +1 -1
  40. package/dist/portal/apps/portal/.next/server/app/(dashboard)/review/queue/page_client-reference-manifest.js +1 -1
  41. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/[id]/page_client-reference-manifest.js +1 -1
  42. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/new/page_client-reference-manifest.js +1 -1
  43. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/page_client-reference-manifest.js +1 -1
  44. package/dist/portal/apps/portal/.next/server/app/(dashboard)/rules/pipelines/page_client-reference-manifest.js +1 -1
  45. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sessions/[sessionId]/page_client-reference-manifest.js +1 -1
  46. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sessions/page.js +1 -1
  47. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sessions/page_client-reference-manifest.js +1 -1
  48. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/github/page_client-reference-manifest.js +1 -1
  49. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/installations/page_client-reference-manifest.js +1 -1
  50. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/keys/page_client-reference-manifest.js +1 -1
  51. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/members/page_client-reference-manifest.js +1 -1
  52. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/orgs/new/page_client-reference-manifest.js +1 -1
  53. package/dist/portal/apps/portal/.next/server/app/(dashboard)/settings/page_client-reference-manifest.js +1 -1
  54. package/dist/portal/apps/portal/.next/server/app/(dashboard)/skills/page_client-reference-manifest.js +1 -1
  55. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sprints/[batchId]/page_client-reference-manifest.js +1 -1
  56. package/dist/portal/apps/portal/.next/server/app/(dashboard)/sprints/page_client-reference-manifest.js +1 -1
  57. package/dist/portal/apps/portal/.next/server/app/(dashboard)/templates/page_client-reference-manifest.js +1 -1
  58. package/dist/portal/apps/portal/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  59. package/dist/portal/apps/portal/.next/server/app/_not-found.html +1 -1
  60. package/dist/portal/apps/portal/.next/server/app/_not-found.rsc +1 -1
  61. package/dist/portal/apps/portal/.next/server/app/auth/callback/page_client-reference-manifest.js +1 -1
  62. package/dist/portal/apps/portal/.next/server/app/auth/callback.html +1 -1
  63. package/dist/portal/apps/portal/.next/server/app/auth/callback.rsc +1 -1
  64. package/dist/portal/apps/portal/.next/server/app/billing.html +1 -1
  65. package/dist/portal/apps/portal/.next/server/app/billing.rsc +3 -3
  66. package/dist/portal/apps/portal/.next/server/app/codemap.html +1 -1
  67. package/dist/portal/apps/portal/.next/server/app/codemap.rsc +3 -3
  68. package/dist/portal/apps/portal/.next/server/app/dashboard.html +1 -1
  69. package/dist/portal/apps/portal/.next/server/app/dashboard.rsc +3 -3
  70. package/dist/portal/apps/portal/.next/server/app/history.html +1 -1
  71. package/dist/portal/apps/portal/.next/server/app/history.rsc +3 -3
  72. package/dist/portal/apps/portal/.next/server/app/jobs.html +1 -1
  73. package/dist/portal/apps/portal/.next/server/app/jobs.rsc +3 -3
  74. package/dist/portal/apps/portal/.next/server/app/loop.html +1 -1
  75. package/dist/portal/apps/portal/.next/server/app/loop.rsc +3 -3
  76. package/dist/portal/apps/portal/.next/server/app/mcps/catalog.html +1 -1
  77. package/dist/portal/apps/portal/.next/server/app/mcps/catalog.rsc +3 -3
  78. package/dist/portal/apps/portal/.next/server/app/mcps/secrets.html +1 -1
  79. package/dist/portal/apps/portal/.next/server/app/mcps/secrets.rsc +3 -3
  80. package/dist/portal/apps/portal/.next/server/app/mcps/submissions.html +1 -1
  81. package/dist/portal/apps/portal/.next/server/app/mcps/submissions.rsc +3 -3
  82. package/dist/portal/apps/portal/.next/server/app/mcps/usage.html +1 -1
  83. package/dist/portal/apps/portal/.next/server/app/mcps/usage.rsc +3 -3
  84. package/dist/portal/apps/portal/.next/server/app/mcps.html +1 -1
  85. package/dist/portal/apps/portal/.next/server/app/mcps.rsc +3 -3
  86. package/dist/portal/apps/portal/.next/server/app/memory/settings.html +1 -1
  87. package/dist/portal/apps/portal/.next/server/app/memory/settings.rsc +3 -3
  88. package/dist/portal/apps/portal/.next/server/app/memory/timeline.html +1 -1
  89. package/dist/portal/apps/portal/.next/server/app/memory/timeline.rsc +3 -3
  90. package/dist/portal/apps/portal/.next/server/app/memory.html +1 -1
  91. package/dist/portal/apps/portal/.next/server/app/memory.rsc +3 -3
  92. package/dist/portal/apps/portal/.next/server/app/notifications.html +1 -1
  93. package/dist/portal/apps/portal/.next/server/app/notifications.rsc +3 -3
  94. package/dist/portal/apps/portal/.next/server/app/parallel.html +1 -1
  95. package/dist/portal/apps/portal/.next/server/app/parallel.rsc +3 -3
  96. package/dist/portal/apps/portal/.next/server/app/prd.html +1 -1
  97. package/dist/portal/apps/portal/.next/server/app/prd.rsc +3 -3
  98. package/dist/portal/apps/portal/.next/server/app/repos.html +1 -1
  99. package/dist/portal/apps/portal/.next/server/app/repos.rsc +3 -3
  100. package/dist/portal/apps/portal/.next/server/app/review/config.html +1 -1
  101. package/dist/portal/apps/portal/.next/server/app/review/config.rsc +3 -3
  102. package/dist/portal/apps/portal/.next/server/app/review/plan.html +1 -1
  103. package/dist/portal/apps/portal/.next/server/app/review/plan.rsc +3 -3
  104. package/dist/portal/apps/portal/.next/server/app/review/queue.html +1 -1
  105. package/dist/portal/apps/portal/.next/server/app/review/queue.rsc +3 -3
  106. package/dist/portal/apps/portal/.next/server/app/review.html +1 -1
  107. package/dist/portal/apps/portal/.next/server/app/review.meta +2 -0
  108. package/dist/portal/apps/portal/.next/server/app/review.rsc +2 -2
  109. package/dist/portal/apps/portal/.next/server/app/rules/new.html +1 -1
  110. package/dist/portal/apps/portal/.next/server/app/rules/new.rsc +3 -3
  111. package/dist/portal/apps/portal/.next/server/app/rules/pipelines.html +1 -1
  112. package/dist/portal/apps/portal/.next/server/app/rules/pipelines.rsc +3 -3
  113. package/dist/portal/apps/portal/.next/server/app/rules.html +1 -1
  114. package/dist/portal/apps/portal/.next/server/app/rules.rsc +3 -3
  115. package/dist/portal/apps/portal/.next/server/app/sessions.html +1 -1
  116. package/dist/portal/apps/portal/.next/server/app/sessions.rsc +3 -3
  117. package/dist/portal/apps/portal/.next/server/app/settings/github.html +1 -1
  118. package/dist/portal/apps/portal/.next/server/app/settings/github.rsc +3 -3
  119. package/dist/portal/apps/portal/.next/server/app/settings/installations.html +1 -1
  120. package/dist/portal/apps/portal/.next/server/app/settings/installations.rsc +2 -2
  121. package/dist/portal/apps/portal/.next/server/app/settings/keys.html +1 -1
  122. package/dist/portal/apps/portal/.next/server/app/settings/keys.rsc +3 -3
  123. package/dist/portal/apps/portal/.next/server/app/settings/members.html +1 -1
  124. package/dist/portal/apps/portal/.next/server/app/settings/members.rsc +3 -3
  125. package/dist/portal/apps/portal/.next/server/app/settings/orgs/new.html +1 -1
  126. package/dist/portal/apps/portal/.next/server/app/settings/orgs/new.rsc +3 -3
  127. package/dist/portal/apps/portal/.next/server/app/settings.html +1 -1
  128. package/dist/portal/apps/portal/.next/server/app/settings.rsc +3 -3
  129. package/dist/portal/apps/portal/.next/server/app/skills.html +1 -1
  130. package/dist/portal/apps/portal/.next/server/app/skills.rsc +3 -3
  131. package/dist/portal/apps/portal/.next/server/app/sprints.html +1 -1
  132. package/dist/portal/apps/portal/.next/server/app/sprints.rsc +3 -3
  133. package/dist/portal/apps/portal/.next/server/app/templates.html +1 -1
  134. package/dist/portal/apps/portal/.next/server/app/templates.rsc +3 -3
  135. package/dist/portal/apps/portal/.next/server/app-paths-manifest.json +18 -18
  136. package/dist/portal/apps/portal/.next/server/chunks/1522.js +1 -1
  137. package/dist/portal/apps/portal/.next/server/next-font-manifest.js +1 -1
  138. package/dist/portal/apps/portal/.next/server/next-font-manifest.json +1 -1
  139. package/dist/portal/apps/portal/.next/server/pages/404.html +1 -1
  140. package/dist/portal/apps/portal/.next/server/pages/500.html +1 -1
  141. package/dist/portal/apps/portal/.next/server/pages-manifest.json +1 -1
  142. package/dist/portal/apps/portal/.next/static/chunks/380-71bdca6a9260da3e.js +1 -0
  143. package/dist/portal/apps/portal/.next/static/chunks/7525-85f4ca4276511230.js +1 -0
  144. package/dist/portal/apps/portal/.next/static/chunks/7889-a8be276e20a74863.js +1 -0
  145. package/dist/portal/apps/portal/.next/static/chunks/8744-29d969a2ddf40afe.js +1 -0
  146. package/dist/portal/apps/portal/.next/static/chunks/{8934-bb365eb647fb2d5a.js → 8934-9fbad2b348b6ada1.js} +1 -1
  147. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/codemap/page-e85b24075b2ae8e9.js +1 -0
  148. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/dashboard/page-701be25e4930fcb6.js +1 -0
  149. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/history/{page-264989cf873cd3de.js → page-0275ca43fdd64bf2.js} +1 -1
  150. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/layout-4232b69653c5fbbf.js +1 -0
  151. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/loop/page-c3f658ffb8d7397b.js +1 -0
  152. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/[name]/page-f5283ca4a2a1141b.js +1 -0
  153. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/catalog/page-9b228ecfe1982eba.js +1 -0
  154. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/page-d8028301dcd11348.js +1 -0
  155. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/page-34fe9bf93ef853d0.js +1 -0
  156. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/settings/page-5c9c471c9425d814.js +1 -0
  157. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/timeline/page-590f707b60b9ba47.js +1 -0
  158. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/notifications/page-46a9b033af7430e6.js +1 -0
  159. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/parallel/{page-85690140ff82dd58.js → page-49a26690ced20482.js} +1 -1
  160. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/repos/page-155cd1007250e5da.js +1 -0
  161. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/config/page-5ffb558d24a57b2c.js +1 -0
  162. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/queue/page-9fe0df848d23c383.js +1 -0
  163. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/page-e17685f3220da942.js +1 -0
  164. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/pipelines/page-589f30a41f066568.js +1 -0
  165. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/sessions/page-4ff5d7490cc0d260.js +1 -0
  166. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/settings/page-045a30e0bd843279.js +1 -0
  167. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/skills/page-2bd816bd8e62dc04.js +1 -0
  168. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/templates/page-28a51e2788c5798d.js +1 -0
  169. package/dist/portal/package.json +1 -1
  170. package/dist/{start-DWZHVBUO.js → start-6SLTMLI4.js} +1 -1
  171. package/dist/{update-IBPDEBEK.js → update-563P3ZIS.js} +1 -1
  172. package/dist/{version-checker-XKFQNN3I.js → version-checker-JHHM4OTR.js} +1 -1
  173. package/package.json +6 -6
  174. package/dist/portal/apps/portal/.next/static/chunks/380-52bab5fc966d7cf9.js +0 -1
  175. package/dist/portal/apps/portal/.next/static/chunks/7525-d6350803a451284c.js +0 -1
  176. package/dist/portal/apps/portal/.next/static/chunks/7889-a3331988a8344d05.js +0 -1
  177. package/dist/portal/apps/portal/.next/static/chunks/8744-d545a53c9709467b.js +0 -1
  178. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/codemap/page-bf1ece66c1b05822.js +0 -1
  179. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/dashboard/page-936391d6b330f0cc.js +0 -1
  180. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/layout-05fc9732a636a609.js +0 -1
  181. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/loop/page-faeaacd95742c754.js +0 -1
  182. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/[name]/page-f24841b78e8c05c0.js +0 -1
  183. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/catalog/page-2ff0e6b6a5d76dac.js +0 -1
  184. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/mcps/page-2476b9c29c44c372.js +0 -1
  185. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/page-79f977cd348c57ae.js +0 -1
  186. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/settings/page-a3be96ef297c8e33.js +0 -1
  187. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/memory/timeline/page-30db4506366d09f4.js +0 -1
  188. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/notifications/page-df5f393a51d8e17b.js +0 -1
  189. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/repos/page-a0bcc68a119f63e1.js +0 -1
  190. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/config/page-770321f5a71a29a3.js +0 -1
  191. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/review/queue/page-33687733a5398264.js +0 -1
  192. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/page-ac19551ab9f2128d.js +0 -1
  193. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/rules/pipelines/page-96ecfcce3a60ebb2.js +0 -1
  194. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/sessions/page-6b199747e9f587de.js +0 -1
  195. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/settings/page-ec4076cedf8df275.js +0 -1
  196. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/skills/page-81f63d5d894b0b03.js +0 -1
  197. package/dist/portal/apps/portal/.next/static/chunks/app/(dashboard)/templates/page-263e03b6690d36f5.js +0 -1
  198. /package/dist/portal/apps/portal/.next/static/{02AzZdYDA5HVAwITp37Ql → p-7mo3JdIgTzhlpqhShmK}/_buildManifest.js +0 -0
  199. /package/dist/portal/apps/portal/.next/static/{02AzZdYDA5HVAwITp37Ql → p-7mo3JdIgTzhlpqhShmK}/_ssgManifest.js +0 -0
@@ -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})]})}},4721:(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"]})]})]})}},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(4721);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})]})}},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(4721),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})]})}},4721:(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()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[317],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>l,h:()=>n});var r=s(7811);function n(){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")}},3025:(e,t,s)=>{"use strict";s.d(t,{s:()=>l});var r=s(8111),n=s(3446);function l(e){let{children:t,featureName:s="This feature"}=e;return"cloud"===(0,n.Xk)()?(0,r.jsx)("div",{className:"space-y-6",children:(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-8 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:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})}),(0,r.jsxs)("p",{className:"mt-3 text-sm text-gray-400",children:[s," is available in local mode."]}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-600",children:"Connect to a local ULPI API server to use this feature."})]})}):(0,r.jsx)(r.Fragment,{children:t})}},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>c,HI:()=>x,Xk:()=>d,yC:()=>u});var r=s(8111),n=s(5271),l=s(422),a=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=a.env.NEXT_PUBLIC_ULPI_API_SECRET,n=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...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,l.h)()}}let o=(0,n.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,s=(0,n.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,n.useContext)(o).mode}function u(){let{localClient:e}=(0,n.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,n.useContext)(o)}},3951:(e,t,s)=>{"use strict";s.d(t,{G:()=>n});var r=s(8111);function n(e){let{rows:t=3,variant:s="skeleton",className:n=""}=e;return"spinner"===s?(0,r.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(n),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(n),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))})}},6892:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>g});var r=s(8111),n=s(5271),l=s(3446),a=s(3951),i=s(3025);let o=[{key:"permission_prompt",label:"Permission Prompt",description:"When a tool requests permission that needs user approval",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"})}),defaultUrgency:"critical",detection:"Sent by Claude Code"},{key:"idle_prompt",label:"Idle Prompt",description:"When the session is idle and waiting for user input",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:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),defaultUrgency:"low",detection:"Sent by Claude Code"}],c=[{key:"task_complete",label:"Task Complete",description:"When a coding task finishes successfully",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.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),defaultUrgency:"low",detection:"Detected at session end"},{key:"task_failed",label:"Task Failed",description:"When a coding task fails or encounters an error",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.75 9.75 4.5 4.5m0-4.5-4.5 4.5M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})}),defaultUrgency:"high",detection:"Detected from postcondition failures"},{key:"rule_blocked",label:"Rule Blocked",description:"When a rule blocks an action from proceeding",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:"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"})}),defaultUrgency:"high",detection:"Detected from rule evaluation"},{key:"repeated_failures",label:"Repeated Failures",description:"When multiple failures occur in quick succession",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:"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"})}),defaultUrgency:"high",detection:"Triggered when consecutive blocks exceed threshold"},{key:"rapid_permission_requests",label:"Rapid Permission Requests",description:"When many permission prompts fire rapidly",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 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})}),defaultUrgency:"critical",detection:"Triggered when permission rate exceeds threshold"},{key:"sensitive_path_access",label:"Sensitive Path Access",description:"When a sensitive file path is accessed",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:"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"})}),defaultUrgency:"high",detection:"Triggered by file pattern matching"}],d={critical:"bg-red-500/15 text-red-400",high:"bg-amber-500/15 text-amber-400",low:"bg-surface-800 text-gray-500"},u=["critical","high","low"],x=[{type:"desktop",label:"Desktop",icon:(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:"M9 17.25v1.007a3 3 0 0 1-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0 1 15 18.257V17.25m6-12V15a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 15V5.25m18 0A2.25 2.25 0 0 0 18.75 3H5.25A2.25 2.25 0 0 0 3 5.25m18 0V12a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 12V5.25"})})},{type:"terminal",label:"Terminal",icon:(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:"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"})})},{type:"webhook",label:"Webhook",icon:(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.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"})})},{type:"log",label:"Log",icon:(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:"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"})})}];function h(){return{dedup_window_seconds:30,permission_prompt:{urgency:"critical",notify:[{type:"desktop"},{type:"terminal"}]},task_complete:{urgency:"low",notify:[{type:"terminal"}]},task_failed:{urgency:"high",notify:[{type:"desktop"},{type:"terminal"}]},rule_blocked:{urgency:"high",notify:[{type:"terminal"}]}}}function m(e){let{checked:t,onChange:s,label:n}=e;return(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":t,"aria-label":n,onClick:s,className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ".concat(t?"bg-primary-500":"bg-surface-700"),children:(0,r.jsx)("span",{className:"pointer-events-none inline-block h-4 w-4 rounded-full bg-white shadow-sm transition-transform ".concat(t?"translate-x-4":"translate-x-0")})})}function p(e){var t,s,n,l,a,i,o,c,h,p,g,y,f,b,v,j;let{meta:k,config:w,expanded:N,onToggleExpand:_,onUpdateConfig:C}=e,L=null!=(n=null==w?void 0:w.urgency)?n:k.defaultUrgency,U=null!=(l=null==w?void 0:w.notify)?l:[],I=void 0!==w,W=null!=(a=null==w?void 0:w.threshold)?a:3,A=null!=(i=null==w?void 0:w.window_seconds)?i:60,S=null!=(o=null==w?void 0:w.file_patterns)?o:[],B=(e,t,s)=>{var r,n;let l=(null!=(r=null==w?void 0:w.notify)?r:[]).map(r=>r.type===e?{...r,[t]:s}:r);C(k.key,{...w,urgency:null!=(n=null==w?void 0:w.urgency)?n:k.defaultUrgency,notify:l})},E=(e,t)=>{var s,r;C(k.key,{...w,urgency:null!=(s=null==w?void 0:w.urgency)?s:k.defaultUrgency,notify:null!=(r=null==w?void 0:w.notify)?r:[],[e]:t})},T=null!=(c=null==w?void 0:w.act)?c:{},M=(e,t)=>{var s,r,n;let l={...null!=(s=null==w?void 0:w.act)?s:{}};void 0===t||""===t||!1===t||0===t?delete l[e]:l[e]=t,C(k.key,{...w,urgency:null!=(r=null==w?void 0:w.urgency)?r:k.defaultUrgency,notify:null!=(n=null==w?void 0:w.notify)?n:[],act:Object.keys(l).length>0?l:void 0})},P=(e,t)=>{var s;M("rate_limit",{...null!=(s=T.rate_limit)?s:{threshold:5,window_seconds:60},[e]:t})};return(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 overflow-hidden",children:[(0,r.jsxs)("button",{type:"button",onClick:_,"aria-expanded":N,className:"flex w-full items-center gap-3 p-4 text-left transition-colors hover:bg-white/[0.02]",children:[(0,r.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-surface-800 text-gray-500",children:k.icon}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 mb-0.5",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-white",children:k.label}),I&&(0,r.jsx)("span",{className:"inline-flex items-center rounded-full px-2 py-0.5 text-[10px] font-medium uppercase tracking-wider ".concat(d[L]),children:L})]}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:k.description}),(0,r.jsx)("p",{className:"text-[10px] text-gray-600 mt-0.5",children:k.detection})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[I&&U.length>0&&(0,r.jsx)("div",{className:"hidden sm:flex gap-1",children:U.map(e=>(0,r.jsx)("span",{className:"rounded-full bg-surface-800 px-2 py-0.5 text-[10px] text-gray-500",children:e.type},e.type))}),!I&&(0,r.jsx)("span",{className:"text-[10px] text-gray-600",children:"Not configured"}),(0,r.jsx)("svg",{className:"h-4 w-4 text-gray-600 transition-transform ".concat(N?"rotate-90":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})]})]}),N&&(0,r.jsxs)("div",{className:"border-t border-white/[0.04] p-4 space-y-5",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Urgency"}),(0,r.jsx)("div",{className:"flex gap-2",children:u.map(e=>(0,r.jsx)("button",{type:"button",onClick:()=>(e=>{var t;let s={urgency:e,notify:null!=(t=null==w?void 0:w.notify)?t:[],repeat_interval_seconds:null==w?void 0:w.repeat_interval_seconds,act:null==w?void 0:w.act};C(k.key,s)})(e),className:"rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ".concat(L===e?d[e]+" ring-1 ring-current":"bg-surface-800 text-gray-600 hover:text-gray-400"),children:e},e))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-2",children:"Notification Channels"}),(0,r.jsx)("div",{className:"space-y-3",children:x.map(e=>{var t,s,n,l,a,i;let o=(l=e.type,null!=(a=null==U?void 0:U.some(e=>e.type===l))&&a),c=(i=e.type,null==U?void 0:U.find(e=>e.type===i));return(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-gray-500",children:e.icon}),(0,r.jsx)("span",{className:"text-sm text-gray-200",children:e.label})]}),(0,r.jsx)(m,{checked:o,onChange:()=>(e=>{var t,s;let r,n=null!=(t=null==w?void 0:w.notify)?t:[];r=n.some(t=>t.type===e)?n.filter(t=>t.type!==e):[...n,{type:e}],C(k.key,{...w,urgency:null!=(s=null==w?void 0:w.urgency)?s:k.defaultUrgency,notify:r})})(e.type),label:"Toggle ".concat(e.label," channel")})]}),o&&"webhook"===e.type&&(0,r.jsx)("div",{className:"mt-2 ml-6",children:(0,r.jsx)("input",{type:"url",placeholder:"https://hooks.slack.com/...",value:null!=(t=null==c?void 0:c.url)?t:"",onChange:t=>B(e.type,"url",t.target.value),className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})}),o&&"log"===e.type&&(0,r.jsx)("div",{className:"mt-2 ml-6",children:(0,r.jsx)("input",{type:"text",placeholder:"~/.ulpi/notifications.log",value:null!=(s=null==c?void 0:c.path)?s:"",onChange:t=>B(e.type,"path",t.target.value),className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 font-mono text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})}),o&&("desktop"===e.type||"terminal"===e.type)&&(0,r.jsxs)("div",{className:"mt-2 ml-6 flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"Sound"}),(0,r.jsx)(m,{checked:null!=(n=null==c?void 0:c.sound)&&n,onChange:()=>{var t;return B(e.type,"sound",!(null!=(t=null==c?void 0:c.sound)&&t))},label:"Toggle sound"})]})]},e.type)})})]}),"repeated_failures"===k.key&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Failure Threshold"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:1,max:50,value:W,onChange:e=>E("threshold",parseInt(e.target.value,10)||3),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"consecutive blocks before alert"})]})]}),"rapid_permission_requests"===k.key&&(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Request Threshold"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:1,max:100,value:W,onChange:e=>E("threshold",parseInt(e.target.value,10)||5),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"requests within window"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Window (seconds)"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:5,max:600,value:A,onChange:e=>E("window_seconds",parseInt(e.target.value,10)||60),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"second detection window"})]})]})]}),"sensitive_path_access"===k.key&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"File Patterns (comma-separated)"}),(0,r.jsx)("textarea",{rows:3,placeholder:".env*, **/secrets/*, **/credentials*",value:S.join(", "),onChange:e=>E("file_patterns",e.target.value.split(",").map(e=>e.trim()).filter(Boolean)),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 resize-none"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-1.5",children:"Repeat Interval"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:0,max:3600,value:null!=(h=null==w?void 0:w.repeat_interval_seconds)?h:0,onChange:e=>{var t,s,r;return t=parseInt(e.target.value,10)||0,void C(k.key,{...w,urgency:null!=(s=null==w?void 0:w.urgency)?s:k.defaultUrgency,notify:null!=(r=null==w?void 0:w.notify)?r:[],repeat_interval_seconds:t||void 0})},className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"seconds (0 = no repeat)"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-xs font-medium text-gray-400 mb-3",children:"Actions"}),(0,r.jsxs)("div",{className:"space-y-3 ml-1",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[11px] text-gray-600 mb-1",children:"Inject Skill"}),(0,r.jsx)("input",{type:"text",placeholder:"path/to/skill.md or bundled skill name",value:null!=(p=T.inject_skill)?p:"",onChange:e=>M("inject_skill",e.target.value||void 0),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"})]}),("rule_blocked"===k.key||"repeated_failures"===k.key)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[11px] text-gray-600 mb-1",children:"Inject Skill on Retry"}),(0,r.jsx)("input",{type:"text",placeholder:"Skill to inject when retrying after block",value:null!=(g=T.inject_skill_on_retry)?g:"",onChange:e=>M("inject_skill_on_retry",e.target.value||void 0),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"})]}),"repeated_failures"===k.key&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[11px] text-gray-600 mb-1",children:"Inject Skill After N Blocks"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:1,max:50,value:null!=(y=T.inject_skill_after_n_blocks)?y:"",onChange:e=>M("inject_skill_after_n_blocks",parseInt(e.target.value,10)||void 0),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"consecutive blocks before skill injection"})]})]}),("rule_blocked"===k.key||"repeated_failures"===k.key)&&(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[11px] text-gray-600 mb-1",children:"Alert Escalation After N Blocks"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:1,max:50,value:null!=(f=T.alert_after_n_blocks)?f:"",onChange:e=>M("alert_after_n_blocks",parseInt(e.target.value,10)||void 0),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"blocks before escalating to extra channels"})]})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("label",{className:"block text-[11px] text-gray-600 mb-1",children:"Rate Limit"}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:1,max:100,value:null!=(b=null==(t=T.rate_limit)?void 0:t.threshold)?b:"",placeholder:"5",onChange:e=>P("threshold",parseInt(e.target.value,10)||5),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"per"}),(0,r.jsx)("input",{type:"number",min:5,max:3600,value:null!=(v=null==(s=T.rate_limit)?void 0:s.window_seconds)?v:"",placeholder:"60",onChange:e=>P("window_seconds",parseInt(e.target.value,10)||60),className:"w-20 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"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"seconds"})]})]}),("rule_blocked"===k.key||"task_failed"===k.key||"repeated_failures"===k.key)&&(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-sm text-gray-200",children:"Log Failure Details"}),(0,r.jsx)("p",{className:"text-xs text-gray-500",children:"Log extra context (tool input, state) to notification log"})]}),(0,r.jsx)(m,{checked:null!=(j=T.log_failure_details)&&j,onChange:()=>{var e;return M("log_failure_details",!(null!=(e=T.log_failure_details)&&e))},label:"Toggle failure details logging"})]})]})]})]})]})}function g(){return(0,r.jsx)(i.s,{featureName:"Notifications",children:(0,r.jsx)(y,{})})}function y(){let e=(0,l.yC)(),[t,s]=(0,n.useState)(null),[i,d]=(0,n.useState)(!0),[u,x]=(0,n.useState)(null),[m,g]=(0,n.useState)(!1),[y,f]=(0,n.useState)(!1),[b,v]=(0,n.useState)(null),[j,k]=(0,n.useState)(!1),w=(0,n.useCallback)(async()=>{d(!0),x(null),f(!1),v(null);try{let t=await e.get("/api/responses");s(t)}catch(e){e instanceof Error&&e.message.includes("404")?s(null):x(e instanceof Error?e.message:"Failed to load response settings")}finally{d(!1)}},[e]);(0,n.useEffect)(()=>{w()},[w]);let N=(0,n.useCallback)((e,t)=>{s(s=>{if(!s){let s=h();return s[e]=t,s}return{...s,[e]:t}}),f(!0)},[]),_=(0,n.useCallback)(e=>{s(t=>t?{...t,dedup_window_seconds:e}:{...h(),dedup_window_seconds:e}),f(!0)},[]),C=(0,n.useCallback)(async()=>{if(t){g(!0),k(!1);try{await e.put("/api/responses",t),f(!1),k(!0),setTimeout(()=>k(!1),2e3)}catch(e){x(e instanceof Error?e.message:"Failed to save")}finally{g(!1)}}},[t,e]),L=(0,n.useCallback)(()=>{w()},[w]),U=(0,n.useCallback)(()=>{s(h()),f(!0)},[]),I=null!==t&&[...o,...c].some(e=>void 0!==t[e.key]);return i?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Response Settings"}),(0,r.jsx)(a.G,{rows:4})]}):u&&!t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Response Settings"}),(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:u})})]}):(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:"Response Settings"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Configure how ULPI notifies you about events"})]}),u&&(0,r.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] px-4 py-3 text-sm text-red-400",children:u}),!I&&(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-8 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:"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"})}),(0,r.jsx)("h3",{className:"mt-3 text-sm font-semibold text-white",children:"No response settings configured"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:"Response settings control how ULPI notifies you about events like permission prompts, task completions, and rule blocks."}),(0,r.jsx)("button",{type:"button",onClick:U,className:"mt-4 rounded-lg bg-primary-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600",children:"Configure Defaults"})]}),null!==t&&I&&(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-4",children:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-white",children:"Deduplication Window"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Suppress duplicate notifications within this time window"})]}),(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("input",{type:"number",min:0,max:600,value:t.dedup_window_seconds,onChange:e=>_(parseInt(e.target.value,10)||0),className:"w-20 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-white text-right outline-none focus:border-primary-500/50"}),(0,r.jsx)("span",{className:"text-xs text-gray-500",children:"seconds"})]})]})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"mb-3 text-[10px] font-medium uppercase tracking-wider text-gray-600",children:"Claude Code Events"}),(0,r.jsx)("div",{className:"space-y-3",children:o.map(e=>(0,r.jsx)(p,{meta:e,config:t[e.key],expanded:b===e.key,onToggleExpand:()=>v(b===e.key?null:e.key),onUpdateConfig:N},e.key))})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"mb-3 text-[10px] font-medium uppercase tracking-wider text-gray-600",children:"Guardian-Detected Events"}),(0,r.jsx)("div",{className:"space-y-3",children:c.map(e=>(0,r.jsx)(p,{meta:e,config:t[e.key],expanded:b===e.key,onToggleExpand:()=>v(b===e.key?null:e.key),onUpdateConfig:N},e.key))})]})]}),y&&(0,r.jsx)("div",{className:"fixed bottom-0 left-0 right-0 z-40 border-t border-white/[0.06] bg-surface-950/95 backdrop-blur-sm px-6 py-3 md:left-64",children:(0,r.jsxs)("div",{className:"flex items-center justify-between max-w-4xl mx-auto",children:[(0,r.jsx)("span",{className:"text-sm text-gray-400",children:"You have unsaved changes"}),(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("button",{type:"button",onClick:L,disabled:m,className:"rounded-lg px-4 py-2 text-sm font-medium text-gray-400 transition-colors hover:text-white hover:bg-surface-800 disabled:opacity-50",children:"Discard"}),(0,r.jsx)("button",{type:"button",onClick:C,disabled:m,className:"flex items-center gap-2 rounded-lg bg-primary-500 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50",children:m?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("svg",{className:"h-3.5 w-3.5 animate-spin",fill:"none",viewBox:"0 0 24 24",children:[(0,r.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,r.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Saving..."]}):j?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),"Saved"]}):"Save Changes"})]})]})})]})}},9736:(e,t,s)=>{Promise.resolve().then(s.bind(s,6892))}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=9736)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6816],{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")}},704:(e,t,s)=>{"use strict";s.d(t,{$:()=>n,Dy:()=>i,Ji:()=>l});var r=s(5271),a=s(3446);function n(){let e=(0,a.yC)(),[t,s]=(0,r.useState)(null),[n,l]=(0,r.useState)(!0),[i,o]=(0,r.useState)(null),c=(0,r.useRef)(null),d=(0,r.useCallback)(async()=>{o(null);try{let t=await e.get("/api/codemap/status");return s(t),t}catch(e){return o(e instanceof Error?e.message:"Failed to fetch codemap status"),null}finally{l(!1)}},[e]);return(0,r.useEffect)(()=>{let e=!1;async function t(){var s;if(e)return;let r=await d();e||(c.current=setTimeout(()=>void t(),null!=(s=null==r?void 0:r.pollIntervalMs)?s:15e3))}return l(!0),t(),()=>{e=!0,c.current&&clearTimeout(c.current)}},[d]),{status:t,loading:n,error:i,refresh:d}}function l(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[n,l]=(0,r.useState)(!1),[i,o]=(0,r.useState)(null);return{results:t,searching:n,search:(0,r.useCallback)(async(t,r)=>{l(!0),o(null);try{var a,n,i;let l=await e.post("/api/codemap/search",{query:t,...r});return s(null!=(a=l.results)?a:[]),o(null!=(n=l.durationMs)?n:null),null!=(i=l.results)?i:[]}catch(e){return s([]),o(null),[]}finally{l(!1)}},[e]),durationMs:i}}function i(){let e=(0,a.yC)(),t=(0,r.useCallback)(async()=>e.get("/api/codemap/config"),[e]);return{getConfig:t,updateConfig:(0,r.useCallback)(async t=>e.put("/api/codemap/config",t),[e]),triggerAction:(0,r.useCallback)(async t=>e.post("/api/codemap/action",{action:t}),[e])}}},1208:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>w});var r=s(8111),a=s(5271),n=s(3446),l=s(8934),i=s(2928),o=s(704),c=s(8984),d=s(3951),u=s(4632),x=s(6028),m=s(5935),h=s.n(m);function p(e){let{repo:t,onDelete:s,onSetDefault:n}=e,[l,i]=(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:"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.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-white",children:t.name}),t.isDefault&&(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary-500/15 px-2 py-0.5 text-[11px] font-medium text-primary-400",children:[(0,r.jsx)("svg",{className:"h-3 w-3",fill:"currentColor",viewBox:"0 0 24 24",children:(0,r.jsx)("path",{d:"M10.788 3.21c.448-1.077 1.976-1.077 2.424 0l2.082 5.006 5.404.434c1.164.093 1.636 1.545.749 2.305l-4.117 3.527 1.257 5.273c.271 1.136-.964 2.033-1.96 1.425L12 18.354 7.373 21.18c-.996.608-2.231-.29-1.96-1.425l1.257-5.273-4.117-3.527c-.887-.76-.415-2.212.749-2.305l5.404-.434 2.082-5.005Z"})}),"Default"]})]}),(0,r.jsx)("p",{className:"mt-0.5 truncate font-mono text-xs text-gray-500",children:t.path})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100",children:[!t.isDefault&&(0,r.jsx)("button",{onClick:()=>n(t.id),className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-primary-400",title:"Set as default",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:"M11.48 3.499a.562.562 0 0 1 1.04 0l2.125 5.111a.563.563 0 0 0 .475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 0 0-.182.557l1.285 5.385a.562.562 0 0 1-.84.61l-4.725-2.885a.562.562 0 0 0-.586 0L6.982 20.54a.562.562 0 0 1-.84-.61l1.285-5.386a.562.562 0 0 0-.182-.557l-4.204-3.602a.562.562 0 0 1 .321-.988l5.518-.442a.563.563 0 0 0 .475-.345L11.48 3.5Z"})})}),(0,r.jsx)("button",{onClick:()=>{l?(s(t.id),i(!1)):(i(!0),setTimeout(()=>i(!1),3e3))},className:"rounded-lg p-1.5 transition-colors ".concat(l?"bg-red-500/10 text-red-400":"text-gray-500 hover:bg-white/[0.06] hover:text-red-400"),title:l?"Click again to confirm":"Remove repo",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 f(e){let{onAdd:t,onClose:s}=e,[n,l]=(0,a.useState)(""),[i,o]=(0,a.useState)(""),[c,d]=(0,a.useState)(!1),[u,x]=(0,a.useState)(null);async function m(){if(n.trim()&&i.trim()){d(!0),x(null);try{await t({name:n.trim(),path:i.trim()}),s()}catch(e){x(e instanceof Error?e.message:"Failed to register repo")}finally{d(!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:"Repo Name"}),(0,r.jsx)("input",{type:"text",value:n,onChange:e=>l(e.target.value),placeholder:"My Repo",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:"Path"}),(0,r.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),placeholder:"/path/to/repo",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"})]}),u&&(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:u}),(0,r.jsxs)("div",{className:"flex items-center gap-3 pt-2",children:[(0,r.jsx)("button",{onClick:()=>void m(),disabled:c||!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:c?"Adding...":"Add Repo"}),(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 g(){let{repos:e,loading:t,error:s,registerRepo:l,deleteRepo:i,setDefault:o}=function(){let e=(0,n.yC)(),[t,s]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[i,o]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{l(!0),o(null);try{var t;let r=await e.get("/api/repos");s(null!=(t=r.repos)?t:[])}catch(e){o(e instanceof Error?e.message:"Failed to fetch repos")}finally{l(!1)}},[e]);(0,a.useEffect)(()=>{c()},[c]);let d=(0,a.useCallback)(async t=>{await e.post("/api/repos",t),await c()},[e,c]),u=(0,a.useCallback)(async t=>{await e.delete("/api/repos/".concat(t)),await c()},[e,c]),x=(0,a.useCallback)(async t=>{await e.post("/api/repos/default",{id:t}),await c()},[e,c]);return{repos:t,loading:r,error:i,refresh:c,registerRepo:d,deleteRepo:u,setDefault:x}}(),[c,m]=(0,a.useState)(!1);return t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Repos"}),(0,r.jsx)(d.G,{rows:3})]}):s?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Repos"}),(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 repos: ",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:"Repos"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-400",children:[e.length," registered repo",1!==e.length?"s":""]})]}),(0,r.jsxs)("button",{onClick:()=>m(!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 Repo"]})]}),0===e.length?(0,r.jsx)(u.p,{title:"No repos registered",description:"Register a repo directory to manage its rules, sessions, and history.",action:{label:"Add Repo",onClick:()=>m(!0)}}):(0,r.jsx)("div",{className:"space-y-2",children:e.map(e=>(0,r.jsx)(p,{repo:e,onDelete:e=>void i(e),onSetDefault:e=>void o(e)},e.id))}),e.length>0&&(0,r.jsx)(y,{}),(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 repos list"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- List all registered repos"})]}),(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 repos add /path"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- Register a repo"})]}),(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 init"}),(0,r.jsx)("span",{className:"ml-2 font-sans text-gray-600",children:"-- Detect stack and install hooks"})]})]})]}),(0,r.jsx)(x.a,{open:c,onClose:()=>m(!1),title:"Add Repo",description:"Register a local repo directory to manage with ULPI.",children:(0,r.jsx)(f,{onAdd:l,onClose:()=>m(!1)})})]})}function y(){var e,t;let s=(0,n.yC)(),{status:l}=(0,o.$)(),{status:i}=(0,c.XB)(),[d,u]=(0,a.useState)(null),[x,m]=(0,a.useState)(null),h=[{name:"CodeMap",initialized:null!=(e=null==l?void 0:l.initialized)&&e,initFn:()=>s.post("/api/codemap/action",{action:"init"})},{name:"Memory",initialized:null!=(t=null==i?void 0:i.initialized)&&t,initFn:()=>s.post("/api/memory/action",{action:"init"})},{name:"History",initialized:!0,initFn:()=>s.post("/api/history/init")}];return(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:"Subsystem Status"}),x&&(0,r.jsx)("div",{className:"mb-3 rounded-lg border border-blue-500/20 bg-blue-500/[0.06] px-3 py-2 text-xs text-blue-400",children:x}),(0,r.jsx)("div",{className:"space-y-2",children:h.map(e=>(0,r.jsxs)("div",{className:"flex items-center justify-between rounded-lg border border-white/[0.04] bg-surface-800/50 px-3 py-2.5",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2.5",children:[(0,r.jsx)("span",{className:"h-2 w-2 rounded-full ".concat(e.initialized?"bg-emerald-400":"bg-gray-500")}),(0,r.jsx)("span",{className:"text-sm text-gray-300",children:e.name})]}),e.initialized?(0,r.jsx)("span",{className:"text-[11px] font-medium text-emerald-400",children:"Ready"}):(0,r.jsxs)("button",{onClick:()=>{u(e.name),m(null),e.initFn().then(()=>{m("".concat(e.name," initialized.")),u(null)}).catch(t=>{m(t instanceof Error?t.message:"".concat(e.name," init failed")),u(null)})},disabled:null!==d,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary-500 px-3 py-1.5 text-[11px] font-semibold text-white transition-colors hover:bg-primary-600 disabled:cursor-not-allowed disabled:opacity-50",children:[d===e.name&&(0,r.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Initialize"]})]},e.name))})]})}function b(e){let{repo:t}=e;return(0,r.jsxs)(h(),{href:"/repos/".concat(t.id),className:"group flex items-center justify-between rounded-xl border border-white/[0.06] bg-surface-900 p-4 transition-colors hover:bg-surface-850",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-800",children:(0,r.jsx)("svg",{className:"h-4 w-4 text-gray-500",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm font-medium text-gray-200 truncate group-hover:text-white transition-colors",children:t.full_name}),(0,r.jsxs)("div",{className:"mt-0.5 flex items-center gap-2",children:[(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs ".concat(t.active?"text-emerald-400":"text-gray-500"),children:[(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(t.active?"bg-emerald-400":"bg-gray-600")}),t.active?"Active":"Inactive"]}),t.config.auto_review&&(0,r.jsx)("span",{className:"rounded-full bg-surface-800 px-1.5 py-0.5 text-[10px] text-gray-500",children:"Review"}),t.config.auto_run_on_pr&&(0,r.jsx)("span",{className:"rounded-full bg-surface-800 px-1.5 py-0.5 text-[10px] text-gray-500",children:"Auto-run"})]})]})]}),(0,r.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-700 transition-colors group-hover:text-gray-400",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"})})]})}function j(e){let{repo:t,installationId:s,orgId:n,onActivated:l}=e,[o,c]=(0,a.useState)(!1);async function d(){c(!0);try{await i.uE.connectRepo(n,{github_installation_id:s,github_repo_id:t.github_repo_id,full_name:t.full_name}),l()}catch(e){c(!1)}}return(0,r.jsxs)("div",{className:"flex items-center justify-between py-3 border-b border-white/[0.04] last:border-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-3 min-w-0",children:[(0,r.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-600",viewBox:"0 0 24 24",fill:"currentColor",children:(0,r.jsx)("path",{d:"M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12Z"})}),(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-sm text-gray-200 truncate",children:t.full_name}),(0,r.jsxs)("div",{className:"flex items-center gap-2 mt-0.5",children:[t.private&&(0,r.jsx)("span",{className:"text-[10px] text-gray-600",children:"Private"}),t.language&&(0,r.jsx)("span",{className:"text-[10px] text-gray-600",children:t.language})]})]})]}),t.activated?(0,r.jsx)("span",{className:"text-xs text-emerald-400",children:"Connected"}):(0,r.jsx)("button",{onClick:()=>void d(),disabled:o,className:"rounded-lg bg-primary-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-primary-600 disabled:opacity-50",children:o?"Connecting...":"Connect"})]})}function v(e){let{orgId:t,installations:s,onDone:n}=e,[l,o]=(0,a.useState)(s[0]),[c,d]=(0,a.useState)([]),[u,x]=(0,a.useState)(!1),[m,h]=(0,a.useState)(null),p=(0,a.useCallback)(async()=>{if(l){x(!0),h(null);try{let e=await i.uE.listAvailableRepos(t,l.github_installation_id);d(e.repos)}catch(e){h("Failed to load repositories from GitHub.")}finally{x(!1)}}},[t,l]);return(0,a.useEffect)(()=>{p()},[p]),(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-medium text-white",children:"Select Repositories"}),(0,r.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Choose repositories to connect from your GitHub installation."})]}),(0,r.jsx)("button",{onClick:n,className:"text-xs text-gray-500 hover:text-gray-300 transition-colors",children:"Done"})]}),s.length>1&&(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsx)("label",{className:"text-xs text-gray-500 mb-1.5 block",children:"Installation"}),(0,r.jsx)("select",{value:l.id,onChange:e=>{let t=s.find(t=>t.id===e.target.value);t&&o(t)},className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-2 text-sm text-gray-200",children:s.map(e=>(0,r.jsxs)("option",{value:e.id,children:[e.github_account_login," (",e.github_account_type,")"]},e.id))})]}),u?(0,r.jsx)("div",{className:"space-y-3 py-4",children:Array.from({length:4}).map((e,t)=>(0,r.jsx)("div",{className:"h-10 animate-pulse rounded bg-surface-800"},t))}):m?(0,r.jsxs)("div",{className:"py-8 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-red-400",children:m}),(0,r.jsx)("button",{onClick:()=>void p(),className:"mt-2 text-xs text-primary-400 hover:text-primary-300",children:"Try again"})]}):0===c.length?(0,r.jsxs)("div",{className:"py-8 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-gray-400",children:"No repositories found."}),(0,r.jsx)("p",{className:"text-xs text-gray-600 mt-1",children:"Adjust the repository access in your GitHub App settings."})]}):(0,r.jsx)("div",{children:c.map(e=>(0,r.jsx)(j,{repo:e,installationId:l.github_installation_id,orgId:t,onActivated:()=>{d(t=>t.map(t=>t.github_repo_id===e.github_repo_id?{...t,activated:!0}:t))}},e.github_repo_id))})]})}function N(){let{org:e}=(0,l.As)(),[t,s]=(0,a.useState)([]),[n,o]=(0,a.useState)([]),[c,d]=(0,a.useState)(!0),[u,x]=(0,a.useState)(!1),m=(0,a.useCallback)(async()=>{if(e)try{let[t,r]=await Promise.all([i.uE.listRepos(e.id),i.uE.listInstallations(e.id)]);s(t),o(r)}catch(e){}finally{d(!1)}},[e]);async function h(){if(e)if(n.length>0)x(!0);else try{let{url:t}=await i.uE.getInstallUrl(e.id);window.location.href=t}catch(e){}}return(0,a.useEffect)(()=>{m()},[m]),(0,r.jsxs)("div",{className:"space-y-6 animate-in",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:"Repositories"}),(0,r.jsx)("p",{className:"mt-0.5 text-sm text-gray-500",children:"Manage your connected GitHub repositories."})]}),(0,r.jsxs)("button",{onClick:()=>void h(),className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-3.5 py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600",children:[(0,r.jsx)("svg",{className:"h-3.5 w-3.5",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"})}),"Connect"]})]}),u&&e&&n.length>0&&(0,r.jsx)(v,{orgId:e.id,installations:n,onDone:function(){x(!1),m()}}),c?(0,r.jsx)("div",{className:"space-y-2",children:Array.from({length:3}).map((e,t)=>(0,r.jsx)("div",{className:"h-[68px] animate-pulse rounded-xl border border-white/[0.04] bg-surface-900"},t))}):0!==t.length||u?t.length>0?(0,r.jsx)("div",{className:"space-y-2",children:t.map(e=>(0,r.jsx)(b,{repo:e},e.id))}):null:(0,r.jsxs)("div",{className:"rounded-xl border border-dashed border-white/[0.08] bg-surface-900/50 py-16 text-center",children:[(0,r.jsx)("svg",{className:"mx-auto h-10 w-10 text-gray-700",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1,children:(0,r.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.375"})}),(0,r.jsx)("h3",{className:"mt-3 text-sm font-medium text-gray-300",children:"No repositories connected"}),(0,r.jsx)("p",{className:"mt-1.5 text-xs text-gray-500 max-w-xs mx-auto",children:n.length>0?"Click Connect to choose repositories from your GitHub installation.":"Install the ULPI GitHub App first, then connect repositories."}),(0,r.jsx)("div",{className:"mt-5",children:(0,r.jsx)("button",{onClick:()=>void h(),className:"inline-flex items-center gap-2 rounded-lg bg-primary-500 px-3.5 py-2 text-sm font-medium text-white transition-colors hover:bg-primary-600",children:n.length>0?"Connect Repository":"Install GitHub App"})})]})]})}function w(){return"cloud"===(0,n.Xk)()?(0,r.jsx)(N,{}):(0,r.jsx)(g,{})}},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>c,HI:()=>x,Xk:()=>d,yC:()=>u});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 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)}},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: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})]})}},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:l,children:i,maxWidth:o="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(o," 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}),l&&(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:l})]}),(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}},6199:(e,t,s)=>{Promise.resolve().then(s.bind(s,1208))},8984:(e,t,s)=>{"use strict";s.d(t,{XB:()=>n,nu:()=>l,wC:()=>i});var r=s(5271),a=s(3446);function n(){let e=(0,a.yC)(),[t,s]=(0,r.useState)(null),[n,l]=(0,r.useState)(!0),[i,o]=(0,r.useState)(null),c=(0,r.useRef)(null),d=(0,r.useCallback)(async()=>{o(null);try{let t=await e.get("/api/memory/status");return s(t),t}catch(e){return o(e instanceof Error?e.message:"Failed to fetch memory status"),null}finally{l(!1)}},[e]);(0,r.useEffect)(()=>{let e=!1;async function t(){var s;if(e)return;let r=await d();e||(c.current=setTimeout(()=>void t(),null!=(s=null==r?void 0:r.pollIntervalMs)?s:3e4))}return l(!0),t(),()=>{e=!0,c.current&&clearTimeout(c.current)}},[d]);let u=(0,r.useCallback)(async t=>{await e.put("/api/memory/config",{enabled:t}),await d()},[e,d]);return{status:t,loading:n,error:i,refresh:d,toggleEnabled:u}}function l(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[n,l]=(0,r.useState)(!1);return{results:t,searching:n,search:(0,r.useCallback)(async t=>{l(!0);try{var r;let a=(null!=(r=(await e.post("/api/memory/search",{query:t})).results)?r:[]).map(e=>e.entry);return s(a),a}catch(e){return s([]),[]}finally{l(!1)}},[e])}}function i(){let e=(0,a.yC)(),t=(0,r.useCallback)(async(t,s)=>e.post("/api/memory/remember",{summary:t,type:null!=s?s:"CONTEXT"}),[e]),s=(0,r.useCallback)(async t=>e.get("/api/memory/timeline".concat(t?"?limit=".concat(t):"")),[e]);return{remember:t,getTimeline:s,forget:(0,r.useCallback)(async t=>e.post("/api/memory/entries/".concat(t,"/forget")),[e]),runAction:(0,r.useCallback)(async t=>e.post("/api/memory/action",{action:t}),[e])}}}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=6199)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5602],{422:(e,t,r)=>{"use strict";r.d(t,{J:()=>i,h:()=>n});var s=r(7811);function n(){return"local"===s.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function i(){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:()=>h,Xk:()=>d,yC:()=>u});var s=r(8111),n=r(5271),i=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,i.h)()}}let o=(0,n.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,r=(0,n.useMemo)(()=>{let e=(0,i.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new l:null}},[]);return(0,s.jsx)(o,{value:r,children:t})}function d(){return(0,n.useContext)(o).mode}function u(){let{localClient:e}=(0,n.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function h(){return(0,n.useContext)(o)}},3951:(e,t,r)=>{"use strict";r.d(t,{G:()=>n});var s=r(8111);function n(e){let{rows:t=3,variant:r="skeleton",className:n=""}=e;return"spinner"===r?(0,s.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(n),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(n),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))})}},5708:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>c});var s=r(8111),n=r(5271),i=r(3446),a=r(3951);function l(e){let{checked:t,onChange:r}=e;return(0,s.jsx)("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>r(!t),className:"relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out ".concat(t?"bg-primary-500":"bg-surface-700"),children:(0,s.jsx)("span",{className:"pointer-events-none inline-block h-5 w-5 rounded-full bg-white shadow transform transition duration-200 ease-in-out ".concat(t?"translate-x-5":"translate-x-0")})})}function o(e){let{label:t,description:r,children:n}=e;return(0,s.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-white/[0.06] bg-surface-900 p-4",children:[(0,s.jsxs)("div",{className:"pr-4",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-white",children:t}),(0,s.jsx)("p",{className:"mt-0.5 text-xs text-gray-500",children:r})]}),(0,s.jsx)("div",{className:"shrink-0",children:n})]})}function c(){let e=(0,i.yC)(),[t,r]=(0,n.useState)(null),[c,d]=(0,n.useState)(!0),[u,h]=(0,n.useState)(!1),[p,x]=(0,n.useState)(!1),[m,v]=(0,n.useState)(null);async function f(){if(t){h(!0),v(null);try{await e.put("/api/review/config",t),x(!0),setTimeout(()=>x(!1),2e3)}catch(e){v(e instanceof Error?e.message:"Failed to save config")}finally{h(!1)}}}return((0,n.useEffect)(()=>{e.get("/api/review/config").then(r).catch(()=>{r({enabled:!0,plan_review:!0,code_review:!0,auto_open_browser:!0,require_server:!1})}).finally(()=>d(!1))},[e]),c)?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Review Settings"}),(0,s.jsx)(a.G,{rows:4})]}):(0,s.jsxs)("div",{className:"space-y-6 max-w-3xl",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("h1",{className:"text-xl font-semibold text-white flex items-center gap-2",children:[(0,s.jsxs)("svg",{className:"h-5 w-5 text-gray-400",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"})]}),"Review Settings"]}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Configure plan and code review behavior"})]}),(0,s.jsxs)("button",{onClick:()=>void f(),disabled:u||!t,className:"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 disabled:opacity-50",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:"M17.593 3.322c1.1.128 1.907 1.077 1.907 2.185V21L12 17.25 4.5 21V5.507c0-1.108.806-2.057 1.907-2.185a48.507 48.507 0 0 1 11.186 0Z"})}),p?"Saved!":u?"Saving...":"Save"]})]}),m&&(0,s.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] px-4 py-3 text-sm text-red-400",children:m}),t&&(0,s.jsx)("div",{className:"space-y-3",children:[{key:"enabled",label:"Review Enabled",description:"Enable review interception for plan and code changes"},{key:"plan_review",label:"Plan Review",description:"Review plans when ExitPlanMode is triggered"},{key:"code_review",label:"Code Review",description:"Review code diffs before git commits"},{key:"auto_open_browser",label:"Auto-open Browser",description:"Automatically open the review UI in your browser"},{key:"require_server",label:"Require Server",description:"Require a running ULPI server before starting review (fail-closed mode)"}].map(e=>{let{key:n,label:i,description:a}=e;return(0,s.jsx)(o,{label:i,description:a,children:(0,s.jsx)(l,{checked:!!t[n],onChange:()=>{t&&r({...t,[n]:!t[n]})}})},n)})})]})}},6967:(e,t,r)=>{Promise.resolve().then(r.bind(r,5708))}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=6967)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8459],{422:(e,t,r)=>{"use strict";r.d(t,{J:()=>n,h:()=>a});var s=r(7811);function a(){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")}},3446:(e,t,r)=>{"use strict";r.d(t,{Kv:()=>c,HI:()=>x,Xk:()=>o,yC:()=>u});var s=r(8111),a=r(5271),n=r(422),l=r(7811);class d{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=l.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,n.h)()}}let i=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,r=(0,a.useMemo)(()=>{let e=(0,n.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new d:null}},[]);return(0,s.jsx)(i,{value:r,children:t})}function o(){return(0,a.useContext)(i).mode}function u(){let{localClient:e}=(0,a.useContext)(i);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,a.useContext)(i)}},3604:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var s=r(8111),a=r(5271),n=r(4736),l=r(3446),d=r(422),i=r(5605),c=r(3951),o=r(4632),u=r(7811);function x(e){return"session"===e.kind?e.data.registeredAt:new Date(e.data.updatedAt).getTime()}function p(e){let{type:t}=e;return"plan"===t?(0,s.jsx)("span",{className:"rounded-full bg-primary-500/10 px-2 py-0.5 text-[10px] font-medium text-primary-400",children:"Plan"}):(0,s.jsx)("span",{className:"rounded-full bg-emerald-500/10 px-2 py-0.5 text-[10px] font-medium text-emerald-400",children:"Code"})}function m(){let e=(0,n.useRouter)(),t=(0,l.yC)(),[r,m]=(0,a.useState)([]),[h,g]=(0,a.useState)([]),[b,f]=(0,a.useState)(!0),[v,y]=(0,a.useState)(null),[j,w]=(0,a.useState)("all"),[,N]=(0,a.useState)(0);(0,a.useEffect)(()=>{let e=setInterval(()=>N(e=>e+1),3e4);return()=>clearInterval(e)},[]);let C=(0,a.useCallback)(async()=>{try{let[e,r]=await Promise.all([t.get("/api/review/hub/sessions").then(e=>Array.isArray(e)?e:[]).catch(()=>[]),t.get("/api/review/plans").then(e=>Array.isArray(e)?e:[]).catch(()=>[])]);m(e),g(r),y(null)}catch(e){y(e instanceof Error?e.message:"Failed to load review data")}finally{f(!1)}},[t]);(0,a.useEffect)(()=>{C()},[C]);let k=(0,a.useRef)(null);(0,a.useEffect)(()=>{let e=null;return!function t(){try{let r=(0,d.h)(),s=u.env.NEXT_PUBLIC_ULPI_API_SECRET,a=s?"".concat(r,"/api/review/hub/events?secret=").concat(encodeURIComponent(s)):"".concat(r,"/api/review/hub/events");k.current=new EventSource(a);let n=()=>void C();k.current.addEventListener("session-added",n),k.current.addEventListener("session-decided",n),k.current.addEventListener("session-updated",n),k.current.onerror=()=>{var r;null==(r=k.current)||r.close(),k.current=null,e=setTimeout(t,3e3)}}catch(e){}}(),()=>{var t;null==(t=k.current)||t.close(),k.current=null,e&&clearTimeout(e)}},[C]);let P=[...r.map(e=>({kind:"session",data:e})),...h.map(e=>({kind:"plan",data:e}))].sort((e,t)=>x(t)-x(e)),E=P.filter(e=>(function(e,t){switch(t){case"all":return!0;case"pending":if("session"===e.kind)return"pending"===e.data.status||"active"===e.data.status;return"pending"===e.data.status;case"code":return"session"===e.kind&&"code"===e.data.type;case"decided":if("session"===e.kind)return"decided"===e.data.status;return"approved"===e.data.status||"denied"===e.data.status}})(e,j)),_=r.filter(e=>"pending"===e.status||"active"===e.status).length,L=h.length,I=r.filter(e=>"decided"===e.status).length;return b?(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Review Queue"}),(0,s.jsx)(c.G,{rows:4})]}):(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Review Queue"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Pending reviews and recent decisions"})]}),v&&(0,s.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/[0.06] px-4 py-3 text-sm text-red-400",children:v}),(0,s.jsxs)("div",{className:"grid grid-cols-3 gap-3",children:[(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-3 text-center",children:[(0,s.jsx)("p",{className:"text-lg font-semibold text-white",children:_}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Pending"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-3 text-center",children:[(0,s.jsx)("p",{className:"text-lg font-semibold text-white",children:L}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Plans"})]}),(0,s.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-3 text-center",children:[(0,s.jsx)("p",{className:"text-lg font-semibold text-white",children:I}),(0,s.jsx)("p",{className:"text-[10px] text-gray-500",children:"Decided"})]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[["all","All"],["pending","Pending"],["code","Code"],["decided","Decided"]].map(e=>{let[t,r]=e;return(0,s.jsx)("button",{onClick:()=>w(t),className:"rounded-full px-3 py-1 text-xs font-medium transition-colors ".concat(j===t?"bg-primary-500/15 text-primary-400":"bg-surface-800 text-gray-500 hover:text-gray-300"),children:r},t)})}),(0,s.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 overflow-hidden",children:0===E.length?(0,s.jsx)(o.p,{title:0===P.length?"No reviews yet":"No entries match this filter",description:0===P.length?"Reviews will appear here when ULPI intercepts a plan exit or git commit.":"Try changing the filter to see more results."}):(0,s.jsx)("div",{className:"divide-y divide-white/[0.04]",children:E.map(t=>{let r="session"===t.kind?"session-".concat(t.data.id):"plan-".concat(t.data.slug),a="session"===t.kind?t.data.title||"Untitled review":t.data.title,n=x(t);return(0,s.jsxs)("button",{onClick:()=>(function(t){if("session"===t.kind){let r=t.data;e.push("/review/plan?session=".concat(encodeURIComponent(r.id)))}else e.push("/review/plan?slug=".concat(encodeURIComponent(t.data.slug)))})(t),className:"flex w-full items-start gap-3 px-4 py-3 text-left transition-colors hover:bg-white/[0.02]",children:[(0,s.jsx)("div",{className:"flex flex-col items-start gap-1.5 pt-0.5",children:"session"===t.kind?(0,s.jsx)(p,{type:t.data.type}):(0,s.jsx)(p,{type:"plan"})}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"truncate text-sm font-medium text-gray-200",children:a}),(0,s.jsxs)("div",{className:"mt-1 flex items-center gap-2",children:[(t.kind,(0,s.jsx)(i.W,{status:t.data.status,size:"sm"})),"session"===t.kind&&t.data.decision&&(0,s.jsx)(i.W,{status:"allow"===t.data.decision.behavior?"approved":"rejected",size:"sm"}),"session"===t.kind&&t.data.projectSlug&&(0,s.jsx)("span",{className:"truncate max-w-[120px] rounded bg-surface-800 px-1.5 py-0.5 font-mono text-[10px] text-gray-500",children:t.data.projectSlug}),"plan"===t.kind&&t.data.versionCount>1&&(0,s.jsxs)("span",{className:"text-[10px] text-gray-600",children:["v",t.data.versionCount]})]})]}),(0,s.jsxs)("div",{className:"shrink-0 text-right",children:[(0,s.jsx)("p",{className:"text-[10px] text-gray-600",children:new Date(n).toLocaleDateString(void 0,{month:"short",day:"numeric"})}),(0,s.jsx)("p",{className:"text-[10px] text-gray-600",children:function(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let r=Math.floor(t/60);if(r<60)return"".concat(r,"m ago");let s=Math.floor(r/60);if(s<24)return"".concat(s,"h ago");let a=Math.floor(s/24);return"".concat(a,"d ago")}(n)})]})]},r)})})})]})}},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))})}},4632:(e,t,r)=>{"use strict";r.d(t,{p:()=>n});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 n(e){let{icon:t,title:r,description:n,action:l,className:d=""}=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(d),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}),n&&(0,s.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:n}),l&&(0,s.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})]})}},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}})},5605:(e,t,r)=>{"use strict";r.d(t,{W:()=>l});var s=r(8111);let a={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"},n={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 l(e){var t,r;let{status:l,label:d,showDot:i=!0,size:c="sm",className:o=""}=e,u=l.toLowerCase().replace(/\s+/g,"_"),x=null!=(t=a[u])?t:"bg-gray-500/10 text-gray-400 border-gray-500/20",p=null!=(r=n[u])?r:"bg-gray-400",m=null!=d?d:l.charAt(0).toUpperCase()+l.slice(1).replace(/_/g," ");return(0,s.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border font-medium ".concat(x," ").concat("sm"===c?"px-2 py-0.5 text-[11px]":"px-2.5 py-1 text-xs"," ").concat(o),children:[i&&(0,s.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(p)}),m]})}},6614:(e,t,r)=>{Promise.resolve().then(r.bind(r,3604))}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=6614)),_N_E=e.O()}]);