@intent-hq/web 2.392.0 → 2.392.1
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/{CB8FMdnB.js → 0TbppU-W.js} +2 -2
- package/web/app/immutable/chunks/{D7rh8Clb.js → 3rqOYBi3.js} +1 -1
- package/web/app/immutable/chunks/{B_DmwFyf.js → 50HYkjWD.js} +3 -3
- package/web/app/immutable/chunks/{B77w2td3.js → 7zxUzaYz.js} +1 -1
- package/web/app/immutable/chunks/{CV86ty5-.js → 9AKr1UyY.js} +1 -1
- package/web/app/immutable/chunks/{IhhtpC0N.js → AlO3r9jV.js} +1 -1
- package/web/app/immutable/chunks/{BybDBA-a.js → B0oQ37UY.js} +1 -1
- package/web/app/immutable/chunks/{B_GvRk21.js → B2frqTj8.js} +1 -1
- package/web/app/immutable/chunks/{mE5-Vs-0.js → B6wkNYPs.js} +1 -1
- package/web/app/immutable/chunks/{B4OBYHli.js → B97l6Xkk.js} +1 -1
- package/web/app/immutable/chunks/{DnNE_pmq.js → B9NjB9vD.js} +1 -1
- package/web/app/immutable/chunks/{C6DQmPVB.js → B9ZgGXDm.js} +1 -1
- package/web/app/immutable/chunks/{DpDGJXfb.js → BB5TUToP.js} +2 -2
- package/web/app/immutable/chunks/{lE7gD_tn.js → BDRM-DVo.js} +1 -1
- package/web/app/immutable/chunks/{Bg5K6Ci3.js → BE3g5vcj.js} +1 -1
- package/web/app/immutable/chunks/{BxCgCRwx.js → BJEFEyAm.js} +1 -1
- package/web/app/immutable/chunks/BPFSAjsd.js +411 -0
- package/web/app/immutable/chunks/{1NvRJVY9.js → BS9LmSp_.js} +1 -1
- package/web/app/immutable/chunks/{Bk3dX2Ob.js → BSMi55yC.js} +1 -1
- package/web/app/immutable/chunks/{qqJggbSF.js → BSpgPPjp.js} +1 -1
- package/web/app/immutable/chunks/{Dv2WcD53.js → BTE0066U.js} +1 -1
- package/web/app/immutable/chunks/{BnGY4PVn.js → BUF0WvAS.js} +1 -1
- package/web/app/immutable/chunks/{CDD7ui9Z.js → BUPWY1pO.js} +1 -1
- package/web/app/immutable/chunks/{CQPid4Qr.js → BVBh582U.js} +1 -1
- package/web/app/immutable/chunks/{Bdh-SKNo.js → BdlwjSpf.js} +1 -1
- package/web/app/immutable/chunks/{B_4oJZFT.js → Bhul7r_Y.js} +1 -1
- package/web/app/immutable/chunks/{DQ3EU1b-.js → BlVpCoL1.js} +1 -1
- package/web/app/immutable/chunks/{DQYwt0RJ.js → Bp6DusVC.js} +1 -1
- package/web/app/immutable/chunks/{k5fprFtz.js → BuM8LV7z.js} +1 -1
- package/web/app/immutable/chunks/{D8CQQUv8.js → BvByaKKp.js} +1 -1
- package/web/app/immutable/chunks/{BJRZEnHw.js → BvvIG-FE.js} +1 -1
- package/web/app/immutable/chunks/{D5A4PJDt.js → BwFe8eI9.js} +1 -1
- package/web/app/immutable/chunks/{DITs7RNY.js → Bwa2n5jC.js} +1 -1
- package/web/app/immutable/chunks/{BnbmXiW4.js → ByvcSsIj.js} +1 -1
- package/web/app/immutable/chunks/{vpLnaArD.js → C13CRqsS.js} +1 -1
- package/web/app/immutable/chunks/{BK5l06W2.js → C6Af0QaF.js} +1 -1
- package/web/app/immutable/chunks/{udmuNwTR.js → C7MFACZg.js} +1 -1
- package/web/app/immutable/chunks/{pUywXnJP.js → C9DStJW1.js} +1 -1
- package/web/app/immutable/chunks/{uPtH8pRz.js → C9iwh4F-.js} +1 -1
- package/web/app/immutable/chunks/{B6SGYvow.js → CA5vNvRD.js} +3 -3
- package/web/app/immutable/chunks/{CcijsN8m.js → CBQrOO2t.js} +1 -1
- package/web/app/immutable/chunks/{CSbEYhAV.js → CCyGGl6b.js} +1 -1
- package/web/app/immutable/chunks/{BCwKGJpG.js → CDcxODgf.js} +1 -1
- package/web/app/immutable/chunks/{Bj58rFtD.js → CEqrck_t.js} +1 -1
- package/web/app/immutable/chunks/{Ca1iiPGq.js → CGJ5yTzR.js} +3 -3
- package/web/app/immutable/chunks/{BPd-Q6x4.js → CJItvMq2.js} +1 -1
- package/web/app/immutable/chunks/{Qvf67TfJ.js → CLX81MHV.js} +1 -1
- package/web/app/immutable/chunks/{DzNzbnYA.js → CPNOsHfj.js} +1 -1
- package/web/app/immutable/chunks/{BjPpzZjk.js → CPav-V5t.js} +2 -2
- package/web/app/immutable/chunks/{Cv6grH4l.js → CPmXQBUf.js} +1 -1
- package/web/app/immutable/chunks/{CtcGxSOx.js → CQClkuxa.js} +1 -1
- package/web/app/immutable/chunks/{BbK9qDRy.js → CRFyRwf-.js} +1 -1
- package/web/app/immutable/chunks/{_IIJlCYC.js → CRIoGx5T.js} +1 -1
- package/web/app/immutable/chunks/{D_-4DIK6.js → CSzXeH2S.js} +1 -1
- package/web/app/immutable/chunks/{kSTrWIIB.js → CUiYYsIq.js} +1 -1
- package/web/app/immutable/chunks/{C3AR_gNB.js → CUmvnJK5.js} +1 -1
- package/web/app/immutable/chunks/{AVUhaNFO.js → CWS5g6aA.js} +1 -1
- package/web/app/immutable/chunks/{7590d3_e.js → CY56l_5k.js} +1 -1
- package/web/app/immutable/chunks/{BRPh2Gky.js → CcBmcC9f.js} +2 -2
- package/web/app/immutable/chunks/{CykElrvo.js → CcMCIG6E.js} +2 -2
- package/web/app/immutable/chunks/{BqF1bVQC.js → CccfsETL.js} +2 -2
- package/web/app/immutable/chunks/{Boky5e4-.js → CdLJ0-dH.js} +1 -1
- package/web/app/immutable/chunks/{DwJUGAx4.js → Cdw7QKyr.js} +3 -3
- package/web/app/immutable/chunks/{DqQWmhFJ.js → CeHL-3WK.js} +1 -1
- package/web/app/immutable/chunks/{ggRB4LMK.js → CewZlXwy.js} +1 -1
- package/web/app/immutable/chunks/{Fiwts6D3.js → CiNmS1jZ.js} +1 -1
- package/web/app/immutable/chunks/{B-mEBo1a.js → CngTEvgU.js} +1 -1
- package/web/app/immutable/chunks/{R2QRct6h.js → CorT7tdR.js} +1 -1
- package/web/app/immutable/chunks/{Bs5b-3jJ.js → Cp4SiU7R.js} +1 -1
- package/web/app/immutable/chunks/{C3cVfkio.js → CpT48V2z.js} +1 -1
- package/web/app/immutable/chunks/{C8TRSNUb.js → Ct0fN4Lt.js} +1 -1
- package/web/app/immutable/chunks/{8ljmIEEj.js → CtzbB_EQ.js} +1 -1
- package/web/app/immutable/chunks/{B76dt5zP.js → CzK_7_Jd.js} +1 -1
- package/web/app/immutable/chunks/{C0JQvbI4.js → D-j7vD5Z.js} +1 -1
- package/web/app/immutable/chunks/{CtBzyNOX.js → D0DIeAXH.js} +1 -1
- package/web/app/immutable/chunks/{CVZzx9IJ.js → D6EyZ2rd.js} +1 -1
- package/web/app/immutable/chunks/{DwwEvwlj.js → D8MIwtpL.js} +1 -1
- package/web/app/immutable/chunks/{CUtsQ_at.js → DA3tGWzX.js} +1 -1
- package/web/app/immutable/chunks/{D7VoSTzK.js → DDDvNwR-.js} +1 -1
- package/web/app/immutable/chunks/{IHdKCjQM.js → DEsM7h8K.js} +2 -2
- package/web/app/immutable/chunks/{BZnji9hP.js → DFNKkiho.js} +4 -4
- package/web/app/immutable/chunks/{B469nFvV.js → DIME5LWK.js} +2 -2
- package/web/app/immutable/chunks/{BkxevPaB.js → DIxibpTv.js} +1 -1
- package/web/app/immutable/chunks/{CXTQXSCs.js → DL__HI6l.js} +1 -1
- package/web/app/immutable/chunks/{mpTxy2jJ.js → DNup87JQ.js} +1 -1
- package/web/app/immutable/chunks/{BNNeufNk.js → DQe_5JbW.js} +1 -1
- package/web/app/immutable/chunks/{BLUGgUG-.js → DTNrtzyx.js} +1 -1
- package/web/app/immutable/chunks/{C-BJXKy-.js → DTbyG794.js} +1 -1
- package/web/app/immutable/chunks/{B8RXlIBH.js → DTco_120.js} +1 -1
- package/web/app/immutable/chunks/{C7q_UkFQ.js → DUcJILSg.js} +1 -1
- package/web/app/immutable/chunks/{CxuKWK-9.js → DY9w61PC.js} +6 -6
- package/web/app/immutable/chunks/{wRT2cc73.js → DYzxLuOL.js} +1 -1
- package/web/app/immutable/chunks/{BhxHPYvf.js → D_R1vNH8.js} +1 -1
- package/web/app/immutable/chunks/{CyHB14hJ.js → D_YMc8vN.js} +1 -1
- package/web/app/immutable/chunks/{wtJmZfcy.js → DaTkisKB.js} +1 -1
- package/web/app/immutable/chunks/{CDjbPb5H.js → DaTwSOqs.js} +1 -1
- package/web/app/immutable/chunks/{D42wJcQ3.js → DbB491_u.js} +1 -1
- package/web/app/immutable/chunks/{BjEG_fCJ.js → DdU2snxg.js} +1 -1
- package/web/app/immutable/chunks/{BFVncOQi.js → DdYVblGk.js} +1 -1
- package/web/app/immutable/chunks/DejjV5ft.js +1 -0
- package/web/app/immutable/chunks/{DtuubiMf.js → Dgvdn_ax.js} +1 -1
- package/web/app/immutable/chunks/{Cb6ALa0V.js → Dhs7RSq9.js} +1 -1
- package/web/app/immutable/chunks/{BzKqzACd.js → DivmpPFQ.js} +1 -1
- package/web/app/immutable/chunks/{Xk1ND_1x.js → DlnCrS3y.js} +1 -1
- package/web/app/immutable/chunks/{i2kR60wc.js → DmtYsVlu.js} +2 -2
- package/web/app/immutable/chunks/{B8pX1T5t.js → DotCIVLI.js} +1 -1
- package/web/app/immutable/chunks/{CkTAy7fl.js → Dp0kLnIL.js} +1 -1
- package/web/app/immutable/chunks/{BnJ52enz.js → DqCgFTqN.js} +1 -1
- package/web/app/immutable/chunks/{DPbxpEc3.js → DuFY1gwd.js} +4 -4
- package/web/app/immutable/chunks/{BmyNM7bS.js → DvdITStP.js} +1 -1
- package/web/app/immutable/chunks/{B9-jkWWp.js → Dvzvnzzu.js} +1 -1
- package/web/app/immutable/chunks/{ynQC8xZQ.js → DznISJQO.js} +1 -1
- package/web/app/immutable/chunks/{BN9pl0_x.js → FS0kRzLP.js} +1 -1
- package/web/app/immutable/chunks/{w3KJAO4V.js → H8hIaDaV.js} +1 -1
- package/web/app/immutable/chunks/{7BHYBi88.js → KPBWxwIA.js} +1 -1
- package/web/app/immutable/chunks/{CPUJ3EYc.js → KRACSBb9.js} +1 -1
- package/web/app/immutable/chunks/{DbSflHPQ.js → KvfW-q1N.js} +1 -1
- package/web/app/immutable/chunks/{vezRCn6E.js → MFTfhUYi.js} +1 -1
- package/web/app/immutable/chunks/{CkyxPppw.js → OuI4JmWC.js} +1 -1
- package/web/app/immutable/chunks/{Cx8Rw_sH.js → PejVYY2W.js} +3 -3
- package/web/app/immutable/chunks/{m8Q2Rt7R.js → QKQvZF-2.js} +2 -2
- package/web/app/immutable/chunks/{BKxcGjV6.js → R3fZBk-k.js} +1 -1
- package/web/app/immutable/chunks/{CGO_zr9m.js → RqSv1iWX.js} +1 -1
- package/web/app/immutable/chunks/{zFu37m6L.js → WWq3hijy.js} +1 -1
- package/web/app/immutable/chunks/{CDUMf4mn.js → Xr-aTNRN.js} +1 -1
- package/web/app/immutable/chunks/{BCL-o_Md.js → ZIePA90q.js} +3 -3
- package/web/app/immutable/chunks/{xK5y1U34.js → a3O-Ns1M.js} +1 -1
- package/web/app/immutable/chunks/{DfyDNbbj.js → aoX2v33V.js} +4 -4
- package/web/app/immutable/chunks/{Z_lXVxA_.js → b7gnFN68.js} +1 -1
- package/web/app/immutable/chunks/{D3m2Y1N8.js → ciQFmiC4.js} +1 -1
- package/web/app/immutable/chunks/{DsDbrkJf.js → f0WUpIfB.js} +1 -1
- package/web/app/immutable/chunks/{CIqC9ucK.js → gX9ZnDRD.js} +1 -1
- package/web/app/immutable/chunks/{CqPoxrPz.js → gXHlCg5O.js} +1 -1
- package/web/app/immutable/chunks/{D7z6HEeo.js → i2Q0D3-m.js} +1 -1
- package/web/app/immutable/chunks/{y83c7yRZ.js → oM2TfoNE.js} +1 -1
- package/web/app/immutable/chunks/{BirGv2ci.js → pQalwNsE.js} +1 -1
- package/web/app/immutable/chunks/{qLTVpfPn.js → r4dmBxo_.js} +1 -1
- package/web/app/immutable/chunks/{DJSAkzw5.js → rmHQzJ1a.js} +1 -1
- package/web/app/immutable/chunks/{DYrrsQ1p.js → vJJtTADX.js} +1 -1
- package/web/app/immutable/chunks/{C-e2e9PC.js → vq6mxGLA.js} +1 -1
- package/web/app/immutable/chunks/{DT_a2Oi3.js → x9IQ_8UO.js} +1 -1
- package/web/app/immutable/chunks/{DeLdUBWT.js → z2uEgbos.js} +1 -1
- package/web/app/immutable/entry/{app.aDjWpyk7.js → app.Dh0FLLBd.js} +2 -2
- package/web/app/immutable/entry/start.IMZH36aM.js +1 -0
- package/web/app/immutable/nodes/{0.D_e7AeTl.js → 0.BlcS-Hyh.js} +1 -1
- package/web/app/immutable/nodes/{1.DA21OvwY.js → 1.BMTchPFq.js} +1 -1
- package/web/app/immutable/nodes/{10.CSASJEbg.js → 10.CfDNhRgU.js} +1 -1
- package/web/app/immutable/nodes/{11.DW2JfBsq.js → 11.CxSRkGHD.js} +1 -1
- package/web/app/immutable/nodes/{15.DrH3We44.js → 15.DCpm4k7K.js} +1 -1
- package/web/app/immutable/nodes/{19.DyUaZQFK.js → 19.C2T81__z.js} +2 -2
- package/web/app/immutable/nodes/{2.CTOsyef2.js → 2.1iJIAnw5.js} +1 -1
- package/web/app/immutable/nodes/{20.BPfqGZ4o.js → 20.BHRuLw4-.js} +1 -1
- package/web/app/immutable/nodes/{3.xcZps6DB.js → 3.BDDby9Gq.js} +1 -1
- package/web/app/immutable/nodes/{4.DaJkDmFI.js → 4.utfN0vdd.js} +1 -1
- package/web/app/immutable/nodes/{5.7rTxN-4O.js → 5.Z6w8za6J.js} +1 -1
- package/web/app/immutable/nodes/{6.tsWwri9c.js → 6.w_k_ibWb.js} +1 -1
- package/web/app/immutable/nodes/{7.CDTojphP.js → 7.I-q-I1bs.js} +1 -1
- package/web/app/immutable/nodes/{8.BO5ffLDm.js → 8.BgjULPKU.js} +1 -1
- package/web/app/immutable/nodes/{9.D0POivb2.js → 9.DOkmR0cl.js} +2 -2
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/C4AJzMws.js +0 -411
- package/web/app/immutable/chunks/DrCYFWYk.js +0 -1
- package/web/app/immutable/entry/start.1qdHg029.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{bm as r}from"./Fcr7AvC-.js";import{JH as s,n_ as p,Cc as N,yJ as f,q$ as F,nZ as T,s2 as m,hu as U,LU as B,o as H,mZ as V,hq as k,F as W}from"./D0qhIm1r.js";import{w as Y}from"./BwweojP5.js";import{cx as z,cf as $,cS as G,co as h,cc as M,cJ as R,d0 as C,c$ as K,dI as I,cZ as Z,c_ as J,d2 as X}from"./cD292w1o.js";const Q={auggie:"auggie",claudeCode:"claude-code",codex:"codex",mock:"mock",opencode:"opencode",pi:"pi",cortex:"cortex",droid:"droid",grok:"grok",unsloth:"unsloth",antigravity:"antigravity",cursor:"cursor",dsh:"dsh"},ee=new Map(Object.entries(Q).map(([e,t])=>[t,e]));function te(e,t){const o=ee.get(t);return o===void 0?void 0:e?.providers[o]}function De(e,t){const o=te(e,t);return o?.available===!0&&O(t,o.authenticated)}const je=new Set(["claude-code"]);function O(e,t){return t!==!1}const y=new WeakMap,qe=s.createSelector((e,t)=>e.agentAvailability.providerStatusMap[t]?.viaNpx===!0),Ne=s.createSelector((e,t)=>{const o=e.agentAvailability.providerStatusMap[t];return o?.available===!0&&o.authenticated!==!0}),w=s.createSelector(e=>{if(!z.select(e))return e.agentAvailability.providerStatusMap;const t=e.providerCatalog?.providers;if(!t)return{};let o=y.get(t);return o||(o=Object.fromEntries(p(t).map(n=>[n.id,{available:!0}])),y.set(t,o)),o}),Fe=s.createSelector(e=>e.agentAvailability.providerLoadingMap),Te=s.createSelector(e=>e.agentAvailability.providerCheckEpochMap),re=s.createSelector(e=>e.agentAvailability.hasCheckedOnce),Ue=s.createSelector(e=>Object.values(e.agentAvailability.providerLoadingMap).some(t=>t)),Be=s.createSelector(e=>e.agentAvailability.npxStatus),He=s.createSelector(e=>e.agentAvailability.hiddenProviders),Ve=s.createSelector(e=>e.agentAvailability.discoveryError),We=s.createSelector(e=>e.agentAvailability.discoveryRevision),Ye=s.createSelector(e=>e.agentAvailability.refreshModelsPending),ze=s.createSelector(e=>e.agentAvailability.refreshModelsRevision),$e=s.createSelector(e=>e.sidebarNav?.onboardingActive&&e.userPreferences.providerSetupHydratedBackendId===e.connections.windowBackendId&&!e.userPreferences.hasCompletedProviderSetup&&$.select(e)==="owner"?G.select(e):null),Ge=s.createSelector((e,t)=>p(e.providerSettings.requests).filter(o=>o.sessionId===t)),Ke=s.createSelector((e,t)=>e.providerSettings.sessions.includes(t)),Ze=s.createSelector((e,t)=>e.providerSettings.writeRevisions?.[t]??0),Je=s.createSelector(e=>e.providerSettings.paths),Xe=s.createSelector(e=>e.providerSettings.pathsRevision),g=s.createSelector(e=>h.select(e)?M.select(e)?.defaultProviderId??"":e.model.defaultProviderId);s.createSelector((e,t)=>g.select(e)===t);const oe=s.createSelector(e=>h.select(e)?Object.fromEntries((M.select(e)?.enabledProviderIds??[]).map(t=>[t,!0])):e.providerSettings.enabledProviders),A=s.createSelector((e,t)=>{if(h.select(e))return M.select(e)?.enabledProviderIds?.includes(t)===!0;const o=e.providerSettings.nonDisableableProviderIds??[];return N(e.providerSettings.enabledProviders,t,{canBeDisabled:!o.includes(t)})}),L=s.createSelector(e=>{if(h.select(e))return M.select(e)?.enabledProviderIds??[];const t=e.providerSettings.enabledProviders,o=e.providerCatalog?p(e.providerCatalog.providers):[],n=new Set(o.filter(c=>A.select(e,c.id)).map(c=>c.id)),i=g.select(e),a=f(i);a&&t[a]!==!1&&n.add(a);for(const[c,l]of Object.entries(t))l&&n.add(c);return[...n]});function ne(e,t){const o=C.select(e,t);return h.select(e)?o?.visible!==!0:!!(o?.requiresEnvVar||o?.requiresFeatureCode)}const S=s.createSelector(e=>{const t=w.select(e);return L.select(e).filter(o=>!ne(e,o)&&t[o]?.available===!0)}),Qe=s.createSelector((e,t)=>{const o=w.select(e),n=R.select(e,t);return S.select(e).filter(i=>R.select(e,i)!==n&&A.select(e,i)&&O(i,o[i]?.authenticated))}),et=s.createSelector(e=>re.select(e)?S.select(e):L.select(e)),tt=s.createSelector(e=>{const t=f(g.select(e));return S.select(e).includes(t)}),rt=s.createSelector(e=>e.providerSettings.fastMode),ot=s.createSelector(e=>{const t=e.providerSettings.fastMode,o={...t?.confirmed};for(const[n,i]of Object.entries(t?.pending??{}))o[n]=i.enabled;return o}),nt=s.createSelector(e=>Object.values(u(e).defaults).some(t=>t.remoteLaunch!==void 0)),st=s.createSelector(e=>e.providerSettings.fastMode?.supported?["claude-code","codex"].filter(t=>C.select(e,t)?.supportsFastMode===!0):[]),u=e=>e.providerSettings?.profiles??F,at=s.createSelector(e=>K.select(e).filter(t=>t.supportsProfiles===!0).map(t=>t.id)),it=s.createSelector((e,t)=>p(u(e).items).filter(o=>o.baseProviderId===t)),ct=s.createSelector(e=>[...new Set(p(u(e).items).map(t=>t.baseProviderId))]),lt=s.createSelector(e=>u(e).defaults),dt=s.createSelector((e,t)=>u(e).defaults[t]),ut=s.createSelector((e,t)=>T(u(e).items,t)),_t=s.createSelector(e=>u(e).revision),pt=s.createSelector(e=>u(e).loadStatus),ft=s.createSelector(e=>u(e).status),ht=s.createSelector(e=>u(e).activation),vt=s.createSelector(e=>Object.fromEntries(p(u(e).mutations).map(t=>[t.id,t]))),se={},mt=s.createSelector(e=>u(e).identity??se),ae={},Mt=s.createSelector(e=>u(e).setups??ae),bt=s.createSelector(e=>(e.providerSettings?.sessions.length??0)>0);function E(e){const t=e.trim();if(!t.startsWith("tc"))return!1;const o=t.slice(2);if(o.length<50||o.length%4===1||!/^[A-Za-z0-9_-]+$/.test(o))return!1;const n=atob(o.slice(0,4).replace(/-/g,"+").replace(/_/g,"/")).charCodeAt(0);return n>=161&&n<=187||n===191}function gt(e){if(!e||typeof e!="object")return null;const t=e;for(const o of[t.collaborationName,t.prettyHostname,t.hostname])if(typeof o=="string"&&v(o))return v(o);return null}function St(e){return[...v(e)].length<=100&&!/\p{Cc}/u.test(e)}function v(e){return e.replace(/^\p{White_Space}+|\p{White_Space}+$/gu,"")}function ie(e){const t=e.label.trim(),o=e.host&&e.port!=null?`${e.host}:${e.port}`:"";return(t&&t!==o?t:"")||e.hostname?.trim()||t||o}function ce(e){return r.layout_daemonStatus_localConnection_label()}function Pt(e,t){return e.isLocal?ce():ie(e)}function le(e){const t=v(e.hostname??"");return t||(E(e.label)?r.connection_unknownHost_label():e.label)}function kt(e){const t=e.label.trim();return!t||E(t)?null:t!==le(e)?t:null}function Rt(e){return e.catalogProfiles.some(t=>typeof t.remoteCompatible=="boolean")||e.defaultRemoteIncompatibility||e.defaultRemoteLaunch||e.profileDefaults.some(t=>typeof t.remoteCompatible=="boolean")?"supported":e.catalogProfiles.length>0?"unsupported":e.profilesLoadStatus==="idle"?"unknown":"unsupported"}function yt(e,t,o){if(m(e)){const n=t.find(i=>i.providerRef===e);return n?.remoteCompatible!==!1?null:n.remoteIncompatibility??{reason:"unknown",keys:[]}}return null}const de=1440*60*1e3;function x(e,t){if(!e?.capabilities)return"missing";const o=e.observedAt?Date.parse(e.observedAt):Number.NaN;return Number.isFinite(o)&&t-o>de?"stale":"fresh"}function Ct(e,t,o){if(!e||x(e,o)!=="fresh")return;const n=f(t),i=e.capabilities?.providers.find(a=>a.id===n);return i&&i.models.length>0?i.models:void 0}function It(e,t,o){const n=f(t),i=new Set;for(const a of e){if(a.state==="revoked"||x(a,o)!=="fresh")continue;const c=a.capabilities?.providers.find(l=>l.id===n);if(!(!c||!_e(c)))for(const l of c.models)i.add(l)}return[...i]}const ue=new Set(["cli-missing","prerequisite-missing"]);function _e(e){return e.visible!==!1&&!ue.has(e.status)}const pe=new Set(["signed-out","auth-failed"]);function fe(e){return pe.has(e)}function he(e,t){if(m(t))return!1;const o=f(t),n=e?.capabilities?.providers.find(i=>i.id===o);return!!n&&fe(n.status)}function D(e,t){return(t.defaultRemoteLaunch?t.defaultRemoteLaunch[e]==="send":!t.defaultRemoteIncompatibility?.[e])&&t.defaultHasOverrides?.[e]!==!1}function ve(e,t,o){return o.defaultRemoteLaunch?.[t]==="refused"?!1:!e.cloud&&!he(e,t)}function Ot(e){const{machine:t,providerRef:o}=e;return m(o)||ve(t,o,e)||D(o,e)?null:e.catalogProfiles.find(n=>n.baseProviderId===o&&n.remoteCompatible===!0)??null}const me="https://e2b.dev/dashboard",Me="https://app.northflank.com",be="https://www.agent37.com/dashboard/cloud",ge="https://vercel.com/dashboard";function wt(e="e2b"){return e==="vercel"?ge:e==="northflank"?Me:e==="agent37"?be:me}function Se(e){switch(e){case"northflank":return{keyRejected:r.cloudMachines_northflank_state_tokenRejected_label(),unreachable:r.cloudMachines_northflank_state_unreachable_label(),ownerOnly:r.cloudMachines_northflank_error_ownerOnly(),saved:r.cloudMachines_northflank_saved_toast(),listTitle:r.cloudMachines_northflank_services_title(),dashboardOpen:r.cloudMachines_northflank_dashboardOpen_label(),deleteTitle:r.cloudMachines_northflank_delete_confirmTitle,deleteDescription:r.cloudMachines_northflank_delete_confirm_description(),creating:r.cloudMachines_northflank_start_creating(),startFailed:r.cloudMachines_northflank_startFailure_title(),startUnknown:r.cloudMachines_northflank_startFailure_unknown_cause()};case"agent37":return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_agent37_state_unreachable_label(),ownerOnly:r.cloudMachines_agent37_error_ownerOnly(),saved:r.cloudMachines_agent37_saved_toast(),listTitle:r.cloudMachines_agent37_instances_title(),dashboardOpen:r.cloudMachines_agent37_dashboardOpen_label(),deleteTitle:r.cloudMachines_agent37_delete_confirmTitle,deleteDescription:r.cloudMachines_agent37_delete_confirm_description(),creating:r.cloudMachines_agent37_start_creating(),startFailed:r.cloudMachines_agent37_startFailure_title(),startUnknown:r.cloudMachines_agent37_startFailure_unknown_cause()};case"vercel":return{keyRejected:r.cloudMachines_vercel_state_tokenRejected_label(),unreachable:r.cloudMachines_vercel_state_unreachable_label(),ownerOnly:r.cloudMachines_vercel_error_ownerOnly(),saved:r.cloudMachines_vercel_saved_toast(),listTitle:r.cloudMachines_vercel_sandboxes_title(),dashboardOpen:r.cloudMachines_vercel_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_vercel_delete_confirm_description(),creating:r.cloudMachines_vercel_start_creating(),startFailed:r.cloudMachines_vercel_startFailure_title(),startUnknown:r.cloudMachines_vercel_startFailure_unknown_cause()};default:return{keyRejected:r.cloudMachines_state_keyRejected_label(),unreachable:r.cloudMachines_state_unreachable_label(),ownerOnly:r.cloudMachines_error_ownerOnly(),saved:r.cloudMachines_saved_toast(),listTitle:r.cloudMachines_sandboxes_title(),dashboardOpen:r.cloudMachines_dashboardOpen_label(),deleteTitle:r.cloudMachines_delete_confirmTitle,deleteDescription:r.cloudMachines_delete_confirm_description(),creating:r.cloudMachines_start_creating(),startFailed:r.cloudMachines_startFailure_title(),startUnknown:r.cloudMachines_startFailure_unknown_cause()}}}function At(e){return e==="vm"?r.cloudMachines_agent37_form_type_vm():r.cloudMachines_agent37_form_type_default()}function Lt(e){return e==="eu"?r.cloudMachines_agent37_region_eu():e==="ap-south"?r.cloudMachines_agent37_region_apSouth():r.cloudMachines_agent37_region_us()}const Pe=/^E2B\s*·\s*/u;function Et(e,t){const o=t?`${t} · `:null;return(o&&e.name.startsWith(o)?e.name.slice(o.length):e.name.replace(Pe,"")).trim()||e.name}function xt(e){const t=U(e);return t?r.cloudMachines_size_label({vcpu:String(t.vcpu),memory:String(t.memoryGiB)}):e}function Dt(e,t,o){const n=e.cloud;if(!n)return 0;const i=n.state==="running"&&t>0?Math.max(0,(o-t)/1e3):0;return Math.floor(n.runningSeconds+i)}function jt(e){const t=Math.floor(e/60);if(t<1)return r.cloudMachines_uptime_underMinute();if(t<60)return r.cloudMachines_uptime_minutes({minutes:String(t)});const o=Math.floor(t/60),n=t%60;return n===0?r.cloudMachines_uptime_hours({hours:String(o)}):r.cloudMachines_uptime_hoursMinutes({hours:String(o),minutes:String(n)})}const ke=new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2});function qt(e){const t=V(e,3600);return t===null?null:r.cloudMachines_size_hourly({amount:ke.format(t)})}function j(e){try{return new URL(e).host||e}catch{return e}}function Nt(e){const t=e.find(o=>o.cloud?.state==="running")?.cloud?.relayUrl;return t?r.cloudMachines_relay_host({host:j(t)}):null}function Ft(e){const t=a=>e.filter(c=>c.cloud?.state===a).length,o=t("running"),n=t("paused"),i=[o>0?r.cloudMachines_sandboxes_running_count({count:String(o)}):null,n>0?r.cloudMachines_sandboxes_paused_count({count:String(n)}):null].filter(a=>a!==null);return i.length>0?i.join(" · "):null}function Tt(e,t){const o=new Map;for(const a of e){const c=a.cloud?.workspaceId,l=c?t(c):null,_=c&&l?c:"";let d=o.get(_);d||(d={key:_,name:l??r.cloudMachines_sandboxes_otherWorkspace(),sandboxes:[]},o.set(_,d)),d.sandboxes.push(a)}const n=a=>+(a.cloud?.state==="paused"),i=a=>Number(a.sandboxes.every(c=>n(c)));for(const a of o.values())a.sandboxes.sort((c,l)=>n(c)-n(l)||(l.cloud?.startedAt??"").localeCompare(c.cloud?.startedAt??"")||c.id.localeCompare(l.id));return[...o.values()].sort((a,c)=>i(a)-i(c)||+(a.key==="")-+(c.key==="")||a.name.localeCompare(c.name,void 0,{sensitivity:"base"})||a.key.localeCompare(c.key))}function Re(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_northflank_error_profileRequired_title(),description:r.cloudMachines_northflank_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_northflank_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_northflank_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_northflank_error_quotaRate_description():r.cloudMachines_northflank_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_northflank_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_northflank_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_northflank_error_tokenRejected_title(),description:r.cloudMachines_northflank_error_tokenRejected_description()};case"project-missing":return t(r.cloudMachines_northflank_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_northflank_error_permissionDenied_title(),description:r.cloudMachines_northflank_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_northflank_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_northflank_error_serviceLost_title(),description:r.cloudMachines_northflank_error_serviceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_northflank_error_bootstrapFailed_description());default:return t(r.cloudMachines_northflank_error_apiError_description())}}}}function ye(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_agent37_error_profileRequired_title(),description:r.cloudMachines_agent37_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_agent37_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_agent37_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_agent37_error_quotaRate_description():r.cloudMachines_agent37_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_agent37_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_agent37_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_agent37_error_keyRejected_title(),description:r.cloudMachines_agent37_error_keyRejected_description()};case"permission-denied":return{title:r.cloudMachines_agent37_error_permissionDenied_title(),description:r.cloudMachines_agent37_error_permissionDenied_description()};case"no-capacity":return{title:r.cloudMachines_agent37_error_noCapacity_title(),description:r.cloudMachines_agent37_error_noCapacity_description()};case"template-missing":return t(r.cloudMachines_agent37_error_templateMissing_description());case"sandbox-lost":return{title:r.cloudMachines_agent37_error_instanceLost_title(),description:r.cloudMachines_agent37_error_instanceLost_description()};case"bootstrap-failed":return t(r.cloudMachines_agent37_error_bootstrapFailed_description());default:return t(r.cloudMachines_agent37_error_apiError_description())}}}}function Ce(e){switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_vercel_error_profileRequired_title(),description:r.cloudMachines_vercel_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_vercel_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_vercel_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_vercel_error_quotaRate_description():r.cloudMachines_vercel_error_quotaConcurrency_description()};case"cloud-machine-unavailable":{const t=o=>({title:r.cloudMachines_vercel_error_unavailable_title(),description:o});switch(e.reason){case"not-configured":return t(r.cloudMachines_vercel_error_notConfigured_description());case"key-rejected":return{title:r.cloudMachines_vercel_error_keyRejected_title(),description:r.cloudMachines_vercel_error_keyRejected_description()};case"project-missing":return t(r.cloudMachines_vercel_error_projectMissing_description());case"permission-denied":return{title:r.cloudMachines_vercel_error_permissionDenied_title(),description:r.cloudMachines_vercel_error_permissionDenied_description()};case"template-missing":return t(r.cloudMachines_vercel_error_imageMissing_description());case"sandbox-lost":return{title:r.cloudMachines_vercel_error_sandboxLost_title(),description:r.cloudMachines_vercel_error_sandboxLost_description()};case"bootstrap-failed":return t(r.cloudMachines_vercel_error_bootstrapFailed_description());default:return t(r.cloudMachines_vercel_error_apiError_description())}}}}function Ut(e,t){if(e.code==="cloud-machine-unavailable"&&e.reason==="relay-unreachable")return{title:r.cloudMachines_error_relayUnreachable_title(),description:e.relayUrl?r.cloudMachines_error_relayUnreachable_description({host:j(e.relayUrl)}):r.cloudMachines_error_relayUnreachable_noHost_description()};const o=e.provider??t;if(o==="northflank")return Re(e);if(o==="agent37")return ye(e);if(o==="vercel")return Ce(e);switch(e.code){case"cloud-profile-required":return{title:r.cloudMachines_error_profileRequired_title(),description:r.cloudMachines_error_profileRequired_description()};case"cloud-quota":return{title:r.cloudMachines_error_quota_title(),description:e.limit==="plan"?r.cloudMachines_error_quotaPlan_description():e.limit==="rate"?r.cloudMachines_error_quotaRate_description():r.cloudMachines_error_quotaConcurrency_description()};case"cloud-machine-unavailable":switch(e.reason){case"not-configured":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_notConfigured_description()};case"key-rejected":return{title:r.cloudMachines_error_keyRejected_title(),description:r.cloudMachines_error_keyRejected_description()};case"template-missing":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_templateMissing_description()};case"sandbox-lost":return{title:r.cloudMachines_error_sandboxLost_title(),description:r.cloudMachines_error_sandboxLost_description()};case"bootstrap-failed":return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_bootstrapFailed_description()};default:return{title:r.cloudMachines_error_unavailable_title(),description:r.cloudMachines_error_apiError_description()}}}}function Bt(e,t,o){const n=e.trim();if(!n)return r.cloudMachines_form_name_required();if(B(n)>H||/[\u0000-\u001f\u007f]/u.test(n))return r.cloudMachines_form_name_invalid();const i=n.toLowerCase();return t.some(a=>a.id!==o&&a.name.trim().toLowerCase()===i)?r.cloudMachines_form_name_taken():null}const Ie=s.createSelector(e=>Y.select(e)&&e.remoteMachines?.supported===!0&&e.cloudMachines?.supported===!0),Ht=s.createSelector(e=>{const t=e.cloudMachines?.providerKinds??["e2b"];return e.cloudMachines?.entries===!0?t:t.filter(o=>o==="e2b")}),Vt=s.createSelector(e=>e.cloudMachines?.diskSettings??{}),Wt=s.createSelector(e=>e.cloudMachines?.entries===!0);function q(e){return Object.values(e.cloudMachines?.providers??{}).sort((t,o)=>t.configuredAt.localeCompare(o.configuredAt)||t.name.localeCompare(o.name))}const Yt=s.createSelector(q),zt=s.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).sort((t,o)=>(t.cloud?.startedAt??"").localeCompare(o.cloud?.startedAt??""))),$t=s.createSelector(e=>Object.values(e.cloudMachines?.machines??{}).filter(t=>t.cloud?.state==="paused").length);function Oe(e,t){const o=t.cloud;return!o?.agentId||!o.workspaceId||!I.select(e,o.workspaceId)?null:{workspaceId:o.workspaceId,agentId:o.agentId}}const Gt=s.createSelector((e,t)=>{const o={},n={};for(const i of t){const a=i.cloud?.workspaceId;if(a&&!(a in o)){const c=I.select(e,a);o[a]=c?.title||c?.name||null}n[i.id]=Oe(e,i)}return{workspaceNames:o,agentLinks:n}}),Kt=s.createSelector(e=>e.cloudMachines?.readAt??{}),Zt=s.createSelector(e=>e.cloudMachines?.pending??{}),Jt=s.createSelector(e=>e.cloudMachines?.failures??{}),Xt=s.createSelector(e=>e.cloudMachines?.validated??null);function Qt(e){if(!Ie.select(e))return null;const t=q(e);if(t.length===0)return null;const o=e.cloudMachines?.entries===!0;return t.map(n=>({cloudMachineId:n.id,label:n.provider==="e2b"?o&&(t.length>1||n.name.trim().toLowerCase()!=="e2b")?r.cloudMachines_startOn_entry_label({name:n.name}):r.cloudMachines_startOn_label():n.name.trim().toLowerCase()===k(n.provider).toLowerCase()?k(n.provider):n.provider==="northflank"?r.cloudMachines_startOn_northflank_label({name:n.name}):n.provider==="agent37"?r.cloudMachines_startOn_agent37_label({name:n.name}):r.cloudMachines_startOn_vercel_label({name:n.name}),unavailableReason:n.state==="key-rejected"?Se(n.provider).keyRejected:null,needsProfile:!we(e,n)}))}function we(e,t){const o=oe.select(e),n=e.providerSettings?.profiles?.defaults??{},i={defaultRemoteLaunch:J.select(e),defaultRemoteIncompatibility:Z.select(e)},a=d=>o[d]!==!1&&(t.agentProviders.length===0||t.agentProviders.includes(d)),c=new Set([...t.agentProviders,...Object.keys(i.defaultRemoteLaunch??{})]);for(const d of c)if(a(d)&&(n[d]?.env.length??0)>0&&D(d,i))return!0;const l=e.providerSettings?.profiles?.items,_=l?p(l):[];return X.select(e).some(d=>{if(d.remoteCompatible!==!0||!a(d.baseProviderId))return!1;const P=_.find(b=>b.providerRef===d.providerRef);return!P||P.env.some(b=>b.kind==="set")})}function er(e,t,o=e.cloudMachines?.providers[W]??null){if(!t)return null;const n=o,i=f(t);if(n&&n.agentProviders.length>0&&!n.agentProviders.includes(i))return r.cloudMachines_startOn_providerMissing();const a=e.providerSettings?.profiles;if(m(t)){const l=a?p(a.items).find(_=>_.providerRef===t):void 0;return l?l.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():l.env.some(_=>_.kind==="set")?null:r.cloudMachines_startOn_needsProfile():null}const c=a?.defaults?.[i];return c?c.remoteCompatible===!1?r.cloudMachines_startOn_needsProfile():c.env.some(l=>l.kind==="set")?null:r.cloudMachines_startOn_needsProfile():a?.loadStatus==="success"?r.cloudMachines_startOn_needsProfile():null}export{re as $,E as A,Dt as B,x as C,Ct as D,v as E,It as F,Ot as G,yt as H,Rt as I,Et as J,g as K,S as L,ct as M,je as N,Vt as O,Q as P,Yt as Q,Wt as R,Jt as S,Ie as T,Zt as U,Ht as V,Kt as W,zt as X,Xt as Y,oe as Z,st as _,Lt as a,tt as a0,Ue as a1,A as a2,et as a3,Be as a4,$e as a5,$t as a6,at as a7,Ne as a8,Te as a9,Ze as aA,Qe as aB,nt as aC,Gt as aD,Qt as aE,St as aF,dt as aa,lt as ab,Ve as ac,We as ad,rt as ae,ot as af,He as ag,Fe as ah,Ye as ai,ze as aj,Je as ak,Xe as al,ut as am,ht as an,mt as ao,vt as ap,Mt as aq,ft as ar,it as as,pt as at,_t as au,qe as av,bt as aw,Ke as ax,Ge as ay,w as az,At as b,wt as c,Bt as d,Nt as e,Ut as f,er as g,Se as h,Ft as i,xt as j,gt as k,ve as l,D as m,ie as n,kt as o,le as p,ce as q,Pt as r,jt as s,te as t,Tt as u,qt as v,_e as w,O as x,De as y,he as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as T,bo as r,bw as W,bq as $,b as x,bs as B}from"./Fcr7AvC-.js";import{bs as C,cd as H,ca as S,a7 as u,ay as f,W as k,bn as q,aA as o}from"./3SdAC2_C.js";import{i as D}from"./BhYXv0ZM.js";import{k as J}from"./Cc0763mU.js";import{a as L}from"./
|
|
1
|
+
import{t as T,bo as r,bw as W,bq as $,b as x,bs as B}from"./Fcr7AvC-.js";import{bs as C,cd as H,ca as S,a7 as u,ay as f,W as k,bn as q,aA as o}from"./3SdAC2_C.js";import{i as D}from"./BhYXv0ZM.js";import{k as J}from"./Cc0763mU.js";import{a as L}from"./Bwa2n5jC.js";import{dI as j}from"./cD292w1o.js";import{JH as z,h0 as E}from"./D0qhIm1r.js";function F(i,t){if(new.target)return T({component:F,...i});C(t,!0);const d=()=>B(v,"$workspace$",b),[b,w]=$();let c=r(t,"tab",7),a=r(t,"workspaceId",7),n=r(t,"layoutId",7),p=r(t,"isActive",7);const m=H(a());S(()=>m.set(a()));const v=j(m);var _={get tab(){return c()},set tab(e){c(e),o()},get workspaceId(){return a()},set workspaceId(e){a(e),o()},get layoutId(){return n()},set layoutId(e){n(e),o()},get isActive(){return p()},set isActive(e){p(e),o()},$set:W,$on:(e,s)=>x(t,e,s)},l=u(),g=f(l);{var y=e=>{var s=u(),h=f(s);J(h,a,A=>{L(A,{get workspace(){return d()},showBackToList:!1,onclose:()=>z.dispatch(E(n()??a(),c().id))})}),k(e,s)};D(g,e=>{p()&&d()&&e(y)})}k(i,l);var I=q(_);return w(),I}export{F as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as bt,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./Fcr7AvC-.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as E,bV as M,aA as F}from"./3SdAC2_C.js";import{b as vt}from"./Dn334wJv.js";import{JH as l,eK as Ut,eL as At,t6 as Bt,op as xt,oq as Ft,Kf as Tt,Ku as Lt,Kk as _t,ou as T}from"./D0qhIm1r.js";import{t as Dt}from"./C-BsEdGZ.js";import{g as Wt}from"./DWGXN6Nr.js";import{dI as Gt,bO as Nt,bQ as Et,bN as Mt,bS as Vt,de as Ht,m as Kt}from"./cD292w1o.js";import{C as qt}from"./
|
|
1
|
+
import{t as bt,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./Fcr7AvC-.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as E,bV as M,aA as F}from"./3SdAC2_C.js";import{b as vt}from"./Dn334wJv.js";import{JH as l,eK as Ut,eL as At,t6 as Bt,op as xt,oq as Ft,Kf as Tt,Ku as Lt,Kk as _t,ou as T}from"./D0qhIm1r.js";import{t as Dt}from"./C-BsEdGZ.js";import{g as Wt}from"./DWGXN6Nr.js";import{dI as Gt,bO as Nt,bQ as Et,bN as Mt,bS as Vt,de as Ht,m as Kt}from"./cD292w1o.js";import{C as qt}from"./BVBh582U.js";import{V as zt}from"./CDtaIFAl.js";import{bT as Jt,bN as Ot,b8 as Qt}from"./D-j7vD5Z.js";import{i as L,n as V}from"./H2jLkRRS.js";import{af as jt}from"./50HYkjWD.js";function Xt(_,$){if(new.target)return bt({component:Xt,..._});Pt($,!0);const H=()=>g(at,"$gitRoots$",c),y=()=>g(ot,"$workspace",c),K=()=>g(nt,"$ftCommits$",c),q=()=>g(lt,"$rootGitRoots$",c),S=()=>g(st,"$ftChanges$",c),z=()=>g(tt,"$foldUnchanged",c),J=()=>g(Z,"$lineWrapping",c),O=()=>g(et,"$diffSideBySide",c),Q=()=>g(rt,"$ftLoading$",c),j=()=>g(it,"$ftBoundarySha$",c),[c,X]=Rt(),Y=o=>{zt(o,{embedded:!0,showExpand:!0,get expanded(){return t(w)},onToggleExpand:()=>{E(w,!t(w)),t(w)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return z()},onToggleFold:()=>l.dispatch(_t()),get wrapEnabled(){return J()},onToggleWrap:()=>l.dispatch(Lt()),get splitEnabled(){return O()},onToggleSplit:()=>l.dispatch(Tt())})},Z=Jt(),tt=Ot(),et=Qt();let P=x($,"tab",7),m=x($,"workspaceId",7),C=x($,"isActive",7);const D=Wt(),p=Dt(()=>m()),ot=Gt(p);I(()=>{const o=m();if(!(!C()||!o||t(n)))return l.dispatch(Ut(o,"all")),()=>l.dispatch(At(o,"all"))});const n=s(()=>P().data?.gitRootId||""),at=jt(p),b=s(()=>H().find(o=>o.id===t(n))),h=s(()=>y()?.worktreePath||y()?.repositoryPath||""),k=s(()=>t(b)?.path||t(h)),st=Nt(p),nt=Et(p),it=Mt(p),rt=Vt(p),dt=s(()=>K()||[]),lt=Ht(p),f=s(()=>q()[t(n)]??Kt),ct=s(()=>t(f).status),gt=s(()=>t(f).loading),mt=s(()=>t(f).commitFiles),ut=s(()=>{const o=t(b)?.registeredCommitSha,i=o?t(f).commits.findIndex(e=>e.hash===o):-1;return i>=0?t(f).commits.slice(0,i):t(f).commits});I(()=>{const o=m(),i=t(n);o&&i&&l.dispatch(Bt(o,i,t(b)?.registeredCommitSha,100))});let w=M(!0),R=M(null);const pt=s(()=>{if(t(n))return[...(t(ct)?.files??[]).map(e=>({filePath:`${t(k)}/${e.path}`,action:"modify",additions:e.additions??0,deletions:e.deletions??0,toolName:"local",toolCallId:`root-${t(n)}-${e.staged}-${e.path}`,staged:e.staged,category:e.staged?"staged":"unstaged"})),...t(ut).flatMap(e=>(t(mt)[e.hash]??[]).map(a=>({filePath:`${t(k)}/${a.path}`,action:"modify",additions:a.additions??0,deletions:a.deletions??0,toolName:"local",toolCallId:`root-commit-${e.hash}-${a.path}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message})))];const o=S().filter(e=>e.stage==="unstaged"),i=S().filter(e=>e.stage==="staged");return[...o.map(e=>{const a=e.file||e.relativePath,r=a&&L(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-unstaged-${r}`,staged:!1,category:"unstaged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...i.map(e=>{const a=e.file||e.relativePath,r=a&&L(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-staged-${r}`,staged:!0,category:"staged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...t(dt).flatMap(e=>(e.files||[]).map(a=>{const r=typeof a=="string"?a:a.path||"",U=r&&L(r)?r:`${t(h)}/${r}`,A=typeof a=="string"?0:a.additions||0,B=typeof a=="string"?0:a.deletions||0;return{filePath:U,action:"modify",additions:A,deletions:B,toolName:"local",toolCallId:`commit-${e.hash}-${r}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message}}))]});function v(o){if(!t(h))return o;const i=V(o),e=V(t(h));return i.startsWith(`${e}/`)?i.slice(e.length+1):o}function W(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"stage",paths:o.map(v),source:"localChanges"}))}function G(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"unstage",paths:o.map(v),source:"localChanges"}))}function ht(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"discard",paths:o.map(v),source:"localChanges"}))}I(()=>{!D||!C()||D.registerActions({display:Y})});const N=crypto.randomUUID();I(()=>{const o=m();if(!(!(C()&&t(n))||!o))return l.dispatch(xt(o,N)),()=>l.dispatch(Ft(o,N))});var ft={get tab(){return P()},set tab(o){P(o),F()},get workspaceId(){return m()},set workspaceId(o){m(o),F()},get isActive(){return C()},set isActive(o){C(o),F()},$set:wt,$on:(o,i)=>It($,o,i)};{let o=s(()=>t(n)?t(gt):Q()),i=s(()=>t(n)||void 0),e=s(()=>t(n)?t(k):void 0),a=s(()=>y()?.baseRef??null),r=s(()=>t(n)?t(b)?.registeredCommitSha||null:j()||y()?.baseCommitSha||null),U=s(()=>!t(n)),A=s(()=>t(n)?void 0:d=>void W([d])),B=s(()=>t(n)?void 0:d=>void G([d])),Ct=s(()=>t(n)?void 0:d=>void ht([d])),yt=s(()=>t(n)?void 0:()=>{const d=S().filter(u=>u.stage==="unstaged");W(d.map(u=>u.relativePath||u.file))}),St=s(()=>t(n)?void 0:()=>{const d=S().filter(u=>u.stage==="staged");G(d.map(u=>u.relativePath||u.file))});vt(qt(_,{get isLoading(){return t(o)},get changes(){return t(pt)},get gitRootId(){return t(i)},get gitRootPath(){return t(e)},get branchBaseRef(){return t(a)},get branchBaseCommitSha(){return t(r)},get showStagingControls(){return t(U)},showCategoryFilter:!0,get onStage(){return t(A)},get onUnstage(){return t(B)},get onRevert(){return t(Ct)},get onStageAll(){return t(yt)},get onUnstageAll(){return t(St)}}),d=>E(R,d,!0),()=>t(R))}var $t=kt(ft);return X(),$t}export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ca as p,c5 as i,aD as l,c9 as S,bs as W,a7 as R,ay as q,W as z,bn as I,aA as m}from"./3SdAC2_C.js";import{JH as h,t3 as K,bt as C}from"./D0qhIm1r.js";import{t as x,bo as u,bw as M,bs as f,bq as A,b as D}from"./Fcr7AvC-.js";import{i as E}from"./BhYXv0ZM.js";import{t as H}from"./C-BsEdGZ.js";import{m as J}from"./A0p6PvBn.js";import{aK as O}from"./
|
|
1
|
+
import{ca as p,c5 as i,aD as l,c9 as S,bs as W,a7 as R,ay as q,W as z,bn as I,aA as m}from"./3SdAC2_C.js";import{JH as h,t3 as K,bt as C}from"./D0qhIm1r.js";import{t as x,bo as u,bw as M,bs as f,bq as A,b as D}from"./Fcr7AvC-.js";import{i as E}from"./BhYXv0ZM.js";import{t as H}from"./C-BsEdGZ.js";import{m as J}from"./A0p6PvBn.js";import{aK as O}from"./BuM8LV7z.js";import{c as j}from"./DkQdSPDN.js";function V(t){const s=()=>h.dispatch(K({quiet:t.quiet}));p(()=>{t.key?.(),t.active()&&i(s)});const r=S(()=>t.workspaces().some(o=>o.status===C.Retired));let a=i(()=>l(r));p(()=>{const o=l(r);i(()=>{a&&!o&&t.active()&&s(),a=o})})}function B(t,s){if(new.target)return x({component:B,...t});W(s,!0);const r=()=>f($,"$connected$",o),a=()=>f(_,"$slot$",o),[o,k]=A();let c=u(s,"workspaceId",7),n=u(s,"size",7,"default");const $=J(),_=O(H(()=>c()));var b={get workspaceId(){return c()},set workspaceId(e){c(e),m()},get size(){return n()},set size(e="default"){n(e),m()},$set:M,$on:(e,y)=>D(s,e,y)},d=R(),g=q(d);{var v=e=>{j(e,{get slot(){return a()},get size(){return n()}})};E(g,e=>{r()&&a()!==null&&e(v)})}z(t,d);var w=I(b);return k(),w}export{B as W,V as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CCAtqaSn.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/cD292w1o.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.DylRFR3N.css"])))=>i.map(i=>d[i]);
|
|
2
|
-
var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{JH as a,uC as ce,n_ as k,nZ as y,mq as le,c9 as de,c8 as ue,cn as pe,cm as ge,z6 as C,z7 as B,z4 as he,z3 as fe,z5 as Se,rV as be,o0 as w}from"./D0qhIm1r.js";import{cU as me,cJ as ve,bJ as _e,cS as Q,aJ as Ae,c3 as ke,c$ as ye,cl as we,cB as Ee,cn as Ce}from"./cD292w1o.js";import{a as Pe,i as Re}from"./CL3a4Hm1.js";import{c as N}from"./ChTqQfQN.js";import{x as Me,aO as Te,c as Ie,aD as Fe,B as De,y as Le,z as xe}from"./k5fprFtz.js";import{a0 as Oe,K as J,a1 as We,ay as U,Z as Be,a3 as Ge,L as Ve,$ as Ne,aA as Ue,x as He}from"./DrCYFWYk.js";import{bm as n,_ as qe}from"./Fcr7AvC-.js";import{i as D}from"./BBWuirRW.js";import{n as ze}from"./BqF1bVQC.js";const $e=5,L=120,je=4e3,j=.2,Ke=.8;function Ze(e,t,r=$e){const s=e.length>0?t/(2*e.length):0,i=je/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let z=0;for(let F=f;F<b;F+=1)z+=e[F]??0;const $=(z/(b-f)/255-j)/(Ke-j);return Number.isFinite($)?Math.min(1,Math.max(0,$)):0})}const _r=a.createSelector(e=>me.select(e)?.capabilities.gitlabCheckout===!0),Ar=a.createSelector(e=>e.gitlabAuth.host),kr=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),yr=a.createSelector(e=>ce(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Er=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Cr=a.createSelector(e=>e.gitlabAuth.isConfigured),Pr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Rr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Mr=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Tr=a.createSelector(e=>e.gitlabAuth.user),Ir=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const Fr=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],Y=new Set(["pr-reviewer"]),Dr="developer";function Lr(e){return A.find(t=>t.id===e)}const Qe=a.createSelector(e=>e.githubAuth.mutationRequestId),Je=a.createSelector(e=>e.githubAuth.callbacksCancelled),Ye=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),Xe=a.createSelector(e=>e.githubAuth.statusSettled===!0),et=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),tt=a.createSelector(e=>e.githubAuth.user),rt=a.createSelector(e=>e.githubAuth.isAuthenticating),st=a.createSelector(e=>e.githubAuth.deviceFlow),it=a.createSelector(e=>e.githubAuth.error),xr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Je,selectGitHubAuthDeviceFlow:st,selectGitHubAuthError:it,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:rt,selectGitHubAuthIsDisconnecting:Ye,selectGitHubAuthMutationRequestId:Qe,selectGitHubAuthRequiresDaemonAuth:et,selectGitHubAuthStatusSettled:Xe,selectGitHubAuthUser:tt},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function at(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&at(e.modelOptions,r.modelOptions):!1}const Or=a.createSelector(e=>e.specialists.bundledSpecialists),nt=a.createSelector(e=>e.specialists.fileSpecialists),Wr=a.createSelector(e=>k(nt.select(e))),Br=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Gr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Vr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),Nr=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Ur=a.createSelector(e=>e.specialists.specialistsFolderPath),Hr=a.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:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(Y.has(t)&&!X.select(e)));function ot(e,t){return t?e:e.filter(r=>!Y.has(r.id))}function ct(e,t){return ot(e,t).filter(r=>!r.hidden)}function qr(e,t){return ct(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=k(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),zr=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),lt=a.createSelector((e,t)=>{const r=y(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(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&k(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),$r=a.createSelector((e,t)=>lt.select(e,t)?.name??null),jr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),Kr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Zr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Qr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const Jr=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),Yr=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!y(e.specialists.fileSpecialists,t)),Xr=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=y(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.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 y(e.specialists.fileSpecialists,t)}),es=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),ts=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=y(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),rs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return ve.select(e,o,r);const l=_e.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=y(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:dt.select(e,t)}),dt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:Oe.select(e)?J.select(e):""}),ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?k(r):[]}),is=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??le),as=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),O=N("Clipboard");async function ns(e){let t;if(Pe())try{const r=await Re("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,O.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 O.error("Browser clipboard write failed",r,{electronError:t}),r}throw O.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}function os(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 ut=0;function pt(e,t){const r=++ut;return a.dispatch(ue(e,t,r)),r}function cs(e,t,r){a.dispatch(de(e,t,r))}async function ee(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(pe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??pt(e,t)}))).status==="success"}finally{a.dispatch(ge(i,o))}}async function ls(e,t,r,s,i){return ee(e,t,{kind:"effort",effort:r,previous:s},i)}async function ds(e,t,r,s,i){return ee(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const gt=a.createSelector((e,t)=>k(e.agentModel.mutations).filter(r=>r.consumerId===t)),us=a.createSelector((e,t)=>gt.select(e,t).some(r=>r.status==="pending")),ps=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ae.select(e,t),o=Me.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Te(l),g=c?Ie(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!ke.select(e,r)}});function ht(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const gs=a.createSelector(e=>We.select(e)?null:U.select(e)),ft=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),hs=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),fs=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===ft.select(e)),te=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:ye.select(e)),re=a.createSelector((e,t)=>{if(!t)return J.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return Be.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),se=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=q.select(e,t),s=re.select(e,t),i=S.select(e,t)?.readiness??{};return te.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ss=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return te.select(e,t).filter(i=>ht(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),bs=a.createSelector((e,t)=>t?se.select(e,t):Ve.select(e)),ms=a.createSelector((e,t)=>v.select(e,t)),vs=a.createSelector((e,t)=>t?!!S.select(e,t):Ne.select(e)),_s=a.createSelector((e,t)=>{if(!t)return Fe.select(e);const r=S.select(e,t)?.settings??[],s=re.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),As=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):De.select(e)),ks=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Le.select(e)),ys=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):xe.select(e)),ws=a.createSelector((e,t,r)=>{if(!r)return Ue.select(e,t);const s=q.select(e,r),i=S.select(e,r);return se.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&He(o,i?.readiness[o]?.authenticated))}),Es=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),St={},Cs=a.createSelector(e=>e.providerSettings?.profiles?.status??St),Ps=a.createSelector(e=>e.directoryPicker.source??"daemon"),Rs=a.createSelector(e=>e.directoryPicker.listing),Ms=a.createSelector(e=>e.directoryPicker.loading),Ts=a.createSelector(e=>e.directoryPicker.error),Is=a.createSelector(e=>e.directoryPicker.pathError),Fs=a.createSelector(e=>e.directoryPicker.createError),bt=N("WorkspaceValidation");async function Ds(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mt(s)?_t(s):At(s,t,r)}function mt(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 vt(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function _t(e){return vt(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function At(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(bt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ls(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function xs(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 Os(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ws(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Bs(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function yt(e){return e===void 0||!kt.includes(e)}function Gs(e){return e.status==="restarting"?"restarting":yt(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 wt(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Vs=a.createSelector(e=>e.voiceSettings.isLoading),Ns=a.createSelector(e=>e.voiceSettings.available),Us=a.createSelector(e=>e.voiceSettings.provider),Hs=a.createSelector(e=>e.voiceSettings.engine),qs=a.createSelector(e=>e.voiceSettings.osEngineAvailable),zs=a.createSelector(e=>e.voiceSettings.keyConfigured),$s=a.createSelector(e=>e.voiceSettings.vocabulary),js=a.createSelector(e=>e.voiceSettings.openaiModel),Ks=a.createSelector(e=>e.voiceSettings.language),Zs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Qs=a.createSelector(e=>e.voiceSettings.inputDeviceId),Js=a.createSelector(e=>e.voiceSettings.inputDevices),Ys=a.createSelector(e=>e.voiceSettings.busyProvider),Xs=a.createSelector(e=>e.voiceSettings.error),ei=a.createSelector(e=>we.select(e)?"unavailable":wt(e.voiceSettings)),G="intent.voice.inputDevice";let V;function Et(){if(V!==void 0)return V;try{const e=localStorage.getItem(G);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ti(e){V=e;try{e===null?localStorage.removeItem(G):localStorage.setItem(G,e)}catch{}}let R=null;function ri(e){R=e}function si(){const e=R;return R=null,e}function Ct(){R=null}const Pt=300,Rt=300;class Mt{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??Pt,this.doublePressWindowMs=t.doublePressWindowMs??Rt,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 M=null;function ii(e){M=e}function ai(){const e=M;return M=null,e}function Tt(){M=null}const It=66;function Ft(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(Ze(g,l.sampleRate))},It);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Dt=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function ni(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Ot(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Wt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);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??Dt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Ot(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Ft(t,this.onLevels)),"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,i=this.cancelRequested;this.teardown(),!i&&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.stopMeter?.(),this.stopMeter=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 Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Mt({onRecordStart:()=>{E&&Nt(E)},onRecordStop:e=>{ie(E,e)}});function oi(){return p!==null}function ci(){return p}function li(e){E=e,_+=1,_===1&&I.keyDown()}function di(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Nt(e,t="key"){if(p!==null)return;Tt(),Ct();const r=new Wt({deviceId:Et(),onLevels:s=>{p===r&&e.dispatch(fe(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(B());return}e.dispatch(he({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(Se({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(B())}})}function ie(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(B());return}m=t,r.stop()}function ui(){ie(null,Vt)}function pi(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ut=N("HardwareConsoleVoiceSetupToast"),Ht="hardware-console-voice-setup";let W=null;function qt(){return W||(W=qe(()=>import("./CCAtqaSn.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url).then(e=>e.notify)),W}function zt(){ze("/settings?tab=connections#voice").catch(e=>{Ut.error("Failed to open voice settings from setup toast",e)})}function $t(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function gi(){qt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Ht,action:$t()})})}const hi=a.createSelector(e=>e.externalEditors.selectedAction),jt=a.createSelector(e=>e.externalEditors.editors),Kt=a.createSelector(e=>{const t=k(jt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),fi=a.createSelector(e=>e.externalEditors.editorOrder??[]),Si=a.createSelector(e=>e.externalEditors.loading),bi=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),mi=a.createSelector((e,t)=>{if(!(t?Ee.select(e,t):Ce.select(e))||be())return[];const s=Zt.select(e);return Kt.select(e).filter(i=>i.installed&&!s.includes(i.id))}),Z={},Qt=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),vi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),_i=a.createSelector(e=>e.mcpSettings.loading),Ai=a.createSelector(e=>e.mcpSettings.error),ki=a.createSelector(e=>e.mcpSettings.mutationError??null),yi=a.createSelector(e=>e.mcpSettings.enabled),Jt=a.createSelector(e=>e.mcpSettings.disabledServers),Yt=a.createSelector(e=>e.mcpSettings.statusMap),Xt=a.createSelector(e=>e.mcpSettings.toolsMap),er=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),tr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),wi=a.createSelector((e,t)=>Object.keys(tr.select(e,t))),Ei=a.createSelector(e=>{const t=Qt.select(e),r=Yt.select(e),s=Xt.select(e),i=Jt.select(e),o=er.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Ci=a.createSelector(e=>e.mcpSettings.lastImportedCount),Pi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Ri=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(rr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ir(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&sr(t,i.idPattern));return s?{...s,id:t}:void 0}function Mi(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function ar(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const nr=new Set(T.flatMap(e=>e.route?[ar(e.route)]:[])),or=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Ti(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return nr.has(r)?s?!!ir(s):!0:or.some(i=>i.test(r))}const Ii=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],cr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Fi=Object.fromEntries(cr.map(e=>[e.path,e.defaultValue]));export{As as $,ni as A,Et as B,pt as C,Dr as D,vt as E,cr as F,Y as G,ds as H,cs as I,wt as J,ir as K,xs as L,ti as M,us as N,gt as O,ps as P,Or as Q,Nr as R,A as S,bs as T,re as U,q as V,Ss as W,se as X,te as Y,ks as Z,ys as _,$e as a,Ei as a$,ws as a0,Es as a1,vs as a2,_s as a3,ms as a4,Gr as a5,Hr as a6,Fs as a7,Ts as a8,Rs as a9,Ar as aA,yr as aB,Pr as aC,wr as aD,Cr as aE,kr as aF,Tr as aG,_r as aH,Fr as aI,Xr as aJ,Zt as aK,Kt as aL,mi as aM,Si as aN,Jr as aO,Yr as aP,bi as aQ,Ri as aR,Pi as aS,Jt as aT,yi as aU,Ai as aV,er as aW,Ci as aX,_i as aY,ki as aZ,Qt as a_,Ms as aa,Is as ab,Ps as ac,fi as ad,Qr as ae,rs as af,jr as ag,ei as ah,Kr as ai,Zr as aj,Wr as ak,Vr as al,H as am,Je as an,st as ao,it as ap,X as aq,rt as ar,Ye as as,Qe as at,et as au,tt as av,Er as aw,Rr as ax,Mr as ay,Ir as az,Fi as b,Yt as b0,Xt as b1,hi as b2,zr as b3,Cs as b4,gs as b5,lt as b6,is as b7,as as b8,ts as b9,ri as bA,ii as bB,gi as bC,Nt as bD,ui as bE,Os as bF,Ls as bG,Ws as bH,Ds as bI,$t as bJ,ns as bK,ss as ba,$r as bb,es as bc,v as bd,Ur as be,Br as bf,Ys as bg,Hs as bh,Qs as bi,Js as bj,zs as bk,Ks as bl,js as bm,qs as bn,Us as bo,Ns as bp,Xs as bq,Vs as br,$s as bs,Zs as bt,S as bu,ft as bv,fs as bw,hs as bx,wi as by,vi as bz,Ii as c,ls as d,pi as e,Ct as f,Tt as g,si as h,ai as i,qr as j,ct as k,ot as l,ci as m,Mi as n,Bs as o,Gs as p,Lr as q,xr as r,li as s,di as t,yt as u,ht as v,oi as w,os as x,K as y,Ti as z};
|
|
2
|
+
var ne=Object.defineProperty;var oe=(e,t,r)=>t in e?ne(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>oe(e,typeof t!="symbol"?t+"":t,r);import{JH as a,uC as ce,n_ as k,nZ as y,mq as le,c9 as de,c8 as ue,cn as pe,cm as ge,z6 as C,z7 as B,z4 as he,z3 as fe,z5 as Se,rV as be,o0 as w}from"./D0qhIm1r.js";import{cU as me,cJ as ve,bJ as _e,cS as Q,aJ as Ae,c3 as ke,c$ as ye,cl as we,cB as Ee,cn as Ce}from"./cD292w1o.js";import{a as Pe,i as Re}from"./CL3a4Hm1.js";import{c as N}from"./ChTqQfQN.js";import{x as Me,aO as Te,c as Ie,aD as Fe,B as De,y as Le,z as xe}from"./BuM8LV7z.js";import{a0 as Oe,K as J,a1 as We,az as U,Z as Be,a3 as Ge,L as Ve,$ as Ne,aB as Ue,x as He}from"./DejjV5ft.js";import{bm as n,_ as qe}from"./Fcr7AvC-.js";import{i as D}from"./BBWuirRW.js";import{n as ze}from"./CccfsETL.js";const $e=5,L=120,je=4e3,j=.2,Ke=.8;function Ze(e,t,r=$e){const s=e.length>0?t/(2*e.length):0,i=je/L;return Array.from({length:r},(o,l)=>{if(s<=0)return 0;const c=L*i**(l/r),g=L*i**((l+1)/r),f=Math.min(e.length-1,Math.floor(c/s)),b=Math.min(e.length,Math.max(f+1,Math.ceil(g/s)));let z=0;for(let F=f;F<b;F+=1)z+=e[F]??0;const $=(z/(b-f)/255-j)/(Ke-j);return Number.isFinite($)?Math.min(1,Math.max(0,$)):0})}const _r=a.createSelector(e=>me.select(e)?.capabilities.gitlabCheckout===!0),Ar=a.createSelector(e=>e.gitlabAuth.host),kr=a.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),yr=a.createSelector(e=>ce(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),wr=a.createSelector(e=>e.gitlabAuth.isCancelling),Er=a.createSelector(e=>e.gitlabAuth.cancelOutcome),Cr=a.createSelector(e=>e.gitlabAuth.isConfigured),Pr=a.createSelector(e=>e.gitlabAuth.isAuthenticating),Rr=a.createSelector(e=>e.gitlabAuth.deviceFlow),Mr=a.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Tr=a.createSelector(e=>e.gitlabAuth.user),Ir=a.createSelector(e=>e.gitlabAuth.error);a.createSelector(e=>e.gitlabAuth.method);const Fr=a.createSelector(e=>e.gitlabAuth.statusReady===!0),A=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return n.specialists_builtin_prReviewer_name()},get description(){return n.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return n.specialists_builtin_uiDesigner_name()},get description(){return n.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return n.specialists_builtin_vulnerabilityScanner_name()},get description(){return n.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return n.specialists_builtin_developer_name()},get description(){return n.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return n.specialists_builtin_productManager_name()},get description(){return n.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return n.specialists_builtin_maintenanceCoordinator_name()},get description(){return n.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return n.specialists_builtin_chiefOfStaff_name()},get description(){return n.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],Y=new Set(["pr-reviewer"]),Dr="developer";function Lr(e){return A.find(t=>t.id===e)}const Qe=a.createSelector(e=>e.githubAuth.mutationRequestId),Je=a.createSelector(e=>e.githubAuth.callbacksCancelled),Ye=a.createSelector(e=>e.githubAuth.isDisconnecting),X=a.createSelector(e=>e.githubAuth.isAuthenticated),Xe=a.createSelector(e=>e.githubAuth.statusSettled===!0),et=a.createSelector(e=>e.githubAuth.requiresDaemonAuth),tt=a.createSelector(e=>e.githubAuth.user),rt=a.createSelector(e=>e.githubAuth.isAuthenticating),st=a.createSelector(e=>e.githubAuth.deviceFlow),it=a.createSelector(e=>e.githubAuth.error),xr=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Je,selectGitHubAuthDeviceFlow:st,selectGitHubAuthError:it,selectGitHubAuthIsAuthenticated:X,selectGitHubAuthIsAuthenticating:rt,selectGitHubAuthIsDisconnecting:Ye,selectGitHubAuthMutationRequestId:Qe,selectGitHubAuthRequiresDaemonAuth:et,selectGitHubAuthStatusSettled:Xe,selectGitHubAuthUser:tt},Symbol.toStringTag,{value:"Module"}));function u(e){return e??""}function at(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>u(i.provider)===u(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&u(i.reasoningEffort)===u(s[o].reasoningEffort))}function K(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?u(e.name)===u(r.name)&&u(e.description)===u(r.description)&&u(e.behaviorPrompt)===u(r.behaviorPrompt)&&u(e.roleReminder)===u(r.roleReminder)&&u(e.reasoningEffort)===u(r.reasoningEffort)&&at(e.modelOptions,r.modelOptions):!1}const Or=a.createSelector(e=>e.specialists.bundledSpecialists),nt=a.createSelector(e=>e.specialists.fileSpecialists),Wr=a.createSelector(e=>k(nt.select(e))),Br=a.createSelector(e=>e.specialists.userOverrides);a.createSelector(e=>e.specialists.overridesLoaded);const Gr=a.createSelector(e=>e.specialists.customSpecialistsLoaded),Vr=a.createSelector(e=>e.specialists.fileSpecialistsLoaded),Nr=a.createSelector(e=>e.specialists.bundledSpecialistsLoaded),Ur=a.createSelector(e=>e.specialists.specialistsFolderPath),Hr=a.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:""});a.createSelector(e=>e.specialists.providerModelOverrides);const x=a.createSelector((e,t)=>!(Y.has(t)&&!X.select(e)));function ot(e,t){return t?e:e.filter(r=>!Y.has(r.id))}function ct(e,t){return ot(e,t).filter(r=>!r.hidden)}function qr(e,t){return ct(e,t).filter(r=>r.role!=="internal")}const v=a.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(c=>({...c,defaultModel:c.model,defaultBehaviorPrompt:c.behaviorPrompt??c.prompt??"",defaultAgentType:c.agentType}));const r=k(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const c of r)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push({id:c.id,name:c.name,description:c.description,codingAgent:c.codingAgent,defaultModel:c.model||void 0,defaultBehaviorPrompt:c.behaviorPrompt,roleReminder:c.roleReminder,source:c.source,importedFrom:c.importedFrom,unsupportedFields:c.unsupportedFields,requiredSkills:c.requiredSkills,missingSkills:c.missingSkills,hidden:c.hidden,resolvedModel:c.resolvedModel,resolvedProvider:c.resolvedProvider,modelOptions:c.modelOptions,reasoningEffort:c.reasoningEffort,role:c.role,teamAgents:c.teamAgents,icon:c.icon}));for(const c of s)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const c of A)!i.has(c.id)&&x.select(e,c.id)&&(i.add(c.id),o.push(c));const l=new Map;for(const c of A)l.has(c.id)||l.set(c.id,l.size);for(const c of s)l.has(c.id)||l.set(c.id,l.size);return o.sort((c,g)=>{const f=l.has(c.id),b=l.has(g.id);return f&&b?(l.get(c.id)??0)-(l.get(g.id)??0):f&&!b?-1:!f&&b?1:c.name.localeCompare(g.name)}),o}),zr=a.createSelector(e=>{const t=v.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...A.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),lt=a.createSelector((e,t)=>{const r=y(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(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&k(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=A.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),$r=a.createSelector((e,t)=>lt.select(e,t)?.name??null),jr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),Kr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),Zr=a.createSelector((e,t,r)=>v.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),Qr=a.createSelector((e,t,r)=>{const i=v.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function P(e,t){return t.some(r=>r.id===e)||A.some(r=>r.id===e)}const Jr=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&P(t,e.specialists.bundledSpecialists)}return P(t,e.specialists.bundledSpecialists)}),Yr=a.createSelector((e,t,r)=>r?!!H.select(e,t,r):!!y(e.specialists.fileSpecialists,t)),Xr=a.createSelector((e,t,r)=>{if(r){const o=H.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:P(t,e.specialists.bundledSpecialists)&&!K(o)}if(!P(t,e.specialists.bundledSpecialists))return!1;const i=y(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!K(i)}),H=a.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.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 y(e.specialists.fileSpecialists,t)}),es=a.createSelector((e,t,r)=>{const s=H.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),ts=a.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=y(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),rs=a.createSelector((e,t,r)=>{if(r){const i=v.select(e,r).find(c=>c.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return ve.select(e,o,r);const l=_e.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[l]?.available?l:""}const s=y(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:dt.select(e,t)}),dt=a.createSelector((e,t)=>{const s=v.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:Oe.select(e)?J.select(e):""}),ss=a.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?k(r):[]}),is=a.createSelector((e,t)=>e.specialists.creationByContext?.[t]??le),as=a.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),O=N("Clipboard");async function ns(e){let t;if(Pe())try{const r=await Re("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,O.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 O.error("Browser clipboard write failed",r,{electronError:t}),r}throw O.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}function os(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 ut=0;function pt(e,t){const r=++ut;return a.dispatch(ue(e,t,r)),r}function cs(e,t,r){a.dispatch(de(e,t,r))}async function ee(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await a.dispatch(pe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:Q.select(a.state)},{...s,intent:s?.intent??pt(e,t)}))).status==="success"}finally{a.dispatch(ge(i,o))}}async function ls(e,t,r,s,i){return ee(e,t,{kind:"effort",effort:r,previous:s},i)}async function ds(e,t,r,s,i){return ee(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const gt=a.createSelector((e,t)=>k(e.agentModel.mutations).filter(r=>r.consumerId===t)),us=a.createSelector((e,t)=>gt.select(e,t).some(r=>r.status==="pending")),ps=a.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=Ae.select(e,t),o=Me.select(e,t),l=e.daemonHealth.stats?.protocolVersion,c=Te(l),g=c?Ie(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:c,identity:JSON.stringify([g,i]),connection:Q.select(e),canWrite:!!s&&s.workspaceId===r&&!ke.select(e,r)}});function ht(e,t,r=!1){const s=t?.available===!0&&t.viaNpx!==!0;return e!=="auggie"||s||r}const gs=a.createSelector(e=>We.select(e)?null:U.select(e)),ft=a.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),S=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),hs=a.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),fs=a.createSelector((e,t)=>!!S.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===ft.select(e)),te=a.createSelector((e,t)=>t?S.select(e,t)?.catalog.providers??[]:ye.select(e)),re=a.createSelector((e,t)=>{if(!t)return J.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),q=a.createSelector((e,t)=>{if(!t)return Be.select(e);const r=S.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),se=a.createSelector((e,t)=>{if(!t)return Ge.select(e);const r=q.select(e,t),s=re.select(e,t),i=S.select(e,t)?.readiness??{};return te.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),Ss=a.createSelector((e,t)=>{const r=q.select(e,t),s=t?S.select(e,t)?.readiness??{}:U.select(e);return te.select(e,t).filter(i=>ht(i.id,s[i.id],r[i.id]===!0)).map(i=>i.id)}),bs=a.createSelector((e,t)=>t?se.select(e,t):Ve.select(e)),ms=a.createSelector((e,t)=>v.select(e,t)),vs=a.createSelector((e,t)=>t?!!S.select(e,t):Ne.select(e)),_s=a.createSelector((e,t)=>{if(!t)return Fe.select(e);const r=S.select(e,t)?.settings??[],s=re.select(e,t),i=r.find(c=>c.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const l=r.find(c=>c.path==="model.default")?.value;return typeof l=="string"?l:""}),As=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):De.select(e)),ks=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Le.select(e)),ys=a.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):xe.select(e)),ws=a.createSelector((e,t,r)=>{if(!r)return Ue.select(e,t);const s=q.select(e,r),i=S.select(e,r);return se.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(l=>l.id===o)?.canBeDisabled===!1)&&He(o,i?.readiness[o]?.authenticated))}),Es=a.createSelector((e,t)=>t?S.select(e,t)?.readiness??{}:U.select(e)),St={},Cs=a.createSelector(e=>e.providerSettings?.profiles?.status??St),Ps=a.createSelector(e=>e.directoryPicker.source??"daemon"),Rs=a.createSelector(e=>e.directoryPicker.listing),Ms=a.createSelector(e=>e.directoryPicker.loading),Ts=a.createSelector(e=>e.directoryPicker.error),Is=a.createSelector(e=>e.directoryPicker.pathError),Fs=a.createSelector(e=>e.directoryPicker.createError),bt=N("WorkspaceValidation");async function Ds(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_repoPathRequired_error(),suggestion:n.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return mt(s)?_t(s):At(s,t,r)}function mt(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 vt(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const l=o[2].replace(/\.git$/,"");return l?{owner:o[1],repo:l}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function _t(e){return vt(e)?{valid:!0,warning:n.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:n.workspace_validation_invalidGithubUrl_error(),suggestion:n.workspace_validation_invalidGithubUrl_suggestion()}}async function At(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:n.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:n.workspace_validation_pathNotAbsolute_error(),suggestion:n.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await D("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const l=s.data;return l.exists?l.isDirectory?l.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l}:l.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:l,warning:n.workspace_validation_insideParentRepo_warning({path:l.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:l}:t?l.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:n.workspace_repoSelector_notGitRepository_label(),directoryStatus:l}:{valid:!1,error:n.workspace_validation_notDirectory_error(),suggestion:n.workspace_validation_notDirectory_suggestion(),directoryStatus:l}:t?{valid:!0,isNewRepo:!0,directoryStatus:l,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExist_suggestion(),directoryStatus:l}}if(!(await D("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:n.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:n.workspace_validation_dirNotExist_error(),suggestion:n.workspace_validation_dirNotExistLegacy_suggestion()};const o=await D("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?n.workspace_repoSelector_notGitRepository_label():n.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:n.workspace_validation_nonGitInit_warning()}}catch(s){if(bt.warn("Could not validate path existence",s),!t)return{valid:!1,error:n.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Ls(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchPrefixInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:n.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:n.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:n.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function xs(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 Os(e){if(!e||e.trim().length===0)return{valid:!1,error:n.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:n.workspace_validation_branchNameInvalidChars_error(),suggestion:n.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:n.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:n.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:n.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:n.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ws(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:n.workspace_validation_promptTooLong_error(),suggestion:n.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function Bs(e){const t=e.toLowerCase();return t.includes("maxbuffer")?n.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?n.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?n.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?n.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?n.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?n.workspace_gitError_cloneAuth():n.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?n.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?n.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?n.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?n.workspace_gitError_readPermission():e:t.includes("permission denied")?n.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?n.workspace_gitError_notFound():t.includes("already exists")?n.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?n.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:n.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?n.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?n.workspace_gitError_diskSpace():e}const kt=["idle","exited"];function yt(e){return e===void 0||!kt.includes(e)}function Gs(e){return e.status==="restarting"?"restarting":yt(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 wt(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const Vs=a.createSelector(e=>e.voiceSettings.isLoading),Ns=a.createSelector(e=>e.voiceSettings.available),Us=a.createSelector(e=>e.voiceSettings.provider),Hs=a.createSelector(e=>e.voiceSettings.engine),qs=a.createSelector(e=>e.voiceSettings.osEngineAvailable),zs=a.createSelector(e=>e.voiceSettings.keyConfigured),$s=a.createSelector(e=>e.voiceSettings.vocabulary),js=a.createSelector(e=>e.voiceSettings.openaiModel),Ks=a.createSelector(e=>e.voiceSettings.language),Zs=a.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),Qs=a.createSelector(e=>e.voiceSettings.inputDeviceId),Js=a.createSelector(e=>e.voiceSettings.inputDevices),Ys=a.createSelector(e=>e.voiceSettings.busyProvider),Xs=a.createSelector(e=>e.voiceSettings.error),ei=a.createSelector(e=>we.select(e)?"unavailable":wt(e.voiceSettings)),G="intent.voice.inputDevice";let V;function Et(){if(V!==void 0)return V;try{const e=localStorage.getItem(G);return typeof e=="string"&&e!==""?e:null}catch{return null}}function ti(e){V=e;try{e===null?localStorage.removeItem(G):localStorage.setItem(G,e)}catch{}}let R=null;function ri(e){R=e}function si(){const e=R;return R=null,e}function Ct(){R=null}const Pt=300,Rt=300;class Mt{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??Pt,this.doublePressWindowMs=t.doublePressWindowMs??Rt,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 M=null;function ii(e){M=e}function ai(){const e=M;return M=null,e}function Tt(){M=null}const It=66;function Ft(e,t){const r=globalThis.AudioContext;if(typeof r!="function")return()=>{};let s,i,o;try{s=new r,i=s.createMediaStreamSource(e),o=s.createAnalyser(),o.fftSize=1024,o.smoothingTimeConstant=.5,o.minDecibels=-85,o.maxDecibels=-25,i.connect(o)}catch{return i?.disconnect(),s?.close().catch(()=>{}),()=>{}}if(!s||!i)return()=>{};const l=s,c=i,g=new Uint8Array(o.frequencyBinCount),f=setInterval(()=>{o.getByteFrequencyData(g),t(Ze(g,l.sampleRate))},It);let b=!1;return()=>{b||(b=!0,clearInterval(f),c.disconnect(),l.close().catch(()=>{}))}}const Dt=12e4,Lt=["audio/webm;codecs=opus","audio/webm"];function ni(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function xt(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function Ot(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lt.find(e=>MediaRecorder.isTypeSupported(e))}class Wt{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"onLevels");d(this,"stopMeter",null);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??Dt,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null,this.onLevels=t.onLevels}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(xt(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=Ot(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),this.onLevels&&(this.stopMeter=Ft(t,this.onLevels)),"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,i=this.cancelRequested;this.teardown(),!i&&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.stopMeter?.(),this.stopMeter=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 Bt=300;function Gt(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vt={stopReason:"manual",autoSend:!1};let p=null,m=null,_=0,E=null;const I=new Mt({onRecordStart:()=>{E&&Nt(E)},onRecordStop:e=>{ie(E,e)}});function oi(){return p!==null}function ci(){return p}function li(e){E=e,_+=1,_===1&&I.keyDown()}function di(e){E=e,_!==0&&(_-=1,_===0&&I.keyUp())}function Nt(e,t="key"){if(p!==null)return;Tt(),Ct();const r=new Wt({deviceId:Et(),onLevels:s=>{p===r&&e.dispatch(fe(s))},onFinished:s=>{p===r&&(p=null);const i=m??{stopReason:"auto-stop",autoSend:!1},o=m!==null;if(m=null,e.dispatch(C()),o||I.reset(),s.durationMs<Bt){i.autoSend&&e.dispatch(B());return}e.dispatch(he({...s,stopReason:i.stopReason,autoSend:i.autoSend}))},onError:s=>{p===r&&(p=null),m=null,e.dispatch(C()),e.showHint(Gt(s)?n.hardwareConsole_ptt_micDenied_message():n.hardwareConsole_ptt_recordingFailed_message())}});p=r,e.dispatch(Se({source:t,startedAt:Date.now()})),r.start().then(s=>{if(s!=="recording"&&(p===r&&(p=null),s==="discarded")){const i=m?.autoSend===!0;m=null,e.dispatch(C()),i&&e.dispatch(B())}})}function ie(e,t){const r=p;if(r===null){t.autoSend&&e?.dispatch(B());return}m=t,r.stop()}function ui(){ie(null,Vt)}function pi(e){I.reset(),_=0,m=null;const t=p;t!==null&&(p=null,t.cancel(),e.dispatch(C()))}const Ut=N("HardwareConsoleVoiceSetupToast"),Ht="hardware-console-voice-setup";let W=null;function qt(){return W||(W=qe(()=>import("./CCAtqaSn.js").then(e=>e.i),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url).then(e=>e.notify)),W}function zt(){ze("/settings?tab=connections#voice").catch(e=>{Ut.error("Failed to open voice settings from setup toast",e)})}function $t(){return{label:n.hardwareConsole_voice_openSettings_label(),onClick:()=>zt()}}function gi(){qt().then(e=>{e.error(n.hardwareConsole_voice_noKey_error(),{id:Ht,action:$t()})})}const hi=a.createSelector(e=>e.externalEditors.selectedAction),jt=a.createSelector(e=>e.externalEditors.editors),Kt=a.createSelector(e=>{const t=k(jt.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(l=>[l.id,l])),i=r.flatMap(l=>{const c=s.get(l);return c?[c]:[]}),o=new Set(r);return[...i,...t.filter(({id:l})=>!o.has(l))]}),fi=a.createSelector(e=>e.externalEditors.editorOrder??[]),Si=a.createSelector(e=>e.externalEditors.loading),bi=a.createSelector(e=>e.externalEditors.lastFetched),Zt=a.createSelector(e=>e.externalEditors.hiddenEditorIds),mi=a.createSelector((e,t)=>{if(!(t?Ee.select(e,t):Ce.select(e))||be())return[];const s=Zt.select(e);return Kt.select(e).filter(i=>i.installed&&!s.includes(i.id))}),Z={},Qt=a.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),vi=a.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),_i=a.createSelector(e=>e.mcpSettings.loading),Ai=a.createSelector(e=>e.mcpSettings.error),ki=a.createSelector(e=>e.mcpSettings.mutationError??null),yi=a.createSelector(e=>e.mcpSettings.enabled),Jt=a.createSelector(e=>e.mcpSettings.disabledServers),Yt=a.createSelector(e=>e.mcpSettings.statusMap),Xt=a.createSelector(e=>e.mcpSettings.toolsMap),er=a.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,w(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),tr=a.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??Z:Z),wi=a.createSelector((e,t)=>Object.keys(tr.select(e,t))),Ei=a.createSelector(e=>{const t=Qt.select(e),r=Yt.select(e),s=Xt.select(e),i=Jt.select(e),o=er.select(e);return t.map(l=>{const c=w(l)in i,g=s[w(l)]||[];let f=r[w(l)]||"disconnected";return c&&(f="disabled"),{...l,disabled:c,status:f,tools:g,toolCount:g.length,errorMessage:o[w(l)]}})});a.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const Ci=a.createSelector(e=>e.mcpSettings.lastImportedCount),Pi=a.createSelector(e=>e.mcpSettings.advancedSaveStatus),Ri=a.createSelector(e=>e.mcpSettings.advancedSaveError);function h(e){return{category:"settings",...e}}const T=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},h({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),h({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),h({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),h({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),h({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),h({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),h({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),h({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),h({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["autocomplete","Autocomplete","Suggest as you type: service, model and API keys.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","token-savings"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","token-savings"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","performance"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","input"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>h({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),h({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>h({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),h({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function ae(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function rr(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function sr(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(rr).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ir(e){const t=ae(e);if(!t)return;const r=T.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=T.find(i=>i.route&&i.dynamic&&i.idPattern&&sr(t,i.idPattern));return s?{...s,id:t}:void 0}function Mi(){return T.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function ar(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const nr=new Set(T.flatMap(e=>e.route?[ar(e.route)]:[])),or=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Ti(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=ae(i.hash)}catch{return!1}return nr.has(r)?s?!!ir(s):!0:or.some(i=>i.test(r))}const Ii=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.secretRequests","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],cr=[{path:"agentFeatures.backgroundHooks",label:()=>n.settings_agentFeatures_backgroundHooks_label(),description:()=>n.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>n.settings_agentFeatures_hostExec_label(),description:()=>n.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>n.settings_agentFeatures_secretRequests_label(),description:()=>n.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.scripts",label:()=>n.settings_agentFeatures_scripts_label(),description:()=>n.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>n.settings_agentFeatures_terminalAccess_label(),description:()=>n.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>n.settings_agentFeatures_browserAutomation_label(),description:()=>n.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>n.settings_agentFeatures_desktopControl_label(),description:()=>n.settings_agentFeatures_desktopControl_description(),info:()=>n.settings_agentFeatures_desktopControl_info(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>n.settings_agentFeatures_richChatBlocks_label(),description:()=>n.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>n.settings_agentFeatures_structuredQuestions_label(),description:()=>n.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.attentionRequests",label:()=>n.settings_agentFeatures_attentionRequests_label(),description:()=>n.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>n.settings_agentFeatures_stateSnapshot_label(),description:()=>n.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>n.settings_agentFeatures_prMonitor_label(),description:()=>n.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>n.settings_agentFeatures_taskGraph_label(),description:()=>n.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>n.settings_agentFeatures_peerAgents_label(),description:()=>n.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>n.settings_agentFeatures_mcpTools_label(),description:()=>n.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],Fi=Object.fromEntries(cr.map(e=>[e.path,e.defaultValue]));export{As as $,ni as A,Et as B,pt as C,Dr as D,vt as E,cr as F,Y as G,ds as H,cs as I,wt as J,ir as K,xs as L,ti as M,us as N,gt as O,ps as P,Or as Q,Nr as R,A as S,bs as T,re as U,q as V,Ss as W,se as X,te as Y,ks as Z,ys as _,$e as a,Ei as a$,ws as a0,Es as a1,vs as a2,_s as a3,ms as a4,Gr as a5,Hr as a6,Fs as a7,Ts as a8,Rs as a9,Ar as aA,yr as aB,Pr as aC,wr as aD,Cr as aE,kr as aF,Tr as aG,_r as aH,Fr as aI,Xr as aJ,Zt as aK,Kt as aL,mi as aM,Si as aN,Jr as aO,Yr as aP,bi as aQ,Ri as aR,Pi as aS,Jt as aT,yi as aU,Ai as aV,er as aW,Ci as aX,_i as aY,ki as aZ,Qt as a_,Ms as aa,Is as ab,Ps as ac,fi as ad,Qr as ae,rs as af,jr as ag,ei as ah,Kr as ai,Zr as aj,Wr as ak,Vr as al,H as am,Je as an,st as ao,it as ap,X as aq,rt as ar,Ye as as,Qe as at,et as au,tt as av,Er as aw,Rr as ax,Mr as ay,Ir as az,Fi as b,Yt as b0,Xt as b1,hi as b2,zr as b3,Cs as b4,gs as b5,lt as b6,is as b7,as as b8,ts as b9,ri as bA,ii as bB,gi as bC,Nt as bD,ui as bE,Os as bF,Ls as bG,Ws as bH,Ds as bI,$t as bJ,ns as bK,ss as ba,$r as bb,es as bc,v as bd,Ur as be,Br as bf,Ys as bg,Hs as bh,Qs as bi,Js as bj,zs as bk,Ks as bl,js as bm,qs as bn,Us as bo,Ns as bp,Xs as bq,Vs as br,$s as bs,Zs as bt,S as bu,ft as bv,fs as bw,hs as bx,wi as by,vi as bz,Ii as c,ls as d,pi as e,Ct as f,Tt as g,si as h,ai as i,qr as j,ct as k,ot as l,ci as m,Mi as n,Bs as o,Gs as p,Lr as q,xr as r,li as s,di as t,yt as u,ht as v,oi as w,os as x,K as y,Ti as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{_ as Z}from"./Fcr7AvC-.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./BZnji9hP.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./B8RXlIBH.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DTco_120.js","/app/immutable/chunks/DFNKkiho.js","/app/immutable/chunks/Fcr7AvC-.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/D-j7vD5Z.js","/app/immutable/chunks/cD292w1o.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/D0qhIm1r.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/BS1zON0P.js","/app/immutable/chunks/CWfjuhY2.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CZfU7DE3.js","/app/immutable/chunks/ChHRVjww.js","/app/immutable/chunks/2z64ELW5.js","/app/immutable/chunks/BhYXv0ZM.js","/app/immutable/chunks/BRCr02in.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/CA6H1-bp.js","/app/immutable/chunks/BAtAwQ72.js","/app/immutable/chunks/TdGvVwuC.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BwweojP5.js","/app/immutable/chunks/C7b3vXLD.js","/app/immutable/chunks/DlnCrS3y.js","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BuM8LV7z.js","/app/immutable/chunks/_IjN0Lbt.js","/app/immutable/chunks/CH7HNVC2.js","/app/immutable/chunks/DejjV5ft.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/CccfsETL.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/B0SSzYpD.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/Beq_QLuz.js","/app/immutable/chunks/Cc0763mU.js","/app/immutable/chunks/DbB491_u.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/D7KhILhs.js","/app/immutable/chunks/DfINI0LK.js","/app/immutable/chunks/C3KgmGxd.js","/app/immutable/chunks/CxR-pcVt.js","/app/immutable/chunks/x4bPxhVW.js","/app/immutable/chunks/CWtyXmQ4.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/Cz3WzTlQ.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/O5ZlQHf9.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/BzXQ5SMs.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/B8m3-qrW.js","/app/immutable/chunks/CpK0xLH4.js","/app/immutable/chunks/C2RnxEnO.js","/app/immutable/chunks/DRMe5Ypb.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/DkQdSPDN.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/assets/notify.DylRFR3N.css","/app/immutable/chunks/koUs6Gjt.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/CVx5OKWy.js","/app/immutable/chunks/DIME5LWK.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/iMqZaR5X.js","/app/immutable/chunks/DhXSKt_a.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Z}from"./Fcr7AvC-.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./DFNKkiho.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./DTco_120.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ao as s}from"./3SdAC2_C.js";import{c as r}from"./
|
|
1
|
+
import{ao as s}from"./3SdAC2_C.js";import{c as r}from"./DY9w61PC.js";const t=()=>{const e=r;return{page:{subscribe:e.page.subscribe},navigating:{subscribe:e.navigating.subscribe},updated:e.updated}},c={subscribe(e){return(s?o("page"):t().page).subscribe(e)}};function o(e){try{return t()[e]}catch{throw new Error(`Cannot subscribe to '${e}' store on the server outside of a Svelte component, as it is bound to the current request via component context. This prevents state from leaking between users.For more information, see https://svelte.dev/docs/kit/state-management#avoid-shared-state-on-the-server`)}}export{c as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{JH as s}from"./D0qhIm1r.js";import{c as t}from"./
|
|
1
|
+
import{i as r}from"./CL3a4Hm1.js";import{w as a,I as e}from"./Bqd7fdCF.js";import{JH as s}from"./D0qhIm1r.js";import{c as t}from"./r4dmBxo_.js";function C(o,i){return t(s,o,{navigate:i,...a("windowChrome")?{closeWindow:()=>r(e.WINDOW.CLOSE)}:{}})}export{C as closeActiveTab};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{c as t,s as r}from"./
|
|
1
|
+
import{c as t,s as r}from"./BJEFEyAm.js";import{b as a}from"./DFNKkiho.js";var s=a(e=>`${r(e)}
|
|
2
2
|
.swimlane.cluster:not([data-color-id]) rect {
|
|
3
3
|
stroke: ${e.clusterBorder} !important;
|
|
4
4
|
}
|