try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="0215292b-cfd8-4ef9-81e6-cfa802f88c35",e._sentryDebugIdIdentifier="sentry-dbid-0215292b-cfd8-4ef9-81e6-cfa802f88c35")}()}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=2591,exports.ids=[2591],exports.modules={"./src/commands/enable.ts":(e,n,r)=>{r.r(n),r.d(n,{handleMcpEnable:()=>u});var o=r("node:os"),s=r("node:path"),i=r.n(s),t=r("../mcp-agent-exec/dist/index.js"),d=r("../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"),c=r("./src/console-io.ts"),a=r("./src/mcp/disabled-store.ts"),l=r("./src/mcp/project-paths.ts"),f=function(e,n,r,o){return new(r||(r=Promise))((function(s,i){function t(e){try{c(o.next(e))}catch(e){i(e)}}function d(e){try{c(o.throw(e))}catch(e){i(e)}}function c(e){var n;e.done?s(e.value):(n=e.value,n instanceof r?n:new r((function(e){e(n)}))).then(t,d)}c((o=o.apply(e,n||[])).next())}))};function p(e){const{text:n,isError:r}=function({identifier:e,wasEnabled:n,isNowEnabled:r,error:o}){return o?{text:d.Ay.red(`Failed to enable MCP server: ${o}`),isError:!0}:n?{text:d.Ay.yellow(`MCP server '${e}' is already enabled and approved`),isError:!1}:r?{text:d.Ay.green(`✓ Enabled and approved MCP server: ${e}`),isError:!1}:{text:d.Ay.red(`MCP server '${e}' not found in configuration`)+"\n"+d.Ay.dim("Check .cursor/mcp.json or ~/.cursor/mcp.json"),isError:!0}}(e);r?(0,c.p2)(n):(0,c.OT)(n)}function u(e,n){return f(this,void 0,void 0,(function*(){var e;try{const e=process.cwd(),{projectRoot:r,approvalPath:s,disabledPath:d}=(0,l.C)(e),c=new t.mF(s,r),f=new a.P(d),u=i().join((0,o.homedir)(),".cursor","mcp.json"),b=i().join(r,".cursor","mcp.json"),[y,v]=yield Promise.all([(0,t.h1)(u).catch((()=>({mcpServers:{}}))),(0,t.h1)(b).catch((()=>({mcpServers:{}})))]),h=Object.assign(Object.assign({},y.mcpServers),v.mcpServers)[n];h||(p({identifier:n,wasEnabled:!1,isNowEnabled:!1}),process.exit(1));const m=n in v.mcpServers,w=yield f.isServerDisabled(n);let g;if(m){const e=(0,t.Ko)(n,h,r),o=(yield c.getApprovals()).includes(e);g=!w&&o,o||(yield c.addApproval(e))}else g=!w;w&&(yield f.removeDisabledServer(n)),p({identifier:n,wasEnabled:g,isNowEnabled:!0}),process.exit(0)}catch(r){const o=null!==(e=null==r?void 0:r.message)&&void 0!==e?e:String(r);p({identifier:n,wasEnabled:!1,isNowEnabled:!1,error:o}),process.exit(1)}}))}}};