try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="fb57d500-e4a4-4a71-9a50-460f56d0bd44",e._sentryDebugIdIdentifier="sentry-dbid-fb57d500-e4a4-4a71-9a50-460f56d0bd44")}()}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.05.20-2b5dd59"}}catch(e){}}(),exports.id=5765,exports.ids=[5765],exports.modules={"./src/cc-marketplace-import.ts":(e,t,r)=>{r.r(t),r.d(t,{importCcMarketplaces:()=>u});var n=r("../cursor-plugins/dist/index.js"),i=r("../proto/dist/generated/aiserver/v1/dashboard_pb.js"),s=r("../utils/dist/index.js"),a=r("../../node_modules/.pnpm/@bufbuild+protobuf@1.10.0/node_modules/@bufbuild/protobuf/dist/esm/google/protobuf/struct_pb.js"),o=r("./src/debug.ts"),l=function(e,t,r,n){return new(r||(r=Promise))((function(i,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function o(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,o)}l((n=n.apply(e,t||[])).next())}))};const d=4,c={log:(e,t)=>{(0,o.debugLog)(e,null!=t?t:{})}};function u(e){return l(this,arguments,void 0,(function*(e,t={}){const r=yield function(e){return l(this,void 0,void 0,(function*(){try{const t=yield e.listMarketplaces(new i.ListMarketplacesRequest({}));return new Set(t.marketplaces.filter((e=>void 0!==e.userId)).map((e=>e.name)))}catch(e){return(0,o.debugLog)("cc-marketplace-import.listMarketplacesError",{error:e instanceof Error?e.message:String(e)}),new Set}}))}(e),{payloads:u}=yield(0,n.kx)({marketplacesDir:t.marketplacesDir,existingUserMarketplaceNames:r,logger:c});if(0===u.length)return void(0,o.debugLog)("cc-marketplace-import.noNewMarketplaces");(0,o.debugLog)("cc-marketplace-import.parsedMarketplaces",{count:u.length});const p=yield(0,s.asyncMapSettledValues)(u,(t=>l(this,void 0,void 0,(function*(){return function(e,t){return l(this,void 0,void 0,(function*(){yield e.registerMarketplaceAndPlugins(function(e){return new i.RegisterMarketplaceAndPluginsRequest({gitUrl:e.gitUrl,gitRef:e.gitRef,marketplaceName:e.marketplaceName,commitSha:e.commitSha,plugins:e.plugins.map((e=>new i.RegisterPluginEntry({name:e.name,displayName:e.displayName,description:e.description,gitPath:e.gitPath,skills:e.skills,subagents:e.subagents,hooks:e.hooks,rules:e.rules,mcpServers:e.mcpServers,commands:e.commands,logoUrl:e.logoUrl,variables:e.variables?a._k.fromJson(e.variables):void 0})))})}(t)),(0,o.debugLog)("cc-marketplace-import.registered",{marketplaceName:t.marketplaceName,gitUrl:t.gitUrl,pluginCount:t.plugins.length})}))}(e,t)}))),{max:d}),g=p.filter((e=>"fulfilled"===e.status)).length,f=p.filter((e=>"rejected"===e.status)).length;(0,o.debugLog)("cc-marketplace-import.complete",{total:u.length,success:g,failures:f})}))}}};