@intent-hq/web 2.327.3 → 2.327.5
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 +1 -1
- package/web/app/immutable/chunks/{BAcNJnHM.js → 0VyTRY65.js} +1 -1
- package/web/app/immutable/chunks/{D_YJY_Ty.js → 0jr8Bg7f.js} +1 -1
- package/web/app/immutable/chunks/{C1pMbnE7.js → 58w9tXyz.js} +1 -1
- package/web/app/immutable/chunks/{Bggzn0XP.js → 6StQr10j.js} +1 -1
- package/web/app/immutable/chunks/{FrlwlE8V.js → 71Mja2wo.js} +1 -1
- package/web/app/immutable/chunks/{D1zY3q4_.js → 9cyklBMv.js} +2 -2
- package/web/app/immutable/chunks/{D6G_--ry.js → B0FeUjOw.js} +1 -1
- package/web/app/immutable/chunks/{D3kn1fgc.js → B33BBg7L.js} +1 -1
- package/web/app/immutable/chunks/{CcurICQ5.js → B572BMbo.js} +1 -1
- package/web/app/immutable/chunks/{CViHflT5.js → B61Pw6nY.js} +1 -1
- package/web/app/immutable/chunks/{rr-r2USw.js → B6KhV2Bg.js} +1 -1
- package/web/app/immutable/chunks/{DTKsxP_g.js → B78ZCJrO.js} +1 -1
- package/web/app/immutable/chunks/{BcyJoTHB.js → B7vTVGVv.js} +1 -1
- package/web/app/immutable/chunks/{C1_2Nvwd.js → B9eYUVR5.js} +1 -1
- package/web/app/immutable/chunks/{COsr-D4q.js → BBJdulBO.js} +1 -1
- package/web/app/immutable/chunks/{DBMurqmQ.js → BF2dYTZa.js} +1 -1
- package/web/app/immutable/chunks/{AfJdOpGJ.js → BGviGCI9.js} +1 -1
- package/web/app/immutable/chunks/{BhbOznM0.js → BJjlHQnx.js} +1 -1
- package/web/app/immutable/chunks/{BveUtPGK.js → BMyBy8MH.js} +1 -1
- package/web/app/immutable/chunks/{B-lZ23N5.js → BO-jThCd.js} +1 -1
- package/web/app/immutable/chunks/{DgFSF7Q3.js → BTiFOdD0.js} +1 -1
- package/web/app/immutable/chunks/{B4Un96Br.js → BWKO1fTV.js} +1 -1
- package/web/app/immutable/chunks/{CwBEqZZ_.js → BZs8VpCk.js} +1 -1
- package/web/app/immutable/chunks/{CZe-BIqB.js → Bb7N8KKo.js} +1 -1
- package/web/app/immutable/chunks/{DeH8i2FV.js → BbbZMK1A.js} +1 -1
- package/web/app/immutable/chunks/{Bf7TqJG_.js → Bd3FOgJ5.js} +1 -1
- package/web/app/immutable/chunks/{DLgg2y1C.js → BfOD7ERB.js} +1 -1
- package/web/app/immutable/chunks/{DreRgY6W.js → Bg-whL5V.js} +1 -1
- package/web/app/immutable/chunks/{ckA-QIlc.js → BgDq477e.js} +1 -1
- package/web/app/immutable/chunks/{myjILdXe.js → Bk8FW95r.js} +1 -1
- package/web/app/immutable/chunks/{DagQHAoe.js → BlO4hQbr.js} +1 -1
- package/web/app/immutable/chunks/{B7Mop_jC.js → BlnCsgUT.js} +1 -1
- package/web/app/immutable/chunks/{r_aV6a4U.js → Bq3my5nc.js} +1 -1
- package/web/app/immutable/chunks/{B7gQ_nlj.js → BtAXWfJQ.js} +1 -1
- package/web/app/immutable/chunks/{CDQiwfpS.js → BuvFVaAY.js} +2 -2
- package/web/app/immutable/chunks/{35D9vOc6.js → ByCOW8do.js} +1 -1
- package/web/app/immutable/chunks/{C0k-qPFA.js → BzH_KBS3.js} +1 -1
- package/web/app/immutable/chunks/{D39ODeMy.js → C2uKsJY1.js} +2 -2
- package/web/app/immutable/chunks/{DlL4i-_c.js → C3Zzd9P9.js} +1 -1
- package/web/app/immutable/chunks/{BOvycfTx.js → C4GW1bio.js} +1 -1
- package/web/app/immutable/chunks/{WCqnCI0Y.js → C5wdd0eM.js} +1 -1
- package/web/app/immutable/chunks/{Bx_Kd6Zj.js → CC1lvkyY.js} +1 -1
- package/web/app/immutable/chunks/{r2-n1eEu.js → CDMQjeQI.js} +1 -1
- package/web/app/immutable/chunks/{CjjnLU79.js → CDuSWzGm.js} +1 -1
- package/web/app/immutable/chunks/{3MiSzwO_.js → CGyDAjHZ.js} +1 -1
- package/web/app/immutable/chunks/{CYjbCKOB.js → CIYx0ii6.js} +1 -1
- package/web/app/immutable/chunks/{GbJiak62.js → CMVV4erq.js} +1 -1
- package/web/app/immutable/chunks/{C9Oy0LtB.js → CMWbuQ77.js} +1 -1
- package/web/app/immutable/chunks/{s4jPNyw8.js → CP2MUsRz.js} +1 -1
- package/web/app/immutable/chunks/{B798GHK3.js → CTG5TYyy.js} +1 -1
- package/web/app/immutable/chunks/{B6EWkrDE.js → CTbAPBO1.js} +2 -2
- package/web/app/immutable/chunks/{KOIbPY1T.js → CVy7yS5O.js} +1 -1
- package/web/app/immutable/chunks/{CziMjc6R.js → CWPMHNwU.js} +3 -3
- package/web/app/immutable/chunks/{D3pYGmsv.js → CWRkcPxW.js} +2 -2
- package/web/app/immutable/chunks/{Cs3K9au3.js → CX1z_2lx.js} +1 -1
- package/web/app/immutable/chunks/{7ZTbeFDr.js → CZHScKIK.js} +1 -1
- package/web/app/immutable/chunks/{DcQP1f_r.js → Cageks4o.js} +3 -3
- package/web/app/immutable/chunks/{BneSomYW.js → CeqDBCoX.js} +1 -1
- package/web/app/immutable/chunks/{CuacBn4U.js → ChKWMNeW.js} +1 -1
- package/web/app/immutable/chunks/{C9vpFXDp.js → Cnj-ocZi.js} +1 -1
- package/web/app/immutable/chunks/{iXIypZcP.js → CoXtBEKL.js} +1 -1
- package/web/app/immutable/chunks/{BDj_hFdE.js → CoZvu7gw.js} +1 -1
- package/web/app/immutable/chunks/{BgfnWFwk.js → CrvlOH-I.js} +1 -1
- package/web/app/immutable/chunks/{DLFNuh8k.js → CsO2DeV8.js} +1 -1
- package/web/app/immutable/chunks/{CjREz2UM.js → CvDuI1Ad.js} +1 -1
- package/web/app/immutable/chunks/{zWlUYLxQ.js → CwBsjeRn.js} +1 -1
- package/web/app/immutable/chunks/{B9dGZuHJ.js → D-Xd8btl.js} +3 -3
- package/web/app/immutable/chunks/{DLrur9eT.js → D0h0gCpu.js} +3 -3
- package/web/app/immutable/chunks/{eq-q_IQg.js → D2YHDAng.js} +4 -4
- package/web/app/immutable/chunks/{BY3-E0yy.js → D2b0ISji.js} +1 -1
- package/web/app/immutable/chunks/{Dmz-4iVB.js → D3HFxkuH.js} +1 -1
- package/web/app/immutable/chunks/{CKlsIlGI.js → D4cQTEB9.js} +1 -1
- package/web/app/immutable/chunks/{ZNzwzylD.js → D4jYxNmQ.js} +3 -3
- package/web/app/immutable/chunks/{CroauewU.js → D7pisHI7.js} +1 -1
- package/web/app/immutable/chunks/{dD52HyjL.js → D8kh7QqM.js} +1 -1
- package/web/app/immutable/chunks/{TP_FEuf4.js → D9NH4H5p.js} +1 -1
- package/web/app/immutable/chunks/{DvJIE9F0.js → D9t8LDcF.js} +1 -1
- package/web/app/immutable/chunks/{CGpqxwcV.js → DB8SI3db.js} +1 -1
- package/web/app/immutable/chunks/{CjqwEdIV.js → DEtQTkN_.js} +1 -1
- package/web/app/immutable/chunks/{C_fXhDsq.js → DFEZ3HlX.js} +12 -12
- package/web/app/immutable/chunks/{U3vyCaVU.js → DFGQ_Wfv.js} +1 -1
- package/web/app/immutable/chunks/{BjtjqFpR.js → DFXvVPhW.js} +1 -1
- package/web/app/immutable/chunks/{B08wwvKU.js → DGtVq4eo.js} +1 -1
- package/web/app/immutable/chunks/{BLqcY2WP.js → DLxs6eHm.js} +1 -1
- package/web/app/immutable/chunks/{iFTOUkOI.js → DOMHFWTg.js} +2 -2
- package/web/app/immutable/chunks/{Bm0frbxK.js → DPX7q3j0.js} +1 -1
- package/web/app/immutable/chunks/{fDvN4TBM.js → DQ_XjzmE.js} +1 -1
- package/web/app/immutable/chunks/{CyLGGlF1.js → DR6SSU50.js} +4 -4
- package/web/app/immutable/chunks/{DFXVbPZk.js → DVrkIyN2.js} +1 -1
- package/web/app/immutable/chunks/{ZOCUfPRu.js → DaKr8JPs.js} +6 -6
- package/web/app/immutable/chunks/{3JpWDI-M.js → DbRrqEgU.js} +4 -4
- package/web/app/immutable/chunks/{Bg-m0Nfi.js → DfqvT9D7.js} +1 -1
- package/web/app/immutable/chunks/{DAB4KDZf.js → DgjMPJcg.js} +1 -1
- package/web/app/immutable/chunks/{uZRrd2pm.js → DkZvhlo2.js} +1 -1
- package/web/app/immutable/chunks/{CNynWE_u.js → DlSyd7Ta.js} +1 -1
- package/web/app/immutable/chunks/{BFK7BFQt.js → DlgmTqk6.js} +1 -1
- package/web/app/immutable/chunks/{TWLYZedM.js → Dq3wAazc.js} +1 -1
- package/web/app/immutable/chunks/{DOuKhcDi.js → DqMdEldm.js} +1 -1
- package/web/app/immutable/chunks/{CI3k0XZh.js → DrQhi0x7.js} +4 -4
- package/web/app/immutable/chunks/{-nlL-11J.js → Dv6-cB4g.js} +1 -1
- package/web/app/immutable/chunks/{D2bUbzxj.js → F0Vwotna.js} +1 -1
- package/web/app/immutable/chunks/{DfURqgI9.js → FfF-YfjO.js} +1 -1
- package/web/app/immutable/chunks/{B01nzMRs.js → GkbL_5B-.js} +1 -1
- package/web/app/immutable/chunks/{BtY5FIF5.js → HUDA8fiy.js} +1 -1
- package/web/app/immutable/chunks/{cSZBj2H1.js → MIydPOVw.js} +1 -1
- package/web/app/immutable/chunks/{ZWp2d2r6.js → O5KlKm48.js} +1 -1
- package/web/app/immutable/chunks/{3t4RuxC6.js → OsOeZocr.js} +2 -2
- package/web/app/immutable/chunks/{C6tQk-Lg.js → Rp4RZapB.js} +1 -1
- package/web/app/immutable/chunks/{k0Eu5yMT.js → Tl1rpQ5s.js} +1 -1
- package/web/app/immutable/chunks/{DkVStA3d.js → ZxSCdpsg.js} +1 -1
- package/web/app/immutable/chunks/{BZprW35U.js → aLLkObRk.js} +1 -1
- package/web/app/immutable/chunks/{UeWiMZOF.js → i2yMwGh_.js} +1 -1
- package/web/app/immutable/chunks/{E96eL6xW.js → jgnoBIlD.js} +1 -1
- package/web/app/immutable/chunks/{CRWxVPtt.js → oE7MOocS.js} +1 -1
- package/web/app/immutable/chunks/{tNRnW6ie.js → pHsrJNld.js} +1 -1
- package/web/app/immutable/chunks/{DZt8Gjbk.js → pLn5y1p2.js} +1 -1
- package/web/app/immutable/chunks/{DPWvmlFQ.js → qaQGm9A7.js} +1 -1
- package/web/app/immutable/chunks/{Dhbliv-K.js → uSNf4PjE.js} +1 -1
- package/web/app/immutable/chunks/{CrKwVRvT.js → vmfD6HOP.js} +1 -1
- package/web/app/immutable/chunks/{CP38gzl0.js → vxHpfx-7.js} +1 -1
- package/web/app/immutable/chunks/{DkZU9zgp.js → wQb33ERJ.js} +2 -2
- package/web/app/immutable/chunks/{AjPbGUJ_.js → zNPAm_g8.js} +1 -1
- package/web/app/immutable/entry/{app.DoEJogUG.js → app.uZOa5xAD.js} +2 -2
- package/web/app/immutable/entry/start._vSBTu19.js +1 -0
- package/web/app/immutable/nodes/{0.BtuyckLI.js → 0.5BN29aF9.js} +1 -1
- package/web/app/immutable/nodes/{1.BlE22l2r.js → 1.CScjxXfi.js} +1 -1
- package/web/app/immutable/nodes/{10.BZLSu1t9.js → 10.DVkuwBxJ.js} +1 -1
- package/web/app/immutable/nodes/{14.CP4eEnwP.js → 14.CQFNVlAh.js} +1 -1
- package/web/app/immutable/nodes/{17.DtGxkuYO.js → 17.N0O7ruOc.js} +2 -2
- package/web/app/immutable/nodes/{2.C6nyC7hb.js → 2.CahtYp3d.js} +12 -12
- package/web/app/immutable/nodes/{3.1uPqjsRC.js → 3.D_5wExma.js} +1 -1
- package/web/app/immutable/nodes/{4.BjOowzuW.js → 4.JCAab1Hg.js} +1 -1
- package/web/app/immutable/nodes/{5.Dy-YkbU6.js → 5.piNO_yu5.js} +1 -1
- package/web/app/immutable/nodes/{6.DR9-o0Dc.js → 6.DXnvvORl.js} +1 -1
- package/web/app/immutable/nodes/{7.BR2qXozN.js → 7.Cd-oGu-r.js} +1 -1
- package/web/app/immutable/nodes/{8.DxHPj0Oq.js → 8.DhDtXFsS.js} +13 -13
- package/web/app/immutable/nodes/{9.BHHxehGk.js → 9.C3bc0Vuy.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.C_iz1en-.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var ke=Object.defineProperty;var Ee=(e,t,r)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Ee(e,typeof t!="symbol"?t+"":t,r);import{k as ye,N as Me,T as Re,d as Ce,l as we,w as Pe}from"./DhFS-yhc.js";import"./DYhIMPy1.js";import{bo as a,_ as Ie}from"./CNdlzZOD.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import"./D3glRUn0.js";import{c as j}from"./ChTqQfQN.js";import"./BOR1_TRO.js";import{Ig as i,tK as Te,nz as M,ny as S,m2 as Oe,v7 as Fe,v5 as te,ha as Le,hb as De,c as xe,HV as Ne,a4 as We,x_ as T,x$ as U,xY as Be,xZ as Ve,bY as Ue,bX as Ge,ca as He,c9 as qe,nB as R}from"./BoIGV7s7.js";import{cE as je,ct as ze,bu as Ke,cJ as $e,cI as Qe,cN as Ye,c6 as Xe,cl as Ze,c8 as Je,cC as ie,ax as et,bQ as tt,cK as rt}from"./De3HYtL6.js";import{a as st,i as nt}from"./BdQCA_Nv.js";import{aI as it,U as ae,bJ as at,m as ot,L as ct,bW as z,g as lt,V as dt,bX as ut,c as pt,aJ as ft,bE as K,am as gt,aY as ht,Z as mt,aE as bt,bL as St,Y as _t,W as vt,X as At,bH as kt,w as Et}from"./VxpSEzE0.js";import{y as yt}from"./C9ruBEtx.js";import{y as I}from"./DrH3w3jB.js";import{i as N}from"./BBy57-xG.js";import{n as Mt}from"./DkZU9zgp.js";const Rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:Me,TOAST_COUNTDOWN_CLASS:Re,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Ce,notify:ye,notifyMetadata:we,withToastCountdown:Pe},Symbol.toStringTag,{value:"Module"})),As=i.createSelector(e=>je.select(e)?.capabilities.gitlabCheckout===!0),ks=i.createSelector(e=>e.gitlabAuth.host),Es=i.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),ys=i.createSelector(e=>Te(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Ms=i.createSelector(e=>e.gitlabAuth.isCancelling),Rs=i.createSelector(e=>e.gitlabAuth.cancelOutcome),Cs=i.createSelector(e=>e.gitlabAuth.isConfigured),ws=i.createSelector(e=>e.gitlabAuth.isAuthenticating),Ps=i.createSelector(e=>e.gitlabAuth.deviceFlow),Is=i.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Ts=i.createSelector(e=>e.gitlabAuth.user),Os=i.createSelector(e=>e.gitlabAuth.error);i.createSelector(e=>e.gitlabAuth.method);const Fs=i.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],oe=new Set(["pr-reviewer"]),Ls="developer";function Ds(e){return E.find(t=>t.id===e)}const Ct=i.createSelector(e=>e.githubAuth.mutationRequestId),wt=i.createSelector(e=>e.githubAuth.callbacksCancelled),Pt=i.createSelector(e=>e.githubAuth.isDisconnecting),ce=i.createSelector(e=>e.githubAuth.isAuthenticated),It=i.createSelector(e=>e.githubAuth.statusSettled===!0),Tt=i.createSelector(e=>e.githubAuth.requiresDaemonAuth),Ot=i.createSelector(e=>e.githubAuth.user),Ft=i.createSelector(e=>e.githubAuth.isAuthenticating),Lt=i.createSelector(e=>e.githubAuth.deviceFlow),Dt=i.createSelector(e=>e.githubAuth.error),xs=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:wt,selectGitHubAuthDeviceFlow:Lt,selectGitHubAuthError:Dt,selectGitHubAuthIsAuthenticated:ce,selectGitHubAuthIsAuthenticating:Ft,selectGitHubAuthIsDisconnecting:Pt,selectGitHubAuthMutationRequestId:Ct,selectGitHubAuthRequiresDaemonAuth:Tt,selectGitHubAuthStatusSettled:It,selectGitHubAuthUser:Ot},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function xt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((n,o)=>f(n.provider)===f(s[o].provider)&&n.model===s[o].model&&n.hint===s[o].hint&&f(n.reasoningEffort)===f(s[o].reasoningEffort))}function re(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&xt(e.modelOptions,r.modelOptions):!1}const Ns=i.createSelector(e=>e.specialists.bundledSpecialists),Nt=i.createSelector(e=>e.specialists.fileSpecialists),Ws=i.createSelector(e=>M(Nt.select(e))),Bs=i.createSelector(e=>e.specialists.userOverrides);i.createSelector(e=>e.specialists.overridesLoaded);const Vs=i.createSelector(e=>e.specialists.customSpecialistsLoaded),Us=i.createSelector(e=>e.specialists.fileSpecialistsLoaded),Gs=i.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Hs=i.createSelector(e=>e.specialists.specialistsFolderPath),qs=i.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});i.createSelector(e=>e.specialists.providerModelOverrides);const W=i.createSelector((e,t)=>!(oe.has(t)&&!ce.select(e)));function Wt(e,t){return t?e:e.filter(r=>!oe.has(r.id))}function Bt(e,t){return Wt(e,t).filter(r=>!r.hidden)}function js(e,t){return Bt(e,t).filter(r=>r.role!=="internal")}const _=i.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=M(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,n=new Set,o=[];for(const l of r)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const m=c.has(l.id),x=c.has(p.id);return m&&x?(c.get(l.id)??0)-(c.get(p.id)??0):m&&!x?-1:!m&&x?1:l.name.localeCompare(p.name)}),o}),zs=i.createSelector(e=>{const t=_.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,n)=>+!r.has(s.id)-+!r.has(n.id)||s.id.localeCompare(n.id)),t[0]}),Vt=i.createSelector((e,t)=>{const r=S(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(n=>n.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&M(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const n=E.find(o=>o.id===t);if(n)return{id:n.id,name:n.name,description:n.description,source:"builtin"}}return null}),Ks=i.createSelector((e,t)=>Vt.select(e,t)?.name??null),$s=i.createSelector((e,t,r)=>{const n=_.select(e,r).find(o=>o.id===t);return n?n.defaultModel?n.defaultModel:n.resolvedModel??"":""}),Qs=i.createSelector((e,t,r)=>_.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Ys=i.createSelector((e,t,r)=>_.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Xs=i.createSelector((e,t,r)=>{const n=_.select(e,r).find(o=>o.id===t);return n?n.defaultBehaviorPrompt:""});function O(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const Zs=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&O(t,e.specialists.bundledSpecialists)}return O(t,e.specialists.bundledSpecialists)}),Js=i.createSelector((e,t,r)=>r?!!$.select(e,t,r):!!S(e.specialists.fileSpecialists,t)),en=i.createSelector((e,t,r)=>{if(r){const o=$.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:O(t,e.specialists.bundledSpecialists)&&!re(o)}if(!O(t,e.specialists.bundledSpecialists))return!1;const n=S(e.specialists.fileSpecialists,t);return!n||n.source!=="user"?!1:!re(n)}),$=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return S(e.specialists.fileSpecialists,t)}),tn=i.createSelector((e,t,r)=>{const s=$.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(n=>n.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(n=>n.id===t)?"Built-in":null}),rn=i.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=S(e.specialists.fileSpecialists,t);if(s)return s.filePath;const n=e.specialists.bundledSpecialists.find(o=>o.id===t);if(n&&"filePath"in n)return n.filePath}),sn=i.createSelector((e,t,r)=>{if(r){const n=_.select(e,r).find(l=>l.id===t),o=n?.codingAgent||n?.resolvedProvider;if(o)return ze.select(e,o,r);const c=Ke.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=S(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ut.select(e,t)}),Ut=i.createSelector((e,t)=>{const s=_.select(e).find(n=>n.id===t);return s?.codingAgent?s.codingAgent:it.select(e)?ae.select(e):""}),nn=i.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?M(r):[]}),an=i.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Oe),on=i.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),B=j("Clipboard");async function cn(e){let t;if(st())try{const r=await nt("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,B.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw B.error("Browser clipboard write failed",r,{electronError:t}),r}throw B.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const Gt=["connected","disconnected","unreachable","revoked","update-required"],y=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,le=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Ht(e){if(!y(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>y(s)&&u(s.id)?[{id:s.id,status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(n=>u(n)):[]}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function ln(e){if(!y(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!Gt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=y(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Ht(e.capabilities),s=C(e.tcAddress),n=C(e.observedAt),o=C(e.lastConnectedAt),c=Fe(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:le(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...n?{observedAt:n}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function dn(e){if(!y(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:le(e.runningAgents)}}function un(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function qt(e){if(!y(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function pn(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=qt(r);if(!s)return null;t.push(s)}return t}function jt(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function P(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const zt={macos:"macOS",linux:"Linux",windows:"Windows"},Kt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function A(e,t){const r=[e&&(zt[e]??e),t&&(Kt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function $t(e){return e?.placement?.target==="remote"||I(e?.placement?.target)}const Qt=new Set(["running","paused","resuming","pausing","stopping"]);function Yt(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&Qt.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function de(e,t){if(!e||!$t(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(I(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Le(s?.cloud?.provider??De(e.placement?.cloudMachineId)),platform:A(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:Yt(e,s)}};const n=A(e.placement?.os,e.placement?.arch)??A(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:n,state:o}}function fn(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:A(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function ue(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function gn(e){const t=ue(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function hn(e){if(e.cloud){const r=ue(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function pe(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function fe(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function Xt(e,t){const r=e.detail??"",s=fe(r),n=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(n&&s?.data.reason==="prepared-checkout")return{updateRequired:n,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=te(s?.data),c=o??(e.code?te({code:e.code}):null);return c?{updateRequired:n,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:n,message:s?.message||r}}function mn(e){if(!I(e?.placement?.target)||!e.placementError||e.status!==xe.Error)return null;const t=Xt(e.placementError,"");return t.cloud?t:null}const Zt=["attachments-too-large-for-machine:","node-prompt-too-large:"],Jt="remote-agent-unsupported:";function se(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function bn(e){const t=fe(e)?.message??e;for(const s of Zt){const n=t.indexOf(s);if(n<0)continue;const o=t.slice(n+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:se(Number(c[1])),limit:se(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(Jt);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function Sn(e){return I(e?.placement?.target)&&pe(e,de(e))==="starting"}function _n(e,t){if(!I(e?.placement?.target))return!1;const r=de(e,t);return r?.cloud?.state==="resuming"&&pe(e,r)===null}const v="",G="cloud:";function Q(e){return`${G}${e}`}function Y(e){return e?.startsWith(G)&&e.slice(G.length)||null}const vn=Q("e2b");function er(e,t){return e?.find(r=>Q(r.cloudMachineId)===t&&r.unavailableReason===null)}const tr=new Set(["connected","disconnected"]);function rr(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function X(e){return tr.has(e.state)}function sr({backendLabel:e,backendPlatform:t,machines:r,cloud:s}){const n=[{id:v,label:e,platform:A(t?.os,t?.arch),disabled:!1},...r.map(o=>{const c=A(o.platform?.os,o.platform?.arch);return X(o)?{id:o.id,label:o.name,platform:c,disabled:!1}:{id:o.id,label:o.name,platform:c,disabled:!0,reason:rr(o.state)}})];for(const o of s??[])n.push({id:Q(o.cloudMachineId),label:o.label,platform:null,kind:"cloud",disabled:o.unavailableReason!==null,...o.unavailableReason?{reason:o.unavailableReason}:o.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return n}function An(e){return e.find(t=>t.id===v)?.label??""}function nr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(X)||(s??[]).some(n=>n.unavailableReason===null))}function ir(e,t,r){if(!e)return v;if(Y(e))return er(r,e)?e:v;const s=t.find(n=>n.id===e);return s&&X(s)?s.id:v}function kn(e,{cloudEntries:t=!1,providerOf:r}={}){const s=Y(e);return s?t&&r?.(s)==="northflank"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function En({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),n=e.find(c=>c.key===t),o=n?s(n):[];if(r){const c=Ne(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(n&&o.length>0)return{providerId:n.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function ar(e,t,r,s){const n=e.map(P),o=n.indexOf(t),c=n.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[m]=p.splice(o,1);return p.splice(l,0,m),p.map(jt)}function yn(e,t,r){const s=e.findIndex(o=>P(o)===t),n=e[s+r];return s<0||!n?null:ar(e,t,P(n),r===-1?"before":"after")}function or(e,t){if(e===v)return"local";const r=t==="cloud"?Y(e):null;return P(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function cr(e,t){const r=new Map(t.map((n,o)=>[P(n),o])),s=n=>r.get(or(n.id,n.kind))??t.length;return e.map((n,o)=>({option:n,index:o})).sort((n,o)=>s(n.option)-s(o.option)||n.index-o.index).map(({option:n})=>n)}const Z=i.createSelector(e=>yt.select(e)&&e.remoteMachines?.supported===!0),Mn=i.createSelector(e=>Z.select(e)&&at.select(e)),ge=i.createSelector(e=>Z.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),lr=i.createSelector(e=>ge.select(e)?e.remoteMachines.order??[]:[]),Rn=i.createSelector(e=>e.remoteMachines.orderSaving!==null),J=i.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Cn=i.createSelector(e=>e.remoteMachines.localFingerprint),wn=i.createSelector(e=>e.remoteMachines.pending),Pn=i.createSelector(e=>e.remoteMachines.failures),In=i.createSelector(e=>e.remoteMachines.executorBackends??[]),dr=i.createSelector((e,t)=>{if(t===We)return a.layout_daemonStatus_localConnection_label();const r=S(e.connections.connections,t);return r?ot(r):t}),ur=i.createSelector(e=>dr.select(e,e.connections.windowBackendId)),Tn=i.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),On=i.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return ct({catalogProfiles:Ye.select(e,t),defaultRemoteIncompatibility:Qe.select(e,t),defaultRemoteLaunch:$e.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Fn=i.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),he=i.createSelector(e=>nr({remoteMachinesVisible:Z.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:J.select(e),cloud:z(e)}));function pr(e){const t=S(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const fr=i.createSelector(e=>{const t=sr({backendLabel:ur.select(e),backendPlatform:pr(e),machines:J.select(e),cloud:z(e)});return ge.select(e)?cr(t,lr.select(e)):t}),Ln=i.createSelector(e=>he.select(e)?fr.select(e):[]),Dn=i.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),xn=i.createSelector((e,t,r)=>he.select(e)?ir(t,J.select(e),me(e,r)):v);function me(e,t){const r=z(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(n=>{if(n.unavailableReason)return n;const o=lt(e,t,s[n.cloudMachineId]??null);return o?{...n,unavailableReason:o}:n})}const Nn=i.createSelector((e,t)=>me(e,t)),gr=j("WorkspaceValidation");async function Wn(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return hr(s)?br(s):Sr(s,t,r)}function hr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function mr(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const n of r){const o=t.match(n);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const n=s[2].replace(/\.git$/,"");return n?{owner:s[1],repo:n}:null}return null}async function br(e){return mr(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function Sr(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await N("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await N("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await N("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(gr.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Bn(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Vn(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Un(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Gn(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Hn(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const _r=["idle","exited"];function vr(e){return e===void 0||!_r.includes(e)}function qn(e){return e.status==="restarting"?"restarting":vr(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function Ar(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const jn=i.createSelector(e=>e.voiceSettings.isLoading),zn=i.createSelector(e=>e.voiceSettings.available),Kn=i.createSelector(e=>e.voiceSettings.provider),$n=i.createSelector(e=>e.voiceSettings.engine),Qn=i.createSelector(e=>e.voiceSettings.osEngineAvailable),Yn=i.createSelector(e=>e.voiceSettings.keyConfigured),Xn=i.createSelector(e=>e.voiceSettings.vocabulary),Zn=i.createSelector(e=>e.voiceSettings.openaiModel),Jn=i.createSelector(e=>e.voiceSettings.language),ei=i.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),ti=i.createSelector(e=>e.voiceSettings.inputDeviceId),ri=i.createSelector(e=>e.voiceSettings.inputDevices),si=i.createSelector(e=>e.voiceSettings.busyProvider),ni=i.createSelector(e=>e.voiceSettings.error),ii=i.createSelector(e=>Xe.select(e)?"unavailable":Ar(e.voiceSettings)),H="intent.voice.inputDevice";let q;function kr(){if(q!==void 0)return q;try{const e=localStorage.getItem(H);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ai(e){q=e;try{e===null?localStorage.removeItem(H):localStorage.setItem(H,e)}catch{}}let F=null;function oi(e){F=e}function ci(){const e=F;return F=null,e}function Er(){F=null}const yr=300,Mr=300;class Rr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??yr,this.doublePressWindowMs=t.doublePressWindowMs??Mr,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let L=null;function li(e){L=e}function di(){const e=L;return L=null,e}function Cr(){L=null}const wr=12e4,Pr=["audio/webm;codecs=opus","audio/webm"];function ui(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Ir(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Tr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Pr.find(e=>MediaRecorder.isTypeSupported(e))}class Or{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??wr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Ir(this.deviceId))}catch(n){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(n),o?"discarded":"error"}if(this.discardRequested){for(const n of t.getTracks())n.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Tr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=n=>{n.data&&n.data.size>0&&this.chunks.push(n.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=n=>this.handleRecorderError(n),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,n=this.cancelRequested;this.teardown(),!n&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Fr=300;function Lr(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Dr={stopReason:"manual",autoSend:!1};let g=null,b=null,k=0,w=null;const D=new Rr({onRecordStart:()=>{w&&xr(w)},onRecordStop:e=>{be(w,e)}});function pi(){return g!==null}function fi(){return g}function gi(e){w=e,k+=1,k===1&&D.keyDown()}function hi(e){w=e,k!==0&&(k-=1,k===0&&D.keyUp())}function xr(e){if(g!==null)return;Cr(),Er();const t=new Or({deviceId:kr(),onFinished:r=>{g===t&&(g=null);const s=b??{stopReason:"auto-stop",autoSend:!1},n=b!==null;if(b=null,e.dispatch(T()),n||D.reset(),r.durationMs<Fr){s.autoSend&&e.dispatch(U());return}e.dispatch(Be({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{g===t&&(g=null),b=null,e.dispatch(T()),e.showHint(Lr(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});g=t,e.dispatch(Ve()),t.start().then(r=>{if(r!=="recording"&&(g===t&&(g=null),r==="discarded")){const s=b?.autoSend===!0;b=null,e.dispatch(T()),s&&e.dispatch(U())}})}function be(e,t){const r=g;if(r===null){t.autoSend&&e?.dispatch(U());return}b=t,r.stop()}function mi(){be(null,Dr)}function bi(e){D.reset(),k=0,b=null;const t=g;t!==null&&(g=null,t.cancel(),e.dispatch(T()))}const Nr=j("HardwareConsoleVoiceSetupToast"),Wr="hardware-console-voice-setup";let V=null;function Br(){return V||(V=Ie(()=>Promise.resolve().then(()=>Rt),void 0,import.meta.url).then(e=>e.notify)),V}function Vr(){Mt("/settings?tab=connections#voice").catch(e=>{Nr.error("Failed to open voice settings from setup toast",e)})}function Ur(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>Vr()}}function Si(){Br().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Wr,action:Ur()})})}const _i=i.createSelector(e=>e.externalEditors.selectedAction),Gr=i.createSelector(e=>e.externalEditors.editors),Hr=i.createSelector(e=>{const t=M(Gr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),n=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...n,...t.filter(({id:c})=>!o.has(c))]}),vi=i.createSelector(e=>e.externalEditors.editorOrder??[]),Ai=i.createSelector(e=>e.externalEditors.loading),ki=i.createSelector(e=>e.externalEditors.lastFetched),qr=i.createSelector(e=>e.externalEditors.hiddenEditorIds),Ei=i.createSelector((e,t)=>{if(!(t?Ze.select(e,t):Je.select(e)))return[];const s=qr.select(e);return Hr.select(e).filter(n=>n.installed&&!s.includes(n.id))});function yi(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let jr=0;function zr(e,t){const r=++jr;return i.dispatch(Ge(e,t,r)),r}function Mi(e,t,r){i.dispatch(Ue(e,t,r))}async function Se(e,t,r,s){const n=crypto.randomUUID(),o=s?.source??"control";try{return(await i.dispatch(He({requestId:n,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:ie.select(i.state)},{...s,intent:s?.intent??zr(e,t)}))).status==="success"}finally{i.dispatch(qe(n,o))}}async function Ri(e,t,r,s,n){return Se(e,t,{kind:"effort",effort:r,previous:s},n)}async function Ci(e,t,r,s,n){return Se(e,t,{kind:"reconcile",current:r??null,levels:s},n)}const Kr=i.createSelector((e,t)=>M(e.agentModel.mutations).filter(r=>r.consumerId===t)),wi=i.createSelector((e,t)=>Kr.select(e,t).some(r=>r.status==="pending")),Pi=i.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],n=et.select(e,t),o=dt.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=ut(c),p=l?pt(s?.model,null,o):s?.model;return{session:s,providerId:n,levels:o,legacy:l,identity:JSON.stringify([p,n]),connection:ie.select(e),canWrite:!!s&&s.workspaceId===r&&!tt.select(e,r)}});function $r(e,t,r=!1){return e!=="auggie"||t===!0||r}const Ii=i.createSelector(e=>ft.select(e)?null:K.select(e)),Qr=i.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),h=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Ti=i.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),Oi=i.createSelector((e,t)=>!!h.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Qr.select(e)),_e=i.createSelector((e,t)=>t?h.select(e,t)?.catalog.providers??[]:rt.select(e)),ve=i.createSelector((e,t)=>{if(!t)return ae.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),ee=i.createSelector((e,t)=>{if(!t)return gt.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),Ae=i.createSelector((e,t)=>{if(!t)return ht.select(e);const r=ee.select(e,t),s=ve.select(e,t),n=h.select(e,t)?.readiness??{};return _e.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&n[o.id]?.available).map(o=>o.id)}),Fi=i.createSelector((e,t)=>{const r=ee.select(e,t),s=t?h.select(e,t)?.readiness??{}:K.select(e);return _e.select(e,t).filter(n=>$r(n.id,s[n.id]?.available,r[n.id]===!0)).map(n=>n.id)}),Li=i.createSelector((e,t)=>t?Ae.select(e,t):mt.select(e)),Di=i.createSelector((e,t)=>_.select(e,t)),xi=i.createSelector((e,t)=>t?!!h.select(e,t):bt.select(e)),Ni=i.createSelector((e,t)=>{if(!t)return St.select(e);const r=h.select(e,t)?.settings??[],s=ve.select(e,t),n=r.find(l=>l.path==="model.providerDefaults")?.value,o=n&&typeof n=="object"?n[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Wi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):_t.select(e)),Bi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):vt.select(e)),Vi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):At.select(e)),Ui=i.createSelector((e,t,r)=>{if(!r)return kt.select(e,t);const s=ee.select(e,r),n=h.select(e,r);return Ae.select(e,r).filter(o=>o!==t&&(s[o]||n?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Et(o,n?.readiness[o]?.authenticated))}),Gi=i.createSelector((e,t)=>t?h.select(e,t)?.readiness??{}:K.select(e)),Yr={},Hi=i.createSelector(e=>e.providerSettings?.profiles?.status??Yr),qi=i.createSelector(e=>e.directoryPicker.listing),ji=i.createSelector(e=>e.directoryPicker.loading),zi=i.createSelector(e=>e.directoryPicker.error),Ki=i.createSelector(e=>e.directoryPicker.pathError),$i=i.createSelector(e=>e.directoryPicker.createError),ne={},Xr=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Qi=i.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(n=>n.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Yi=i.createSelector(e=>e.mcpSettings.loading),Xi=i.createSelector(e=>e.mcpSettings.error),Zi=i.createSelector(e=>e.mcpSettings.mutationError??null),Ji=i.createSelector(e=>e.mcpSettings.enabled),Zr=i.createSelector(e=>e.mcpSettings.disabledServers),Jr=i.createSelector(e=>e.mcpSettings.statusMap),es=i.createSelector(e=>e.mcpSettings.toolsMap),ts=i.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(n=>[n.id,R(n)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(n=>{const o=s.get(n.serverId);return o&&n.lastError?[[o,n.lastError]]:[]}))}),rs=i.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??ne:ne),ea=i.createSelector((e,t)=>Object.keys(rs.select(e,t))),ta=i.createSelector(e=>{const t=Xr.select(e),r=Jr.select(e),s=es.select(e),n=Zr.select(e),o=ts.select(e);return t.map(c=>{const l=R(c)in n,p=s[R(c)]||[];let m=r[R(c)]||"disconnected";return l&&(m="disabled"),{...c,disabled:l,status:m,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});i.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const ra=i.createSelector(e=>e.mcpSettings.lastImportedCount),sa=i.createSelector(e=>e.mcpSettings.advancedSaveStatus),na=i.createSelector(e=>e.mcpSettings.advancedSaveError),ia=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],ss=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],aa=Object.fromEntries(ss.map(e=>[e.path,e.defaultValue]));export{Mi as $,gi as A,hi as B,Rt as C,Ls as D,kn as E,ss as F,oe as G,vr as H,$r as I,pi as J,yi as K,re as L,ui as M,kr as N,fn as O,En as P,P as Q,A as R,E as S,zr as T,ar as U,dn as V,mr as W,pn as X,ln as Y,Xt as Z,Ci as _,aa as a,Cs as a$,bn as a0,Ar as a1,ir as a2,Vn as a3,ai as a4,wi as a5,Kr as a6,Pi as a7,Ns as a8,Gs as a9,sn as aA,$s as aB,xn as aC,ii as aD,In as aE,Qs as aF,Ys as aG,Ws as aH,Us as aI,$ as aJ,wt as aK,Lt as aL,Dt as aM,ce as aN,Ft as aO,Pt as aP,Ct as aQ,Tt as aR,Ot as aS,Rs as aT,Ps as aU,Is as aV,Os as aW,ks as aX,ys as aY,ws as aZ,Ms as a_,dr as aa,Li as ab,ve as ac,ee as ad,Fi as ae,Ae as af,_e as ag,Bi as ah,Vi as ai,Wi as aj,Ui as ak,Gi as al,xi as am,Ni as an,Di as ao,ur as ap,Vs as aq,Fn as ar,qs as as,$i as at,zi as au,qi as av,ji as aw,Ki as ax,vi as ay,Xs as az,ia as b,Kn as b$,Es as b0,Ts as b1,As as b2,Fs as b3,en as b4,qr as b5,Dn as b6,Hr as b7,Ei as b8,Ai as b9,J as bA,Z as bB,On as bC,Mn as bD,Ii as bE,Vt as bF,an as bG,on as bH,rn as bI,nn as bJ,Ks as bK,tn as bL,_ as bM,Hs as bN,Nn as bO,Ln as bP,fr as bQ,he as bR,Bs as bS,si as bT,$n as bU,ti as bV,ri as bW,Yn as bX,Jn as bY,Zn as bZ,Qn as b_,Zs as ba,Js as bb,ki as bc,Cn as bd,lr as be,Rn as bf,ge as bg,na as bh,sa as bi,Zr as bj,Ji as bk,Xi as bl,ts as bm,ra as bn,Yi as bo,Zi as bp,Xr as bq,ta as br,Jr as bs,es as bt,_i as bu,zs as bv,Hi as bw,Tn as bx,Pn as by,wn as bz,v as c,zn as c0,ni as c1,jn as c2,Xn as c3,ei as c4,h as c5,Qr as c6,Oi as c7,Ti as c8,ea as c9,Qi as ca,oi as cb,li as cc,Si as cd,An as ce,Q as cf,Y as cg,xr as ch,yn as ci,mi as cj,Un as ck,Bn as cl,Gn as cm,Wn as cn,Ur as co,cn as cp,vn as d,mn as e,Sn as f,_n as g,gn as h,de as i,hn as j,pe as k,Ri as l,bi as m,Er as n,Cr as o,ci as p,di as q,js as r,Bt as s,Wt as t,un as u,fi as v,Hn as w,qn as x,Ds as y,xs as z};
|
|
1
|
+
var ke=Object.defineProperty;var Ee=(e,t,r)=>t in e?ke(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Ee(e,typeof t!="symbol"?t+"":t,r);import{k as ye,N as Me,T as Re,d as Ce,l as we,w as Pe}from"./DhFS-yhc.js";import"./DYhIMPy1.js";import{bo as a,_ as Ie}from"./CNdlzZOD.js";import"./9iFKJfkz.js";import"./DIh4SQwA.js";import"./D3glRUn0.js";import{c as j}from"./ChTqQfQN.js";import"./BOR1_TRO.js";import{Ig as i,tK as Te,nz as M,ny as S,m2 as Oe,v7 as Fe,v5 as te,ha as Le,hb as De,c as xe,HV as Ne,a4 as We,x_ as T,x$ as U,xY as Be,xZ as Ve,bY as Ue,bX as Ge,ca as He,c9 as qe,nB as R}from"./BoIGV7s7.js";import{cE as je,ct as ze,bu as Ke,cJ as $e,cI as Qe,cN as Ye,c6 as Xe,cl as Ze,c8 as Je,cC as ie,ax as et,bQ as tt,cK as rt}from"./De3HYtL6.js";import{a as st,i as nt}from"./BdQCA_Nv.js";import{aI as it,U as ae,bJ as at,m as ot,L as ct,bW as z,g as lt,V as dt,bX as ut,c as pt,aJ as ft,bE as K,am as gt,aY as ht,Z as mt,aE as bt,bL as St,Y as _t,W as vt,X as At,bH as kt,w as Et}from"./VxpSEzE0.js";import{y as yt}from"./C9ruBEtx.js";import{y as I}from"./DrH3w3jB.js";import{i as N}from"./BBy57-xG.js";import{n as Mt}from"./wQb33ERJ.js";const Rt=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:Me,TOAST_COUNTDOWN_CLASS:Re,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Ce,notify:ye,notifyMetadata:we,withToastCountdown:Pe},Symbol.toStringTag,{value:"Module"})),As=i.createSelector(e=>je.select(e)?.capabilities.gitlabCheckout===!0),ks=i.createSelector(e=>e.gitlabAuth.host),Es=i.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),ys=i.createSelector(e=>Te(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),Ms=i.createSelector(e=>e.gitlabAuth.isCancelling),Rs=i.createSelector(e=>e.gitlabAuth.cancelOutcome),Cs=i.createSelector(e=>e.gitlabAuth.isConfigured),ws=i.createSelector(e=>e.gitlabAuth.isAuthenticating),Ps=i.createSelector(e=>e.gitlabAuth.deviceFlow),Is=i.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Ts=i.createSelector(e=>e.gitlabAuth.user),Os=i.createSelector(e=>e.gitlabAuth.error);i.createSelector(e=>e.gitlabAuth.method);const Fs=i.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],oe=new Set(["pr-reviewer"]),Ls="developer";function Ds(e){return E.find(t=>t.id===e)}const Ct=i.createSelector(e=>e.githubAuth.mutationRequestId),wt=i.createSelector(e=>e.githubAuth.callbacksCancelled),Pt=i.createSelector(e=>e.githubAuth.isDisconnecting),ce=i.createSelector(e=>e.githubAuth.isAuthenticated),It=i.createSelector(e=>e.githubAuth.statusSettled===!0),Tt=i.createSelector(e=>e.githubAuth.requiresDaemonAuth),Ot=i.createSelector(e=>e.githubAuth.user),Ft=i.createSelector(e=>e.githubAuth.isAuthenticating),Lt=i.createSelector(e=>e.githubAuth.deviceFlow),Dt=i.createSelector(e=>e.githubAuth.error),xs=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:wt,selectGitHubAuthDeviceFlow:Lt,selectGitHubAuthError:Dt,selectGitHubAuthIsAuthenticated:ce,selectGitHubAuthIsAuthenticating:Ft,selectGitHubAuthIsDisconnecting:Pt,selectGitHubAuthMutationRequestId:Ct,selectGitHubAuthRequiresDaemonAuth:Tt,selectGitHubAuthStatusSettled:It,selectGitHubAuthUser:Ot},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function xt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((n,o)=>f(n.provider)===f(s[o].provider)&&n.model===s[o].model&&n.hint===s[o].hint&&f(n.reasoningEffort)===f(s[o].reasoningEffort))}function re(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&xt(e.modelOptions,r.modelOptions):!1}const Ns=i.createSelector(e=>e.specialists.bundledSpecialists),Nt=i.createSelector(e=>e.specialists.fileSpecialists),Ws=i.createSelector(e=>M(Nt.select(e))),Bs=i.createSelector(e=>e.specialists.userOverrides);i.createSelector(e=>e.specialists.overridesLoaded);const Vs=i.createSelector(e=>e.specialists.customSpecialistsLoaded),Us=i.createSelector(e=>e.specialists.fileSpecialistsLoaded),Gs=i.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Hs=i.createSelector(e=>e.specialists.specialistsFolderPath),qs=i.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});i.createSelector(e=>e.specialists.providerModelOverrides);const W=i.createSelector((e,t)=>!(oe.has(t)&&!ce.select(e)));function Wt(e,t){return t?e:e.filter(r=>!oe.has(r.id))}function Bt(e,t){return Wt(e,t).filter(r=>!r.hidden)}function js(e,t){return Bt(e,t).filter(r=>r.role!=="internal")}const _=i.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=M(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,n=new Set,o=[];for(const l of r)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!n.has(l.id)&&W.select(e,l.id)&&(n.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const m=c.has(l.id),x=c.has(p.id);return m&&x?(c.get(l.id)??0)-(c.get(p.id)??0):m&&!x?-1:!m&&x?1:l.name.localeCompare(p.name)}),o}),zs=i.createSelector(e=>{const t=_.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,n)=>+!r.has(s.id)-+!r.has(n.id)||s.id.localeCompare(n.id)),t[0]}),Vt=i.createSelector((e,t)=>{const r=S(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(n=>n.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&M(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const n=E.find(o=>o.id===t);if(n)return{id:n.id,name:n.name,description:n.description,source:"builtin"}}return null}),Ks=i.createSelector((e,t)=>Vt.select(e,t)?.name??null),$s=i.createSelector((e,t,r)=>{const n=_.select(e,r).find(o=>o.id===t);return n?n.defaultModel?n.defaultModel:n.resolvedModel??"":""}),Qs=i.createSelector((e,t,r)=>_.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Ys=i.createSelector((e,t,r)=>_.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Xs=i.createSelector((e,t,r)=>{const n=_.select(e,r).find(o=>o.id===t);return n?n.defaultBehaviorPrompt:""});function O(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const Zs=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&O(t,e.specialists.bundledSpecialists)}return O(t,e.specialists.bundledSpecialists)}),Js=i.createSelector((e,t,r)=>r?!!$.select(e,t,r):!!S(e.specialists.fileSpecialists,t)),en=i.createSelector((e,t,r)=>{if(r){const o=$.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:O(t,e.specialists.bundledSpecialists)&&!re(o)}if(!O(t,e.specialists.bundledSpecialists))return!1;const n=S(e.specialists.fileSpecialists,t);return!n||n.source!=="user"?!1:!re(n)}),$=i.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(n=>n.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return S(e.specialists.fileSpecialists,t)}),tn=i.createSelector((e,t,r)=>{const s=$.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(n=>n.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(n=>n.id===t)?"Built-in":null}),rn=i.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=S(e.specialists.fileSpecialists,t);if(s)return s.filePath;const n=e.specialists.bundledSpecialists.find(o=>o.id===t);if(n&&"filePath"in n)return n.filePath}),sn=i.createSelector((e,t,r)=>{if(r){const n=_.select(e,r).find(l=>l.id===t),o=n?.codingAgent||n?.resolvedProvider;if(o)return ze.select(e,o,r);const c=Ke.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=S(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:Ut.select(e,t)}),Ut=i.createSelector((e,t)=>{const s=_.select(e).find(n=>n.id===t);return s?.codingAgent?s.codingAgent:it.select(e)?ae.select(e):""}),nn=i.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?M(r):[]}),an=i.createSelector((e,t)=>e.specialists.creationByContext?.[t]??Oe),on=i.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),B=j("Clipboard");async function cn(e){let t;if(st())try{const r=await nt("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,B.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw B.error("Browser clipboard write failed",r,{electronError:t}),r}throw B.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const Gt=["connected","disconnected","unreachable","revoked","update-required"],y=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,le=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Ht(e){if(!y(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>y(s)&&u(s.id)?[{id:s.id,status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(n=>u(n)):[]}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function ln(e){if(!y(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!Gt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=y(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Ht(e.capabilities),s=C(e.tcAddress),n=C(e.observedAt),o=C(e.lastConnectedAt),c=Fe(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:le(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...n?{observedAt:n}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function dn(e){if(!y(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:le(e.runningAgents)}}function un(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function qt(e){if(!y(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function pn(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=qt(r);if(!s)return null;t.push(s)}return t}function jt(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function P(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const zt={macos:"macOS",linux:"Linux",windows:"Windows"},Kt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function A(e,t){const r=[e&&(zt[e]??e),t&&(Kt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function $t(e){return e?.placement?.target==="remote"||I(e?.placement?.target)}const Qt=new Set(["running","paused","resuming","pausing","stopping"]);function Yt(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&Qt.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function de(e,t){if(!e||!$t(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(I(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Le(s?.cloud?.provider??De(e.placement?.cloudMachineId)),platform:A(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:Yt(e,s)}};const n=A(e.placement?.os,e.placement?.arch)??A(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:n,state:o}}function fn(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:A(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function ue(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function gn(e){const t=ue(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function hn(e){if(e.cloud){const r=ue(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function pe(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function fe(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function Xt(e,t){const r=e.detail??"",s=fe(r),n=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(n&&s?.data.reason==="prepared-checkout")return{updateRequired:n,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=te(s?.data),c=o??(e.code?te({code:e.code}):null);return c?{updateRequired:n,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:n,message:s?.message||r}}function mn(e){if(!I(e?.placement?.target)||!e.placementError||e.status!==xe.Error)return null;const t=Xt(e.placementError,"");return t.cloud?t:null}const Zt=["attachments-too-large-for-machine:","node-prompt-too-large:"],Jt="remote-agent-unsupported:";function se(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function bn(e){const t=fe(e)?.message??e;for(const s of Zt){const n=t.indexOf(s);if(n<0)continue;const o=t.slice(n+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:se(Number(c[1])),limit:se(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(Jt);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function Sn(e){return I(e?.placement?.target)&&pe(e,de(e))==="starting"}function _n(e,t){if(!I(e?.placement?.target))return!1;const r=de(e,t);return r?.cloud?.state==="resuming"&&pe(e,r)===null}const v="",G="cloud:";function Q(e){return`${G}${e}`}function Y(e){return e?.startsWith(G)&&e.slice(G.length)||null}const vn=Q("e2b");function er(e,t){return e?.find(r=>Q(r.cloudMachineId)===t&&r.unavailableReason===null)}const tr=new Set(["connected","disconnected"]);function rr(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function X(e){return tr.has(e.state)}function sr({backendLabel:e,backendPlatform:t,machines:r,cloud:s}){const n=[{id:v,label:e,platform:A(t?.os,t?.arch),disabled:!1},...r.map(o=>{const c=A(o.platform?.os,o.platform?.arch);return X(o)?{id:o.id,label:o.name,platform:c,disabled:!1}:{id:o.id,label:o.name,platform:c,disabled:!0,reason:rr(o.state)}})];for(const o of s??[])n.push({id:Q(o.cloudMachineId),label:o.label,platform:null,kind:"cloud",disabled:o.unavailableReason!==null,...o.unavailableReason?{reason:o.unavailableReason}:o.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return n}function An(e){return e.find(t=>t.id===v)?.label??""}function nr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(X)||(s??[]).some(n=>n.unavailableReason===null))}function ir(e,t,r){if(!e)return v;if(Y(e))return er(r,e)?e:v;const s=t.find(n=>n.id===e);return s&&X(s)?s.id:v}function kn(e,{cloudEntries:t=!1,providerOf:r}={}){const s=Y(e);return s?t&&r?.(s)==="northflank"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}:e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function En({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),n=e.find(c=>c.key===t),o=n?s(n):[];if(r){const c=Ne(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(n&&o.length>0)return{providerId:n.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function ar(e,t,r,s){const n=e.map(P),o=n.indexOf(t),c=n.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[m]=p.splice(o,1);return p.splice(l,0,m),p.map(jt)}function yn(e,t,r){const s=e.findIndex(o=>P(o)===t),n=e[s+r];return s<0||!n?null:ar(e,t,P(n),r===-1?"before":"after")}function or(e,t){if(e===v)return"local";const r=t==="cloud"?Y(e):null;return P(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function cr(e,t){const r=new Map(t.map((n,o)=>[P(n),o])),s=n=>r.get(or(n.id,n.kind))??t.length;return e.map((n,o)=>({option:n,index:o})).sort((n,o)=>s(n.option)-s(o.option)||n.index-o.index).map(({option:n})=>n)}const Z=i.createSelector(e=>yt.select(e)&&e.remoteMachines?.supported===!0),Mn=i.createSelector(e=>Z.select(e)&&at.select(e)),ge=i.createSelector(e=>Z.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),lr=i.createSelector(e=>ge.select(e)?e.remoteMachines.order??[]:[]),Rn=i.createSelector(e=>e.remoteMachines.orderSaving!==null),J=i.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Cn=i.createSelector(e=>e.remoteMachines.localFingerprint),wn=i.createSelector(e=>e.remoteMachines.pending),Pn=i.createSelector(e=>e.remoteMachines.failures),In=i.createSelector(e=>e.remoteMachines.executorBackends??[]),dr=i.createSelector((e,t)=>{if(t===We)return a.layout_daemonStatus_localConnection_label();const r=S(e.connections.connections,t);return r?ot(r):t}),ur=i.createSelector(e=>dr.select(e,e.connections.windowBackendId)),Tn=i.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),On=i.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return ct({catalogProfiles:Ye.select(e,t),defaultRemoteIncompatibility:Qe.select(e,t),defaultRemoteLaunch:$e.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Fn=i.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),he=i.createSelector(e=>nr({remoteMachinesVisible:Z.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:J.select(e),cloud:z(e)}));function pr(e){const t=S(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const fr=i.createSelector(e=>{const t=sr({backendLabel:ur.select(e),backendPlatform:pr(e),machines:J.select(e),cloud:z(e)});return ge.select(e)?cr(t,lr.select(e)):t}),Ln=i.createSelector(e=>he.select(e)?fr.select(e):[]),Dn=i.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),xn=i.createSelector((e,t,r)=>he.select(e)?ir(t,J.select(e),me(e,r)):v);function me(e,t){const r=z(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(n=>{if(n.unavailableReason)return n;const o=lt(e,t,s[n.cloudMachineId]??null);return o?{...n,unavailableReason:o}:n})}const Nn=i.createSelector((e,t)=>me(e,t)),gr=j("WorkspaceValidation");async function Wn(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return hr(s)?br(s):Sr(s,t,r)}function hr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function mr(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const n of r){const o=t.match(n);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const n=s[2].replace(/\.git$/,"");return n?{owner:s[1],repo:n}:null}return null}async function br(e){return mr(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function Sr(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await N("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await N("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await N("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(gr.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Bn(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Vn(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Un(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Gn(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Hn(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const _r=["idle","exited"];function vr(e){return e===void 0||!_r.includes(e)}function qn(e){return e.status==="restarting"?"restarting":vr(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function Ar(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const jn=i.createSelector(e=>e.voiceSettings.isLoading),zn=i.createSelector(e=>e.voiceSettings.available),Kn=i.createSelector(e=>e.voiceSettings.provider),$n=i.createSelector(e=>e.voiceSettings.engine),Qn=i.createSelector(e=>e.voiceSettings.osEngineAvailable),Yn=i.createSelector(e=>e.voiceSettings.keyConfigured),Xn=i.createSelector(e=>e.voiceSettings.vocabulary),Zn=i.createSelector(e=>e.voiceSettings.openaiModel),Jn=i.createSelector(e=>e.voiceSettings.language),ei=i.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),ti=i.createSelector(e=>e.voiceSettings.inputDeviceId),ri=i.createSelector(e=>e.voiceSettings.inputDevices),si=i.createSelector(e=>e.voiceSettings.busyProvider),ni=i.createSelector(e=>e.voiceSettings.error),ii=i.createSelector(e=>Xe.select(e)?"unavailable":Ar(e.voiceSettings)),H="intent.voice.inputDevice";let q;function kr(){if(q!==void 0)return q;try{const e=localStorage.getItem(H);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ai(e){q=e;try{e===null?localStorage.removeItem(H):localStorage.setItem(H,e)}catch{}}let F=null;function oi(e){F=e}function ci(){const e=F;return F=null,e}function Er(){F=null}const yr=300,Mr=300;class Rr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??yr,this.doublePressWindowMs=t.doublePressWindowMs??Mr,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let L=null;function li(e){L=e}function di(){const e=L;return L=null,e}function Cr(){L=null}const wr=12e4,Pr=["audio/webm;codecs=opus","audio/webm"];function ui(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Ir(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Tr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Pr.find(e=>MediaRecorder.isTypeSupported(e))}class Or{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??wr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Ir(this.deviceId))}catch(n){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(n),o?"discarded":"error"}if(this.discardRequested){for(const n of t.getTracks())n.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Tr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=n=>{n.data&&n.data.size>0&&this.chunks.push(n.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=n=>this.handleRecorderError(n),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,n=this.cancelRequested;this.teardown(),!n&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Fr=300;function Lr(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Dr={stopReason:"manual",autoSend:!1};let g=null,b=null,k=0,w=null;const D=new Rr({onRecordStart:()=>{w&&xr(w)},onRecordStop:e=>{be(w,e)}});function pi(){return g!==null}function fi(){return g}function gi(e){w=e,k+=1,k===1&&D.keyDown()}function hi(e){w=e,k!==0&&(k-=1,k===0&&D.keyUp())}function xr(e){if(g!==null)return;Cr(),Er();const t=new Or({deviceId:kr(),onFinished:r=>{g===t&&(g=null);const s=b??{stopReason:"auto-stop",autoSend:!1},n=b!==null;if(b=null,e.dispatch(T()),n||D.reset(),r.durationMs<Fr){s.autoSend&&e.dispatch(U());return}e.dispatch(Be({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{g===t&&(g=null),b=null,e.dispatch(T()),e.showHint(Lr(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});g=t,e.dispatch(Ve()),t.start().then(r=>{if(r!=="recording"&&(g===t&&(g=null),r==="discarded")){const s=b?.autoSend===!0;b=null,e.dispatch(T()),s&&e.dispatch(U())}})}function be(e,t){const r=g;if(r===null){t.autoSend&&e?.dispatch(U());return}b=t,r.stop()}function mi(){be(null,Dr)}function bi(e){D.reset(),k=0,b=null;const t=g;t!==null&&(g=null,t.cancel(),e.dispatch(T()))}const Nr=j("HardwareConsoleVoiceSetupToast"),Wr="hardware-console-voice-setup";let V=null;function Br(){return V||(V=Ie(()=>Promise.resolve().then(()=>Rt),void 0,import.meta.url).then(e=>e.notify)),V}function Vr(){Mt("/settings?tab=connections#voice").catch(e=>{Nr.error("Failed to open voice settings from setup toast",e)})}function Ur(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>Vr()}}function Si(){Br().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Wr,action:Ur()})})}const _i=i.createSelector(e=>e.externalEditors.selectedAction),Gr=i.createSelector(e=>e.externalEditors.editors),Hr=i.createSelector(e=>{const t=M(Gr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),n=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...n,...t.filter(({id:c})=>!o.has(c))]}),vi=i.createSelector(e=>e.externalEditors.editorOrder??[]),Ai=i.createSelector(e=>e.externalEditors.loading),ki=i.createSelector(e=>e.externalEditors.lastFetched),qr=i.createSelector(e=>e.externalEditors.hiddenEditorIds),Ei=i.createSelector((e,t)=>{if(!(t?Ze.select(e,t):Je.select(e)))return[];const s=qr.select(e);return Hr.select(e).filter(n=>n.installed&&!s.includes(n.id))});function yi(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let jr=0;function zr(e,t){const r=++jr;return i.dispatch(Ge(e,t,r)),r}function Mi(e,t,r){i.dispatch(Ue(e,t,r))}async function Se(e,t,r,s){const n=crypto.randomUUID(),o=s?.source??"control";try{return(await i.dispatch(He({requestId:n,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:ie.select(i.state)},{...s,intent:s?.intent??zr(e,t)}))).status==="success"}finally{i.dispatch(qe(n,o))}}async function Ri(e,t,r,s,n){return Se(e,t,{kind:"effort",effort:r,previous:s},n)}async function Ci(e,t,r,s,n){return Se(e,t,{kind:"reconcile",current:r??null,levels:s},n)}const Kr=i.createSelector((e,t)=>M(e.agentModel.mutations).filter(r=>r.consumerId===t)),wi=i.createSelector((e,t)=>Kr.select(e,t).some(r=>r.status==="pending")),Pi=i.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],n=et.select(e,t),o=dt.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=ut(c),p=l?pt(s?.model,null,o):s?.model;return{session:s,providerId:n,levels:o,legacy:l,identity:JSON.stringify([p,n]),connection:ie.select(e),canWrite:!!s&&s.workspaceId===r&&!tt.select(e,r)}});function $r(e,t,r=!1){return e!=="auggie"||t===!0||r}const Ii=i.createSelector(e=>ft.select(e)?null:K.select(e)),Qr=i.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),h=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Ti=i.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),Oi=i.createSelector((e,t)=>!!h.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===Qr.select(e)),_e=i.createSelector((e,t)=>t?h.select(e,t)?.catalog.providers??[]:rt.select(e)),ve=i.createSelector((e,t)=>{if(!t)return ae.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),ee=i.createSelector((e,t)=>{if(!t)return gt.select(e);const r=h.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),Ae=i.createSelector((e,t)=>{if(!t)return ht.select(e);const r=ee.select(e,t),s=ve.select(e,t),n=h.select(e,t)?.readiness??{};return _e.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&n[o.id]?.available).map(o=>o.id)}),Fi=i.createSelector((e,t)=>{const r=ee.select(e,t),s=t?h.select(e,t)?.readiness??{}:K.select(e);return _e.select(e,t).filter(n=>$r(n.id,s[n.id]?.available,r[n.id]===!0)).map(n=>n.id)}),Li=i.createSelector((e,t)=>t?Ae.select(e,t):mt.select(e)),Di=i.createSelector((e,t)=>_.select(e,t)),xi=i.createSelector((e,t)=>t?!!h.select(e,t):bt.select(e)),Ni=i.createSelector((e,t)=>{if(!t)return St.select(e);const r=h.select(e,t)?.settings??[],s=ve.select(e,t),n=r.find(l=>l.path==="model.providerDefaults")?.value,o=n&&typeof n=="object"?n[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Wi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):_t.select(e)),Bi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):vt.select(e)),Vi=i.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):At.select(e)),Ui=i.createSelector((e,t,r)=>{if(!r)return kt.select(e,t);const s=ee.select(e,r),n=h.select(e,r);return Ae.select(e,r).filter(o=>o!==t&&(s[o]||n?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Et(o,n?.readiness[o]?.authenticated))}),Gi=i.createSelector((e,t)=>t?h.select(e,t)?.readiness??{}:K.select(e)),Yr={},Hi=i.createSelector(e=>e.providerSettings?.profiles?.status??Yr),qi=i.createSelector(e=>e.directoryPicker.listing),ji=i.createSelector(e=>e.directoryPicker.loading),zi=i.createSelector(e=>e.directoryPicker.error),Ki=i.createSelector(e=>e.directoryPicker.pathError),$i=i.createSelector(e=>e.directoryPicker.createError),ne={},Xr=i.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),Qi=i.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(n=>n.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),Yi=i.createSelector(e=>e.mcpSettings.loading),Xi=i.createSelector(e=>e.mcpSettings.error),Zi=i.createSelector(e=>e.mcpSettings.mutationError??null),Ji=i.createSelector(e=>e.mcpSettings.enabled),Zr=i.createSelector(e=>e.mcpSettings.disabledServers),Jr=i.createSelector(e=>e.mcpSettings.statusMap),es=i.createSelector(e=>e.mcpSettings.toolsMap),ts=i.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(n=>[n.id,R(n)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(n=>{const o=s.get(n.serverId);return o&&n.lastError?[[o,n.lastError]]:[]}))}),rs=i.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??ne:ne),ea=i.createSelector((e,t)=>Object.keys(rs.select(e,t))),ta=i.createSelector(e=>{const t=Xr.select(e),r=Jr.select(e),s=es.select(e),n=Zr.select(e),o=ts.select(e);return t.map(c=>{const l=R(c)in n,p=s[R(c)]||[];let m=r[R(c)]||"disconnected";return l&&(m="disabled"),{...c,disabled:l,status:m,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});i.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const ra=i.createSelector(e=>e.mcpSettings.lastImportedCount),sa=i.createSelector(e=>e.mcpSettings.advancedSaveStatus),na=i.createSelector(e=>e.mcpSettings.advancedSaveError),ia=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],ss=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],aa=Object.fromEntries(ss.map(e=>[e.path,e.defaultValue]));export{Mi as $,gi as A,hi as B,Rt as C,Ls as D,kn as E,ss as F,oe as G,vr as H,$r as I,pi as J,yi as K,re as L,ui as M,kr as N,fn as O,En as P,P as Q,A as R,E as S,zr as T,ar as U,dn as V,mr as W,pn as X,ln as Y,Xt as Z,Ci as _,aa as a,Cs as a$,bn as a0,Ar as a1,ir as a2,Vn as a3,ai as a4,wi as a5,Kr as a6,Pi as a7,Ns as a8,Gs as a9,sn as aA,$s as aB,xn as aC,ii as aD,In as aE,Qs as aF,Ys as aG,Ws as aH,Us as aI,$ as aJ,wt as aK,Lt as aL,Dt as aM,ce as aN,Ft as aO,Pt as aP,Ct as aQ,Tt as aR,Ot as aS,Rs as aT,Ps as aU,Is as aV,Os as aW,ks as aX,ys as aY,ws as aZ,Ms as a_,dr as aa,Li as ab,ve as ac,ee as ad,Fi as ae,Ae as af,_e as ag,Bi as ah,Vi as ai,Wi as aj,Ui as ak,Gi as al,xi as am,Ni as an,Di as ao,ur as ap,Vs as aq,Fn as ar,qs as as,$i as at,zi as au,qi as av,ji as aw,Ki as ax,vi as ay,Xs as az,ia as b,Kn as b$,Es as b0,Ts as b1,As as b2,Fs as b3,en as b4,qr as b5,Dn as b6,Hr as b7,Ei as b8,Ai as b9,J as bA,Z as bB,On as bC,Mn as bD,Ii as bE,Vt as bF,an as bG,on as bH,rn as bI,nn as bJ,Ks as bK,tn as bL,_ as bM,Hs as bN,Nn as bO,Ln as bP,fr as bQ,he as bR,Bs as bS,si as bT,$n as bU,ti as bV,ri as bW,Yn as bX,Jn as bY,Zn as bZ,Qn as b_,Zs as ba,Js as bb,ki as bc,Cn as bd,lr as be,Rn as bf,ge as bg,na as bh,sa as bi,Zr as bj,Ji as bk,Xi as bl,ts as bm,ra as bn,Yi as bo,Zi as bp,Xr as bq,ta as br,Jr as bs,es as bt,_i as bu,zs as bv,Hi as bw,Tn as bx,Pn as by,wn as bz,v as c,zn as c0,ni as c1,jn as c2,Xn as c3,ei as c4,h as c5,Qr as c6,Oi as c7,Ti as c8,ea as c9,Qi as ca,oi as cb,li as cc,Si as cd,An as ce,Q as cf,Y as cg,xr as ch,yn as ci,mi as cj,Un as ck,Bn as cl,Gn as cm,Wn as cn,Ur as co,cn as cp,vn as d,mn as e,Sn as f,_n as g,gn as h,de as i,hn as j,pe as k,Ri as l,bi as m,Er as n,Cr as o,ci as p,di as q,js as r,Bt as s,Wt as t,un as u,fi as v,Hn as w,qn as x,Ds as y,xs as z};
|