conductor-oss 0.58.39 → 0.58.41
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.
- package/package.json +5 -5
- package/web/.next/standalone/packages/web/.next/BUILD_ID +1 -1
- package/web/.next/standalone/packages/web/.next/app-path-routes-manifest.json +4 -4
- package/web/.next/standalone/packages/web/.next/build-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/prerender-manifest.json +3 -3
- package/web/.next/standalone/packages/web/.next/react-loadable-manifest.json +5 -5
- package/web/.next/standalone/packages/web/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/api/sessions/[id]/preview/route.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/bridge/connect/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/embed/terminal/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sessions/[id]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/settings/bridge/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/[[...sign-in]]/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/hosted/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/sign-in/sso-callback/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page.js.nft.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/app/unlock/page_client-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/app-paths-manifest.json +4 -4
- package/web/.next/standalone/packages/web/.next/server/chunks/107.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/1564.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/177.js +1 -0
- package/web/.next/standalone/packages/web/.next/server/chunks/2089.js +3 -3
- package/web/.next/standalone/packages/web/.next/server/chunks/3990.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/6054.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/9455.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware-build-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/middleware-react-loadable-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/next-font-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/next-font-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/server/pages/500.html +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.js +1 -1
- package/web/.next/standalone/packages/web/.next/server/server-reference-manifest.json +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/2799.1e0f8bbd84a63128.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{4443.611b659fd26e567b.js → 4443.21500483f2024d8e.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/474.0468442a7b5947e9.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/8462.f878c844419c1a0c.js +1 -0
- package/web/.next/{static/chunks/8510-eb40f26ac825fca3.js → standalone/packages/web/.next/static/chunks/8510-5c551d5a3d4b390c.js} +1 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-b196fb7d7e558466.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/app/page-970687afb211d9f8.js +1 -0
- package/web/.next/standalone/packages/web/.next/static/chunks/{webpack-b8e6b1ccb85a3faa.js → webpack-59e3530274e2a5a1.js} +1 -1
- package/web/.next/static/chunks/2799.1e0f8bbd84a63128.js +1 -0
- package/web/.next/static/chunks/{4443.611b659fd26e567b.js → 4443.21500483f2024d8e.js} +1 -1
- package/web/.next/static/chunks/474.0468442a7b5947e9.js +1 -0
- package/web/.next/static/chunks/8462.f878c844419c1a0c.js +1 -0
- package/web/.next/{standalone/packages/web/.next/static/chunks/8510-eb40f26ac825fca3.js → static/chunks/8510-5c551d5a3d4b390c.js} +1 -1
- package/web/.next/static/chunks/app/layout-b196fb7d7e558466.js +1 -0
- package/web/.next/static/chunks/app/page-970687afb211d9f8.js +1 -0
- package/web/.next/static/chunks/{webpack-b8e6b1ccb85a3faa.js → webpack-59e3530274e2a5a1.js} +1 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/2553.js +0 -1
- package/web/.next/standalone/packages/web/.next/server/chunks/60.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/2799.d54bac0b61a6c631.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/474.d51d3c524fefdcc2.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/7649.96df81c61d4eeaaa.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/layout-40d6d4ccf615ee62.js +0 -1
- package/web/.next/standalone/packages/web/.next/static/chunks/app/page-b6a5c403840a5555.js +0 -1
- package/web/.next/static/chunks/2799.d54bac0b61a6c631.js +0 -1
- package/web/.next/static/chunks/474.d51d3c524fefdcc2.js +0 -1
- package/web/.next/static/chunks/7649.96df81c61d4eeaaa.js +0 -1
- package/web/.next/static/chunks/app/layout-40d6d4ccf615ee62.js +0 -1
- package/web/.next/static/chunks/app/page-b6a5c403840a5555.js +0 -1
- /package/web/.next/standalone/packages/web/.next/static/{W7Ix_gUgmq_cKa_iZEKIf → BoRHND7Qzg9aFwUgEoPWa}/_buildManifest.js +0 -0
- /package/web/.next/standalone/packages/web/.next/static/{W7Ix_gUgmq_cKa_iZEKIf → BoRHND7Qzg9aFwUgEoPWa}/_ssgManifest.js +0 -0
- /package/web/.next/static/{W7Ix_gUgmq_cKa_iZEKIf → BoRHND7Qzg9aFwUgEoPWa}/_buildManifest.js +0 -0
- /package/web/.next/static/{W7Ix_gUgmq_cKa_iZEKIf → BoRHND7Qzg9aFwUgEoPWa}/_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:()=>ei,SettingsDialog:()=>ex});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 k=r(34309),f=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 R=r(5739),E=r(33866),P=r(72410),U=r(31404),$=r(85626);r(51164);var M=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 B(e){return e?e.split("-").map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" "):"No access"}function F({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-[color:color-mix(in_srgb,var(--vk-accent)_14%,transparent)] text-[26px] font-semibold text-[var(--vk-accent)]",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:B(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)(F,{label:"Display Name",value:n}),(0,a.jsx)(F,{label:"Email",value:o}),(0,a.jsx)(F,{label:"GitHub Username",value:i,href:e?.githubProfileUrl??null}),(0,a.jsx)(F,{label:"Username",value:e?.username??"Not available"}),(0,a.jsx)(F,{label:"Auth Provider",value:L(e?.provider??null)}),(0,a.jsx)(F,{label:"Access Role",value:B(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)(M.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 q=r(88272);let O="claude-code";function I(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function z(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,64)}function G(e){let t=e.trim();return t?t.split(/[\\/]+/).filter(Boolean).at(-1)??null:null}function W(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}}function Z(e,t,r){let a=t?.trim();if(a)return a;let s=W(e);if(s)return s;let l=r?.trim();return l||"workspace"}function V(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 Y=[{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}],J=[{id:"preferences",label:"Preferences",icon:b.A,implemented:!0},{id:"repositories",label:"Repository",icon:p.A,implemented:!0}],X=[{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"}],K=[{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 Q(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function ee(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 et(e,t){let r=Q(e),a=Q(r.trustedHeaders),s=Q(r.roles),l=Q(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:ee(s.viewers),operators:ee(s.operators),admins:ee(s.admins),viewerDomains:ee(s.viewerDomains),operatorDomains:ee(s.operatorDomains),adminDomains:ee(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 er(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 ea="block h-4 w-4 shrink-0";function es(e){return JSON.stringify(e)}let el={obsidian:{kind:"icon",icon:o.mWn,className:`${ea} text-[#8b5cf6]`},vscode:{kind:"icon",icon:i.$$9,className:`${ea} text-[#22a3f5]`},notion:{kind:"icon",icon:o.i4$,className:`${ea} text-white`},logseq:{kind:"image",imageSrc:"/icons/editors/logseq.svg",className:`${ea} object-contain`},typora:{kind:"image",imageSrc:"/icons/editors/typora-32.png",className:`${ea} rounded-[3px] bg-white/90 p-[1px] object-contain`},custom:{kind:"icon",icon:x.A,className:`${ea} text-[var(--vk-text-muted)]`}};function en({editorId:e}){let t=el[e];if(!t)return(0,a.jsx)(g,{className:`${ea} 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 eo({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=(0,q.Ik)(e,t,r),c=(0,q.xb)(s)??s.catalogModel,x=(0,q.iL)(e,t,r,c),p=er(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=(0,q.iL)(e,t,r,l);n({...s,catalogModel:l,reasoningEffort:o.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,q.YS)(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:[p?`Filtered for ${p}.`:"Filtered for your current access preference."," Leave custom override blank to use this selection."]})]}),x.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:x.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=(0,q.iL)(e,t,r,o);n({...s,customModel:l,reasoningEffort:i.some(e=>e.id===s.reasoningEffort)?s.reasoningEffort:(0,q.YS)(e,t,r,o)})},placeholder:(0,q.ZA)(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 ei({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,P]=(0,n.useState)(""),[$,M]=(0,n.useState)(""),[D,L]=(0,n.useState)(""),[B,F]=(0,n.useState)("main"),[_,T]=(0,n.useState)(d),[Y,J]=(0,n.useState)((0,q.Z3)()),[X,K]=(0,n.useState)(!0),[Q,ee]=(0,n.useState)(!0),[et,er]=(0,n.useState)([]),[ea,es]=(0,n.useState)(!1),[el,en]=(0,n.useState)(!1),[ec,ex]=(0,n.useState)(null),[ep,ev]=(0,n.useState)(""),[em,eu]=(0,n.useState)(""),[eh,eb]=(0,n.useState)(!1),[eg,ek]=(0,n.useState)("local"),[ef,ej]=(0,n.useState)([]),[eN,ey]=(0,n.useState)(!1),[ew,eC]=(0,n.useState)(null);(0,n.useEffect)(()=>{e&&(u("git"),b("source"),C(""),A(!1),P(""),M(""),L(""),F("main"),ee(!0),K(!0),T(d),J((0,q.Z3)()),er([]),en(!1),ex(null),ev(""),eu(""),ej([]),eC(null),ey(!1),eb(!1),ek("local"))},[d,e]),(0,n.useEffect)(()=>{e&&J(e=>{let t=(0,q.c0)(_,x,p,(0,q.xb)(e)??null,(0,q.aB)(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:$.trim().length>0;"source"===h||t||b("source")},[H,$,m,e,h]);let eS=(0,n.useMemo)(()=>{let e;return 0===(e=ep.trim().toLowerCase()).length?et:et.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))},[ep,et]),eA=(0,n.useMemo)(()=>{let e=et.find(e=>e.httpsUrl===em);return e||(H.trim()?et.find(e=>e.httpsUrl===H.trim())??null:null)},[H,et,em]),eH=(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})(ep),[ep]),eR=(0,n.useMemo)(()=>{let e;return(e=ep.trim())&&/^(https?:\/\/|git@)/i.test(e)?e:null},[ep]),eE=(0,n.useMemo)(()=>V(eA?.updatedAt),[eA]),eP=(0,n.useMemo)(()=>{let e=eH??eR;return!!e&&e.toLowerCase()!==H.trim().toLowerCase()},[H,eH,eR]),eU="git"===m?H.trim().length>0:$.trim().length>0,e$=(0,n.useMemo)(()=>{let e=z(g);return e||("git"===m?z(Z(H,eA?.name)):z(G($)??"workspace"))},[H,$,m,g,eA?.name]),eM=(0,n.useMemo)(()=>Z(H,eA?.name,e$),[e$,H,eA?.name]),eD=(0,n.useMemo)(()=>{if(0===D.trim().length)return"";let e=D.trim().replace(/[\\/]+$/,""),t=eM.trim().replace(/^[\\/]+/,"");if(!e)return t;if(!t)return e;let r=e.includes("\\")&&!e.includes("/")?"\\":"/";return`${e}${r}${t}`},[eM,D]),eL=(0,n.useMemo)(()=>"git"===m?eA?.fullName??H.trim():G($)??$.trim(),[H,$,m,eA]),eB=(0,n.useMemo)(()=>"git"===m?eA?.description?.trim()||H.trim():$.trim(),[H,$,m,eA]),eF=(0,n.useMemo)(()=>{let e=[...new Set(c)];0===e.length&&e.push(d||O);let t=new Map(E.BO.map((e,t)=>[e,t]));return e.sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[c,d]);(0,n.useEffect)(()=>{eF.includes(_)||T(eF[0]??O)},[_,eF]);let e_=async(e=!1)=>{es(!0),ex(null);try{let t=await fetch((0,U.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})`);er(Array.isArray(r?.repos)?r.repos:[])}catch(e){er([]),ex(e instanceof Error?e.message:"Failed to load GitHub repositories")}finally{en(!0),es(!1)}};(0,n.useEffect)(()=>{!e||"git"!==m||ea||el||e_()},[el,ea,m,e]);let eT=async e=>{let t=e?.gitUrl??("git"===m?H.trim():""),r=e?.path??("local"===m?$.trim():"");if(0===t.length&&0===r.length)return void eC("git"===m?"Choose or paste a repository first.":"Select a local repository path first.");ey(!0),eC(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,U.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):[];ej(l);let n="string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??null;n&&(0===B.trim().length||!l.includes(B))&&F(n)}catch(e){ej([]),eC(e instanceof Error?e.message:"Failed to load branches")}finally{ey(!1)}},eq=async e=>{eu(e);let t=et.find(t=>t.httpsUrl===e);t&&(P(t.httpsUrl),ev(t.fullName),F(t.defaultBranch||"main"),S||C(z(t.name)||g),await eT({gitUrl:t.httpsUrl}),b("details"))},eO=async()=>{let e=eH??eR;if(!e)return;let t=et.find(t=>t.httpsUrl.toLowerCase()===e.toLowerCase())??null;if(t)return void await eq(t.httpsUrl);if(eu(""),P(e),F("main"),ej([]),eC(null),!S){let t=W(e);t&&C(z(t))}await eT({gitUrl:e}),b("details")},eI=e=>{ek(e),eb(!0)},ez=e=>{u(e),b("source"),ej([]),eC(null)};if(!e)return null;let eG=eU&&B.trim().length>0;async function eW(e){if(e.preventDefault(),"review"!==h||!eG||o)return;let t="git"===m?{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,q.xb)(Y)??"",agentReasoningEffort:(0,q.aB)(Y)??"",defaultBranch:B.trim(),useWorktree:X,gitUrl:H.trim(),path:eD||void 0}:{mode:m,projectId:e$||void 0,agent:_,agentModel:(0,q.xb)(Y)??"",agentReasoningEffort:(0,q.aB)(Y)??"",defaultBranch:B.trim(),useWorktree:X,path:$.trim(),initializeGit:Q};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||eh||t()},role:"presentation",children:(0,a.jsxs)("form",{onSubmit:eW,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 3":"details"===h?"Step 2 of 3":"Step 3 of 3"})]}),(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.":"details"===h?"Confirm the project defaults Conductor should use when this workspace is created.":"Review the project and destination details before Conductor adds it."}),(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:"Project"},{id:"review",label:"Review"}].map(e=>{let t=h===e.id,r="source"===e.id?"source"!==h&&eU:"details"===e.id&&"review"===h;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)(k.A,{className:"h-3 w-3"}):"source"===e.id?"1":"details"===e.id?"2":"3"}),(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)(f.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:()=>ez("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:()=>ez("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:()=>{en(!1),e_(!0)},disabled:ea,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:ea?(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:ep,onChange:e=>ev(e.target.value),onKeyDown:e=>{"Enter"===e.key&&eP&&(e.preventDefault(),eO())},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)]"})]}),eP?(0,a.jsxs)("button",{type:"button",onClick:()=>{eO()},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 ",eH?"this GitHub repository":"pasted repository URL"]})]}):null,ea&&0===et.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,ec?(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:ec}),(0,a.jsx)("button",{type:"button",onClick:()=>{en(!1),e_(!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,!ec&&eS.length>0?(0,a.jsx)("div",{className:"max-h-[min(42dvh,340px)] space-y-2 overflow-y-auto pr-1",children:eS.map(e=>{let t=V(e.updatedAt),r=eA?.httpsUrl===e.httpsUrl;return(0,a.jsxs)("button",{type:"button",onClick:()=>{eq(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)(k.A,{className:"h-4 w-4"}):null})]},e.httpsUrl)})}):null,ea||ec||0!==eS.length?null:(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:ep.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:()=>eI("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"}),$.trim().length>0?"Choose another folder":"Choose folder"]}),$.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:$})]}):(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]}):"details"===h?(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:eL}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eB}),(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:[eA?.private?(0,a.jsx)(s.XAi,{className:"h-3 w-3"}):(0,a.jsx)(s.uj0,{className:"h-3 w-3"}),eA?eA.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"}),B||"main"]}),eA?.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:eA.ownerLogin}):null,eE?(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:eE}):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:B,onChange:e=>F(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:()=>{eT()},disabled:eN,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:eN?(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"})})]}),ef.length>0?(0,a.jsx)("select",{value:B,onChange:e=>F(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:ef.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}):null,ew?(0,a.jsx)("p",{className:"mt-1 text-[11px] text-[var(--vk-red)]",children:ew}):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: ",I(_)]}),(0,a.jsx)("span",{className:"inline-flex rounded-full border border-[var(--vk-border)] px-2 py-0.5",children:X?"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:Q?"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)(eo,{compact:!0,agent:_,modelAccess:x,runtimeModelCatalogs:p,selection:Y,onChange:J})})]}):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:eF.map(e=>(0,a.jsx)("option",{value:e,className:"bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)]",children:I(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:X,onChange:e=>K(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:Q,onChange:e=>ee(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 parent folder"}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("input",{value:D,readOnly:!0,onClick:()=>eI("clone"),placeholder:"Leave empty to use Conductor's default repo 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:()=>eI("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"})})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-5 text-[var(--vk-text-muted)]",children:eD?`Conductor will create ${eD}.`:"Conductor will create the cloned repository inside the selected parent folder."})]})]})]}),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.jsxs)("div",{className:"rounded-[10px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] p-3 sm:p-4",children:[(0,a.jsx)("p",{className:"text-[13px] font-medium text-[var(--vk-text-strong)]",children:"Review project"}),(0,a.jsxs)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:["Conductor will add ",(0,a.jsx)("span",{className:"font-medium text-[var(--vk-text-normal)]",children:e$||"workspace"})," ","and sync the board plus support files for this project."]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:[(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)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Project"}),(0,a.jsx)("p",{className:"mt-2 text-[15px] font-medium text-[var(--vk-text-strong)]",children:e$||"workspace"}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:g.trim().length>0?"Uses the custom workspace name you entered.":"Auto-derived from the selected repository or folder."})]}),(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)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Source"}),(0,a.jsx)("p",{className:"mt-2 break-words text-[15px] font-medium text-[var(--vk-text-strong)]",children:eL}),(0,a.jsx)("p",{className:"mt-1 break-all text-[12px] leading-5 text-[var(--vk-text-muted)]",children:eB})]}),(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)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Destination"}),(0,a.jsx)("p",{className:"mt-2 break-all text-[15px] font-medium text-[var(--vk-text-strong)]",children:"git"===m?eD||"Conductor default repo location":$}),(0,a.jsx)("p",{className:"mt-1 text-[12px] leading-5 text-[var(--vk-text-muted)]",children:"git"===m?eD?`The repository will be cloned into ${eD}.`:"Conductor will choose the default clone location for this repository.":"Conductor will link the selected folder directly."})]}),(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)("p",{className:"text-[12px] uppercase tracking-[0.08em] text-[var(--vk-text-muted)]",children:"Runtime Defaults"}),(0,a.jsxs)("div",{className:"mt-2 space-y-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,a.jsxs)("p",{children:["Branch: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:B.trim()||"main"})]}),(0,a.jsxs)("p",{children:["Agent: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:I(_)})]}),(0,a.jsxs)("p",{children:["Isolation: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:X?"Worktree enabled":"Runs on selected branch"})]}),(0,q.xb)(Y)?(0,a.jsxs)("p",{children:["Model: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,q.xb)(Y)})]}):null,(0,q.aB)(Y)?(0,a.jsxs)("p",{children:["Reasoning: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:(0,q.aB)(Y)})]}):null,"local"===m?(0,a.jsxs)("p",{children:["Git init: ",(0,a.jsx)("span",{className:"text-[var(--vk-text-strong)]",children:Q?"Enabled if needed":"Disabled"})]}):null]})]})]}),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"):eI("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"})]}):"details"===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:()=>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:"button",onClick:()=>{eU&&0!==B.trim().length&&!o&&b("review")},disabled:!eG||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:"Review"})]}):(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("details"),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:!eG||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)(ed,{open:eh,bridgeId:v,initialPath:"clone"===eg?D:$,title:"local"===eg?"Select Local Repository":"Select Clone Parent Folder",description:"local"===eg?"Choose the local repository folder.":"Choose the parent folder where Conductor should create the cloned repository.",onClose:()=>eb(!1),onSelect:e=>{if(eb(!1),e){if("clone"===eg)return void L(e);if(M(e),!S){let t=G(e);t&&C(z(t))}eT({path:e}),b("details")}}})]})}function ed({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),[k,f]=(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),f(null),fetch((0,U.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=>{f(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),f(null);try{let r=e&&e.trim().length>0?`?path=${encodeURIComponent(e.trim())}`:"",a=await fetch((0,U.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){f(e instanceof Error?e.message:"Failed to load directory"),m([])}finally{g(!1)}},H=async()=>{w(!0);try{let e=await fetch((0,U.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..."}):k?(0,a.jsx)("div",{className:"px-3 py-3 text-[12px] text-[var(--vk-red)]",children:k}):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 ec({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)(k.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 ex({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,M]=(0,n.useState)("preferences"),[D,L]=(0,n.useState)(o.codingAgent),[B,F]=(0,n.useState)(o.ide),[_,z]=(0,n.useState)(o.markdownEditor),[G,W]=(0,n.useState)(o.markdownEditorPath??""),[Z,V]=(0,n.useState)(o.modelAccess),[Q,ee]=(0,n.useState)(o.notifications.soundEnabled),[ea,el]=(0,n.useState)(o.notifications.soundFile),[ei,ep]=(0,n.useState)([]),[ev,em]=(0,n.useState)(!1),[eu,eh]=(0,n.useState)(!1),[eb,eg]=(0,n.useState)(null),[ek,ef]=(0,n.useState)(""),[ej,eN]=(0,n.useState)(null),[ey,ew]=(0,n.useState)((0,q.Z3)()),[eC,eS]=(0,n.useState)([]),[eA,eH]=(0,n.useState)(!1),[eR,eE]=(0,n.useState)(null),[eP,eU]=(0,n.useState)(!1),[e$,eM]=(0,n.useState)(!1),[eD,eL]=(0,n.useState)(()=>et(null)),[eB,eF]=(0,n.useState)(!1),[e_,eT]=(0,n.useState)(!1),[eq,eO]=(0,n.useState)(null),[eI,ez]=(0,n.useState)(null),[eG,eW]=(0,n.useState)(!1),[eZ,eV]=(0,n.useState)(null),eY=r||eu||e_;function eJ(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 eX(e){return e.split(/\n+/g).map(e=>e.trim()).filter(Boolean)}async function eK(e){em(!0),eg(null);try{let t=await fetch((0,U.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:[];ep(a);let s=a[0]?.id??"",l=e&&a.some(t=>t.id===e)?e:ek&&a.some(e=>e.id===ek)?ek:s;ef(l)}catch(e){ep([]),ef(""),eN(null),ew((0,q.Z3)()),eg(e instanceof Error?e.message:"Failed to load repositories")}finally{em(!1)}}async function eQ(e,t){let r=(e??ej?.path??"").trim();if(0===r.length){eE("Select a repository path first."),eS([]);return}eH(!0),eE(null);try{let e=new URLSearchParams({path:r}),a=await fetch((0,U.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):[];eS(l);let n=t?.trim()||("string"==typeof s?.defaultBranch&&s.defaultBranch.trim().length>0?s.defaultBranch.trim():l[0]??"");if(!n)return;eN(e=>!e||e.defaultBranch.trim().length>0&&l.includes(e.defaultBranch)?e:{...e,defaultBranch:n})}catch(e){eS([]),eE(e instanceof Error?e.message:"Failed to detect branches")}finally{eH(!1)}}async function e0(){if(!ej||eu||0===ej.repo.trim().length||0===ej.path.trim().length)return!1;eh(!0),eg(null);try{let e=await fetch((0,U.S)("/api/repositories",b),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:ej.id,displayName:ej.displayName,repo:ej.repo,path:ej.path,agent:ej.agent,agentPermissions:ej.agentPermissions,agentModel:(0,q.xb)(ey)??"",agentReasoningEffort:(0,q.aB)(ey)??"",defaultWorkingDirectory:ej.defaultWorkingDirectory,defaultBranch:ej.defaultBranch,devServerScript:ej.devServerScript,devServerCwd:ej.devServerCwd,devServerUrl:ej.devServerUrl,devServerPort:ej.devServerPort,devServerHost:ej.devServerHost,devServerPath:ej.devServerPath,devServerHttps:ej.devServerHttps,setupScript:ej.setupScript,runSetupInParallel:ej.runSetupInParallel,cleanupScript:ej.cleanupScript,archiveScript:ej.archiveScript,copyFiles:ej.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 ep(e=>e.map(e=>e.id===r.id?r:e)),eN(eJ(r)),ef(r.id),eE(null),await eQ(r.path,r.defaultBranch),p&&await p(),!0}catch(e){return eg(e instanceof Error?e.message:"Failed to save repository settings"),!1}finally{eh(!1)}}async function e1(){eF(!0),eO(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})`);eL(et(t?.access,t?.current))}catch(e){eL(et(null)),eO(e instanceof Error?e.message:"Failed to load organization settings")}finally{eF(!1)}}async function e2(){eW(!0),eV(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),eV(e instanceof Error?e.message:"Failed to load profile")}finally{eW(!1)}}async function e3(){if(e_)return!1;eT(!0),eO(null);try{let e=await fetch("/api/access",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireAuth:eD.requireAuth||eD.trustedHeaders.enabled,defaultRole:eD.defaultRole,trustedHeaders:{enabled:eD.trustedHeaders.enabled,provider:"cloudflare-access",emailHeader:eD.trustedHeaders.emailHeader,jwtHeader:eD.trustedHeaders.jwtHeader,teamDomain:eD.trustedHeaders.teamDomain,audience:eD.trustedHeaders.audience},roles:{viewers:eX(eD.roles.viewers),operators:eX(eD.roles.operators),admins:eX(eD.roles.admins),viewerDomains:eX(eD.roles.viewerDomains),operatorDomains:eX(eD.roles.operatorDomains),adminDomains:eX(eD.roles.adminDomains)}})}),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to save organization settings (${e.status})`);return eL(et(t?.access,t?.current)),!0}catch(e){return eO(e instanceof Error?e.message:"Failed to save organization settings"),!1}finally{eT(!1)}}(0,n.useEffect)(()=>{e&&(M("onboarding"===t?"preferences":"general"),L(o.codingAgent),F(o.ide),z(o.markdownEditor),W(o.markdownEditorPath??""),V(o.modelAccess),ee(o.notifications.soundEnabled),el(o.notifications.soundFile),eS([]),eE(null),eg(null),ew((0,q.Z3)()),eO(null),ez(null),eV(null))},[t,e]),(0,n.useEffect)(()=>{e&&("settings"===t||"repositories"===S)&&eK()},[S,t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&e1()},[t,e]),(0,n.useEffect)(()=>{e&&"onboarding"!==t&&"profile"===S&&e2()},[S,t,e]),(0,n.useEffect)(()=>{if(!e)return;if(!ek){eN(null),ew((0,q.Z3)());return}let t=ei.find(e=>e.id===ek);if(!t)return;let r=(0,E.a6)(t.agent,D||O);eN(eJ({...t,agent:r})),ew((0,q.c0)(r,Z,x,t.agentModel,t.agentReasoningEffort)),eS([]),eE(null),t.path.trim().length>0&&eQ(t.path,t.defaultBranch)},[D,Z,e,ei,x,ek]);let e4="onboarding"===t&&i>0,e5=(0,n.useMemo)(()=>"onboarding"===t?e4?J:J.filter(e=>"preferences"===e.id):Y.filter(e=>e.implemented),[t,e4]),e9=e5.find(e=>e.id===S)??e5[0]??Y[0],e8="onboarding"===t,e6="preferences"===e9.id,e7="profile"===e9.id,te="general"===e9.id,tt="agents"===e9.id,tr=e6||te||tt,ta="repositories"===e9.id,ts="organization"===e9.id,tl=e5.findIndex(e=>e.id===e9.id)+1,tn=e5.some(e=>"repositories"===e.id),to="admin"===eD.current.role,ti=(0,n.useMemo)(()=>{let e=new Set((0,E.Ge)(d));D.trim().length>0&&(0,E.iQ)(D)&&e.add(D),0===e.size&&e.add(O);let t=new Map(E.BO.map((e,t)=>[e,t]));return[...e].sort((e,r)=>{let a=t.get((0,R.q)(e))??Number.MAX_SAFE_INTEGER,s=t.get((0,R.q)(r))??Number.MAX_SAFE_INTEGER;return a!==s?a-s:I(e).localeCompare(I(r))})},[d,D]);(0,n.useEffect)(()=>{0!==ti.length&&(D&&ti.includes(D)||L((0,E.a6)(D,ti[0]??O)))},[D,ti]);let td=c[(0,R.q)(D)]??null;if(!e)return null;let tc=D.trim().length>0&&B.trim().length>0&&_.trim().length>0,tx=!!ej&&ej.displayName.trim().length>0&&ej.repo.trim().length>0&&ej.path.trim().length>0&&ej.defaultBranch.trim().length>0,tp=to&&!eB&&(!eD.trustedHeaders.enabled||eD.trustedHeaders.teamDomain.trim().length>0&&eD.trustedHeaders.audience.trim().length>0),tv=ta?eb:ts?eq:e7?eZ:s,tm=ej?(g={...ej,agentModel:(0,q.xb)(ey)??"",agentReasoningEffort:(0,q.aB)(ey)??""},w={ide:B,markdownEditor:_},C=["npx --yes --registry=https://registry.npmjs.org conductor-oss@latest setup","--yes",`--path ${es(g.path)}`,`--project-id ${es(g.id)}`,`--display-name ${es(g.displayName)}`,`--agent ${es(g.agent||"claude-code")}`,`--ide ${es(w.ide)}`,`--markdown-editor ${es(w.markdownEditor)}`],g.repo.trim().length>0&&C.push(`--repo ${es(g.repo.trim())}`),g.defaultBranch.trim().length>0&&C.push(`--default-branch ${es(g.defaultBranch.trim())}`),g.agentModel.trim().length>0&&C.push(`--model ${es(g.agentModel.trim())}`),g.agentReasoningEffort.trim().length>0&&C.push(`--reasoning-effort ${es(g.agentReasoningEffort.trim())}`),g.defaultWorkingDirectory.trim().length>0&&C.push(`--default-working-directory ${es(g.defaultWorkingDirectory.trim())}`),C.join(" ")):"";async function tu(e,t){let a;if(!tc||r)return!1;let s=await h((a=Q?ea??K[0]?.id??"abstract-sound-4":null,{onboardingAcknowledged:!!e||o.onboardingAcknowledged,codingAgent:D.trim(),ide:B.trim(),markdownEditor:_.trim(),markdownEditorPath:(G??"").trim(),modelAccess:Z,notifications:{soundEnabled:Q,soundFile:a}}),t);return s&&td&&!td.ready&&m(D),s}async function th(){if(!ev){if(!tn){if(!await tu(!0,{closeDialog:!0}))return;v?.({needsProject:0===i});return}await tu(!1,{closeDialog:!1})&&M("repositories")}}async function tb(){(!ta||await e0())&&await tu(!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:()=>{eY||"onboarding"===t||eP||e$||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:e8?"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:e5.map(e=>{let t=e.icon,r=e9.id===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>M(e.id),disabled:eY,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-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":"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:e8?e6?"Choose your preferences":"Review repository defaults":e9.label}),e8&&(0,a.jsxs)("p",{className:"mt-1 text-[12px] text-[var(--vk-text-muted)]",children:["Step ",tl," of ",e5.length]})]}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:eY||"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)(f.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:tr?(0,a.jsxs)("div",{className:"space-y-5",children:[e8&&(0,a.jsx)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_10%,transparent)] 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 terminals and boards immediately."})}),(e6||tt)&&(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:ti.map(e=>{let t=D===e,r=c[(0,R.q)(e)]??null,s=er(e,Z),n=(0,q.Ik)(e,Z,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)(P.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:I(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,E.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)(k.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:ti.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,Z)??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))&&V(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)})})]})]}),(e6||te)&&(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:X.map(e=>{let t=_===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>z(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)(en,{editorId:e.id}),(0,a.jsx)("span",{className:"flex-1 text-[13px] text-[var(--vk-text-normal)]",children:e.label}),t&&(0,a.jsx)(k.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:()=>eM(!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:()=>eM(!0),disabled:eY,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:()=>W(""),disabled:eY,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:[K.map(e=>{let t=Q&&ea===e.id;return(0,a.jsxs)("button",{type:"button",onClick:()=>{ee(!0),el(e.id),(0,$.$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)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]},e.id)}),(0,a.jsxs)("button",{type:"button",onClick:()=>ee(!1),className:`flex items-center gap-2 rounded-[4px] border px-3 py-2 text-left ${!Q?"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"}),!Q&&(0,a.jsx)(k.A,{className:"h-3.5 w-3.5 text-[var(--vk-orange)]"})]})]})]})]})]}):e7?(0,a.jsx)(T,{profile:eI,loading:eG,error:eZ,onRefresh:()=>{e2()}}):ta?(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:e8?"Repository Defaults":"Repository Configuration"}),(0,a.jsx)("p",{className:"text-[14px] text-[var(--vk-text-muted)]",children:e8?"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||ei.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:ek,onChange:e=>ef(e.target.value),disabled:ev||0===ei.length||eY,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===ei.length&&(0,a.jsx)("option",{value:"",children:"No repositories configured"}),ei.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."}),ev&&(0,a.jsx)("p",{className:"text-[12px] text-[var(--vk-text-muted)]",children:"Loading repositories..."})]}),e8&&1===ei.length&&ej&&(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:[ej.displayName,(0,a.jsx)("span",{className:"ml-2 text-[var(--vk-text-muted)]",children:ej.path})]})]}),ej&&(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 --yes --registry=https://registry.npmjs.org 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: ",ej.workspaceMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["Runtime: ",ej.runtimeMode]}),(0,a.jsxs)("span",{className:"rounded-[999px] border border-[var(--vk-border)] px-2 py-1",children:["SCM: ",ej.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:tm})}),(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)(ec,{value:tm,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:ej.displayName,onChange:e=>eN(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:ej.repo,onChange:e=>eN(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:ej.agent,onChange:e=>{let t=e.target.value;eN(e=>e?{...e,agent:t}:e),ew((0,q.c0)(t,Z,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:ti.map(e=>(0,a.jsx)("option",{value:e,children:I(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)(ej.agent)&&(0,a.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] px-3 py-3",children:(0,a.jsx)(eo,{agent:ej.agent,modelAccess:Z,runtimeModelCatalogs:x,selection:ey,onChange:ew})}),(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:ej.agentPermissions,onChange:e=>eN(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:ej.path,readOnly:!0,onClick:()=>eU(!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:()=>eU(!0),disabled:eY,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"})})]}),!ej.pathHealth.exists&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:"Configured path does not exist on disk."}),ej.pathHealth.exists&&!ej.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."}),ej.pathHealth.suggestedPath&&(0,a.jsx)("button",{type:"button",onClick:()=>{let e=ej.pathHealth.suggestedPath??"";e&&(eN(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),eQ(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:ej.defaultWorkingDirectory,onChange:e=>eN(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:ej.defaultBranch,onChange:e=>eN(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:()=>{eQ()},disabled:eA,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:eA?(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"})})]}),eC.length>0&&(0,a.jsx)("select",{value:ej.defaultBranch,onChange:e=>eN(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:eC.map(e=>(0,a.jsx)("option",{value:e,children:e},e))}),eR&&(0,a.jsx)("p",{className:"mt-1 text-[12px] text-[var(--vk-red)]",children:eR})]})]}),"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:ej.devServerScript,onChange:e=>eN(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:ej.devServerCwd,onChange:e=>eN(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:ej.devServerUrl,onChange:e=>eN(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:ej.devServerPort,onChange:e=>eN(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:ej.devServerHost,onChange:e=>eN(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:ej.devServerPath,onChange:e=>eN(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:ej.devServerHttps,onChange:e=>eN(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:ej.setupScript,onChange:e=>eN(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:ej.runSetupInParallel,onChange:e=>eN(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:ej.cleanupScript,onChange:e=>eN(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:ej.archiveScript,onChange:e=>eN(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:ej.copyFiles,onChange:e=>eN(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."})]})]})]})]}):ts?(0,a.jsxs)("div",{className:"space-y-5",children:[(0,a.jsxs)("section",{className:"rounded-[6px] border border-[var(--vk-border)] bg-[color:color-mix(in_srgb,var(--vk-accent)_8%,transparent)] 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."})]}),eB?(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:eD.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:eD.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:eD.current.provider??"Local only"})]})]}),!to&&(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:eD.requireAuth,onChange:e=>eL(t=>({...t,requireAuth:e.target.checked})),disabled:!to||e_||eD.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:eD.defaultRole,onChange:e=>eL(t=>({...t,defaultRole:e.target.value})),disabled:!to||e_,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:eD.trustedHeaders.enabled,onChange:e=>eL(t=>({...t,requireAuth:!!e.target.checked||t.requireAuth,trustedHeaders:{...t.trustedHeaders,enabled:e.target.checked}})),disabled:!to||e_,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:eD.trustedHeaders.emailHeader,onChange:e=>eL(t=>({...t,trustedHeaders:{...t.trustedHeaders,emailHeader:e.target.value}})),disabled:!to||e_,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:eD.trustedHeaders.jwtHeader,onChange:e=>eL(t=>({...t,trustedHeaders:{...t.trustedHeaders,jwtHeader:e.target.value}})),disabled:!to||e_,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:eD.trustedHeaders.teamDomain,onChange:e=>eL(t=>({...t,trustedHeaders:{...t.trustedHeaders,teamDomain:e.target.value}})),disabled:!to||e_,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:eD.trustedHeaders.audience,onChange:e=>eL(t=>({...t,trustedHeaders:{...t.trustedHeaders,audience:e.target.value}})),disabled:!to||e_,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:eD.roles[t],onChange:e=>eL(r=>({...r,roles:{...r.roles,[t]:e.target.value}})),disabled:!to||e_,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:e9.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:()=>M("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:[tv&&(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:tv}),!tv&&tr&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:e8?"Finish setup once here. You can change these preferences any time from Settings.":"Preferences are saved to your conductor config and applied immediately."}),!tv&&ta&&(0,a.jsx)("p",{className:"text-[11px] text-[var(--vk-text-muted)]",children:e8?"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."}),!tv&&ts&&(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."}),!tv&&e7&&(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:[!e8&&(0,a.jsx)("button",{type:"button",onClick:u,disabled:eY,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"}),e8&&ta&&(0,a.jsx)("button",{type:"button",onClick:()=>M("preferences"),disabled:eY,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"}),tr&&!e8&&(0,a.jsx)("button",{type:"button",onClick:()=>{tu(o.onboardingAcknowledged,{closeDialog:!0})},disabled:!tc||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"}),ta&&!e8&&(0,a.jsx)("button",{type:"button",onClick:()=>{e0()},disabled:!tx||eu||ev,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:eu?(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"}),ts&&!e8&&(0,a.jsx)("button",{type:"button",onClick:()=>{e3()},disabled:!tp||e_,className:"inline-flex h-9 items-center rounded-[4px] bg-[var(--vk-bg-active)] px-3 text-[13px] text-[var(--vk-text-strong)] hover:bg-[var(--vk-bg-hover)] disabled:opacity-50",children:e_?(0,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"}),e8&&(0,a.jsx)("button",{type:"button",onClick:()=>{e6?th():tb()},disabled:e6?!tc||r||ev:!tx||eY,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:eY||e6&&ev?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.A,{className:"mr-1.5 h-3.5 w-3.5 animate-spin"}),e6&&ev?"Loading...":"Saving..."]}):e6&&tn?"Continue":"Finish Setup"})]})]})]})]})}),(0,a.jsx)(ed,{open:eP,bridgeId:b,initialPath:ej?.path,title:"Select Repository Path",description:"Choose the local git repository folder.",onClose:()=>eU(!1),onSelect:e=>{eU(!1),e&&(eN(t=>t?{...t,path:e,pathHealth:{...t.pathHealth,exists:!0,isGitRepository:!0,suggestedPath:null}}:t),eQ(e))}}),(0,a.jsx)(ed,{open:e$,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:()=>eM(!1),onSelect:e=>{eM(!1),null!==e&&W(e)}})]})}}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7649],{34441:(e,c,r)=>{r.d(c,{a:()=>t});var a=r(5974);let t=(0,a.createServerReference)("0056a043e7b275ff1a94e951b504cb5d5b7fea4808",a.callServer,void 0,a.findSourceMapURL,"createOrReadKeylessAction")},67649:(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)("0020ee235bab230e8215f50c6c37aaff8bd82b18e7",a.callServer,void 0,a.findSourceMapURL,"deleteKeylessAction");var s=r(34441),l=r(77066);let n=(0,a.createServerReference)("402ce17edc7360e1763794c2b2af42c153477dcb07",a.callServer,void 0,a.findSourceMapURL,"syncKeylessConfigAction")}}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7177],{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:()=>d});var o=t(54568),n=t(7620);let s=(0,n.createContext)({theme:"dark",toggleTheme:()=>{}});function i(e){let r=document.documentElement;r.classList.remove("dark","light"),r.classList.add(e)}function d({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),i(e);return}i("dark")},[]);let a=(0,n.useCallback)(()=>{t(e=>{let r="dark"===e?"light":"dark";return localStorage.setItem("conductor-theme",r),i(r),r})},[]);return(0,o.jsx)(s.Provider,{value:{theme:r,toggleTheme:a},children:e})}},74471:()=>{},77066:(e,r,t)=>{"use strict";t.d(r,{A:()=>n});var o=t(5974);let n=(0,o.createServerReference)("009396d30a8813ef0f7a2827d302825e6ee64e6f52",o.callServer,void 0,o.findSourceMapURL,"detectKeylessEnvDriftAction")},77144:(e,r,t)=>{"use strict";t.d(r,{y:()=>n});var o=t(5974);let n=(0,o.createServerReference)("00927a55359fd3edee8b795e6b31bf6af5db9598de",o.callServer,void 0,o.findSourceMapURL,"invalidateCacheAction")},92690:(e,r,t)=>{"use strict";t.d(r,{TooltipProvider:()=>d});var o=t(54568),n=t(97257),s=t(7620),i=t(46916);let d=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,i.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"},98709:(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,79584,23)),Promise.resolve().then(t.t.bind(t,84978,23)),Promise.resolve().then(t.t.bind(t,74471,23)),Promise.resolve().then(t.bind(t,48204)),Promise.resolve().then(t.bind(t,92690))}},e=>{e.O(0,[9271,9306,3357,524,3051,8510,587,1968,7358],()=>e(e.s=98709)),_N_E=e.O()}]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8974,9847],{12529:(e,t,n)=>{Promise.resolve().then(n.bind(n,60594))},33866:(e,t,n)=>{"use strict";n.d(t,{BO:()=>l,Ge:()=>d,a6:()=>c,h7:()=>i,iQ:()=>o,pN:()=>a});var r=n(5739);let a=[{name:"codex",label:"Codex",description:"OpenAI Codex CLI",homepage:"https://github.com/openai/codex",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/openai.svg",installHint:"npm install -g @openai/codex",installUrl:"https://github.com/openai/codex",setupUrl:"https://chatgpt.com/codex"},{name:"gemini",label:"Gemini",description:"Google Gemini CLI",homepage:"https://ai.google.dev/gemini-api/docs",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/googlegemini.svg",installHint:"npm install -g @google/gemini-cli",installUrl:"https://ai.google.dev/gemini-api/docs",setupUrl:"https://aistudio.google.com/"},{name:"qwen-code",label:"Qwen Code",description:"Qwen Code CLI",homepage:"https://qwenlm.github.io/announcements/",iconUrl:null,installHint:"npm install -g @qwen-code/qwen-code@latest",installUrl:"https://qwenlm.github.io/announcements/",setupUrl:"https://chat.qwen.ai/"},{name:"droid",label:"Droid",description:"Factory Droid CLI",homepage:"https://github.com/Factory-AI/factory",iconUrl:"https://raw.githubusercontent.com/Factory-AI/factory/main/docs/images/droid_logo_cli.png",installHint:"npm install -g @factory/cli",installUrl:"https://github.com/Factory-AI/factory"},{name:"claude-code",label:"Claude Code",description:"Claude Code CLI",homepage:"https://www.anthropic.com/claude",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/claude.svg",installHint:"npm install -g @anthropic-ai/claude-code",installUrl:"https://www.anthropic.com/claude-code",setupUrl:"https://claude.ai/"},{name:"amp",label:"Amp",description:"Amp Code CLI",homepage:"https://www.ampcode.com",iconUrl:"https://ampcode.com/amp-mark-color.svg",installHint:"npm install -g @sourcegraph/amp",installUrl:"https://www.ampcode.com"},{name:"hermes",label:"Hermes",description:"Nous Research Hermes Agent CLI",homepage:"https://hermes-agent.nousresearch.com/",iconUrl:"/agents/hermes.png",installHint:"curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash",installUrl:"https://hermes-agent.nousresearch.com/docs/getting-started/installation/",setupUrl:"https://hermes-agent.nousresearch.com/docs/getting-started/installation/"},{name:"opencode",label:"OpenCode",description:"OpenCode CLI",homepage:"https://opencode.ai",iconUrl:null,installHint:"npm install -g opencode-ai",installUrl:"https://opencode.ai"},{name:"letta",label:"Letta Code",description:"Letta Code CLI (memory-first agent)",homepage:"https://docs.letta.com/letta-code",iconUrl:"/agents/letta-light.svg",installHint:"npm install -g @letta-ai/letta-code",installUrl:"https://docs.letta.com/letta-code",setupUrl:"https://app.letta.com/"},{name:"openclaw",label:"OpenClaw",description:"OpenClaw gateway-backed chat runtime",homepage:"https://github.com/openclaw/openclaw#readme",iconUrl:null,installHint:"Configure the OpenClaw gateway in backend runtime settings",installUrl:"https://github.com/openclaw/openclaw",setupUrl:"https://github.com/openclaw/openclaw",surfaces:["dispatcher"]},{name:"github-copilot",label:"GitHub Copilot",description:"GitHub Copilot CLI",homepage:"https://docs.github.com/copilot/how-tos/copilot-cli",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/githubcopilot.svg",installHint:"npm install -g @github/copilot",installUrl:"https://docs.github.com/copilot/how-tos/copilot-cli",setupUrl:"https://github.com/settings/copilot"},{name:"cursor-cli",label:"Cursor Agent",description:"Cursor Agent CLI",homepage:"https://www.cursor.com",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/cursor.svg",installHint:"npm install -g cursor-agent"},{name:"ccr",label:"CCR",description:"Claude Code Router",homepage:"https://www.npmjs.com/package/@musistudio/claude-code-router",iconUrl:"https://cdn.jsdelivr.net/npm/simple-icons@latest/icons/claude.svg",installHint:"npm install -g @musistudio/claude-code-router",installUrl:"https://www.npmjs.com/package/@musistudio/claude-code-router"}],l=a.map(e=>e.name),s=new Map(a.map(e=>[(0,r.q)(e.name),e]));function i(e){return s.get((0,r.q)(e))??null}function o(e){let t=i(e);return!t||(t.surfaces?.includes("terminal")??!0)}function d(e){let t=[],n=new Set;for(let a of e){let e=a.trim();if(!e||!o(e))continue;let l=(0,r.q)(e);n.has(l)||(n.add(l),t.push(e))}return t}function c(e,t){let n="string"==typeof e?e.trim():"";if(n&&o(n))return n;let r=t.trim();return r&&o(r)?r:a.find(e=>o(e.name))?.name??"codex"}},51164:(e,t,n)=>{"use strict";n.d(t,{v:()=>c});var r=n(76196);let a=["pro","max","api"],l=["chatgpt","api"],s=["default"],i=["oauth","api"],o=["oauth","api"];function d(e,t,n){return"string"==typeof e&&t.includes(e)?e:n}function c(e){let t=!e||"object"!=typeof e||Array.isArray(e)?{}:{...e},n=(0,r.Zp)();return{amp:d(t.amp,s,n.amp),claudeCode:d(t.claudeCode,a,n.claudeCode),codex:d(t.codex,l,n.codex),cursorCli:d(t.cursorCli,s,n.cursorCli),droid:d(t.droid,s,n.droid),gemini:d(t.gemini,i,n.gemini),githubCopilot:d(t.githubCopilot,s,n.githubCopilot),opencode:d(t.opencode,s,n.opencode),qwenCode:d(t.qwenCode,o,n.qwenCode),ccr:d(t.ccr,s,n.ccr)}}},60594:(e,t,n)=>{"use strict";n.d(t,{default:()=>ej});var r=n(54568),a=n(42925),l=n(79748),s=n(7620),i=n(40448);n(76196);var o=n(52353),d=n(20487),c=n(50549),p=n(57917),u=n(21048),x=n(55341),m=n(30824),h=n(34737),g=n(20670),f=n(8008),v=n(58299),b=n(36645),w=n(84736),j=n(7086),k=n(54299),y=n(34041),N=n(34309),C=n(68476),A=n(20732),S=n(45894),I=n(5739),E=n(33866),M=n(35821),$=n(95106),L=n(53649),U=n(86011),P=n(31404),O=n(10926);let B=new Map,q=new Map;function F(e){let t=q.get(e);return t||(t={agents:[],loading:!0,lastFetchedAt:0,inFlight:null,retryTimeout:null},q.set(e,t)),t}function _(e){let t=B.get(e);return t||(t=new Set,B.set(e,t)),t}function T(e){for(let t of _(e))t()}function D(e){let t=F(e);return t.agents.length>0&&Date.now()-t.lastFetchedAt<3e4}function R(e,t){let n=F(e);null===n.retryTimeout&&(n.retryTimeout=window.setTimeout(()=>{F(e).retryTimeout=null,W(e,t,!0)},1e4))}async function W(e,t,n=!1){let r=F(e);if(!n&&D(e)){r.loading&&(r.loading=!1,T(e));return}return r.inFlight||(r.loading=!0,T(e),r.inFlight=(async()=>{try{var n;let a=await fetch((0,P.S)("/api/agents",t),{cache:"no-store"});if(!a.ok)throw Error(`Failed to fetch agents: ${a.status}`);let l=(n=await a.json(),Array.isArray(n)?n:n&&"object"==typeof n&&"agents"in n&&Array.isArray(n.agents)?n.agents:[]);l.length>0?(r.agents=l,r.lastFetchedAt=Date.now(),null!==r.retryTimeout&&(window.clearTimeout(r.retryTimeout),r.retryTimeout=null)):R(e,t)}catch{R(e,t)}finally{r.loading=!1,r.inFlight=null,T(e)}})()),r.inFlight}var H=n(46012),z=n(862),G=n(97882),V=n(39702),Z=n(86181),J=n(72410),X=n(85905),Q=n(84527),K=n(15115),Y=n(83770);function ee(e){return e.map(e=>(0,O.C0)(e)).filter(e=>null!==e)}var et=n(67506),en=n(76050),er=n(51164),ea=n(88272);let el="claude-code",es="conductor-board-dispatcher-panel-width";function ei(e){let t=e?.trim();return t&&t.length>0?t:null}function eo(e,t){return Math.min(Math.min(720,Math.max(320,Math.floor(.55*(Number.isFinite(t)&&t>0?t:720)))),Math.max(320,Math.round(e)))}let ed=(0,a.default)(()=>Promise.all([n.e(5493),n.e(5863)]).then(n.bind(n,35493)).then(e=>e.SessionDetail),{loadableGenerated:{webpack:()=>[35493]},loading:()=>(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading session..."})}),ec=(0,a.default)(()=>Promise.all([n.e(9450),n.e(9167)]).then(n.bind(n,29450)).then(e=>e.WorkspaceSidebarPanel),{loadableGenerated:{webpack:()=>[29450]},loading:()=>(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading workspace panel..."})}),ep=(0,a.default)(()=>n.e(6173).then(n.bind(n,66173)).then(e=>e.WorkspaceOverview),{loadableGenerated:{webpack:()=>[66173]},loading:()=>(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading workspace..."})}),eu=(0,a.default)(()=>n.e(9739).then(n.bind(n,79739)).then(e=>e.WorkspaceKanban),{loadableGenerated:{webpack:()=>[79739]},loading:()=>(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading board..."})}),ex=(0,a.default)(()=>Promise.all([n.e(9526),n.e(2651),n.e(2261),n.e(8607)]).then(n.bind(n,44838)).then(e=>e.ProjectDispatcherPanel),{loadableGenerated:{webpack:()=>[44838]},loading:()=>(0,r.jsx)("div",{className:"flex h-full items-center justify-center text-[13px] text-[var(--vk-text-muted)]",children:"Loading dispatcher..."})}),em=(0,a.default)(()=>Promise.all([n.e(3470),n.e(524),n.e(474)]).then(n.bind(n,90474)).then(e=>e.NewWorkspaceDialog),{loadableGenerated:{webpack:()=>[90474]},loading:()=>null}),eh=(0,a.default)(()=>Promise.all([n.e(3470),n.e(524),n.e(474)]).then(n.bind(n,90474)).then(e=>e.SettingsDialog),{loadableGenerated:{webpack:()=>[90474]},loading:()=>null});function eg(e){let t=(0,E.h7)(e);return t?.label?t.label:e.split(/[-_\s]+/g).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(" ")}function ef(e){return e.issueId?.trim()||e.taskRef?.trim()||e.id}function ev(e){let[t]=e.split(" - ");return(t??e).trim()}function eb(e){return!e||"object"!=typeof e||Array.isArray(e)?{}:{...e}}function ew(e,t){let n=eb(e),r=eb(n.notifications),a=r.soundFile,l="string"==typeof n.codingAgent&&n.codingAgent.trim().length>0?n.codingAgent.trim():t,s=(0,E.a6)(l,t),i="string"==typeof n.ide&&n.ide.trim().length>0?n.ide.trim():"vscode",o="string"==typeof n.markdownEditor&&n.markdownEditor.trim().length>0?n.markdownEditor.trim():"obsidian",d="string"==typeof n.markdownEditorPath?n.markdownEditorPath.trim():"";return{onboardingAcknowledged:!0===n.onboardingAcknowledged,codingAgent:s,ide:i,markdownEditor:o,markdownEditorPath:d,modelAccess:(0,er.v)(n.modelAccess),notifications:{soundEnabled:!1!==r.soundEnabled,soundFile:null===a?null:"string"==typeof a&&a.trim().length>0?a.trim():"abstract-sound-4"}}}function ej({requiresPairedDeviceScope:e=!1}){let t=(0,l.useRouter)(),n=(0,l.usePathname)(),a=(0,l.useSearchParams)(),i=(0,s.useMemo)(()=>ei(a.get("project")),[a]),o=(0,s.useMemo)(()=>ei(a.get("session")),[a]),d=(0,s.useMemo)(()=>"board"===a.get("view")?"board":"direct",[a]),c=(0,s.useMemo)(()=>ei(a.get("bridge")),[a]),[p,u]=(0,s.useState)(c??""),h=(0,O.C0)(p),g=(0,s.useMemo)(()=>(0,O.DW)(o)?.bridgeId??null,[o]),w=c??g,j=h??g,[k,y]=(0,s.useState)([]),[N,C]=(0,s.useState)("loading"),[A,S]=(0,s.useState)(null),B=!!(0,et.y)()&&null===A,q=(0,s.useMemo)(()=>k.filter(e=>e.connected),[k]),T=(0,s.useMemo)(()=>q.map(e=>e.bridgeId),[q]),R=(0,s.useMemo)(()=>(function({requiresPairedDeviceScope:e,effectiveBridgeId:t,connectedBridgeIds:n,bridgeInventoryStatus:r}){if(!e)return!1;let a=(0,O.C0)(t);return!!a&&("loading"===r||"ready"===r&&!ee(n).includes(a))})({requiresPairedDeviceScope:e,effectiveBridgeId:j,connectedBridgeIds:T,bridgeInventoryStatus:N}),[N,T,j,e]);(0,s.useMemo)(()=>(function({requiresPairedDeviceScope:e,effectiveBridgeId:t,connectedBridgeIds:n,bridgeInventoryStatus:r}){if(!e)return!0;let a=(0,O.C0)(t);return!!a&&"ready"===r&&ee(n).includes(a)})({requiresPairedDeviceScope:e,effectiveBridgeId:j,connectedBridgeIds:T,bridgeInventoryStatus:N}),[N,T,j,e]);let J=(0,s.useMemo)(()=>!e||!!j,[j,e]),{projects:X,loading:ef,error:ev,refresh:eb}=(0,L.U)(j,{enabled:J}),{agents:ey}=function(e,t){let n=t?.enabled??!0,r=(0,O.C0)(e)??"local",[a,l]=(0,s.useState)({agents:[],loading:n});return(0,s.useEffect)(()=>{if(!n)return void l({agents:[],loading:!1});let t=()=>{let e;return l({agents:(e=F(r)).agents,loading:e.loading})};_(r).add(t),t(),W(r,e);let a=()=>{D(r)||W(r,e,!0)},s=()=>{"visible"!==document.visibilityState||D(r)||W(r,e,!0)};return window.addEventListener("focus",a),document.addEventListener("visibilitychange",s),()=>{_(r).delete(t),window.removeEventListener("focus",a),document.removeEventListener("visibilitychange",s)}},[e,n,r]),n?a:{agents:[],loading:!1}}(j,{enabled:J}),{mobileSidebarOpen:eN,desktopSidebarOpen:eC,toggleSidebar:eA,closeSidebarOnMobile:eS,syncSidebarForViewport:eI}=(0,H.T)({initialDesktopOpen:!1}),eE=eN||eC,eM=!o||eE,{sessions:e$,loading:eL,error:eU,refresh:eP}=(0,$.t)(i,{enabled:eM&&J,bridgeId:j}),[eO,eB]=(0,s.useState)(""),[eq,eF]=(0,s.useState)(""),[e_,eT]=(0,s.useState)((0,ea.Z3)()),[eD,eR]=(0,s.useState)(!1),[eW,eH]=(0,s.useState)(null),[ez,eG]=(0,s.useState)(null),[eV,eZ]=(0,s.useState)(!1),[eJ,eX]=(0,s.useState)(!1),[eQ,eK]=(0,s.useState)(null),[eY,e0]=(0,s.useState)(null),[e1,e4]=(0,s.useState)(!0),[e3,e2]=(0,s.useState)(!1),[e5,e6]=(0,s.useState)(null),[e9,e7]=(0,s.useState)(!1),[e8,te]=(0,s.useState)(!1),[tt,tn]=(0,s.useState)(()=>o?[o]:[]),[tr,ta]=(0,s.useState)(!1),[tl,ts]=(0,s.useState)(!1),[ti,to]=(0,s.useState)(()=>o?"chat":"board"),[td,tc]=(0,s.useState)(!1),[tp,tu]=(0,s.useState)(405),[tx,tm]=(0,s.useState)(!1),th=(0,s.useRef)(null),tg=(0,s.useRef)(i);(0,s.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null,t=()=>{ta((0,Z.k$)())};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),(0,s.useEffect)(()=>{let e="function"==typeof window.matchMedia?window.matchMedia("(min-width: 1280px)"):null,t=()=>{ts(e?.matches??window.innerWidth>=1280)};return t(),window.addEventListener("resize",t),e?.addEventListener?.("change",t),()=>{window.removeEventListener("resize",t),e?.removeEventListener?.("change",t)}},[]),(0,s.useEffect)(()=>{if("board"!==d||null===i){tg.current=i,to("board");return}let e=tg.current!==i;(tg.current=i,o)?to("chat"):e&&to("board")},[i,o,d]),(0,s.useEffect)(()=>{try{let e=window.localStorage.getItem(es),t=e?Number.parseInt(e,10):NaN;Number.isFinite(t)&&tu(eo(t,window.innerWidth))}catch{}let e=()=>{tu(e=>eo(e,window.innerWidth))};return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[]),(0,s.useEffect)(()=>{if(!tx)return;let e=e=>{let t=window.innerWidth;tu(eo(t-e.clientX,t))},t=()=>{tm(!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(es,String(tp))}catch{}}},[tx,tp]),(0,s.useEffect)(()=>{if(!B){y([]),C("ready"),e&&t.replace("/bridge/connect");return}let n=!1,r=window.innerWidth<768,a=R?r?8e3:4e3:r?3e4:15e3;async function l(){try{let e=await fetch("/api/bridge/devices",{cache:"no-store"}),t=await e.json().catch(()=>null);if(!e.ok){if((0,Y.Xt)(t?.error)){n||(S(t?.error??null),y([]),C("ready"));return}throw Error(`Failed to fetch bridges: ${e.status}`)}n||(S(null),y((0,K.oH)(t?.devices).map(e=>({bridgeId:e.device_id,hostname:e.last_status?.hostname??e.hostname,os:`${e.last_status?.os??`${e.os}/${e.arch}`}${(0,K.wj)(e.last_status?.version)}`,capabilities:[],connected:e.connected,status:e.connected?"connected":"offline",connectedAt:"",lastSeenAt:""}))),C("ready"))}catch{n||(y([]),C("error"))}}l();let s=window.setInterval(()=>{l()},a);return()=>{n=!0,window.clearInterval(s)}},[B,R,e,t]),(0,s.useEffect)(()=>{let t=function({requiresPairedDeviceScope:e,requestedBridgeId:t,selectedBridgeId:n,connectedBridgeIds:r}){let a=(0,O.C0)(t),l=(0,O.C0)(n),s=ee(r);return e?a||(0===s.length?"":l&&s.includes(l)?l:s[0]??""):l&&s.includes(l)?l:""}({requiresPairedDeviceScope:e,requestedBridgeId:w,selectedBridgeId:p,connectedBridgeIds:T});t!==p&&u(t)},[T,w,e,p]),(0,s.useEffect)(()=>{!e||j||"ready"!==N||q.length>0||t.replace("/bridge/connect")},[N,q.length,j,e,t]),(0,s.useEffect)(()=>{u(c??"")},[c]);let tf=(0,s.useMemo)(()=>new Map(e$.map(e=>[e.id,e])),[e$]),{session:tv,loading:tb,error:tw}=(0,M.w)(o,null,{enabled:!!o&&J,bridgeId:j}),tj=eW??ev??eU??tw??e5,tk=(0,s.useMemo)(()=>{let e=new Map;for(let t of e$){let n=e.get(t.projectId);n?n.push(t):e.set(t.projectId,[t])}return e},[e$]),ty=(0,s.useCallback)((e,r="push")=>{let l=new URLSearchParams(a.toString()),s=(e,t)=>{let n="string"==typeof t?t.trim():"";n.length>0?l.set(e,n):l.delete(e)};"projectId"in e&&s("project",e.projectId),"sessionId"in e&&s("session",e.sessionId),"workspaceView"in e&&("board"===e.workspaceView?l.set("view","board"):l.delete("view")),"tab"in e&&(e.tab&&"dispatcher"!==e.tab?l.set("tab",e.tab):l.delete("tab")),"bridgeId"in e&&s("bridge",e.bridgeId),l.has("project")||l.delete("view"),l.has("session")||l.delete("tab");let i=l.toString(),o=i.length>0?`${n}?${i}`:n;"replace"===r?t.replace(o,{scroll:!1}):t.push(o,{scroll:!1})},[n,t,a]);(0,s.useEffect)(()=>{let e=(0,O.C0)(p);(c??null)!==e&&ty({bridgeId:e},"replace")},[c,ty,p]),(0,s.useEffect)(()=>{if(!ef&&!ev){if(0===X.length){null!==i&&ty({projectId:null,workspaceView:null},"replace");return}null===i||X.some(e=>e.id===i)||ty({projectId:o?null:X[0]?.id??null,workspaceView:o?null:d},"replace")}},[ev,ef,ty,X,i,o,d]),(0,s.useEffect)(()=>{if(o){if(eM){if(eL||eU)return;e$.some(e=>e.id===o)||ty({sessionId:null,tab:null},"replace");return}!tb&&(tv||ty({sessionId:null,tab:null},"replace"))}},[e$,ty,eM,o,tb,tv,eU,eL]),(0,s.useEffect)(()=>{o?tn(e=>[o,...e.filter(e=>e!==o)].slice(0,1)):tn([])},[o]),(0,s.useEffect)(()=>{o&&th.current&&th.current!==o&&(th.current=null)},[o]),(0,s.useEffect)(()=>{o&&eM&&!eL&&!eU&&tn(e=>e.filter(e=>e===o||tf.has(e)))},[eM,o,tf,eU,eL]);let tN=(0,s.useMemo)(()=>tv,[tv]),tC=(0,s.useMemo)(()=>X.find(e=>e.id===i)??null,[X,i]),tA=(0,s.useMemo)(()=>i?tk.get(i)??[]:[],[i,tk]),tS=(0,s.useMemo)(()=>tN??(o?tf.get(o)??null:null),[tN,o,tf]),tI=(0,s.useMemo)(()=>{let e=a.get("tab");return"overview"!==e&&"preview"!==e&&"diff"!==e&&"dispatcher"!==e&&"terminal"===(0,en.tK)(tS)},[tS,a]),tE=!!o&&tI&&tr,tM=(0,s.useMemo)(()=>tN?[tN.projectId,tN.branch].filter(Boolean).join(" \xb7 "):tC?[tC.id,tC.defaultBranch||"main"].filter(Boolean).join(" \xb7 "):"All Projects",[tC,tN]),t$=(0,s.useMemo)(()=>j?k.find(e=>e.bridgeId===j)??null:null,[k,j]),tL=t$?`Device \xb7 ${t$.hostname}`:R?"Device \xb7 Reconnecting":e?"Scope \xb7 Paired device required":"Scope \xb7 Local backend",tU=t$?`Showing projects and sessions from ${t$.hostname}.`:R?"Waiting for the selected laptop to reconnect before loading dashboard data.":e?"Hosted dashboard access must target a connected laptop.":"Showing projects and sessions from the local backend because no paired laptop is selected.",tP=t$?"border-[rgba(24,197,143,0.35)] bg-[rgba(24,197,143,0.12)] text-[var(--vk-green)]":R?"border-[color:color-mix(in_srgb,var(--vk-accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]":e?"border-[rgba(255,143,122,0.24)] bg-[rgba(255,143,122,0.08)] text-[var(--vk-red)]":"border-[var(--vk-border)] bg-[var(--vk-bg-main)] text-[var(--vk-text-muted)]",tO=(0,s.useMemo)(()=>{let e=Array.isArray(ey)?ey:[],t=new Set;for(let e of E.pN)t.add(e.name);for(let n of e)n.name&&t.add(n.name);for(let e of X)e.agent&&t.add(e.agent);eY?.codingAgent&&t.add(eY.codingAgent),eq&&t.add(eq),0===t.size&&t.add(eY?.codingAgent||el);let n=(0,E.Ge)(t);return 0===n.length&&n.push((0,E.a6)(eY?.codingAgent||el,el)),n},[ey,eY?.codingAgent,X,eq]),tB=(0,s.useMemo)(()=>{let e={};for(let t of E.pN)e[(0,I.q)(t.name)]={name:t.name,ready:!1,installed:!1,configured:!1,homepage:t.homepage,description:t.description,installHint:t.installHint??null,installUrl:t.installUrl??t.homepage??null,setupUrl:t.setupUrl??t.homepage??null};for(let t of Array.isArray(ey)?ey:[]){if(!t.name)continue;let n=(0,I.q)(t.name),r=(0,E.h7)(t.name);e[(0,I.q)(t.name)]={name:r?.name??t.name,ready:!0===t.ready,installed:!1!==t.installed,configured:!0===t.configured,homepage:"string"==typeof t.homepage?t.homepage:r?.homepage??e[n]?.homepage??null,description:"string"==typeof t.description?t.description:r?.description??e[n]?.description??null,installHint:"string"==typeof t.installHint?t.installHint:r?.installHint??e[n]?.installHint??null,installUrl:"string"==typeof t.installUrl?t.installUrl:r?.installUrl??e[n]?.installUrl??null,setupUrl:"string"==typeof t.setupUrl?t.setupUrl:r?.setupUrl??e[n]?.setupUrl??null}}return e},[ey]),tq=(0,s.useMemo)(()=>{let e={};for(let t of Array.isArray(ey)?ey:[])t.name&&t.runtimeModelCatalog&&(e[(0,I.q)(t.name)]=t.runtimeModelCatalog);return e},[ey]),tF=(0,s.useCallback)(e=>{let t=tB[(0,I.q)(e)],n=(0,E.h7)(e),r=t?.installed?t?.setupUrl??n?.setupUrl??t?.homepage??n?.homepage:t?.installUrl??n?.installUrl??t?.setupUrl??n?.setupUrl??t?.homepage??n?.homepage;r&&window.open(r,"_blank","noopener,noreferrer")},[tB]);async function t_(t,n){e2(!0),e6(null);try{if(e&&!j)throw Error("Pair or reconnect a laptop before saving preferences.");let r=await fetch((0,P.S)("/api/preferences",j),{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await r.json().catch(()=>null);if(!r.ok)throw Error(a?.error??a?.reason??`Failed to save preferences: ${r.status}`);let l=ew(a?.preferences,t.codingAgent||el);return e0(l),eF(l.codingAgent),n?.closeDialog!==!1&&e7(!1),!0}catch(e){return e6(e instanceof Error?e.message:"Failed to save preferences"),!1}finally{e2(!1)}}(0,s.useEffect)(()=>{let e=!1;return async function(){if(!J){e||(e0(null),e6(null),e4(!1));return}e4(!0);try{let t=await fetch((0,P.S)("/api/preferences",j)),n=await t.json().catch(()=>null);if(!t.ok)throw Error(n?.error??n?.reason??`Failed to load preferences: ${t.status}`);if(e)return;let r=ew(n?.preferences,el);e0(r),e6(null)}catch(t){if(e)return;e0(ew(null,el)),e6(t instanceof Error?t.message:"Failed to load preferences")}finally{e||e4(!1)}}(),()=>{e=!0}},[j,J]),(0,s.useEffect)(()=>{eY&&(eq||eF(eY.codingAgent))},[eY,eq]),(0,s.useEffect)(()=>{if(!e1){if(!eY||e&&!j)return void e7(!1);eY.onboardingAcknowledged||e7(!0)}},[j,eY,e1,e]),(0,s.useEffect)(()=>{if(0!==tO.length&&(!eq||!tO.includes(eq))){let e=eY?.codingAgent||el;eF(tO.includes(e)?e:tO[0]??el)}},[tO,eY?.codingAgent,eq]),(0,s.useEffect)(()=>{let e=(0,E.a6)(eq||tC?.agent||eY?.codingAgent||el,el),t=tC&&(0,I.q)(tC.agent)===(0,I.q)(e)?tC.agentModel:null,n=tC&&(0,I.q)(tC.agent)===(0,I.q)(e)?tC.agentReasoningEffort:null;eT((0,ea.c0)(e,eY?.modelAccess??(0,er.v)(null),tq,t,n))},[eY?.modelAccess,eY?.codingAgent,tq,eq,tC]);let tT=(0,s.useCallback)(()=>{e&&!j?eG("Pair or reconnect a laptop before adding a workspace."):(eG(null),eK(null),eH(null),eZ(!0),eI())},[j,e,eI]);(0,s.useEffect)(()=>{e8&&!e9&&(te(!1),tT())},[e8,e9]),(0,s.useEffect)(()=>{(!e||j)&&eG(null)},[j,e]);let tD=(0,s.useCallback)(async t=>{let n=eO.trim(),r=(0,ea.xb)(e_),a=(0,ea.aB)(e_),l=t?.bridgeId??j??null;if(e&&!l)return eH("Pair or reconnect a laptop before launching an agent session."),!1;let s=t?.projectId??i??X[0]?.id;if(!s)return eH("No project is configured in conductor.yaml"),!1;let o=(0,E.a6)(eq||el,el),d=tB[(0,I.q)(o)]??null;if(d&&!d.ready)return eH(d.installed?`${eg(o)} is not ready yet. Finish setup or authentication and try again.`:`${eg(o)} is not installed on this machine yet. Open setup and try again.`),tF(o),!1;eR(!0),eH(null);try{let e=await fetch((0,P.S)("/api/sessions",l),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:s,prompt:n,...t?.issueId?.trim()?{issueId:t.issueId.trim()}:{},agent:o,...t?.branch?{branch:t.branch}:{},...t?.baseBranch?{baseBranch:t.baseBranch}:{},..."boolean"==typeof t?.useWorktree?{useWorktree:t.useWorktree}:{},...t?.permissionMode?{permissionMode:t.permissionMode}:{},...r?{model:r}:{},...a?{reasoningEffort:a}:{},...t?.attachments&&t.attachments.length>0?{attachments:t.attachments}:{}})}),i=await e.json().catch(()=>null);if(!e.ok)throw Error(i?.error??`Failed to create workspace: ${e.status}`);if(!i?.session?.id)throw Error("Session created but response is missing session id");return eB(""),eI(),th.current=i.session.id,await eP(),ty({projectId:s,sessionId:i.session.id,tab:null,bridgeId:l},"push"),!0}catch(e){return eH(e instanceof Error?e.message:"Failed to create workspace"),!1}finally{eR(!1)}},[tB,e_,ty,tF,X,eO,eP,eq,j,i,e,eI]),tR=(0,s.useCallback)(async e=>{(await (0,Q.J)(e,{bridgeId:j}),o===e)?ty({projectId:null,sessionId:null,workspaceView:null,tab:null},"replace"):j&&eP()},[j,ty,eP,o]),tW=(0,s.useCallback)(async t=>{if(e&&!j)return void eK("Pair or reconnect a laptop before adding a workspace.");eX(!0),eK(null);try{let e=await fetch((0,P.S)("/api/workspaces",j),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await e.json().catch(()=>null);if(!e.ok)throw Error(n?.error??`Failed to add workspace: ${e.status}`);let r=n?.project?.id;if(!r)throw Error("Workspace created but response is missing project id");await eb(),eB(""),eI(),eZ(!1),ty({projectId:r,sessionId:null,workspaceView:"direct",tab:null,bridgeId:j??null},"push")}catch(e){eK(e instanceof Error?e.message:"Failed to add workspace")}finally{eX(!1)}},[j,ty,eb,e,eI]),tH=!e1&&!!eY&&(!e||!!j)&&!eY.onboardingAcknowledged,tz=eY??ew(null,eq||el),tG=(0,E.a6)(eq||tz.codingAgent||el,el),tV=i??tv?.projectId??null;(0,U.Q)({enabled:!e1,projectId:tV,preferences:tz.notifications,bridgeId:j});let tZ=(0,s.useCallback)(e=>{ty({projectId:e,sessionId:null,workspaceView:e?d:null,tab:null},"push"),eF((0,E.a6)(eY?.codingAgent||el,el)),to("board"),eS()},[eS,ty,eY?.codingAgent,d]),tJ=(0,s.useCallback)((e,t)=>{var n,r;let a,l=tf.get(e)??null;ty((n=i??null,r=t?.tab,a={projectId:l?.projectId??n??null,sessionId:e,tab:r??(0,en.tK)(l)},"board"===d?{...a,workspaceView:"direct"}:a),"push"),eS()},[eS,ty,i,tf,d]),tX=(0,s.useCallback)(()=>{e&&!j?t.push("/bridge/connect"):e7(!0)},[j,e,t]),tQ=(0,s.useCallback)(()=>{eJ||eZ(!1)},[eJ]),tK=(0,s.useCallback)(()=>{e3||tH||(e7(!1),e6(null))},[tH,e3]),tY=(0,s.useCallback)(()=>{tc(e=>!e)},[]),t0=(0,s.useCallback)(async e=>{let t=encodeURIComponent(e),n=await fetch((0,P.S)(`/api/repositories/${t}`,j),{method:"DELETE"});(404===n.status||405===n.status)&&(n=await fetch((0,P.S)(`/api/repositories?id=${t}`,j),{method:"DELETE"}));let r=await n.json().catch(()=>null);if(!n.ok)throw Error(r?.error??`Failed to unlink project (${n.status})`);await eb()},[j,eb]),t1=(0,s.useMemo)(()=>eE?(0,r.jsx)(ec,{projects:X,selectedProjectId:i,onSelectProject:tZ,onUnlinkProject:t0,sessions:e$,selectedSessionId:o,onSelectSession:tJ,onArchiveSession:tR,onCreateWorkspace:tT}):null,[e$,tR,tZ,tJ,t0,tT,X,i,o,eE]),t4=(0,s.useMemo)(()=>{let t=tC?(0,r.jsxs)("div",{className:"hidden w-fit rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px xl:inline-flex",children:[(0,r.jsx)("button",{type:"button",onClick:()=>ty({projectId:tC.id,workspaceView:"direct"},"replace"),className:`min-h-[31px] rounded-[2px] px-3 text-[13px] ${"direct"===d?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Direct launch"}),(0,r.jsx)("button",{type:"button",onClick:()=>ty({projectId:tC.id,workspaceView:"board"},"replace"),className:`min-h-[31px] rounded-[2px] px-3 text-[13px] ${"board"===d?"bg-[var(--vk-bg-hover)] text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"})]}):null;return"board"===d?(0,r.jsx)(eu,{projectId:i,bridgeId:j,defaultAgent:tG,agentOptions:tO,projectSessions:tA,projectLabel:tC?.id??i,headerAccessory:t,onOpenSession:tJ}):(0,r.jsx)(ek,{prompt:eO,setPrompt:eB,selectedAgent:tG,setSelectedAgent:eF,agentStates:tB,modelSelection:e_,setModelSelection:eT,modelAccess:tz.modelAccess,runtimeModelCatalogs:tq,agentOptions:tO,projects:X,bridges:k,selectedBridgeId:p,setSelectedBridgeId:u,requiresPairedDeviceScope:e,selectedProjectId:i,onSelectProject:tZ,projectLabel:i??"All projects",hasProject:X.length>0,creating:eD,error:tj,onOpenAddWorkspace:tT,onOpenAgentSetup:tF,onCreate:tD})},[tO,tB,k,eD,tD,e_,tF,tT,X,tA,tC,o,tJ,eO,tG,tz.modelAccess,e,tq,p,i,eB,tj,d,ty]),t3=(0,s.useMemo)(()=>{if(!tC)return t4;let e=({fullWidth:e=!1,compact:t=!1}={})=>(0,r.jsxs)("div",{className:`inline-flex ${e?"w-full":"w-fit"} rounded-[6px] border border-[var(--vk-border)] ${t?"p-0.5":"p-1"}`,children:[(0,r.jsx)("button",{type:"button",onClick:()=>ty({projectId:tC.id,workspaceView:"direct"},"replace"),className:`${t?"min-h-[30px] px-3 text-[12px]":"min-h-[32px] px-3 text-[13px]"} flex-1 rounded-[4px] ${"direct"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Direct launch"}),(0,r.jsx)("button",{type:"button",onClick:()=>ty({projectId:tC.id,workspaceView:"board"},"replace"),className:`${t?"min-h-[30px] px-3 text-[12px]":"min-h-[32px] px-3 text-[13px]"} flex-1 rounded-[4px] ${"board"===d?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:"Board view"})]});if("board"===d){let t={"--dispatcher-panel-width":`${tp}px`},n=!tl,a=!n||"board"===ti,l=!n||"chat"===ti,s=n&&null===o,i=tl&&td&&null===o,c=null!==o||!td;return(0,r.jsxs)("div",{style:t,className:"relative flex h-full min-h-0 flex-1 flex-col overflow-hidden",children:[n?(0,r.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 xl:hidden",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[e({fullWidth:!0,compact:!0}),s?(({fullWidth:e=!1,compact:t=!1}={})=>(0,r.jsxs)("div",{className:`inline-flex ${e?"w-full":"w-fit"} rounded-[6px] border border-[var(--vk-border)] ${t?"p-0.5":"p-1"}`,children:[(0,r.jsxs)("button",{type:"button",onClick:()=>{to("board"),ty({projectId:tC.id,workspaceView:"board"},"replace")},"aria-pressed":"board"===d&&"board"===ti,className:`inline-flex flex-1 items-center justify-center rounded-[4px] font-medium transition-colors ${t?"min-h-[30px] gap-1 px-2.5 text-[11px]":"min-h-[34px] gap-1.5 px-3 text-[12px]"} ${"board"===d&&"board"===ti?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,r.jsx)(x.A,{className:`${t?"h-3 w-3":"h-3.5 w-3.5"} shrink-0`}),(0,r.jsx)("span",{children:"Board"})]}),(0,r.jsxs)("button",{type:"button",onClick:()=>{to("chat"),ty({projectId:tC.id,workspaceView:"board"},"replace")},"aria-pressed":"board"===d&&"chat"===ti,className:`inline-flex flex-1 items-center justify-center rounded-[4px] font-medium transition-colors ${t?"min-h-[30px] gap-1 px-2.5 text-[11px]":"min-h-[34px] gap-1.5 px-3 text-[12px]"} ${"board"===d&&"chat"===ti?"bg-[var(--vk-bg-active)] text-[var(--vk-text-strong)]":"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]"}`,children:[(0,r.jsx)(m.A,{className:`${t?"h-3 w-3":"h-3.5 w-3.5"} shrink-0`}),(0,r.jsx)("span",{children:"Dispatcher"})]})]}))({fullWidth:!0,compact:!0}):null]})}):null,(0,r.jsxs)("div",{className:"relative flex min-h-0 flex-1 flex-col overflow-hidden xl:flex-row",children:[(0,r.jsx)("div",{className:`${a?"block":"hidden"} min-h-0 min-w-0 flex-1 overflow-hidden xl:block`,children:t4}),c?(0,r.jsx)("div",{className:"absolute bottom-0 right-[var(--dispatcher-panel-width)] top-0 z-20 hidden w-2 translate-x-1/2 cursor-col-resize xl:block",onMouseDown:e=>{e.preventDefault(),tm(!0)},"aria-hidden":"true",children:(0,r.jsx)("div",{className:"mx-auto h-full w-px bg-transparent transition-colors hover:bg-[var(--vk-border)]"})}):null,(0,r.jsxs)("div",{className:`${l?"flex":"hidden xl:flex"} ${i?"flex-1 min-h-0 xl:h-auto xl:max-h-none xl:w-[56px] xl:flex-none xl:min-h-0":"flex-1 min-h-[min(360px,50dvh)] xl:w-[var(--dispatcher-panel-width)] xl:flex-none xl:min-h-0"} flex-col overflow-hidden border-t border-[var(--vk-border)] bg-[var(--vk-bg-panel)] xl:border-l xl:border-t-0`,children:[n&&l&&null!==o?(0,r.jsx)("div",{className:"flex items-center border-b border-[var(--vk-border)] px-3 py-2 xl:hidden",children:(0,r.jsxs)("button",{type:"button",onClick:()=>to("board"),className:"inline-flex items-center gap-1.5 rounded-[4px] px-2 py-1 text-[12px] font-medium text-[var(--vk-text-muted)] transition-colors hover:bg-[var(--vk-bg-hover)] hover:text-[var(--vk-text-strong)]",children:[(0,r.jsx)(f.A,{className:"h-3.5 w-3.5 shrink-0"}),(0,r.jsx)("span",{children:"Back to board"})]})}):null,o?tS?(0,r.jsx)("div",{className:"relative min-h-0 h-full min-w-0 flex-1 overflow-hidden",children:tt.map(e=>{let t=e===o,n=t?tS:tf.get(e)??null;return n&&n.projectId===tC.id?(0,r.jsx)("div",{"aria-hidden":!t,className:t?"relative z-10 h-full min-w-0":"pointer-events-none absolute inset-0 overflow-hidden opacity-0 select-none",children:(0,r.jsx)(ed,{sessionId:e,initialSession:n,bridgeId:j,active:t,suppressPreviewAutoOpen:t&&th.current===e,immersiveMobileMode:t&&tE})},e):null})}):(0,r.jsx)("div",{className:"flex h-full items-center justify-center bg-[var(--vk-bg-panel)] text-[13px] text-[var(--vk-text-muted)]",children:"Loading session workspace..."}):(0,r.jsx)(ex,{projectId:tC.id,bridgeId:j,defaultAgent:tG,modelAccess:tz.modelAccess,runtimeModelCatalogs:tq,collapsed:i,onToggleCollapsed:tY})]})]})]})}return(0,r.jsxs)("div",{className:"flex h-full min-h-0 flex-col overflow-hidden",children:[(0,r.jsx)("div",{className:"border-b border-[var(--vk-border)] bg-[var(--vk-bg-panel)]/70 px-3 py-3 sm:px-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsx)("p",{className:"text-[11px] uppercase tracking-[0.12em] text-[var(--vk-text-muted)]",children:"Project Workspace"}),(0,r.jsxs)("p",{className:"mt-1 truncate text-[14px] text-[var(--vk-text-strong)]",children:[tC.id," \xb7 ",tC.defaultBranch||"main"]})]}),(0,r.jsx)("div",{className:"hidden xl:inline-flex",children:e()}),(0,r.jsx)("div",{className:"xl:hidden",children:e({fullWidth:!0,compact:!0})})]})}),(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:t4})]})},[ti,td,tp,tS,j,tY,tE,tt,ty,tG,tC,tA,o,tf,tl,t4,d]),t2=(0,s.useMemo)(()=>R?(0,r.jsx)("div",{className:"flex h-full min-h-0 flex-1 items-center justify-center bg-[var(--vk-bg-main)] px-4",children:(0,r.jsxs)("div",{className:"w-full max-w-md rounded-[12px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-5 py-5 text-center shadow-[0_18px_50px_rgba(0,0,0,0.18)]",children:[(0,r.jsx)("div",{className:"mx-auto flex h-11 w-11 items-center justify-center rounded-full border border-[color:color-mix(in_srgb,var(--vk-accent)_30%,transparent)] bg-[color:color-mix(in_srgb,var(--vk-accent)_12%,transparent)] text-[var(--vk-accent)]",children:(0,r.jsx)(v.A,{className:"h-5 w-5 animate-spin"})}),(0,r.jsx)("h2",{className:"mt-4 text-[18px] font-medium text-[var(--vk-text-strong)]",children:"Reconnecting paired laptop"}),(0,r.jsx)("p",{className:"mt-2 text-[14px] leading-6 text-[var(--vk-text-muted)]",children:"Waiting for the selected laptop to report online before loading its projects and sessions."})]})}):o&&("board"!==d||null===i)?(0,r.jsx)("div",{className:"relative min-h-0 h-full min-w-0 flex-1 overflow-hidden",children:tt.map(e=>{let t=e===o,n=t?tN:tf.get(e)??null;return(0,r.jsx)("div",{"aria-hidden":!t,className:t?"relative z-10 h-full min-w-0":"pointer-events-none absolute inset-0 overflow-hidden opacity-0 select-none",children:(0,r.jsx)(ed,{sessionId:e,initialSession:n,bridgeId:j,active:t,suppressPreviewAutoOpen:t&&th.current===e,immersiveMobileMode:t&&tE,onOpenSidebar:eA})},e)})}):null!==i?(0,r.jsx)("div",{className:"min-h-0 flex-1 overflow-hidden",children:t3}):(0,r.jsx)("div",{className:"flex h-full min-h-0 w-full flex-1 overflow-hidden",children:(0,r.jsx)(ep,{projects:X,sessions:e$,onCreateWorkspace:tT,onSelectSession:tJ})}),[e$,tt,t3,tN,o,tJ,tT,X,i,tf,R,eA,d]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(z.G,{mobileSidebarOpen:eN,desktopSidebarOpen:eC,onToggleSidebar:eA,hideMobileSidebarToggle:tE,sidebar:t1,children:[tE?null:(0,r.jsx)(G.V,{title:tM,onOpenPreferences:tX,rightContent:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("span",{className:`inline-flex items-center rounded-full border px-2 py-0.5 text-[11px] font-medium ${tP}`,title:tU,children:tL}),(0,r.jsx)(V.J,{})]})}),(0,r.jsxs)("div",{className:`flex min-h-0 min-w-0 flex-1 flex-col overflow-hidden ${tE?"bg-[#060404]":""}`,children:[ez?(0,r.jsx)("div",{className:"border-b border-[var(--vk-red)]/35 bg-[color:color-mix(in_srgb,var(--vk-red)_12%,var(--vk-bg-panel))] px-3 py-2 text-[13px] text-[var(--vk-red)] sm:px-4",children:(0,r.jsxs)("div",{className:"flex items-start gap-2",children:[(0,r.jsx)("p",{className:"min-w-0 flex-1",children:ez}),(0,r.jsx)("button",{type:"button",onClick:()=>eG(null),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded-[4px] text-[var(--vk-red)]/80 hover:bg-[var(--vk-red)]/10 hover:text-[var(--vk-red)]","aria-label":"Dismiss workspace action error",children:(0,r.jsx)(b.A,{className:"h-4 w-4"})})]})}):null,t2]})]}),eV?(0,r.jsx)(em,{open:eV,onClose:tQ,onCreate:tW,creating:eJ,error:eQ,defaultAgent:tG,agentOptions:tO,modelAccess:tz.modelAccess,runtimeModelCatalogs:tq,bridgeId:j}):null,e9||tH?(0,r.jsx)(eh,{open:e9,mode:tH?"onboarding":"settings",creating:e3,error:e5,current:tz,projectCount:X.length,agentOptions:tO,agentStates:tB,runtimeModelCatalogs:tq,onRepositoriesChanged:eb,onOnboardingComplete:({needsProject:e})=>{e&&te(!0)},onOpenAgentSetup:tF,onClose:tK,onSave:t_,bridgeId:j}):null]})}c.A,p.A,u.A,x.A,m.A,h.A,g.A,g.A,p.A,[{id:"vscode",label:"VS Code"},{id:"vscode-insiders",label:"VS Code Insiders"},{id:"cursor",label:"Cursor"},{id:"windsurf",label:"Windsurf"},{id:"intellij-idea",label:"IntelliJ IDEA"},{id:"zed",label:"Zed"},{id:"xcode",label:"Xcode"},{id:"antigravity",label:"Antigravity"},{id:"custom",label:"Custom"}].filter(e=>"custom"!==e.id),c.A,o.mWn,d.$$9,o.i4$,c.A;let ek=(0,s.memo)(function({prompt:e,setPrompt:t,selectedAgent:n,setSelectedAgent:a,agentStates:l,modelSelection:o,setModelSelection:d,modelAccess:c,runtimeModelCatalogs:p,agentOptions:u,projects:x,bridges:m,selectedBridgeId:f,setSelectedBridgeId:M,requiresPairedDeviceScope:$,selectedProjectId:L,onSelectProject:U,projectLabel:O,hasProject:B,creating:q,error:F,onOpenAddWorkspace:_,onOpenAgentSetup:T,onCreate:D}){let R=(0,s.useMemo)(()=>{let e=new Map(E.BO.map((e,t)=>[e,t]));return[...u].sort((t,n)=>{let r=e.get((0,I.q)(t))??Number.MAX_SAFE_INTEGER,a=e.get((0,I.q)(n))??Number.MAX_SAFE_INTEGER;return r!==a?r-a:eg(t).localeCompare(eg(n))})},[u]),W=eg(n),H=l[(0,I.q)(n)]??null,z=(0,s.useMemo)(()=>[...x].sort((e,t)=>e.id.localeCompare(t.id)),[x]),G=L??z[0]?.id??null,V=(0,s.useMemo)(()=>z.find(e=>e.id===G)??null,[G,z]),Z=(0,s.useMemo)(()=>m.filter(e=>e.connected),[m]),Q=(0,s.useMemo)(()=>!f||Z.some(e=>e.bridgeId===f),[Z,f]),[K,Y]=(0,s.useState)([]),[ee,et]=(0,s.useState)(!1),[en,er]=(0,s.useState)(""),[el,es]=(0,s.useState)(""),[ei,eo]=(0,s.useState)([]),[ed,ec]=(0,s.useState)(!1),[ep,eu]=(0,s.useState)(!1),[ex,em]=(0,s.useState)(!1),[eh,eb]=(0,s.useState)(!1),[ew,ej]=(0,s.useState)("default"),[ek,ey]=(0,s.useState)([]),[eN,eC]=(0,s.useState)(!1),[eA,eS]=(0,s.useState)(null);(0,s.useEffect)(()=>{if(!V){Y([]),er(""),et(!1);return}Y([]),er(V.defaultBranch.trim()||"main"),et(!1)},[V]),(0,s.useEffect)(()=>{if(!G){eo([]),es(""),ec(!1);return}eo([]),es(""),ec(!1)},[G]);let eI=(0,s.useCallback)(async()=>{if(!V)return;let e=V.defaultBranch.trim()||"main";if(!V.path?.trim()){Y([e]),er(t=>t.trim().length>0?t:e);return}et(!0);try{let t=new URLSearchParams({path:V.path}),n=await fetch((0,P.S)(`/api/workspaces/branches?${t.toString()}`,f)),r=await n.json().catch(()=>null),a=Array.isArray(r?.branches)?r.branches.filter(e=>"string"==typeof e&&e.trim().length>0):[],l="string"==typeof r?.defaultBranch&&r.defaultBranch.trim().length>0?r.defaultBranch.trim():e,s=a.length>0?a:[l];Y(s),er(e=>e.trim().length>0&&s.includes(e)?e:l)}catch{Y([e]),er(e)}finally{et(!1)}},[f,V]),eE=(0,s.useCallback)(async()=>{if(G){ec(!0);try{let e=await fetch((0,P.S)(`/api/boards?projectId=${encodeURIComponent(G)}`,f)),t=await e.json().catch(()=>null);if(!e.ok)throw Error(t?.error??`Failed to load tasks: ${e.status}`);let n=(Array.isArray(t?.columns)?t.columns:[]).flatMap(e=>Array.isArray(e.tasks)?e.tasks:[]),r=new Set,a=n.filter(e=>{let t=ef(e);return!(!t||r.has(t))&&(r.add(t),!0)});eo(a),es(e=>a.some(t=>ef(t)===e)?e:"")}catch{eo([]),es("")}finally{ec(!1)}}},[G,f]);(0,s.useEffect)(()=>{!ex||ee||K.length>0||eI()},[ee,ex,K.length,eI]),(0,s.useEffect)(()=>{!ep||ed||ei.length>0||eE()},[ei.length,eE,ed,ep]);let eM=(0,s.useMemo)(()=>(0,ea.Ik)(n,c,p),[c,p,n]),e$=(0,s.useMemo)(()=>ei.find(e=>ef(e)===el)??null,[ei,el]),eL=(0,ea.xb)(o)??"",eU=(0,s.useMemo)(()=>{let e=new Set,t=[],r=eL.trim();for(let n of eM)e.has(n.id)||(e.add(n.id),t.push(n));return r&&!e.has(r)&&(e.add(r),t.unshift({id:r,label:function(e,t){let n=t.trim(),r=(0,I.q)(e);if(!n)return n;if("claude-code"===r){let e=n.toLowerCase();if("opus"===e)return"Claude Opus";if("sonnet"===e)return"Claude Sonnet";if("haiku"===e)return"Claude Haiku";let t=e.match(/^claude-(sonnet|opus|haiku)-(\d+)-(\d+)(?:-\d{8})?$/);if(t){let e=t[1];return`Claude ${e[0]?.toUpperCase()+e.slice(1)} ${t[2]}.${t[3]}`}}return n.split(/[-_]+/g).filter(Boolean).map(e=>"gpt"===e.toLowerCase()?"GPT":/^\d+(?:\.\d+)?$/.test(e)?e:e[0]?.toUpperCase()+e.slice(1)).join("-")}(n,r),description:"Current selected model.",access:[]})),t},[eM,n,eL]),eP=(0,s.useMemo)(()=>!H||H.ready||eL?eL?eU.find(e=>e.id===eL)?.label??eL:"Default":"Setup required",[eU,H,eL]),eO=(0,s.useMemo)(()=>(0,ea.iL)(n,c,p,eL),[c,p,n,eL]),eB=(0,ea.aB)(o)??"",eq=(0,s.useMemo)(()=>{let e=eO.find(e=>e.id===eB);return e?e.label:eB||(eO[0]?.label??"Default")},[eO,eB]),eF="z-50 min-w-[240px] max-w-[calc(100vw-32px)] rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-2 shadow-[0_18px_50px_rgba(0,0,0,0.35)] sm:max-w-none",e_=`${eF} max-h-[min(360px,50vh)] overflow-y-auto`,eT="flex min-h-[44px] cursor-default items-center gap-2 rounded-[3px] px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] focus:bg-[var(--vk-bg-hover)] sm:min-h-[36px]",eD=[{id:"default",label:"Default",icon:g.A},{id:"auto",label:"Auto",icon:w.A},{id:"ask",label:"Ask",icon:j.A},{id:"plan",label:"Plan",icon:k.A}],eR=eD.find(e=>e.id===ew)??eD[0],eW="launchpad-attachment-input",eH=q||eN,ez=e=>{let t=e.repo?.trim();if(t){let e=t.split("/").filter(Boolean),n=e[e.length-1]?.replace(/\.git$/i,"");if(n)return n}return e.id},eG=V?ez(V):null,eV=V?`${eG} \xb7 ${en||V.defaultBranch||"main"}`:B?O:"Select project",eZ=e$?.taskRef?.trim()||e$?.issueId?.trim()||e$?.id||"",eJ=e$?ev(e$.text):"Choose a task, bug, or issue from this project's board",eX=V?.id??G??null,eQ=(0,s.useCallback)(e=>{let t=Array.from(e.currentTarget.files??[]);if(e.currentTarget.value="",!t.length)return;let n=new Set(ek.map(e=>`${e.name}:${e.size}:${e.lastModified}`)),r=t.filter(e=>!n.has(`${e.name}:${e.size}:${e.lastModified}`));r.length>0&&ey(e=>[...e,...r]),eS(null)},[ek]),eK=(0,s.useCallback)(e=>{ey(t=>t.filter((t,n)=>n!==e))},[]),eY=(0,s.useCallback)(async()=>{let e;if(eS(null),!eX||!V)return D({projectId:eX??void 0,...eh?{baseBranch:en||V?.defaultBranch||void 0}:{branch:en||V?.defaultBranch||void 0},issueId:el.trim()||void 0,bridgeId:f||void 0,useWorktree:eh,permissionMode:ew});eC(!0),eS(null);try{ek.length>0&&(e=await (0,X.P)({files:ek,projectId:V.id,taskRef:el.trim()||void 0,bridgeId:f||void 0}))}catch(e){return eS(e instanceof Error?e.message:"Failed to upload attachment"),!1}finally{eC(!1)}let t=await D({projectId:eX??void 0,...eh?{baseBranch:en||V.defaultBranch||void 0}:{branch:en||V.defaultBranch||void 0},issueId:el.trim()||void 0,bridgeId:f||void 0,useWorktree:eh,permissionMode:ew,...e&&e.length>0?{attachments:e}:{}});return t&&(ey([]),eS(null)),t},[el,eX,D,ew,en,V,V?.defaultBranch,f,ek,eh]);return(0,s.useEffect)(()=>{ey([]),eS(null)},[eX]),(0,r.jsx)("section",{className:"flex h-full min-h-0 items-start justify-center overflow-auto bg-[var(--vk-bg-main)] px-3 py-4 sm:items-center sm:px-6 sm:py-6",children:(0,r.jsxs)("div",{className:"w-full max-w-[768px]",children:[(0,r.jsx)("h1",{className:"pb-4 text-center text-[30px] font-medium leading-[34px] tracking-[-0.7px] text-[var(--vk-text-strong)] sm:text-[36px] sm:leading-[40px] sm:tracking-[-0.9px]",children:"What would you like to work on?"}),f?null:(0,r.jsxs)("div",{className:"mb-4 flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:[(0,r.jsx)(h.A,{className:"mt-0.5 h-[14px] w-[14px] shrink-0"}),(0,r.jsx)("span",{children:$?"Pair or reconnect a laptop to browse workspaces and launch coding agents from the web dashboard.":"Showing projects and sessions from the local backend. Pair a laptop and select it here to browse that device instead."})]}),(0,r.jsxs)("div",{className:"mx-auto w-full rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] p-px",children:[(0,r.jsxs)("div",{className:"flex flex-col gap-2 border-b border-[var(--vk-border)] px-2 pb-[9px] pt-2 sm:flex-row sm:items-center",children:[(0,r.jsxs)("div",{className:"flex min-w-0 items-center gap-2 sm:flex-1",children:[(0,r.jsx)(J.N,{seed:{label:n},className:"h-[25px] w-[25px] shrink-0 border-none bg-transparent"}),(0,r.jsxs)(i.bL,{children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:"inline-flex h-[31px] min-w-0 max-w-full items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] outline-none hover:bg-[var(--vk-bg-hover)] data-[state=open]:bg-[var(--vk-bg-hover)] sm:max-w-[280px]","aria-label":"Select agent",children:[(0,r.jsx)("span",{className:"min-w-0 flex-1 truncate pr-1 text-left",children:W}),(0,r.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-[var(--vk-text-muted)]"})]})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",sideOffset:6,className:e_,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Agents"}),R.map(e=>{let t=e===n,s=l[(0,I.q)(e)]??null;return(0,r.jsxs)(i.q7,{onSelect:()=>a(e),className:eT,children:[(0,r.jsx)(J.N,{seed:{label:e},className:"h-6 w-6 border-none bg-transparent"}),(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{children:eg(e)}),s?.ready?null:(0,r.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--vk-text-muted)]",children:s?.installed?"Setup required":"Not installed"})]}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:t?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e)})]})})]})]}),(0,r.jsxs)(i.bL,{onOpenChange:eu,children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",disabled:!G,className:"flex h-[31px] w-full min-w-0 items-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-left disabled:cursor-not-allowed disabled:opacity-50 sm:w-[240px] sm:shrink-0","aria-label":"Select task",children:[(0,r.jsx)("span",{className:`min-w-0 flex-1 truncate text-[14px] leading-[21px] ${eZ?"text-[var(--vk-text-normal)]":"text-[var(--vk-text-muted)]"}`,children:eZ||"No task"}),(0,r.jsx)(y.A,{className:"h-3 w-3 shrink-0 text-[var(--vk-text-muted)]"})]})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"end",side:"bottom",sideOffset:6,className:e_,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Tasks"}),(0,r.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:eJ}),(0,r.jsxs)(i.q7,{onSelect:()=>es(""),className:eT,children:[(0,r.jsx)("span",{children:"No linked task"}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:el?null:(0,r.jsx)(N.A,{className:"h-4 w-4"})})]}),ed?(0,r.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Loading board tasks..."}):ei.length>0?ei.map(e=>{let t=ef(e),n=ev(e.text),a=[e.type,e.priority].filter(Boolean).join(" \xb7 ");return(0,r.jsxs)(i.q7,{onSelect:()=>es(t),className:`${eT} min-w-[320px] items-start`,children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate",children:e.taskRef?.trim()||n}),(0,r.jsxs)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:[e.taskRef?.trim()?n:t,a?` \xb7 ${a}`:""]})]}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:el===t?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},t)}):(0,r.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"No existing tasks were found for this project."})]})})]})]}),(0,r.jsx)("div",{className:"rounded-[3.5px]",children:(0,r.jsxs)("div",{className:"flex flex-col gap-3 p-2",children:[(0,r.jsxs)("div",{className:"relative w-full",children:[(0,r.jsx)("textarea",{value:e,onChange:e=>t(e.target.value),placeholder:"Optional launch prompt. Leave empty to open the native CLI.",rows:1,className:"min-h-[24px] w-full resize-none bg-transparent pr-16 text-[16px] leading-[24px] text-[var(--vk-text-normal)] outline-none placeholder:text-[var(--vk-text-muted)]"}),(0,r.jsxs)("label",{htmlFor:eW,className:`absolute right-[18px] top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] ${eX?"text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]":"cursor-not-allowed opacity-50"}`,children:[(0,r.jsx)("input",{id:eW,type:"file",accept:"*/*",multiple:!0,onChange:eQ,disabled:!eX||eH,className:"hidden"}),(0,r.jsx)(C.A,{className:"h-[14px] w-[14px]"})]}),(0,r.jsx)("button",{type:"button","aria-label":"Preview",className:"absolute right-0 top-0 inline-flex h-[24px] w-[24px] items-center justify-center rounded-[4px] text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,r.jsx)(A.A,{className:"h-[14px] w-[14px]"})})]}),ek.length>0?(0,r.jsx)("div",{className:"flex flex-wrap gap-1.5",children:ek.map((e,t)=>(0,r.jsxs)("span",{className:"inline-flex max-w-full items-center gap-1 rounded-[999px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-1 text-[11px] text-[var(--vk-text-muted)]",children:[(0,r.jsx)("span",{className:"max-w-[160px] truncate",title:e.name,children:e.name}),(0,r.jsx)("button",{type:"button","aria-label":`Remove attachment ${e.name}`,onClick:()=>eK(t),className:"inline-flex h-[14px] w-[14px] items-center justify-center rounded-full text-[var(--vk-text-muted)] hover:bg-[var(--vk-bg-hover)]",children:(0,r.jsx)(b.A,{className:"h-3 w-3"})})]},`${e.name}-${e.size}-${e.lastModified}-${t}`))}):null,(0,r.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-end sm:justify-between",children:[(0,r.jsxs)("div",{className:"flex min-w-0 flex-1 flex-wrap items-center gap-x-1 gap-y-2",children:[(0,r.jsxs)(i.bL,{children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsx)("button",{type:"button",className:"inline-flex h-[29px] w-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]","aria-label":"Select workspace or project",children:(0,r.jsx)(g.A,{className:"h-[15px] w-[15px]"})})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",sideOffset:6,className:e_,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Projects"}),z.map(e=>{let t=ez(e),n=e.id!==t?e.id:e.path?.trim()||e.repo?.trim()||null;return(0,r.jsxs)(i.q7,{onSelect:()=>U(e.id),className:`${eT} min-w-[280px] items-start`,children:[(0,r.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,r.jsx)("div",{className:"truncate",children:t}),n?(0,r.jsx)("div",{className:"truncate text-[12px] leading-[16px] text-[var(--text-faint)]",children:n}):null]}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:e.id===G?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id)}),(0,r.jsx)(i.wv,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,r.jsxs)(i.q7,{onSelect:_,className:eT,children:[(0,r.jsx)(S.A,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:"Add Workspace"})]})]})})]}),eO.length>0?(0,r.jsxs)(i.bL,{children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button","aria-label":"Select reasoning effort",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,r.jsx)("span",{children:eq}),(0,r.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",sideOffset:6,className:eF,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Reasoning"}),eO.map(e=>(0,r.jsxs)(i.q7,{onSelect:()=>d({...o,reasoningEffort:e.id}),className:eT,children:[(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:eB===e.id?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id))]})})]}):null,(0,r.jsxs)(i.bL,{children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)] disabled:cursor-not-allowed disabled:opacity-60",children:[(0,r.jsx)("span",{children:eP}),(0,r.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",sideOffset:6,className:eF,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Model"}),(0,r.jsxs)(i.q7,{onSelect:()=>d((0,ea.c0)(n,c,p,V?.agentModel,V?.agentReasoningEffort)),className:eT,children:[(0,r.jsx)("span",{children:"Default"}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:eL?null:(0,r.jsx)(N.A,{className:"h-4 w-4"})})]}),eU.map(e=>(0,r.jsxs)(i.q7,{onSelect:()=>{var t;let r;return t=e.id,r=(0,ea.iL)(n,c,p,t),void d({catalogModel:t,customModel:"",reasoningEffort:r.some(e=>e.id===o.reasoningEffort)?o.reasoningEffort:(0,ea.YS)(n,c,p,t)})},className:eT,children:[(0,r.jsx)("span",{children:e.label}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:eL===e.id?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e.id)),0===eU.length?(0,r.jsx)("div",{className:"px-3 py-2 text-[12px] leading-[18px] text-[var(--vk-text-muted)]",children:"Models will appear here after the selected agent is installed and its runtime catalog is detected."}):null,H&&!H.ready?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.wv,{className:"my-1 h-px bg-[var(--vk-border)]"}),(0,r.jsx)("button",{type:"button",onClick:()=>T(n),className:"flex w-full items-center rounded-[3px] px-3 py-2 text-left text-[13px] text-[var(--vk-orange)] transition hover:bg-[var(--vk-bg-hover)]",children:H.installed?"Open setup":"Open install guide"})]}):null]})})]}),(0,r.jsxs)(i.bL,{children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsxs)("button",{type:"button",className:"inline-flex h-[29px] items-center gap-[4px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:bg-[var(--vk-bg-hover)]",children:[(0,r.jsx)("span",{children:eR.label}),(0,r.jsx)(y.A,{className:"h-[10px] w-[10px] text-[var(--vk-text-muted)]"})]})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",sideOffset:6,className:eF,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Permissions"}),eD.map(({id:e,label:t,icon:n})=>(0,r.jsxs)(i.q7,{onSelect:()=>ej(e),className:eT,children:[(0,r.jsx)(n,{className:"h-4 w-4"}),(0,r.jsx)("span",{children:t}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:ew===e?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e))]})})]}),Z.length>0?(0,r.jsxs)("label",{className:"inline-flex h-[29px] max-w-[260px] items-center gap-[6px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-normal)]",children:[(0,r.jsx)(h.A,{className:"h-[14px] w-[14px] text-[var(--vk-text-muted)]"}),(0,r.jsxs)("select",{value:f,onChange:e=>M(e.target.value),className:"min-w-0 flex-1 bg-transparent text-[14px] text-[var(--vk-text-normal)] outline-none",children:[$?null:(0,r.jsx)("option",{value:"",children:"Local backend"}),Z.map(e=>(0,r.jsxs)("option",{value:e.bridgeId,children:[e.hostname," \xb7 ",e.os]},e.bridgeId))]})]}):(0,r.jsxs)("div",{className:"inline-flex h-[29px] items-center gap-[6px] rounded-[3px] border border-[var(--vk-border)] bg-[var(--vk-bg-panel)] px-[9px] py-[5px] text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:[(0,r.jsx)(h.A,{className:"h-[14px] w-[14px]"}),(0,r.jsx)("span",{children:f&&!Q?"Waiting for selected device":$?"No device connected":"Local backend"})]}),(0,r.jsxs)(i.bL,{onOpenChange:em,children:[(0,r.jsx)(i.l9,{asChild:!0,children:(0,r.jsx)("button",{type:"button",disabled:!V,className:"inline-flex min-h-[29px] max-w-[320px] items-center justify-center truncate text-[14px] leading-[21px] text-[var(--vk-text-normal)] hover:text-[var(--vk-text-strong)] disabled:cursor-not-allowed disabled:opacity-50",children:eV})}),(0,r.jsx)(i.ZL,{children:(0,r.jsxs)(i.UC,{align:"start",side:"bottom",sideOffset:6,avoidCollisions:!1,className:e_,children:[(0,r.jsx)("p",{className:"px-3 pb-1 text-[14px] font-semibold leading-[21px] text-[var(--vk-text-muted)]",children:"Branch"}),eG?(0,r.jsx)("p",{className:"px-3 pb-2 text-[12px] leading-[16px] text-[var(--text-faint)]",children:eG}):null,ee?(0,r.jsx)("div",{className:"px-3 py-2 text-[14px] leading-[21px] text-[var(--vk-text-muted)]",children:"Loading branches..."}):K.map(e=>(0,r.jsxs)(i.q7,{onSelect:()=>er(e),className:eT,children:[(0,r.jsx)("span",{children:e}),(0,r.jsx)("span",{className:"ml-auto inline-flex h-4 w-4 items-center justify-center text-[var(--vk-text-strong)]",children:en===e?(0,r.jsx)(N.A,{className:"h-4 w-4"}):null})]},e))]})})]})]}),(0,r.jsx)("div",{className:"flex w-full justify-end sm:w-auto",children:(0,r.jsx)("button",{type:"button",onClick:eY,disabled:eH||!G,className:"inline-flex min-h-[29px] items-center justify-center rounded-[3px] bg-[var(--vk-bg-hover)] px-[8px] py-[6.5px] text-[16px] leading-[16px] text-[var(--vk-text-strong)] transition-colors hover:bg-[var(--vk-bg-active)] disabled:cursor-not-allowed disabled:opacity-50",children:eH?(0,r.jsx)(v.A,{className:"h-4 w-4 animate-spin"}):"Launch"})})]}),H&&!H.ready?(0,r.jsx)("div",{className:"rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-3 py-2 text-[13px] text-[var(--vk-text-normal)]",children:(0,r.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,r.jsxs)("div",{className:"min-w-0",children:[(0,r.jsxs)("p",{className:"text-[13px] text-[var(--vk-text-strong)]",children:[W," is not ready on this machine."]}),(0,r.jsx)("p",{className:"pt-0.5 text-[12px] text-[var(--vk-text-muted)]",children:H.installed?"Finish login or local setup to load models and start streaming sessions.":"Install the CLI first, then its models and authentication state will appear here."})]}),(0,r.jsx)("button",{type:"button",onClick:()=>T(n),className:"inline-flex h-[29px] items-center justify-center rounded-[3px] border border-[var(--vk-border)] px-3 text-[12px] text-[var(--vk-orange)] hover:bg-[var(--vk-bg-hover)]",children:H.installed?"Open setup":"Open install"})]})}):null,(0,r.jsxs)("label",{className:"flex items-start gap-2 rounded-[4px] border border-[var(--vk-border)] bg-[var(--vk-bg-main)] px-2 py-2 text-[13px] text-[var(--vk-text-normal)]",children:[(0,r.jsx)("input",{type:"checkbox",checked:eh,onChange:e=>eb(e.target.checked),className:"mt-0.5 h-4 w-4 rounded border border-[var(--vk-border)] bg-transparent accent-[var(--vk-orange)]"}),(0,r.jsxs)("span",{children:["Use worktree isolation",(0,r.jsx)("span",{className:"block text-[11px] text-[var(--vk-text-muted)]",children:"If unchecked, the session runs directly on the selected branch in the local repo."})]})]})]})})]}),F&&(0,r.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:F}),eA&&(0,r.jsx)("p",{className:"pt-2 text-[12px] text-[var(--status-error)]",children:eA})]})})})},85905:(e,t,n)=>{"use strict";n.d(t,{P:()=>l});var r=n(31404);function a(e){return e&&"object"==typeof e?e:null}async function l({files:e,projectId:t,taskRef:n,bridgeId:s,preferAbsolute:i=!0}){if(!e.length)return[];let o=t.trim();if(!o)throw Error("Project id is required to upload attachments");let d=new FormData;d.append("projectId",o);let c=n?.trim();for(let t of(c&&d.append("taskRef",c),e))d.append("files",t);let p=await fetch((0,r.S)("/api/attachments",s),{method:"POST",body:d}),u=await p.json().catch(()=>null);if(!p.ok){let t=1===e.length?e[0]?.name??"attachment":`${e.length} attachments`;throw Error(u?.error??`Failed to upload ${t}`)}let x=(Array.isArray(u?.files)?u.files:u?[u]:[]).map(e=>(function(e,t){let n=a(e);if(!n)return null;let r=a(n.attachment);for(let e of t?[n.absolutePath,n.path,n.filePath,r?.absolutePath,r?.path,r?.filePath]:[n.path,n.absolutePath,n.filePath,r?.path,r?.absolutePath,r?.filePath])if("string"==typeof e&&e.trim().length>0)return e.trim();return null})(e,i)).filter(e=>!!e);if(0===x.length)throw Error("Attachment upload succeeded but did not return a usable file path");return x}},88272:(e,t,n)=>{"use strict";n.d(t,{c0:()=>x,Z3:()=>s,Ik:()=>d,iL:()=>c,YS:()=>p,ZA:()=>u,xb:()=>m,aB:()=>h});var r=n(76196),a=n(5739);function l(e){return"openclaw"===(0,a.q)(e)}function s(){return{catalogModel:"",customModel:"",reasoningEffort:""}}function i(e,t){return t[(0,a.q)(e)]??null}function o(e){if(!e)return[];let t=[],n=new Set;for(let r of Object.values(e.modelsByAccess))if(Array.isArray(r))for(let e of r)!e?.id||n.has(e.id)||(n.add(e.id),t.push(e));return t}function d(e,t,n){if(l(e))return[];let a=i(e,n),s=(0,r.Tk)(e,t),d=a&&s?a.modelsByAccess[s]??[]:[],c=o(a);if(c.length>0){let e=[],t=new Set;for(let n of[...d,...c])!n?.id||t.has(n.id)||(t.add(n.id),e.push(n));return e}return(0,r.d8)(e,t)}function c(e,t,n,a){if(l(e))return[];let s=i(e,n),o=(0,r.Tk)(e,t);if(s){if(!s)return[];let e=a?.trim();return e&&s.reasoningOptionsByModel?.[e]?.length?s.reasoningOptionsByModel[e]??[]:o?s.reasoningOptionsByAccess?.[o]??[]:[]}return(0,r.u6)(e,t)}function p(e,t,n,a){if(l(e))return"";let s=i(e,n),o=(0,r.Tk)(e,t);return s?function(e,t,n){if(!e)return null;let r=t?.trim();return r&&e.defaultReasoningByModel?.[r]?e.defaultReasoningByModel[r]??null:n?e.defaultReasoningByAccess?.[n]??null:null}(s,a,o)??"":(0,r.DZ)(e,t)??""}function u(e,t){if(l(e))return"";let n=i(e,t),a=n?.customModelPlaceholder.trim();if(a)return a;let s=(0,r.yM)(e)?.label??"agent";return`Enter exact ${s} model id`}function x(e,t,n,a,u){if(l(e))return s();let x=a?.trim()??"",m=u?.trim().toLowerCase()??"",h=i(e,n),g=d(e,t,n),f=function(e,t,n){if(l(e))return"";let a=i(e,n),s=(0,r.Tk)(e,t);if(a)return(a&&s?a.defaultModelByAccess[s]??null:null)??o(a)[0]?.id??"";return(0,r.O$)(e,t)??""}(e,t,n),v=o(h).length>0,b=r=>{let a=c(e,t,n,r);return m.length>0&&a.some(e=>e.id===m)?m:p(e,t,n,r)};if(x.length>0){if(g.some(e=>e.id===x))return{catalogModel:x,customModel:"",reasoningEffort:b(x)};if(!v)return{catalogModel:f,customModel:x,reasoningEffort:b(x)}}return{catalogModel:f,customModel:"",reasoningEffort:b(f)}}function m(e){let t=e.customModel.trim();if(t.length>0)return t;let n=e.catalogModel.trim();return n.length>0?n:void 0}function h(e){let t=e.reasoningEffort.trim().toLowerCase();return t.length>0?t:void 0}}},e=>{e.O(0,[3036,691,3357,5587,3051,1257,9083,9703,1964,587,1968,7358],()=>e(e.s=12529)),_N_E=e.O()}]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|