@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([[9558],{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")}},2757:(e,t,s)=>{Promise.resolve().then(s.bind(s,7970))},3025:(e,t,s)=>{"use strict";s.d(t,{s:()=>n});var r=s(8111),a=s(3446);function n(e){let{children:t,featureName:s="This feature"}=e;return"cloud"===(0,a.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),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})]})}},4638:(e,t,s)=>{"use strict";s.d(t,{f:()=>n});var r=s(5271),a=s(3446);function n(){let e=(0,a.yC)(),[t,s]=(0,r.useState)({rules:[],loading:!0,error:null}),n=(0,r.useCallback)(async()=>{s(e=>({...e,loading:!0,error:null}));try{let t=await e.get("/api/rules"),r=Array.isArray(t)?t:[];s({rules:r,loading:!1,error:null})}catch(e){s(t=>({...t,loading:!1,error:e instanceof Error?e.message:"Failed to fetch rules"}))}},[e]);(0,r.useEffect)(()=>{n()},[n]);let l=(0,r.useCallback)(async t=>{await e.post("/api/rules",t),await n()},[e,n]),i=(0,r.useCallback)(async(t,s)=>{await e.put("/api/rules/".concat(t),s),await n()},[e,n]),o=(0,r.useCallback)(async t=>{await e.delete("/api/rules/".concat(t)),await n()},[e,n]),c=(0,r.useCallback)(async t=>{await e.post("/api/rules/".concat(t,"/toggle")),await n()},[e,n]);return{...t,fetchRules:n,createRule:l,updateRule:i,deleteRule:o,toggleRule:c}}},7970:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>f});var r=s(8111),a=s(5271),n=s(5935),l=s.n(n),i=s(4638);let o={precondition:"bg-blue-500/10 text-blue-400 border-blue-500/20",postcondition:"bg-amber-500/10 text-amber-400 border-amber-500/20",permission:"bg-violet-500/10 text-violet-400 border-violet-500/20",pipeline:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20"};function c(e){var t;let{type:s}=e,a=null!=(t=o[s])?t:"bg-gray-500/10 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-[11px] font-medium ".concat(a),children:s.charAt(0).toUpperCase()+s.slice(1)})}function d(e){var t;let{decision:s}=e,a=null!=(t=({allow:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",deny:"bg-red-500/10 text-red-400 border-red-500/20",ask_user:"bg-amber-500/10 text-amber-400 border-amber-500/20"})[s])?t:"bg-gray-500/10 text-gray-400 border-gray-500/20",n="ask_user"===s?"Ask User":s.charAt(0).toUpperCase()+s.slice(1);return(0,r.jsx)("span",{className:"inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium ".concat(a),children:n})}function u(e){let{checked:t,onChange:s}=e;return(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":t,onClick:e=>{e.preventDefault(),e.stopPropagation(),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 x(e){var t;let{rule:s,onToggle:n,onDelete:i}=e,[o,x]=(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.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"mb-2 flex flex-wrap items-center gap-2",children:[(0,r.jsx)(l(),{href:"/rules/".concat(s.id),className:"text-sm font-semibold text-white hover:text-primary-400 transition-colors",children:s.id}),(0,r.jsx)(c,{type:(t=s.section).endsWith("s")?t.slice(0,-1):t}),s.locked&&(0,r.jsx)("svg",{className:"h-3.5 w-3.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:"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"})})]}),(0,r.jsxs)("div",{className:"space-y-1 text-xs text-gray-500",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Trigger:"}),(0,r.jsx)("span",{className:"rounded-md bg-surface-800 px-1.5 py-0.5 text-[10px] font-medium text-gray-400",children:s.trigger})]}),(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Matcher:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:s.matcher})]}),s.file_pattern&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"File:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:s.file_pattern})]}),s.command_pattern&&(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Command:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:s.command_pattern})]})]}),(0,r.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:["permissions"===s.section&&s.decision&&(0,r.jsx)(d,{decision:s.decision}),"preconditions"===s.section&&s.requires_read&&(0,r.jsx)("span",{className:"inline-flex items-center rounded-full border border-blue-500/20 bg-blue-500/10 px-2 py-0.5 text-[11px] font-medium text-blue-400",children:"Requires Read"}),"postconditions"===s.section&&s.run&&(0,r.jsxs)("span",{className:"font-mono text-xs text-gray-400",children:["$ ",s.run]}),"pipelines"===s.section&&s.steps&&(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:[s.steps.length," step",1!==s.steps.length?"s":""]}),s.message&&(0,r.jsx)("p",{className:"w-full text-xs text-gray-500 line-clamp-1",children:s.message})]})]}),(0,r.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[(0,r.jsx)(u,{checked:s.enabled,onChange:()=>n(s.id)}),(0,r.jsx)(l(),{href:"/rules/".concat(s.id),className:"rounded-lg p-1.5 text-gray-500 transition-colors hover:bg-white/[0.06] hover:text-gray-300",title:"Edit rule",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:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125"})})}),i&&(0,r.jsx)("button",{onClick:e=>{e.preventDefault(),o?(i(s.id),x(!1)):(x(!0),setTimeout(()=>x(!1),3e3))},className:"rounded-lg p-1.5 transition-colors ".concat(o?"bg-red-500/10 text-red-400":"text-gray-500 hover:bg-white/[0.06] hover:text-red-400"),title:o?"Click again to confirm":"Delete rule",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"})})})]})]})})}var m=s(3951),h=s(4632),p=s(3025);let g=[{key:"all",label:"All"},{key:"preconditions",label:"Preconditions"},{key:"permissions",label:"Permissions"},{key:"postconditions",label:"Postconditions"},{key:"pipelines",label:"Pipelines"}];function f(){return(0,r.jsx)(p.s,{featureName:"Rules management",children:(0,r.jsx)(b,{})})}function b(){let{rules:e,loading:t,error:s,toggleRule:n,deleteRule:o}=(0,i.f)(),[c,d]=(0,a.useState)("all"),[u,p]=(0,a.useState)(""),f=(0,a.useMemo)(()=>{let t=e;if("all"!==c&&(t=t.filter(e=>e.section===c)),u.trim()){let e=u.toLowerCase();t=t.filter(t=>t.id.toLowerCase().includes(e)||t.matcher.toLowerCase().includes(e)||t.message&&"string"==typeof t.message&&t.message.toLowerCase().includes(e))}return t},[e,c,u]),b=(0,a.useMemo)(()=>{let t={all:e.length};for(let r of e){var s;t[r.section]=(null!=(s=t[r.section])?s:0)+1}return t},[e]);return t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("div",{className:"flex items-center justify-between",children:(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Rules"})}),(0,r.jsx)(m.G,{rows:5})]}):s?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Rules"}),(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 rules: ",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:"Rules"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-400",children:[e.length," rule",1!==e.length?"s":""," configured"]})]}),(0,r.jsxs)(l(),{href:"/rules/new",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"})}),"New Rule"]})]}),(0,r.jsxs)("div",{className:"space-y-3",children:[(0,r.jsxs)("div",{className:"relative",children:[(0,r.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,r.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,r.jsx)("input",{type:"text",value:u,onChange:e=>p(e.target.value),placeholder:"Search rules by name or matcher...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800/50 py-2 pl-9 pr-3 text-sm text-white placeholder-gray-600 outline-none transition-colors focus:border-primary-500/50"})]}),(0,r.jsx)("div",{className:"flex gap-1 rounded-lg bg-surface-800/50 p-1",children:g.map(e=>{var t;return(0,r.jsxs)("button",{onClick:()=>d(e.key),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(c===e.key?"bg-primary-500/15 text-primary-400":"text-gray-500 hover:text-gray-300"),children:[e.label,(null!=(t=b[e.key])?t:0)>0&&(0,r.jsx)("span",{className:"ml-1.5 text-gray-600",children:b[e.key]})]},e.key)})})]}),0===f.length?(0,r.jsx)(h.p,{title:u?"No rules match your search":"No rules configured",description:u?"Try a different search term.":"Create your first rule or run setup to generate rules automatically.",action:u?void 0:{label:"New Rule",onClick:()=>window.location.assign("/rules/new")}}):(0,r.jsx)("div",{className:"space-y-2",children:f.map(e=>(0,r.jsx)(x,{rule:e,onToggle:()=>void n(e.id),onDelete:e=>void o(e)},e.id))})]})}}},e=>{e.O(0,[5935,814,9743,7358],()=>e(e.s=2757)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6630],{422:(e,s,t)=>{"use strict";t.d(s,{J:()=>a,h:()=>n});var r=t(7811);function n(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},3025:(e,s,t)=>{"use strict";t.d(s,{s:()=>a});var r=t(8111),n=t(3446);function a(e){let{children:s,featureName:t="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:[t," 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:s})}},3446:(e,s,t)=>{"use strict";t.d(s,{Kv:()=>o,HI:()=>u,Xk:()=>d,yC:()=>x});var r=t(8111),n=t(5271),a=t(422),l=t(7811);class i{async request(e,s){let t="".concat(this.baseUrl).concat(e);if(this.repo){let e=t.includes("?")?"&":"?";t="".concat(t).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=l.env.NEXT_PUBLIC_ULPI_API_SECRET,n=await fetch(t,{...s,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==s?void 0:s.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,s){return this.request(e,{method:"POST",body:s?JSON.stringify(s):void 0})}async put(e,s){return this.request(e,{method:"PUT",body:s?JSON.stringify(s):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,a.h)()}}let c=(0,n.createContext)({mode:"cloud",localClient:null});function o(e){let{children:s}=e,t=(0,n.useMemo)(()=>{let e=(0,a.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(c,{value:t,children:s})}function d(){return(0,n.useContext)(c).mode}function x(){let{localClient:e}=(0,n.useContext)(c);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function u(){return(0,n.useContext)(c)}},3747:(e,s,t)=>{"use strict";t.r(s),t.d(s,{default:()=>h});var r=t(8111),n=t(5271),a=t(5935),l=t.n(a),i=t(4638),c=t(3951),o=t(4632),d=t(3025);function x(e){let{steps:s}=e;return(0,r.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:s.map((e,t)=>(0,r.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-800 px-2.5 py-1.5",children:[(0,r.jsx)("p",{className:"text-xs font-medium text-gray-300",children:e.name}),(0,r.jsx)("p",{className:"mt-0.5 font-mono text-[10px] text-gray-500",children:e.run})]}),t<s.length-1&&(0,r.jsx)("svg",{className:"h-3.5 w-3.5 shrink-0 text-gray-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 4.5 21 12m0 0-7.5 7.5M21 12H3"})})]},t))})}function u(e){let{checked:s,onChange:t}=e;return(0,r.jsx)("button",{type:"button",role:"switch","aria-checked":s,onClick:t,className:"relative inline-flex h-5 w-9 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors ".concat(s?"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(s?"translate-x-4":"translate-x-0")})})}function h(){return(0,r.jsx)(d.s,{featureName:"Pipelines",children:(0,r.jsx)(m,{})})}function m(){let{rules:e,loading:s,error:t,toggleRule:a}=(0,i.f)(),d=(0,n.useMemo)(()=>e.filter(e=>"pipelines"===e.section),[e]);return s?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Pipelines"}),(0,r.jsx)(c.G,{rows:3})]}):t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Pipelines"}),(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 rules: ",t]})})]}):(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:"Pipelines"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Pipeline rules run multi-step workflows on tool actions"})]}),(0,r.jsxs)(l(),{href:"/rules/new",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"})}),"New Pipeline"]})]}),0===d.length?(0,r.jsx)(o.p,{title:"No pipelines configured",description:"Pipelines run a sequence of steps when a tool action matches. Create one from the Rule Builder.",action:{label:"Create Pipeline",onClick:()=>window.location.assign("/rules/new")}}):(0,r.jsx)("div",{className:"space-y-3",children:d.map(e=>{let s=Array.isArray(e.steps)?e.steps:[],t="string"==typeof e.on_failure?e.on_failure:"block";return(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-start justify-between gap-4",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center gap-2",children:[(0,r.jsx)(l(),{href:"/rules/".concat(e.id),className:"text-sm font-semibold text-white hover:text-primary-400 transition-colors",children:e.id}),(0,r.jsx)("span",{className:"inline-flex items-center rounded-full border border-cyan-500/20 bg-cyan-500/10 px-2 py-0.5 text-[11px] font-medium text-cyan-400",children:"Pipeline"}),!e.enabled&&(0,r.jsx)("span",{className:"text-[11px] text-gray-600",children:"Disabled"})]}),(0,r.jsxs)("div",{className:"mb-3 flex items-center gap-3 text-xs text-gray-500",children:[(0,r.jsxs)("span",{children:["Trigger: ",(0,r.jsx)("span",{className:"text-gray-400",children:e.trigger})]}),(0,r.jsxs)("span",{children:["Matcher: ",(0,r.jsx)("span",{className:"font-mono text-gray-400",children:e.matcher})]}),(0,r.jsxs)("span",{children:["On failure: ",(0,r.jsx)("span",{className:"text-gray-400",children:t})]})]}),s.length>0&&(0,r.jsx)(x,{steps:s})]}),(0,r.jsx)(u,{checked:e.enabled,onChange:()=>void a(e.id)})]})},e.id)})})]})}},3951:(e,s,t)=>{"use strict";t.d(s,{G:()=>n});var r=t(8111);function n(e){let{rows:s=3,variant:t="skeleton",className:n=""}=e;return"spinner"===t?(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:s}).map((e,s)=>(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]"})]})},s))})}},4632:(e,s,t)=>{"use strict";t.d(s,{p:()=>a});var r=t(8111);function n(){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 a(e){let{icon:s,title:t,description:a,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!=s?s:(0,r.jsx)(n,{})}),(0,r.jsx)("h3",{className:"text-sm font-medium text-gray-300",children:t}),a&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:a}),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})]})}},4638:(e,s,t)=>{"use strict";t.d(s,{f:()=>a});var r=t(5271),n=t(3446);function a(){let e=(0,n.yC)(),[s,t]=(0,r.useState)({rules:[],loading:!0,error:null}),a=(0,r.useCallback)(async()=>{t(e=>({...e,loading:!0,error:null}));try{let s=await e.get("/api/rules"),r=Array.isArray(s)?s:[];t({rules:r,loading:!1,error:null})}catch(e){t(s=>({...s,loading:!1,error:e instanceof Error?e.message:"Failed to fetch rules"}))}},[e]);(0,r.useEffect)(()=>{a()},[a]);let l=(0,r.useCallback)(async s=>{await e.post("/api/rules",s),await a()},[e,a]),i=(0,r.useCallback)(async(s,t)=>{await e.put("/api/rules/".concat(s),t),await a()},[e,a]),c=(0,r.useCallback)(async s=>{await e.delete("/api/rules/".concat(s)),await a()},[e,a]),o=(0,r.useCallback)(async s=>{await e.post("/api/rules/".concat(s,"/toggle")),await a()},[e,a]);return{...s,fetchRules:a,createRule:l,updateRule:i,deleteRule:c,toggleRule:o}}},7299:(e,s,t)=>{Promise.resolve().then(t.bind(t,3747))}},e=>{e.O(0,[5935,814,9743,7358],()=>e(e.s=7299)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6274],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>l,h:()=>a});var r=s(7811);function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},759:(e,t,s)=>{Promise.resolve().then(s.bind(s,9947))},3446:(e,t,s)=>{"use strict";s.d(t,{Kv:()=>o,HI:()=>u,Xk:()=>d,yC:()=>x});var r=s(8111),a=s(5271),l=s(422),n=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=n.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,l.h)()}}let c=(0,a.createContext)({mode:"cloud",localClient:null});function o(e){let{children:t}=e,s=(0,a.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(c,{value:s,children:t})}function d(){return(0,a.useContext)(c).mode}function x(){let{localClient:e}=(0,a.useContext)(c);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function u(){return(0,a.useContext)(c)}},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:()=>l});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 l(e){let{icon:t,title:s,description:l,action:n,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}),l&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:l}),n&&(0,r.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})]})}},4736:(e,t,s)=>{"use strict";var r=s(1504);s.o(r,"useParams")&&s.d(t,{useParams:function(){return r.useParams}}),s.o(r,"usePathname")&&s.d(t,{usePathname:function(){return r.usePathname}}),s.o(r,"useRouter")&&s.d(t,{useRouter:function(){return r.useRouter}}),s.o(r,"useSearchParams")&&s.d(t,{useSearchParams:function(){return r.useSearchParams}})},5605:(e,t,s)=>{"use strict";s.d(t,{W:()=>n});var r=s(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"},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,s;let{status:n,label:i,showDot:c=!0,size:o="sm",className:d=""}=e,x=n.toLowerCase().replace(/\s+/g,"_"),u=null!=(t=a[x])?t:"bg-gray-500/10 text-gray-400 border-gray-500/20",m=null!=(s=l[x])?s:"bg-gray-400",h=null!=i?i:n.charAt(0).toUpperCase()+n.slice(1).replace(/_/g," ");return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1.5 rounded-full border font-medium ".concat(u," ").concat("sm"===o?"px-2 py-0.5 text-[11px]":"px-2.5 py-1 text-xs"," ").concat(d),children:[c&&(0,r.jsx)("span",{className:"h-1.5 w-1.5 rounded-full ".concat(m)}),h]})}},9947:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>_});var r=s(8111),a=s(5271),l=s(4736),n=s(422),i=s(8934),c=s(2928),o=s(3446),d=s(3951),x=s(4632),u=s(5605);function m(e){let t=Date.now()-new Date(e).getTime();return t<6e4?"just now":t<36e5?"".concat(Math.floor(t/6e4),"m ago"):t<864e5?"".concat(Math.floor(t/36e5),"h ago"):"".concat(Math.floor(t/864e5),"d ago")}function h(e){return new Date(e).toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function p(e,t){let s=new Date(e).getTime(),r=(t?new Date(t).getTime():Date.now())-s;if(r<0)return"0s";if(r<6e4)return"".concat(Math.round(r/1e3),"s");if(r<36e5){let e=Math.floor(r/6e4),t=Math.round(r%6e4/1e3);return"".concat(e,"m ").concat(t,"s")}let a=Math.floor(r/36e5),l=Math.floor(r%36e5/6e4);return"".concat(a,"h ").concat(l,"m")}function g(e){if(!e)return"Unknown";let t=e.replace(/\/$/,"").split("/");return t[t.length-1]||e}let f={PreToolUse:"bg-blue-400",PostToolUse:"bg-emerald-400",PermissionRequest:"bg-amber-400",Notification:"bg-violet-400",Stop:"bg-orange-400",SessionStart:"bg-cyan-400",SessionEnd:"bg-gray-400"},b={PreToolUse:"bg-blue-500/15 text-blue-400 border-blue-500/30",PostToolUse:"bg-emerald-500/15 text-emerald-400 border-emerald-500/30",PermissionRequest:"bg-amber-500/15 text-amber-400 border-amber-500/30",Notification:"bg-violet-500/15 text-violet-400 border-violet-500/30",Stop:"bg-orange-500/15 text-orange-400 border-orange-500/30",SessionStart:"bg-cyan-500/15 text-cyan-400 border-cyan-500/30",SessionEnd:"bg-gray-500/15 text-gray-400 border-gray-500/30"};function j(e){let{session:t,selected:s,onSelect:a}=e,l=t.filesRead>0||t.filesWritten>0||t.commandsRun>0||t.rulesEnforced>0;return(0,r.jsxs)("button",{onClick:a,className:"w-full text-left rounded-lg px-3 py-3 transition-colors ".concat(s?"bg-primary-500/10 border border-primary-500/30":"border border-transparent hover:bg-white/[0.03]"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"h-2 w-2 shrink-0 rounded-full ".concat(l?"bg-emerald-400":"bg-gray-600")}),(0,r.jsx)("span",{className:"font-mono text-xs text-primary-400 truncate",children:t.sessionName||t.sessionId.slice(0,12)})]}),(0,r.jsx)("span",{className:"text-[10px] text-gray-600 shrink-0",children:m(t.startedAt)})]}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-400 truncate pl-4",children:g(t.projectDir)}),(0,r.jsxs)("div",{className:"mt-1.5 flex items-center gap-3 text-[10px] text-gray-600 pl-4",children:[(0,r.jsxs)("span",{children:[t.filesRead,"r"]}),(0,r.jsxs)("span",{children:[t.filesWritten,"w"]}),(0,r.jsxs)("span",{children:[t.commandsRun,"c"]}),t.rulesEnforced>0&&(0,r.jsxs)("span",{className:"text-amber-400/70",children:[t.rulesEnforced," rules"]}),t.actionsBlocked>0&&(0,r.jsxs)("span",{className:"text-red-400/70",children:[t.actionsBlocked," blocked"]})]})]})}function v(e){let{label:t,active:s}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[10px] font-medium ".concat(s?"bg-emerald-500/10 text-emerald-400":"bg-surface-800 text-gray-600"),children:[s?"+":"-"," ",t]})}function y(e){var t;let{sessionId:s}=e,[l,n]=(0,a.useState)(null),{session:i,loading:c,error:m,refresh:j}=function(e){let t=(0,o.yC)(),[s,r]=(0,a.useState)(null),[l,n]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),d=(0,a.useRef)(!1),x=(0,a.useRef)(e);x.current!==e&&(x.current=e,d.current=!1);let u=(0,a.useCallback)(async()=>{if(!e){r(null),n(!1);return}d.current||n(!0),c(null);try{let s=await t.get("/api/session?session=".concat(encodeURIComponent(e)));r(s)}catch(e){c(e instanceof Error?e.message:"Failed to load session"),r(null)}finally{d.current=!0,n(!1)}},[t,e]);return(0,a.useEffect)(()=>{u()},[u]),{session:s,loading:l,error:i,refresh:u}}(s),{events:y,loading:N,error:w,refresh:k}=function(e){let t=(0,o.yC)(),[s,r]=(0,a.useState)([]),[l,n]=(0,a.useState)(!0),[i,c]=(0,a.useState)(null),d=(0,a.useRef)(!1),x=(0,a.useRef)(e);x.current!==e&&(x.current=e,d.current=!1);let u=(0,a.useCallback)(async()=>{if(!e){r([]),n(!1);return}d.current||n(!0),c(null);try{let s=await t.get("/api/events?session=".concat(encodeURIComponent(e)));r(Array.isArray(s)?s:[])}catch(e){c(e instanceof Error?e.message:"Failed to load events"),r([])}finally{d.current=!0,n(!1)}},[t,e]);return(0,a.useEffect)(()=>{u()},[u]),{events:s,loading:l,error:i,refresh:u}}(s);(0,a.useEffect)(()=>{if(!i||"ended"===i.phase)return;let e=setInterval(()=>{j(),k()},3e3);return()=>clearInterval(e)},[i,j,k]),(0,a.useEffect)(()=>{n(null)},[s]);let C=(0,a.useMemo)(()=>{let e=y;return"read"===l?e=y.filter(e=>"Read"===e.toolName||"file_read"===e.event):"written"===l?e=y.filter(e=>"Write"===e.toolName||"Edit"===e.toolName||"file_written"===e.event):"cmds"===l?e=y.filter(e=>"Bash"===e.toolName||e.command):"rules"===l?e=y.filter(e=>e.ruleName):"blocked"===l&&(e=y.filter(e=>e.event.includes("block")||e.event.includes("deny"))),[...e].sort((e,t)=>new Date(e.ts).getTime()-new Date(t.ts).getTime())},[y,l]);return c?(0,r.jsx)(d.G,{rows:4}):m?(0,r.jsxs)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-5",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-red-400",children:"Failed to load session"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-red-400/70",children:m})]}):i?(0,r.jsxs)("div",{className:"flex flex-col h-full min-h-0",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between shrink-0",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:i.sessionName||"Session Detail"}),(0,r.jsx)("p",{className:"font-mono text-[10px] text-gray-600",children:i.sessionId})]}),(0,r.jsx)(u.W,{status:null!=(t=i.phase)?t:"active"})]}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-x-4 gap-y-1 text-xs mt-4 shrink-0",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Project "}),(0,r.jsx)("span",{className:"text-gray-300",children:g(i.projectDir)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Started "}),(0,r.jsx)("span",{className:"text-gray-300",children:h(i.startedAt)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Duration "}),(0,r.jsx)("span",{className:"text-gray-300",children:p(i.startedAt)})]}),i.branch&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Branch "}),(0,r.jsx)("span",{className:"text-gray-300 font-mono",children:i.branch})]})]}),(0,r.jsx)("div",{className:"grid grid-cols-1 gap-2 sm:grid-cols-5 mt-4 shrink-0",children:[{key:"read",label:"Files Read",value:i.filesRead.length,activeColor:"text-primary-400",icon:(0,r.jsx)("svg",{className:"h-[18px] w-[18px]",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"})})},{key:"written",label:"Files Written",value:i.filesWritten.length,activeColor:"text-primary-400",icon:(0,r.jsx)("svg",{className:"h-[18px] w-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})})},{key:"cmds",label:"Commands",value:i.commandsRun.length,activeColor:"text-primary-400",icon:(0,r.jsx)("svg",{className:"h-[18px] w-[18px]",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"})})},{key:"rules",label:"Rules Enforced",value:i.rulesEnforced,activeColor:"text-primary-400",icon:(0,r.jsx)("svg",{className:"h-[18px] w-[18px]",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"})})},{key:"blocked",label:"Blocked",value:i.actionsBlocked,activeColor:"text-primary-400",icon:(0,r.jsx)("svg",{className:"h-[18px] w-[18px]",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M18.364 18.364A9 9 0 0 0 5.636 5.636m12.728 12.728A9 9 0 0 1 5.636 5.636m12.728 12.728L5.636 5.636"})})}].map(e=>{let t=l===e.key;return(0,r.jsxs)("button",{onClick:()=>n(t?null:e.key),className:"flex items-center gap-3 rounded-lg border p-3 text-left transition-all ".concat(t?"border-primary-500/40 bg-primary-500/[0.07] ring-1 ring-primary-500/30":"border-white/[0.06] bg-surface-800/50 hover:bg-surface-800/80"),children:[(0,r.jsx)("div",{className:"shrink-0 ".concat(t?e.activeColor:"text-primary-400/50"),children:e.icon}),(0,r.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,r.jsx)("p",{className:"text-lg font-semibold text-white",children:e.value}),(0,r.jsx)("p",{className:"text-[10px] text-gray-500",children:e.label})]})]},e.key)})}),(0,r.jsxs)("div",{className:"flex flex-wrap gap-1.5 mt-4 shrink-0",children:[(0,r.jsx)(v,{label:"Tests",active:i.testsRun}),(0,r.jsx)(v,{label:"Lint",active:i.lintRun}),(0,r.jsx)(v,{label:"Build",active:i.buildRun}),(0,r.jsx)(v,{label:"Fmt",active:i.formatterRun}),(0,r.jsx)(v,{label:"Branch",active:i.branchCreated}),(0,r.jsx)(v,{label:"Plan",active:i.planApproved})]}),(0,r.jsxs)("div",{className:"flex-1 min-h-0 flex flex-col mt-4",children:[(0,r.jsxs)("div",{className:"mb-2 flex items-center justify-between shrink-0",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-xs font-semibold text-white",children:"Events"}),l&&(0,r.jsxs)("button",{onClick:()=>n(null),className:"inline-flex items-center gap-1 rounded-full bg-primary-500/15 px-2 py-0.5 text-[10px] font-medium text-primary-400 hover:bg-primary-500/25 transition-colors",children:[l,(0,r.jsx)("svg",{className:"h-2.5 w-2.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"})})]})]}),(0,r.jsx)("span",{className:"text-[10px] text-gray-600",children:l?"".concat(C.length," / ").concat(y.length):y.length||""})]}),N?(0,r.jsx)(d.G,{rows:3}):w?(0,r.jsx)("div",{className:"rounded-lg border border-red-500/20 bg-red-500/5 p-3",children:(0,r.jsx)("p",{className:"text-xs text-red-400",children:w})}):0===C.length?(0,r.jsx)("p",{className:"py-6 text-center text-xs text-gray-600",children:l?"No ".concat(l," events"):"No events recorded"}):(0,r.jsxs)("div",{className:"relative flex-1 min-h-0 overflow-y-auto",children:[(0,r.jsx)("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-white/[0.06]"}),(0,r.jsx)("div",{className:"space-y-1",children:C.map((e,t)=>{var s,a,l;let n=null!=(s=e.hookEvent)?s:"",i=null!=(a=f[n])?a:"bg-gray-500",c=null!=(l=b[n])?l:"bg-gray-500/15 text-gray-400 border-gray-500/30",o=function(e){let t=[];if(e.message&&t.push(e.message),e.toolName&&t.push("tool: ".concat(e.toolName)),e.filePath){var s;let r=null!=(s=e.filePath.split("/").pop())?s:e.filePath;t.push(r)}if(e.command){let s=e.command.length>60?e.command.slice(0,57)+"...":e.command;t.push(s)}return e.ruleName&&t.push("rule: ".concat(e.ruleName)),t.join(" | ")}(e);return(0,r.jsxs)("div",{className:"relative flex items-start gap-2",children:[(0,r.jsx)("div",{className:"relative z-10 mt-2 shrink-0",children:(0,r.jsx)("div",{className:"h-[7px] w-[7px] rounded-full ".concat(i," ring-2 ring-surface-900"),style:{marginLeft:"1px"}})}),(0,r.jsxs)("div",{className:"flex-1 min-w-0 rounded-md border border-white/[0.03] bg-surface-800/20 px-2 py-1.5 hover:bg-surface-800/40 transition-colors",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-1",children:[(0,r.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[n&&(0,r.jsx)("span",{className:"inline-flex items-center rounded px-1 py-px text-[9px] font-medium border shrink-0 ".concat(c),children:n}),(0,r.jsx)("span",{className:"text-[10px] text-gray-500 truncate",children:e.event.replace(/_/g," ")})]}),(0,r.jsx)("span",{className:"text-[9px] text-gray-700 shrink-0",children:new Date(e.ts).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"})})]}),o&&(0,r.jsx)("p",{className:"mt-0.5 text-[10px] text-gray-600 font-mono truncate",children:o})]})]},"".concat(e.ts,"-").concat(e.event,"-").concat(t))})})]})]})]}):(0,r.jsx)(x.p,{title:"Session not found",description:'No session found with ID "'.concat(s,'".')})}function N(){var e;let t=(0,l.useRouter)(),s=(0,l.useSearchParams)(),n=null!=(e=null==s?void 0:s.get("id"))?e:null,{sessions:i,loading:c,error:x}=function(){let e=(0,o.yC)(),[t,s]=(0,a.useState)([]),[r,l]=(0,a.useState)(!0),[n,i]=(0,a.useState)(null),c=(0,a.useRef)(!1),d=(0,a.useCallback)(async()=>{c.current||l(!0),i(null);try{let t=await e.get("/api/sessions");s(Array.isArray(t)?t:[])}catch(e){i(e instanceof Error?e.message:"Failed to fetch sessions")}finally{c.current=!0,l(!1)}},[e]);return(0,a.useEffect)(()=>{d()},[d]),{sessions:t,loading:r,error:n,refresh:d}}(),u=(0,a.useCallback)(e=>{t.push("/sessions?id=".concat(encodeURIComponent(e)),{scroll:!1})},[t]);return(0,r.jsxs)("div",{className:"flex flex-col h-[calc(100vh-32px)]",children:[(0,r.jsxs)("div",{className:"shrink-0",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Sessions"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Session history and event timeline."})]}),(0,r.jsxs)("div",{className:"flex gap-4 flex-1 min-h-0 mt-4",children:[(0,r.jsx)("div",{className:"w-1/3 min-w-[280px] max-w-[400px] shrink-0 overflow-y-auto rounded-xl border border-white/[0.06] bg-surface-900 p-2",children:c?(0,r.jsx)(d.G,{rows:6}):x?(0,r.jsx)("div",{className:"p-3",children:(0,r.jsx)("p",{className:"text-xs text-red-400",children:x})}):0===i.length?(0,r.jsxs)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:[(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"No sessions found"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-600",children:"Start a Claude Code session with ULPI hooks."})]}):(0,r.jsx)("div",{className:"space-y-0.5",children:i.map(e=>(0,r.jsx)(j,{session:e,selected:e.sessionId===n,onSelect:()=>u(e.sessionId)},e.sessionId))})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 rounded-xl border border-white/[0.06] bg-surface-900 p-5 overflow-hidden flex flex-col",children:n?(0,r.jsx)(y,{sessionId:n}):(0,r.jsxs)("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[(0,r.jsx)("svg",{className:"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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"})}),(0,r.jsx)("p",{className:"mt-3 text-sm text-gray-500",children:"Select a session"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-600",children:"Click a session on the left to view its details and events."})]})})]})]})}let w={active:"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",idle:"bg-yellow-500/10 text-yellow-400 border-yellow-500/20",ended:"bg-gray-500/10 text-gray-400 border-gray-500/20"};function k(e){var t;let{status:s}=e;return(0,r.jsxs)("span",{className:"inline-flex items-center rounded-md border px-2 py-0.5 text-[11px] font-medium ".concat(null!=(t=w[s])?t:w.ended),children:["active"===s&&(0,r.jsx)("span",{className:"mr-1.5 h-1.5 w-1.5 rounded-full bg-emerald-400 animate-pulse"}),s]})}let C=[{label:"All",value:""},{label:"Active",value:"active"},{label:"Idle",value:"idle"},{label:"Ended",value:"ended"}];function S(){var e,t;let s=(0,l.useRouter)(),n=(0,l.useSearchParams)(),o=null!=(e=null==n?void 0:n.get("id"))?e:null,{org:u}=(0,i.As)(),[g,f]=(0,a.useState)([]),[b,j]=(0,a.useState)(!0),[v,y]=(0,a.useState)(""),[N,w]=(0,a.useState)(null),[S,_]=(0,a.useState)(!1),L=(0,a.useCallback)(async()=>{if(u){j(!0);try{let e=await c.uE.listSessions(u.id,{status:v||void 0});f(e.sessions)}catch(e){}finally{j(!1)}}},[u,v]);(0,a.useEffect)(()=>{L()},[L]),(0,a.useEffect)(()=>{if(!g.some(e=>"active"===e.status))return;let e=setInterval(()=>void L(),5e3);return()=>clearInterval(e)},[g,L]),(0,a.useEffect)(()=>{if(!u||!o)return void w(null);_(!0),c.uE.getSession(u.id,o).then(e=>w(e)).catch(()=>w(null)).finally(()=>_(!1))},[u,o]);let E=(0,a.useCallback)(e=>{s.push("/sessions?id=".concat(encodeURIComponent(e)),{scroll:!1})},[s]);return(0,r.jsxs)("div",{className:"flex flex-col h-[calc(100vh-32px)]",children:[(0,r.jsxs)("div",{className:"flex items-center justify-between shrink-0",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Sessions"}),(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:"Live and recent worker sessions."})]}),(0,r.jsx)("div",{className:"inline-flex rounded-lg bg-surface-900 p-1",children:C.map(e=>(0,r.jsx)("button",{onClick:()=>y(e.value),className:"rounded-md px-3 py-1.5 text-xs font-medium transition-colors ".concat(v===e.value?"bg-surface-750 text-white":"text-gray-400 hover:text-gray-300"),children:e.label},e.value))})]}),(0,r.jsxs)("div",{className:"flex gap-4 flex-1 min-h-0 mt-4",children:[(0,r.jsx)("div",{className:"w-1/3 min-w-[280px] max-w-[400px] shrink-0 overflow-y-auto rounded-xl border border-white/[0.06] bg-surface-900 p-2",children:b?(0,r.jsx)(d.G,{rows:6}):0===g.length?(0,r.jsx)("div",{className:"flex flex-col items-center justify-center py-12 text-center",children:(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"No sessions found"})}):(0,r.jsx)("div",{className:"space-y-0.5",children:g.map(e=>(0,r.jsxs)("button",{onClick:()=>E(e.id),className:"w-full text-left rounded-lg px-3 py-3 transition-colors ".concat(e.id===o?"bg-primary-500/10 border border-primary-500/30":"border border-transparent hover:bg-white/[0.03]"),children:[(0,r.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,r.jsx)("span",{className:"font-mono text-xs text-primary-400 truncate",children:e.id.slice(0,12)}),(0,r.jsx)(k,{status:e.status})]}),(0,r.jsx)("span",{className:"text-[10px] text-gray-600 shrink-0",children:m(e.last_activity_at)})]}),e.repo_full_name&&(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-400 truncate pl-0",children:e.repo_full_name}),e.current_task&&(0,r.jsx)("p",{className:"mt-0.5 text-[10px] text-gray-600 truncate",children:e.current_task})]},e.id))})}),(0,r.jsx)("div",{className:"flex-1 min-w-0 overflow-y-auto rounded-xl border border-white/[0.06] bg-surface-900 p-5",children:o?S?(0,r.jsx)(d.G,{rows:4}):N?(0,r.jsxs)("div",{className:"space-y-4",children:[(0,r.jsx)("div",{className:"flex items-start justify-between",children:(0,r.jsxs)("div",{children:[(0,r.jsxs)("div",{className:"flex items-center gap-3",children:[(0,r.jsx)("h2",{className:"text-base font-semibold text-white",children:"Session"}),(0,r.jsx)(k,{status:N.status})]}),N.repo_full_name&&(0,r.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:N.repo_full_name})]})}),(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-x-6 gap-y-2 text-xs sm:grid-cols-3",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Agent "}),(0,r.jsx)("span",{className:"text-gray-300",children:null!=(t=N.agent_type)?t:"claude"})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Duration "}),(0,r.jsx)("span",{className:"text-gray-300",children:p(N.started_at,N.ended_at)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Files "}),(0,r.jsx)("span",{className:"text-gray-300",children:N.files_changed})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Started "}),(0,r.jsx)("span",{className:"text-gray-300",children:h(N.started_at)})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Last Activity "}),(0,r.jsx)("span",{className:"text-gray-300",children:h(N.last_activity_at)})]})]}),N.current_task&&(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-950/50 px-3 py-2",children:[(0,r.jsx)("span",{className:"text-[9px] font-medium uppercase tracking-widest text-gray-600",children:"Current Task"}),(0,r.jsx)("p",{className:"mt-1 text-xs text-gray-300",children:N.current_task})]}),N.output_tail&&(0,r.jsxs)("div",{className:"rounded-lg border border-white/[0.06] bg-surface-950 overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-white/[0.06] px-3 py-1.5",children:(0,r.jsx)("span",{className:"text-[10px] font-medium text-gray-500",children:"Output"})}),(0,r.jsx)("div",{className:"px-3 py-2 max-h-64 overflow-y-auto",children:(0,r.jsx)("pre",{className:"whitespace-pre-wrap break-all text-[10px] font-mono text-gray-500",children:N.output_tail})})]})]}):(0,r.jsx)(x.p,{title:"Session not found",description:"Could not load session details."}):(0,r.jsxs)("div",{className:"flex h-full flex-col items-center justify-center text-center",children:[(0,r.jsx)("svg",{className:"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:"M3.75 6.75h16.5M3.75 12h16.5m-16.5 5.25H12"})}),(0,r.jsx)("p",{className:"mt-3 text-sm text-gray-500",children:"Select a session"})]})})]})]})}function _(){return(0,n.J)()?(0,r.jsx)(N,{}):(0,r.jsx)(S,{})}}},e=>{e.O(0,[8934,814,9743,7358],()=>e(e.s=759)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1670],{27:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>z});var n=a(8111),s=a(5271),l=a(8934),r=a(3446),i=a(2928),o=a(5935),d=a.n(o);function c(e){var t,a;let{items:l}=e,[r,i]=(0,s.useState)(null!=(a=null==(t=l[0])?void 0:t.id)?a:"");return(0,s.useEffect)(()=>{let e=new IntersectionObserver(e=>{for(let t of e)t.isIntersecting&&i(t.target.id)},{rootMargin:"-20% 0px -70% 0px"});for(let t of l){let a=document.getElementById(t.id);a&&e.observe(a)}return()=>e.disconnect()},[l]),(0,n.jsx)("nav",{className:"hidden lg:block sticky top-24 self-start space-y-0.5 w-48 shrink-0",children:l.map(e=>(0,n.jsx)("button",{onClick:()=>{let t=document.getElementById(e.id);null==t||t.scrollIntoView({behavior:"smooth",block:"start"})},className:"block w-full text-left rounded-lg px-3 py-1.5 text-xs transition-colors ".concat(r===e.id?"bg-primary-500/10 text-primary-400 font-medium":"text-gray-500 hover:text-gray-300 hover:bg-surface-800"),children:e.label},e.id))})}function u(e){let{id:t,icon:a,title:l,description:r,defaultOpen:i,children:o}=e,[d,c]=(0,s.useState)(null==i||i);return(0,n.jsxs)("section",{id:t,children:[(0,n.jsxs)("button",{type:"button",onClick:()=>c(!d),className:"flex w-full items-center gap-3 mb-4 group cursor-pointer",children:[(0,n.jsx)("div",{className:"flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-surface-800 text-gray-500",children:a}),(0,n.jsxs)("div",{className:"text-left flex-1",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-white",children:l}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:r})]}),(0,n.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-600 transition-transform ".concat(d?"rotate-180":""),fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})})]}),d&&(0,n.jsx)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-5 space-y-4",children:o})]})}function x(e){var t;let{version:a,username:s,usernameInput:l,setUsernameInput:r,savingUsername:i,saveUsername:o}=e;return(0,n.jsxs)(u,{id:"general",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})}),title:"General",description:"Version and identity",defaultOpen:!0,children:[(0,n.jsx)("div",{className:"flex items-center justify-between",children:(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{className:"text-sm text-gray-400",children:["Version:"," ",(0,n.jsx)("span",{className:"font-mono font-medium text-white",children:null!=(t=null==a?void 0:a.current)?t:"..."})]}),(null==a?void 0:a.updateAvailable)&&(0,n.jsxs)("p",{className:"mt-0.5 text-xs text-amber-400",children:["Update available: ",(0,n.jsxs)("span",{className:"font-mono",children:["v",a.latest]})," ","— ",(0,n.jsx)("code",{className:"text-gray-500",children:"ulpi update"})]}),a&&!a.updateAvailable&&(0,n.jsx)("p",{className:"mt-0.5 text-xs text-emerald-400",children:"Up to date"})]})}),(0,n.jsxs)("div",{className:"border-t border-white/[0.04] pt-4",children:[(0,n.jsxs)("div",{className:"mb-2",children:[(0,n.jsx)("p",{className:"text-sm font-medium text-white",children:"Username"}),(0,n.jsx)("p",{className:"text-xs text-gray-500 mt-0.5",children:"Used for per-user branch naming. Leave empty to auto-detect."})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("input",{type:"text",placeholder:"e.g. your-github-username",value:l,onChange:e=>r(e.target.value),onBlur:o,onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},disabled:i,className:"flex-1 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:opacity-50"}),i&&(0,n.jsx)("span",{className:"text-xs text-gray-500",children:"Saving..."})]}),s&&(0,n.jsxs)("div",{className:"mt-3 space-y-0.5",children:[(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["History branch: ",(0,n.jsx)("span",{className:"font-mono text-gray-300",children:s.resolvedHistoryBranch})]}),(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["CodeMap branch: ",(0,n.jsx)("span",{className:"font-mono text-gray-300",children:s.resolvedCodemapBranch})]}),(0,n.jsxs)("p",{className:"text-xs text-gray-500",children:["Memory branch: ",(0,n.jsx)("span",{className:"font-mono text-gray-300",children:s.resolvedMemoryBranch})]}),"settings"!==s.source&&(0,n.jsxs)("p",{className:"text-[10px] text-gray-600 mt-1",children:["Auto-detected from: ",s.source]})]})]})]})}function m(e){let{label:t,maskedValue:a,onSet:l,onClear:r}=e,[i,o]=(0,s.useState)(!1),[d,c]=(0,s.useState)("");return i?(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)("p",{className:"text-sm text-white shrink-0",children:t}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("input",{type:"text",value:d,onChange:e=>c(e.target.value),onKeyDown:e=>{"Enter"===e.key&&d.trim()&&(l(d.trim()),o(!1),c("")),"Escape"===e.key&&(o(!1),c(""))},autoFocus:!0,placeholder:"Paste API key...",className:"w-64 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 font-mono text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),(0,n.jsx)("button",{onClick:()=>{d.trim()&&(l(d.trim()),o(!1),c(""))},className:"rounded-lg bg-primary-500 px-2.5 py-1.5 text-xs font-medium text-white hover:bg-primary-600",children:"Save"}),(0,n.jsx)("button",{onClick:()=>{o(!1),c("")},className:"rounded-lg border border-white/[0.08] bg-surface-800 px-2.5 py-1.5 text-xs text-gray-400 hover:text-white",children:"Cancel"})]})]}):(0,n.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,n.jsx)("p",{className:"text-sm text-white shrink-0",children:t}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[a?(0,n.jsx)("span",{className:"font-mono text-xs text-gray-400",children:a}):(0,n.jsx)("span",{className:"text-xs text-gray-600",children:"Not set"}),(0,n.jsx)("button",{onClick:()=>o(!0),className:"rounded-lg border border-white/[0.08] bg-surface-800 px-2.5 py-1 text-xs text-gray-400 hover:text-white",children:a?"Change":"Set"}),a&&(0,n.jsx)("button",{onClick:r,className:"rounded-lg border border-red-500/20 bg-red-500/5 px-2.5 py-1 text-xs text-red-400 hover:bg-red-500/10",children:"Clear"})]})]})}function p(e){let{apiKeys:t,onSet:a,onClear:s}=e;return(0,n.jsxs)(u,{id:"api-keys",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})}),title:"API Keys",description:"Manage provider API keys",defaultOpen:!0,children:[t?(0,n.jsxs)("div",{className:"space-y-3",children:[(0,n.jsx)(m,{label:"OpenAI",maskedValue:t.openai,onSet:e=>a("openai",e),onClear:()=>s("openai")}),(0,n.jsx)("div",{className:"border-t border-white/[0.04]"}),(0,n.jsx)(m,{label:"Anthropic",maskedValue:t.anthropic,onSet:e=>a("anthropic",e),onClear:()=>s("anthropic")}),(0,n.jsx)("div",{className:"border-t border-white/[0.04]"}),(0,n.jsx)(m,{label:"ULPI",maskedValue:t.ulpi,onSet:e=>a("ulpi",e),onClear:()=>s("ulpi")})]}):(0,n.jsx)("p",{className:"text-xs text-gray-600",children:"Loading API keys..."}),(0,n.jsx)("p",{className:"text-[10px] text-gray-600 mt-3",children:"Keys are stored in ~/.ulpi/settings.json. Environment variables (OPENAI_API_KEY, ANTHROPIC_API_KEY) are used as fallback."})]})}let h=[{value:"openai",label:"OpenAI"},{value:"ollama",label:"Ollama"},{value:"ulpi",label:"ULPI"}],g=[{id:"text-embedding-3-small",label:"text-embedding-3-small",dimensions:1536},{id:"text-embedding-3-large",label:"text-embedding-3-large",dimensions:3072}],b=[{id:"code",label:"code",dimensions:1024},{id:"memory",label:"memory",dimensions:1024}];function v(e){let{label:t,provider:a,model:s,dimensions:l,saving:r,onSave:i}=e;return(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-gray-400",children:t}),(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,n.jsx)("select",{value:a,onChange:e=>{let t=e.target.value;"openai"===t?i({provider:t,model:"text-embedding-3-small",dimensions:1536}):"ollama"===t?i({provider:t,model:"nomic-embed-text",dimensions:768}):i({provider:t})},className:"rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs text-white outline-none focus:border-primary-500/50",children:h.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))}),"openai"===a&&(0,n.jsx)("select",{value:s,onChange:e=>{var t;let a=g.find(t=>t.id===e.target.value);i({model:e.target.value,dimensions:null!=(t=null==a?void 0:a.dimensions)?t:l})},className:"rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs text-white outline-none focus:border-primary-500/50",children:g.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))}),"ollama"===a&&(0,n.jsx)("input",{type:"text",value:s,onChange:e=>i({model:e.target.value}),placeholder:"model name",className:"w-48 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 font-mono text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),"ulpi"===a&&(0,n.jsx)("select",{value:s,onChange:e=>{var t;let a=b.find(t=>t.id===e.target.value);i({model:e.target.value,dimensions:null!=(t=null==a?void 0:a.dimensions)?t:l})},className:"rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs text-white outline-none focus:border-primary-500/50",children:b.map(e=>(0,n.jsx)("option",{value:e.id,children:e.label},e.id))}),"openai"!==a&&"ollama"!==a&&"ulpi"!==a&&(0,n.jsx)("input",{type:"text",value:s,onChange:e=>i({model:e.target.value}),placeholder:"model name",className:"w-48 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 font-mono text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"}),(0,n.jsxs)("span",{className:"text-[10px] text-gray-600",children:[l,"d"]}),r&&(0,n.jsx)("span",{className:"text-[10px] text-gray-500",children:"Saving..."})]})]})}function f(e){let{codemapConfig:t,memoryConfig:a,savingCodemap:s,savingMemory:l,onSaveCodemap:r,onSaveMemory:i}=e;return(0,n.jsxs)(u,{id:"embeddings",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})}),title:"AI & Embeddings",description:"Embedding provider configuration",defaultOpen:!0,children:[t&&(0,n.jsx)(v,{label:"CodeMap Embeddings",provider:t.embedding.provider,model:t.embedding.model,dimensions:t.embedding.dimensions,saving:s,onSave:r}),a&&(0,n.jsx)(v,{label:"Memory Embeddings",provider:a.embedding.provider,model:a.embedding.model,dimensions:a.embedding.dimensions,saving:l,onSave:i}),!t&&!a&&(0,n.jsx)("p",{className:"text-xs text-gray-600",children:"Loading embedding configuration..."})]})}function y(e){let{label:t,description:a,value:s,onChange:l,options:r}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm text-white",children:t}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:a})]}),(0,n.jsx)("select",{value:s,onChange:e=>l(e.target.value),className:"rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs text-white outline-none focus:border-primary-500/50",children:r.map(e=>(0,n.jsx)("option",{value:e.value,children:e.label},e.value))})]})}function j(e){let{label:t,description:a,value:l,onChange:r,min:i,max:o,step:d}=e,[c,u]=(0,s.useState)(String(l));return(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm text-white",children:t}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:a})]}),(0,n.jsx)("input",{type:"number",min:i,max:o,step:d,value:c,onChange:e=>u(e.target.value),onBlur:()=>{let e=parseInt(c,10);isNaN(e)?u(String(l)):r(e)},className:"w-24 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-sm text-white text-right outline-none focus:border-primary-500/50"})]})}var w=a(3310);let N=w.jw.map(e=>({value:e.value,label:e.label}));function k(e){var t,a,s,l,r;let{config:i,onUpdate:o}=e;if(!i)return null;let d=null!=(t=i.provider)?t:"claude",c=(0,w.F_)(d),x=c.length>0?c.map(e=>({value:e.value,label:e.label})):[{value:null!=(a=i.model)?a:"",label:i.model||"Default"}];return(0,n.jsxs)(u,{id:"agent",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.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.25Zm.75-12h9v9h-9v-9Z"})}),title:"Agent",description:"Default agent provider and model",defaultOpen:!0,children:[(0,n.jsx)(y,{label:"Provider",description:"AI agent provider for loop execution",value:d,onChange:e=>o({provider:e,model:(0,w.fZ)(e)}),options:N}),(0,n.jsx)(y,{label:"Model",description:"Model to use for task execution",value:null!=(s=i.model)?s:(0,w.fZ)(d),onChange:e=>o({model:e}),options:x}),(0,n.jsx)(j,{label:"Max Tokens",description:"Maximum output tokens per request",value:null!=(l=i.maxTokens)?l:16e3,onChange:e=>o({maxTokens:e}),min:1e3,max:2e5,step:1e3}),(0,n.jsx)(j,{label:"Temperature",description:"Sampling temperature (0-100, divided by 100)",value:Math.round((null!=(r=i.temperature)?r:0)*100),onChange:e=>o({temperature:e/100}),min:0,max:100,step:5})]})}function C(e){let{checked:t,onChange:a}=e;return(0,n.jsx)("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>a(!t),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,n.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 S(e){let{label:t,description:a,checked:s,onChange:l}=e;return(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm text-white",children:t}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:a})]}),(0,n.jsx)(C,{checked:s,onChange:l})]})}let M=[{value:"retry",label:"Retry"},{value:"skip",label:"Skip"},{value:"abort",label:"Abort"}];function L(e){var t,a,s,l,r,i;let{config:o,onUpdate:d}=e;return o?(0,n.jsxs)(u,{id:"loop",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182"})}),title:"Loop Engine",description:"Execution loop defaults",children:[(0,n.jsx)(j,{label:"Max Retries",description:"Retries per task on failure",value:null!=(t=o.maxRetries)?t:3,onChange:e=>d({maxRetries:e}),min:0,max:20,step:1}),(0,n.jsx)(j,{label:"Retry Delay (ms)",description:"Wait between retries",value:null!=(a=o.retryDelayMs)?a:1e3,onChange:e=>d({retryDelayMs:e}),min:0,max:6e4,step:500}),(0,n.jsx)(j,{label:"Timeout (ms)",description:"Max time per task execution",value:null!=(s=o.timeout)?s:3e5,onChange:e=>d({timeout:e}),min:1e4,max:36e5,step:1e4}),(0,n.jsx)(j,{label:"Max Iterations",description:"Maximum loop iterations per run",value:null!=(l=o.maxIterations)?l:50,onChange:e=>d({maxIterations:e}),min:1,max:500,step:1}),(0,n.jsx)(y,{label:"Error Strategy",description:"How to handle task failures",value:null!=(r=o.errorStrategy)?r:"retry",onChange:e=>d({errorStrategy:e}),options:M}),(0,n.jsx)(S,{label:"Auto-commit",description:"Automatically commit after each task",checked:null!=(i=o.autoCommit)&&i,onChange:e=>d({autoCommit:e})})]}):null}function A(e){let{historyStatus:t,historyConfig:a,savingHistory:s,initingHistory:l,updateHistoryField:r,handleInitHistory:i}=e;return(0,n.jsxs)(u,{id:"history",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.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"})}),title:"History",description:"Shadow branch session recording",children:[(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsxs)("p",{className:"text-sm text-gray-400",children:["Status:"," ",(null==t?void 0:t.exists)?(0,n.jsxs)("span",{className:"font-medium text-emerald-400",children:["Active — ",t.totalEntries," entries"]}):(0,n.jsx)("span",{className:"font-medium text-gray-600",children:"Not initialized"})]}),(null==t?void 0:t.branch)&&(0,n.jsxs)("p",{className:"text-xs text-gray-500 mt-0.5",children:["Branch: ",(0,n.jsx)("span",{className:"font-mono text-gray-400",children:t.branch})]})]}),!(null==t?void 0:t.exists)&&(0,n.jsx)("button",{onClick:i,disabled:l,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:l?"Initializing...":"Initialize"})]}),(null==t?void 0:t.exists)&&a&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"border-t border-white/[0.04] pt-4"}),(0,n.jsx)(S,{label:"Enabled",description:"Automatically record sessions to history",checked:a.enabled,onChange:e=>r({enabled:e})}),(0,n.jsx)(S,{label:"Capture transcripts",description:"Include conversation transcripts in history",checked:a.captureTranscript,onChange:e=>r({captureTranscript:e})}),(0,n.jsx)(S,{label:"AI enrichment",description:"Auto-generate summaries and insights for entries",checked:a.aiEnrichment,onChange:e=>r({aiEnrichment:e})}),(0,n.jsx)(j,{label:"Max diff size",description:"Maximum characters to store per diff",value:a.maxDiffSize,onChange:e=>r({maxDiffSize:e}),min:1e3,max:5e5,step:1e3}),s&&(0,n.jsx)("p",{className:"text-[10px] text-gray-600",children:"Saving..."})]})]})}function E(e){let{label:t,description:a,tags:l,onChange:r}=e,[i,o]=(0,s.useState)(""),d=()=>{let e=i.trim();e&&!l.includes(e)&&r([...l,e]),o("")};return(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"text-sm text-white",children:t}),(0,n.jsx)("p",{className:"text-xs text-gray-500 mb-2",children:a}),(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 mb-2",children:l.map(e=>(0,n.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-surface-800 px-2.5 py-0.5 text-xs text-gray-300",children:[(0,n.jsx)("span",{className:"font-mono",children:e}),(0,n.jsx)("button",{onClick:()=>r(l.filter(t=>t!==e)),className:"text-gray-500 hover:text-red-400",children:"\xd7"})]},e))}),(0,n.jsx)("input",{type:"text",value:i,onChange:e=>o(e.target.value),onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),d())},onBlur:d,placeholder:"Type and press Enter...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]})}function P(e){var t,a;let{config:s,onUpdate:l}=e,r=null!=s?s:{};return(0,n.jsxs)(u,{id:"codemap",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 3v11.25A2.25 2.25 0 0 0 6 16.5h2.25M3.75 3h-1.5m1.5 0h16.5m0 0h1.5m-1.5 0v11.25A2.25 2.25 0 0 1 18 16.5h-2.25m-7.5 0h7.5m-7.5 0-1 3m8.5-3 1 3m0 0 .5 1.5m-.5-1.5h-9.5m0 0-.5 1.5M9 11.25v1.5M12 9v3.75m3-6v6"})}),title:"CodeMap",description:"Semantic code search and indexing",children:[(0,n.jsx)(S,{label:"Auto-index",description:"Automatically index files on change",checked:null==(t=r.autoIndex)||t,onChange:e=>l({autoIndex:e})}),(0,n.jsx)(E,{label:"Exclude patterns",description:"Glob patterns to exclude from indexing (gitignore-style)",tags:null!=(a=r.excludePatterns)?a:[],onChange:e=>l({excludePatterns:e})})]})}let I=[{value:"auto",label:"Auto"},{value:"manual",label:"Manual"},{value:"off",label:"Off"}];function O(e){var t,a,l,r,i,o,d,c,x,m,p,h;let{config:g,status:b,client:v,onUpdate:f}=e,w=null!=g?g:{},[N,k]=(0,s.useState)(null),[C,M]=(0,s.useState)(null),L=(0,s.useCallback)(async(e,t)=>{k(e),M(null);try{var a;let n=await v.post("/api/memory/action",{action:e});M(null!=(a=n.message)?a:"".concat(t," completed."))}catch(e){M(e instanceof Error?e.message:"".concat(t," failed"))}finally{k(null)}},[v]);return(0,n.jsxs)(u,{id:"memory",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M20.25 6.375c0 2.278-3.694 4.125-8.25 4.125S3.75 8.653 3.75 6.375m16.5 0c0-2.278-3.694-4.125-8.25-4.125S3.75 4.097 3.75 6.375m16.5 0v11.25c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125V6.375m16.5 0v3.75m-16.5-3.75v3.75m16.5 0v3.75C20.25 16.153 16.556 18 12 18s-8.25-1.847-8.25-4.125v-3.75m16.5 0c0 2.278-3.694 4.125-8.25 4.125s-8.25-1.847-8.25-4.125"})}),title:"Memory",description:"Agent memory capture and retrieval",children:[b&&(0,n.jsx)("div",{className:"flex items-center justify-between",children:(0,n.jsx)("div",{children:(0,n.jsxs)("p",{className:"text-sm text-gray-400",children:["Status:"," ",b.initialized?(0,n.jsxs)("span",{className:"font-medium text-emerald-400",children:["Active — ",null!=(r=null==(t=b.stats)?void 0:t.totalMemories)?r:0," memories"]}):(0,n.jsx)("span",{className:"font-medium text-gray-600",children:"Not initialized"})]})})}),(0,n.jsx)("div",{className:"border-t border-white/[0.04] pt-4"}),(0,n.jsx)(S,{label:"Enabled",description:"Enable memory capture and retrieval",checked:null==(i=w.enabled)||i,onChange:e=>f({enabled:e})}),(0,n.jsx)(S,{label:"Auto-classify",description:"Automatically classify new sessions to discover memories",checked:null==(o=w.autoClassify)||o,onChange:e=>f({autoClassify:e})}),(0,n.jsx)(y,{label:"Capture Mode",description:"How memories are captured",value:null!=(d=w.captureMode)?d:"auto",onChange:e=>f({captureMode:e}),options:I}),(0,n.jsx)(S,{label:"Surface on start",description:"Show relevant memories at session start",checked:null==(c=w.surfaceOnStart)||c,onChange:e=>f({surfaceOnStart:e})}),(0,n.jsx)(j,{label:"Surface limit",description:"Max memories to surface per session",value:null!=(x=w.surfaceLimit)?x:5,onChange:e=>f({surfaceLimit:e}),min:1,max:50,step:1}),(0,n.jsxs)("div",{className:"border-t border-white/[0.04] pt-4",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-gray-400 mb-3",children:"Retention"}),(0,n.jsxs)("div",{className:"space-y-4",children:[(0,n.jsx)(j,{label:"Max memories",description:"Maximum number of memories to keep",value:null!=(m=null==(a=w.retention)?void 0:a.maxMemories)?m:1e3,onChange:e=>f({retention:{...w.retention,maxMemories:e}}),min:10,max:1e5,step:100}),(0,n.jsx)(j,{label:"Max age (days)",description:"Auto-delete memories older than this",value:null!=(p=null==(l=w.retention)?void 0:l.maxAgeDays)?p:365,onChange:e=>f({retention:{...w.retention,maxAgeDays:e}}),min:7,max:3650,step:30})]})]}),(0,n.jsx)(E,{label:"Redact patterns",description:"Regex patterns to redact from captured content",tags:null!=(h=w.redactPatterns)?h:[],onChange:e=>f({redactPatterns:e})}),(0,n.jsxs)("div",{className:"border-t border-white/[0.04] pt-4",children:[(0,n.jsx)("p",{className:"text-xs font-medium text-gray-400 mb-3",children:"Actions"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:[{action:"reindex",label:"Reindex"},{action:"export",label:"Export"},{action:"import",label:"Import"}].map(e=>{let{action:t,label:a}=e;return(0,n.jsxs)("button",{onClick:()=>void L(t,a),disabled:null!==N,className:"inline-flex items-center gap-2 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-xs font-medium text-gray-300 transition-colors hover:bg-surface-700 hover:text-white disabled:cursor-not-allowed disabled:opacity-50",children:[N===t&&(0,n.jsx)("span",{className:"h-3 w-3 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"}),a]},t)})}),C&&(0,n.jsx)("p",{className:"mt-2 text-[10px] text-blue-400",children:C})]})]})}let B=[{value:"none",label:"None"},{value:"bwrap",label:"Bubblewrap (bwrap)"},{value:"sandbox-exec",label:"sandbox-exec (macOS)"}];function U(e){var t,a,s,l,r;let{config:i,onUpdate:o}=e,d=null!=i?i:{};return(0,n.jsxs)(u,{id:"sandbox",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 7.5-2.25-1.313M21 7.5v2.25m0-2.25-2.25 1.313M3 7.5l2.25-1.313M3 7.5l2.25 1.313M3 7.5v2.25m9 3 2.25-1.313M12 12.75l-2.25-1.313M12 12.75V15m0 6.75 2.25-1.313M12 21.75V19.5m0 2.25-2.25-1.313m0-16.875L12 2.25l2.25 1.313M21 14.25v2.25l-2.25 1.313m-13.5 0L3 16.5v-2.25"})}),title:"Sandbox",description:"Sandbox and container isolation",children:[(0,n.jsx)(S,{label:"Enabled",description:"Run agent tasks in a sandbox",checked:null!=(t=d.enabled)&&t,onChange:e=>o({enabled:e})}),(0,n.jsx)(y,{label:"Mode",description:"Sandbox technology to use",value:null!=(a=d.mode)?a:"none",onChange:e=>o({mode:e}),options:B}),(0,n.jsx)(S,{label:"Allow network",description:"Allow network access inside sandbox",checked:null!=(s=d.allowNetwork)&&s,onChange:e=>o({allowNetwork:e})}),(0,n.jsx)(E,{label:"Allowed paths",description:"Paths accessible inside the sandbox",tags:null!=(l=d.allowedPaths)?l:[],onChange:e=>o({allowedPaths:e})}),(0,n.jsx)(E,{label:"Read-only paths",description:"Paths mounted read-only in sandbox",tags:null!=(r=d.readOnlyPaths)?r:[],onChange:e=>o({readOnlyPaths:e})})]})}function H(e){let{label:t,description:a,value:l,onChange:r,placeholder:i}=e,[o,d]=(0,s.useState)(l);return(0,n.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,n.jsxs)("div",{className:"min-w-0",children:[(0,n.jsx)("p",{className:"text-sm text-white",children:t}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:a})]}),(0,n.jsx)("input",{type:"text",value:o,onChange:e=>d(e.target.value),onBlur:()=>{o!==l&&r(o)},onKeyDown:e=>{"Enter"===e.key&&e.target.blur()},placeholder:i,className:"w-48 rounded-lg border border-white/[0.08] bg-surface-800 px-3 py-1.5 text-sm text-white placeholder-gray-600 outline-none focus:border-primary-500/50"})]})}function T(e){var t,a,s;let{config:l,onUpdate:r}=e,i=null!=l?l:{};return(0,n.jsxs)(u,{id:"remote",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.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"})}),title:"Remote",description:"Remote agent connections",children:[(0,n.jsx)(S,{label:"Enabled",description:"Accept remote agent connections via WebSocket",checked:null!=(t=i.enabled)&&t,onChange:e=>r({enabled:e})}),(0,n.jsx)(j,{label:"Port",description:"WebSocket server port",value:null!=(a=i.port)?a:9900,onChange:e=>r({port:e}),min:1024,max:65535,step:1}),(0,n.jsx)(H,{label:"Host",description:"Bind address for the remote server",value:null!=(s=i.host)?s:"127.0.0.1",onChange:e=>r({host:e}),placeholder:"127.0.0.1"})]})}let D=[{id:"general",label:"General"},{id:"api-keys",label:"API Keys"},{id:"embeddings",label:"AI & Embeddings"},{id:"agent",label:"Agent"},{id:"loop",label:"Loop Engine"},{id:"history",label:"History"},{id:"codemap",label:"CodeMap"},{id:"memory",label:"Memory"},{id:"sandbox",label:"Sandbox"},{id:"remote",label:"Remote"}];function _(e){let{href:t,icon:a,title:s,description:l}=e;return(0,n.jsxs)(d(),{href:t,className:"group flex items-center gap-4 rounded-xl border border-white/[0.06] bg-surface-900 p-4 transition-colors hover:bg-surface-850",children:[(0,n.jsx)("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-surface-800 text-gray-500 group-hover:text-gray-400 transition-colors",children:a}),(0,n.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-200 group-hover:text-white transition-colors",children:s}),(0,n.jsx)("p",{className:"mt-0.5 text-xs text-gray-500",children:l})]}),(0,n.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-700 group-hover:text-gray-400 transition-colors",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})})]})}function R(){var e,t,a,l,i;let{localClient:o}=(0,r.HI)(),{tomlConfig:d,updateTomlSection:u,apiKeys:m,setApiKey:h}=function(e){let[t,a]=(0,s.useState)(null),[n,l]=(0,s.useState)(!0),[r,i]=(0,s.useState)(null),[o,d]=(0,s.useState)(!0),[c,u]=(0,s.useState)(null);(0,s.useEffect)(()=>{e.get("/api/settings/config").then(e=>a(e)).catch(()=>a({})).finally(()=>l(!1)),e.get("/api/settings/api-keys").then(i).catch(()=>{}).finally(()=>d(!1))},[e]);let x=(0,s.useCallback)(async(n,s)=>{u(n);try{var l;let r={...null!=(l=null==t?void 0:t[n])?l:{},...s};a(e=>e?{...e,[n]:r}:{[n]:r});let i=await e.put("/api/settings/config",{[n]:r});a(i)}catch(t){a(await e.get("/api/settings/config").catch(()=>({})))}finally{u(null)}},[t,e]);return{tomlConfig:t,tomlLoading:n,updateTomlSection:x,apiKeys:r,apiKeysLoading:o,setApiKey:(0,s.useCallback)(async(t,a)=>{u("api-keys");try{let n=await e.put("/api/settings/api-keys",{[t]:a});i(n)}catch(e){}finally{u(null)}},[e]),saving:c}}(o),[g,b]=(0,s.useState)(null),[v,y]=(0,s.useState)(null),[j,w]=(0,s.useState)(""),[N,C]=(0,s.useState)(!1),[S,M]=(0,s.useState)(null),[E,I]=(0,s.useState)(null),[B,H]=(0,s.useState)(!1),[R,W]=(0,s.useState)(!1),[z,Z]=(0,s.useState)(null),[G,K]=(0,s.useState)(null),[V,F]=(0,s.useState)(!1),[q,X]=(0,s.useState)(!1),[J,Y]=(0,s.useState)(null),[Q,$]=(0,s.useState)(null);(0,s.useEffect)(()=>{o.get("/api/version").then(b).catch(()=>{}),o.get("/api/settings/username").then(e=>{y(e),w(e.username)}).catch(()=>{}),o.get("/api/history/status").then(M).catch(()=>{}),o.get("/api/history/config").then(I).catch(()=>{}),o.get("/api/codemap/config").then(e=>{var t;return Z(null!=(t=e.config)?t:e)}).catch(()=>{}),o.get("/api/memory/config").then(e=>{K(e),Y(e)}).catch(()=>{}),o.get("/api/memory/status").then(e=>{var t;$({initialized:e.initialized,stats:null!=(t=e.stats)?t:void 0})}).catch(()=>{})},[o]);let ee=(0,s.useCallback)(async()=>{var e;let t=j.trim();if(t!==(null!=(e=null==v?void 0:v.username)?e:"")){C(!0);try{let e=await o.put("/api/settings/username",{username:t});y(e),w(e.username)}catch(e){}finally{C(!1)}}},[j,v,o]),et=(0,s.useCallback)(async e=>{if(E&&(null==S?void 0:S.exists)){H(!0);try{let t=await o.put("/api/history/config",{...E,...e});I(t)}catch(e){}finally{H(!1)}}},[E,S,o]),ea=(0,s.useCallback)(async()=>{W(!0);try{await o.post("/api/history/init");let e=await o.get("/api/history/status");M(e);let t=await o.get("/api/history/config");I(t)}catch(e){}finally{W(!1)}},[o]),en=(0,s.useCallback)(async e=>{if(z){F(!0);try{var t;let a={...z.embedding,...e},n=await o.put("/api/codemap/config",{embedding:a});Z(null!=(t=n.config)?t:n)}catch(e){}finally{F(!1)}}},[z,o]),es=(0,s.useCallback)(async e=>{if(G){X(!0);try{let t={...G.embedding,...e},a=await o.put("/api/memory/config",{...G,embedding:t});K(a)}catch(e){}finally{X(!1)}}},[G,o]),el=(0,s.useCallback)(async e=>{if(J)try{let t={...J,...e};Y(t);let a=await o.put("/api/memory/config",t);Y(a)}catch(e){}},[J,o]);return(0,n.jsxs)("div",{className:"flex gap-8",children:[(0,n.jsx)(c,{items:D}),(0,n.jsxs)("div",{className:"flex-1 min-w-0 space-y-8",children:[(0,n.jsx)(x,{version:g,username:v,usernameInput:j,setUsernameInput:w,savingUsername:N,saveUsername:()=>void ee()}),(0,n.jsx)(p,{apiKeys:m,onSet:(e,t)=>void h(e,t),onClear:e=>void h(e,null)}),(0,n.jsx)(f,{codemapConfig:z,memoryConfig:G,savingCodemap:V,savingMemory:q,onSaveCodemap:e=>void en(e),onSaveMemory:e=>void es(e)}),(0,n.jsx)(k,{config:null!=(e=null==d?void 0:d.agent)?e:{provider:"claude"},onUpdate:e=>void u("agent",e)}),(0,n.jsx)(L,{config:null!=(t=null==d?void 0:d.loop)?t:{},onUpdate:e=>void u("loop",e)}),(0,n.jsx)(A,{historyStatus:S,historyConfig:E,savingHistory:B,initingHistory:R,updateHistoryField:e=>void et(e),handleInitHistory:()=>void ea()}),(0,n.jsx)(P,{config:null!=(a=null==d?void 0:d.codemap)?a:null,onUpdate:e=>void u("codemap",e)}),(0,n.jsx)(O,{config:J,status:Q,client:o,onUpdate:e=>void el(e)}),(0,n.jsx)(U,{config:null!=(l=null==d?void 0:d.sandbox)?l:null,onUpdate:e=>void u("sandbox",e)}),(0,n.jsx)(T,{config:null!=(i=null==d?void 0:d.remote)?i:null,onUpdate:e=>void u("remote",e)}),(0,n.jsx)("div",{children:(0,n.jsx)(_,{href:"/notifications",title:"Notifications",description:"Configure notification channels and routing",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.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,n.jsx)("div",{className:"border-t border-white/[0.04] pt-4",children:(0,n.jsxs)("div",{className:"flex items-center gap-2 text-xs text-emerald-400/70",children:[(0,n.jsx)("svg",{className:"h-3.5 w-3.5",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"})}),"Settings saved automatically"]})})]})]})}function W(){let{org:e}=(0,l.As)(),[t,a]=(0,s.useState)(""),[r,o]=(0,s.useState)(""),[d,c]=(0,s.useState)(!0),[u,x]=(0,s.useState)(!1),[m,p]=(0,s.useState)(!1),[h,g]=(0,s.useState)(!1),[b,v]=(0,s.useState)(""),[f,y]=(0,s.useState)(!1),j=(0,s.useCallback)(async()=>{if(e)try{let t=await i.uE.getOrg(e.id);a(t.name),o(t.slug)}catch(e){}finally{c(!1)}},[e]);async function w(){if(e){x(!0),p(!1);try{await i.uE.updateOrg(e.id,{name:t,slug:r}),p(!0),setTimeout(()=>p(!1),3e3)}catch(e){}finally{x(!1)}}}async function N(){if(e&&b===e.slug){y(!0);try{await i.uE.deleteOrg(e.id),window.location.href="/"}catch(e){y(!1)}}}return((0,s.useEffect)(()=>{j()},[j]),d)?(0,n.jsx)("div",{className:"h-48 animate-pulse rounded-xl border border-white/[0.04] bg-surface-900"}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"grid gap-3 sm:grid-cols-3",children:[(0,n.jsx)(_,{href:"/settings/members",title:"Members",description:"Manage team members and roles",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 19.128a9.38 9.38 0 0 0 2.625.372 9.337 9.337 0 0 0 4.121-.952 4.125 4.125 0 0 0-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 0 1 8.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0 1 11.964-3.07M12 6.375a3.375 3.375 0 1 1-6.75 0 3.375 3.375 0 0 1 6.75 0Zm8.25 2.25a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})})}),(0,n.jsx)(_,{href:"/settings/keys",title:"API Keys",description:"Generate and manage API keys",icon:(0,n.jsx)("svg",{className:"h-4 w-4",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,n.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"})})}),(0,n.jsx)(_,{href:"/settings/github",title:"GitHub",description:"Manage GitHub App installation",icon:(0,n.jsx)("svg",{className:"h-4 w-4",viewBox:"0 0 24 24",fill:"currentColor",children:(0,n.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,n.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 p-6",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-gray-200",children:"Organization"}),(0,n.jsxs)("div",{className:"mt-5 space-y-5",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-1.5 block",children:"Organization Name"}),(0,n.jsx)("input",{type:"text",value:t,onChange:e=>a(e.target.value),className:"w-full bg-surface-800 border border-white/[0.08] rounded-lg px-3 py-2 text-sm text-gray-200 placeholder-gray-500 focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{className:"text-xs font-medium text-gray-400 uppercase tracking-wider mb-1.5 block",children:"Organization Slug"}),(0,n.jsx)("p",{className:"text-xs text-gray-600 mb-2",children:"Used in URLs and API paths. Lowercase letters, numbers, and hyphens only."}),(0,n.jsx)("input",{type:"text",value:r,onChange:e=>o(e.target.value.toLowerCase().replace(/[^a-z0-9-]/g,"")),className:"w-full bg-surface-800 border border-white/[0.08] rounded-lg px-3 py-2 text-sm text-gray-200 placeholder-gray-500 focus:border-primary-500 focus:ring-2 focus:ring-primary-500/20 transition-colors"})]}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("button",{onClick:()=>void w(),disabled:u,className:"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:u?"Saving...":"Save Changes"}),m&&(0,n.jsx)("span",{className:"text-xs text-emerald-400",children:"Saved"})]})]})]}),(0,n.jsxs)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/5 p-6",children:[(0,n.jsx)("h2",{className:"text-sm font-semibold text-red-400",children:"Danger Zone"}),(0,n.jsx)("p",{className:"mt-2 text-xs text-gray-400 leading-relaxed",children:"Permanently delete this organization and all its data. This action cannot be undone."}),h?(0,n.jsxs)("div",{className:"mt-4 space-y-3",children:[(0,n.jsxs)("p",{className:"text-xs text-gray-400",children:["Type"," ",(0,n.jsx)("code",{className:"rounded bg-surface-800 px-1.5 py-0.5 text-red-400 font-mono text-[11px]",children:null==e?void 0:e.slug})," ","to confirm:"]}),(0,n.jsx)("input",{type:"text",value:b,onChange:e=>v(e.target.value),placeholder:null==e?void 0:e.slug,className:"w-full bg-surface-800 border border-red-500/20 rounded-lg px-3 py-2 text-sm text-gray-200 placeholder-gray-600 focus:border-red-500 focus:ring-2 focus:ring-red-500/20 transition-colors"}),(0,n.jsxs)("div",{className:"flex gap-2",children:[(0,n.jsx)("button",{onClick:()=>void N(),disabled:b!==(null==e?void 0:e.slug)||f,className:"rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white transition-colors hover:bg-red-700 disabled:cursor-not-allowed disabled:opacity-50",children:f?"Deleting...":"Permanently Delete"}),(0,n.jsx)("button",{onClick:()=>{g(!1),v("")},className:"rounded-lg border border-white/[0.08] bg-surface-800 px-4 py-2 text-sm text-gray-300 transition-colors hover:bg-surface-750",children:"Cancel"})]})]}):(0,n.jsx)("button",{onClick:()=>g(!0),className:"mt-4 rounded-lg bg-red-500/10 text-red-400 hover:bg-red-500/20 border border-red-500/30 px-4 py-2 text-sm font-medium transition-colors",children:"Delete Organization"})]})]})}function z(){let e=(0,r.Xk)();return(0,n.jsxs)("div",{children:[(0,n.jsxs)("div",{className:"sticky top-0 z-10 -mx-6 -mt-6 mb-6 bg-surface-950/80 px-6 pb-4 pt-6 backdrop-blur-sm border-b border-white/[0.04]",children:[(0,n.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Settings"}),(0,n.jsx)("p",{className:"mt-0.5 text-sm text-gray-400",children:"local"===e?"Configure ULPI preferences":"Manage your organization settings."})]}),"local"===e?(0,n.jsx)(R,{}):(0,n.jsx)(W,{})]})}},422:(e,t,a)=>{"use strict";a.d(t,{J:()=>l,h:()=>s});var n=a(7811);function s(){return"local"===n.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===n.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},3310:(e,t,a)=>{"use strict";a.d(t,{F_:()=>s,fZ:()=>l,jw:()=>n});let n=[{value:"claude",label:"Claude Code",models:[{value:"claude-sonnet-4-6",label:"Sonnet 4.6"},{value:"claude-opus-4-6",label:"Opus 4.6"},{value:"claude-haiku-4-5-20251001",label:"Haiku 4.5"},{value:"claude-opus-4-5-20251101",label:"Opus 4.5"},{value:"claude-sonnet-4-5-20250929",label:"Sonnet 4.5"}]},{value:"gemini",label:"Gemini CLI",models:[{value:"gemini-2.5-pro",label:"2.5 Pro"},{value:"gemini-2.5-flash",label:"2.5 Flash"},{value:"gemini-3-pro-preview",label:"3 Pro (Preview)"},{value:"gemini-3-flash-preview",label:"3 Flash (Preview)"}]},{value:"opencode",label:"OpenCode",models:[{value:"anthropic/claude-sonnet-4-6",label:"Claude Sonnet 4.6"},{value:"anthropic/claude-opus-4-6",label:"Claude Opus 4.6"},{value:"openai/gpt-5.3-codex",label:"GPT-5.3 Codex"},{value:"google/gemini-2.5-pro",label:"Gemini 2.5 Pro"}]},{value:"codex",label:"Codex",models:[{value:"gpt-5.3-codex",label:"GPT-5.3 Codex"},{value:"gpt-5.3-codex-spark",label:"GPT-5.3 Codex Spark"},{value:"gpt-5.2-codex",label:"GPT-5.2 Codex"},{value:"gpt-5.1-codex-max",label:"GPT-5.1 Codex Max"},{value:"gpt-5-codex-mini",label:"GPT-5 Codex Mini"}]},{value:"kiro",label:"Kiro",models:[{value:"auto",label:"Auto"},{value:"claude-opus-4.6",label:"Claude Opus 4.6"},{value:"claude-sonnet-4.5",label:"Claude Sonnet 4.5"},{value:"claude-sonnet-4",label:"Claude Sonnet 4"},{value:"claude-haiku-4.5",label:"Claude Haiku 4.5"}]},{value:"factory-droid",label:"Factory Droid",models:[]}];function s(e){var t,a;return null!=(a=null==(t=n.find(t=>t.value===e))?void 0:t.models)?a:[]}function l(e){let t=s(e);return t.length>0?t[0].value:""}},3446:(e,t,a)=>{"use strict";a.d(t,{Kv:()=>d,HI:()=>x,Xk:()=>c,yC:()=>u});var n=a(8111),s=a(5271),l=a(422),r=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 n=r.env.NEXT_PUBLIC_ULPI_API_SECRET,s=await fetch(a,{...t,headers:{"Content-Type":"application/json",...n?{"X-Ulpi-Secret":n}:{},...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 d(e){let{children:t}=e,a=(0,s.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,n.jsx)(o,{value:a,children:t})}function c(){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 x(){return(0,s.useContext)(o)}},5015:(e,t,a)=>{Promise.resolve().then(a.bind(a,27))}},e=>{e.O(0,[5935,8934,814,9743,7358],()=>e(e.s=5015)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8141],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>a,h:()=>l});var r=s(7811);function l(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},714:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>d});var r=s(8111),l=s(5271),a=s(4906),n=s(3951),i=s(4632),c=s(3025);function o(e){let{skill:t}=e,[s,a]=(0,l.useState)(!1);return(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 transition-colors hover:border-white/[0.1]",children:[(0,r.jsx)("button",{type:"button",onClick:()=>a(!s),className:"w-full p-4 text-left",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,r.jsx)("svg",{className:"h-4 w-4 shrink-0 text-primary-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:1.5,children:(0,r.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.455 2.456L21.75 6l-1.036.259a3.375 3.375 0 0 0-2.455 2.456Z"})}),(0,r.jsx)("h3",{className:"text-sm font-semibold text-white",children:t.name})]}),t.description&&(0,r.jsx)("p",{className:"text-xs text-gray-500 line-clamp-2",children:t.description})]}),(0,r.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-600 transition-transform ".concat(s?"rotate-180":""),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"})})]})}),s&&(0,r.jsx)("div",{className:"border-t border-white/[0.04] px-4 py-3",children:(0,r.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Name:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:t.name})]}),t.path&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"File:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:t.path})]})]})})]})}function d(){return(0,r.jsx)(c.s,{featureName:"Skills",children:(0,r.jsx)(u,{})})}function u(){let{skills:e,loading:t,error:s}=(0,a.a)(),[c,d]=(0,l.useState)(""),u=(0,l.useMemo)(()=>{if(!c.trim())return e;let t=c.toLowerCase();return e.filter(e=>e.name.toLowerCase().includes(t)||e.description&&e.description.toLowerCase().includes(t))},[e,c]);return t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Skills"}),(0,r.jsx)(n.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:"Skills"}),(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 skills: ",s]})})]}):(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:"Skills"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-400",children:[e.length," skill",1!==e.length?"s":""," available for rule injection"]})]}),(0,r.jsxs)("div",{className:"relative",children:[(0,r.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,r.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,r.jsx)("input",{type:"text",value:c,onChange:e=>d(e.target.value),placeholder:"Search skills...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800/50 py-2 pl-9 pr-3 text-sm text-white placeholder-gray-600 outline-none transition-colors focus:border-primary-500/50"})]}),0===u.length?(0,r.jsx)(i.p,{title:c?"No skills match your search":"No skills available",description:c?"Try a different search term.":"Skills are bundled with ULPI and loaded from your project."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:u.map(e=>(0,r.jsx)(o,{skill:e},e.name))})]})}},3025:(e,t,s)=>{"use strict";s.d(t,{s:()=>a});var r=s(8111),l=s(3446);function a(e){let{children:t,featureName:s="This feature"}=e;return"cloud"===(0,l.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:()=>o,HI:()=>x,Xk:()=>d,yC:()=>u});var r=s(8111),l=s(5271),a=s(422),n=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=n.env.NEXT_PUBLIC_ULPI_API_SECRET,l=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!l.ok)throw Error((await l.json().catch(()=>({error:l.statusText}))).error||"API error: ".concat(l.status));return l.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,a.h)()}}let c=(0,l.createContext)({mode:"cloud",localClient:null});function o(e){let{children:t}=e,s=(0,l.useMemo)(()=>{let e=(0,a.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(c,{value:s,children:t})}function d(){return(0,l.useContext)(c).mode}function u(){let{localClient:e}=(0,l.useContext)(c);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,l.useContext)(c)}},3951:(e,t,s)=>{"use strict";s.d(t,{G:()=>l});var r=s(8111);function l(e){let{rows:t=3,variant:s="skeleton",className:l=""}=e;return"spinner"===s?(0,r.jsx)("div",{className:"flex items-center justify-center py-16 ".concat(l),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(l),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:()=>a});var r=s(8111);function l(){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 a(e){let{icon:t,title:s,description:a,action:n,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)(l,{})}),(0,r.jsx)("h3",{className:"text-sm font-medium text-gray-300",children:s}),a&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:a}),n&&(0,r.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})]})}},4906:(e,t,s)=>{"use strict";s.d(t,{a:()=>n,b:()=>a});var r=s(5271),l=s(3446);function a(){let e=(0,l.yC)(),[t,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(!0),[i,c]=(0,r.useState)(null),o=(0,r.useCallback)(async()=>{n(!0),c(null);try{var t,r,l;let a=await e.get("/api/templates"),n=null!=(l=a.templates)?l:[...null!=(t=a.bundled)?t:[],...null!=(r=a.user)?r:[]];s(n)}catch(e){c(e instanceof Error?e.message:"Failed to fetch templates")}finally{n(!1)}},[e]);return(0,r.useEffect)(()=>{o()},[o]),{templates:t,loading:a,error:i,refresh:o}}function n(){let e=(0,l.yC)(),[t,s]=(0,r.useState)([]),[a,n]=(0,r.useState)(!0),[i,c]=(0,r.useState)(null),o=(0,r.useCallback)(async()=>{n(!0),c(null);try{var t;let r=await e.get("/api/skills"),l=Array.isArray(r)?r:null!=(t=r.skills)?t:[];s(l)}catch(e){c(e instanceof Error?e.message:"Failed to fetch skills")}finally{n(!1)}},[e]);return(0,r.useEffect)(()=>{o()},[o]),{skills:t,loading:a,error:i,refresh:o}}},8658:(e,t,s)=>{Promise.resolve().then(s.bind(s,714))}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=8658)),_N_E=e.O()}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3702],{422:(e,t,s)=>{"use strict";s.d(t,{J:()=>l,h:()=>a});var r=s(7811);function a(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE,"https://ulpi-cloud-api.ngrok.app"}function l(){return"local"===r.env.NEXT_PUBLIC_ULPI_MODE||!0==="https://ulpi-cloud-api.ngrok.app".includes("localhost")}},3025:(e,t,s)=>{"use strict";s.d(t,{s:()=>l});var r=s(8111),a=s(3446);function l(e){let{children:t,featureName:s="This feature"}=e;return"cloud"===(0,a.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),a=s(5271),l=s(422),n=s(7811);class i{async request(e,t){let s="".concat(this.baseUrl).concat(e);if(this.repo){let e=s.includes("?")?"&":"?";s="".concat(s).concat(e,"repo=").concat(encodeURIComponent(this.repo))}let r=n.env.NEXT_PUBLIC_ULPI_API_SECRET,a=await fetch(s,{...t,headers:{"Content-Type":"application/json",...r?{"X-Ulpi-Secret":r}:{},...null==t?void 0:t.headers}});if(!a.ok)throw Error((await a.json().catch(()=>({error:a.statusText}))).error||"API error: ".concat(a.status));return a.json()}async get(e){return this.request(e)}async post(e,t){return this.request(e,{method:"POST",body:t?JSON.stringify(t):void 0})}async put(e,t){return this.request(e,{method:"PUT",body:t?JSON.stringify(t):void 0})}async delete(e){return this.request(e,{method:"DELETE"})}constructor(){this.repo=null,this.baseUrl=(0,l.h)()}}let o=(0,a.createContext)({mode:"cloud",localClient:null});function c(e){let{children:t}=e,s=(0,a.useMemo)(()=>{let e=(0,l.J)()?"local":"cloud";return{mode:e,localClient:"local"===e?new i:null}},[]);return(0,r.jsx)(o,{value:s,children:t})}function d(){return(0,a.useContext)(o).mode}function u(){let{localClient:e}=(0,a.useContext)(o);if(!e)throw Error("LocalApiClient not available in cloud mode");return e}function x(){return(0,a.useContext)(o)}},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))})}},4289:(e,t,s)=>{Promise.resolve().then(s.bind(s,4295))},4295:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>x});var r=s(8111),a=s(5271),l=s(4906),n=s(3951),i=s(4632),o=s(3025);let c={runtime:"bg-blue-500/10 text-blue-400 border-blue-500/20",framework:"bg-violet-500/10 text-violet-400 border-violet-500/20","package-manager":"bg-emerald-500/10 text-emerald-400 border-emerald-500/20",tool:"bg-amber-500/10 text-amber-400 border-amber-500/20",testing:"bg-cyan-500/10 text-cyan-400 border-cyan-500/20",workflow:"bg-pink-500/10 text-pink-400 border-pink-500/20","quality-of-life":"bg-orange-500/10 text-orange-400 border-orange-500/20"};function d(e){var t;let{category:s}=e;if(!s)return null;let a=null!=(t=c[s])?t:"bg-gray-500/10 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-[11px] font-medium ".concat(a),children:s})}function u(e){let{template:t}=e,[s,l]=(0,a.useState)(!1),n=t.variables?Object.keys(t.variables).length:0,i=t.rules?Object.values(t.rules).reduce((e,t)=>t&&"object"==typeof t?e+Object.keys(t).length:e,0):0;return(0,r.jsxs)("div",{className:"rounded-xl border border-white/[0.06] bg-surface-900 transition-colors hover:border-white/[0.1]",children:[(0,r.jsx)("button",{type:"button",onClick:()=>l(!s),className:"w-full p-4 text-left",children:(0,r.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsxs)("div",{className:"mb-1 flex items-center gap-2",children:[(0,r.jsx)("h3",{className:"text-sm font-semibold text-white",children:t.name}),(0,r.jsx)(d,{category:t.category})]}),t.description&&(0,r.jsx)("p",{className:"text-xs text-gray-500 line-clamp-2",children:t.description}),(0,r.jsxs)("div",{className:"mt-2 flex items-center gap-3 text-[11px] text-gray-600",children:[i>0&&(0,r.jsxs)("span",{children:[i," rule",1!==i?"s":""]}),n>0&&(0,r.jsxs)("span",{children:[n," variable",1!==n?"s":""]})]})]}),(0,r.jsx)("svg",{className:"h-4 w-4 shrink-0 text-gray-600 transition-transform ".concat(s?"rotate-180":""),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"})})]})}),s&&(0,r.jsx)("div",{className:"border-t border-white/[0.04] px-4 py-3",children:(0,r.jsxs)("div",{className:"space-y-2 text-xs",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"ID:"}),(0,r.jsx)("span",{className:"font-mono text-gray-400",children:t.id})]}),t.category&&(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Category:"}),(0,r.jsx)("span",{className:"text-gray-400",children:t.category})]}),n>0&&(0,r.jsxs)("div",{children:[(0,r.jsx)("span",{className:"text-gray-600",children:"Variables:"}),(0,r.jsx)("div",{className:"mt-1 flex flex-wrap gap-1",children:Object.entries(t.variables).map(e=>{let[t,s]=e;return(0,r.jsxs)("span",{className:"rounded-md bg-surface-800 px-2 py-0.5 font-mono text-[10px] text-gray-500",children:[t,": ",String(s)]},t)})})]})]})})]})}function x(){return(0,r.jsx)(o.s,{featureName:"Templates",children:(0,r.jsx)(m,{})})}function m(){let{templates:e,loading:t,error:s}=(0,l.b)(),[o,c]=(0,a.useState)(""),[d,x]=(0,a.useState)("all"),m=(0,a.useMemo)(()=>{let t=new Set;for(let s of e)s.category&&t.add(s.category);return Array.from(t).sort()},[e]),h=(0,a.useMemo)(()=>{let t=e;if("all"!==d&&(t=t.filter(e=>e.category===d)),o.trim()){let e=o.toLowerCase();t=t.filter(t=>t.name.toLowerCase().includes(e)||t.description&&t.description.toLowerCase().includes(e)||t.category&&t.category.toLowerCase().includes(e))}return t},[e,d,o]);return t?(0,r.jsxs)("div",{className:"space-y-6",children:[(0,r.jsx)("h1",{className:"text-xl font-semibold text-white",children:"Templates"}),(0,r.jsx)(n.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:"Templates"}),(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 templates: ",s]})})]}):(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:"Templates"}),(0,r.jsxs)("p",{className:"mt-1 text-sm text-gray-400",children:[e.length," template",1!==e.length?"s":""," available"]})]}),(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row",children:[(0,r.jsxs)("div",{className:"relative flex-1",children:[(0,r.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,r.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,r.jsx)("input",{type:"text",value:o,onChange:e=>c(e.target.value),placeholder:"Search templates...",className:"w-full rounded-lg border border-white/[0.08] bg-surface-800/50 py-2 pl-9 pr-3 text-sm text-white placeholder-gray-600 outline-none transition-colors focus:border-primary-500/50"})]}),(0,r.jsxs)("select",{value:d,onChange:e=>x(e.target.value),className:"rounded-lg border border-white/[0.08] bg-surface-800/50 px-3 py-2 text-sm text-gray-300 outline-none transition-colors focus:border-primary-500/50",children:[(0,r.jsx)("option",{value:"all",children:"All Categories"}),m.map(e=>(0,r.jsx)("option",{value:e,children:e},e))]})]}),0===h.length?(0,r.jsx)(i.p,{title:o||"all"!==d?"No templates match your filter":"No templates available",description:"Try adjusting your search or filter criteria."}):(0,r.jsx)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:h.map(e=>(0,r.jsx)(u,{template:e},e.id))})]})}},4632:(e,t,s)=>{"use strict";s.d(t,{p:()=>l});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 l(e){let{icon:t,title:s,description:l,action:n,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}),l&&(0,r.jsx)("p",{className:"mt-1.5 max-w-sm text-xs text-gray-500",children:l}),n&&(0,r.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})]})}},4906:(e,t,s)=>{"use strict";s.d(t,{a:()=>n,b:()=>l});var r=s(5271),a=s(3446);function l(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[l,n]=(0,r.useState)(!0),[i,o]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{n(!0),o(null);try{var t,r,a;let l=await e.get("/api/templates"),n=null!=(a=l.templates)?a:[...null!=(t=l.bundled)?t:[],...null!=(r=l.user)?r:[]];s(n)}catch(e){o(e instanceof Error?e.message:"Failed to fetch templates")}finally{n(!1)}},[e]);return(0,r.useEffect)(()=>{c()},[c]),{templates:t,loading:l,error:i,refresh:c}}function n(){let e=(0,a.yC)(),[t,s]=(0,r.useState)([]),[l,n]=(0,r.useState)(!0),[i,o]=(0,r.useState)(null),c=(0,r.useCallback)(async()=>{n(!0),o(null);try{var t;let r=await e.get("/api/skills"),a=Array.isArray(r)?r:null!=(t=r.skills)?t:[];s(a)}catch(e){o(e instanceof Error?e.message:"Failed to fetch skills")}finally{n(!1)}},[e]);return(0,r.useEffect)(()=>{c()},[c]),{skills:t,loading:l,error:i,refresh:c}}}},e=>{e.O(0,[814,9743,7358],()=>e(e.s=4289)),_N_E=e.O()}]);