conductor-oss 0.30.2 → 0.30.4

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 (109) 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/app-path-routes-manifest.json +6 -6
  4. package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
  5. package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
  6. package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +5 -5
  7. package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  8. package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
  9. package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
  10. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  11. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  12. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  13. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  14. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  15. package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  16. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
  17. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
  18. package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  19. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/bridges/[bridgeId]/route.js +1 -1
  20. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/bridges/route.js +1 -1
  21. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/[deviceId]/route.js +1 -1
  22. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/claims/complete/route.js +1 -1
  23. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/code/route.js +1 -1
  24. package/web/.next/standalone/packages/web/.next/server/app/api/bridge/devices/route.js +1 -1
  25. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
  26. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
  27. package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
  28. package/web/.next/standalone/packages/web/.next/server/app/page.js +2 -2
  29. package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
  30. package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
  31. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +2 -2
  32. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
  33. package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
  34. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
  35. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
  36. package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
  37. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +1 -1
  38. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
  39. package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
  40. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
  41. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
  42. package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
  43. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
  44. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
  45. package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
  46. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
  47. package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
  48. package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
  49. package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +6 -6
  50. package/web/.next/standalone/packages/web/.next/server/chunks/1121.js +1 -1
  51. package/web/.next/standalone/packages/web/.next/server/chunks/4888.js +1 -1
  52. package/web/.next/standalone/packages/web/.next/server/chunks/5025.js +1 -0
  53. package/web/.next/standalone/packages/web/.next/server/chunks/5164.js +3 -3
  54. package/web/.next/standalone/packages/web/.next/server/chunks/5694.js +1 -1
  55. package/web/.next/standalone/packages/web/.next/server/chunks/6054.js +1 -1
  56. package/web/.next/standalone/packages/web/.next/server/chunks/6489.js +1 -1
  57. package/web/.next/standalone/packages/web/.next/server/chunks/7547.js +1 -0
  58. package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
  59. package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
  60. package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
  61. package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
  62. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
  63. package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
  64. package/web/.next/standalone/packages/web/.next/static/chunks/1265.1c9b072945904c07.js +1 -0
  65. package/web/.next/standalone/packages/web/.next/static/chunks/4443.4751072018eda510.js +1 -0
  66. package/web/.next/standalone/packages/web/.next/static/chunks/474.1a853ae261c6f831.js +1 -0
  67. package/web/.next/standalone/packages/web/.next/static/chunks/4929.a3162cca47aff839.js +1 -0
  68. package/web/.next/standalone/packages/web/.next/static/chunks/{7220-6f03daec280b1310.js → 7220-759bf5f5ee3a953f.js} +1 -1
  69. package/web/.next/standalone/packages/web/.next/static/chunks/7720-f8fad1acac794e8d.js +2 -0
  70. package/web/.next/standalone/packages/web/.next/static/chunks/9756-2afe5fa19201a51a.js +1 -0
  71. package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-4ff8eb6917b7e063.js +1 -0
  72. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-536f088e4ecf886b.js +1 -0
  73. package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/page-f3756bd7b55447a9.js +1 -0
  74. package/web/.next/standalone/packages/web/.next/static/chunks/{webpack-65247d8c6649582a.js → webpack-e988047f31110b5c.js} +1 -1
  75. package/web/.next/static/chunks/1265.1c9b072945904c07.js +1 -0
  76. package/web/.next/static/chunks/4443.4751072018eda510.js +1 -0
  77. package/web/.next/static/chunks/474.1a853ae261c6f831.js +1 -0
  78. package/web/.next/static/chunks/4929.a3162cca47aff839.js +1 -0
  79. package/web/.next/static/chunks/{7220-6f03daec280b1310.js → 7220-759bf5f5ee3a953f.js} +1 -1
  80. package/web/.next/static/chunks/7720-f8fad1acac794e8d.js +2 -0
  81. package/web/.next/static/chunks/9756-2afe5fa19201a51a.js +1 -0
  82. package/web/.next/static/chunks/app/layout-4ff8eb6917b7e063.js +1 -0
  83. package/web/.next/static/chunks/app/page-536f088e4ecf886b.js +1 -0
  84. package/web/.next/static/chunks/app/sessions/[id]/page-f3756bd7b55447a9.js +1 -0
  85. package/web/.next/static/chunks/{webpack-65247d8c6649582a.js → webpack-e988047f31110b5c.js} +1 -1
  86. package/web/.next/standalone/packages/web/.next/server/chunks/6229.js +0 -1
  87. package/web/.next/standalone/packages/web/.next/server/chunks/6312.js +0 -1
  88. package/web/.next/standalone/packages/web/.next/static/chunks/1265.eb0836b68e2c5068.js +0 -1
  89. package/web/.next/standalone/packages/web/.next/static/chunks/4443.a7231192bcabcb39.js +0 -1
  90. package/web/.next/standalone/packages/web/.next/static/chunks/474.e2261e8fe56e5d2b.js +0 -1
  91. package/web/.next/standalone/packages/web/.next/static/chunks/7720-26b9379cbba41cf1.js +0 -2
  92. package/web/.next/standalone/packages/web/.next/static/chunks/8659.44db5b2c3161acd3.js +0 -1
  93. package/web/.next/standalone/packages/web/.next/static/chunks/9756-c69416a974795433.js +0 -1
  94. package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-cce84419ee9eeeca.js +0 -1
  95. package/web/.next/standalone/packages/web/.next/static/chunks/app/page-2e773d9773c7b8d8.js +0 -1
  96. package/web/.next/standalone/packages/web/.next/static/chunks/app/sessions/[id]/page-057af93ee9059ddb.js +0 -1
  97. package/web/.next/static/chunks/1265.eb0836b68e2c5068.js +0 -1
  98. package/web/.next/static/chunks/4443.a7231192bcabcb39.js +0 -1
  99. package/web/.next/static/chunks/474.e2261e8fe56e5d2b.js +0 -1
  100. package/web/.next/static/chunks/7720-26b9379cbba41cf1.js +0 -2
  101. package/web/.next/static/chunks/8659.44db5b2c3161acd3.js +0 -1
  102. package/web/.next/static/chunks/9756-c69416a974795433.js +0 -1
  103. package/web/.next/static/chunks/app/layout-cce84419ee9eeeca.js +0 -1
  104. package/web/.next/static/chunks/app/page-2e773d9773c7b8d8.js +0 -1
  105. package/web/.next/static/chunks/app/sessions/[id]/page-057af93ee9059ddb.js +0 -1
  106. /package/web/.next/standalone/packages/web/.next/static/{see4G2ERXsOIVmNhC0xYH → PI7swHEBX1p5mEZCM1Irt}/_buildManifest.js +0 -0
  107. /package/web/.next/standalone/packages/web/.next/static/{see4G2ERXsOIVmNhC0xYH → PI7swHEBX1p5mEZCM1Irt}/_ssgManifest.js +0 -0
  108. /package/web/.next/static/{see4G2ERXsOIVmNhC0xYH → PI7swHEBX1p5mEZCM1Irt}/_buildManifest.js +0 -0
  109. /package/web/.next/static/{see4G2ERXsOIVmNhC0xYH → PI7swHEBX1p5mEZCM1Irt}/_ssgManifest.js +0 -0
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[474],{23555:(e,t,r)=>{r.d(t,{A:()=>a});let a=(0,r(13454).A)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]])},90474:(e,t,r)=>{r.r(t),r.d(t,{NewWorkspaceDialog:()=>eu,SettingsDialog:()=>eg});var a=r(54568),s=r(71708),l=r(76196),n=r(7620),o=r(52353),i=r(20487),d=r(13454);let c=(0,d.A)("circle-user",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);var x=r(50549),p=r(57917),v=r(21048),m=r(55341),u=r(30824),h=r(34737),b=r(20670);let g=(0,d.A)("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 f=r(34309),k=r(36645),j=r(45894),N=r(58299),y=r(62868),w=r(34041),C=r(23555),S=r(59706);let A=(0,d.A)("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"}]]),H=(0,d.A)("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 E=r(5739),P=r(33866),R=r(90124),M=r(31404),U=r(85626);r(51164);var $=r(30524);let D=(0,d.A)("log-out",[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]]);function L(e){switch(e){case"clerk":return"Clerk";case"cloudflare-access":return"Cloudflare Access";case"trusted-header":return"Verified Header";case"local":return"Local";default:return"Unknown"}}function F(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function B({label:e,value:t,href:r}){return(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:e}),r?(0,a.jsx)("a",{href:r,target:"_blank",rel:"noreferrer",className:"mt-2 block break-all text-[14px] text-[var(--vk-orange)] hover:underline",children:t}):(0,a.jsx)("p",{className:"mt-2 break-all text-[14px] text-[var(--vk-text-normal)]",children:t})]})}function _({profile:e}){let t=(e?.displayName??e?.email??"User").split(/[\s@._-]+/g).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("").slice(0,2);return e?.avatarUrl?(0,a.jsx)("img",{src:e.avatarUrl,alt:e.displayName??e.email??"Profile avatar",className:"h-20 w-20 rounded-full border border-[var(--vk-border)] object-cover shadow-[0_10px_30px_rgba(0,0,0,0.28)]"}):(0,a.jsx)("div",{className:"flex h-20 w-20 items-center justify-center rounded-full border border-[var(--vk-border)] bg-[rgba(234,122,42,0.12)] text-[26px] font-semibold text-[var(--vk-orange)]",children:t||"U"})}function T({profile:e,loading:t,error:r,onRefresh:l}){if(t)return(0,a.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,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading profile details..."]});if(r&&!e)return(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Profile Unavailable"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Conductor could not load the active user profile for this session."})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Retry"]})]});let n=e?.displayName??"Unknown user",o=e?.email??"Not available",i=e?.githubUsername?`@${e.githubUsername}`:"Not linked";return(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] px-5 py-5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-4",children:[(0,a.jsx)(_,{profile:e}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h4",{className:"truncate text-[24px] leading-[26px] text-[var(--vk-text-strong)]",children:n}),(0,a.jsx)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-muted)]",children:o}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2 text-[11px]",children:[(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:F(e?.role??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:L(e?.provider??null)}),(0,a.jsx)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1 text-[var(--vk-text-normal)]",children:e?"local"===e.provider?"Local admin session":e.authenticated?"Authenticated":"Anonymous":"Unknown"})]})]})]}),(0,a.jsxs)("button",{type:"button",onClick:l,className:"inline-flex h-9 items-center gap-2 self-start rounded-[4px] border border-[var(--vk-border)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"}),"Refresh"]})]})}),(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsx)(B,{label:"Display Name",value:n}),(0,a.jsx)(B,{label:"Email",value:o}),(0,a.jsx)(B,{label:"GitHub",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(B,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(B,{label:"Auth Provider",value:L(e?.provider??null)}),(0,a.jsx)(B,{label:"Access Role",value:F(e?.role??null)})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Session Actions"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Review how this browser session is authenticated and sign out when Conductor owns the session lifecycle."})]}),e?.canLogout&&"clerk"===e.logoutMode?(0,a.jsx)($.ct,{redirectUrl:"/sign-in",children:(0,a.jsxs)("button",{type:"button",className:"inline-flex h-9 items-center gap-2 rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(D,{className:"h-3.5 w-3.5"}),"Log Out"]})}):(0,a.jsx)("div",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-3 py-3 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:e?.provider==="local"?"This is a local recovery session on the current machine, so there is nothing to sign out of.":`This session is managed by ${L(e?.provider??null)}. Sign out from that provider if you need to end access.`}),e?.githubProfileUrl&&(0,a.jsxs)("a",{href:e.githubProfileUrl,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 text-[13px] text-[var(--vk-orange)] hover:underline",children:[(0,a.jsx)(s.uj0,{size:14}),"Open GitHub Profile"]})]})]})}var O=r(73927);let q="claude-code";function z(e){let t=(0,P.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function G(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function I(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function W(e){if(!e)return null;let t=Date.parse(e);return Number.isNaN(t)?null:`Updated ${new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",timeZone:"UTC"}).format(new Date(t))}`}let V=[{id:"profile",label:"Profile",icon:c,implemented:!0},{id:"general",label:"General",icon:x.A,implemented:!0},{id:"repositories",label:"Repositories",icon:p.A,implemented:!0},{id:"organization",label:"Organization Settings",icon:v.A,implemented:!0},{id:"projects",label:"Projects",icon:m.A,implemented:!1},{id:"agents",label:"Agents",icon:u.A,implemented:!0},{id:"mcp",label:"MCP Servers",icon:h.A,implemented:!1},{id:"preferences",label:"Preferences",icon:b.A,implemented:!1}],Z=[{id:"preferences",label:"Preferences",icon:b.A,implemented:!0},{id:"repositories",label:"Repository",icon:p.A,implemented:!0}],J=[{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"}],Y=[{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 X(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function K(e){return Array.isArray(e)?e.filter(e=>"string"==typeof e).map(e=>e.trim()).filter(Boolean).join("\n"):"string"!=typeof e?"":e.split(/[\n,]+/g).map(e=>e.trim()).filter(Boolean).join("\n")}function Q(e,t){let r=X(e),a=X(r.trustedHeaders),s=X(r.roles),l=X(t),n=r.defaultRole,o=l.role;return{requireAuth:!0===r.requireAuth||!0===a.enabled,defaultRole:"viewer"===n||"admin"===n||"operator"===n?n:"operator",trustedHeaders:{enabled:!0===a.enabled,provider:"cloudflare-access",emailHeader:"string"==typeof a.emailHeader&&a.emailHeader.trim().length>0?a.emailHeader.trim():"Cf-Access-Authenticated-User-Email",jwtHeader:"string"==typeof a.jwtHeader&&a.jwtHeader.trim().length>0?a.jwtHeader.trim():"Cf-Access-Jwt-Assertion",teamDomain:"string"==typeof a.teamDomain&&a.teamDomain.trim().length>0?a.teamDomain.trim():"",audience:"string"==typeof a.audience&&a.audience.trim().length>0?a.audience.trim():""},roles:{viewers:K(s.viewers),operators:K(s.operators),admins:K(s.admins),viewerDomains:K(s.viewerDomains),operatorDomains:K(s.operatorDomains),adminDomains:K(s.adminDomains)},current:{authenticated:!0===l.authenticated,role:"viewer"===o||"operator"===o||"admin"===o?o:null,email:"string"==typeof l.email&&l.email.trim().length>0?l.email.trim():null,provider:"string"==typeof l.provider&&l.provider.trim().length>0?l.provider.trim():null}}}function ee(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function et(e,t){return t[(0,E.q)(e)]??null}function er(e){if(!e)return[];let t=[],r=new Set;for(let a of Object.values(e.modelsByAccess))if(Array.isArray(a))for(let e of a)!e?.id||r.has(e.id)||(r.add(e.id),t.push(e));return t}function ea(e,t,r){let a=et(e,r),s=(0,l.Tk)(e,t),n=(0,O.V3)(a,s),o=(0,l.d8)(e,t),i=[],d=new Set;for(let e of[...n,...o,...er(a)])!e?.id||d.has(e.id)||(d.add(e.id),i.push(e));return i}function es(e,t,r,a){let s=et(e,r),n=(0,l.Tk)(e,t),o=(0,O.a3)(s,a,n),i=(0,l.u6)(e,t),d=[],c=new Set;for(let e of[...o,...i])!e?.id||c.has(e.id)||(c.add(e.id),d.push(e));return d}function el(e,t,r,a){let s=et(e,r),n=(0,l.Tk)(e,t);return(0,O.Z9)(s,a,n)??(0,l.DZ)(e,t)??""}function en(e,t,r,a,s){let n,o,i=a?.trim()??"",d=s?.trim().toLowerCase()??"",c=ea(e,t,r),x=(n=et(e,r),o=(0,l.Tk)(e,t),(0,O.NN)(n,o)??(0,l.O$)(e,t)??er(n)[0]?.id??""),p=a=>{let s=es(e,t,r,a);return d.length>0&&s.some(e=>e.id===d)?d:el(e,t,r,a)};return i.length>0?c.some(e=>e.id===i)?{catalogModel:i,customModel:"",reasoningEffort:p(i)}:{catalogModel:x,customModel:i,reasoningEffort:p(i)}:{catalogModel:x,customModel:"",reasoningEffort:p(x)}}function eo(e){let t=e.customModel.trim();if(t.length>0)return t;let r=e.catalogModel.trim();return r.length>0?r:void 0}function ei(e){let t=e.reasoningEffort.trim().toLowerCase();return t.length>0?t:void 0}function ed(e,t){let r=(0,l.yM)(e);if(!r||r.accessOptions.length<=1)return null;let a=(0,l.Tk)(e,t);return a?r.accessOptions.find(e=>e.id===a)?.label??null:null}let ec="block h-4 w-4 shrink-0";function ex(e){return JSON.stringify(e)}let ep={obsidian:{kind:"icon",icon:o.mWn,className:`${ec} text-[#8b5cf6]`},vscode:{kind:"icon",icon:i.$$9,className:`${ec} text-[#22a3f5]`},notion:{kind:"icon",icon:o.i4$,className:`${ec} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ec} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ec} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:x.A,className:`${ec} text-[var(--vk-text-muted)]`}};function ev({editorId:e}){let t=ep[e];if(!t)return(0,a.jsx)(g,{className:`${ec} text-[var(--vk-text-muted)]`});if("image"===t.kind)return(0,a.jsx)("img",{src:t.imageSrc,alt:"",className:t.className});let r=t.icon;return(0,a.jsx)(r,{className:t.className})}function em({agent:e,modelAccess:t,runtimeModelCatalogs:r,selection:s,onChange:n,compact:o=!1}){if(!(0,l.Zz)(e))return null;let i=(0,l.yM)(e),d=ea(e,t,r),c=es(e,t,r,eo(s)??s.catalogModel),x=ed(e,t);return i?(0,a.jsxs)("div",{className:o?"grid gap-3 md:grid-cols-3":"space-y-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Model"}),(0,a.jsxs)("select",{value:s.catalogModel,disabled:0===d.length,onChange:a=>{let l=a.target.value,o=es(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:el(e,t,r,l)})},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===d.length&&(0,a.jsx)("option",{value:"",children:"No runtime models detected"}),d.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))]}),(0,a.jsxs)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:[x?`Filtered for ${x}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),c.length>0&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Reasoning Effort"}),(0,a.jsx)("select",{value:s.reasoningEffort,onChange:e=>{n({...s,reasoningEffort:e.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:c.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Custom Model Override"}),(0,a.jsx)("input",{value:s.customModel,onChange:a=>{let l=a.target.value,o=l.trim()||s.catalogModel,i=es(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:el(e,t,r,o)})},placeholder:function(e,t){let r=et(e,t);if(r?.customModelPlaceholder.trim())return r.customModelPlaceholder;let a=(0,l.yM)(e)?.label??"agent";return`Enter exact ${a} model id`}(e,r),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,a.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 eu({open:e,onClose:t,onCreate:r,creating:o,error:i,defaultAgent:d,agentOptions:c,modelAccess:x,runtimeModelCatalogs:p,bridgeId:v}){let[m,u]=(0,n.useState)("git"),[h,b]=(0,n.useState)("source"),[g,C]=(0,n.useState)(""),[S,A]=(0,n.useState)(!1),[H,R]=(0,n.useState)(""),[U,$]=(0,n.useState)(""),[D,L]=(0,n.useState)(""),[F,B]=(0,n.useState)("main"),[_,T]=(0,n.useState)(d),[O,V]=(0,n.useState)(ee()),[Z,J]=(0,n.useState)(!1),[Y,X]=(0,n.useState)(!0),[K,Q]=(0,n.useState)([]),[et,er]=(0,n.useState)(!1),[ea,es]=(0,n.useState)(!1),[el,ed]=(0,n.useState)(null),[ec,ex]=(0,n.useState)(""),[ep,ev]=(0,n.useState)(""),[eb,eg]=(0,n.useState)(!1),[ef,ek]=(0,n.useState)("local"),[ej,eN]=(0,n.useState)([]),[ey,ew]=(0,n.useState)(!1),[eC,eS]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(u("git"),b("source"),C(""),A(!1),R(""),$(""),L(""),B("main"),X(!0),J(!1),T(d),V(ee()),Q([]),es(!1),ed(null),ex(""),ev(""),eN([]),eS(null),ew(!1),eg(!1),ek("local"))},[d,e]),(0,n.useEffect)(()=>{e&&V(e=>{let t=en(_,x,p,eo(e)??null,ei(e)??null);return e.catalogModel===t.catalogModel&&e.customModel===t.customModel&&e.reasoningEffort===t.reasoningEffort?e:t})},[_,x,e,p]),(0,n.useEffect)(()=>{if(!e)return;let t="git"===m?H.trim().length>0:U.trim().length>0;"details"!==h||t||b("source")},[H,U,m,e,h]);let eA=(0,n.useMemo)(()=>{let e;return 0===(e=ec.trim().toLowerCase()).length?K:K.filter(t=>t.fullName.toLowerCase().includes(e)||t.name.toLowerCase().includes(e)||(t.ownerLogin??"").toLowerCase().includes(e)||(t.description??"").toLowerCase().includes(e)||t.defaultBranch.toLowerCase().includes(e))},[ec,K]),eH=(0,n.useMemo)(()=>{let e=K.find(e=>e.httpsUrl===ep);return e||(H.trim()?K.find(e=>e.httpsUrl===H.trim())??null:null)},[H,K,ep]),eE=(0,n.useMemo)(()=>(function(e){let t=e.trim();if(!t)return null;let r=t.match(/^https?:\/\/github\.com\/([^/\s]+)\/([^/\s?#]+?)(?:\.git)?\/?$/i);if(r)return`https://github.com/${r[1]}/${r[2]}.git`;let a=t.match(/^git@github\.com:([^/\s]+)\/([^/\s]+?)(?:\.git)?$/i);return a?`https://github.com/${a[1]}/${a[2]}.git`:null})(ec),[ec]),eP=(0,n.useMemo)(()=>{let e;return(e=ec.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ec]),eR=(0,n.useMemo)(()=>W(eH?.updatedAt),[eH]),eM=(0,n.useMemo)(()=>{let e=eE??eP;return!!e&&e.toLowerCase()!==H.trim().toLowerCase()},[H,eE,eP]),eU="git"===m?H.trim().length>0:U.trim().length>0,e$=(0,n.useMemo)(()=>"git"===m?eH?.fullName??H.trim():I(U)??U.trim(),[H,U,m,eH]),eD=(0,n.useMemo)(()=>"git"===m?eH?.description?.trim()||H.trim():U.trim(),[H,U,m,eH]),eL=(0,n.useMemo)(()=>{let e=[...new Set(c)];0===e.length&&e.push(d||q);let t=new Map(P.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,E.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,E.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:z(e).localeCompare(z(r))})},[c,d]);(0,n.useEffect)(()=>{eL.includes(_)||T(eL[0]??q)},[_,eL]);let eF=async(e=!1)=>{er(!0),ed(null);try{let t=await fetch((0,M.S)(`/api/github/repos${e?"?refresh=true":""}`,v)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load GitHub repositories (${t.status})`);Q(Array.isArray(r?.repos)?r.repos:[])}catch(e){Q([]),ed(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{es(!0),er(!1)}};(0,n.useEffect)(()=>{!e||"git"!==m||et||ea||eF()},[ea,et,m,e]);let eB=async e=>{let t=e?.gitUrl??("git"===m?H.trim():""),r=e?.path??("local"===m?U.trim():"");if(0===t.length&&0===r.length)return void eS("git"===m?"Choose or paste a repository first.":"Select a local repository path first.");ew(!0),eS(null);try{let e=new URLSearchParams;t.length>0&&e.set("gitUrl",t),r.length>0&&e.set("path",r);let a=await fetch((0,M.S)(`/api/workspaces/branches?${e.toString()}`,v)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eN(l);let n="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??null;n&&(0===F.trim().length||!l.includes(F))&&B(n)}catch(e){eN([]),eS(e instanceof Error?e.message:"Failed to load branches")}finally{ew(!1)}},e_=async e=>{ev(e);let t=K.find(t=>t.httpsUrl===e);t&&(R(t.httpsUrl),ex(t.fullName),B(t.defaultBranch||"main"),S||C(G(t.name)||g),await eB({gitUrl:t.httpsUrl}),b("details"))},eT=async()=>{let e=eE??eP;if(!e)return;let t=K.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await e_(t.httpsUrl);if(ev(""),R(e),B("main"),eN([]),eS(null),!S){let t=function(e){let t=e.trim();if(!t)return null;let r=t.match(/^git@[^:]+:([^/]+)\/([^/\s]+?)(?:\.git)?$/i);if(r)return r[2]??null;try{let e=new URL(t).pathname.split("/").filter(Boolean).at(-1);return e?e.replace(/\.git$/i,""):null}catch{return null}}(e);t&&C(G(t))}await eB({gitUrl:e}),b("details")},eO=e=>{ek(e),eg(!0)},eq=e=>{u(e),b("source"),eN([]),eS(null)};if(!e)return null;let ez=eU&&F.trim().length>0;async function eG(e){if(e.preventDefault(),"details"!==h||!ez||o)return;let t="git"===m?{mode:m,projectId:g.trim()||void 0,agent:_,agentModel:eo(O)??"",agentReasoningEffort:ei(O)??"",defaultBranch:F.trim(),useWorktree:Z,gitUrl:H.trim(),path:D.trim()||void 0}:{mode:m,projectId:g.trim()||void 0,agent:_,agentModel:eo(O)??"",agentReasoningEffort:ei(O)??"",defaultBranch:F.trim(),useWorktree:Z,path:U.trim(),initializeGit:Y};await r(t)}return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[80] flex items-end justify-center overflow-y-auto bg-black/65 px-0 py-0 sm:items-center sm:px-3 sm:py-3",onClick:()=>{o||eb||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eG,onClick:e=>e.stopPropagation(),className:"flex h-dvh w-full max-w-none flex-col overflow-hidden rounded-none border-x-0 border-b-0 border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] shadow-[0_24px_80px_rgba(0,0,0,0.55)] sm:h-auto sm:max-h-[calc(100dvh-3rem)] sm:max-w-[860px] sm:rounded-[10px] sm:border",children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 backdrop-blur",children:[(0,a.jsx)("div",{className:"mb-3 flex justify-center sm:hidden",children:(0,a.jsx)("span",{className:"h-1 w-10 rounded-full bg-[color:color-mix(in_srgb,var(--vk-text-muted)_36%,transparent)]"})}),(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h2",{className:"text-[18px] leading-[22px] text-[var(--vk-text-strong)]",children:"Add Workspace"}),(0,a.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:"source"===h?"Step 1 of 2":"Step 2 of 2"})]}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:"source"===h?"Start with the repository or folder you want Conductor to manage.":"Confirm the defaults Conductor should use when this workspace is created."}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap items-center gap-2",children:[{id:"source",label:"git"===m?"Repository":"Folder"},{id:"details",label:"Defaults"}].map(e=>{let t=h===e.id,r="source"===e.id&&"details"===h&&eU;return(0,a.jsxs)("div",{className:`inline-flex items-center gap-2 rounded-full border px-3 py-1 text-[11px] ${t?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)] text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)("span",{className:`inline-flex h-4 w-4 items-center justify-center rounded-full border text-[10px] ${r?"border-[var(--vk-orange)] bg-[var(--vk-orange)] text-black":t?"border-[var(--vk-orange)] text-[var(--vk-text-strong)]":"border-[var(--vk-border)]"}`,children:r?(0,a.jsx)(f.A,{className:"h-3 w-3"}):"source"===e.id?"1":"2"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,"aria-label":"Close dialog",className:"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,a.jsx)(k.A,{className:"h-4 w-4"})})]})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-y-auto px-4 py-4 sm:px-5 sm:py-5",children:"source"===h?(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eq("git"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"git"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.uj0,{className:"h-[18px] w-[18px]"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"GitHub repository"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Search repos you already have access to, or paste a GitHub URL directly."})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eq("local"),className:`rounded-[10px] border px-4 py-4 text-left transition ${"local"===m?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_12%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsx)("p",{className:"mt-3 text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Local folder"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Point Conductor at a repository already on this machine."})]})]}),"git"===m?(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose repository"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Select a repo first. Branch, workspace name, and runtime defaults come next."})]}),(0,a.jsx)("button",{type:"button",onClick:()=>{es(!1),eF(!0)},disabled:et,className:"inline-flex h-9 items-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:et?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y.A,{className:"mr-1.5 h-3.5 w-3.5"}),"Refresh"]})})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(s.uj0,{className:"pointer-events-none absolute left-3 top-1/2 h-[16px] w-[16px] -translate-y-1/2 text-[var(--vk-text-muted)]"}),(0,a.jsx)("input",{value:ec,onChange:e=>ex(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eM&&(e.preventDefault(),eT())},placeholder:"Search GitHub repos or paste a repository URL",className:"h-11 w-full rounded-[8px] 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)]"})]}),eM?(0,a.jsxs)("button",{type:"button",onClick:()=>{eT()},className:"inline-flex w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2.5 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(s.SYR,{className:"h-4 w-4 text-[var(--vk-text-strong)]"}),(0,a.jsxs)("span",{className:"truncate",children:["Use ",eE?"this GitHub repository":"pasted repository URL"]})]}):null,et&&0===K.length?(0,a.jsx)("div",{className:"rounded-[8px] border border-[var(--vk-border)] px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading accessible GitHub repositories..."}):null,el?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-red)]/40 bg-[var(--vk-bg-panel)] px-3 py-3 text-[12px] text-[var(--vk-red)]",children:[(0,a.jsx)("p",{children:el}),(0,a.jsx)("button",{type:"button",onClick:()=>{es(!1),eF(!0)},className:"mt-2 inline-flex items-center rounded-[6px] 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,!el&&eA.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eA.map(e=>{let t=W(e.updatedAt),r=eH?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{e_(e.httpsUrl)},className:`flex w-full items-start gap-3 rounded-[8px] border px-3 py-3 text-left transition ${r?"border-[var(--vk-orange)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)]":"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)("span",{className:"mt-0.5 inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(s.SYR,{className:"h-4 w-4"})}),(0,a.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("span",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.fullName}),(0,a.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:[e.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),e.private?"Private":"Public"]}),(0,a.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,a.jsx)(s.C3c,{className:"h-3 w-3"}),e.defaultBranch]})]}),e.description?(0,a.jsx)("span",{className:"mt-1 block line-clamp-2 text-[12px] leading-[17px] text-[var(--vk-text-muted)]",children:e.description}):null,(0,a.jsxs)("span",{className:"mt-1 flex flex-wrap gap-x-3 gap-y-1 text-[11px] text-[var(--vk-text-muted)]",children:[e.ownerLogin?(0,a.jsx)("span",{children:e.ownerLogin}):null,t?(0,a.jsx)("span",{children:t}):null,e.permission?(0,a.jsx)("span",{children:e.permission.toLowerCase()}):null]})]}),(0,a.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 shrink-0 items-center justify-center text-[var(--vk-text-strong)]",children:r?(0,a.jsx)(f.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,et||el||0!==eA.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ec.trim().length>0?"No matching repositories. Try another search or paste a repository URL.":"No accessible GitHub repositories were found for this machine yet."})]}):(0,a.jsxs)("div",{className:"space-y-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"inline-flex h-10 w-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-strong)]",children:(0,a.jsx)(j.A,{className:"h-5 w-5"})}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[14px] font-medium text-[var(--vk-text-strong)]",children:"Choose folder"}),(0,a.jsx)("p",{className:"pt-0.5 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"Pick the repository folder already on disk. You can adjust branch and runtime defaults next."})]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>eO("local"),className:"inline-flex h-11 w-full items-center justify-center gap-2 rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,a.jsx)(j.A,{className:"h-4 w-4"}),U.trim().length>0?"Choose another folder":"Choose folder"]}),U.trim().length>0?(0,a.jsxs)("div",{className:"rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:[(0,a.jsx)("p",{className:"text-[12px] font-medium text-[var(--vk-text-strong)]",children:"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:U})]}):(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"The folder picker stays separate so you do not lose your place in this setup flow on mobile."})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsx)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"git"===m?"Selected repository":"Selected folder"}),(0,a.jsx)("p",{className:"mt-1 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:e$}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eD}),(0,a.jsx)("div",{className:"mt-2 flex flex-wrap gap-2",children:"git"===m?(0,a.jsxs)(a.Fragment,{children:[(0,a.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:[eH?.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),eH?eH.private?"Private":"Public":"Manual URL"]}),(0,a.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,a.jsx)(s.C3c,{className:"h-3 w-3"}),F||"main"]}),eH?.ownerLogin?(0,a.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:eH.ownerLogin}):null,eR?(0,a.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:eR}):null]}):(0,a.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:"Local repository"})})]}),(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),className:"inline-flex h-9 items-center justify-center rounded-[6px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:"Change"})]})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Workspace Name (optional)"}),(0,a.jsx)("input",{value:g,onChange:e=>{C(e.target.value),A(!0)},placeholder:"auto-derived from the selected repository or folder",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:F,onChange:e=>B(e.target.value),placeholder:"Uses the repository default branch",className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>{eB()},disabled:ey,className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",title:"Detect branches",children:ey?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),ej.length>0?(0,a.jsx)("select",{value:F,onChange:e=>B(e.target.value),className:"mt-2 h-9 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[12px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:ej.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,eC?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:eC}):null]})]}),(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:["Agent: ",z(_)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:Z?"Worktree isolation on":"Runs on selected branch"}),"local"===m?(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:Y?"Auto-init git if needed":"Do not init git"}):null]}),(0,l.Zz)(_)?(0,a.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("div",{className:"flex flex-col gap-1 sm:flex-row sm:items-end sm:justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Agent defaults"}),(0,a.jsx)("p",{className:"mt-0.5 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Choose the model and reasoning this workspace should inherit when sessions launch."})]})}),(0,a.jsx)("div",{className:"mt-3",children:(0,a.jsx)(em,{compact:!0,agent:_,modelAccess:x,runtimeModelCatalogs:p,selection:O,onChange:V})})]}):null,(0,a.jsxs)("details",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)]",children:[(0,a.jsx)("summary",{className:"cursor-pointer list-none px-3 py-3 text-[13px] text-[var(--vk-text-normal)] marker:hidden",children:(0,a.jsxs)("span",{className:"inline-flex items-center gap-2",children:[(0,a.jsx)(w.A,{className:"h-3.5 w-3.5 text-[var(--vk-text-muted)]"}),"Runtime and repository options"]})}),(0,a.jsxs)("div",{className:"space-y-3 border-t border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Agent"}),(0,a.jsx)("select",{value:_,onChange:e=>T(e.target.value),className:"h-10 w-full rounded-[8px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]",children:eL.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:z(e)},e))})]}),(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:Z,onChange:e=>J(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Keep work isolated in a new worktree",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Recommended. Turn this off only if sessions should run directly on the selected branch."})]})]})}),"local"===m?(0,a.jsx)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-3",children:(0,a.jsxs)("label",{className:"flex items-start gap-3 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsx)("input",{type:"checkbox",checked:Y,onChange:e=>X(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsxs)("span",{children:["Initialize git if this folder is not already a repository",(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-5 text-[var(--vk-text-muted)]",children:"Leave this on unless you know the folder should stay non-git."})]})]})}):(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] text-[var(--vk-text-muted)]",children:"Clone into a specific folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:D,readOnly:!0,onClick:()=>eO("clone"),placeholder:"Leave empty to use Conductor's default workspace location",className:"h-10 w-full cursor-pointer rounded-[8px] border border-[var(--vk-border)] bg-transparent px-3 text-[14px] text-[var(--vk-text-normal)] outline-none focus:border-[var(--vk-orange)]"}),(0,a.jsx)("button",{type:"button",onClick:()=>eO("clone"),className:"inline-flex h-10 items-center rounded-[8px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",title:"Browse folders",children:(0,a.jsx)(j.A,{className:"h-4 w-4"})})]})]})]})]}),i?(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-red)]",children:i}):null]})}),(0,a.jsx)("footer",{className:"border-t border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-bg-panel)_92%,transparent)] px-4 py-3 pb-[calc(0.75rem+env(safe-area-inset-bottom))] backdrop-blur",children:"source"===h?(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:t,disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Cancel"}),(0,a.jsx)("button",{type:"button",onClick:()=>{"local"!==m||eU?eU&&!o&&b("details"):eO("local")},disabled:"git"===m&&!eU||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"local"!==m||eU?"Continue":"Choose folder"})]}):(0,a.jsxs)("div",{className:"flex flex-col-reverse gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("button",{type:"button",onClick:()=>b("source"),disabled:o,className:"inline-flex h-10 items-center justify-center rounded-[8px] border border-[var(--vk-border)] px-4 text-[13px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:"Back"}),(0,a.jsx)("button",{type:"submit",disabled:!ez||o,className:"inline-flex h-10 items-center justify-center rounded-[8px] bg-[var(--vk-bg-active)] px-4 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:o?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Adding..."]}):"Add Workspace"})]})})]})}),(0,a.jsx)(eh,{open:eb,bridgeId:v,initialPath:"clone"===ef?D:U,title:"local"===ef?"Select Local Repository":"Select Clone Target Folder",description:"local"===ef?"Choose the local repository folder.":"Choose where the git repository should be cloned.",onClose:()=>eg(!1),onSelect:e=>{if(eg(!1),e){if("clone"===ef)return void L(e);if($(e),!S){let t=I(e);t&&C(G(t))}eB({path:e}),b("details")}}})]})}function eh({open:e,bridgeId:t,initialPath:r,title:s,description:l,onClose:o,onSelect:i}){let[d,c]=(0,n.useState)(""),[x,p]=(0,n.useState)(r??""),[v,m]=(0,n.useState)([]),[u,h]=(0,n.useState)(""),[b,g]=(0,n.useState)(!1),[f,k]=(0,n.useState)(null),[y,w]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!e)return;h(""),p(r??"");let a=r&&r.trim().length>0?r.trim():void 0,s=a?`?path=${encodeURIComponent(a)}`:"";g(!0),k(null),fetch((0,M.S)(`/api/filesystem/directory${s}`,t)).then(async e=>{let t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load directory (${e.status})`);c("string"==typeof t?.currentPath?t.currentPath:""),m(Array.isArray(t?.entries)?t.entries:[])}).catch(e=>{k(e instanceof Error?e.message:"Failed to load directory"),m([])}).finally(()=>{g(!1)})},[r,e]);let S=(0,n.useMemo)(()=>{if(0===u.trim().length)return v;let e=u.trim().toLowerCase();return v.filter(t=>t.name.toLowerCase().includes(e))},[v,u]),A=async e=>{g(!0),k(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,M.S)(`/api/filesystem/directory${r}`,t)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to load directory (${a.status})`);let l="string"==typeof s?.currentPath?s.currentPath:"";c(l),m(Array.isArray(s?.entries)?s.entries:[]),p(l)}catch(e){k(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},H=async()=>{w(!0);try{let e=await fetch((0,M.S)("/api/filesystem/pick-directory",t),{method:"POST"}),r=await e.json().catch(()=>null);if(!r||r.cancelled||!r.path)return;p(r.path),A(r.path)}catch{}finally{w(!1)}};return e?(0,a.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:()=>{o(),i(null)},role:"presentation",children:(0,a.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:e=>e.stopPropagation(),children:[(0,a.jsxs)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("h3",{className:"text-[16px] text-[var(--vk-text-strong)]",children:s}),(0,a.jsx)("p",{className:"pt-1 text-[12px] text-[var(--vk-text-muted)]",children:l})]}),(0,a.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-3 px-4 py-3",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("input",{value:x,onChange:e=>p(e.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,a.jsx)("button",{type:"button",onClick:()=>{A(x)},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,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{A()},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,a.jsx)("button",{type:"button",onClick:()=>{if(!d)return;let e=d.replace(/\\/g,"/");if(/^[A-Za-z]:\/?$/.test(d)||"/"===e)return;let t=e.split("/").filter(Boolean),r=d.match(/^([A-Za-z]):[/\\]/);A(r?t.length>1?`${r[1]}:/${t.slice(1,-1).join("/")}`:`${r[1]}:/`:t.length>1?`/${t.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,a.jsxs)("button",{type:"button",disabled:y,onClick:()=>{H()},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:[y?(0,a.jsx)(N.A,{className:"h-3 w-3 animate-spin"}):(0,a.jsx)(j.A,{className:"h-3 w-3"}),y?"Opening...":"Browse"]}),(0,a.jsx)("div",{className:"truncate text-[12px] text-[var(--vk-text-muted)]",children:d||"Home"})]}),(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsx)(C.A,{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,a.jsx)("input",{value:u,onChange:e=>h(e.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,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto rounded-[4px] border border-[var(--vk-border)]",children:b?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"Loading..."}):f?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:f}):0===S.length?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-text-muted)]",children:"No folders found."}):(0,a.jsx)("div",{className:"p-1",children:S.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{e.isDirectory&&A(e.path)},className:`mb-1 flex w-full items-center gap-2 rounded-[4px] px-2 py-2 text-left text-[12px] ${e.isDirectory?"text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]":"cursor-default text-[var(--vk-text-muted)]"}`,children:[(0,a.jsx)(j.A,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"truncate",children:e.name}),e.isGitRepo&&(0,a.jsx)("span",{className:"ml-auto rounded-[999px] border border-[var(--vk-border)] px-1.5 py-0.5 text-[10px]",children:"git"})]},e.path))})})]}),(0,a.jsxs)("footer",{className:"flex items-center justify-end gap-2 border-t border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{o(),i(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,a.jsx)("button",{type:"button",onClick:()=>{let e=x.trim().length>0?x.trim():d;o(),i(e||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 eb({value:e,idleLabel:t="Copy",copiedLabel:r="Copied"}){let[s,l]=(0,n.useState)(!1);async function o(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1400)}return(0,a.jsxs)("button",{type:"button",onClick:()=>void o(),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:[s?(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"}):(0,a.jsx)(S.A,{className:"h-3.5 w-3.5"}),(0,a.jsx)("span",{children:s?r:t})]})}function eg({open:e,mode:t,creating:r,error:s,current:o,projectCount:i,agentOptions:d,agentStates:c,runtimeModelCatalogs:x,onRepositoriesChanged:p,onOnboardingComplete:v,onOpenAgentSetup:m,onClose:u,onSave:h,bridgeId:b}){var g,w;let C,[S,$]=(0,n.useState)("preferences"),[D,L]=(0,n.useState)(o.codingAgent),[F,B]=(0,n.useState)(o.ide),[_,O]=(0,n.useState)(o.markdownEditor),[G,I]=(0,n.useState)(o.markdownEditorPath??""),[W,X]=(0,n.useState)(o.modelAccess),[K,et]=(0,n.useState)(o.notifications.soundEnabled),[er,es]=(0,n.useState)(o.notifications.soundFile),[el,ec]=(0,n.useState)([]),[ep,eu]=(0,n.useState)(!1),[ef,ek]=(0,n.useState)(!1),[ej,eN]=(0,n.useState)(null),[ey,ew]=(0,n.useState)(""),[eC,eS]=(0,n.useState)(null),[eA,eH]=(0,n.useState)(ee()),[eE,eP]=(0,n.useState)([]),[eR,eM]=(0,n.useState)(!1),[eU,e$]=(0,n.useState)(null),[eD,eL]=(0,n.useState)(!1),[eF,eB]=(0,n.useState)(!1),[e_,eT]=(0,n.useState)(()=>Q(null)),[eO,eq]=(0,n.useState)(!1),[ez,eG]=(0,n.useState)(!1),[eI,eW]=(0,n.useState)(null),[eV,eZ]=(0,n.useState)(null),[eJ,eY]=(0,n.useState)(!1),[eX,eK]=(0,n.useState)(null),eQ=r||ef||ez;function e0(e){return{...e,agentPermissions:"default"===e.agentPermissions?"default":"skip",devServerScript:e.devServerScript??"",devServerCwd:e.devServerCwd??"",devServerUrl:e.devServerUrl??"",devServerPort:e.devServerPort??"",devServerHost:e.devServerHost??"",devServerPath:e.devServerPath??"",devServerHttps:!0===e.devServerHttps,pathHealth:{exists:e.pathHealth.exists,isGitRepository:e.pathHealth.isGitRepository,suggestedPath:e.pathHealth.suggestedPath}}}function e1(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function e2(e){eu(!0),eN(null);try{let t=await fetch((0,M.S)("/api/repositories",b)),r=await t.json().catch(()=>null);if(!t.ok)throw Error(r?.error??`Failed to load repositories (${t.status})`);let a=Array.isArray(r?.repositories)?r.repositories:[];ec(a);let s=a[0]?.id??"",l=e&&a.some(t=>t.id===e)?e:ey&&a.some(e=>e.id===ey)?ey:s;ew(l)}catch(e){ec([]),ew(""),eS(null),eH(ee()),eN(e instanceof Error?e.message:"Failed to load repositories")}finally{eu(!1)}}async function e3(e,t){let r=(e??eC?.path??"").trim();if(0===r.length){e$("Select a repository path first."),eP([]);return}eM(!0),e$(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,M.S)(`/api/workspaces/branches?${e.toString()}`,b)),s=await a.json().catch(()=>null);if(!a.ok)throw Error(s?.error??`Failed to detect branches (${a.status})`);let l=Array.isArray(s?.branches)?s.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[];eP(l);let n=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??"");if(!n)return;eS(e=>!e||e.defaultBranch.trim().length>0&&l.includes(e.defaultBranch)?e:{...e,defaultBranch:n})}catch(e){eP([]),e$(e instanceof Error?e.message:"Failed to detect branches")}finally{eM(!1)}}async function e4(){if(!eC||ef||0===eC.repo.trim().length||0===eC.path.trim().length)return!1;ek(!0),eN(null);try{let e=await fetch((0,M.S)("/api/repositories",b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:eC.id,displayName:eC.displayName,repo:eC.repo,path:eC.path,agent:eC.agent,agentPermissions:eC.agentPermissions,agentModel:eo(eA)??"",agentReasoningEffort:ei(eA)??"",defaultWorkingDirectory:eC.defaultWorkingDirectory,defaultBranch:eC.defaultBranch,devServerScript:eC.devServerScript,devServerCwd:eC.devServerCwd,devServerUrl:eC.devServerUrl,devServerPort:eC.devServerPort,devServerHost:eC.devServerHost,devServerPath:eC.devServerPath,devServerHttps:eC.devServerHttps,setupScript:eC.setupScript,runSetupInParallel:eC.runSetupInParallel,cleanupScript:eC.cleanupScript,archiveScript:eC.archiveScript,copyFiles:eC.copyFiles})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save repository settings (${e.status})`);let r=t?.repository;if(!r)throw Error("Repository saved but response is missing repository data");return ec(e=>e.map(e=>e.id===r.id?r:e)),eS(e0(r)),ew(r.id),e$(null),await e3(r.path,r.defaultBranch),p&&await p(),!0}catch(e){return eN(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{ek(!1)}}async function e5(){eq(!0),eW(null);try{let e=await fetch("/api/access"),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load organization settings (${e.status})`);eT(Q(t?.access,t?.current))}catch(e){eT(Q(null)),eW(e instanceof Error?e.message:"Failed to load organization settings")}finally{eq(!1)}}async function e9(){eY(!0),eK(null);try{let e=await fetch("/api/auth/profile",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){let r=t&&"object"==typeof t&&"error"in t&&"string"==typeof t.error?t.error:`Failed to load profile (${e.status})`;throw Error(r)}eZ(t)}catch(e){eZ(null),eK(e instanceof Error?e.message:"Failed to load profile")}finally{eY(!1)}}async function e8(){if(ez)return!1;eG(!0),eW(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:e_.requireAuth||e_.trustedHeaders.enabled,defaultRole:e_.defaultRole,trustedHeaders:{enabled:e_.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:e_.trustedHeaders.emailHeader,jwtHeader:e_.trustedHeaders.jwtHeader,teamDomain:e_.trustedHeaders.teamDomain,audience:e_.trustedHeaders.audience},roles:{viewers:e1(e_.roles.viewers),operators:e1(e_.roles.operators),admins:e1(e_.roles.admins),viewerDomains:e1(e_.roles.viewerDomains),operatorDomains:e1(e_.roles.operatorDomains),adminDomains:e1(e_.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eT(Q(t?.access,t?.current)),!0}catch(e){return eW(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{eG(!1)}}(0,n.useEffect)(()=>{e&&($("onboarding"===t?"preferences":"general"),L(o.codingAgent),B(o.ide),O(o.markdownEditor),I(o.markdownEditorPath??""),X(o.modelAccess),et(o.notifications.soundEnabled),es(o.notifications.soundFile),eP([]),e$(null),eN(null),eH(ee()),eW(null),eZ(null),eK(null))},[t,e]),(0,n.useEffect)(()=>{e&&("settings"===t||"repositories"===S)&&e2()},[S,t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&e5()},[t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===S&&e9()},[S,t,e]),(0,n.useEffect)(()=>{if(!e)return;if(!ey){eS(null),eH(ee());return}let t=el.find(e=>e.id===ey);t&&(eS(e0(t)),eH(en(t.agent,W,x,t.agentModel,t.agentReasoningEffort)),eP([]),e$(null),t.path.trim().length>0&&e3(t.path,t.defaultBranch))},[W,e,el,x,ey]);let e6="onboarding"===t&&i>0,e7=(0,n.useMemo)(()=>"onboarding"===t?e6?Z:Z.filter(e=>"preferences"===e.id):V.filter(e=>e.implemented),[t,e6]),te=e7.find(e=>e.id===S)??e7[0]??V[0],tt="onboarding"===t,tr="preferences"===te.id,ta="profile"===te.id,ts="general"===te.id,tl="agents"===te.id,tn=tr||ts||tl,to="repositories"===te.id,ti="organization"===te.id,td=e7.findIndex(e=>e.id===te.id)+1,tc=e7.some(e=>"repositories"===e.id),tx="admin"===e_.current.role,tp=(0,n.useMemo)(()=>{let e=new Set(d);D.trim().length>0&&e.add(D),0===e.size&&e.add(q);let t=new Map(P.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,E.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,E.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:z(e).localeCompare(z(r))})},[d,D]),tv=c[(0,E.q)(D)]??null;if(!e)return null;let tm=D.trim().length>0&&F.trim().length>0&&_.trim().length>0,tu=!!eC&&eC.displayName.trim().length>0&&eC.repo.trim().length>0&&eC.path.trim().length>0&&eC.defaultBranch.trim().length>0,th=tx&&!eO&&(!e_.trustedHeaders.enabled||e_.trustedHeaders.teamDomain.trim().length>0&&e_.trustedHeaders.audience.trim().length>0),tb=to?ej:ti?eI:ta?eX:s,tg=eC?(g={...eC,agentModel:eo(eA)??"",agentReasoningEffort:ei(eA)??""},w={ide:F,markdownEditor:_},C=["npx conductor-oss@latest setup","--yes",`--path ${ex(g.path)}`,`--project-id ${ex(g.id)}`,`--display-name ${ex(g.displayName)}`,`--agent ${ex(g.agent||"claude-code")}`,`--ide ${ex(w.ide)}`,`--markdown-editor ${ex(w.markdownEditor)}`],g.repo.trim().length>0&&C.push(`--repo ${ex(g.repo.trim())}`),g.defaultBranch.trim().length>0&&C.push(`--default-branch ${ex(g.defaultBranch.trim())}`),g.agentModel.trim().length>0&&C.push(`--model ${ex(g.agentModel.trim())}`),g.agentReasoningEffort.trim().length>0&&C.push(`--reasoning-effort ${ex(g.agentReasoningEffort.trim())}`),g.defaultWorkingDirectory.trim().length>0&&C.push(`--default-working-directory ${ex(g.defaultWorkingDirectory.trim())}`),C.join(" ")):"";async function tf(e,t){let a;if(!tm||r)return!1;let s=await h((a=K?er??Y[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!e||o.onboardingAcknowledged,codingAgent:D.trim(),ide:F.trim(),markdownEditor:_.trim(),markdownEditorPath:(G??"").trim(),modelAccess:W,notifications:{soundEnabled:K,soundFile:a}}),t);return s&&tv&&!tv.ready&&m(D),s}async function tk(){if(!ep){if(!tc){if(!await tf(!0,{closeDialog:!0}))return;v?.({needsProject:0===i});return}await tf(!1,{closeDialog:!1})&&$("repositories")}}async function tj(){(!to||await e4())&&await tf(!0,{closeDialog:!0})&&v?.({needsProject:!1})}return(0,a.jsxs)(a.Fragment,{children:[(0,a.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:()=>{eQ||"onboarding"===t||eD||eF||u()},role:"presentation",children:(0,a.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:e=>e.stopPropagation(),children:[(0,a.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,a.jsx)("header",{className:"border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:(0,a.jsx)("h2",{className:"text-[22px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?"Setup":"Settings"})}),(0,a.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:e7.map(e=>{let t=e.icon,r=te.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>$(e.id),disabled:eQ,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 ${r?"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,a.jsx)(t,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{children:e.label})]},e.id)})})]}),(0,a.jsxs)("div",{className:"flex min-h-0 min-w-0 flex-1 flex-col",children:[(0,a.jsxs)("header",{className:"flex items-center justify-between border-b border-[var(--vk-border)] px-4 py-3 sm:py-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-[20px] leading-[24px] text-[var(--vk-text-strong)] sm:text-[27px] sm:leading-[27px]",children:tt?tr?"Choose your preferences":"Review repository defaults":te.label}),tt&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",td," of ",e7.length]})]}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ||"onboarding"===t,"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,a.jsx)(k.A,{className:"h-4 w-4"})})]}),(0,a.jsx)("div",{className:"min-h-0 flex-1 overflow-auto px-4 py-3 sm:px-6 sm:py-4",children:tn?(0,a.jsxs)("div",{className:"space-y-5",children:[tt&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.08)] px-4 py-3",children:(0,a.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."})}),(tr||tl)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Choose Your Coding Agent"}),(0,a.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,a.jsx)("div",{className:"grid gap-3",children:tp.map(e=>{let t=D===e,r=c[(0,E.q)(e)]??null,s=ed(e,W),n=ea(e,W,x),o=n.slice(0,3),i=n.length-o.length,d=r?.installed?r.ready?"Ready":"Setup required":"Not installed";return(0,a.jsxs)("div",{className:`flex flex-col gap-3 rounded-[4px] border px-3 py-3 text-left sm:flex-row sm:items-start ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[(0,a.jsx)(R.N,{seed:{label:e},className:"mt-0.5 h-5 w-5 border-none bg-transparent"}),(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"text-[13px] font-medium text-[var(--vk-text-normal)]",children:z(e)}),(0,a.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:d}),s?(0,a.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:s}):null]}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:r?.description??(0,P.h7)(e)?.description??"Agent metadata not available."}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap gap-1.5",children:[o.map(t=>(0,a.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:t.label},`${e}-${t.id}`)),i>0?(0,a.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:["+",i," more"]}):null,0===o.length?(0,a.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,l.Zz)(e)?"Models appear after setup":"Uses the agent default model"}):null]}),!r?.installed&&r?.installHint?(0,a.jsxs)("p",{className:"mt-2 text-[11px] text-[var(--vk-text-muted)]",children:["Install hint: ",(0,a.jsx)("code",{className:"rounded bg-[var(--vk-bg-main)] px-1.5 py-0.5 text-[11px] text-[var(--vk-text-normal)]",children:r.installHint})]}):null]})]}),(0,a.jsxs)("div",{className:"flex shrink-0 items-center gap-2 self-start sm:ml-auto",children:[r?.ready?null:(0,a.jsx)("button",{type:"button",onClick:()=>{L(e),m(e)},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:r?.installed?"Authenticate":"Install"}),(0,a.jsx)("button",{type:"button",onClick:()=>L(e),className:`inline-flex h-8 items-center rounded-[4px] border px-3 text-[12px] ${t?"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:t?"Selected":"Use this agent"}),t&&(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]},e)})})]}),(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Model Access"}),(0,a.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,a.jsx)("div",{className:"grid gap-3",children:tp.filter(e=>{let t=(0,l.yM)(e);return(0,l.Zz)(e)&&(t?.accessOptions.length??0)>1}).map(e=>{let t=(0,l.yM)(e);if(!t)return null;let r=(0,l.Tk)(e,W)??t.defaultAccess;return(0,a.jsxs)("label",{className:"block rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:[(0,a.jsx)("span",{className:"mb-1 block text-[13px] font-medium text-[var(--vk-text-normal)]",children:t.label}),(0,a.jsx)("select",{value:r,onChange:t=>{var r;let a;return r=t.target.value,void((a=(0,l.yM)(e))&&X(e=>({...e,[a.accessKey]:r})))},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:t.accessOptions.map(e=>(0,a.jsx)("option",{value:e.id,children:e.label},e.id))}),(0,a.jsx)("p",{className:"mt-1.5 text-[11px] text-[var(--vk-text-muted)]",children:t.accessOptions.find(e=>e.id===r)?.description})]},e)})})]})]}),(tr||ts)&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Markdown Editor"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Used as your second-brain markdown source when feeding context into tasks."}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2",children:J.map(e=>{let t=_===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>O(e.id),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(ev,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)})}),"notion"!==_&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Notes Root"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:G??"",readOnly:!0,onClick:()=>eB(!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,a.jsx)("button",{type:"button",onClick:()=>eB(!0),disabled:eQ,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,a.jsx)(j.A,{className:"h-4 w-4"})}),(G??"").trim().length>0&&(0,a.jsx)("button",{type:"button",onClick:()=>I(""),disabled:eQ,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,a.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,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Notification Sound"}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Pick a sound for notifications, or disable sound."}),(0,a.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[Y.map(e=>{let t=K&&er===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{et(!0),es(e.id),(0,U.$E)(e.id)},className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${t?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>et(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!K?"border-[var(--vk-orange)] bg-[var(--vk-bg-hover)]":"border-[var(--vk-border)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,a.jsx)(H,{className:"h-4 w-4 text-[var(--vk-text-muted)]"}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:"No sound"}),!K&&(0,a.jsx)(f.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):ta?(0,a.jsx)(T,{profile:eV,loading:eJ,error:eX,onRefresh:()=>{e9()}}):to?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"space-y-1",children:[(0,a.jsx)("h4",{className:"text-[24px] leading-[24px] text-[var(--vk-text-strong)]",children:tt?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:tt?"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"===t||el.length>1)&&(0,a.jsxs)("section",{className:"space-y-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Select Repository"}),(0,a.jsxs)("select",{value:ey,onChange:e=>ew(e.target.value),disabled:ep||0===el.length||eQ,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===el.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),el.map(e=>(0,a.jsx)("option",{value:e.id,children:e.displayName},e.id))]})]}),(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Select a repository to view and edit its configuration."}),ep&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),tt&&1===el.length&&eC&&(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Detected Repository"}),(0,a.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:[eC.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:eC.path})]})]}),eC&&(0,a.jsxs)(a.Fragment,{children:["settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Repo-Preseed Bootstrap"}),(0,a.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,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-[11px] text-[var(--vk-text-muted)]",children:[(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Workspace: ",eC.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",eC.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",eC.scmMode]})]}),(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[rgba(15,15,15,0.72)] p-3",children:(0,a.jsx)("pre",{className:"overflow-x-auto whitespace-pre-wrap break-all text-[12px] leading-5 text-[var(--vk-text-normal)]",children:tg})}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.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,a.jsx)(eb,{value:tg,idleLabel:"Copy Setup Command"})]})]}),(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"General Settings"}),(0,a.jsx)("p",{className:"text-[13px] text-[var(--vk-text-muted)]",children:"Configure basic repository information."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Display Name"}),(0,a.jsx)("input",{value:eC.displayName,onChange:e=>eS(t=>t?{...t,displayName:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"A friendly name for this repository."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Slug"}),(0,a.jsx)("input",{value:eC.repo,onChange:e=>eS(t=>t?{...t,repo:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Used for PR tracking, GitHub links, and onboarding defaults."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Agent"}),(0,a.jsx)("select",{value:eC.agent,onChange:e=>{let t=e.target.value;eS(e=>e?{...e,agent:t}:e),eH(en(t,W,x,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:tp.map(e=>(0,a.jsx)("option",{value:e,children:z(e)},e))}),(0,a.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,l.Zz)(eC.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(em,{agent:eC.agent,modelAccess:W,runtimeModelCatalogs:x,selection:eA,onChange:eH})}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Agent Permission Default"}),(0,a.jsxs)("select",{value:eC.agentPermissions,onChange:e=>eS(t=>t?{...t,agentPermissions:"default"===e.target.value?"default":"skip"}:t),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,a.jsx)("option",{value:"skip",children:"Auto approve and allow local dev servers"}),(0,a.jsx)("option",{value:"default",children:"Sandboxed default mode"})]}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Repository Path"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eC.path,readOnly:!0,onClick:()=>eL(!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,a.jsx)("button",{type:"button",onClick:()=>eL(!0),disabled:eQ,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,a.jsx)(j.A,{className:"h-4 w-4"})})]}),!eC.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),eC.pathHealth.exists&&!eC.pathHealth.isGitRepository&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path exists but is not a git repository."}),eC.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=eC.pathHealth.suggestedPath??"";e&&(eS(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))},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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Working Directory"}),(0,a.jsx)("input",{value:eC.defaultWorkingDirectory,onChange:e=>eS(t=>t?{...t,defaultWorkingDirectory:e.target.value}:t),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,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Target Branch"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:eC.defaultBranch,onChange:e=>eS(t=>t?{...t,defaultBranch:e.target.value}:t),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,a.jsx)("button",{type:"button",onClick:()=>{e3()},disabled:eR,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:eR?(0,a.jsx)(N.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(y.A,{className:"h-3.5 w-3.5"})})]}),eE.length>0&&(0,a.jsx)("select",{value:eC.defaultBranch,onChange:e=>eS(t=>t?{...t,defaultBranch:e.target.value}:t),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:eE.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eU&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eU})]})]}),"settings"===t&&(0,a.jsxs)("section",{className:"space-y-3 border-t border-[var(--vk-border)] pt-4",children:[(0,a.jsx)("h5",{className:"text-[22px] leading-[22px] text-[var(--vk-text-strong)]",children:"Scripts & Configuration"}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server Script"}),(0,a.jsx)("textarea",{rows:3,value:eC.devServerScript,onChange:e=>eS(t=>t?{...t,devServerScript:e.target.value}:t),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,a.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,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Dev Server CWD"}),(0,a.jsx)("input",{value:eC.devServerCwd,onChange:e=>eS(t=>t?{...t,devServerCwd:e.target.value}:t),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,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:"Runs the dev server from this subdirectory when set."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview URL Override"}),(0,a.jsx)("input",{value:eC.devServerUrl,onChange:e=>eS(t=>t?{...t,devServerUrl:e.target.value}:t),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,a.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,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-4",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Port"}),(0,a.jsx)("input",{value:eC.devServerPort,onChange:e=>eS(t=>t?{...t,devServerPort:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Host"}),(0,a.jsx)("input",{value:eC.devServerHost,onChange:e=>eS(t=>t?{...t,devServerHost:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Preview Path"}),(0,a.jsx)("input",{value:eC.devServerPath,onChange:e=>eS(t=>t?{...t,devServerPath:e.target.value}:t),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,a.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,a.jsx)("input",{type:"checkbox",checked:eC.devServerHttps,onChange:e=>eS(t=>t?{...t,devServerHttps:e.target.checked}:t),className:"h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Use HTTPS"})]})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Setup Script"}),(0,a.jsx)("textarea",{rows:4,value:eC.setupScript,onChange:e=>eS(t=>t?{...t,setupScript:e.target.value}:t),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,a.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,a.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,a.jsx)("input",{type:"checkbox",checked:eC.runSetupInParallel,onChange:e=>eS(t=>t?{...t,runSetupInParallel:e.target.checked}:t),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Run setup script in parallel with coding agent"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cleanup Script"}),(0,a.jsx)("textarea",{rows:4,value:eC.cleanupScript,onChange:e=>eS(t=>t?{...t,cleanupScript:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Archive Script"}),(0,a.jsx)("textarea",{rows:4,value:eC.archiveScript,onChange:e=>eS(t=>t?{...t,archiveScript:e.target.value}:t),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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Copy Files"}),(0,a.jsx)("input",{value:eC.copyFiles,onChange:e=>eS(t=>t?{...t,copyFiles:e.target.value}:t),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,a.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."})]})]})]})]}):ti?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(234,122,42,0.06)] px-4 py-3",children:[(0,a.jsx)("h4",{className:"text-[15px] font-medium text-[var(--vk-text-strong)]",children:"Access Control"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"The dashboard stays bound to localhost by default. If you need access beyond the local machine, put a verified identity layer like Cloudflare Access or Clerk in front of it, then map authenticated users into viewer, operator, or admin roles here."})]}),eO?(0,a.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,a.jsx)(N.A,{className:"h-4 w-4 animate-spin"}),"Loading organization access settings..."]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("section",{className:"grid gap-3 lg:grid-cols-3",children:[(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Current Identity"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.email??"Anonymous local session"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Effective Role"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.role??"No access"})]}),(0,a.jsxs)("div",{className:"rounded-[6px] border border-[var(--vk-border)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Auth Provider"}),(0,a.jsx)("p",{className:"mt-2 text-[14px] text-[var(--vk-text-normal)]",children:e_.current.provider??"Local only"})]})]}),!tx&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[rgba(80,80,80,0.18)] px-4 py-3",children:(0,a.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,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Baseline Access Rules"}),(0,a.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,a.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,a.jsx)("input",{type:"checkbox",checked:e_.requireAuth,onChange:e=>eT(t=>({...t,requireAuth:e.target.checked})),disabled:!tx||ez||e_.trustedHeaders.enabled,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Require authentication for remote dashboard requests"})]}),(0,a.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:"Unauthenticated public dashboard access is not supported. Use a verified identity provider such as Cloudflare Access or Clerk before exposing the dashboard beyond localhost."}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Default Role"}),(0,a.jsxs)("select",{value:e_.defaultRole,onChange:e=>eT(t=>({...t,defaultRole:e.target.value})),disabled:!tx||ez,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,a.jsx)("option",{value:"viewer",children:"Viewer"}),(0,a.jsx)("option",{value:"operator",children:"Operator"}),(0,a.jsx)("option",{value:"admin",children:"Admin"})]}),(0,a.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,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Verified Edge Auth"}),(0,a.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,a.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,a.jsx)("input",{type:"checkbox",checked:e_.trustedHeaders.enabled,onChange:e=>eT(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!tx||ez,className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,a.jsx)("span",{children:"Enable verified Cloudflare Access authentication"})]}),(0,a.jsxs)("div",{className:"grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Provider"}),(0,a.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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Identity Email Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.emailHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!tx||ez,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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"JWT Assertion Header"}),(0,a.jsx)("input",{value:e_.trustedHeaders.jwtHeader,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!tx||ez,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,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Team Domain"}),(0,a.jsx)("input",{value:e_.trustedHeaders.teamDomain,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!tx||ez,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,a.jsxs)("label",{className:"block lg:col-span-2",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:"Cloudflare Access Audience"}),(0,a.jsx)("input",{value:e_.trustedHeaders.audience,onChange:e=>eT(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!tx||ez,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,a.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:"Verified public dashboard access requires a Cloudflare Access application that injects a signed JWT and identity email header. Conductor will not trust a public request path when that verification layer is missing."})]}),(0,a.jsxs)("section",{className:"space-y-3 rounded-[6px] border border-[var(--vk-border)] px-4 py-4",children:[(0,a.jsxs)("div",{className:"space-y-1",children:[(0,a.jsx)("h5",{className:"text-[18px] leading-[20px] text-[var(--vk-text-strong)]",children:"Role Bindings"}),(0,a.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,a.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:e,key:t,placeholder:r})=>(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1.5 block text-[12px] font-medium text-[var(--vk-text-normal)]",children:e}),(0,a.jsx)("textarea",{rows:4,value:e_.roles[t],onChange:e=>eT(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!tx||ez,placeholder:r,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,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:"One entry per line."})]},t))})]})]})]}):(0,a.jsxs)("section",{className:"space-y-3",children:[(0,a.jsx)("h4",{className:"text-[16px] font-medium text-[var(--vk-text-strong)]",children:te.label}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:"This section is queued for implementation. General, Agents, and repository settings are available now."}),(0,a.jsx)("button",{type:"button",onClick:()=>$("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,a.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,a.jsxs)("div",{className:"min-w-0",children:[tb&&(0,a.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:tb}),!tb&&tn&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tb&&to&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:tt?"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."}),!tb&&ti&&(0,a.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."}),!tb&&ta&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:"Profile details reflect the current dashboard identity. GitHub avatar and logout controls appear when this session is authenticated through Clerk."})]}),(0,a.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-end gap-2 sm:w-auto",children:[!tt&&(0,a.jsx)("button",{type:"button",onClick:u,disabled:eQ,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"}),tt&&to&&(0,a.jsx)("button",{type:"button",onClick:()=>$("preferences"),disabled:eQ,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"}),tn&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tf(o.onboardingAcknowledged,{closeDialog:!0})},disabled:!tm||r,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:r?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save"}),to&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e4()},disabled:!tu||ef||ep,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:ef?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Repository"}),ti&&!tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{e8()},disabled:!th||ez,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:ez?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),"Saving..."]}):"Save Access"}),tt&&(0,a.jsx)("button",{type:"button",onClick:()=>{tr?tk():tj()},disabled:tr?!tm||r||ep:!tu||eQ,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:eQ||tr&&ep?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),tr&&ep?"Loading...":"Saving..."]}):tr&&tc?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(eh,{open:eD,bridgeId:b,initialPath:eC?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eL(!1),onSelect:e=>{eL(!1),e&&(eS(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),e3(e))}}),(0,a.jsx)(eh,{open:eF,bridgeId:b,initialPath:G??"",title:"Select Notes Root",description:"Choose the local Obsidian vault, Logseq graph, or markdown notes folder used for context attachments.",onClose:()=>eB(!1),onSelect:e=>{eB(!1),null!==e&&I(e)}})]})}}}]);
@@ -1,2 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7720],{10926:(e,t,r)=>{r.d(t,{C0:()=>a,DW:()=>i});let n="bridge:";function a(e){let t=e?.trim();return t&&t.length>0?t:null}function i(e){let t=e?.trim();if(!t||!t.startsWith(n))return null;let r=t.slice(n.length),i=r.indexOf(":");if(i<=0||i>=r.length-1)return null;let s=a(r.slice(0,i)),d=r.slice(i+1).trim();return s&&0!==d.length?{bridgeId:s,sessionId:d}:null}},11984:(e,t,r)=>{function n(e){let t=e?.trim().toLowerCase()??"";return!!t&&(t.includes("127.0.0.1:4749")||t.includes("older bridge build")||t.includes("one-time local bridge upgrade"))}function a(e){return`This laptop needs a one-time local bridge upgrade before ${function(e){switch(e){case"repair":return"Repair bridge";case"restart":return"Restart service";case"update":return"Update Conductor"}}(e)} can run from the dashboard.`}function i(e){let t=e?.trim()||"This laptop";return`${t} is still on an older bridge build, so Conductor cannot repair, restart, or update it remotely yet. Upgrade the bridge once on that laptop, then future fixes run from the dashboard.`}r.d(t,{Az:()=>n,IG:()=>a,_5:()=>i})},15115:(e,t,r)=>{function n(e,t){return"string"==typeof e&&e.trim().length>0?e.trim():t}function a(e){let t="string"==typeof e?e.trim():"";return t?` (build ${t})`:""}function i(e){return Array.isArray(e)?e.filter(e=>!!e&&"object"==typeof e).map(e=>{let t,r,a;return t=n(e.hostname,"unknown-host"),r=n(e.os,"unknown-os"),a=n(e.arch,"unknown-arch"),{device_id:n(e.device_id,t),device_name:n(e.device_name,t),hostname:t,os:r,arch:a,connected:!0===e.connected,last_status:e.last_status?{hostname:n(e.last_status.hostname,t),os:n(e.last_status.os,r),connected:!0===e.last_status.connected,version:"string"==typeof e.last_status.version&&e.last_status.version.trim().length>0?e.last_status.version.trim():null}:null}}):[]}r.d(t,{oH:()=>i,wj:()=>a})},15321:(e,t,r)=>{r.d(t,{i:()=>m});var n=r(54568),a=r(7620),i=r(65587),s=r.n(i),d=r(63322),o=r(59706),l=r(87242),c=r(76081),u=r(46916),v=r(11984),p=r(61369);function m({deviceId:e,deviceName:t,dashboardUrl:r,installScriptUrl:i,relayUrl:h,className:g}){let[x,b]=(0,a.useState)(!1),f=(0,a.useMemo)(()=>(0,p.$y)(i,r,h),[r,i,h]),k=(0,a.useMemo)(()=>(0,p.kw)(e),[e]);return(0,n.jsxs)("div",{className:(0,u.cn)("mt-3 rounded-[14px] border border-[color:color-mix(in_srgb,var(--vk-orange)_28%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-orange)_10%,transparent)] px-3 py-3",g),children:[(0,n.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-[0.18em] text-[var(--vk-text-muted)]",children:"One-time local repair"}),(0,n.jsx)("div",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-normal)]",children:(0,v._5)(t)}),(0,n.jsxs)("div",{className:"mt-3 flex flex-wrap gap-2",children:[(0,n.jsxs)(c.$,{type:"button",variant:"outline",size:"sm",onClick:()=>{navigator.clipboard?.writeText?(b(!1),navigator.clipboard.writeText(f).then(()=>{b(!0)}).catch(()=>{b(!1)})):b(!1)},children:[x?(0,n.jsx)(d.A,{className:"h-4 w-4"}):(0,n.jsx)(o.A,{className:"h-4 w-4"}),x?"Repair command copied":"Copy repair command"]}),(0,n.jsx)(c.$,{asChild:!0,variant:"outline",size:"sm",children:(0,n.jsxs)(s(),{href:k,children:[(0,n.jsx)(l.A,{className:"h-4 w-4"}),"Open repair steps"]})})]})]})}},26167:(e,t,r)=>{r.d(t,{E:()=>i,b:()=>a});var n=r(11984);async function a(e){let t=await s(e,"service-restart",{});return t?.message??"Bridge service restart scheduled. This laptop should reconnect once the bridge is back online."}async function i(e,t){let r=await s(e,"repair",{installScriptUrl:t});return r?.message??"Bridge reinstall requested. This laptop should reconnect shortly."}async function s(e,t,r){let a=await fetch(`/api/bridge/devices/${encodeURIComponent(e)}/${t}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r),cache:"no-store"}),i=await a.json().catch(()=>null);if(!a.ok){var s,d;let e;throw Error((s=i?.error??i?.message??null,d=a.status,e=s?.trim()??"",(0,n.Az)(e)?(0,n.IG)("repair"===t?"repair":"restart"):e||`Failed to run ${t} on the bridge service (${d})`))}return i}},31404:(e,t,r)=>{r.d(t,{S:()=>a,y:()=>i});var n=r(10926);function a(e,t){let r=(0,n.C0)(t);if(!r)return e;let a=new URL(e,"http://127.0.0.1");return a.searchParams.set("bridgeId",r),`${a.pathname}${a.search}${a.hash}`}function i(e){let t=function(e){if(!e)return null;if(e instanceof URL)return e;if("string"==typeof e)try{return new URL(e,"http://127.0.0.1")}catch{return null}if("string"==typeof e.href)try{return new URL(e.href)}catch{}return null}(e);if(!t)return null;let r=(0,n.C0)(t.searchParams.get("bridge")??t.searchParams.get("bridgeId"));if(r)return r;let a=(0,n.DW)(t.searchParams.get("session"))?.bridgeId;if(a)return a;let i=t.pathname.match(/^\/sessions\/([^/]+)$/);if(!i)return null;try{return(0,n.DW)(decodeURIComponent(i[1]))?.bridgeId??null}catch{return null}}},39702:(e,t,r)=>{r.d(t,{J:()=>C});var n=r(54568),a=r(7620),i=r(40448),s=r(65587),d=r.n(s),o=r(79748),l=r(22061),c=r(34041),u=r(58299),v=r(87242),p=r(2099),m=r(60527),h=r(81167),g=r(15321),x=r(44522),b=r(11984),f=r(46916),k=r(26167),w=r(61369),y=r(15115),j=r(67506);let _="/bridge/connect";function N({connected:e,className:t,title:r,suffix:a}){return(0,n.jsxs)("span",{className:(0,f.cn)("inline-flex items-center gap-2 rounded-full border px-2.5 py-1 text-[12px] font-medium",e?"border-[rgba(24,197,143,0.35)] bg-[rgba(24,197,143,0.12)] text-[var(--vk-green)]":"border-[rgba(255,143,122,0.24)] bg-[rgba(255,143,122,0.08)] text-[var(--vk-red)]",t),title:r,children:[(0,n.jsx)("span",{className:(0,f.cn)("h-2.5 w-2.5 rounded-full",e?"bg-[var(--vk-green)]":"bg-[var(--vk-red)]")}),(0,n.jsx)("span",{children:e?"Online":"Offline"}),a]})}function $({className:e}){let t=(0,o.useRouter)(),r=(0,o.usePathname)(),s=(0,o.useSearchParams)(),[C,I]=(0,a.useState)([]),[R,A]=(0,a.useState)(!0),[S,T]=(0,a.useState)(null),[E,U]=(0,a.useState)(null),[L,M]=(0,a.useState)({deviceId:null,phase:"idle",message:null}),[O,P]=(0,a.useState)({deviceId:null,kind:null,status:"idle",message:null}),D=(0,a.useRef)(new Set),F=(0,j.y)(),z=!!F,B=(0,a.useCallback)(async e=>{if(!z){e&&A(!1),I([]),T(null);return}e&&A(!0);try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load bridge devices (${e.status})`);I((0,y.oH)(t?.devices)),T(null)}catch(e){T(e instanceof Error?e.message:"Failed to load bridge devices.")}finally{A(!1)}},[z]);(0,a.useEffect)(()=>{if(!z){A(!1),I([]),T(null);return}let e=!1,t=null,r=async t=>{e||await B(t)};return r(!0),t=window.setInterval(()=>{r(!1)},15e3),()=>{e=!0,null!==t&&window.clearInterval(t)}},[z,B]),(0,a.useEffect)(()=>{let e=()=>{U((0,x.Tr)()?.deviceId??null)};return e(),window.addEventListener("focus",e),window.addEventListener("storage",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("storage",e)}},[]),(0,a.useEffect)(()=>{r!==_&&t.prefetch(_)},[r,t]);let G=C.filter(e=>e.connected),V=s.get("bridge")?.trim()||null,W=window.location.origin,q=V?C.find(e=>e.device_id===V)??null:null,J=!R&&0===G.length,H=E?C.find(e=>e.device_id===E)??null:null,X=J?q?.device_id?(0,w.kw)(q.device_id):H?.device_id?(0,w.kw)(H.device_id):C[0]?.device_id?(0,w.kw)(C[0].device_id):_:_,Y=G.length>0,Z=z?S??(Y?`${G.length} bridge${1===G.length?"":"s"} online`:C.length>0?"No paired bridges are online":"No paired bridges yet"):"Bridge relay URL is not configured";(0,a.useEffect)(()=>{let e=(H?.connected?H:null)??(q?.connected?q:null);!e||D.current.has(e.device_id)||(D.current.add(e.device_id),(0,x.jV)(e,M))},[H,q]),(0,a.useEffect)(()=>{!H||H.connected||L.message||M({deviceId:H.device_id,phase:"checking",message:`Waiting for ${H.device_name} to reconnect so Conductor can finish its package update.`})},[L.message,H]);let Q=(0,a.useCallback)(async e=>{P({deviceId:e.device_id,kind:"restart",status:"running",message:`Restarting the bridge service on ${e.device_name}.`});try{let t=await (0,k.b)(e.device_id);P({deviceId:e.device_id,kind:"restart",status:"completed",message:`${t} Waiting for ${e.device_name} to reconnect.`}),[2e3,5e3,1e4,2e4,35e3].forEach(e=>{window.setTimeout(()=>{B(!1)},e)})}catch(t){P({deviceId:e.device_id,kind:"restart",status:"failed",message:t instanceof Error?t.message:`Failed to restart ${e.device_name}.`})}},[B]),K=(0,a.useCallback)(async e=>{P({deviceId:e.device_id,kind:"repair",status:"running",message:`Reinstalling the bridge service on ${e.device_name}.`});try{let t=(0,w.pj)(window.location.origin),r=await (0,k.E)(e.device_id,t);P({deviceId:e.device_id,kind:"repair",status:"completed",message:r}),window.setTimeout(()=>{B(!1)},2e3)}catch(t){P({deviceId:e.device_id,kind:"repair",status:"failed",message:t instanceof Error?t.message:`Failed to repair ${e.device_name}.`})}},[B]),ee=(0,a.useCallback)(async e=>{await (0,x.jV)(e,M),window.setTimeout(()=>{B(!1)},2e3)},[B]);return J?(0,n.jsx)(d(),{href:X,prefetch:!0,className:"inline-flex",title:C.length>0?"Reconnect paired device":"Pair a device",children:(0,n.jsx)(N,{connected:!1,className:e,title:C.length>0?"Reconnect paired device":"Pair a device",suffix:(0,n.jsx)(l.A,{className:"h-3.5 w-3.5"})})}):(0,n.jsxs)(i.bL,{children:[(0,n.jsx)(i.l9,{asChild:!0,children:(0,n.jsx)("button",{type:"button",className:"outline-none",children:(0,n.jsx)(N,{connected:Y,className:e,title:Z,suffix:(0,n.jsx)(c.A,{className:"h-3.5 w-3.5 text-current/70"})})})}),(0,n.jsx)(i.ZL,{children:(0,n.jsxs)(i.UC,{align:"end",sideOffset:8,className:"z-[90] w-[320px] rounded-[18px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 text-[var(--vk-text-normal)] shadow-[0_22px_48px_rgba(0,0,0,0.34)]",children:[(0,n.jsxs)("div",{className:"rounded-[14px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-3",children:[(0,n.jsx)("div",{className:"text-[11px] font-semibold uppercase tracking-[0.22em] text-[var(--vk-text-muted)]",children:"Conductor Bridge"}),(0,n.jsx)("div",{className:"mt-2 text-[13px] text-[var(--vk-text-normal)]",children:Y?`${G.length} device${1===G.length?"":"s"} online`:R?"Loading device status":"No live bridge connection"}),(0,n.jsx)("div",{className:"mt-2 text-[11px] leading-5 text-[var(--vk-text-faint)]",children:"If a laptop is online but misbehaving, repair the bridge, update Conductor, or restart the service here."}),S?(0,n.jsx)("div",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-red)]",children:S}):null,L.message?(0,n.jsxs)("div",{className:(0,f.cn)("mt-2 flex flex-wrap items-center gap-2 text-[12px] leading-5","failed"===L.phase?"text-[var(--vk-red)]":"skipped"===L.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,x.qv)(L.phase)}),(0,n.jsx)("span",{children:L.message})]}):null]}),(0,n.jsx)("div",{className:"mt-2 max-h-[280px] overflow-y-auto",children:C.length>0?C.map(e=>{let t=(0,x.xv)(L,e.device_id),r="running"===O.status&&O.deviceId===e.device_id,a=r&&"repair"===O.kind,i=r&&"restart"===O.kind,s=O.deviceId===e.device_id&&(0,b.Az)(O.message)||L.deviceId===e.device_id&&(0,b.Az)(L.message);return(0,n.jsx)("div",{className:"rounded-[14px] px-3 py-2.5 transition-colors hover:bg-[var(--vk-bg-hover)]",children:(0,n.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,n.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,n.jsx)("div",{className:"truncate text-[13px] font-medium text-[var(--vk-text-strong)]",children:e.device_name}),(0,n.jsxs)("div",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:[e.hostname," \xb7 ",e.os,"/",e.arch,(0,y.wj)(e.last_status?.version)]}),(0,n.jsxs)("div",{className:"mt-1 text-[11px] text-[var(--vk-text-muted)]",children:["Relay: ",e.last_status?.hostname??e.hostname,(0,y.wj)(e.last_status?.version)]}),L.message&&L.deviceId===e.device_id?(0,n.jsxs)("div",{className:(0,f.cn)("mt-1 flex flex-wrap items-center gap-2 text-[11px] leading-5","failed"===L.phase?"text-[var(--vk-red)]":"skipped"===L.phase?"text-[var(--vk-text-muted)]":"text-[var(--vk-text-faint)]"),children:[(0,n.jsx)("span",{className:"inline-flex items-center rounded-full border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-2 py-0.5 text-[10px] font-semibold uppercase tracking-[0.16em] text-[var(--vk-text-muted)]",children:(0,x.qv)(L.phase)}),(0,n.jsx)("span",{children:L.message})]}):null,O.message&&O.deviceId===e.device_id?(0,n.jsx)("div",{className:(0,f.cn)("mt-1 text-[11px] leading-5","failed"===O.status?"text-[var(--vk-red)]":"completed"===O.status?"text-[var(--vk-green)]":"text-[var(--vk-text-faint)]"),children:O.message}):null,s&&W?(0,n.jsx)(g.i,{deviceId:e.device_id,deviceName:e.device_name,dashboardUrl:W,installScriptUrl:(0,w.pj)(W),relayUrl:F}):null,e.connected?(0,n.jsxs)("div",{className:"mt-2 flex flex-wrap gap-2",children:[(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:r||t,onClick:()=>{K(e)},children:[a?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(v.A,{className:"h-3.5 w-3.5"}),"Repair bridge"]}),(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:t||r,onClick:()=>{ee(e)},children:[t?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(p.A,{className:"h-3.5 w-3.5"}),t?"Updating...":"Update Conductor"]}),(0,n.jsxs)("button",{type:"button",className:"inline-flex items-center gap-1.5 rounded-[10px] border border-[var(--vk-border)] px-2.5 py-1 text-[11px] font-medium text-[var(--vk-text-normal)] transition-colors hover:bg-[var(--vk-bg-hover)]",disabled:r||t,onClick:()=>{Q(e)},children:[i?(0,n.jsx)(u.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,n.jsx)(m.A,{className:"h-3.5 w-3.5"}),"Restart service"]})]}):null]}),(0,n.jsx)(N,{connected:!0===e.connected})]})},e.device_id)}):(0,n.jsx)("div",{className:"rounded-[14px] border border-dashed border-[var(--vk-border)] px-3 py-4 text-[12px] text-[var(--vk-text-muted)]",children:R?"Loading paired devices...":"Pair a laptop to see bridge status here."})}),(0,n.jsx)(i.wv,{className:"my-2 h-px bg-[var(--vk-border)]"}),(0,n.jsx)(i.q7,{asChild:!0,children:(0,n.jsxs)(d(),{href:_,prefetch:!0,className:"flex items-center justify-between rounded-[12px] px-3 py-2 text-[13px] font-medium text-[var(--vk-text-normal)] outline-none transition-colors hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)]",children:[(0,n.jsx)("span",{children:"Open paired devices"}),(0,n.jsx)(h.A,{className:"h-4 w-4 text-[var(--vk-text-muted)]"})]})})]})})]})}function C({connected:e,className:t,title:r}={}){return"boolean"==typeof e?(0,n.jsx)(N,{connected:e,className:t,title:r}):(0,n.jsx)($,{className:t})}},44522:(e,t,r)=>{r.d(t,{N8:()=>c,Tr:()=>p,jV:()=>m,m7:()=>v,qv:()=>s,xv:()=>d});var n=r(31404),a=r(11984);let i="conductor-bridge-recent-pairing";function s(e){switch(e){case"checking":return"Checking";case"updating":return"Updating";case"restarting":return"Restarting";case"completed":return"Completed";case"skipped":return"Skipped";case"failed":return"Failed";default:return"Idle"}}function d(e,t){return e.deviceId===t&&("checking"===e.phase||"updating"===e.phase||"restarting"===e.phase)}function o(e,t){return t.jobMessage??`Installing Conductor ${t.latestVersion??"latest"} on ${e.device_name}.`}function l(e){let t=e.currentVersion?.trim();return t?` (build ${t})`:""}function c(e){if(!e.enabled)switch(e.reason){case"source-checkout":return"This laptop is running from a source checkout, so there is no published package to auto-update.";case"missing-cli-metadata":return"This install could not determine its update metadata, so automatic package updates are unavailable.";default:return"Automatic package updates are unavailable for this laptop."}return e.updateAvailable?e.canAutoUpdate?`This laptop is already running the latest Conductor release${l(e)}.`:"npx"===e.installMode?"This laptop was launched via npx, so the next launch will pick up the latest package automatically.":e.updateCommand?`A newer Conductor release is available, but this install still needs a manual update: ${e.updateCommand}`:"A newer Conductor release is available, but this install cannot update itself automatically.":`This laptop is already running the latest Conductor release${l(e)}.`}async function u(e,t){var r,i;let s=t?.method??"GET",d=`/api/bridge/devices/${encodeURIComponent(e)}/app-update`,o=new URL((0,n.S)(d,e),window.location.origin);t?.force&&o.searchParams.set("force","1");let l=await fetch(o.toString(),{method:s,headers:t?.body?{"Content-Type":"application/json"}:void 0,body:t?.body?JSON.stringify(t.body):void 0,cache:"no-store"}),c=await l.json().catch(()=>null);if(!l.ok){let e;throw Error((r=c&&"object"==typeof c&&"error"in c&&"string"==typeof c.error?c.error:null,i=l.status,e=r?.trim()??"",(0,a.Az)(e)?(0,a.IG)("update"):e||`Failed to update Conductor on this laptop (${i})`))}let u=c&&"object"==typeof c?c:null;if(!u)throw Error("Paired device returned an invalid update payload.");return u}function v(e){let t={deviceId:e.deviceId,deviceName:e.deviceName??null,pairedAt:new Date().toISOString()};try{window.localStorage.setItem(i,JSON.stringify(t))}catch{}}function p(){try{let e=window.localStorage.getItem(i);if(!e)return null;let t=JSON.parse(e);if(!(t&&"object"==typeof t&&"string"==typeof t.deviceId&&"string"==typeof t.pairedAt&&(null===t.deviceName||"string"==typeof t.deviceName)))return window.localStorage.removeItem(i),null;let r=Date.parse(t.pairedAt);if(!Number.isFinite(r)||Date.now()-r>18e5)return window.localStorage.removeItem(i),null;return t}catch{return null}}async function m(e,t){let r=(r,n)=>{t({deviceId:e.device_id,phase:r,message:n})};r("checking",`Checking for Conductor updates on ${e.device_name}.`);try{let t=await u(e.device_id,{force:!0});if(t.restarting)return void r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name}. This page will reconnect once the bridge runtime is back online.`);if("running"===t.jobStatus)r("updating",o(e,t));else{if(!t.updateAvailable||!t.enabled||!t.canAutoUpdate)return void r(t.enabled&&t.canAutoUpdate?"completed":"skipped",c(t));t=await u(e.device_id,{method:"POST"}),r("updating",o(e,t))}let n=Date.now()+3e5;for(;Date.now()<n&&"running"===t.jobStatus;){if(await new Promise(e=>{window.setTimeout(e,1500)}),(t=await u(e.device_id)).restarting)return void r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name}. This page will reconnect once the bridge runtime is back online.`);r("updating",o(e,t))}if("running"===t.jobStatus)return void r("updating",`The package update is still running on ${e.device_name}. Leave this page open and Conductor will finish applying it in the background.`);if("failed"===t.jobStatus)throw Error(t.jobMessage??t.error??`Automatic package update failed on ${e.device_name}.`);if(t.restartRequired){if(t.canRestart){t=await u(e.device_id,{method:"POST",body:{action:"restart"}}),r("restarting",t.jobMessage??`Restart scheduled on ${e.device_name} to finish updating Conductor.`);return}r("completed",t.jobMessage??`The latest Conductor package is installed on ${e.device_name}. Restart that laptop to finish updating.`);return}r("completed",t.jobMessage??`${e.device_name} is now updated to Conductor ${t.latestVersion??"latest"}.`)}catch(t){r("failed",t instanceof Error?t.message:`Failed to auto-update ${e.device_name}.`)}}},46916:(e,t,r)=>{r.d(t,{cn:()=>i});var n=r(9917),a=r(2809);function i(...e){return(0,a.QP)((0,n.$)(e))}},61369:(e,t,r)=>{function n(e){return/^[A-Za-z0-9_./:=@%+-]+$/.test(e)?e:`'${e.replace(/'/g,"'\"'\"'")}'`}function a(e){return e.map(n).join(" ")}function i(e){return new URL("/bridge/install.sh",e).toString()}function s(e){return`/bridge/connect?device=${encodeURIComponent(e)}#bridge-setup`}function d(e){return`curl -fsSL ${n(e)} | sh`}function o(e,t,r){let n=["npx","--yes","conductor-oss@latest","bridge","setup","--dashboard-url",t];return r?.trim()&&n.push("--relay-url",r.trim()),a(n)}function l(e,t){let r=["conductor-bridge","connect","--dashboard-url",e];return t?.trim()&&r.push("--relay-url",t.trim()),a(r)}function c(e,t){let r=["conductor-bridge","pair","--code",e?.trim()||"ABC123"],n=["conductor-bridge","daemon"];return t?.trim()&&(r.push("--relay-url",t.trim()),n.push("--relay-url",t.trim())),`${a(r)}
2
- ${a(n)}`}r.d(t,{$y:()=>o,G7:()=>d,hI:()=>l,kw:()=>s,pj:()=>i,zd:()=>c})},67506:(e,t,r)=>{r.d(t,{y:()=>a});var n=r(63680);function a(){let e=function(e){let t=e?.trim();if(!t)return null;try{let e=new URL(t);if("http:"!==e.protocol&&"https:"!==e.protocol)return null;return e.toString()}catch{return null}}(n.env.CONDUCTOR_BRIDGE_RELAY_URL??n.env.NEXT_PUBLIC_CONDUCTOR_BRIDGE_RELAY_URL);return e||null}},76081:(e,t,r)=>{r.d(t,{$:()=>l});var n=r(54568),a=r(46916),i=r(78347),s=r(7620);let d={default:"border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",primary:"border-[var(--vk-border)] bg-[var(--vk-bg-active)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",ghost:"border-transparent bg-transparent text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]",danger:"border-[var(--vk-red)]/40 bg-[color:color-mix(in_srgb,var(--vk-red)_18%,transparent)] text-[var(--vk-red)] hover:bg-[color:color-mix(in_srgb,var(--vk-red)_24%,transparent)]",outline:"border-[var(--vk-border)] bg-transparent text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]"},o={sm:"h-7 px-2.5 text-[12px] gap-1",md:"h-8 px-3 text-[13px] gap-1.5",lg:"h-9 px-3.5 text-[14px] gap-2",icon:"h-8 w-8 p-0"},l=(0,s.forwardRef)(({variant:e="default",size:t="md",asChild:r,className:s,children:l,...c},u)=>{let v=r?i.DX:"button";return(0,n.jsx)(v,{ref:u,className:(0,a.cn)("inline-flex items-center justify-center rounded-[var(--radius-sm)] border font-medium","transition-colors duration-150","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-[var(--vk-orange)]","disabled:pointer-events-none disabled:opacity-45",d[e],o[t],s),...c,children:l})});l.displayName="Button"},86181:(e,t,r)=>{function n(){var e;return"function"==typeof window.matchMedia&&window.matchMedia("(pointer: coarse)").matches,"u"<typeof navigator||navigator.maxTouchPoints,e=window.innerWidth,window.innerHeight,e<1024}function a(e,t,r,n){let a=Number.isFinite(e)?Math.max(0,e):0,i=Number.isFinite(t)?Math.max(0,t):a,s=Number.isFinite(r)?Math.max(0,r):0,d=Number.isFinite(n)?Math.max(0,n):0,o=Math.max(0,a-(i+s));return{usableHeight:Math.round(Math.max(0,i-Math.max(0,d-s))),keyboardInset:Math.round(o),keyboardVisible:o>=80}}r.d(t,{k$:()=>n,wP:()=>a})}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8659],{48018:(e,c,r)=>{r.d(c,{a:()=>t});var a=r(5974);let t=(0,a.createServerReference)("00cc094c84913ef51c465bd0f826638582aac42847",a.callServer,void 0,a.findSourceMapURL,"createOrReadKeylessAction")},58659:(e,c,r)=>{r.r(c),r.d(c,{createOrReadKeylessAction:()=>s.a,deleteKeylessAction:()=>t,detectKeylessEnvDriftAction:()=>l.A,syncKeylessConfigAction:()=>n});var a=r(5974);let t=(0,a.createServerReference)("00842a583829a05ccd273acf35d805f36c509ca097",a.callServer,void 0,a.findSourceMapURL,"deleteKeylessAction");var s=r(48018),l=r(22538);let n=(0,a.createServerReference)("40b168a2dede98515c8c0efe03247a00647b249c59",a.callServer,void 0,a.findSourceMapURL,"syncKeylessConfigAction")}}]);
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9756],{862:(e,t,n)=>{n.d(t,{G:()=>C});var a=n(54568),r=n(7620),i=n(33593),o=n(90466),s=n(46916),l=n(79748),d=n(58299),c=n(34309),u=n(62868),p=n(2099),f=n(36645),m=n(59706),h=n(76081),g=n(17210),b=n(31404),v=n(44522);let y="conductor-dismissed-update-version";function w(){let e,t,n=(0,l.usePathname)(),i=(0,l.useSearchParams)(),[o,w]=(0,r.useState)(null),[x,C]=(0,r.useState)(null),[k,A]=(0,r.useState)(null),[j,S]=(0,r.useState)(!1),[M,E]=(0,r.useState)(!1),[I,P]=(0,r.useState)(!1),N=(0,r.useMemo)(()=>(0,b.y)(window.location.href),[n,i]),B=(0,r.useCallback)(()=>(0,b.y)(window.location.href),[]),L=(0,r.useCallback)((e=!1)=>{let t=(0,b.S)("/api/app-update",B());if(!e)return t;let n=new URL(t,"http://127.0.0.1");return n.searchParams.set("force","1"),`${n.pathname}${n.search}${n.hash}`},[B]),T=(0,r.useCallback)(async(e=!1)=>{try{let t=await fetch(L(e),{cache:"no-store"}),n=await t.json().catch(()=>null);if(412===t.status)return C(null),null;if(!t.ok)throw Error("string"==typeof n?.error?n.error:`Failed to load update status (${t.status})`);return w(n),C(null),n}catch(e){return C(e instanceof Error?e.message:"Failed to load update status."),null}},[L,B]);(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(y);A(e&&e.length>0?e:null)}catch{}T(!0);let e=N?()=>{}:(0,g.F)(e=>{e&&(w(e),C(null))}),t=()=>{"visible"===document.visibilityState&&T(!1)};return window.addEventListener("focus",t),document.addEventListener("visibilitychange",t),()=>{e(),window.removeEventListener("focus",t),document.removeEventListener("visibilitychange",t)}},[N,T]);let $=o?.latestVersion&&k===o.latestVersion,q=!!o?.restarting||I,R=(0,r.useMemo)(()=>!!o&&(!!q||"running"===o.jobStatus||!$&&("completed"===o.jobStatus||"failed"===o.jobStatus||!o.enabled&&!!o.reason||o.updateAvailable)),[$,q,o]);async function G(){o?.updateCommand&&(await navigator.clipboard.writeText(o.updateCommand),S(!0),window.setTimeout(()=>S(!1),1400))}async function O(){E(!0);try{let e=await fetch((0,b.S)("/api/app-update",B()),{method:"POST",headers:{"content-type":"application/json"}}),t=await e.json().catch(()=>null);if(!e.ok)throw Error("string"==typeof t?.error?t.error:`Update failed (${e.status})`);w(t),C(null)}catch(e){C(e instanceof Error?e.message:"Failed to trigger update.")}finally{E(!1)}}let U=(0,r.useCallback)(async()=>{let e=Date.now()+6e4;if(N){for(;Date.now()<e;){let e=await T(!1);if(!e?.restarting)return void P(!1);await new Promise(e=>window.setTimeout(e,1e3))}P(!1),C("Restart started on the paired device, but it did not reconnect in time. Retry from the bridge controls.");return}for(;Date.now()<e;){try{if((await fetch("/api/health",{cache:"no-store"})).ok)return void window.location.reload()}catch{}await new Promise(e=>window.setTimeout(e,1e3))}P(!1),C("Restart started, but the dashboard did not come back in time. Reload manually.")},[N,T]);async function F(){try{let e=await fetch((0,b.S)("/api/app-update",B()),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({action:"restart"})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error("string"==typeof t?.error?t.error:`Restart failed (${e.status})`);w(t),C(null)}catch(e){C(e instanceof Error?e.message:"Failed to restart Conductor.")}}return((0,r.useEffect)(()=>{o?.restarting&&!I&&(P(!0),U())},[I,o?.restarting,U]),R)?(0,a.jsx)("div",{className:"pointer-events-none fixed bottom-3 right-3 z-[70] w-[min(calc(100vw-1.5rem),24rem)] sm:bottom-4 sm:right-4",children:(0,a.jsxs)("section",{className:(0,s.cn)("pointer-events-auto rounded-[14px] border bg-[var(--vk-bg-panel)] p-4 shadow-[0_16px_40px_rgba(0,0,0,0.35)]",o?.jobStatus==="failed"?"border-[color:color-mix(in_srgb,var(--vk-red)_55%,var(--vk-border))]":"border-[var(--vk-border)]"),children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[q||o?.jobStatus==="running"?(0,a.jsx)(d.A,{className:"h-4 w-4 animate-spin text-[var(--vk-orange)]"}):o?.jobStatus==="completed"?(0,a.jsx)(c.A,{className:"h-4 w-4 text-[var(--status-ready)]"}):o?.jobStatus==="failed"?(0,a.jsx)(u.A,{className:"h-4 w-4 text-[var(--vk-red)]"}):(0,a.jsx)(p.A,{className:"h-4 w-4 text-[var(--vk-orange)]"}),(0,a.jsx)("h2",{className:"truncate text-[13px] font-semibold text-[var(--vk-text-normal)]",children:o?(t=(e=o.currentVersion?.trim())?` (build ${e})`:"",!o.enabled&&o.reason?`Conductor update unavailable${t}`:o.restarting?`Restarting Conductor${t}`:"running"===o.jobStatus?`Updating Conductor${t}`:"completed"===o.jobStatus?`Conductor updated${t}`:"failed"===o.jobStatus?`Update failed${t}`:o.latestVersion?`Conductor ${o.latestVersion} is available${t}`:`Conductor update available${t}`):"Conductor update"})]}),(0,a.jsx)("p",{className:"mt-2 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:o?function(e){if(!e.enabled&&e.reason)return(0,v.N8)(e);if(e.restarting)return"The launcher is restarting the runtime. This tab will reconnect automatically once it is ready.";if("running"===e.jobStatus)return e.jobMessage??"Installing the latest version in the background.";if("completed"===e.jobStatus)return e.jobMessage??"The latest version has been installed. Restart Conductor to use it.";if("failed"===e.jobStatus)return e.jobMessage??"The update command did not finish successfully.";let t=e.currentVersion?`You are running ${e.currentVersion}. `:"";return e.canAutoUpdate?`${t}Install the new release now and restart when it finishes.`:"npx"===e.installMode?`${t}Copy the restart command, run it in a terminal, and the next launch will use the latest release.`:`${t}Copy the update command, run it in a terminal, then restart Conductor.`}(o):"Checking for updates..."})]}),(0,a.jsx)("button",{type:"button",onClick:function(){if(o?.latestVersion){try{window.localStorage.setItem(y,o.latestVersion)}catch{}A(o.latestVersion);return}w(e=>e?{...e,reason:null,enabled:!0}:e)},className:"inline-flex h-7 w-7 shrink-0 items-center justify-center rounded-[7px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)]","aria-label":"Dismiss update notice",children:(0,a.jsx)(f.A,{className:"h-4 w-4"})})]}),o?.updateCommand?(0,a.jsx)("div",{className:"mt-3 rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 font-mono text-[11px] leading-5 text-[var(--vk-text-muted)]",children:o.updateCommand}):null,o?(0,a.jsx)("p",{className:"mt-2 text-[11px] leading-5 text-[var(--vk-text-faint)]",children:function(e){switch(e){case"npx":return"This session was launched through npx. Copy the restart command, run it in a terminal, and the next launch will use the latest package.";case"unknown":return"Automatic updates are unavailable for this install.";default:return null}}(o.installMode)??(o.restartRequired?"Restart the current Conductor process after the installer completes.":"Update state streams from the running Conductor runtime.")}):null,x?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--vk-red)]",children:x}):o?.error?(0,a.jsx)("p",{className:"mt-2 text-[11px] text-[var(--vk-red)]",children:o.error}):null,o?.logsTail&&"failed"===o.jobStatus?(0,a.jsx)("pre",{className:"mt-2 max-h-32 overflow-auto rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-2 text-[10px] leading-4 text-[var(--vk-text-faint)]",children:o.logsTail}):null,(0,a.jsxs)("div",{className:"mt-3 flex items-center justify-end gap-2",children:[o?.jobStatus==="failed"&&o.canAutoUpdate?(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void O(),disabled:M,children:[M?(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Retry"]}):null,o?.jobStatus==="idle"&&o.canAutoUpdate?(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void O(),disabled:M,children:[M?(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}):(0,a.jsx)(p.A,{className:"h-3.5 w-3.5"}),"Update now"]}):null,o?.jobStatus==="idle"&&!o.canAutoUpdate&&o.updateCommand?(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"outline",onClick:()=>void G(),children:[j?(0,a.jsx)(c.A,{className:"h-3.5 w-3.5 text-[var(--status-ready)]"}):(0,a.jsx)(m.A,{className:"h-3.5 w-3.5"}),j?"Copied":"npx"===o.installMode?"Copy restart command":"Copy command"]}):null,o?.restartRequired&&o.canRestart&&!o.restarting&&!I?(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"primary",onClick:()=>void F(),children:[(0,a.jsx)(u.A,{className:"h-3.5 w-3.5"}),"Restart now"]}):null,o?.restarting||I?(0,a.jsxs)(h.$,{type:"button",size:"sm",variant:"primary",disabled:!0,children:[(0,a.jsx)(d.A,{className:"h-3.5 w-3.5 animate-spin"}),"Restarting"]}):null]})]})}):null}let x="conductor-workspace-sidebar-width";function C({sidebar:e,children:t,mobileSidebarOpen:n,desktopSidebarOpen:l,onToggleSidebar:d,hideMobileSidebarToggle:c=!1}){let[u,p]=(0,r.useState)(356),[f,m]=(0,r.useState)(!1);(0,r.useEffect)(()=>{try{let e=window.localStorage.getItem(x),t=e?Number.parseInt(e,10):NaN;Number.isFinite(t)&&p(Math.min(460,Math.max(296,t)))}catch{}},[]),(0,r.useEffect)(()=>{if(!f)return;let e=e=>{p(Math.min(460,Math.max(296,e.clientX)))},t=()=>{m(!1)};return window.addEventListener("mousemove",e),window.addEventListener("mouseup",t),document.body.style.userSelect="none",document.body.style.cursor="col-resize",()=>{window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",t),document.body.style.userSelect="",document.body.style.cursor="";try{window.localStorage.setItem(x,String(u))}catch{}}},[f,u]);let h={"--workspace-sidebar-width":`${u}px`};return(0,a.jsxs)("div",{style:h,className:"relative flex h-dvh min-h-[100dvh] w-full max-w-full overflow-hidden bg-[var(--vk-bg-main)] text-[var(--vk-text-normal)] [padding-top:env(safe-area-inset-top)] [padding-bottom:env(safe-area-inset-bottom)] pl-[env(safe-area-inset-left)] pr-[env(safe-area-inset-right)]",children:[n&&(0,a.jsx)("button",{type:"button",className:"absolute inset-0 z-20 bg-black/45 lg:hidden",onClick:d,"aria-label":"Close workspace panel"}),(0,a.jsx)("aside",{className:(0,s.cn)("absolute inset-y-0 left-0 z-30 flex h-full w-full max-w-none flex-col border-r border-[var(--vk-border)] bg-[var(--vk-bg-panel)] transition-[transform,width] duration-200 sm:w-[min(90vw,var(--workspace-sidebar-width))] sm:max-w-[28rem]",n?"translate-x-0":"-translate-x-full",l?"lg:w-[var(--workspace-sidebar-width)]":"lg:w-0 lg:overflow-hidden lg:border-r-0","lg:relative lg:left-auto lg:translate-x-0"),children:e}),l?(0,a.jsx)("div",{className:"absolute bottom-0 left-[var(--workspace-sidebar-width)] top-0 z-30 hidden w-2 -translate-x-1/2 cursor-col-resize lg:block",onMouseDown:()=>m(!0),"aria-hidden":"true",children:(0,a.jsx)("div",{className:"mx-auto h-full w-px bg-transparent transition-colors hover:bg-[var(--vk-border)]"})}):null,l&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-[var(--workspace-sidebar-width)] top-2 z-40 hidden h-7 w-7 -translate-x-1/2 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] shadow-[0_0_0_1px_rgba(0,0,0,0.25)] hover:bg-[var(--vk-bg-hover)] lg:inline-flex","aria-label":"Hide workspace panel",children:(0,a.jsx)(i.A,{className:"h-5 w-5"})}),(0,a.jsxs)("main",{className:"relative flex min-h-0 min-w-0 w-full flex-1 flex-col overflow-hidden bg-[var(--vk-bg-main)]",children:[!n&&!c&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-40 inline-flex h-11 w-11 items-center justify-center rounded-[6px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] shadow-[0_10px_24px_rgba(0,0,0,0.28)] hover:bg-[var(--vk-bg-hover)] sm:h-8 sm:w-8 lg:hidden","aria-label":"Open workspace panel",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),!l&&(0,a.jsx)("button",{type:"button",onClick:d,className:"absolute left-2 top-2 z-40 hidden h-7 w-7 items-center justify-center rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] lg:inline-flex","aria-label":"Open workspace panel",children:(0,a.jsx)(o.A,{className:"h-5 w-5"})}),t]}),(0,a.jsx)(w,{})]})}},5739:(e,t,n)=>{n.d(t,{q:()=>a});function a(e){return e.trim().toLowerCase().replace(/[_\s]+/g,"-")}},17210:(e,t,n)=>{n.d(t,{F:()=>x,L:()=>w});var a=n(31404);let r=new Set,i=new Set,o=null,s=null,l=null,d=null;function c(){return r.size>0||i.size>0}function u(){return"u"<typeof document||"visible"===document.visibilityState}function p(){o&&(o.close(),o=null)}function f(e){if(Array.isArray(e))return{type:"snapshot",sessions:e};if(!e||"object"!=typeof e)return null;let t=e.type;return"snapshot"!==t&&"snapshot_delta"!==t?null:Array.isArray(e.sessions)?e:null}function m(e){return e&&"object"==typeof e&&"boolean"==typeof e.enabled?e:null}function h(e){for(let t of r)t(e);let t=m(e.appUpdate);if(t)for(let e of i)e(t)}function g(){return(0,a.y)(window.location.href)}async function b(){if("function"!=typeof fetch)return;let e=(async()=>{let e=g();try{let t=await fetch((0,a.S)("/api/sessions",e));if(!t.ok)return;let n=await t.json().catch(()=>null),r=f(n);if(!r)return;h(r)}catch{}try{let n=await fetch((0,a.S)("/api/app-update",e));if(!n.ok)return;let r=await n.json().catch(()=>null);var t=m(r);for(let e of i)e(t)}catch{}})();s=e.finally(()=>{s===e&&(s=null)}),await e}function v(){o||"u"<typeof EventSource||!c()||!u()||g()||((o=new EventSource("/api/events")).onmessage=e=>{try{let t=f(JSON.parse(e.data));if(!t)return;h(t)}catch{}},o.addEventListener("refresh",()=>{s||b()}),o.onerror=()=>{c()&&u()||p()})}function y(){if(!c()){p(),l&&(window.removeEventListener("focus",l),l=null),d&&(document.removeEventListener("visibilitychange",d),d=null);return}(l||d||(l=()=>{c()&&u()&&(v(),s||b())},d=()=>{c()&&u()?(v(),s||b()):p()},window.addEventListener("focus",l),document.addEventListener("visibilitychange",d)),g()||!u())?p():v()}function w(e){return r.add(e),y(),()=>{r.delete(e),y()}}function x(e){return i.add(e),y(),()=>{i.delete(e),y()}}},35821:(e,t,n)=>{n.d(t,{w:()=>r});var a=n(75120);function r(e,t=null,n){return(0,a.DA)(e,t,n)}},46012:(e,t,n)=>{n.d(t,{T:()=>i});var a=n(7620);function r(){return window.innerWidth>=1024}function i(e){let[t,n]=(0,a.useState)(!1),[i,o]=(0,a.useState)(e?.initialDesktopOpen??!0),s=(0,a.useCallback)(()=>{r()?o(e=>!e):n(e=>!e)},[]);return{mobileSidebarOpen:t,desktopSidebarOpen:i,toggleSidebar:s,closeSidebarOnMobile:(0,a.useCallback)(()=>{r()||n(!1)},[]),syncSidebarForViewport:(0,a.useCallback)(()=>{r()?o(!0):n(!1)},[])}}},53649:(e,t,n)=>{n.d(t,{U:()=>o});var a=n(7620),r=n(31404);function i(e,t){return{id:e,repo:"string"==typeof t?.repo?t.repo:null,path:"string"==typeof t?.path?t.path:null,iconUrl:"string"==typeof t?.iconUrl?t.iconUrl:null,boardDir:"string"==typeof t?.boardDir?t.boardDir:null,boardFile:"string"==typeof t?.boardFile?t.boardFile:null,description:"string"==typeof t?.description?t.description:null,defaultBranch:"string"==typeof t?.defaultBranch&&t.defaultBranch.trim().length>0?t.defaultBranch:"main",agent:"string"==typeof t?.agent&&t.agent.trim().length>0?t.agent:"claude-code",agentPermissions:"string"==typeof t?.agentPermissions&&t.agentPermissions.trim().length>0?t.agentPermissions:null,agentModel:"string"==typeof t?.agentModel&&t.agentModel.trim().length>0?t.agentModel:null,agentReasoningEffort:"string"==typeof t?.agentReasoningEffort&&t.agentReasoningEffort.trim().length>0?t.agentReasoningEffort:null}}function o(e,t){let n=t?.enabled??!0,[o,s]=(0,a.useState)([]),[l,d]=(0,a.useState)(n),[c,u]=(0,a.useState)(null),p=(0,a.useCallback)(async()=>{if(!n){s([]),u(null),d(!1);return}d(!0);try{let t=await fetch((0,r.S)("/api/config",e)),n=await t.json().catch(()=>null);if(!t.ok){let e="object"==typeof n&&null!==n?n.error??n.reason:null;throw Error(e??`Failed to fetch config: ${t.status}`)}s(function(e){if(!e||"object"!=typeof e)return[];let t=e.projects;return t?Array.isArray(t)?t.map((e,t)=>e&&"object"==typeof e?i("string"==typeof e.id&&e.id.trim().length>0?e.id:`project-${t+1}`,e):i(`project-${t+1}`,null)):"object"==typeof t?Object.entries(t).map(([e,t])=>i(e,t&&"object"==typeof t?t:null)):[]:[]}(n)),u(null)}catch(e){s([]),u(e instanceof Error?e.message:"Failed to fetch config")}finally{d(!1)}},[e,n]);return(0,a.useEffect)(()=>{p()},[p]),{projects:o,loading:!!n&&l,error:n?c:null,refresh:p}}},75120:(e,t,n)=>{n.d(t,{DA:()=>S,eI:()=>j});var a=n(7620),r=n(31404),i=n(10926),o=n(17210);let s="local",l=new Map,d=new Map;function c(e){return(0,i.C0)(e)??s}function u(e){let t=l.get(e);return t||(t={sessionsById:new Map,orderedIds:[],version:0,loading:!0,error:null,listInitialized:!1,refreshPromise:null,unsubscribeSnapshots:null,activeConsumers:0,pollTimer:null,focusHandler:null,visibilityHandler:null},l.set(e,t)),t}function p(e){let t=d.get(e);return t||(t=new Set,d.set(e,t)),t}function f(e){for(let t of p(e))t()}function m(e){return[...e.values()].sort((e,t)=>t.createdAt.localeCompare(e.createdAt)).map(e=>e.id)}function h(e,t,n){let a=u(e);a.sessionsById=t,a.orderedIds=n,a.version+=1}function g(e){return{id:e.id,projectId:e.projectId,bridgeId:e.bridgeId??null,bridgeConnected:e.bridgeConnected??null,bridgeConnection:e.bridgeConnection??null,status:e.status,activity:e.activity,branch:e.branch,model:e.model??null,reasoningEffort:e.reasoningEffort??null,issueId:e.issueId,summary:e.summary??null,createdAt:e.createdAt,lastActivityAt:e.lastActivityAt,pr:e.pr??null,metadata:e.metadata}}async function b(e,t){let n=u(e);if(n.refreshPromise)return void await n.refreshPromise;let a=(async()=>{try{var a;let i=await fetch((0,r.S)("/api/sessions",t),{cache:"no-store"});if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error??e?.reason??`Failed to fetch sessions: ${i.status}`)}let o=(a=await i.json().catch(()=>null),Array.isArray(a)?a:Array.isArray(a?.sessions)?a.sessions:[]),s=new Map(o.map(e=>[e.id,e]));h(e,s,m(s)),n.error=null}catch(e){n.error=e instanceof Error?e.message:"Failed to fetch sessions"}finally{n.loading=!1,f(e)}})();n.refreshPromise=a.finally(()=>{n.refreshPromise===a&&(n.refreshPromise=null)}),await a}function v(){return"visible"===document.visibilityState}function y(e){let t=u(e);null!==t.pollTimer&&(window.clearTimeout(t.pollTimer),t.pollTimer=null)}function w(e,t){let n=u(e);y(e),0!==n.activeConsumers&&v()&&(n.pollTimer=window.setTimeout(async()=>{0!==u(e).activeConsumers&&v()&&(await b(e,t),w(e,t))},15e3))}function x(e,t){let n=u(e);n.activeConsumers+=1,n.activeConsumers>1||(!function(e){if(e!==s)return;let t=u(e);t.unsubscribeSnapshots||(t.unsubscribeSnapshots=(0,o.L)(t=>{let n=u(e);if("snapshot"===t.type)h(e,new Map(t.sessions.map(e=>{let t=g(e);return[t.id,t]})),t.sessions.map(e=>e.id));else{let a=new Map(n.sessionsById);for(let e of t.sessions){let t=g(e);a.set(t.id,t)}for(let e of t.removedSessionIds??[])a.delete(e);h(e,a,m(a))}n.loading=!1,n.error=null,f(e)}))}(e),n.listInitialized||(n.listInitialized=!0),function(e,t){let n=u(e);if(n.focusHandler||n.visibilityHandler)return;let a=()=>{0!==n.activeConsumers&&(b(e,t),w(e,t))},r=()=>{0!==n.activeConsumers&&("visible"===document.visibilityState&&b(e,t),y(e),w(e,t))};n.focusHandler=a,n.visibilityHandler=r,window.addEventListener("focus",a),document.addEventListener("visibilitychange",r)}(e,t),v()&&b(e,t),w(e,t))}function C(e){let t=u(e);if(t.activeConsumers=Math.max(0,t.activeConsumers-1),!(t.activeConsumers>0)){let n;y(e),(n=u(e)).focusHandler&&(window.removeEventListener("focus",n.focusHandler),n.focusHandler=null),n.visibilityHandler&&(document.removeEventListener("visibilitychange",n.visibilityHandler),n.visibilityHandler=null),t.unsubscribeSnapshots?.(),t.unsubscribeSnapshots=null}}function k(e,t){let n=p(e);return n.add(t),()=>{n.delete(t)}}async function A(e,t,n){let a=u(t);try{let i=await fetch((0,r.S)(`/api/sessions/${encodeURIComponent(e)}`,n),{cache:"no-store"});if(404===i.status){let n=new Map(a.sessionsById);return n.delete(e),h(t,n,m(n)),a.error=null,f(t),null}if(!i.ok){let e=await i.json().catch(()=>null);throw Error(e?.error??e?.reason??`Failed to fetch session: ${i.status}`)}let o=await i.json(),s=new Map(a.sessionsById);return s.set(o.id,o),h(t,s,m(s)),a.error=null,o}catch(e){throw a.error=e instanceof Error?e.message:"Failed to fetch session",e}finally{a.loading=!1,f(t)}}function j(e,t){let n=t?.enabled??!0,r=c(t?.bridgeId),i=u(r),[,o]=(0,a.useReducer)(e=>e+1,0),[s,l]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{if(l(!0),!n)return;x(r,t?.bridgeId);let e=k(r,()=>o());return()=>{e(),C(r)}},[n,t?.bridgeId,r]),{sessions:(0,a.useMemo)(()=>{let t,a;return n&&s?(t=u(r),a=e?.trim(),t.orderedIds.map(e=>t.sessionsById.get(e)).filter(e=>!!e).filter(e=>!a||e.projectId===a)):[]},[n,s,e,r,i.version]),loading:!!n&&(!s||i.loading),error:n?i.error:null,refresh:()=>b(r,t?.bridgeId)}}function S(e,t=null,n){let r=n?.enabled??!0,o="string"==typeof e&&e.trim().length>0?e.trim():null,l=(0,i.C0)(n?.bridgeId??t?.bridgeId??(0,i.DW)(o)?.bridgeId??null),d=c(l),p=u(d),[,g]=(0,a.useReducer)(e=>e+1,0),[b,v]=(0,a.useState)(!1),[y,w]=(0,a.useState)(t),[j,M]=(0,a.useState)(null),[E,I]=(0,a.useState)(r&&null!==o&&null===t);return(0,a.useEffect)(()=>{v(!0),function(e,t){if(!t)return;let n=u(e),a=n.sessionsById.get(t.id);if(a&&JSON.stringify(a)===JSON.stringify(t))return;let r=new Map(n.sessionsById);r.set(t.id,t),h(e,r,m(r)),n.loading=!1,f(e)}(d,t),w(t),M(null)},[t,d]),(0,a.useEffect)(()=>{if(r&&null!==o)return k(d,()=>g())},[r,o,d]),(0,a.useEffect)(()=>{if(r&&null!==o)return x(d,l),()=>{C(d)}},[r,l,o,d]),(0,a.useEffect)(()=>{if(!r||null===o||d===s)return;let e=()=>{"visible"===document.visibilityState&&A(o,d,l).catch(()=>{})};e();let t=window.setInterval(e,5e3);return()=>{window.clearInterval(t)}},[r,l,o,d]),(0,a.useEffect)(()=>{if(!r||null===o){w(null),M(null),I(!1);return}if(t||p.sessionsById.has(o)){w(e=>p.sessionsById.get(o)??e??t),M(null),I(!1);return}let e=!1;return I(!0),M(null),A(o,d,l).then(t=>{e||(w(t),M(null))}).catch(t=>{e||(w(null),M(t instanceof Error?t.message:"Failed to fetch session"))}).finally(()=>{e||I(!1)}),()=>{e=!0}},[r,l,t,o,d,p]),{session:o?b?p.sessionsById.get(o)??y??t??null:t??null:null,loading:E,error:r&&o?j??p.error:null}}},76196:(e,t,n)=>{n.d(t,{DZ:()=>v,O$:()=>g,Tk:()=>m,Zp:()=>u,Zz:()=>p,d8:()=>h,u6:()=>b,yM:()=>f}),[...new Set(["killed","terminated","done","cleanup","errored","merged"])];let a=["amp","claude-code","codex","cursor-cli","droid","gemini","github-copilot","opencode","qwen-code","ccr"],r={amp:"default",claudeCode:"pro",codex:"chatgpt",cursorCli:"default",droid:"default",gemini:"oauth",githubCopilot:"default",opencode:"default",qwenCode:"oauth",ccr:"default"},i={amp:{agent:"amp",label:"Amp",accessKey:"amp",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Amp CLI catalog and custom override support."}]},"claude-code":{agent:"claude-code",label:"Claude Code",accessKey:"claudeCode",defaultAccess:"pro",accessOptions:[{id:"pro",label:"Claude Pro",description:"Shows the current Sonnet models that Claude Code documents for Pro usage."},{id:"max",label:"Claude Max",description:"Unlocks both Sonnet and Opus model choices in Claude Code."},{id:"api",label:"Anthropic API",description:"Use direct Anthropic API credentials instead of a Claude subscription."}]},codex:{agent:"codex",label:"Codex",accessKey:"codex",defaultAccess:"chatgpt",accessOptions:[{id:"chatgpt",label:"ChatGPT Plan",description:"Use the ChatGPT-backed Codex login flow for paid ChatGPT workspaces."},{id:"api",label:"OpenAI API",description:"Use direct OpenAI API credentials when Codex is pointed at the API."}]},"cursor-cli":{agent:"cursor-cli",label:"Cursor Agent",accessKey:"cursorCli",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Cursor Agent catalog and custom override support."}]},droid:{agent:"droid",label:"Droid",accessKey:"droid",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Droid catalog and custom override support."}]},gemini:{agent:"gemini",label:"Gemini",accessKey:"gemini",defaultAccess:"oauth",accessOptions:[{id:"oauth",label:"Google Login",description:"Use the built-in Google account flow that Gemini CLI ships with."},{id:"api",label:"Gemini API",description:"Use a Gemini API key or Vertex AI project for broader model control."}]},"github-copilot":{agent:"github-copilot",label:"GitHub Copilot",accessKey:"githubCopilot",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Copilot CLI catalog and custom override support."}]},opencode:{agent:"opencode",label:"OpenCode",accessKey:"opencode",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed OpenCode catalog and custom override support."}]},"qwen-code":{agent:"qwen-code",label:"Qwen Code",accessKey:"qwenCode",defaultAccess:"oauth",accessOptions:[{id:"oauth",label:"Qwen OAuth",description:"Use Qwen Code's built-in browser login and bundled provider defaults."},{id:"api",label:"DashScope / Custom API",description:"Use DashScope or another OpenAI-compatible endpoint configured for Qwen Code."}]},ccr:{agent:"ccr",label:"CCR",accessKey:"ccr",defaultAccess:"default",accessOptions:[{id:"default",label:"Local CLI",description:"Use the locally installed Claude Code Router catalog and custom override support."}]}},o=[{id:"low",label:"Low",description:"Fast responses with lighter reasoning."},{id:"medium",label:"Medium",description:"Balanced speed and reasoning depth for everyday tasks."},{id:"high",label:"High",description:"Deeper reasoning for more complex tasks."}],s=[...o,{id:"xhigh",label:"Extra High",description:"Maximum reasoning depth for the hardest tasks."}];function l(e,t,n,a=function(e){return e.trim().split(/[-_]+/g).filter(Boolean).map(e=>"gpt"===e.toLowerCase()?"GPT":e[0]?.toUpperCase()+e.slice(1)).join(" ")}(e)){return{id:e,label:a,description:t,access:n}}let d={amp:{modelsByAccess:{default:[l("free","Amp Free mode prioritizes lower-cost execution.",["default"],"Amp Free"),l("rush","Amp Rush mode prioritizes faster turnaround.",["default"],"Amp Rush"),l("smart","Amp Smart mode balances quality, speed, and tool choice.",["default"],"Amp Smart"),l("deep","Amp Deep mode enables the highest-capability reasoning path.",["default"],"Amp Deep")]},defaultModelByAccess:{default:"smart"}},"claude-code":{modelsByAccess:{pro:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")],max:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude Code model for deeper reasoning.",["max","api"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")],api:[l("claude-sonnet-4-6","Balanced Claude Code model for day-to-day coding tasks.",["pro","max","api"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude Code model for deeper reasoning.",["max","api"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model for lightweight tasks.",["pro","max","api"],"Claude Haiku 4.5")]},defaultModelByAccess:{pro:"claude-sonnet-4-6",max:"claude-opus-4-6",api:"claude-sonnet-4-6"},reasoningOptionsByAccess:{pro:o,max:o,api:o},defaultReasoningByAccess:{pro:"medium",max:"high",api:"medium"}},codex:{modelsByAccess:{chatgpt:[l("gpt-5.4","Latest frontier coding model exposed by Codex.",["chatgpt","api"],"GPT-5.4"),l("gpt-5.4-mini","Smaller GPT-5.4 variant for faster or lower-cost coding tasks.",["chatgpt","api"],"GPT-5.4-Mini"),l("gpt-5.3-codex","Balanced Codex coding model.",["chatgpt","api"],"GPT-5.3-Codex"),l("gpt-5.3-codex-spark","Fast Codex model optimized for rapid iteration.",["chatgpt"],"GPT-5.3-Codex-Spark"),l("gpt-5.2-codex","Previous generation Codex coding model.",["chatgpt","api"],"GPT-5.2-Codex"),l("gpt-5.2","Previous frontier model for professional work with configurable reasoning effort.",["chatgpt","api"],"GPT-5.2"),l("gpt-5.1-codex-max","High-capability legacy Codex model.",["chatgpt","api"],"GPT-5.1-Codex-Max"),l("gpt-5.1-codex-mini","Smaller Codex model for quick tasks.",["chatgpt","api"],"GPT-5.1-Codex-Mini")],api:[l("gpt-5.4","Latest frontier coding model exposed by Codex.",["chatgpt","api"],"GPT-5.4"),l("gpt-5.4-mini","Smaller GPT-5.4 variant for faster or lower-cost coding tasks.",["chatgpt","api"],"GPT-5.4-Mini"),l("gpt-5.3-codex","Balanced Codex coding model.",["chatgpt","api"],"GPT-5.3-Codex"),l("gpt-5.2-codex","Previous generation Codex coding model.",["chatgpt","api"],"GPT-5.2-Codex"),l("gpt-5.2","Previous frontier model for professional work with configurable reasoning effort.",["chatgpt","api"],"GPT-5.2"),l("gpt-5.1-codex-max","High-capability legacy Codex model.",["chatgpt","api"],"GPT-5.1-Codex-Max"),l("gpt-5.1-codex-mini","Smaller Codex model for quick tasks.",["chatgpt","api"],"GPT-5.1-Codex-Mini")]},defaultModelByAccess:{chatgpt:"gpt-5.4",api:"gpt-5.4"},reasoningOptionsByAccess:{chatgpt:s,api:s},defaultReasoningByAccess:{chatgpt:"high",api:"high"}},"cursor-cli":{modelsByAccess:{default:[l("gpt-5","Cursor Agent's GPT-5 preset alias.",["default"],"GPT-5"),l("sonnet-4","Cursor Agent's Sonnet preset alias.",["default"],"Sonnet 4"),l("opus","Cursor Agent's Opus preset alias.",["default"],"Opus")]},defaultModelByAccess:{default:"gpt-5"}},droid:{modelsByAccess:{default:[]},defaultModelByAccess:{}},gemini:{modelsByAccess:{oauth:[l("gemini-3.1-pro-preview","High-capability Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3.1 Pro Preview"),l("gemini-3-flash-preview","Fast Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3 Flash Preview")],api:[l("gemini-3.1-pro-preview","High-capability Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3.1 Pro Preview"),l("gemini-3-flash-preview","Fast Gemini model discovered in local Gemini sessions.",["oauth","api"],"Gemini 3 Flash Preview")]},defaultModelByAccess:{oauth:"gemini-3.1-pro-preview",api:"gemini-3.1-pro-preview"}},"github-copilot":{modelsByAccess:{default:[]},defaultModelByAccess:{}},opencode:{modelsByAccess:{default:[]},defaultModelByAccess:{}},"qwen-code":{modelsByAccess:{oauth:[l("coder-model","Model discovered in the local Qwen Code installation.",["oauth","api"],"Coder Model")],api:[l("coder-model","Model discovered in the local Qwen Code installation.",["oauth","api"],"Coder Model")]},defaultModelByAccess:{oauth:"coder-model",api:"coder-model"}},ccr:{modelsByAccess:{default:[l("claude-sonnet-4-6","Balanced Claude model exposed through Claude Code Router.",["default"],"Claude Sonnet 4.6"),l("claude-opus-4-6","Highest-capability Claude model exposed through Claude Code Router.",["default"],"Claude Opus 4.6"),l("claude-haiku-4-5","Fast Claude model exposed through Claude Code Router.",["default"],"Claude Haiku 4.5")]},defaultModelByAccess:{default:"claude-sonnet-4-6"},reasoningOptionsByAccess:{default:o},defaultReasoningByAccess:{default:"medium"}}};function c(e){let t=e.trim().toLowerCase().replace(/[_\s]+/g,"-");return a.includes(t)?t:null}function u(){return{...r}}function p(e){return null!==c(e)}function f(e){let t=c(e);return t?i[t]:null}function m(e,t){let n=f(e);if(!n)return null;let a=t?.[n.accessKey];return"string"==typeof a&&n.accessOptions.some(e=>e.id===a)?a:n.defaultAccess}function h(e,t){let n=c(e);if(!n)return[];let a=m(n,t);if(!a)return[];let r=d[n],i=r.modelsByAccess[a]??[];if(i.length>0)return[...i];let o=[],s=new Set;for(let e of Object.values(r.modelsByAccess))if(Array.isArray(e))for(let t of e)s.has(t.id)||(s.add(t.id),o.push(t));return o}function g(e,t){let n=c(e);if(!n)return null;let a=m(n,t);return a?d[n].defaultModelByAccess[a]??null:null}function b(e,t){let n=c(e);if(!n)return[];let a=m(n,t);return a?d[n].reasoningOptionsByAccess?.[a]??[]:[]}function v(e,t){let n=c(e);if(!n)return null;let a=m(n,t);return a?d[n].defaultReasoningByAccess?.[a]??null:null}},84169:(e,t,n)=>{n.d(t,{V:()=>o});var a=n(54568),r=n(7620),i=n(37270);let o=(0,r.memo)(function({title:e,onOpenPreferences:t,rightContent:n}){return(0,a.jsxs)("header",{className:"flex h-11 items-center border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)] pl-14 pr-2 text-[13px] text-[var(--vk-text-muted)] sm:h-14 sm:pl-5 sm:pr-5 sm:text-[14px]",children:[(0,a.jsx)("div",{className:"min-w-0 flex-1 text-left sm:text-center",children:(0,a.jsx)("span",{className:"block truncate font-medium tracking-[0.01em] text-[var(--vk-text-normal)]",children:e??"All Projects"})}),n?(0,a.jsx)("div",{className:"ml-1 flex shrink-0 items-center gap-2",children:n}):null,t?(0,a.jsx)("div",{className:"ml-1 flex shrink-0",children:(0,a.jsx)("button",{type:"button",onClick:t,className:"inline-flex h-11 w-11 items-center justify-center rounded-[6px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-normal)] sm:h-9 sm:w-9","aria-label":"Open preferences",title:"Preferences",children:(0,a.jsx)(i.A,{className:"h-4 w-4"})})}):null]})})},85626:(e,t,n)=>{n.d(t,{$E:()=>u,ww:()=>d,zu:()=>c});let a="abstract-sound-4",r={"abstract-sound-1":{steps:[{frequency:784,durationMs:90,gain:.24},{frequency:988,durationMs:90,gain:.22},{frequency:1175,durationMs:120,gain:.2}]},"abstract-sound-2":{steps:[{frequency:659,durationMs:120,gain:.22},{frequency:523,durationMs:140,gain:.2},{frequency:659,durationMs:120,gain:.18}]},"abstract-sound-3":{steps:[{frequency:440,durationMs:80,gain:.22},{frequency:554,durationMs:80,gain:.22},{frequency:659,durationMs:90,gain:.2},{frequency:880,durationMs:120,gain:.18}]},"abstract-sound-4":{steps:[{frequency:523,durationMs:130,gain:.22},{frequency:659,durationMs:130,gain:.2},{frequency:784,durationMs:150,gain:.18}]},"cow-mooing":{steps:[{frequency:220,durationMs:220,type:"triangle",gain:.24},{frequency:174,durationMs:260,type:"triangle",gain:.2}]},"phone-vibration":{vibrate:[120,60,120,60,180],steps:[{frequency:180,durationMs:140,gain:.16},{frequency:220,durationMs:140,gain:.14}]},rooster:{steps:[{frequency:784,durationMs:70,type:"square",gain:.24},{frequency:1046,durationMs:70,type:"square",gain:.22},{frequency:1318,durationMs:90,type:"square",gain:.2},{frequency:1568,durationMs:120,type:"square",gain:.18}]}},i=null;function o(){let e=window,t=e.AudioContext??e.webkitAudioContext;return t?(i||(i=new t),i):null}function s(e){let t=e?.trim();return t&&t in r?t:a}function l(e,t,n){return Math.min(n,Math.max(t,e))}function d(e){return s(e)}async function c(){let e=o();if(!e)return!1;if("suspended"===e.state)try{await e.resume()}catch{return!1}return"running"===e.state}async function u(e,t){let n=s(e),a=r[n];if("phone-vibration"===n&&a.vibrate&&"u">typeof navigator&&"function"==typeof navigator.vibrate)return navigator.vibrate(a.vibrate);let i=o();if(!i||!a.steps||0===a.steps.length)return!1;if("suspended"===i.state)try{await i.resume()}catch{return!1}if("running"!==i.state)return!1;let d=l(t?.volume??.4,.05,.8),c=i.currentTime+.02;for(let e of a.steps)!function(e,t,n,a){let r=e.createOscillator(),i=e.createGain(),o=l((n.gain??1)*a,.02,.9),s=Math.max(.04,n.durationMs/1e3),d=t+Math.max(.015,Math.min(.05,.35*s)),c=t+Math.max(.02,.7*s),u=t+s;r.type=n.type??"sine",r.frequency.setValueAtTime(n.frequency,t),i.gain.setValueAtTime(1e-4,t),i.gain.linearRampToValueAtTime(o,d),i.gain.exponentialRampToValueAtTime(1e-4,c),i.gain.setValueAtTime(1e-4,u),r.connect(i),i.connect(e.destination),r.start(t),r.stop(u+.05)}(i,c,e,d),c+=Math.max(.06,e.durationMs/1e3+.04);return!0}},86011:(e,t,n)=>{n.d(t,{Q:()=>c});var a=n(7620),r=n(31404),i=n(85626);function o(){return"u"<typeof document||"visible"===document.visibilityState}function s(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function l(e){return`${e.id}::${e.timestamp}`}function d(e){null!==e.current&&(window.clearTimeout(e.current),e.current=null)}function c({enabled:e,projectId:t,preferences:n,bridgeId:u}){let p=(0,a.useRef)(n?.soundEnabled!==!1),f=(0,a.useRef)((0,i.ww)(n?.soundFile)),m=(0,a.useRef)(new Set),h=(0,a.useRef)(null),g=(0,a.useRef)(!1),b=(0,a.useRef)(null),v=(0,a.useRef)(null),y=(0,a.useRef)(null);(0,a.useEffect)(()=>{p.current=n?.soundEnabled!==!1,f.current=(0,i.ww)(n?.soundFile)},[n?.soundEnabled,n?.soundFile]),(0,a.useEffect)(()=>{if(!e)return;let n=t?.trim()||null,a=u?.trim()||null,c=`${a??"local"}::${n??""}`;b.current!==c&&(b.current=c,m.current=new Set,h.current=null,g.current=!1);let w=!1,x=async e=>{if(w||!o())return;if(v.current)return void await v.current;let t=(async()=>{let t=new URLSearchParams({limit:"20"});n&&t.set("project",n),!e&&h.current&&t.set("since",h.current);try{var o;let n,d=await fetch((0,r.S)(`/api/notifications?${t.toString()}`,a),{cache:"no-store"});if(!d.ok)return;let c=(o=await d.json().catch(()=>null),n=s(o),(Array.isArray(n.notifications)?n.notifications:[]).map(e=>{var t;let n,a,r,i,o,l,d,c;return n=s(e),a="string"==typeof n.id?n.id.trim():"",r="string"==typeof n.message?n.message.trim():"",i="string"==typeof n.timestamp?n.timestamp.trim():"",o="string"==typeof n.sessionId?n.sessionId.trim():"",l="string"==typeof n.projectId?n.projectId.trim():"",d="string"==typeof n.type?n.type.trim():"",c="high"===(t=n.priority)||"medium"===t||"low"===t?n.priority:"low",a&&r&&i&&o&&l&&d?{id:a,priority:c,message:r,timestamp:i,sessionId:o,projectId:l,type:d}:null}).filter(e=>null!==e).sort((e,t)=>{let n=Date.parse(t.timestamp)-Date.parse(e.timestamp);return 0!==n?n:t.id.localeCompare(e.id)}));if(0===c.length){g.current=!0;return}if(h.current=c[0]?.timestamp??null,e||!g.current){for(let e of c)m.current.add(l(e));g.current=!0;return}let u=c.filter(e=>!m.current.has(l(e)));for(let e of c)m.current.add(l(e));if(0===u.length)return;let b=u.find(e=>"high"===e.priority)??u.find(e=>"medium"===e.priority)??u[0]??null;if(!b||"low"===b.priority||!p.current)return;await (0,i.$E)(f.current)}catch{}})();v.current=t;try{await t}finally{v.current===t&&(v.current=null),g.current=!0}},C=()=>{d(y),!w&&o()&&(y.current=window.setTimeout(()=>{x(!1).finally(()=>{C()})},1e4))},k=()=>{!w&&o()&&x(!g.current).finally(()=>{C()})},A=()=>{o()?k():d(y)},j=()=>{o()&&k()},S=()=>{(0,i.zu)()};return k(),window.addEventListener("focus",j),document.addEventListener("visibilitychange",A),window.addEventListener("pointerdown",S,!0),window.addEventListener("touchstart",S,!0),window.addEventListener("keydown",S,!0),()=>{w=!0,d(y),window.removeEventListener("focus",j),document.removeEventListener("visibilitychange",A),window.removeEventListener("pointerdown",S,!0),window.removeEventListener("touchstart",S,!0),window.removeEventListener("keydown",S,!0)}},[u,e,t])}},90124:(e,t,n)=>{n.d(t,{N:()=>c});var a=n(54568),r=n(7620);let i=new Map;for(let[e,t]of Object.entries({amp:["amp","amp-code","amp-cli","ampcode","agent-amp"],claude:["claude","claude-code","claude-cli","claudecode","ccr","claude-code-router","claude-mcp","claude-mcp-cli","claude-mcp-agent","agent-claude-code"],codex:["codex","openai-codex","codex-cli","codexcli","openai","agent-codex"],copilot:["copilot","github-copilot","githubcopilot","copilot-cli","agent-github-copilot"],cursor:["cursor","cursor-cli","cursor-agent","cursoragent","agent-cursor-cli"],droid:["droid","factory-droid","factory_droid","agent-droid"],gemini:["gemini","gemini-cli","google-gemini","googlegemini","agent-gemini"],opencode:["opencode","open-code","open_code","open-code-cli","agent-opencode"],qwen:["qwen","qwen-code","qwen_code","qwen-code-cli","agent-qwen-code"]}))for(let n of t)i.set(o(n),e);function o(e){return e.trim().toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/_+/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function s(e){let t=o(e);if(!t)return null;let n=i.get(t);if(n)return n;for(let e of t.split("-")){let t=i.get(e);if(t)return t}for(let[e,n]of i.entries())if(t===e||t.startsWith(`${e}-`)||t.endsWith(`-${e}`)||t.includes(`-${e}-`))return n;return null}function l(e){try{let t=new URL(e),n=s(t.hostname.replace(/^www\./,"").replace(/\./g,"-"));if(n)return n;return s(t.pathname.replace(/\//g,"-"))}catch{return s(e)}}function d({label:e,className:t}){let n=e.split(/[^a-z0-9]/iu).filter(Boolean).slice(0,2).map(e=>e[0]?.toUpperCase()).join("");return(0,a.jsx)("span",{"aria-hidden":"true",className:`inline-flex shrink-0 items-center justify-center rounded-[0.2rem] text-[9px] font-semibold text-white ${t}`,style:{backgroundColor:function(e){let t=["#14b8a6","#06b6d4","#0ea5e9","#8b5cf6","#ec4899","#f97316","#f59e0b","#ef4444","#22c55e","#84cc16"],n=0;for(let a=0;a<e.length;a+=1)n=(31*n+e.charCodeAt(a))%t.length;return t[Math.abs(n)%t.length]??"#6b7280"}(`${e}:${e.length}`)},children:n||"AI"})}function c({seed:e,className:t="h-6 w-6"}){let[n,i]=(0,r.useState)(0),o=e?.label?.trim()??"",u=(0,r.useMemo)(()=>{var t;if(!o)return[];let n=s((t={label:o,iconUrl:e?.iconUrl,homepage:e?.homepage}).label)??(t.homepage?l(t.homepage):null)??(t.iconUrl?l(t.iconUrl):null),a="string"==typeof e?.iconUrl&&e.iconUrl.trim().length>0?e.iconUrl.trim():null,r=[];return n&&(r.push(`/agents/${n}-dark.svg`),r.push(`/agents/${n}-light.svg`)),a&&r.push(a),r},[o,e?.homepage,e?.iconUrl]);if((0,r.useEffect)(()=>{i(0)},[o,u]),!o)return(0,a.jsx)(d,{label:"AI",className:t});let p=u[n]??null;return p?(0,a.jsx)("img",{src:p,alt:`${o} icon`,loading:"lazy",className:`${t} shrink-0 rounded-[0.2rem] object-contain scale-125`,onError:()=>i(e=>e+1)}):(0,a.jsx)(d,{label:o,className:t})}},95106:(e,t,n)=>{n.d(t,{t:()=>r});var a=n(75120);function r(e,t){return(0,a.eI)(e,t)}}}]);
@@ -1 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{22538:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});var o=t(5974);let n=(0,o.createServerReference)("00db8b0780708a2c1a907f80719fd178c919d685d4",o.callServer,void 0,o.findSourceMapURL,"detectKeylessEnvDriftAction")},24876:(e,r,t)=>{Promise.resolve().then(t.bind(t,37204)),Promise.resolve().then(t.bind(t,36727)),Promise.resolve().then(t.bind(t,76940)),Promise.resolve().then(t.bind(t,48914)),Promise.resolve().then(t.bind(t,30679)),Promise.resolve().then(t.bind(t,62520)),Promise.resolve().then(t.bind(t,93603)),Promise.resolve().then(t.t.bind(t,48477,23)),Promise.resolve().then(t.t.bind(t,91745,23)),Promise.resolve().then(t.t.bind(t,31008,23)),Promise.resolve().then(t.t.bind(t,78578,23)),Promise.resolve().then(t.t.bind(t,74471,23)),Promise.resolve().then(t.bind(t,48204)),Promise.resolve().then(t.bind(t,92690))},46916:(e,r,t)=>{"use strict";t.d(r,{cn:()=>s});var o=t(9917),n=t(2809);function s(...e){return(0,n.QP)((0,o.$)(e))}},48204:(e,r,t)=>{"use strict";t.d(r,{ThemeProvider:()=>i});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function d(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function i({children:e}){let[r,t]=(0,n.useState)("dark");(0,n.useEffect)(()=>{let e=localStorage.getItem("conductor-theme");if("light"===e||"dark"===e){t(e),d(e);return}d("dark")},[]);let a=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),d(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:a},children:e})}},53684:(e,r,t)=>{"use strict";t.d(r,{y:()=>n});var o=t(5974);let n=(0,o.createServerReference)("00b93ac06f8d9b6c6ca36e335d44243249f20ddd5d",o.callServer,void 0,o.findSourceMapURL,"invalidateCacheAction")},74471:()=>{},92690:(e,r,t)=>{"use strict";t.d(r,{TooltipProvider:()=>i});var o=t(54568),n=t(97257),s=t(7620),d=t(46916);let i=n.Kq;n.bL,n.l9,(0,s.forwardRef)(({className:e,sideOffset:r=8,...t},s)=>(0,o.jsx)(n.ZL,{children:(0,o.jsx)(n.UC,{ref:s,sideOffset:r,className:(0,d.cn)("z-50 rounded-[var(--radius-xs)] border border-[var(--border-strong)] bg-[var(--bg-panel)] px-2 py-1.5","text-[11px] text-[var(--text-normal)] shadow-[var(--shadow-soft)]","animate-in fade-in-0 zoom-in-95",e),...t})})).displayName="TooltipContent"}},e=>{e.O(0,[7547,3357,524,3051,7220,587,1968,7358],()=>e(e.s=24876)),_N_E=e.O()}]);