try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},s=(new e.Error).stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="358ef713-1a07-477b-8e5d-7e57e1ab3a46",e._sentryDebugIdIdentifier="sentry-dbid-358ef713-1a07-477b-8e5d-7e57e1ab3a46")}()}catch(e){}!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"agent-cli@2026.06.02-8c11d9f"}}catch(e){}}(),exports.id=9897,exports.ids=[9897],exports.modules={"./src/commands/auth-status-format.ts":(e,s,n)=>{n.d(s,{$7:()=>i,Fg:()=>o,cq:()=>r});var t=n("../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js");function o(e){const{status:s,message:n,userInfo:o,loginUrl:r}=e;switch(s){case"starting":return"Starting login process...";case"in-progress":{const e=["Authenticating with Cursor..."];return n&&e.push(n),r&&e.push(t.Ay.dim(r)),e.join("\n")}case"success":{const e=(null==o?void 0:o.email)?`Logged in as ${o.email}`:(null==o?void 0:o.userId)?`Logged in as user id ${o.userId}`:"Login successful!",s=[`${t.Ay.green("✓")} ${e}`];return n&&s.push(n),s.join("\n")}case"error":return n?t.Ay.red(n):""}}function r(e){const{status:s,message:n}=e;switch(s){case"starting":return"Preparing to log out...";case"in-progress":return"Logging out...";case"success":{const e=[t.Ay.green("✓ Logout successful")];return n&&e.push(n),e.join("\n")}case"error":{const e=[t.Ay.red("✗ Logout failed")];return n&&e.push(t.Ay.red(n)),e.join("\n")}}}function i(e){const{status:s,message:n}=e;switch(s){case"starting":{const e=["MCP Login","Preparing login..."];return n&&e.push(n),e.join("\n")}case"in-progress":{const e=["Checking status..."];return n&&e.push(n),e.join("\n")}case"success":{const e=[t.Ay.green("✓ MCP login successful")];return n&&e.push(n),e.join("\n")}case"error":{const e=[t.Ay.red("✗ MCP login failed")];return n&&e.push(t.Ay.red(n)),e.join("\n")}}}},"./src/commands/dev-login.ts":(e,s,n)=>{n.r(s),n.d(s,{handleDevLogin:()=>i});var t=n("./src/console-io.ts"),o=n("./src/commands/auth-status-format.ts"),r=function(e,s,n,t){return new(n||(n=Promise))((function(o,r){function i(e){try{a(t.next(e))}catch(e){r(e)}}function c(e){try{a(t.throw(e))}catch(e){r(e)}}function a(e){var s;e.done?o(e.value):(s=e.value,s instanceof n?s:new n((function(e){e(s)}))).then(i,c)}a((t=t.apply(e,s||[])).next())}))};function i(e){return r(this,arguments,void 0,(function*(e,s={}){(0,t.OT)((0,o.Fg)({status:"starting"}));const n=process.env.NODE_TLS_REJECT_UNAUTHORIZED;try{const n=s.endpoint||"https://localhost:8000",r=s.email,i=new URLSearchParams;r&&i.set("email",r),s.trial&&i.set("trial","true");const c=`${n}/auth/cursor_dev_session_token?${i.toString()}`;(0,t.OT)((0,o.Fg)({status:"in-progress",message:`Authenticating with dev backend at ${n}...`})),s.insecure&&n.startsWith("https:")&&(process.env.NODE_TLS_REJECT_UNAUTHORIZED="0");const a=yield fetch(c);if(!a.ok){const e=yield a.text();throw new Error(`Dev authentication failed (${a.status}): ${e}`)}const u=yield a.json();if(null==u?void 0:u.accessToken)try{yield e.setAuthentication(u.accessToken,u.refreshToken);const n=s.trial?"free trial":"pro",r=s.insecure?" (insecure SSL)":"";(0,t.OT)((0,o.Fg)({status:"success",message:`Dev authentication successful!${r} Logged in with ${n} account.\nAuth ID: ${u.authId}`}))}catch(e){const s=`Failed to store dev authentication tokens.\nAccess token: ${u.accessToken}`;(0,t.p2)((0,o.Fg)({status:"error",message:s}))}else(0,t.p2)((0,o.Fg)({status:"error",message:"Dev login failed - invalid response from server."})),process.exit(1)}catch(e){const n=e instanceof TypeError&&e.message.includes("fetch");let r;r=e instanceof Error&&(e.message.includes("certificate")||e.message.includes("self signed")||e.message.includes("unable to verify"))&&!s.insecure?`SSL certificate error. Try using the -k flag to ignore certificate validation: ${e}`:n?`Failed to connect to dev backend. Make sure the development server is running at ${s.endpoint||"https://localhost:8000"}.`:`Dev login error: ${e}`,(0,t.p2)((0,o.Fg)({status:"error",message:r})),process.exit(1)}finally{void 0!==n?process.env.NODE_TLS_REJECT_UNAUTHORIZED=n:delete process.env.NODE_TLS_REJECT_UNAUTHORIZED}process.exit(0)}))}}};