conductor-oss 0.19.2 → 0.20.0

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 (218) hide show
  1. package/package.json +5 -5
  2. package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
  3. package/web/.next/standalone/packages/web/.next/build-manifest.json +4 -4
  4. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  5. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page/build-manifest.json +2 -2
  6. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +2 -2
  7. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  8. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  9. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  10. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  11. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  12. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  13. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/build-manifest.json +2 -2
  14. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page/server-reference-manifest.json +7 -7
  15. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  16. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  17. package/web/.next/standalone/packages/web/.next/server/app/_not-found.html +1 -1
  18. package/web/.next/standalone/packages/web/.next/server/app/_not-found.rsc +4 -4
  19. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  20. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  21. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  22. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  23. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  24. package/web/.next/standalone/packages/web/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  25. package/web/.next/standalone/packages/web/.next/server/app/api/access/route.js.nft.json +1 -1
  26. package/web/.next/standalone/packages/web/.next/server/app/api/agents/route.js.nft.json +1 -1
  27. package/web/.next/standalone/packages/web/.next/server/app/api/app-update/route.js.nft.json +1 -1
  28. package/web/.next/standalone/packages/web/.next/server/app/api/attachments/route.js.nft.json +1 -1
  29. package/web/.next/standalone/packages/web/.next/server/app/api/auth/session/route.js.nft.json +1 -1
  30. package/web/.next/standalone/packages/web/.next/server/app/api/boards/comments/route.js.nft.json +1 -1
  31. package/web/.next/standalone/packages/web/.next/server/app/api/boards/route.js.nft.json +1 -1
  32. package/web/.next/standalone/packages/web/.next/server/app/api/config/route.js.nft.json +1 -1
  33. package/web/.next/standalone/packages/web/.next/server/app/api/context-files/open/route.js.nft.json +1 -1
  34. package/web/.next/standalone/packages/web/.next/server/app/api/context-files/route.js.nft.json +1 -1
  35. package/web/.next/standalone/packages/web/.next/server/app/api/events/route.js.nft.json +1 -1
  36. package/web/.next/standalone/packages/web/.next/server/app/api/executor/health/route.js.nft.json +1 -1
  37. package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/directory/route.js.nft.json +1 -1
  38. package/web/.next/standalone/packages/web/.next/server/app/api/filesystem/pick-directory/route.js.nft.json +1 -1
  39. package/web/.next/standalone/packages/web/.next/server/app/api/github/repos/route.js.nft.json +1 -1
  40. package/web/.next/standalone/packages/web/.next/server/app/api/github/webhook/route.js.nft.json +1 -1
  41. package/web/.next/standalone/packages/web/.next/server/app/api/health/boards/route.js.nft.json +1 -1
  42. package/web/.next/standalone/packages/web/.next/server/app/api/health/sessions/route.js.nft.json +1 -1
  43. package/web/.next/standalone/packages/web/.next/server/app/api/notifications/route.js.nft.json +1 -1
  44. package/web/.next/standalone/packages/web/.next/server/app/api/preferences/route.js.nft.json +1 -1
  45. package/web/.next/standalone/packages/web/.next/server/app/api/remote-access/route.js.nft.json +1 -1
  46. package/web/.next/standalone/packages/web/.next/server/app/api/repositories/[id]/route.js.nft.json +1 -1
  47. package/web/.next/standalone/packages/web/.next/server/app/api/repositories/route.js.nft.json +1 -1
  48. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/actions/route.js.nft.json +1 -1
  49. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/archive/route.js.nft.json +1 -1
  50. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/checks/route.js.nft.json +1 -1
  51. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/diff/route.js.nft.json +1 -1
  52. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feed/route.js.nft.json +1 -1
  53. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/feedback/route.js.nft.json +1 -1
  54. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/files/route.js.nft.json +1 -1
  55. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/interrupt/route.js.nft.json +1 -1
  56. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/kill/route.js.nft.json +1 -1
  57. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/output/route.js.nft.json +1 -1
  58. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/dom/route.js.nft.json +1 -1
  59. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/route.js.nft.json +1 -1
  60. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/screenshot/route.js.nft.json +1 -1
  61. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/restore/route.js.nft.json +1 -1
  62. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/route.js.nft.json +1 -1
  63. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/snapshot/route.js.nft.json +1 -1
  64. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/token/route.js.nft.json +1 -1
  65. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/ttyd/route.js.nft.json +1 -1
  66. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/terminal/ttyd/ws/route.js.nft.json +1 -1
  67. package/web/.next/standalone/packages/web/.next/server/app/api/sessions/route.js.nft.json +1 -1
  68. package/web/.next/standalone/packages/web/.next/server/app/api/spawn/route.js.nft.json +1 -1
  69. package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/branches/route.js.nft.json +1 -1
  70. package/web/.next/standalone/packages/web/.next/server/app/api/workspaces/route.js.nft.json +1 -1
  71. package/web/.next/standalone/packages/web/.next/server/app/page/build-manifest.json +2 -2
  72. package/web/.next/standalone/packages/web/.next/server/app/page/react-loadable-manifest.json +4 -4
  73. package/web/.next/standalone/packages/web/.next/server/app/page/server-reference-manifest.json +7 -7
  74. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  75. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  76. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/build-manifest.json +2 -2
  77. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/react-loadable-manifest.json +3 -3
  78. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page/server-reference-manifest.json +7 -7
  79. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  80. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  81. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/build-manifest.json +2 -2
  82. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page/server-reference-manifest.json +7 -7
  83. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  84. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  85. package/web/.next/standalone/packages/web/.next/server/app/unlock/page/build-manifest.json +2 -2
  86. package/web/.next/standalone/packages/web/.next/server/app/unlock/page/server-reference-manifest.json +7 -7
  87. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  88. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  89. package/web/.next/standalone/packages/web/.next/server/chunks/_2c837d66._.js +1 -1
  90. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__cb0aeb63._.js → [root-of-the-server]__1329224f._.js} +2 -2
  91. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{[root-of-the-server]__ce4b4158._.js → [root-of-the-server]__1cb74434._.js} +1 -1
  92. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__53bcdbc9._.js +1 -1
  93. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__c405048c._.js +1 -1
  94. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__c79fcfd3._.js +3 -0
  95. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_0e1412de._.js +1 -1
  96. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_3aee3cff._.js +3 -0
  97. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_532f707d._.js +1 -1
  98. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_69e05fca._.js +1 -1
  99. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_80efe193._.js +1 -1
  100. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_903c3fe3._.js +1 -1
  101. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_9990bc82._.js +3 -0
  102. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_a990354c._.js +1 -1
  103. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_b9330c69._.js +1 -1
  104. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_c0f0e227._.js +1 -1
  105. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_f36ddaa9._.js +1 -1
  106. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_152e81cd._.js +3 -0
  107. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_a09380f4._.js +3 -0
  108. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_@clerk_nextjs_dist_esm_app-router_3eb7b454._.js → node_modules_@clerk_nextjs_dist_esm_app-router_e767206a._.js} +2 -2
  109. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@radix-ui_19d0f177._.js +3 -0
  110. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/{node_modules_b8d99fb4._.js → node_modules_@radix-ui_ef419f6b._.js} +2 -2
  111. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_core_dist_types_ba19386c.js +1 -1
  112. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_components_board_WorkspaceKanban_tsx_735b7999._.js +1 -1
  113. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_components_sessions_SessionPreview_tsx_ec32db81._.js +1 -1
  114. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_features_dashboard_DashboardClient_tsx_81ae42b0._.js +1 -1
  115. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_features_dashboard_components_DashboardDialogs_tsx_32d3d858._.js +1 -1
  116. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_hooks_5cb69d9a._.js +1 -1
  117. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_hooks_f05b02cd._.js +1 -1
  118. package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +2 -2
  119. package/web/.next/standalone/packages/web/.next/server/pages/404.html +1 -1
  120. package/web/.next/standalone/packages/web/.next/server/pages/500.html +2 -2
  121. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  122. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +8 -8
  123. package/web/.next/standalone/packages/web/.next/static/chunks/{d934d0e74594a818.js → 2d65cd3bc1137b3d.js} +1 -1
  124. package/web/.next/standalone/packages/web/.next/static/chunks/{96b41c96a34195c2.js → 437b46a75e1c92a7.js} +1 -1
  125. package/web/.next/standalone/packages/web/.next/static/chunks/450e4de887dcd142.js +1 -0
  126. package/web/.next/standalone/packages/web/.next/static/chunks/{81e3cea43881b17d.js → 4b3ac491753f4910.js} +1 -1
  127. package/web/.next/standalone/packages/web/.next/static/chunks/4f912a60e3753a1f.css +4 -0
  128. package/web/.next/standalone/packages/web/.next/static/chunks/50475743a65c6ae5.js +1 -0
  129. package/web/.next/standalone/packages/web/.next/static/chunks/581440483618ce47.js +1 -0
  130. package/web/.next/standalone/packages/web/.next/static/chunks/5c60a749d318d388.js +1 -0
  131. package/web/.next/standalone/packages/web/.next/static/chunks/5cb35e89898ff9e1.js +1 -0
  132. package/web/.next/standalone/packages/web/.next/static/chunks/{378daaa8dbf5309c.js → 741a641e5fe294ff.js} +1 -1
  133. package/web/.next/standalone/packages/web/.next/static/chunks/9b1065a7ccd69a3e.js +1 -0
  134. package/web/.next/standalone/packages/web/.next/static/chunks/{a70ab593d305d020.js → a0af599485430d5f.js} +1 -1
  135. package/web/.next/{static/chunks/355bedd41c2e9b0c.js → standalone/packages/web/.next/static/chunks/ae6e408453a5d1dc.js} +1 -1
  136. package/web/.next/standalone/packages/web/.next/static/chunks/b1c03c2c194b81b8.js +1 -0
  137. package/web/.next/standalone/packages/web/.next/static/chunks/b9c1238cc9302baa.js +1 -0
  138. package/web/.next/standalone/packages/web/.next/static/chunks/c3443f28deeae499.js +1 -0
  139. package/web/.next/standalone/packages/web/.next/static/chunks/{4f9d3a3c14fb43da.js → c8e8ff2836531532.js} +1 -1
  140. package/web/.next/standalone/packages/web/.next/static/chunks/cb1a507b11d64bfb.js +1 -0
  141. package/web/.next/standalone/packages/web/.next/static/chunks/ce2f01a7e421d6fe.js +1 -0
  142. package/web/.next/standalone/packages/web/.next/static/chunks/dd6469b26407178b.js +1 -0
  143. package/web/.next/standalone/packages/web/.next/static/chunks/e59b8003fba5213d.js +1 -0
  144. package/web/.next/standalone/packages/web/.next/static/chunks/{459f77e3c65b47d6.js → fc68108d32aea368.js} +1 -1
  145. package/web/.next/standalone/packages/web/.next/static/chunks/{turbopack-9809b4096e86149a.js → turbopack-c76ead44073de602.js} +1 -1
  146. package/web/.next/standalone/packages/web/src/components/board/WorkspaceKanban.tsx +2 -1
  147. package/web/.next/standalone/packages/web/src/components/sessions/SessionDiff.tsx +3 -2
  148. package/web/.next/standalone/packages/web/src/components/sessions/SessionPreview.tsx +3 -2
  149. package/web/.next/standalone/packages/web/src/components/sessions/SessionTerminal.tsx +1 -1
  150. package/web/.next/standalone/packages/web/src/features/dashboard/DashboardClient.tsx +10 -11
  151. package/web/.next/standalone/packages/web/src/features/dashboard/components/DashboardDialogs.tsx +4 -142
  152. package/web/.next/standalone/packages/web/src/features/dashboard/components/WorkspaceOverview.tsx +20 -4
  153. package/web/.next/standalone/packages/web/src/features/sessions/SessionPageClient.tsx +10 -0
  154. package/web/.next/standalone/packages/web/src/hooks/useAgents.ts +1 -1
  155. package/web/.next/standalone/packages/web/src/hooks/useNotificationAlerts.ts +291 -0
  156. package/web/.next/standalone/packages/web/src/lib/notificationSounds.ts +207 -0
  157. package/web/.next/standalone/packages/web/src/lib/sessionState.ts +11 -6
  158. package/web/.next/static/chunks/{d934d0e74594a818.js → 2d65cd3bc1137b3d.js} +1 -1
  159. package/web/.next/static/chunks/{96b41c96a34195c2.js → 437b46a75e1c92a7.js} +1 -1
  160. package/web/.next/static/chunks/450e4de887dcd142.js +1 -0
  161. package/web/.next/static/chunks/{81e3cea43881b17d.js → 4b3ac491753f4910.js} +1 -1
  162. package/web/.next/static/chunks/4f912a60e3753a1f.css +4 -0
  163. package/web/.next/static/chunks/50475743a65c6ae5.js +1 -0
  164. package/web/.next/static/chunks/581440483618ce47.js +1 -0
  165. package/web/.next/static/chunks/5c60a749d318d388.js +1 -0
  166. package/web/.next/static/chunks/5cb35e89898ff9e1.js +1 -0
  167. package/web/.next/static/chunks/{378daaa8dbf5309c.js → 741a641e5fe294ff.js} +1 -1
  168. package/web/.next/static/chunks/9b1065a7ccd69a3e.js +1 -0
  169. package/web/.next/static/chunks/{a70ab593d305d020.js → a0af599485430d5f.js} +1 -1
  170. package/web/.next/{standalone/packages/web/.next/static/chunks/355bedd41c2e9b0c.js → static/chunks/ae6e408453a5d1dc.js} +1 -1
  171. package/web/.next/static/chunks/b1c03c2c194b81b8.js +1 -0
  172. package/web/.next/static/chunks/b9c1238cc9302baa.js +1 -0
  173. package/web/.next/static/chunks/c3443f28deeae499.js +1 -0
  174. package/web/.next/static/chunks/{4f9d3a3c14fb43da.js → c8e8ff2836531532.js} +1 -1
  175. package/web/.next/static/chunks/cb1a507b11d64bfb.js +1 -0
  176. package/web/.next/static/chunks/ce2f01a7e421d6fe.js +1 -0
  177. package/web/.next/static/chunks/dd6469b26407178b.js +1 -0
  178. package/web/.next/static/chunks/e59b8003fba5213d.js +1 -0
  179. package/web/.next/static/chunks/{459f77e3c65b47d6.js → fc68108d32aea368.js} +1 -1
  180. package/web/.next/static/chunks/{turbopack-9809b4096e86149a.js → turbopack-c76ead44073de602.js} +1 -1
  181. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/[root-of-the-server]__337468fd._.js +0 -3
  182. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/_98876927._.js +0 -3
  183. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_883c65c7._.js +0 -3
  184. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_@clerk_nextjs_dist_esm_app-router_284bf164._.js +0 -3
  185. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/node_modules_fc0422b6._.js +0 -3
  186. package/web/.next/standalone/packages/web/.next/server/chunks/ssr/packages_web_src_lib_cn_ts_d08d265f._.js +0 -3
  187. package/web/.next/standalone/packages/web/.next/static/chunks/26a7e7bfa0c7c333.js +0 -1
  188. package/web/.next/standalone/packages/web/.next/static/chunks/2760ffd80cc5974a.js +0 -1
  189. package/web/.next/standalone/packages/web/.next/static/chunks/27e63de286c66b73.js +0 -1
  190. package/web/.next/standalone/packages/web/.next/static/chunks/3066ce838f62bf36.js +0 -1
  191. package/web/.next/standalone/packages/web/.next/static/chunks/34500baf24f4b1ba.js +0 -1
  192. package/web/.next/standalone/packages/web/.next/static/chunks/5d8c72d5215f5485.js +0 -1
  193. package/web/.next/standalone/packages/web/.next/static/chunks/6e98107b81bc5b12.js +0 -1
  194. package/web/.next/standalone/packages/web/.next/static/chunks/8216f40bafea0ec2.js +0 -1
  195. package/web/.next/standalone/packages/web/.next/static/chunks/997ac5c24d1d89f2.js +0 -1
  196. package/web/.next/standalone/packages/web/.next/static/chunks/a0656cf00243d2a4.js +0 -1
  197. package/web/.next/standalone/packages/web/.next/static/chunks/c2f9fe243cc8bd24.js +0 -1
  198. package/web/.next/standalone/packages/web/.next/static/chunks/c3a61db21bd52eaf.css +0 -4
  199. package/web/.next/standalone/packages/web/.next/static/chunks/da9681f9820fc6bd.js +0 -1
  200. package/web/.next/static/chunks/26a7e7bfa0c7c333.js +0 -1
  201. package/web/.next/static/chunks/2760ffd80cc5974a.js +0 -1
  202. package/web/.next/static/chunks/27e63de286c66b73.js +0 -1
  203. package/web/.next/static/chunks/3066ce838f62bf36.js +0 -1
  204. package/web/.next/static/chunks/34500baf24f4b1ba.js +0 -1
  205. package/web/.next/static/chunks/5d8c72d5215f5485.js +0 -1
  206. package/web/.next/static/chunks/6e98107b81bc5b12.js +0 -1
  207. package/web/.next/static/chunks/8216f40bafea0ec2.js +0 -1
  208. package/web/.next/static/chunks/997ac5c24d1d89f2.js +0 -1
  209. package/web/.next/static/chunks/a0656cf00243d2a4.js +0 -1
  210. package/web/.next/static/chunks/c2f9fe243cc8bd24.js +0 -1
  211. package/web/.next/static/chunks/c3a61db21bd52eaf.css +0 -4
  212. package/web/.next/static/chunks/da9681f9820fc6bd.js +0 -1
  213. /package/web/.next/standalone/packages/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_buildManifest.js +0 -0
  214. /package/web/.next/standalone/packages/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_clientMiddlewareManifest.json +0 -0
  215. /package/web/.next/standalone/packages/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_ssgManifest.js +0 -0
  216. /package/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_buildManifest.js +0 -0
  217. /package/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_clientMiddlewareManifest.json +0 -0
  218. /package/web/.next/static/{AThcyGsbhfLjpe2EymN_C → E909GLj6potSWpP-i6F73}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- module.exports=[15624,a=>{"use strict";var b=a.i(87924),c=a.i(27736),d=a.i(72131);function e(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function f(){return(f=Object.assign.bind()).apply(this,arguments)}var g=["aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"],h={small:16,medium:32,large:64};function i(a,b,c){var i=c(),j=Object.keys(i),k=d.default.forwardRef(function(a,c){var k,l,m=a["aria-label"],n=a["aria-labelledby"],o=a.tabIndex,p=a.className,q=a.fill,r=a.size,s=void 0===r?16:r,t=a.verticalAlign,u=a.id,v=a.title,w=a.style,x=function(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(b.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}(a,g),y=h[s]||s,z=(k=j,l=y,k.map(function(a){return parseInt(a,10)}).reduce(function(a,b){return b<=l?b:a},k[0])),A=i[z].width,B=A/z*y,C=i[z].path,D=m||n;return d.default.createElement("svg",f({ref:c},x,{"aria-hidden":D?void 0:"true",tabIndex:o,focusable:o>=0?"true":"false","aria-label":m,"aria-labelledby":n,className:"".concat(b," ").concat(void 0===p?"":p).trim(),role:D?"img":void 0,viewBox:"0 0 ".concat(A," ").concat(z),width:B,height:y,fill:void 0===q?"currentColor":q,id:u,display:"inline-block",overflow:"visible",style:function(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?e(Object(c),!0).forEach(function(b){var d,e,f;d=a,e=b,f=c[b],e in d?Object.defineProperty(d,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[e]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):e(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}({verticalAlign:void 0===t?"text-bottom":t},w)}),v?d.default.createElement("title",null,v):null,C)});return k.displayName=a,k}var j=i("GitBranchIcon","octicon octicon-git-branch",function(){return{16:{width:16,path:d.default.createElement("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:d.default.createElement(d.default.Fragment,null,d.default.createElement("path",{d:"M15 4.75a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM2.5 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 6.5Z"}),d.default.createElement("path",{d:"M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z"}),d.default.createElement("path",{d:"M17.5 8.75v-1H19v1a3.75 3.75 0 0 1-3.75 3.75h-7a1.75 1.75 0 0 0-1.75 1.75H5A3.25 3.25 0 0 1 8.25 11h7a2.25 2.25 0 0 0 2.25-2.25Z"}))}}}),k=i("LockIcon","octicon octicon-lock",function(){return{16:{width:16,path:d.default.createElement("path",{d:"M4 4a4 4 0 0 1 8 0v2h.25c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25v-5.5C2 6.784 2.784 6 3.75 6H4Zm8.25 3.5h-8.5a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25ZM10.5 6V4a2.5 2.5 0 1 0-5 0v2Z"})},24:{width:24,path:d.default.createElement("path",{d:"M6 9V7.25C6 3.845 8.503 1 12 1s6 2.845 6 6.25V9h.5a2.5 2.5 0 0 1 2.5 2.5v8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-8A2.5 2.5 0 0 1 5.5 9Zm-1.5 2.5v8a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-13a1 1 0 0 0-1 1Zm3-4.25V9h9V7.25c0-2.67-1.922-4.75-4.5-4.75-2.578 0-4.5 2.08-4.5 4.75Z"})}}}),l=i("MarkGithubIcon","octicon octicon-mark-github",function(){return{16:{width:16,path:d.default.createElement("path",{d:"M6.766 11.695C4.703 11.437 3.25 9.904 3.25 7.92c0-.806.281-1.677.75-2.258-.203-.532-.172-1.662.062-2.129.626-.081 1.469.258 1.969.726.594-.194 1.219-.291 1.985-.291.765 0 1.39.097 1.953.274.484-.451 1.343-.79 1.969-.709.218.435.25 1.564.046 2.113.5.613.766 1.436.766 2.274 0 1.984-1.453 3.485-3.547 3.759.531.355.891 1.129.891 2.016v1.678c0 .484.39.758.859.564C13.781 14.824 16 11.905 16 8.291 16 3.726 12.406 0 7.984 0 3.562 0 0 3.726 0 8.291c0 3.581 2.203 6.55 5.172 7.663A.595.595 0 0 0 6 15.389v-1.291c-.219.097-.5.162-.75.162-1.031 0-1.641-.581-2.078-1.662-.172-.435-.36-.693-.719-.742-.187-.016-.25-.097-.25-.193 0-.194.313-.339.625-.339.453 0 .844.29 1.25.887.313.468.641.678 1.031.678.391 0 .641-.146 1-.516.266-.275.469-.517.657-.678Z"})},24:{width:24,path:d.default.createElement("path",{d:"M10.303 16.652c-2.837-.344-4.835-2.385-4.835-5.028 0-1.074.387-2.235 1.031-3.008-.279-.709-.236-2.214.086-2.837.86-.107 2.02.344 2.708.967.816-.258 1.676-.386 2.728-.386 1.053 0 1.913.128 2.686.365.666-.602 1.848-1.053 2.708-.946.3.581.344 2.085.064 2.815.688.817 1.053 1.913 1.053 3.03 0 2.643-1.998 4.641-4.877 5.006.73.473 1.224 1.504 1.224 2.686v2.235c0 .644.537 1.01 1.182.752 3.889-1.483 6.94-5.372 6.94-10.185 0-6.081-4.942-11.044-11.022-11.044-6.081 0-10.98 4.963-10.98 11.044a10.84 10.84 0 0 0 7.112 10.206c.58.215 1.139-.172 1.139-.752v-1.719a2.768 2.768 0 0 1-1.032.215c-1.418 0-2.256-.773-2.857-2.213-.237-.58-.495-.924-.989-.988-.258-.022-.344-.129-.344-.258 0-.258.43-.451.86-.451.623 0 1.16.386 1.719 1.181.43.623.881.903 1.418.903.537 0 .881-.194 1.375-.688.365-.365.645-.687.903-.902Z"})}}}),m=i("RepoIcon","octicon octicon-repo",function(){return{16:{width:16,path:d.default.createElement("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"})},24:{width:24,path:d.default.createElement(d.default.Fragment,null,d.default.createElement("path",{d:"M3 2.75A2.75 2.75 0 0 1 5.75 0h14.5a.75.75 0 0 1 .75.75v20.5a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h5.25v-4H6A1.5 1.5 0 0 0 4.5 18v.75c0 .716.43 1.334 1.05 1.605a.75.75 0 0 1-.6 1.374A3.251 3.251 0 0 1 3 18.75ZM19.5 1.5H5.75c-.69 0-1.25.56-1.25 1.25v12.651A2.989 2.989 0 0 1 6 15h13.5Z"}),d.default.createElement("path",{d:"M7 18.25a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v5.01a.25.25 0 0 1-.397.201l-2.206-1.604a.25.25 0 0 0-.294 0L7.397 23.46a.25.25 0 0 1-.397-.2v-5.01Z"}))}}}),n=a.i(67299),o=a.i(13846),p=a.i(76172),q=a.i(70106);let r=(0,q.default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);var s=a.i(82434),t=a.i(67900),u=a.i(33441),v=a.i(5784),w=a.i(31746),x=a.i(5151),y=a.i(34531),z=a.i(63416),A=a.i(96101),B=a.i(96221),C=a.i(39920),D=a.i(28790),E=a.i(87532),F=a.i(65385),G=a.i(72162);let H=(0,q.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),I=(0,q.default)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var J=a.i(33508),K=a.i(53603),L=a.i(57941),M=a.i(52806);a.i(87837);var N=a.i(87315);let O="claude-code";function P(a){let b=(0,L.getKnownAgent)(a);return b?.label?b.label:a.split(/[-_\s]+/g).filter(Boolean).map(a=>a[0]?.toUpperCase()+a.slice(1)).join(" ")}function Q(a){return a.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function R(a){if(!a)return null;let b=Date.parse(a);return Number.isNaN(b)?null:`Updated ${new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric"}).format(new Date(b))}`}let S=[{id:"general",label:"General",icon:F.Settings2,implemented:!0},{id:"remote_access",label:"Remote Access",icon:G.SlidersHorizontal,implemented:!0},{id:"repositories",label:"Repositories",icon:y.FolderGit2,implemented:!0},{id:"organization",label:"Organization Settings",icon:t.Building2,implemented:!0},{id:"projects",label:"Projects",icon:z.FolderKanban,implemented:!1},{id:"agents",label:"Agents",icon:s.Bot,implemented:!0},{id:"mcp",label:"MCP Servers",icon:C.PlugZap,implemented:!1},{id:"preferences",label:"Preferences",icon:G.SlidersHorizontal,implemented:!1}],T=[{id:"preferences",label:"Preferences",icon:G.SlidersHorizontal,implemented:!0},{id:"repositories",label:"Repository",icon:y.FolderGit2,implemented:!0}],U=[{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"antigravity",label:"Antigravity"},{id:"custom",label:"Custom"}],V=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],W=U.filter(a=>"custom"!==a.id),X=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function Y(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:{...a}}function Z(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean).join("\n"):"string"!=typeof a?"":a.split(/[\n,]+/g).map(a=>a.trim()).filter(Boolean).join("\n")}function $(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean):[]}function _(a,b){let c=Y(a),d=Y(c.trustedHeaders),e=Y(c.roles),f=Y(b),g=c.defaultRole,h=f.role;return{requireAuth:!0===c.requireAuth||!0===d.enabled,defaultRole:"viewer"===g||"admin"===g||"operator"===g?g:"operator",trustedHeaders:{enabled:!0===d.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof d.emailHeader&&d.emailHeader.trim().length>0?d.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof d.jwtHeader&&d.jwtHeader.trim().length>0?d.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof d.teamDomain&&d.teamDomain.trim().length>0?d.teamDomain.trim():"",audience:"string"==typeof d.audience&&d.audience.trim().length>0?d.audience.trim():""},roles:{viewers:Z(e.viewers),operators:Z(e.operators),admins:Z(e.admins),viewerDomains:Z(e.viewerDomains),operatorDomains:Z(e.operatorDomains),adminDomains:Z(e.adminDomains)},current:{authenticated:!0===f.authenticated,role:"viewer"===h||"operator"===h||"admin"===h?h:null,email:"string"==typeof f.email&&f.email.trim().length>0?f.email.trim():null,provider:"string"==typeof f.provider&&f.provider.trim().length>0?f.provider.trim():null}}}function aa(a){let b=Y(a),c=b.mode,d=b.status,e=b.provider,f=b.autoInstallMethod;return{publicUrl:"string"==typeof b.publicUrl&&b.publicUrl.trim().length>0?b.publicUrl.trim():null,connectUrl:"string"==typeof b.connectUrl&&b.connectUrl.trim().length>0?b.connectUrl.trim():null,shareable:!0===b.shareable,status:"starting"===d||"ready"===d||"error"===d||"disabled"===d?d:"disabled",provider:"tailscale"===e?e:null,recommendedProvider:"tailscale"===b.recommendedProvider?b.recommendedProvider:null,localUrl:"string"==typeof b.localUrl&&b.localUrl.trim().length>0?b.localUrl.trim():null,managed:!0===b.managed,installed:!0===b.installed,connected:!0===b.connected,canAutoInstall:!0===b.canAutoInstall,autoInstallMethod:"brew"===f?"brew":null,lastError:"string"==typeof b.lastError&&b.lastError.trim().length>0?b.lastError.trim():null,startedAt:"string"==typeof b.startedAt&&b.startedAt.trim().length>0?b.startedAt.trim():null,updatedAt:"string"==typeof b.updatedAt&&b.updatedAt.trim().length>0?b.updatedAt.trim():null,mode:"cloudflare-access"===c||"private-network"===c||"enterprise-only"===c||"generic-header"===c||"clerk"===c||"local-only"===c||"misconfigured"===c||"unsafe-public"===c?c:"local-only",title:"string"==typeof b.title&&b.title.trim().length>0?b.title.trim():"Remote access",description:"string"==typeof b.description&&b.description.trim().length>0?b.description.trim():"",warnings:$(b.warnings),nextSteps:$(b.nextSteps)}}function ab(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function ac(a,b){return b[(0,K.normalizeAgentName)(a)]??null}function ad(a){if(!a)return[];let b=[],c=new Set;for(let d of Object.values(a.modelsByAccess))if(Array.isArray(d))for(let a of d)!a?.id||c.has(a.id)||(c.add(a.id),b.push(a));return b}function ae(a,b,c){let d=ac(a,c),e=(0,n.resolveAgentModelAccess)(a,b),f=(0,N.getRuntimeCatalogModelsForAccess)(d,e),g=(0,n.getAvailableAgentModels)(a,b),h=[],i=new Set;for(let a of[...f,...g,...ad(d)])!a?.id||i.has(a.id)||(i.add(a.id),h.push(a));return h}function af(a,b,c,d){let e=ac(a,c),f=(0,n.resolveAgentModelAccess)(a,b),g=(0,N.getRuntimeCatalogReasoningOptions)(e,d,f),h=(0,n.getAvailableAgentReasoningEfforts)(a,b),i=[],j=new Set;for(let a of[...g,...h])!a?.id||j.has(a.id)||(j.add(a.id),i.push(a));return i}function ag(a,b,c,d){let e=ac(a,c),f=(0,n.resolveAgentModelAccess)(a,b);return(0,N.getRuntimeCatalogDefaultReasoning)(e,d,f)??(0,n.getDefaultAgentReasoningEffort)(a,b)??""}function ah(a,b,c,d,e){let f,g,h=d?.trim()??"",i=e?.trim().toLowerCase()??"",j=ae(a,b,c),k=(f=ac(a,c),g=(0,n.resolveAgentModelAccess)(a,b),(0,N.getRuntimeCatalogDefaultModelForAccess)(f,g)??(0,n.getDefaultAgentModel)(a,b)??ad(f)[0]?.id??""),l=d=>{let e=af(a,b,c,d);return i.length>0&&e.some(a=>a.id===i)?i:ag(a,b,c,d)};return h.length>0?j.some(a=>a.id===h)?{catalogModel:h,customModel:"",reasoningEffort:l(h)}:{catalogModel:k,customModel:h,reasoningEffort:l(h)}:{catalogModel:k,customModel:"",reasoningEffort:l(k)}}function ai(a){let b=a.customModel.trim();if(b.length>0)return b;let c=a.catalogModel.trim();return c.length>0?c:void 0}function aj(a){let b=a.reasoningEffort.trim().toLowerCase();return b.length>0?b:void 0}function ak(a,b){let c=(0,n.getAgentModelCatalog)(a);if(!c||c.accessOptions.length<=1)return null;let d=(0,n.resolveAgentModelAccess)(a,b);return d?c.accessOptions.find(a=>a.id===d)?.label??null:null}let al="block h-4 w-4 shrink-0",am="block h-4 w-4 shrink-0 object-contain",an={vscode:{kind:"image",imageSrc:"/icons/ide/vscode-dark.svg",className:am},"vscode-insiders":{kind:"image",imageSrc:"/icons/ide/vscode-insiders.svg",className:am},cursor:{kind:"image",imageSrc:"/icons/ide/cursor-dark.svg",className:am},windsurf:{kind:"image",imageSrc:"/icons/ide/windsurf-dark.svg",className:am},"intellij-idea":{kind:"image",imageSrc:"/icons/ide/intellij.svg",className:am},zed:{kind:"image",imageSrc:"/icons/ide/zed-dark.svg",className:am},xcode:{kind:"image",imageSrc:"/icons/ide/xcode.svg",className:am},antigravity:{kind:"image",imageSrc:"/icons/ide/antigravity-dark.svg",className:am},custom:{kind:"icon",icon:F.Settings2,className:`${am} text-[var(--vk-text-muted)]`}};function ao({editorId:a,label:c}){let d=an[a];if(!d)return(0,b.jsx)(F.Settings2,{className:`${am} text-[var(--vk-text-muted)]`});if("image"===d.kind)return(0,b.jsx)("img",{src:d.imageSrc,alt:`${c} logo`,className:d.className});let e=d.icon;return(0,b.jsx)(e,{className:d.className})}function ap(a){return JSON.stringify(a)}let aq={obsidian:{kind:"icon",icon:o.SiObsidian,className:`${al} text-[#8b5cf6]`},vscode:{kind:"icon",icon:p.VscVscode,className:`${al} text-[#22a3f5]`},notion:{kind:"icon",icon:o.SiNotion,className:`${al} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${al} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${al} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:F.Settings2,className:`${al} text-[var(--vk-text-muted)]`}};function ar({editorId:a}){let c=aq[a];if(!c)return(0,b.jsx)(r,{className:`${al} text-[var(--vk-text-muted)]`});if("image"===c.kind)return(0,b.jsx)("img",{src:c.imageSrc,alt:"",className:c.className});let d=c.icon;return(0,b.jsx)(d,{className:c.className})}function as({agent:a,modelAccess:c,runtimeModelCatalogs:d,selection:e,onChange:f,compact:g=!1}){if(!(0,n.supportsAgentModelSelection)(a))return null;let h=(0,n.getAgentModelCatalog)(a),i=ae(a,c,d),j=af(a,c,d,ai(e)??e.catalogModel),k=ak(a,c);return h?(0,b.jsxs)("div",{className:g?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,b.jsxs)("select",{value:e.catalogModel,disabled:0===i.length,onChange:b=>{let g=b.target.value,h=af(a,c,d,g);f({...e,catalogModel:g,reasoningEffort:h.some(a=>a.id===e.reasoningEffort)?e.reasoningEffort:ag(a,c,d,g)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===i.length&&(0,b.jsx)("option",{value:"",children:"No runtime models detected"}),i.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))]}),(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[k?`Filtered for ${k}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),j.length>0&&(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,b.jsx)("select",{value:e.reasoningEffort,onChange:a=>{f({...e,reasoningEffort:a.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:j.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,b.jsx)("input",{value:e.customModel,onChange:b=>{let g=b.target.value,h=g.trim()||e.catalogModel,i=af(a,c,d,h);f({...e,customModel:g,reasoningEffort:i.some(a=>a.id===e.reasoningEffort)?e.reasoningEffort:ag(a,c,d,h)})},placeholder:function(a,b){let c=ac(a,b);if(c?.customModelPlaceholder.trim())return c.customModelPlaceholder;let d=(0,n.getAgentModelCatalog)(a)?.label??"agent";return`Enter exact ${d} model id`}(a,d),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function at({open:a,onClose:c,onCreate:e,creating:f,error:g,defaultAgent:h,agentOptions:i}){let[n,o]=(0,d.useState)("git"),[p,q]=(0,d.useState)(""),[r,s]=(0,d.useState)(!1),[t,w]=(0,d.useState)(""),[x,y]=(0,d.useState)(""),[z,C]=(0,d.useState)("main"),[E,F]=(0,d.useState)(h),[G,H]=(0,d.useState)(!1),[I,M]=(0,d.useState)(!0),[N,S]=(0,d.useState)([]),[T,U]=(0,d.useState)(!1),[V,W]=(0,d.useState)(!1),[X,Y]=(0,d.useState)(null),[Z,$]=(0,d.useState)(""),[_,aa]=(0,d.useState)(""),[ab,ac]=(0,d.useState)(!1),[ad,ae]=(0,d.useState)("local"),[af,ag]=(0,d.useState)([]),[ah,ai]=(0,d.useState)(!1),[aj,ak]=(0,d.useState)(null);(0,d.useEffect)(()=>{a&&(o("git"),q(""),s(!1),w(""),y(""),C("main"),M(!0),H(!1),F(h),S([]),W(!1),Y(null),$(""),aa(""),ag([]),ak(null),ai(!1),ac(!1),ae("local"))},[h,a]),(0,d.useEffect)(()=>{!a||"local"!==n||x.trim().length>0||(ae("local"),ac(!0))},[n,a,x]);let al=(0,d.useMemo)(()=>{let a=Z.trim().toLowerCase(),b=0===a.length?N:N.filter(b=>b.fullName.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)||(b.ownerLogin??"").toLowerCase().includes(a)||(b.description??"").toLowerCase().includes(a)||b.defaultBranch.toLowerCase().includes(a));return 0===a.length?b.slice(0,10):b.slice(0,14)},[Z,N]),am=(0,d.useMemo)(()=>{let a=N.find(a=>a.httpsUrl===_);return a||(t.trim()?N.find(a=>a.httpsUrl===t.trim())??null:null)},[t,N,_]),an=(0,d.useMemo)(()=>(function(a){let b=a.trim();if(!b)return null;let c=b.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(c)return`https://github.com/${c[1]}/${c[2]}.git`;let d=b.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return d?`https://github.com/${d[1]}/${d[2]}.git`:null})(Z),[Z]),ao=(0,d.useMemo)(()=>{let a;return(a=Z.trim())&&/^(https?:\/\/|git@)/i.test(a)?a:null},[Z]),ap=(0,d.useMemo)(()=>R(am?.updatedAt),[am]),aq=(0,d.useMemo)(()=>{let a=an??ao;return!!a&&a.toLowerCase()!==t.trim().toLowerCase()},[t,an,ao]),ar=(0,d.useMemo)(()=>{let a=[...new Set(i)];0===a.length&&a.push(h||O);let b=new Map(L.KNOWN_AGENT_ORDER.map((a,b)=>[a,b]));return a.sort((a,c)=>{let d=b.get((0,K.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,K.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:P(a).localeCompare(P(c))})},[i,h]);(0,d.useEffect)(()=>{ar.includes(E)||F(ar[0]??O)},[E,ar]);let as=async(a=!1)=>{U(!0),Y(null);try{let b=await fetch(`/api/github/repos${a?"?refresh=true":""}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load GitHub repositories (${b.status})`);S(Array.isArray(c?.repos)?c.repos:[])}catch(a){S([]),Y(a instanceof Error?a.message:"Failed to load GitHub repositories")}finally{W(!0),U(!1)}};(0,d.useEffect)(()=>{!a||"git"!==n||T||V||as()},[V,T,n,a]);let at=async a=>{let b=a?.gitUrl??("git"===n?t.trim():""),c=a?.path??("local"===n?x.trim():"");if(0===b.length&&0===c.length)return void ak("git"===n?"Choose or paste a repository first.":"Select a local repository path first.");ai(!0),ak(null);try{let a=new URLSearchParams;b.length>0&&a.set("gitUrl",b),c.length>0&&a.set("path",c);let d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to load branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];ag(f);let g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??null;g&&(0===z.trim().length||!f.includes(z))&&C(g)}catch(a){ag([]),ak(a instanceof Error?a.message:"Failed to load branches")}finally{ai(!1)}},av=async a=>{aa(a);let b=N.find(b=>b.httpsUrl===a);b&&(w(b.httpsUrl),$(b.fullName),C(b.defaultBranch||"main"),r||q(Q(b.name)||p),await at({gitUrl:b.httpsUrl}))},aw=async()=>{let a=an??ao;if(!a)return;let b=N.find(b=>b.httpsUrl.toLowerCase()===a.toLowerCase())??null;if(b)return void await av(b.httpsUrl);if(aa(""),w(a),C("main"),ag([]),ak(null),!r){let b=function(a){let b=a.trim();if(!b)return null;let c=b.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(c)return c[2]??null;try{let a=new URL(b).pathname.split("/").filter(Boolean).at(-1);return a?a.replace(/\.git$/i,""):null}catch{return null}}(a);b&&q(Q(b))}await at({gitUrl:a})},ax=a=>{ae(a),ac(!0)};if(!a)return null;let ay="git"===n?t.trim().length>0&&z.trim().length>0:x.trim().length>0&&z.trim().length>0;async function az(a){if(a.preventDefault(),!ay||f)return;let b="git"===n?{mode:n,projectId:p.trim()||void 0,agent:E,defaultBranch:z.trim(),useWorktree:G,gitUrl:t.trim(),path:x.trim()||void 0}:{mode:n,projectId:p.trim()||void 0,agent:E,defaultBranch:z.trim(),useWorktree:G,path:x.trim(),initializeGit:I};await e(b)}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[80] flex items-start justify-center overflow-y-auto bg-black/65 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{f||ab||c()},role:"presentation",children:(0,b.jsxs)("form",{onSubmit:az,onClick:a=>a.stopPropagation(),className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",children:[(0,b.jsxs)("header",{className:"flex items-center border-b border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,b.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Pick a GitHub repository or local folder, then confirm the branch."})]}),(0,b.jsx)("button",{type:"button",onClick:c,disabled:f,"aria-label":"Close dialog",className:"ml-auto inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,b.jsx)(J.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-4",children:[(0,b.jsxs)("div",{className:"inline-flex rounded-[4px] border border-[var(--vk-border)] p-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>o("git"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"git"===n?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"GitHub"}),(0,b.jsx)("button",{type:"button",onClick:()=>o("local"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"local"===n?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Local Folder"})]}),"git"===n?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(l,{className:"h-[18px] w-[18px]"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"GitHub Repository"}),(0,b.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:"Search accessible repositories or paste a repository URL. Conductor fills the branch and clone URL after selection."})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{W(!1),as(!0)},disabled:T,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:T?(0,b.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(D.RefreshCcw,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,b.jsxs)("div",{className:"relative mt-3",children:[(0,b.jsx)(l,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,b.jsx)("input",{value:Z,onChange:a=>$(a.target.value),onKeyDown:a=>{"Enter"===a.key&&aq&&(a.preventDefault(),aw())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-10 w-full rounded-[5px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),aq?(0,b.jsxs)("button",{type:"button",onClick:()=>{aw()},className:"mt-3 inline-flex items-center gap-2 rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,b.jsx)(m,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,b.jsxs)("span",{className:"truncate",children:["Use ",an?"this GitHub repository":"pasted repository URL"]})]}):null,T&&0===N.length?(0,b.jsx)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,X?(0,b.jsxs)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,b.jsx)("p",{children:X}),(0,b.jsx)("button",{type:"button",onClick:()=>{W(!1),as(!0)},className:"mt-2 inline-flex items-center rounded-[4px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!X&&al.length>0?(0,b.jsx)("div",{className:"mt-3 max-h-[260px] space-y-2 overflow-y-auto pr-1",children:al.map(a=>{let c=R(a.updatedAt),d=am?.httpsUrl===a.httpsUrl;return(0,b.jsxs)("button",{type:"button",onClick:()=>{av(a.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[5px] border px-3 py-3 text-left transition ${d?"border-[var(--vk-orange)] bg-[var(--vk-bg-panel)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)("span",{className:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(m,{className:"h-4 w-4"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:a.fullName}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[a.private?(0,b.jsx)(k,{className:"h-3 w-3"}):(0,b.jsx)(l,{className:"h-3 w-3"}),a.private?"Private":"Public"]}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(j,{className:"h-3 w-3"}),a.defaultBranch]})]}),a.description?(0,b.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:a.description}):null,(0,b.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[a.ownerLogin?(0,b.jsx)("span",{children:a.ownerLogin}):null,c?(0,b.jsx)("span",{children:c}):null,a.permission?(0,b.jsx)("span",{children:a.permission.toLowerCase()}):null]})]}),(0,b.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:d?(0,b.jsx)(u.Check,{className:"h-4 w-4"}):null})]},a.httpsUrl)})}):null,T||X||0!==al.length?null:(0,b.jsx)("p",{className:"mt-3 text-[12px] text-[var(--vk-text-muted)]",children:Z.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}),t.trim().length>0?(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(m,{className:"h-[18px] w-[18px]"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:am?.fullName??t}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[am&&am.private?(0,b.jsx)(k,{className:"h-3 w-3"}):(0,b.jsx)(l,{className:"h-3 w-3"}),am?am.private?"Private":"Public":"Manual URL"]}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(j,{className:"h-3 w-3"}),z||"main"]})]}),am?.description?(0,b.jsx)("p",{className:"mt-1 line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:am.description}):(0,b.jsx)("p",{className:"mt-1 truncate text-[12px] text-[var(--vk-text-muted)]",children:t}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[am?.ownerLogin?(0,b.jsx)("span",{children:am.ownerLogin}):null,ap?(0,b.jsx)("span",{children:ap}):null,am?.permission?(0,b.jsx)("span",{children:am.permission.toLowerCase()}):null]})]})]})}):null]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Path"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:x,readOnly:!0,onClick:()=>ax("local"),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>ax("local"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,b.jsx)(A.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:I,onChange:a=>M(a.target.checked),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Initialize git if this folder is non-git"})]})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,b.jsx)("input",{value:p,onChange:a=>{q(a.target.value),s(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:z,onChange:a=>C(a.target.value),placeholder:"Uses the repository default branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{at()},disabled:ah,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:ah?(0,b.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.RefreshCcw,{className:"h-3.5 w-3.5"})})]}),af.length>0&&(0,b.jsx)("select",{value:z,onChange:a=>C(a.target.value),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:af.map(a=>(0,b.jsx)("option",{value:a,children:a},a))}),aj&&(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:aj})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,b.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ar.map(a=>(0,b.jsx)("option",{value:a,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:P(a)},a))})]})]}),"git"===n?(0,b.jsxs)("details",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,b.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,b.jsx)(v.ChevronDown,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Advanced options"]})}),(0,b.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Copy Location (optional)"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:x,readOnly:!0,onClick:()=>ax("clone"),placeholder:"Choose a folder only if you want a specific clone location",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>ax("clone"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,b.jsx)(A.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:G,onChange:a=>H(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,b.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]})]})]}):(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:G,onChange:a=>H(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,b.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]}),g&&(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:g})]}),(0,b.jsxs)("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("button",{type:"button",onClick:c,disabled:f,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,b.jsx)("button",{type:"submit",disabled:!ay||f,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})]})}),(0,b.jsx)(au,{open:ab,initialPath:x,title:"local"===ad?"Select Local Repository":"Select Clone Target Folder",description:"local"===ad?"Choose the local repository folder.":"Choose where the git repository should be cloned.",onClose:()=>ac(!1),onSelect:a=>{if(ac(!1),a){if(y(a),("local"===n||"local"===ad)&&!r){let b,c=(b=a.trim())?b.split(/[\\/]+/).filter(Boolean).at(-1)??null:null;c&&q(Q(c))}("local"===n||"local"===ad)&&at({path:a})}}})]})}function au({open:a,initialPath:c,title:e,description:f,onClose:g,onSelect:h}){let[i,j]=(0,d.useState)(""),[k,l]=(0,d.useState)(c??""),[m,n]=(0,d.useState)([]),[o,p]=(0,d.useState)(""),[q,r]=(0,d.useState)(!1),[s,t]=(0,d.useState)(null),[u,v]=(0,d.useState)(!1);(0,d.useEffect)(()=>{if(!a)return;p(""),l(c??"");let b=c&&c.trim().length>0?c.trim():void 0,d=b?`?path=${encodeURIComponent(b)}`:"";r(!0),t(null),fetch(`/api/filesystem/directory${d}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load directory (${a.status})`);j("string"==typeof b?.currentPath?b.currentPath:""),n(Array.isArray(b?.entries)?b.entries:[])}).catch(a=>{t(a instanceof Error?a.message:"Failed to load directory"),n([])}).finally(()=>{r(!1)})},[c,a]);let w=(0,d.useMemo)(()=>{if(0===o.trim().length)return m;let a=o.trim().toLowerCase();return m.filter(b=>b.name.toLowerCase().includes(a))},[m,o]),x=async a=>{r(!0),t(null);try{let b=a&&a.trim().length>0?`?path=${encodeURIComponent(a.trim())}`:"",c=await fetch(`/api/filesystem/directory${b}`),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to load directory (${c.status})`);let e="string"==typeof d?.currentPath?d.currentPath:"";j(e),n(Array.isArray(d?.entries)?d.entries:[]),l(e)}catch(a){t(a instanceof Error?a.message:"Failed to load directory"),n([])}finally{r(!1)}},y=async()=>{v(!0);try{let a=await fetch("/api/filesystem/pick-directory",{method:"POST"}),b=await a.json().catch(()=>null);if(!b||b.cancelled||!b.path)return;l(b.path),x(b.path)}catch{}finally{v(!1)}};return a?(0,b.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{g(),h(null)},role:"presentation",children:(0,b.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:e}),(0,b.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:f})]}),(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("input",{value:k,onChange:a=>l(a.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{x(k)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:()=>{x()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,b.jsx)("button",{type:"button",onClick:()=>{if(!i)return;let a=i.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(i)||"/"===a)return;let b=a.split("/").filter(Boolean),c=i.match(/^([A-Za-z]):[/\\]/);x(c?b.length>1?`${c[1]}:/${b.slice(1,-1).join("/")}`:`${c[1]}:/`:b.length>1?`/${b.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,b.jsxs)("button",{type:"button",disabled:u,onClick:()=>{y()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[u?(0,b.jsx)(B.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(A.FolderOpen,{className:"h-3 w-3"}),u?"Opening...":"Browse"]}),(0,b.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:i||"Home"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(E.Search,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,b.jsx)("input",{value:o,onChange:a=>p(a.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:q?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):s?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:s}):0===w.length?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,b.jsx)("div",{className:"p-1",children:w.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{a.isDirectory&&x(a.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${a.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,b.jsx)(A.FolderOpen,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.name}),a.isGitRepo&&(0,b.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},a.path))})})]}),(0,b.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("button",{type:"button",onClick:()=>{g(),h(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,b.jsx)("button",{type:"button",onClick:()=>{let a=k.trim().length>0?k.trim():i;g(),h(a||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function av({value:a,idleLabel:c="Copy",copiedLabel:e="Copied"}){let[f,g]=(0,d.useState)(!1);async function h(){await navigator.clipboard.writeText(a),g(!0),window.setTimeout(()=>g(!1),1400)}return(0,b.jsxs)("button",{type:"button",onClick:()=>void h(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[f?(0,b.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,b.jsx)(x.Copy,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f?e:c})]})}function aw({open:a,mode:e,creating:f,error:g,current:h,projectCount:i,agentOptions:j,agentStates:k,runtimeModelCatalogs:l,onRepositoriesChanged:m,onOnboardingComplete:o,onOpenAgentSetup:p,onClose:q,onSave:r}){var s,t;let x,[y,z]=(0,d.useState)("preferences"),[C,E]=(0,d.useState)(h.codingAgent),[F,G]=(0,d.useState)(h.ide),[N,Q]=(0,d.useState)(h.markdownEditor),[R,Y]=(0,d.useState)(h.markdownEditorPath??""),[Z,$]=(0,d.useState)(h.modelAccess),[ac,ad]=(0,d.useState)(h.notifications.soundEnabled),[af,ag]=(0,d.useState)(h.notifications.soundFile),[al,am]=(0,d.useState)([]),[an,aq]=(0,d.useState)(!1),[at,aw]=(0,d.useState)(!1),[ax,ay]=(0,d.useState)(null),[az,aA]=(0,d.useState)(""),[aB,aC]=(0,d.useState)(null),[aD,aE]=(0,d.useState)(ab()),[aF,aG]=(0,d.useState)([]),[aH,aI]=(0,d.useState)(!1),[aJ,aK]=(0,d.useState)(null),[aL,aM]=(0,d.useState)(!1),[aN,aO]=(0,d.useState)(!1),[aP,aQ]=(0,d.useState)(()=>_(null)),[aR,aS]=(0,d.useState)(!1),[aT,aU]=(0,d.useState)(!1),[aV,aW]=(0,d.useState)(null),[aX,aY]=(0,d.useState)(()=>aa(null)),[aZ,a$]=(0,d.useState)(!1),[a_,a0]=(0,d.useState)(null),[a1,a2]=(0,d.useState)(null),a3=f||at||aT||null!==a_;function a4(a){return{...a,agentPermissions:"default"===a.agentPermissions?"default":"skip",devServerScript:a.devServerScript??"",devServerCwd:a.devServerCwd??"",devServerUrl:a.devServerUrl??"",devServerPort:a.devServerPort??"",devServerHost:a.devServerHost??"",devServerPath:a.devServerPath??"",devServerHttps:!0===a.devServerHttps,pathHealth:{exists:a.pathHealth.exists,isGitRepository:a.pathHealth.isGitRepository,suggestedPath:a.pathHealth.suggestedPath}}}function a5(a){return a.split(/\n+/g).map(a=>a.trim()).filter(Boolean)}async function a6(a){aq(!0),ay(null);try{let b=await fetch("/api/repositories"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load repositories (${b.status})`);let d=Array.isArray(c?.repositories)?c.repositories:[];am(d);let e=d[0]?.id??"",f=a&&d.some(b=>b.id===a)?a:az&&d.some(a=>a.id===az)?az:e;aA(f)}catch(a){am([]),aA(""),aC(null),aE(ab()),ay(a instanceof Error?a.message:"Failed to load repositories")}finally{aq(!1)}}async function a7(a,b){let c=(a??aB?.path??"").trim();if(0===c.length){aK("Select a repository path first."),aG([]);return}aI(!0),aK(null);try{let a=new URLSearchParams({path:c}),d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to detect branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];aG(f);let g=b?.trim()||("string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??"");if(!g)return;aC(a=>!a||a.defaultBranch.trim().length>0&&f.includes(a.defaultBranch)?a:{...a,defaultBranch:g})}catch(a){aG([]),aK(a instanceof Error?a.message:"Failed to detect branches")}finally{aI(!1)}}async function a8(){if(!aB||at||0===aB.repo.trim().length||0===aB.path.trim().length)return!1;aw(!0),ay(null);try{let a=await fetch("/api/repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:aB.id,displayName:aB.displayName,repo:aB.repo,path:aB.path,agent:aB.agent,agentPermissions:aB.agentPermissions,agentModel:ai(aD)??"",agentReasoningEffort:aj(aD)??"",defaultWorkingDirectory:aB.defaultWorkingDirectory,defaultBranch:aB.defaultBranch,devServerScript:aB.devServerScript,devServerCwd:aB.devServerCwd,devServerUrl:aB.devServerUrl,devServerPort:aB.devServerPort,devServerHost:aB.devServerHost,devServerPath:aB.devServerPath,devServerHttps:aB.devServerHttps,setupScript:aB.setupScript,runSetupInParallel:aB.runSetupInParallel,cleanupScript:aB.cleanupScript,archiveScript:aB.archiveScript,copyFiles:aB.copyFiles})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save repository settings (${a.status})`);let c=b?.repository;if(!c)throw Error("Repository saved but response is missing repository data");return am(a=>a.map(a=>a.id===c.id?c:a)),aC(a4(c)),aA(c.id),aK(null),await a7(c.path,c.defaultBranch),m&&await m(),!0}catch(a){return ay(a instanceof Error?a.message:"Failed to save repository settings"),!1}finally{aw(!1)}}async function a9(){aS(!0),aW(null);try{let a=await fetch("/api/access"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load organization settings (${a.status})`);aQ(_(b?.access,b?.current))}catch(a){aQ(_(null)),aW(a instanceof Error?a.message:"Failed to load organization settings")}finally{aS(!1)}}async function ba(){if(aT)return!1;aU(!0),aW(null);try{let a=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:aP.requireAuth||aP.trustedHeaders.enabled,defaultRole:aP.defaultRole,trustedHeaders:{enabled:aP.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:aP.trustedHeaders.emailHeader,jwtHeader:aP.trustedHeaders.jwtHeader,teamDomain:aP.trustedHeaders.teamDomain,audience:aP.trustedHeaders.audience},roles:{viewers:a5(aP.roles.viewers),operators:a5(aP.roles.operators),admins:a5(aP.roles.admins),viewerDomains:a5(aP.roles.viewerDomains),operatorDomains:a5(aP.roles.operatorDomains),adminDomains:a5(aP.roles.adminDomains)}})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save organization settings (${a.status})`);return aQ(_(b?.access,b?.current)),"remote_access"===y&&await bb(),!0}catch(a){return aW(a instanceof Error?a.message:"Failed to save organization settings"),!1}finally{aU(!1)}}async function bb(){a$(!0),a2(null);try{let a=await fetch("/api/remote-access"),b=await a.json().catch(()=>null);if(!a.ok){let c=b&&"object"==typeof b&&"reason"in b&&"string"==typeof b.reason?b.reason:null,d=b&&"object"==typeof b&&"error"in b&&"string"==typeof b.error?b.error:null;throw Error(c??d??`Failed to load remote access (${a.status})`)}aY(aa(b))}catch(a){aY(aa(null)),a2(a instanceof Error?a.message:"Failed to load remote access")}finally{a$(!1)}}async function bc(a){a0(a),a2(null);try{let b=await fetch("/api/remote-access",{method:"disable"===a?"DELETE":"POST",headers:"disable"===a?void 0:{"Content-Type":"application/json"},body:"disable"===a?void 0:JSON.stringify({action:a})}),c=await b.json().catch(()=>null);if(!b.ok){let d=c&&"object"==typeof c&&"reason"in c&&"string"==typeof c.reason?c.reason:null,e=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:null;throw Error(d??e??`Failed to ${a} remote access (${b.status})`)}aY(aa(c))}catch(b){a2(b instanceof Error?b.message:`Failed to ${a} remote access`)}finally{a0(null)}}(0,d.useEffect)(()=>{a&&(z("onboarding"===e?"preferences":"general"),E(h.codingAgent),G(h.ide),Q(h.markdownEditor),Y(h.markdownEditorPath??""),$(h.modelAccess),ad(h.notifications.soundEnabled),ag(h.notifications.soundFile),aG([]),aK(null),ay(null),aE(ab()),aW(null),aY(aa(null)),a2(null))},[e,a]),(0,d.useEffect)(()=>{a&&("settings"===e||"repositories"===y)&&a6()},[y,e,a]),(0,d.useEffect)(()=>{a&&"onboarding"!==e&&a9()},[e,a]),(0,d.useEffect)(()=>{a&&"onboarding"!==e&&"remote_access"===y&&bb()},[y,e,a]),(0,d.useEffect)(()=>{if(!a)return;if(!az){aC(null),aE(ab());return}let b=al.find(a=>a.id===az);b&&(aC(a4(b)),aE(ah(b.agent,Z,l,b.agentModel,b.agentReasoningEffort)),aG([]),aK(null),b.path.trim().length>0&&a7(b.path,b.defaultBranch))},[Z,a,al,l,az]);let bd="onboarding"===e&&i>0,be=(0,d.useMemo)(()=>"onboarding"===e?bd?T:T.filter(a=>"preferences"===a.id):S.filter(a=>a.implemented),[e,bd]),bf=be.find(a=>a.id===y)??be[0]??S[0],bg="onboarding"===e,bh="preferences"===bf.id,bi="general"===bf.id,bj="remote_access"===bf.id,bk="agents"===bf.id,bl=bh||bi||bk,bm=bl||bj,bn="repositories"===bf.id,bo="organization"===bf.id,bp=be.findIndex(a=>a.id===bf.id)+1,bq=be.some(a=>"repositories"===a.id),br="admin"===aP.current.role,bs=function(a){switch(a){case"cloudflare-access":return"Cloudflare Access";case"private-network":return"Private network";case"enterprise-only":return"Enterprise only";case"generic-header":return"Legacy mode blocked";case"clerk":return"Clerk";case"misconfigured":return"Auth required";case"unsafe-public":return"Blocked until protected";default:return"Local only"}}(aX.mode),bt=function(a){switch(a){case"starting":return"Starting";case"ready":return"Ready";case"error":return"Error";default:return"Disabled"}}(aX.status),bu=null!==a_,bv=aX.provider??aX.recommendedProvider,bw="tailscale"===bv,bx=null!==bv||aX.managed,by=U.find(a=>a.id===F)??{id:F,label:F},bz="z-50 min-w-[240px] rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.35)]",bA=`${bz} min-w-[280px]`,bB="flex min-h-[40px] cursor-default items-center gap-2 rounded-[4px] px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)]",bC=!aX.installed&&aX.canAutoInstall?"Install + Enable":"Enable Private Link",bD=!aZ&&!bu&&bw&&!("ready"===aX.status&&aX.managed),bE=!aZ&&!bu&&("starting"===aX.status||"ready"===aX.status||"error"===aX.status),bF=(0,d.useMemo)(()=>{let a=new Set(j);C.trim().length>0&&a.add(C),0===a.size&&a.add(O);let b=new Map(L.KNOWN_AGENT_ORDER.map((a,b)=>[a,b]));return[...a].sort((a,c)=>{let d=b.get((0,K.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,K.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:P(a).localeCompare(P(c))})},[j,C]),bG=k[(0,K.normalizeAgentName)(C)]??null;if(!a)return null;let bH=C.trim().length>0&&F.trim().length>0&&N.trim().length>0,bI=!!aB&&aB.displayName.trim().length>0&&aB.repo.trim().length>0&&aB.path.trim().length>0&&aB.defaultBranch.trim().length>0,bJ=br&&!aR&&(!aP.trustedHeaders.enabled||aP.trustedHeaders.teamDomain.trim().length>0&&aP.trustedHeaders.audience.trim().length>0),bK=bn?ax:bo?aV:g,bL=aB?(s={...aB,agentModel:ai(aD)??"",agentReasoningEffort:aj(aD)??""},t={ide:F,markdownEditor:N},x=["npx conductor-oss@latest setup","--yes",`--path ${ap(s.path)}`,`--project-id ${ap(s.id)}`,`--display-name ${ap(s.displayName)}`,`--agent ${ap(s.agent||"claude-code")}`,`--ide ${ap(t.ide)}`,`--markdown-editor ${ap(t.markdownEditor)}`],s.repo.trim().length>0&&x.push(`--repo ${ap(s.repo.trim())}`),s.defaultBranch.trim().length>0&&x.push(`--default-branch ${ap(s.defaultBranch.trim())}`),s.agentModel.trim().length>0&&x.push(`--model ${ap(s.agentModel.trim())}`),s.agentReasoningEffort.trim().length>0&&x.push(`--reasoning-effort ${ap(s.agentReasoningEffort.trim())}`),s.defaultWorkingDirectory.trim().length>0&&x.push(`--default-working-directory ${ap(s.defaultWorkingDirectory.trim())}`),x.join(" ")):"";async function bM(a,b){let c;if(!bH||f)return!1;let d=await r((c=ac?af??X[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!a||h.onboardingAcknowledged,codingAgent:C.trim(),ide:F.trim(),markdownEditor:N.trim(),markdownEditorPath:(R??"").trim(),modelAccess:Z,notifications:{soundEnabled:ac,soundFile:c}}),b);return d&&bG&&!bG.ready&&p(C),d}async function bN(){if(!an){if(!bq){if(!await bM(!0,{closeDialog:!0}))return;o?.({needsProject:0===i});return}await bM(!1,{closeDialog:!1})&&z("repositories")}}async function bO(){(!bn||await a8())&&await bM(!0,{closeDialog:!0})&&o?.({needsProject:!1})}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{a3||"onboarding"===e||aL||aN||q()},role:"presentation",children:(0,b.jsxs)("div",{className:"flex h-[100dvh] w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:max-h-[calc(100dvh-1.5rem)] sm:max-w-[1120px] sm:rounded-[6px] sm:border sm:flex-row",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,b.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,b.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:bg?"Setup":"Settings"})}),(0,b.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:be.map(a=>{let c=a.icon,d=bf.id===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>z(a.id),disabled:a3,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${d?"bg-[rgba(234,122,42,0.1)] text-[var(--vk-orange)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:a.label})]},a.id)})})]}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:bg?bh?"Choose your preferences":"Review repository defaults":bf.label}),bg&&(0,b.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",bp," of ",be.length]})]}),(0,b.jsx)("button",{type:"button",onClick:q,disabled:a3||"onboarding"===e,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,b.jsx)(J.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:bm?(0,b.jsxs)("div",{className:"space-y-5",children:[bg&&(0,b.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.08)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using chat and boards immediately."})}),(bh||bk)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,b.jsx)("div",{className:"grid gap-3",children:bF.map(a=>{let c=C===a,d=k[(0,K.normalizeAgentName)(a)]??null,e=ak(a,Z),f=ae(a,Z,l),g=f.slice(0,3),h=f.length-g.length,i=d?.installed?d.ready?"Ready":"Setup required":"Not installed";return(0,b.jsxs)("div",{className:`flex flex-col gap-3 rounded-[4px] border px-3 py-3 text-left sm:flex-row sm:items-start ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,b.jsx)(M.AgentTileIcon,{seed:{label:a},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:P(a)}),(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:i}),e?(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:e}):null]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:d?.description??(0,L.getKnownAgent)(a)?.description??"Agent metadata not available."}),(0,b.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[g.map(c=>(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:c.label},`${a}-${c.id}`)),h>0?(0,b.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",h," more"]}):null,0===g.length?(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,n.supportsAgentModelSelection)(a)?"Models appear after setup":"Uses the agent default model"}):null]}),!d?.installed&&d?.installHint?(0,b.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,b.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:d.installHint})]}):null]})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2 self-start sm:ml-auto",children:[d?.ready?null:(0,b.jsx)("button",{type:"button",onClick:()=>{E(a),p(a)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:d?.installed?"Authenticate":"Install"}),(0,b.jsx)("button",{type:"button",onClick:()=>E(a),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${c?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:c?"Selected":"Use this agent"}),c&&(0,b.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},a)})})]}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,b.jsx)("div",{className:"grid gap-3",children:bF.filter(a=>{let b=(0,n.getAgentModelCatalog)(a);return(0,n.supportsAgentModelSelection)(a)&&(b?.accessOptions.length??0)>1}).map(a=>{let c=(0,n.getAgentModelCatalog)(a);if(!c)return null;let d=(0,n.resolveAgentModelAccess)(a,Z)??c.defaultAccess;return(0,b.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,b.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:c.label}),(0,b.jsx)("select",{value:d,onChange:b=>{var c;let d;return c=b.target.value,void((d=(0,n.getAgentModelCatalog)(a))&&$(a=>({...a,[d.accessKey]:c})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:c.accessOptions.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:c.accessOptions.find(a=>a.id===d)?.description})]},a)})})]})]}),(bh||bi)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Code Editor"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This editor will be used when opening attempts and files."})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsxs)(c.Root,{children:[(0,b.jsx)(c.Trigger,{asChild:!0,children:(0,b.jsxs)("button",{type:"button",className:"inline-flex h-11 items-center gap-2 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none transition hover:bg-[var(--vk-bg-hover)] data-[state=open]:bg-[var(--vk-bg-hover)]","aria-label":"Choose code editor",children:[(0,b.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-muted)]",children:(0,b.jsx)(A.FolderOpen,{className:"h-3.5 w-3.5"})}),(0,b.jsx)("span",{className:"font-medium text-[var(--vk-text-strong)]",children:"Open"}),(0,b.jsx)(v.ChevronDown,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"})]})}),(0,b.jsx)(c.Portal,{children:(0,b.jsxs)(c.Content,{align:"start",sideOffset:6,className:bz,children:[(0,b.jsx)("p",{className:"px-3 pb-1 text-[12px] font-medium uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Open With"}),(0,b.jsxs)(c.Sub,{children:[(0,b.jsxs)(c.SubTrigger,{className:`${bB} min-w-[220px] justify-between`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,b.jsx)(ao,{editorId:by.id,label:by.label}),(0,b.jsx)("span",{children:"IDE"})]}),(0,b.jsxs)("div",{className:"ml-4 flex min-w-0 items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:by.label}),(0,b.jsx)(w.ChevronsRight,{className:"h-3.5 w-3.5 shrink-0 text-[var(--vk-text-muted)]"})]})]}),(0,b.jsx)(c.Portal,{children:(0,b.jsxs)(c.SubContent,{sideOffset:8,alignOffset:-4,className:bA,children:[(0,b.jsx)("p",{className:"px-3 pb-1 text-[12px] font-medium uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Editors"}),W.map(a=>(0,b.jsxs)(c.Item,{onSelect:()=>G(a.id),className:bB,children:[(0,b.jsx)(ao,{editorId:a.id,label:a.label}),(0,b.jsx)("span",{className:"flex-1",children:a.label}),(0,b.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:F===a.id?(0,b.jsx)(u.Check,{className:"h-4 w-4 text-[var(--vk-orange)]"}):null})]},a.id))]})})]}),(0,b.jsx)(c.Separator,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,b.jsxs)(c.Item,{onSelect:()=>G("custom"),className:bB,children:[(0,b.jsx)(ao,{editorId:"custom",label:"Custom"}),(0,b.jsx)("span",{className:"flex-1",children:"Custom"}),(0,b.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:"custom"===F?(0,b.jsx)(u.Check,{className:"h-4 w-4 text-[var(--vk-orange)]"}):null})]})]})})]}),(0,b.jsxs)("div",{className:"inline-flex min-h-11 max-w-full items-center gap-2 rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2",children:[(0,b.jsx)("span",{className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:(0,b.jsx)(ao,{editorId:by.id,label:by.label})}),(0,b.jsxs)("div",{className:"min-w-0",children:[(0,b.jsx)("div",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:by.label}),(0,b.jsx)("div",{className:"truncate text-[11px] text-[var(--vk-text-muted)]",children:"Current editor"})]})]})]})]}),(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:V.map(a=>{let c=N===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>Q(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(ar,{editorId:a.id}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),c&&(0,b.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})}),"notion"!==N&&(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:R??"",readOnly:!0,onClick:()=>aO(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>aO(!0),disabled:a3,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,b.jsx)(A.FolderOpen,{className:"h-4 w-4"})}),(R??"").trim().length>0&&(0,b.jsx)("button",{type:"button",onClick:()=>Y(""),disabled:a3,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})})]}),(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[X.map(a=>{let c=ac&&af===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>{ad(!0),ag(a.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(H,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),c&&(0,b.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)}),(0,b.jsxs)("button",{type:"button",onClick:()=>ad(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!ac?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(I,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!ac&&(0,b.jsx)(u.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]}),bj&&(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Use one complete URL to open this Conductor instance from your phone or any other machine. The URL below is only shown to admin sessions because it can grant real control of the dashboard."})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:aX.title}),(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:aX.description})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void bb(),disabled:aZ,className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,b.jsx)(D.RefreshCcw,{className:`h-3.5 w-3.5${aZ?" animate-spin":""}`}),(0,b.jsx)("span",{children:"Refresh"})]})]}),aZ?(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-3 py-3 text-[13px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(B.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading remote access details..."]}):a1?(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-3 py-3 text-[12px] leading-5 text-[var(--vk-red)]",children:a1}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Remote Status"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:bt})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Security Mode"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:bs})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Local Target"}),(0,b.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:aX.localUrl??"Not resolved"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Remote URL"}),(0,b.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:aX.publicUrl??"Not resolved"})]})]}),bx?(0,b.jsxs)("div",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:bw?"Private Network Link":"Managed Remote Access"}),(0,b.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:bw?"Start a private Tailscale link inside Conductor. Only authenticated devices on your tailnet can reach this URL.":"Conductor no longer starts public share tunnels. Use a private Tailscale link here, or configure a protected Cloudflare Access URL separately."})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:()=>void bc("enable"),disabled:!bD,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-orange)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-orange)]/10 disabled:cursor-not-allowed disabled:opacity-50",children:"enable"===a_?"Enabling...":bC}),(0,b.jsx)("button",{type:"button",onClick:()=>void bc("disable"),disabled:!bE,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-50",children:"disable"===a_?"Disabling...":"Disable"})]})]}),(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:bw?aX.installed?"Tailscale is available on this machine. Conductor will publish a private HTTPS link inside your tailnet.":aX.canAutoInstall&&"brew"===aX.autoInstallMethod?"Tailscale is not installed yet. Conductor can install it automatically with Homebrew, but the machine still needs a Tailscale sign-in.":"Tailscale is not installed on this machine yet. Install and sign in once to enable the private remote link.":"Managed remote access now uses only a private Tailscale link. For an enterprise public URL, configure Cloudflare Access separately and point Conductor at that protected address."})]}):(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Enterprise Policy"}),(0,b.jsx)("p",{className:"mt-2 text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"tailscale"===aX.recommendedProvider?"Conductor is set up for a private VPN-style link. Install and sign in to Tailscale, then enable the private link from this screen.":"Conductor no longer publishes bearer-style unlock URLs. Configure verified Cloudflare Access and point `CONDUCTOR_PUBLIC_DASHBOARD_URL` at the protected external URL instead."})]}),aX.lastError&&(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-red)]",children:bw?"Private Link Error":"Tunnel Error"}),(0,b.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-red)]",children:aX.lastError})]}),aX.connectUrl?(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"private-network"===aX.mode?"Private Remote URL":"Protected Remote URL"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"private-network"===aX.mode?"Share this URL only with operators who are already authenticated to your private network.":"Share this protected URL. Recipients still need to pass the enterprise identity check before they reach Conductor."})]}),(0,b.jsx)(av,{value:aX.connectUrl,idleLabel:"Copy URL"})]}),(0,b.jsx)("code",{className:"block break-all rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-normal)]",children:aX.connectUrl})]}):(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-normal)]",children:"enterprise-only"===aX.mode?"tailscale"===aX.recommendedProvider?aX.connected?"A private VPN URL will appear here after you enable the private link.":"A private VPN URL will appear here after Tailscale is installed and signed in.":"A protected enterprise remote URL will appear here after verified Cloudflare Access is configured.":"A protected remote URL is not available yet."})}),aX.warnings.length>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-red)]",children:"Security Warnings"}),(0,b.jsx)("div",{className:"space-y-1.5",children:aX.warnings.map(a=>(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-red)]",children:a},a))})]}),aX.nextSteps.length>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Next Steps"}),(0,b.jsx)("div",{className:"space-y-1.5",children:aX.nextSteps.map(a=>(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:a},a))})]})]})]})]})]}):bn?(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("section",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:bg?"Repository Defaults":"Repository Configuration"}),(0,b.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:bg?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===e||al.length>1)&&(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,b.jsxs)("select",{value:az,onChange:a=>aA(a.target.value),disabled:an||0===al.length||a3,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===al.length&&(0,b.jsx)("option",{value:"",children:"No repositories configured"}),al.map(a=>(0,b.jsx)("option",{value:a.id,children:a.displayName},a.id))]})]}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),an&&(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),bg&&1===al.length&&aB&&(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,b.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[aB.displayName,(0,b.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:aB.path})]})]}),aB&&(0,b.jsxs)(b.Fragment,{children:["settings"===e&&(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",aB.workspaceMode]}),(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",aB.runtimeMode]}),(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",aB.scmMode]})]}),(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,b.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:bL})}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,b.jsx)(av,{value:bL,idleLabel:"Copy Setup Command"})]})]}),(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,b.jsx)("input",{value:aB.displayName,onChange:a=>aC(b=>b?{...b,displayName:a.target.value}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,b.jsx)("input",{value:aB.repo,onChange:a=>aC(b=>b?{...b,repo:a.target.value}:b),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,b.jsx)("select",{value:aB.agent,onChange:a=>{let b=a.target.value;aC(a=>a?{...a,agent:b}:a),aE(ah(b,Z,l,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:bF.map(a=>(0,b.jsx)("option",{value:a,children:P(a)},a))}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,n.supportsAgentModelSelection)(aB.agent)&&(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,b.jsx)(as,{agent:aB.agent,modelAccess:Z,runtimeModelCatalogs:l,selection:aD,onChange:aE})}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,b.jsxs)("select",{value:aB.agentPermissions,onChange:a=>aC(b=>b?{...b,agentPermissions:"default"===a.target.value?"default":"skip"}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,b.jsx)("option",{value:"skip",children:"Auto approve and allow local dev servers"}),(0,b.jsx)("option",{value:"default",children:"Sandboxed default mode"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository across all agents unless you override the launch mode."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:aB.path,readOnly:!0,onClick:()=>aM(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>aM(!0),disabled:a3,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,b.jsx)(A.FolderOpen,{className:"h-4 w-4"})})]}),!aB.pathHealth.exists&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),aB.pathHealth.exists&&!aB.pathHealth.isGitRepository&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),aB.pathHealth.suggestedPath&&(0,b.jsx)("button",{type:"button",onClick:()=>{let a=aB.pathHealth.suggestedPath??"";a&&(aC(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),a7(a))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,b.jsx)("input",{value:aB.defaultWorkingDirectory,onChange:a=>aC(b=>b?{...b,defaultWorkingDirectory:a.target.value}:b),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:aB.defaultBranch,onChange:a=>aC(b=>b?{...b,defaultBranch:a.target.value}:b),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{a7()},disabled:aH,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:aH?(0,b.jsx)(B.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(D.RefreshCcw,{className:"h-3.5 w-3.5"})})]}),aF.length>0&&(0,b.jsx)("select",{value:aB.defaultBranch,onChange:a=>aC(b=>b?{...b,defaultBranch:a.target.value}:b),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:aF.map(a=>(0,b.jsx)("option",{value:a,children:a},a))}),aJ&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:aJ})]})]}),"settings"===e&&(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,b.jsx)("textarea",{rows:3,value:aB.devServerScript,onChange:a=>aC(b=>b?{...b,devServerScript:a.target.value}:b),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,b.jsx)("input",{value:aB.devServerCwd,onChange:a=>aC(b=>b?{...b,devServerCwd:a.target.value}:b),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,b.jsx)("input",{value:aB.devServerUrl,onChange:a=>aC(b=>b?{...b,devServerUrl:a.target.value}:b),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,b.jsx)("input",{value:aB.devServerPort,onChange:a=>aC(b=>b?{...b,devServerPort:a.target.value}:b),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,b.jsx)("input",{value:aB.devServerHost,onChange:a=>aC(b=>b?{...b,devServerHost:a.target.value}:b),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,b.jsx)("input",{value:aB.devServerPath,onChange:a=>aC(b=>b?{...b,devServerPath:a.target.value}:b),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aB.devServerHttps,onChange:a=>aC(b=>b?{...b,devServerHttps:a.target.checked}:b),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Use HTTPS"})]})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,b.jsx)("textarea",{rows:4,value:aB.setupScript,onChange:a=>aC(b=>b?{...b,setupScript:a.target.value}:b),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aB.runSetupInParallel,onChange:a=>aC(b=>b?{...b,runSetupInParallel:a.target.checked}:b),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,b.jsx)("textarea",{rows:4,value:aB.cleanupScript,onChange:a=>aC(b=>b?{...b,cleanupScript:a.target.value}:b),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,b.jsx)("textarea",{rows:4,value:aB.archiveScript,onChange:a=>aC(b=>b?{...b,archiveScript:a.target.value}:b),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,b.jsx)("input",{value:aB.copyFiles,onChange:a=>aC(b=>b?{...b,copyFiles:a.target.value}:b),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):bo?(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Security-First Remote Access"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost. For phone and team access, put a verified edge identity layer like Cloudflare Access in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),aR?(0,b.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(B.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aP.current.email??"Anonymous local session"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aP.current.role??"No access"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aP.current.provider??"Local only"})]})]}),!br&&(0,b.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aP.requireAuth,onChange:a=>aQ(b=>({...b,requireAuth:a.target.checked})),disabled:!br||aT||aP.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,b.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Public share-link remote control has been removed. Remote access now requires either the private Tailscale link or an identity-bound provider such as Cloudflare Access or Clerk."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,b.jsxs)("select",{value:aP.defaultRole,onChange:a=>aQ(b=>({...b,defaultRole:a.target.value})),disabled:!br||aT,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,b.jsx)("option",{value:"viewer",children:"Viewer"}),(0,b.jsx)("option",{value:"operator",children:"Operator"}),(0,b.jsx)("option",{value:"admin",children:"Admin"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aP.trustedHeaders.enabled,onChange:a=>aQ(b=>({...b,requireAuth:!!a.target.checked||b.requireAuth,trustedHeaders:{...b.trustedHeaders,enabled:a.target.checked}})),disabled:!br||aT,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,b.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,b.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,b.jsx)("input",{value:aP.trustedHeaders.emailHeader,onChange:a=>aQ(b=>({...b,trustedHeaders:{...b.trustedHeaders,emailHeader:a.target.value}})),disabled:!br||aT,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,b.jsx)("input",{value:aP.trustedHeaders.jwtHeader,onChange:a=>aQ(b=>({...b,trustedHeaders:{...b.trustedHeaders,jwtHeader:a.target.value}})),disabled:!br||aT,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,b.jsx)("input",{value:aP.trustedHeaders.teamDomain,onChange:a=>aQ(b=>({...b,trustedHeaders:{...b.trustedHeaders,teamDomain:a.target.value}})),disabled:!br||aT,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block lg:col-span-2",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,b.jsx)("input",{value:aP.trustedHeaders.audience,onChange:a=>aQ(b=>({...b,trustedHeaders:{...b.trustedHeaders,audience:a.target.value}})),disabled:!br||aT,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,b.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Enterprise remote access requires a Cloudflare Access application that injects a verified JWT and email header. Conductor will not publish a shareable admin URL when that verification layer is missing."})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,b.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:a,key:c,placeholder:d})=>(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:a}),(0,b.jsx)("textarea",{rows:4,value:aP.roles[c],onChange:a=>aQ(b=>({...b,roles:{...b.roles,[c]:a.target.value}})),disabled:!br||aT,placeholder:d,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},c))})]})]})]}):(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:bf.label}),(0,b.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, Remote Access, and repository settings are available now."}),(0,b.jsx)("button",{type:"button",onClick:()=>z("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,b.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[bK&&(0,b.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:bK}),!bK&&bl&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:bg?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!bK&&bn&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:bg?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!bK&&bo&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."})]}),(0,b.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!bg&&(0,b.jsx)("button",{type:"button",onClick:q,disabled:a3,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),bg&&bn&&(0,b.jsx)("button",{type:"button",onClick:()=>z("preferences"),disabled:a3,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),bl&&!bg&&(0,b.jsx)("button",{type:"button",onClick:()=>{bM(h.onboardingAcknowledged,{closeDialog:!0})},disabled:!bH||f,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),bn&&!bg&&(0,b.jsx)("button",{type:"button",onClick:()=>{a8()},disabled:!bI||at||an,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:at?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),bo&&!bg&&(0,b.jsx)("button",{type:"button",onClick:()=>{ba()},disabled:!bJ||aT,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:aT?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),bg&&(0,b.jsx)("button",{type:"button",onClick:()=>{bh?bN():bO()},disabled:bh?!bH||f||an:!bI||a3,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:a3||bh&&an?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),bh&&an?"Loading...":"Saving..."]}):bh&&bq?"Continue":"Finish Setup"})]})]})]})]})}),(0,b.jsx)(au,{open:aL,initialPath:aB?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>aM(!1),onSelect:a=>{aM(!1),a&&(aC(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),a7(a))}}),(0,b.jsx)(au,{open:aN,initialPath:R??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>aO(!1),onSelect:a=>{aO(!1),null!==a&&Y(a)}})]})}a.s(["NewWorkspaceDialog",()=>at,"SettingsDialog",()=>aw],15624)},57280,a=>{a.n(a.i(15624))}];
1
+ module.exports=[15624,a=>{"use strict";var b=a.i(87924),c=a.i(72131);function d(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function e(){return(e=Object.assign.bind()).apply(this,arguments)}var f=["aria-label","aria-labelledby","tabIndex","className","fill","size","verticalAlign","id","title","style"],g={small:16,medium:32,large:64};function h(a,b,h){var i=h(),j=Object.keys(i),k=c.default.forwardRef(function(a,h){var k,l,m=a["aria-label"],n=a["aria-labelledby"],o=a.tabIndex,p=a.className,q=a.fill,r=a.size,s=void 0===r?16:r,t=a.verticalAlign,u=a.id,v=a.title,w=a.style,x=function(a,b){if(null==a)return{};var c,d,e=function(a,b){if(null==a)return{};var c,d,e={},f=Object.keys(a);for(d=0;d<f.length;d++)c=f[d],b.indexOf(c)>=0||(e[c]=a[c]);return e}(a,b);if(Object.getOwnPropertySymbols){var f=Object.getOwnPropertySymbols(a);for(d=0;d<f.length;d++)c=f[d],!(b.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}return e}(a,f),y=g[s]||s,z=(k=j,l=y,k.map(function(a){return parseInt(a,10)}).reduce(function(a,b){return b<=l?b:a},k[0])),A=i[z].width,B=A/z*y,C=i[z].path,D=m||n;return c.default.createElement("svg",e({ref:h},x,{"aria-hidden":D?void 0:"true",tabIndex:o,focusable:o>=0?"true":"false","aria-label":m,"aria-labelledby":n,className:"".concat(b," ").concat(void 0===p?"":p).trim(),role:D?"img":void 0,viewBox:"0 0 ".concat(A," ").concat(z),width:B,height:y,fill:void 0===q?"currentColor":q,id:u,display:"inline-block",overflow:"visible",style:function(a){for(var b=1;b<arguments.length;b++){var c=null!=arguments[b]?arguments[b]:{};b%2?d(Object(c),!0).forEach(function(b){var d,e,f;d=a,e=b,f=c[b],e in d?Object.defineProperty(d,e,{value:f,enumerable:!0,configurable:!0,writable:!0}):d[e]=f}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(c)):d(Object(c)).forEach(function(b){Object.defineProperty(a,b,Object.getOwnPropertyDescriptor(c,b))})}return a}({verticalAlign:void 0===t?"text-bottom":t},w)}),v?c.default.createElement("title",null,v):null,C)});return k.displayName=a,k}var i=h("GitBranchIcon","octicon octicon-git-branch",function(){return{16:{width:16,path:c.default.createElement("path",{d:"M9.5 3.25a2.25 2.25 0 1 1 3 2.122V6A2.5 2.5 0 0 1 10 8.5H6a1 1 0 0 0-1 1v1.128a2.251 2.251 0 1 1-1.5 0V5.372a2.25 2.25 0 1 1 1.5 0v1.836A2.493 2.493 0 0 1 6 7h4a1 1 0 0 0 1-1v-.628A2.25 2.25 0 0 1 9.5 3.25Zm-6 0a.75.75 0 1 0 1.5 0 .75.75 0 0 0-1.5 0Zm8.25-.75a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5ZM4.25 12a.75.75 0 1 0 0 1.5.75.75 0 0 0 0-1.5Z"})},24:{width:24,path:c.default.createElement(c.default.Fragment,null,c.default.createElement("path",{d:"M15 4.75a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM2.5 19.25a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0Zm0-14.5a3.25 3.25 0 1 1 6.5 0 3.25 3.25 0 0 1-6.5 0ZM5.75 6.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 6.5Zm0 14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 5.75 21Zm12.5-14.5a1.75 1.75 0 1 0-.001-3.501A1.75 1.75 0 0 0 18.25 6.5Z"}),c.default.createElement("path",{d:"M5.75 16.75A.75.75 0 0 1 5 16V8a.75.75 0 0 1 1.5 0v8a.75.75 0 0 1-.75.75Z"}),c.default.createElement("path",{d:"M17.5 8.75v-1H19v1a3.75 3.75 0 0 1-3.75 3.75h-7a1.75 1.75 0 0 0-1.75 1.75H5A3.25 3.25 0 0 1 8.25 11h7a2.25 2.25 0 0 0 2.25-2.25Z"}))}}}),j=h("LockIcon","octicon octicon-lock",function(){return{16:{width:16,path:c.default.createElement("path",{d:"M4 4a4 4 0 0 1 8 0v2h.25c.966 0 1.75.784 1.75 1.75v5.5A1.75 1.75 0 0 1 12.25 15h-8.5A1.75 1.75 0 0 1 2 13.25v-5.5C2 6.784 2.784 6 3.75 6H4Zm8.25 3.5h-8.5a.25.25 0 0 0-.25.25v5.5c0 .138.112.25.25.25h8.5a.25.25 0 0 0 .25-.25v-5.5a.25.25 0 0 0-.25-.25ZM10.5 6V4a2.5 2.5 0 1 0-5 0v2Z"})},24:{width:24,path:c.default.createElement("path",{d:"M6 9V7.25C6 3.845 8.503 1 12 1s6 2.845 6 6.25V9h.5a2.5 2.5 0 0 1 2.5 2.5v8a2.5 2.5 0 0 1-2.5 2.5h-13A2.5 2.5 0 0 1 3 19.5v-8A2.5 2.5 0 0 1 5.5 9Zm-1.5 2.5v8a1 1 0 0 0 1 1h13a1 1 0 0 0 1-1v-8a1 1 0 0 0-1-1h-13a1 1 0 0 0-1 1Zm3-4.25V9h9V7.25c0-2.67-1.922-4.75-4.5-4.75-2.578 0-4.5 2.08-4.5 4.75Z"})}}}),k=h("MarkGithubIcon","octicon octicon-mark-github",function(){return{16:{width:16,path:c.default.createElement("path",{d:"M6.766 11.695C4.703 11.437 3.25 9.904 3.25 7.92c0-.806.281-1.677.75-2.258-.203-.532-.172-1.662.062-2.129.626-.081 1.469.258 1.969.726.594-.194 1.219-.291 1.985-.291.765 0 1.39.097 1.953.274.484-.451 1.343-.79 1.969-.709.218.435.25 1.564.046 2.113.5.613.766 1.436.766 2.274 0 1.984-1.453 3.485-3.547 3.759.531.355.891 1.129.891 2.016v1.678c0 .484.39.758.859.564C13.781 14.824 16 11.905 16 8.291 16 3.726 12.406 0 7.984 0 3.562 0 0 3.726 0 8.291c0 3.581 2.203 6.55 5.172 7.663A.595.595 0 0 0 6 15.389v-1.291c-.219.097-.5.162-.75.162-1.031 0-1.641-.581-2.078-1.662-.172-.435-.36-.693-.719-.742-.187-.016-.25-.097-.25-.193 0-.194.313-.339.625-.339.453 0 .844.29 1.25.887.313.468.641.678 1.031.678.391 0 .641-.146 1-.516.266-.275.469-.517.657-.678Z"})},24:{width:24,path:c.default.createElement("path",{d:"M10.303 16.652c-2.837-.344-4.835-2.385-4.835-5.028 0-1.074.387-2.235 1.031-3.008-.279-.709-.236-2.214.086-2.837.86-.107 2.02.344 2.708.967.816-.258 1.676-.386 2.728-.386 1.053 0 1.913.128 2.686.365.666-.602 1.848-1.053 2.708-.946.3.581.344 2.085.064 2.815.688.817 1.053 1.913 1.053 3.03 0 2.643-1.998 4.641-4.877 5.006.73.473 1.224 1.504 1.224 2.686v2.235c0 .644.537 1.01 1.182.752 3.889-1.483 6.94-5.372 6.94-10.185 0-6.081-4.942-11.044-11.022-11.044-6.081 0-10.98 4.963-10.98 11.044a10.84 10.84 0 0 0 7.112 10.206c.58.215 1.139-.172 1.139-.752v-1.719a2.768 2.768 0 0 1-1.032.215c-1.418 0-2.256-.773-2.857-2.213-.237-.58-.495-.924-.989-.988-.258-.022-.344-.129-.344-.258 0-.258.43-.451.86-.451.623 0 1.16.386 1.719 1.181.43.623.881.903 1.418.903.537 0 .881-.194 1.375-.688.365-.365.645-.687.903-.902Z"})}}}),l=h("RepoIcon","octicon octicon-repo",function(){return{16:{width:16,path:c.default.createElement("path",{d:"M2 2.5A2.5 2.5 0 0 1 4.5 0h8.75a.75.75 0 0 1 .75.75v12.5a.75.75 0 0 1-.75.75h-2.5a.75.75 0 0 1 0-1.5h1.75v-2h-8a1 1 0 0 0-.714 1.7.75.75 0 1 1-1.072 1.05A2.495 2.495 0 0 1 2 11.5Zm10.5-1h-8a1 1 0 0 0-1 1v6.708A2.486 2.486 0 0 1 4.5 9h8ZM5 12.25a.25.25 0 0 1 .25-.25h3.5a.25.25 0 0 1 .25.25v3.25a.25.25 0 0 1-.4.2l-1.45-1.087a.249.249 0 0 0-.3 0L5.4 15.7a.25.25 0 0 1-.4-.2Z"})},24:{width:24,path:c.default.createElement(c.default.Fragment,null,c.default.createElement("path",{d:"M3 2.75A2.75 2.75 0 0 1 5.75 0h14.5a.75.75 0 0 1 .75.75v20.5a.75.75 0 0 1-.75.75h-6a.75.75 0 0 1 0-1.5h5.25v-4H6A1.5 1.5 0 0 0 4.5 18v.75c0 .716.43 1.334 1.05 1.605a.75.75 0 0 1-.6 1.374A3.251 3.251 0 0 1 3 18.75ZM19.5 1.5H5.75c-.69 0-1.25.56-1.25 1.25v12.651A2.989 2.989 0 0 1 6 15h13.5Z"}),c.default.createElement("path",{d:"M7 18.25a.25.25 0 0 1 .25-.25h5a.25.25 0 0 1 .25.25v5.01a.25.25 0 0 1-.397.201l-2.206-1.604a.25.25 0 0 0-.294 0L7.397 23.46a.25.25 0 0 1-.397-.2v-5.01Z"}))}}}),m=a.i(67299),n=a.i(13846),o=a.i(76172),p=a.i(70106);let q=(0,p.default)("book-text",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H19a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"k3hazp"}],["path",{d:"M8 11h8",key:"vwpz6n"}],["path",{d:"M8 7h6",key:"1f0q6e"}]]);var r=a.i(82434),s=a.i(67900),t=a.i(33441),u=a.i(5784),v=a.i(5151),w=a.i(34531),x=a.i(63416),y=a.i(96101),z=a.i(96221),A=a.i(39920),B=a.i(28790),C=a.i(87532),D=a.i(65385),E=a.i(72162);let F=(0,p.default)("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),G=(0,p.default)("volume-x",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);var H=a.i(33508),I=a.i(53603),J=a.i(57941),K=a.i(52806),L=a.i(30775);a.i(87837);var M=a.i(87315);let N="claude-code";function O(a){let b=(0,J.getKnownAgent)(a);return b?.label?b.label:a.split(/[-_\s]+/g).filter(Boolean).map(a=>a[0]?.toUpperCase()+a.slice(1)).join(" ")}function P(a){return a.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function Q(a){if(!a)return null;let b=Date.parse(a);return Number.isNaN(b)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(b))}`}let R=[{id:"general",label:"General",icon:D.Settings2,implemented:!0},{id:"remote_access",label:"Remote Access",icon:E.SlidersHorizontal,implemented:!0},{id:"repositories",label:"Repositories",icon:w.FolderGit2,implemented:!0},{id:"organization",label:"Organization Settings",icon:s.Building2,implemented:!0},{id:"projects",label:"Projects",icon:x.FolderKanban,implemented:!1},{id:"agents",label:"Agents",icon:r.Bot,implemented:!0},{id:"mcp",label:"MCP Servers",icon:A.PlugZap,implemented:!1},{id:"preferences",label:"Preferences",icon:E.SlidersHorizontal,implemented:!1}],S=[{id:"preferences",label:"Preferences",icon:E.SlidersHorizontal,implemented:!0},{id:"repositories",label:"Repository",icon:w.FolderGit2,implemented:!0}],T=[{id:"obsidian",label:"Obsidian"},{id:"vscode",label:"VS Code"},{id:"notion",label:"Notion"},{id:"typora",label:"Typora"},{id:"logseq",label:"Logseq"},{id:"custom",label:"Custom"}],U=[{id:"abstract-sound-1",label:"Abstract Sound 1"},{id:"abstract-sound-2",label:"Abstract Sound 2"},{id:"abstract-sound-3",label:"Abstract Sound 3"},{id:"abstract-sound-4",label:"Abstract Sound 4"},{id:"cow-mooing",label:"Cow Mooing"},{id:"phone-vibration",label:"Phone Vibration"},{id:"rooster",label:"Rooster"}];function V(a){return!a||"object"!=typeof a||Array.isArray(a)?{}:{...a}}function W(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean).join("\n"):"string"!=typeof a?"":a.split(/[\n,]+/g).map(a=>a.trim()).filter(Boolean).join("\n")}function X(a){return Array.isArray(a)?a.filter(a=>"string"==typeof a).map(a=>a.trim()).filter(Boolean):[]}function Y(a,b){let c=V(a),d=V(c.trustedHeaders),e=V(c.roles),f=V(b),g=c.defaultRole,h=f.role;return{requireAuth:!0===c.requireAuth||!0===d.enabled,defaultRole:"viewer"===g||"admin"===g||"operator"===g?g:"operator",trustedHeaders:{enabled:!0===d.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof d.emailHeader&&d.emailHeader.trim().length>0?d.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof d.jwtHeader&&d.jwtHeader.trim().length>0?d.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof d.teamDomain&&d.teamDomain.trim().length>0?d.teamDomain.trim():"",audience:"string"==typeof d.audience&&d.audience.trim().length>0?d.audience.trim():""},roles:{viewers:W(e.viewers),operators:W(e.operators),admins:W(e.admins),viewerDomains:W(e.viewerDomains),operatorDomains:W(e.operatorDomains),adminDomains:W(e.adminDomains)},current:{authenticated:!0===f.authenticated,role:"viewer"===h||"operator"===h||"admin"===h?h:null,email:"string"==typeof f.email&&f.email.trim().length>0?f.email.trim():null,provider:"string"==typeof f.provider&&f.provider.trim().length>0?f.provider.trim():null}}}function Z(a){let b=V(a),c=b.mode,d=b.status,e=b.provider,f=b.autoInstallMethod;return{publicUrl:"string"==typeof b.publicUrl&&b.publicUrl.trim().length>0?b.publicUrl.trim():null,connectUrl:"string"==typeof b.connectUrl&&b.connectUrl.trim().length>0?b.connectUrl.trim():null,shareable:!0===b.shareable,status:"starting"===d||"ready"===d||"error"===d||"disabled"===d?d:"disabled",provider:"tailscale"===e?e:null,recommendedProvider:"tailscale"===b.recommendedProvider?b.recommendedProvider:null,localUrl:"string"==typeof b.localUrl&&b.localUrl.trim().length>0?b.localUrl.trim():null,managed:!0===b.managed,installed:!0===b.installed,connected:!0===b.connected,canAutoInstall:!0===b.canAutoInstall,autoInstallMethod:"brew"===f?"brew":null,lastError:"string"==typeof b.lastError&&b.lastError.trim().length>0?b.lastError.trim():null,startedAt:"string"==typeof b.startedAt&&b.startedAt.trim().length>0?b.startedAt.trim():null,updatedAt:"string"==typeof b.updatedAt&&b.updatedAt.trim().length>0?b.updatedAt.trim():null,mode:"cloudflare-access"===c||"private-network"===c||"enterprise-only"===c||"generic-header"===c||"clerk"===c||"local-only"===c||"misconfigured"===c||"unsafe-public"===c?c:"local-only",title:"string"==typeof b.title&&b.title.trim().length>0?b.title.trim():"Remote access",description:"string"==typeof b.description&&b.description.trim().length>0?b.description.trim():"",warnings:X(b.warnings),nextSteps:X(b.nextSteps)}}function $(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function _(a,b){return b[(0,I.normalizeAgentName)(a)]??null}function aa(a){if(!a)return[];let b=[],c=new Set;for(let d of Object.values(a.modelsByAccess))if(Array.isArray(d))for(let a of d)!a?.id||c.has(a.id)||(c.add(a.id),b.push(a));return b}function ab(a,b,c){let d=_(a,c),e=(0,m.resolveAgentModelAccess)(a,b),f=(0,M.getRuntimeCatalogModelsForAccess)(d,e),g=(0,m.getAvailableAgentModels)(a,b),h=[],i=new Set;for(let a of[...f,...g,...aa(d)])!a?.id||i.has(a.id)||(i.add(a.id),h.push(a));return h}function ac(a,b,c,d){let e=_(a,c),f=(0,m.resolveAgentModelAccess)(a,b),g=(0,M.getRuntimeCatalogReasoningOptions)(e,d,f),h=(0,m.getAvailableAgentReasoningEfforts)(a,b),i=[],j=new Set;for(let a of[...g,...h])!a?.id||j.has(a.id)||(j.add(a.id),i.push(a));return i}function ad(a,b,c,d){let e=_(a,c),f=(0,m.resolveAgentModelAccess)(a,b);return(0,M.getRuntimeCatalogDefaultReasoning)(e,d,f)??(0,m.getDefaultAgentReasoningEffort)(a,b)??""}function ae(a,b,c,d,e){let f,g,h=d?.trim()??"",i=e?.trim().toLowerCase()??"",j=ab(a,b,c),k=(f=_(a,c),g=(0,m.resolveAgentModelAccess)(a,b),(0,M.getRuntimeCatalogDefaultModelForAccess)(f,g)??(0,m.getDefaultAgentModel)(a,b)??aa(f)[0]?.id??""),l=d=>{let e=ac(a,b,c,d);return i.length>0&&e.some(a=>a.id===i)?i:ad(a,b,c,d)};return h.length>0?j.some(a=>a.id===h)?{catalogModel:h,customModel:"",reasoningEffort:l(h)}:{catalogModel:k,customModel:h,reasoningEffort:l(h)}:{catalogModel:k,customModel:"",reasoningEffort:l(k)}}function af(a){let b=a.customModel.trim();if(b.length>0)return b;let c=a.catalogModel.trim();return c.length>0?c:void 0}function ag(a){let b=a.reasoningEffort.trim().toLowerCase();return b.length>0?b:void 0}function ah(a,b){let c=(0,m.getAgentModelCatalog)(a);if(!c||c.accessOptions.length<=1)return null;let d=(0,m.resolveAgentModelAccess)(a,b);return d?c.accessOptions.find(a=>a.id===d)?.label??null:null}let ai="block h-4 w-4 shrink-0";function aj(a){return JSON.stringify(a)}let ak={obsidian:{kind:"icon",icon:n.SiObsidian,className:`${ai} text-[#8b5cf6]`},vscode:{kind:"icon",icon:o.VscVscode,className:`${ai} text-[#22a3f5]`},notion:{kind:"icon",icon:n.SiNotion,className:`${ai} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ai} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ai} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:D.Settings2,className:`${ai} text-[var(--vk-text-muted)]`}};function al({editorId:a}){let c=ak[a];if(!c)return(0,b.jsx)(q,{className:`${ai} text-[var(--vk-text-muted)]`});if("image"===c.kind)return(0,b.jsx)("img",{src:c.imageSrc,alt:"",className:c.className});let d=c.icon;return(0,b.jsx)(d,{className:c.className})}function am({agent:a,modelAccess:c,runtimeModelCatalogs:d,selection:e,onChange:f,compact:g=!1}){if(!(0,m.supportsAgentModelSelection)(a))return null;let h=(0,m.getAgentModelCatalog)(a),i=ab(a,c,d),j=ac(a,c,d,af(e)??e.catalogModel),k=ah(a,c);return h?(0,b.jsxs)("div",{className:g?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,b.jsxs)("select",{value:e.catalogModel,disabled:0===i.length,onChange:b=>{let g=b.target.value,h=ac(a,c,d,g);f({...e,catalogModel:g,reasoningEffort:h.some(a=>a.id===e.reasoningEffort)?e.reasoningEffort:ad(a,c,d,g)})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===i.length&&(0,b.jsx)("option",{value:"",children:"No runtime models detected"}),i.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))]}),(0,b.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[k?`Filtered for ${k}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),j.length>0&&(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,b.jsx)("select",{value:e.reasoningEffort,onChange:a=>{f({...e,reasoningEffort:a.target.value})},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:j.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Choose how much deliberate reasoning the CLI should use before it acts."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,b.jsx)("input",{value:e.customModel,onChange:b=>{let g=b.target.value,h=g.trim()||e.catalogModel,i=ac(a,c,d,h);f({...e,customModel:g,reasoningEffort:i.some(a=>a.id===e.reasoningEffort)?e.reasoningEffort:ad(a,c,d,h)})},placeholder:function(a,b){let c=_(a,b);if(c?.customModelPlaceholder.trim())return c.customModelPlaceholder;let d=(0,m.getAgentModelCatalog)(a)?.label??"agent";return`Enter exact ${d} model id`}(a,d),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"Optional. Use this to force an exact model id from the installed CLI when you want to override the detected list."})]})]}):null}function an({open:a,onClose:d,onCreate:e,creating:f,error:g,defaultAgent:h,agentOptions:m}){let[n,o]=(0,c.useState)("git"),[p,q]=(0,c.useState)(""),[r,s]=(0,c.useState)(!1),[v,w]=(0,c.useState)(""),[x,A]=(0,c.useState)(""),[C,D]=(0,c.useState)("main"),[E,F]=(0,c.useState)(h),[G,K]=(0,c.useState)(!1),[L,M]=(0,c.useState)(!0),[R,S]=(0,c.useState)([]),[T,U]=(0,c.useState)(!1),[V,W]=(0,c.useState)(!1),[X,Y]=(0,c.useState)(null),[Z,$]=(0,c.useState)(""),[_,aa]=(0,c.useState)(""),[ab,ac]=(0,c.useState)(!1),[ad,ae]=(0,c.useState)("local"),[af,ag]=(0,c.useState)([]),[ah,ai]=(0,c.useState)(!1),[aj,ak]=(0,c.useState)(null);(0,c.useEffect)(()=>{a&&(o("git"),q(""),s(!1),w(""),A(""),D("main"),M(!0),K(!1),F(h),S([]),W(!1),Y(null),$(""),aa(""),ag([]),ak(null),ai(!1),ac(!1),ae("local"))},[h,a]),(0,c.useEffect)(()=>{!a||"local"!==n||x.trim().length>0||(ae("local"),ac(!0))},[n,a,x]);let al=(0,c.useMemo)(()=>{let a=Z.trim().toLowerCase(),b=0===a.length?R:R.filter(b=>b.fullName.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)||(b.ownerLogin??"").toLowerCase().includes(a)||(b.description??"").toLowerCase().includes(a)||b.defaultBranch.toLowerCase().includes(a));return 0===a.length?b.slice(0,10):b.slice(0,14)},[Z,R]),am=(0,c.useMemo)(()=>{let a=R.find(a=>a.httpsUrl===_);return a||(v.trim()?R.find(a=>a.httpsUrl===v.trim())??null:null)},[v,R,_]),an=(0,c.useMemo)(()=>(function(a){let b=a.trim();if(!b)return null;let c=b.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(c)return`https://github.com/${c[1]}/${c[2]}.git`;let d=b.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return d?`https://github.com/${d[1]}/${d[2]}.git`:null})(Z),[Z]),ap=(0,c.useMemo)(()=>{let a;return(a=Z.trim())&&/^(https?:\/\/|git@)/i.test(a)?a:null},[Z]),aq=(0,c.useMemo)(()=>Q(am?.updatedAt),[am]),ar=(0,c.useMemo)(()=>{let a=an??ap;return!!a&&a.toLowerCase()!==v.trim().toLowerCase()},[v,an,ap]),as=(0,c.useMemo)(()=>{let a=[...new Set(m)];0===a.length&&a.push(h||N);let b=new Map(J.KNOWN_AGENT_ORDER.map((a,b)=>[a,b]));return a.sort((a,c)=>{let d=b.get((0,I.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,I.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:O(a).localeCompare(O(c))})},[m,h]);(0,c.useEffect)(()=>{as.includes(E)||F(as[0]??N)},[E,as]);let at=async(a=!1)=>{U(!0),Y(null);try{let b=await fetch(`/api/github/repos${a?"?refresh=true":""}`),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load GitHub repositories (${b.status})`);S(Array.isArray(c?.repos)?c.repos:[])}catch(a){S([]),Y(a instanceof Error?a.message:"Failed to load GitHub repositories")}finally{W(!0),U(!1)}};(0,c.useEffect)(()=>{!a||"git"!==n||T||V||at()},[V,T,n,a]);let au=async a=>{let b=a?.gitUrl??("git"===n?v.trim():""),c=a?.path??("local"===n?x.trim():"");if(0===b.length&&0===c.length)return void ak("git"===n?"Choose or paste a repository first.":"Select a local repository path first.");ai(!0),ak(null);try{let a=new URLSearchParams;b.length>0&&a.set("gitUrl",b),c.length>0&&a.set("path",c);let d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to load branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];ag(f);let g="string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??null;g&&(0===C.trim().length||!f.includes(C))&&D(g)}catch(a){ag([]),ak(a instanceof Error?a.message:"Failed to load branches")}finally{ai(!1)}},av=async a=>{aa(a);let b=R.find(b=>b.httpsUrl===a);b&&(w(b.httpsUrl),$(b.fullName),D(b.defaultBranch||"main"),r||q(P(b.name)||p),await au({gitUrl:b.httpsUrl}))},aw=async()=>{let a=an??ap;if(!a)return;let b=R.find(b=>b.httpsUrl.toLowerCase()===a.toLowerCase())??null;if(b)return void await av(b.httpsUrl);if(aa(""),w(a),D("main"),ag([]),ak(null),!r){let b=function(a){let b=a.trim();if(!b)return null;let c=b.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(c)return c[2]??null;try{let a=new URL(b).pathname.split("/").filter(Boolean).at(-1);return a?a.replace(/\.git$/i,""):null}catch{return null}}(a);b&&q(P(b))}await au({gitUrl:a})},ax=a=>{ae(a),ac(!0)};if(!a)return null;let ay="git"===n?v.trim().length>0&&C.trim().length>0:x.trim().length>0&&C.trim().length>0;async function az(a){if(a.preventDefault(),!ay||f)return;let b="git"===n?{mode:n,projectId:p.trim()||void 0,agent:E,defaultBranch:C.trim(),useWorktree:G,gitUrl:v.trim(),path:x.trim()||void 0}:{mode:n,projectId:p.trim()||void 0,agent:E,defaultBranch:C.trim(),useWorktree:G,path:x.trim(),initializeGit:L};await e(b)}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[80] flex items-start justify-center overflow-y-auto bg-black/65 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{f||ab||d()},role:"presentation",children:(0,b.jsxs)("form",{onSubmit:az,onClick:a=>a.stopPropagation(),className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",children:[(0,b.jsxs)("header",{className:"flex items-center border-b border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,b.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Pick a GitHub repository or local folder, then confirm the branch."})]}),(0,b.jsx)("button",{type:"button",onClick:d,disabled:f,"aria-label":"Close dialog",className:"ml-auto inline-flex h-8 w-8 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:(0,b.jsx)(H.X,{className:"h-4 w-4"})})]}),(0,b.jsxs)("div",{className:"min-h-0 flex-1 space-y-4 overflow-y-auto px-4 py-4",children:[(0,b.jsxs)("div",{className:"inline-flex rounded-[4px] border border-[var(--vk-border)] p-1",children:[(0,b.jsx)("button",{type:"button",onClick:()=>o("git"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"git"===n?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"GitHub"}),(0,b.jsx)("button",{type:"button",onClick:()=>o("local"),className:`rounded-[3px] px-3 py-1.5 text-[13px] ${"local"===n?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Local Folder"})]}),"git"===n?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:[(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(k,{className:"h-[18px] w-[18px]"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"GitHub Repository"}),(0,b.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:"Search accessible repositories or paste a repository URL. Conductor fills the branch and clone URL after selection."})]}),(0,b.jsx)("button",{type:"button",onClick:()=>{W(!1),at(!0)},disabled:T,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:T?(0,b.jsx)(z.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(B.RefreshCcw,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,b.jsxs)("div",{className:"relative mt-3",children:[(0,b.jsx)(k,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,b.jsx)("input",{value:Z,onChange:a=>$(a.target.value),onKeyDown:a=>{"Enter"===a.key&&ar&&(a.preventDefault(),aw())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-10 w-full rounded-[5px] border border-[var(--vk-border)] bg-transparent pl-10 pr-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),ar?(0,b.jsxs)("button",{type:"button",onClick:()=>{aw()},className:"mt-3 inline-flex items-center gap-2 rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,b.jsx)(l,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,b.jsxs)("span",{className:"truncate",children:["Use ",an?"this GitHub repository":"pasted repository URL"]})]}):null,T&&0===R.length?(0,b.jsx)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,X?(0,b.jsxs)("div",{className:"mt-3 rounded-[5px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,b.jsx)("p",{children:X}),(0,b.jsx)("button",{type:"button",onClick:()=>{W(!1),at(!0)},className:"mt-2 inline-flex items-center rounded-[4px] border border-[var(--vk-border)] px-2 py-1 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Retry"})]}):null,!X&&al.length>0?(0,b.jsx)("div",{className:"mt-3 max-h-[260px] space-y-2 overflow-y-auto pr-1",children:al.map(a=>{let c=Q(a.updatedAt),d=am?.httpsUrl===a.httpsUrl;return(0,b.jsxs)("button",{type:"button",onClick:()=>{av(a.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[5px] border px-3 py-3 text-left transition ${d?"border-[var(--vk-orange)] bg-[var(--vk-bg-panel)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)("span",{className:"mt-0.5 inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(l,{className:"h-4 w-4"})}),(0,b.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:a.fullName}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[a.private?(0,b.jsx)(j,{className:"h-3 w-3"}):(0,b.jsx)(k,{className:"h-3 w-3"}),a.private?"Private":"Public"]}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(i,{className:"h-3 w-3"}),a.defaultBranch]})]}),a.description?(0,b.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:a.description}):null,(0,b.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[a.ownerLogin?(0,b.jsx)("span",{children:a.ownerLogin}):null,c?(0,b.jsx)("span",{children:c}):null,a.permission?(0,b.jsx)("span",{children:a.permission.toLowerCase()}):null]})]}),(0,b.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:d?(0,b.jsx)(t.Check,{className:"h-4 w-4"}):null})]},a.httpsUrl)})}):null,T||X||0!==al.length?null:(0,b.jsx)("p",{className:"mt-3 text-[12px] text-[var(--vk-text-muted)]",children:Z.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}),v.trim().length>0?(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3",children:(0,b.jsxs)("div",{className:"flex items-start gap-3",children:[(0,b.jsx)("span",{className:"inline-flex h-9 w-9 items-center justify-center rounded-[5px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,b.jsx)(l,{className:"h-[18px] w-[18px]"})}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"truncate text-[14px] font-medium text-[var(--vk-text-strong)]",children:am?.fullName??v}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[am&&am.private?(0,b.jsx)(j,{className:"h-3 w-3"}):(0,b.jsx)(k,{className:"h-3 w-3"}),am?am.private?"Private":"Public":"Manual URL"]}),(0,b.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(i,{className:"h-3 w-3"}),C||"main"]})]}),am?.description?(0,b.jsx)("p",{className:"mt-1 line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:am.description}):(0,b.jsx)("p",{className:"mt-1 truncate text-[12px] text-[var(--vk-text-muted)]",children:v}),(0,b.jsxs)("div",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[am?.ownerLogin?(0,b.jsx)("span",{children:am.ownerLogin}):null,aq?(0,b.jsx)("span",{children:aq}):null,am?.permission?(0,b.jsx)("span",{children:am.permission.toLowerCase()}):null]})]})]})}):null]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Path"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:x,readOnly:!0,onClick:()=>ax("local"),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>ax("local"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,b.jsx)(y.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:L,onChange:a=>M(a.target.checked),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Initialize git if this folder is non-git"})]})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,b.jsx)("input",{value:p,onChange:a=>{q(a.target.value),s(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("div",{className:"grid grid-cols-1 gap-3 md:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:C,onChange:a=>D(a.target.value),placeholder:"Uses the repository default branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{au()},disabled:ah,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:ah?(0,b.jsx)(z.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(B.RefreshCcw,{className:"h-3.5 w-3.5"})})]}),af.length>0&&(0,b.jsx)("select",{value:C,onChange:a=>D(a.target.value),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:af.map(a=>(0,b.jsx)("option",{value:a,children:a},a))}),aj&&(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:aj})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,b.jsx)("select",{value:E,onChange:a=>F(a.target.value),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:as.map(a=>(0,b.jsx)("option",{value:a,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:O(a)},a))})]})]}),"git"===n?(0,b.jsxs)("details",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,b.jsx)("summary",{className:"cursor-pointer list-none px-3 py-2 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,b.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,b.jsx)(u.ChevronDown,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Advanced options"]})}),(0,b.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Local Copy Location (optional)"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:x,readOnly:!0,onClick:()=>ax("clone"),placeholder:"Choose a folder only if you want a specific clone location",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>ax("clone"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,b.jsx)(y.FolderOpen,{className:"h-4 w-4"})})]})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:G,onChange:a=>K(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,b.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]})]})]}):(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:G,onChange:a=>K(a.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,b.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"Turn this off only if you want sessions to run directly in the selected branch."})]})]}),g&&(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:g})]}),(0,b.jsxs)("footer",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("button",{type:"button",onClick:d,disabled:f,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,b.jsx)("button",{type:"submit",disabled:!ay||f,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:f?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})]})}),(0,b.jsx)(ao,{open:ab,initialPath:x,title:"local"===ad?"Select Local Repository":"Select Clone Target Folder",description:"local"===ad?"Choose the local repository folder.":"Choose where the git repository should be cloned.",onClose:()=>ac(!1),onSelect:a=>{if(ac(!1),a){if(A(a),("local"===n||"local"===ad)&&!r){let b,c=(b=a.trim())?b.split(/[\\/]+/).filter(Boolean).at(-1)??null:null;c&&q(P(c))}("local"===n||"local"===ad)&&au({path:a})}}})]})}function ao({open:a,initialPath:d,title:e,description:f,onClose:g,onSelect:h}){let[i,j]=(0,c.useState)(""),[k,l]=(0,c.useState)(d??""),[m,n]=(0,c.useState)([]),[o,p]=(0,c.useState)(""),[q,r]=(0,c.useState)(!1),[s,t]=(0,c.useState)(null),[u,v]=(0,c.useState)(!1);(0,c.useEffect)(()=>{if(!a)return;p(""),l(d??"");let b=d&&d.trim().length>0?d.trim():void 0,c=b?`?path=${encodeURIComponent(b)}`:"";r(!0),t(null),fetch(`/api/filesystem/directory${c}`).then(async a=>{let b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load directory (${a.status})`);j("string"==typeof b?.currentPath?b.currentPath:""),n(Array.isArray(b?.entries)?b.entries:[])}).catch(a=>{t(a instanceof Error?a.message:"Failed to load directory"),n([])}).finally(()=>{r(!1)})},[d,a]);let w=(0,c.useMemo)(()=>{if(0===o.trim().length)return m;let a=o.trim().toLowerCase();return m.filter(b=>b.name.toLowerCase().includes(a))},[m,o]),x=async a=>{r(!0),t(null);try{let b=a&&a.trim().length>0?`?path=${encodeURIComponent(a.trim())}`:"",c=await fetch(`/api/filesystem/directory${b}`),d=await c.json().catch(()=>null);if(!c.ok)throw Error(d?.error??`Failed to load directory (${c.status})`);let e="string"==typeof d?.currentPath?d.currentPath:"";j(e),n(Array.isArray(d?.entries)?d.entries:[]),l(e)}catch(a){t(a instanceof Error?a.message:"Failed to load directory"),n([])}finally{r(!1)}},A=async()=>{v(!0);try{let a=await fetch("/api/filesystem/pick-directory",{method:"POST"}),b=await a.json().catch(()=>null);if(!b||b.cancelled||!b.path)return;l(b.path),x(b.path)}catch{}finally{v(!1)}};return a?(0,b.jsx)("div",{className:"fixed inset-0 z-[95] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center sm:py-0",onClick:()=>{g(),h(null)},role:"presentation",children:(0,b.jsxs)("div",{className:"flex max-h-[calc(100dvh-1.5rem)] w-full max-w-[760px] flex-col overflow-hidden rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)]",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:e}),(0,b.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:f})]}),(0,b.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("input",{value:k,onChange:a=>l(a.target.value),placeholder:"/path/to/repository",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{x(k)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open"})]}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:()=>{x()},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Home"}),(0,b.jsx)("button",{type:"button",onClick:()=>{if(!i)return;let a=i.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(i)||"/"===a)return;let b=a.split("/").filter(Boolean),c=i.match(/^([A-Za-z]):[/\\]/);x(c?b.length>1?`${c[1]}:/${b.slice(1,-1).join("/")}`:`${c[1]}:/`:b.length>1?`/${b.slice(0,-1).join("/")}`:"/")},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Up"}),(0,b.jsxs)("button",{type:"button",disabled:u,onClick:()=>{A()},className:"inline-flex h-8 items-center gap-1 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:[u?(0,b.jsx)(z.Loader2,{className:"h-3 w-3 animate-spin"}):(0,b.jsx)(y.FolderOpen,{className:"h-3 w-3"}),u?"Opening...":"Browse"]}),(0,b.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:i||"Home"})]}),(0,b.jsxs)("div",{className:"relative",children:[(0,b.jsx)(C.Search,{className:"pointer-events-none absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,b.jsx)("input",{value:o,onChange:a=>p(a.target.value),placeholder:"Filter folders",className:"h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent pl-7 pr-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:q?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):s?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:s}):0===w.length?(0,b.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,b.jsx)("div",{className:"p-1",children:w.map(a=>(0,b.jsxs)("button",{type:"button",onClick:()=>{a.isDirectory&&x(a.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${a.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,b.jsx)(y.FolderOpen,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{className:"truncate",children:a.name}),a.isGitRepo&&(0,b.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},a.path))})})]}),(0,b.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("button",{type:"button",onClick:()=>{g(),h(null)},className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Cancel"}),(0,b.jsx)("button",{type:"button",onClick:()=>{let a=k.trim().length>0?k.trim():i;g(),h(a||null)},className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:"Use this folder"})]})]})}):null}function ap({value:a,idleLabel:d="Copy",copiedLabel:e="Copied"}){let[f,g]=(0,c.useState)(!1);async function h(){await navigator.clipboard.writeText(a),g(!0),window.setTimeout(()=>g(!1),1400)}return(0,b.jsxs)("button",{type:"button",onClick:()=>void h(),className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[f?(0,b.jsx)(t.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,b.jsx)(v.Copy,{className:"h-3.5 w-3.5"}),(0,b.jsx)("span",{children:f?e:d})]})}function aq({open:a,mode:d,creating:e,error:f,current:g,projectCount:h,agentOptions:i,agentStates:j,runtimeModelCatalogs:k,onRepositoriesChanged:l,onOnboardingComplete:n,onOpenAgentSetup:o,onClose:p,onSave:q}){var r,s;let u,[v,w]=(0,c.useState)("preferences"),[x,A]=(0,c.useState)(g.codingAgent),[C,D]=(0,c.useState)(g.ide),[E,M]=(0,c.useState)(g.markdownEditor),[P,Q]=(0,c.useState)(g.markdownEditorPath??""),[V,W]=(0,c.useState)(g.modelAccess),[X,_]=(0,c.useState)(g.notifications.soundEnabled),[aa,ac]=(0,c.useState)(g.notifications.soundFile),[ad,ai]=(0,c.useState)([]),[ak,an]=(0,c.useState)(!1),[aq,ar]=(0,c.useState)(!1),[as,at]=(0,c.useState)(null),[au,av]=(0,c.useState)(""),[aw,ax]=(0,c.useState)(null),[ay,az]=(0,c.useState)($()),[aA,aB]=(0,c.useState)([]),[aC,aD]=(0,c.useState)(!1),[aE,aF]=(0,c.useState)(null),[aG,aH]=(0,c.useState)(!1),[aI,aJ]=(0,c.useState)(!1),[aK,aL]=(0,c.useState)(()=>Y(null)),[aM,aN]=(0,c.useState)(!1),[aO,aP]=(0,c.useState)(!1),[aQ,aR]=(0,c.useState)(null),[aS,aT]=(0,c.useState)(()=>Z(null)),[aU,aV]=(0,c.useState)(!1),[aW,aX]=(0,c.useState)(null),[aY,aZ]=(0,c.useState)(null),a$=e||aq||aO||null!==aW;function a_(a){return{...a,agentPermissions:"default"===a.agentPermissions?"default":"skip",devServerScript:a.devServerScript??"",devServerCwd:a.devServerCwd??"",devServerUrl:a.devServerUrl??"",devServerPort:a.devServerPort??"",devServerHost:a.devServerHost??"",devServerPath:a.devServerPath??"",devServerHttps:!0===a.devServerHttps,pathHealth:{exists:a.pathHealth.exists,isGitRepository:a.pathHealth.isGitRepository,suggestedPath:a.pathHealth.suggestedPath}}}function a0(a){return a.split(/\n+/g).map(a=>a.trim()).filter(Boolean)}async function a1(a){an(!0),at(null);try{let b=await fetch("/api/repositories"),c=await b.json().catch(()=>null);if(!b.ok)throw Error(c?.error??`Failed to load repositories (${b.status})`);let d=Array.isArray(c?.repositories)?c.repositories:[];ai(d);let e=d[0]?.id??"",f=a&&d.some(b=>b.id===a)?a:au&&d.some(a=>a.id===au)?au:e;av(f)}catch(a){ai([]),av(""),ax(null),az($()),at(a instanceof Error?a.message:"Failed to load repositories")}finally{an(!1)}}async function a2(a,b){let c=(a??aw?.path??"").trim();if(0===c.length){aF("Select a repository path first."),aB([]);return}aD(!0),aF(null);try{let a=new URLSearchParams({path:c}),d=await fetch(`/api/workspaces/branches?${a.toString()}`),e=await d.json().catch(()=>null);if(!d.ok)throw Error(e?.error??`Failed to detect branches (${d.status})`);let f=Array.isArray(e?.branches)?e.branches.filter(a=>"string"==typeof a&&a.trim().length>0):[];aB(f);let g=b?.trim()||("string"==typeof e?.defaultBranch&&e.defaultBranch.trim().length>0?e.defaultBranch.trim():f[0]??"");if(!g)return;ax(a=>!a||a.defaultBranch.trim().length>0&&f.includes(a.defaultBranch)?a:{...a,defaultBranch:g})}catch(a){aB([]),aF(a instanceof Error?a.message:"Failed to detect branches")}finally{aD(!1)}}async function a3(){if(!aw||aq||0===aw.repo.trim().length||0===aw.path.trim().length)return!1;ar(!0),at(null);try{let a=await fetch("/api/repositories",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:aw.id,displayName:aw.displayName,repo:aw.repo,path:aw.path,agent:aw.agent,agentPermissions:aw.agentPermissions,agentModel:af(ay)??"",agentReasoningEffort:ag(ay)??"",defaultWorkingDirectory:aw.defaultWorkingDirectory,defaultBranch:aw.defaultBranch,devServerScript:aw.devServerScript,devServerCwd:aw.devServerCwd,devServerUrl:aw.devServerUrl,devServerPort:aw.devServerPort,devServerHost:aw.devServerHost,devServerPath:aw.devServerPath,devServerHttps:aw.devServerHttps,setupScript:aw.setupScript,runSetupInParallel:aw.runSetupInParallel,cleanupScript:aw.cleanupScript,archiveScript:aw.archiveScript,copyFiles:aw.copyFiles})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save repository settings (${a.status})`);let c=b?.repository;if(!c)throw Error("Repository saved but response is missing repository data");return ai(a=>a.map(a=>a.id===c.id?c:a)),ax(a_(c)),av(c.id),aF(null),await a2(c.path,c.defaultBranch),l&&await l(),!0}catch(a){return at(a instanceof Error?a.message:"Failed to save repository settings"),!1}finally{ar(!1)}}async function a4(){aN(!0),aR(null);try{let a=await fetch("/api/access"),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to load organization settings (${a.status})`);aL(Y(b?.access,b?.current))}catch(a){aL(Y(null)),aR(a instanceof Error?a.message:"Failed to load organization settings")}finally{aN(!1)}}async function a5(){if(aO)return!1;aP(!0),aR(null);try{let a=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:aK.requireAuth||aK.trustedHeaders.enabled,defaultRole:aK.defaultRole,trustedHeaders:{enabled:aK.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:aK.trustedHeaders.emailHeader,jwtHeader:aK.trustedHeaders.jwtHeader,teamDomain:aK.trustedHeaders.teamDomain,audience:aK.trustedHeaders.audience},roles:{viewers:a0(aK.roles.viewers),operators:a0(aK.roles.operators),admins:a0(aK.roles.admins),viewerDomains:a0(aK.roles.viewerDomains),operatorDomains:a0(aK.roles.operatorDomains),adminDomains:a0(aK.roles.adminDomains)}})}),b=await a.json().catch(()=>null);if(!a.ok)throw Error(b?.error??`Failed to save organization settings (${a.status})`);return aL(Y(b?.access,b?.current)),"remote_access"===v&&await a6(),!0}catch(a){return aR(a instanceof Error?a.message:"Failed to save organization settings"),!1}finally{aP(!1)}}async function a6(){aV(!0),aZ(null);try{let a=await fetch("/api/remote-access"),b=await a.json().catch(()=>null);if(!a.ok){let c=b&&"object"==typeof b&&"reason"in b&&"string"==typeof b.reason?b.reason:null,d=b&&"object"==typeof b&&"error"in b&&"string"==typeof b.error?b.error:null;throw Error(c??d??`Failed to load remote access (${a.status})`)}aT(Z(b))}catch(a){aT(Z(null)),aZ(a instanceof Error?a.message:"Failed to load remote access")}finally{aV(!1)}}async function a7(a){aX(a),aZ(null);try{let b=await fetch("/api/remote-access",{method:"disable"===a?"DELETE":"POST",headers:"disable"===a?void 0:{"Content-Type":"application/json"},body:"disable"===a?void 0:JSON.stringify({action:a})}),c=await b.json().catch(()=>null);if(!b.ok){let d=c&&"object"==typeof c&&"reason"in c&&"string"==typeof c.reason?c.reason:null,e=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:null;throw Error(d??e??`Failed to ${a} remote access (${b.status})`)}aT(Z(c))}catch(b){aZ(b instanceof Error?b.message:`Failed to ${a} remote access`)}finally{aX(null)}}(0,c.useEffect)(()=>{a&&(w("onboarding"===d?"preferences":"general"),A(g.codingAgent),D(g.ide),M(g.markdownEditor),Q(g.markdownEditorPath??""),W(g.modelAccess),_(g.notifications.soundEnabled),ac(g.notifications.soundFile),aB([]),aF(null),at(null),az($()),aR(null),aT(Z(null)),aZ(null))},[d,a]),(0,c.useEffect)(()=>{a&&("settings"===d||"repositories"===v)&&a1()},[v,d,a]),(0,c.useEffect)(()=>{a&&"onboarding"!==d&&a4()},[d,a]),(0,c.useEffect)(()=>{a&&"onboarding"!==d&&"remote_access"===v&&a6()},[v,d,a]),(0,c.useEffect)(()=>{if(!a)return;if(!au){ax(null),az($());return}let b=ad.find(a=>a.id===au);b&&(ax(a_(b)),az(ae(b.agent,V,k,b.agentModel,b.agentReasoningEffort)),aB([]),aF(null),b.path.trim().length>0&&a2(b.path,b.defaultBranch))},[V,a,ad,k,au]);let a8="onboarding"===d&&h>0,a9=(0,c.useMemo)(()=>"onboarding"===d?a8?S:S.filter(a=>"preferences"===a.id):R.filter(a=>a.implemented),[d,a8]),ba=a9.find(a=>a.id===v)??a9[0]??R[0],bb="onboarding"===d,bc="preferences"===ba.id,bd="general"===ba.id,be="remote_access"===ba.id,bf="agents"===ba.id,bg=bc||bd||bf,bh=bg||be,bi="repositories"===ba.id,bj="organization"===ba.id,bk=a9.findIndex(a=>a.id===ba.id)+1,bl=a9.some(a=>"repositories"===a.id),bm="admin"===aK.current.role,bn=function(a){switch(a){case"cloudflare-access":return"Cloudflare Access";case"private-network":return"Private network";case"enterprise-only":return"Enterprise only";case"generic-header":return"Legacy mode blocked";case"clerk":return"Clerk";case"misconfigured":return"Auth required";case"unsafe-public":return"Blocked until protected";default:return"Local only"}}(aS.mode),bo=function(a){switch(a){case"starting":return"Starting";case"ready":return"Ready";case"error":return"Error";default:return"Disabled"}}(aS.status),bp=null!==aW,bq=aS.provider??aS.recommendedProvider,br="tailscale"===bq,bs=null!==bq||aS.managed,bt=!aS.installed&&aS.canAutoInstall?"Install + Enable":"Enable Private Link",bu=!aU&&!bp&&br&&!("ready"===aS.status&&aS.managed),bv=!aU&&!bp&&("starting"===aS.status||"ready"===aS.status||"error"===aS.status),bw=(0,c.useMemo)(()=>{let a=new Set(i);x.trim().length>0&&a.add(x),0===a.size&&a.add(N);let b=new Map(J.KNOWN_AGENT_ORDER.map((a,b)=>[a,b]));return[...a].sort((a,c)=>{let d=b.get((0,I.normalizeAgentName)(a))??Number.MAX_SAFE_INTEGER,e=b.get((0,I.normalizeAgentName)(c))??Number.MAX_SAFE_INTEGER;return d!==e?d-e:O(a).localeCompare(O(c))})},[i,x]),bx=j[(0,I.normalizeAgentName)(x)]??null;if(!a)return null;let by=x.trim().length>0&&C.trim().length>0&&E.trim().length>0,bz=!!aw&&aw.displayName.trim().length>0&&aw.repo.trim().length>0&&aw.path.trim().length>0&&aw.defaultBranch.trim().length>0,bA=bm&&!aM&&(!aK.trustedHeaders.enabled||aK.trustedHeaders.teamDomain.trim().length>0&&aK.trustedHeaders.audience.trim().length>0),bB=bi?as:bj?aQ:f,bC=aw?(r={...aw,agentModel:af(ay)??"",agentReasoningEffort:ag(ay)??""},s={ide:C,markdownEditor:E},u=["npx conductor-oss@latest setup","--yes",`--path ${aj(r.path)}`,`--project-id ${aj(r.id)}`,`--display-name ${aj(r.displayName)}`,`--agent ${aj(r.agent||"claude-code")}`,`--ide ${aj(s.ide)}`,`--markdown-editor ${aj(s.markdownEditor)}`],r.repo.trim().length>0&&u.push(`--repo ${aj(r.repo.trim())}`),r.defaultBranch.trim().length>0&&u.push(`--default-branch ${aj(r.defaultBranch.trim())}`),r.agentModel.trim().length>0&&u.push(`--model ${aj(r.agentModel.trim())}`),r.agentReasoningEffort.trim().length>0&&u.push(`--reasoning-effort ${aj(r.agentReasoningEffort.trim())}`),r.defaultWorkingDirectory.trim().length>0&&u.push(`--default-working-directory ${aj(r.defaultWorkingDirectory.trim())}`),u.join(" ")):"";async function bD(a,b){let c;if(!by||e)return!1;let d=await q((c=X?aa??U[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!a||g.onboardingAcknowledged,codingAgent:x.trim(),ide:C.trim(),markdownEditor:E.trim(),markdownEditorPath:(P??"").trim(),modelAccess:V,notifications:{soundEnabled:X,soundFile:c}}),b);return d&&bx&&!bx.ready&&o(x),d}async function bE(){if(!ak){if(!bl){if(!await bD(!0,{closeDialog:!0}))return;n?.({needsProject:0===h});return}await bD(!1,{closeDialog:!1})&&w("repositories")}}async function bF(){(!bi||await a3())&&await bD(!0,{closeDialog:!0})&&n?.({needsProject:!1})}return(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)("div",{className:"fixed inset-0 z-[90] flex items-start justify-center overflow-y-auto bg-black/70 px-3 py-3 sm:items-center",onClick:()=>{a$||"onboarding"===d||aG||aI||p()},role:"presentation",children:(0,b.jsxs)("div",{className:"flex h-[100dvh] w-full flex-col overflow-hidden border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-[min(92vh,760px)] sm:max-h-[calc(100dvh-1.5rem)] sm:max-w-[1120px] sm:rounded-[6px] sm:border sm:flex-row",onClick:a=>a.stopPropagation(),children:[(0,b.jsxs)("aside",{className:"flex w-full shrink-0 flex-col border-b border-[var(--vk-border)] bg-[rgba(28,28,28,0.8)] sm:w-[224px] sm:border-b-0 sm:border-r",children:[(0,b.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,b.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:bb?"Setup":"Settings"})}),(0,b.jsx)("nav",{className:"-mx-0.5 flex gap-1 overflow-x-auto px-2 py-2 sm:mx-0 sm:block sm:space-y-1 sm:overflow-auto sm:px-2",children:a9.map(a=>{let c=a.icon,d=ba.id===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>w(a.id),disabled:a$,className:`flex min-h-[44px] shrink-0 items-center gap-3 rounded-[3px] px-3 py-2 text-left text-[14px] leading-[21px] transition-colors sm:min-h-0 sm:w-full ${d?"bg-[rgba(234,122,42,0.1)] text-[var(--vk-orange)]":"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"} disabled:opacity-50`,children:[(0,b.jsx)(c,{className:"h-4 w-4 shrink-0"}),(0,b.jsx)("span",{children:a.label})]},a.id)})})]}),(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col",children:[(0,b.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,b.jsxs)("div",{children:[(0,b.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:bb?bc?"Choose your preferences":"Review repository defaults":ba.label}),bb&&(0,b.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",bk," of ",a9.length]})]}),(0,b.jsx)("button",{type:"button",onClick:p,disabled:a$||"onboarding"===d,"aria-label":"Close settings",className:"inline-flex h-7 w-7 items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-40",children:(0,b.jsx)(H.X,{className:"h-4 w-4"})})]}),(0,b.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:bh?(0,b.jsxs)("div",{className:"space-y-5",children:[bb&&(0,b.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.08)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"Conductor is already running locally. Finish setup here in the dashboard, then you can start using chat and boards immediately."})}),(bc||bf)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select the default coding agent, review its setup state, and confirm which models Conductor can offer for it."}),(0,b.jsx)("div",{className:"grid gap-3",children:bw.map(a=>{let c=x===a,d=j[(0,I.normalizeAgentName)(a)]??null,e=ah(a,V),f=ab(a,V,k),g=f.slice(0,3),h=f.length-g.length,i=d?.installed?d.ready?"Ready":"Setup required":"Not installed";return(0,b.jsxs)("div",{className:`flex flex-col gap-3 rounded-[4px] border px-3 py-3 text-left sm:flex-row sm:items-start ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,b.jsx)(K.AgentTileIcon,{seed:{label:a},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,b.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,b.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:O(a)}),(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:i}),e?(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:e}):null]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:d?.description??(0,J.getKnownAgent)(a)?.description??"Agent metadata not available."}),(0,b.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[g.map(c=>(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:c.label},`${a}-${c.id}`)),h>0?(0,b.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:["+",h," more"]}):null,0===g.length?(0,b.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[11px] text-[var(--vk-text-muted)]",children:(0,m.supportsAgentModelSelection)(a)?"Models appear after setup":"Uses the agent default model"}):null]}),!d?.installed&&d?.installHint?(0,b.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,b.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:d.installHint})]}):null]})]}),(0,b.jsxs)("div",{className:"flex shrink-0 items-center gap-2 self-start sm:ml-auto",children:[d?.ready?null:(0,b.jsx)("button",{type:"button",onClick:()=>{A(a),o(a)},className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-panel)]",children:d?.installed?"Authenticate":"Install"}),(0,b.jsx)("button",{type:"button",onClick:()=>A(a),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${c?"border-[var(--vk-orange)] bg-[var(--vk-orange)]/12 text-[var(--vk-orange)]":"border-[var(--vk-border)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-panel)]"}`,children:c?"Selected":"Use this agent"}),c&&(0,b.jsx)(t.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},a)})})]}),(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Tell Conductor which account mode each agent is using so the model dropdown only shows options that make sense for that login path."})]}),(0,b.jsx)("div",{className:"grid gap-3",children:bw.filter(a=>{let b=(0,m.getAgentModelCatalog)(a);return(0,m.supportsAgentModelSelection)(a)&&(b?.accessOptions.length??0)>1}).map(a=>{let c=(0,m.getAgentModelCatalog)(a);if(!c)return null;let d=(0,m.resolveAgentModelAccess)(a,V)??c.defaultAccess;return(0,b.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,b.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:c.label}),(0,b.jsx)("select",{value:d,onChange:b=>{var c;let d;return c=b.target.value,void((d=(0,m.getAgentModelCatalog)(a))&&W(a=>({...a,[d.accessKey]:c})))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:c.accessOptions.map(a=>(0,b.jsx)("option",{value:a.id,children:a.label},a.id))}),(0,b.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:c.accessOptions.find(a=>a.id===d)?.description})]},a)})})]})]}),(bc||bd)&&(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,b.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:T.map(a=>{let c=E===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>M(a.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(al,{editorId:a.id}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),c&&(0,b.jsx)(t.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)})}),"notion"!==E&&(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:P??"",readOnly:!0,onClick:()=>aJ(!0),placeholder:"Select your Obsidian vault, Logseq graph, or notes folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>aJ(!0),disabled:a$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Browse folders",children:(0,b.jsx)(y.FolderOpen,{className:"h-4 w-4"})}),(P??"").trim().length>0&&(0,b.jsx)("button",{type:"button",onClick:()=>Q(""),disabled:a$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:"Clear"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Context attachments are discovered from this folder first. Leave it blank to fall back to the current workspace."})]})})]}),(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,b.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[U.map(a=>{let c=X&&aa===a.id;return(0,b.jsxs)("button",{type:"button",onClick:()=>{_(!0),ac(a.id),(0,L.playNotificationSound)(a.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${c?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(F,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:a.label}),c&&(0,b.jsx)(t.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},a.id)}),(0,b.jsxs)("button",{type:"button",onClick:()=>_(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!X?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,b.jsx)(G,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,b.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!X&&(0,b.jsx)(t.Check,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]}),be&&(0,b.jsxs)("div",{className:"space-y-4",children:[(0,b.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Remote Access"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Use one complete URL to open this Conductor instance from your phone or any other machine. The URL below is only shown to admin sessions because it can grant real control of the dashboard."})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:aS.title}),(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:aS.description})]}),(0,b.jsxs)("button",{type:"button",onClick:()=>void a6(),disabled:aU,className:"inline-flex h-8 items-center gap-1.5 rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,b.jsx)(B.RefreshCcw,{className:`h-3.5 w-3.5${aU?" animate-spin":""}`}),(0,b.jsx)("span",{children:"Refresh"})]})]}),aU?(0,b.jsxs)("div",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-3 py-3 text-[13px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading remote access details..."]}):aY?(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-3 py-3 text-[12px] leading-5 text-[var(--vk-red)]",children:aY}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("div",{className:"grid gap-3 lg:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Remote Status"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:bo})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Security Mode"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:bn})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Local Target"}),(0,b.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:aS.localUrl??"Not resolved"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Remote URL"}),(0,b.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:aS.publicUrl??"Not resolved"})]})]}),bs?(0,b.jsxs)("div",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:br?"Private Network Link":"Managed Remote Access"}),(0,b.jsx)("p",{className:"text-[13px] leading-5 text-[var(--vk-text-normal)]",children:br?"Start a private Tailscale link inside Conductor. Only authenticated devices on your tailnet can reach this URL.":"Conductor no longer starts public share tunnels. Use a private Tailscale link here, or configure a protected Cloudflare Access URL separately."})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,b.jsx)("button",{type:"button",onClick:()=>void a7("enable"),disabled:!bu,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-orange)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-orange)]/10 disabled:cursor-not-allowed disabled:opacity-50",children:"enable"===aW?"Enabling...":bt}),(0,b.jsx)("button",{type:"button",onClick:()=>void a7("disable"),disabled:!bv,className:"inline-flex h-8 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-50",children:"disable"===aW?"Disabling...":"Disable"})]})]}),(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:br?aS.installed?"Tailscale is available on this machine. Conductor will publish a private HTTPS link inside your tailnet.":aS.canAutoInstall&&"brew"===aS.autoInstallMethod?"Tailscale is not installed yet. Conductor can install it automatically with Homebrew, but the machine still needs a Tailscale sign-in.":"Tailscale is not installed on this machine yet. Install and sign in once to enable the private remote link.":"Managed remote access now uses only a private Tailscale link. For an enterprise public URL, configure Cloudflare Access separately and point Conductor at that protected address."})]}):(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Enterprise Policy"}),(0,b.jsx)("p",{className:"mt-2 text-[13px] leading-5 text-[var(--vk-text-normal)]",children:"tailscale"===aS.recommendedProvider?"Conductor is set up for a private VPN-style link. Install and sign in to Tailscale, then enable the private link from this screen.":"Conductor no longer publishes bearer-style unlock URLs. Configure verified Cloudflare Access and point `CONDUCTOR_PUBLIC_DASHBOARD_URL` at the protected external URL instead."})]}),aS.lastError&&(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-red)]",children:br?"Private Link Error":"Tunnel Error"}),(0,b.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-red)]",children:aS.lastError})]}),aS.connectUrl?(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"flex flex-wrap items-start justify-between gap-2",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"private-network"===aS.mode?"Private Remote URL":"Protected Remote URL"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"private-network"===aS.mode?"Share this URL only with operators who are already authenticated to your private network.":"Share this protected URL. Recipients still need to pass the enterprise identity check before they reach Conductor."})]}),(0,b.jsx)(ap,{value:aS.connectUrl,idleLabel:"Copy URL"})]}),(0,b.jsx)("code",{className:"block break-all rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-normal)]",children:aS.connectUrl})]}):(0,b.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-normal)]",children:"enterprise-only"===aS.mode?"tailscale"===aS.recommendedProvider?aS.connected?"A private VPN URL will appear here after you enable the private link.":"A private VPN URL will appear here after Tailscale is installed and signed in.":"A protected enterprise remote URL will appear here after verified Cloudflare Access is configured.":"A protected remote URL is not available yet."})}),aS.warnings.length>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-red)]",children:"Security Warnings"}),(0,b.jsx)("div",{className:"space-y-1.5",children:aS.warnings.map(a=>(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-red)]",children:a},a))})]}),aS.nextSteps.length>0&&(0,b.jsxs)("div",{className:"space-y-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Next Steps"}),(0,b.jsx)("div",{className:"space-y-1.5",children:aS.nextSteps.map(a=>(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:a},a))})]})]})]})]})]}):bi?(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("section",{className:"space-y-1",children:[(0,b.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:bb?"Repository Defaults":"Repository Configuration"}),(0,b.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:bb?"Review the repository Conductor will use for this workspace. You can edit advanced scripts later from Settings.":"Configure scripts and defaults used whenever this repository is selected for workspaces."})]}),("settings"===d||ad.length>1)&&(0,b.jsxs)("section",{className:"space-y-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,b.jsxs)("select",{value:au,onChange:a=>av(a.target.value),disabled:ak||0===ad.length||a$,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[0===ad.length&&(0,b.jsx)("option",{value:"",children:"No repositories configured"}),ad.map(a=>(0,b.jsx)("option",{value:a.id,children:a.displayName},a.id))]})]}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),ak&&(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),bb&&1===ad.length&&aw&&(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,b.jsxs)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.52)] px-3 py-3 text-[13px] text-[var(--vk-text-normal)]",children:[aw.displayName,(0,b.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:aw.path})]})]}),aw&&(0,b.jsxs)(b.Fragment,{children:["settings"===d&&(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Use this when you already know the target repository and want one command to prefill it. The default first-run path is still `npx conductor-oss@latest`, which opens the dashboard and lets the user choose preferences before adding a project."})]}),(0,b.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",aw.workspaceMode]}),(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",aw.runtimeMode]}),(0,b.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",aw.scmMode]})]}),(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,b.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:bC})}),(0,b.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"This command uses your selected agent, editor, and notes app. Best on macOS with Homebrew. GitHub sign-in still opens a browser so the user can approve access."}),(0,b.jsx)(ap,{value:bC,idleLabel:"Copy Setup Command"})]})]}),(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,b.jsx)("input",{value:aw.displayName,onChange:a=>ax(b=>b?{...b,displayName:a.target.value}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,b.jsx)("input",{value:aw.repo,onChange:a=>ax(b=>b?{...b,repo:a.target.value}:b),placeholder:"e.g., your-org/your-repo",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,b.jsx)("select",{value:aw.agent,onChange:a=>{let b=a.target.value;ax(a=>a?{...a,agent:b}:a),az(ae(b,V,k,null))},className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:bw.map(a=>(0,b.jsx)("option",{value:a,children:O(a)},a))}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used by the one-line bootstrap and as the project default when tasks dispatch."})]}),(0,m.supportsAgentModelSelection)(aw.agent)&&(0,b.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,b.jsx)(am,{agent:aw.agent,modelAccess:V,runtimeModelCatalogs:k,selection:ay,onChange:az})}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,b.jsxs)("select",{value:aw.agentPermissions,onChange:a=>ax(b=>b?{...b,agentPermissions:"default"===a.target.value?"default":"skip"}:b),className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:[(0,b.jsx)("option",{value:"skip",children:"Auto approve and allow local dev servers"}),(0,b.jsx)("option",{value:"default",children:"Sandboxed default mode"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Applies to new sessions for this repository across all agents unless you override the launch mode."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:aw.path,readOnly:!0,onClick:()=>aH(!0),placeholder:"Use Browse to select a repository folder",className:"h-9 w-full cursor-pointer rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>aH(!0),disabled:a$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",children:(0,b.jsx)(y.FolderOpen,{className:"h-4 w-4"})})]}),!aw.pathHealth.exists&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),aw.pathHealth.exists&&!aw.pathHealth.isGitRepository&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),aw.pathHealth.suggestedPath&&(0,b.jsx)("button",{type:"button",onClick:()=>{let a=aw.pathHealth.suggestedPath??"";a&&(ax(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),a2(a))},className:"mt-1 inline-flex h-7 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[11px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Use detected git repo path"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,b.jsx)("input",{value:aw.defaultWorkingDirectory,onChange:a=>ax(b=>b?{...b,defaultWorkingDirectory:a.target.value}:b),placeholder:"e.g., packages/frontend",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Subdirectory relative to the repository root where the coding agent starts."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,b.jsxs)("div",{className:"flex items-center gap-2",children:[(0,b.jsx)("input",{value:aw.defaultBranch,onChange:a=>ax(b=>b?{...b,defaultBranch:a.target.value}:b),placeholder:"Select a branch",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("button",{type:"button",onClick:()=>{a2()},disabled:aC,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-2 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-60",title:"Detect branches",children:aC?(0,b.jsx)(z.Loader2,{className:"h-3.5 w-3.5 animate-spin"}):(0,b.jsx)(B.RefreshCcw,{className:"h-3.5 w-3.5"})})]}),aA.length>0&&(0,b.jsx)("select",{value:aw.defaultBranch,onChange:a=>ax(b=>b?{...b,defaultBranch:a.target.value}:b),className:"mt-2 h-8 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:aA.map(a=>(0,b.jsx)("option",{value:a,children:a},a))}),aE&&(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:aE})]})]}),"settings"===d&&(0,b.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,b.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,b.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure dev server, setup, cleanup, archive, and file-copy behavior for this repository."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,b.jsx)("textarea",{rows:3,value:aw.devServerScript,onChange:a=>ax(b=>b?{...b,devServerScript:a.target.value}:b),placeholder:"npm run dev",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Optional. Leave this blank if you run the local app yourself and only want Conductor to auto-connect the preview."})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,b.jsx)("input",{value:aw.devServerCwd,onChange:a=>ax(b=>b?{...b,devServerCwd:a.target.value}:b),placeholder:"e.g., apps/web",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,b.jsx)("input",{value:aw.devServerUrl,onChange:a=>ax(b=>b?{...b,devServerUrl:a.target.value}:b),placeholder:"e.g., https://preview.example.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"If set, preview connects here first instead of inferring from logs."})]})]}),(0,b.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,b.jsx)("input",{value:aw.devServerPort,onChange:a=>ax(b=>b?{...b,devServerPort:a.target.value}:b),inputMode:"numeric",placeholder:"3000",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,b.jsx)("input",{value:aw.devServerHost,onChange:a=>ax(b=>b?{...b,devServerHost:a.target.value}:b),placeholder:"127.0.0.1",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,b.jsx)("input",{value:aw.devServerPath,onChange:a=>ax(b=>b?{...b,devServerPath:a.target.value}:b),placeholder:"/",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"flex items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aw.devServerHttps,onChange:a=>ax(b=>b?{...b,devServerHttps:a.target.checked}:b),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Use HTTPS"})]})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,b.jsx)("textarea",{rows:4,value:aw.setupScript,onChange:a=>ax(b=>b?{...b,setupScript:a.target.value}:b),placeholder:"npm install",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs in the worktree after creation and before/with coding-agent startup."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aw.runSetupInParallel,onChange:a=>ax(b=>b?{...b,runSetupInParallel:a.target.checked}:b),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,b.jsx)("textarea",{rows:4,value:aw.cleanupScript,onChange:a=>ax(b=>b?{...b,cleanupScript:a.target.value}:b),placeholder:"Runs when the workspace is archived and changes exist",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,b.jsx)("textarea",{rows:4,value:aw.archiveScript,onChange:a=>ax(b=>b?{...b,archiveScript:a.target.value}:b),placeholder:"Runs when the workspace/session is archived",className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,b.jsx)("input",{value:aw.copyFiles,onChange:a=>ax(b=>b?{...b,copyFiles:a.target.value}:b),placeholder:".env, config/*.json",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Comma-separated relative file paths or glob patterns copied from the repo to each worktree."})]})]})]})]}):bj?(0,b.jsxs)("div",{className:"space-y-5",children:[(0,b.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,b.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Security-First Remote Access"}),(0,b.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost. For phone and team access, put a verified edge identity layer like Cloudflare Access in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),aM?(0,b.jsxs)("section",{className:"flex items-center gap-2 rounded-[6px] border border-[var(--vk-border)] px-4 py-4 text-[13px] text-[var(--vk-text-muted)]",children:[(0,b.jsx)(z.Loader2,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,b.jsxs)(b.Fragment,{children:[(0,b.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aK.current.email??"Anonymous local session"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aK.current.role??"No access"})]}),(0,b.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,b.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,b.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:aK.current.provider??"Local only"})]})]}),!bm&&(0,b.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,b.jsx)("p",{className:"text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"You can review organization security here, but only an admin session can save changes. Use a local admin session or an admin identity from your edge auth provider to modify access rules."})}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Require authentication for remote dashboard requests and decide what authenticated users get by default before explicit role bindings are applied. Localhost on this machine stays in a local admin recovery mode so setup and break-glass access keep working."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aK.requireAuth,onChange:a=>aL(b=>({...b,requireAuth:a.target.checked})),disabled:!bm||aO||aK.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,b.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Public share-link remote control has been removed. Remote access now requires either the private Tailscale link or an identity-bound provider such as Cloudflare Access or Clerk."}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,b.jsxs)("select",{value:aK.defaultRole,onChange:a=>aL(b=>({...b,defaultRole:a.target.value})),disabled:!bm||aO,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60",children:[(0,b.jsx)("option",{value:"viewer",children:"Viewer"}),(0,b.jsx)("option",{value:"operator",children:"Operator"}),(0,b.jsx)("option",{value:"admin",children:"Admin"})]}),(0,b.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"This applies after identity verification when no explicit email or domain binding matches. Cloudflare Access enterprise mode forces full authentication automatically."})]})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Recommended for secure public phone access and free team collaboration. Conductor verifies the Cloudflare Access JWT instead of trusting a raw email header."})]}),(0,b.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,b.jsx)("input",{type:"checkbox",checked:aK.trustedHeaders.enabled,onChange:a=>aL(b=>({...b,requireAuth:!!a.target.checked||b.requireAuth,trustedHeaders:{...b.trustedHeaders,enabled:a.target.checked}})),disabled:!bm||aO,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,b.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,b.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,b.jsx)("div",{className:"flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 text-[13px] text-[var(--vk-text-normal)]",children:"Cloudflare Access (verified JWT)"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,b.jsx)("input",{value:aK.trustedHeaders.emailHeader,onChange:a=>aL(b=>({...b,trustedHeaders:{...b.trustedHeaders,emailHeader:a.target.value}})),disabled:!bm||aO,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,b.jsx)("input",{value:aK.trustedHeaders.jwtHeader,onChange:a=>aL(b=>({...b,trustedHeaders:{...b.trustedHeaders,jwtHeader:a.target.value}})),disabled:!bm||aO,className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,b.jsx)("input",{value:aK.trustedHeaders.teamDomain,onChange:a=>aL(b=>({...b,trustedHeaders:{...b.trustedHeaders,teamDomain:a.target.value}})),disabled:!bm||aO,placeholder:"your-team.cloudflareaccess.com",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]}),(0,b.jsxs)("label",{className:"block lg:col-span-2",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,b.jsx)("input",{value:aK.trustedHeaders.audience,onChange:a=>aL(b=>({...b,trustedHeaders:{...b.trustedHeaders,audience:a.target.value}})),disabled:!bm||aO,placeholder:"Copy the AUD value from your Cloudflare Access application",className:"h-9 w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"})]})]}),(0,b.jsx)("p",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Enterprise remote access requires a Cloudflare Access application that injects a verified JWT and email header. Conductor will not publish a shareable admin URL when that verification layer is missing."})]}),(0,b.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,b.jsxs)("div",{className:"space-y-1",children:[(0,b.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,b.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Map verified team identities into least-privilege roles. `viewer` can inspect work, `operator` can control agents, and `admin` can change global settings."})]}),(0,b.jsx)("div",{className:"grid gap-3 lg:grid-cols-2",children:[{label:"Viewer Emails",key:"viewers",placeholder:"alice@example.com"},{label:"Operator Emails",key:"operators",placeholder:"builder@example.com"},{label:"Admin Emails",key:"admins",placeholder:"owner@example.com"},{label:"Viewer Domains",key:"viewerDomains",placeholder:"guests.example.com"},{label:"Operator Domains",key:"operatorDomains",placeholder:"eng.example.com"},{label:"Admin Domains",key:"adminDomains",placeholder:"admins.example.com"}].map(({label:a,key:c,placeholder:d})=>(0,b.jsxs)("label",{className:"block",children:[(0,b.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:a}),(0,b.jsx)("textarea",{rows:4,value:aK.roles[c],onChange:a=>aL(b=>({...b,roles:{...b.roles,[c]:a.target.value}})),disabled:!bm||aO,placeholder:d,className:"w-full rounded-[4px] border border-[var(--vk-border)] bg-transparent px-2 py-2 text-[13px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)] disabled:opacity-60"}),(0,b.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},c))})]})]})]}):(0,b.jsxs)("section",{className:"space-y-3",children:[(0,b.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:ba.label}),(0,b.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, Remote Access, and repository settings are available now."}),(0,b.jsx)("button",{type:"button",onClick:()=>w("general"),className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Open General"})]})}),(0,b.jsxs)("footer",{className:"flex flex-col gap-3 border-t border-[var(--vk-border)] px-4 py-3 sm:flex-row sm:items-center sm:justify-between sm:gap-2",children:[(0,b.jsxs)("div",{className:"min-w-0",children:[bB&&(0,b.jsx)("p",{className:"truncate rounded-[4px] border border-[var(--vk-red)]/35 bg-[var(--vk-red)]/10 px-2 py-1 text-[12px] text-[var(--vk-red)]",children:bB}),!bB&&bg&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:bb?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!bB&&bi&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:bb?"These defaults will be used the first time workspaces and tasks are created for this repo.":"Repository settings are saved to your conductor config and used for future workspaces."}),!bB&&bj&&(0,b.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Organization access settings are written into `conductor.yaml`. Use admin role bindings for full control, operator bindings for day-to-day agent usage, and viewer bindings for read-only access."})]}),(0,b.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!bb&&(0,b.jsx)("button",{type:"button",onClick:p,disabled:a$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Close"}),bb&&bi&&(0,b.jsx)("button",{type:"button",onClick:()=>w("preferences"),disabled:a$,className:"inline-flex h-9 items-center rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),bg&&!bb&&(0,b.jsx)("button",{type:"button",onClick:()=>{bD(g.onboardingAcknowledged,{closeDialog:!0})},disabled:!by||e,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:e?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),bi&&!bb&&(0,b.jsx)("button",{type:"button",onClick:()=>{a3()},disabled:!bz||aq||ak,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:aq?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),bj&&!bb&&(0,b.jsx)("button",{type:"button",onClick:()=>{a5()},disabled:!bA||aO,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:aO?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),bb&&(0,b.jsx)("button",{type:"button",onClick:()=>{bc?bE():bF()},disabled:bc?!by||e||ak:!bz||a$,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:a$||bc&&ak?(0,b.jsxs)(b.Fragment,{children:[(0,b.jsx)(z.Loader2,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),bc&&ak?"Loading...":"Saving..."]}):bc&&bl?"Continue":"Finish Setup"})]})]})]})]})}),(0,b.jsx)(ao,{open:aG,initialPath:aw?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>aH(!1),onSelect:a=>{aH(!1),a&&(ax(b=>b?{...b,path:a,pathHealth:{...b.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:b),a2(a))}}),(0,b.jsx)(ao,{open:aI,initialPath:P??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>aJ(!1),onSelect:a=>{aJ(!1),null!==a&&Q(a)}})]})}a.s(["NewWorkspaceDialog",()=>an,"SettingsDialog",()=>aq],15624)},57280,a=>{a.n(a.i(15624))}];
2
2
 
3
3
  //# sourceMappingURL=packages_web_src_features_dashboard_components_DashboardDialogs_tsx_32d3d858._.js.map