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]="a498ad87-d5f9-48f4-9902-e693563df5cf",e._sentryDebugIdIdentifier="sentry-dbid-a498ad87-d5f9-48f4-9902-e693563df5cf")}()}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.09-0afadcc"}}catch(e){}}(),exports.id=136,exports.ids=[136],exports.modules={"./src/commands/search.ts":(e,n,t)=>{t.a(e,(async(e,o)=>{try{t.r(n),t.d(n,{handleSearch:()=>g});var s=t("../context/dist/index.js"),r=t("../indexing-client/dist/index.js"),i=t("../proto/dist/generated/aiserver/v1/repository_connect.js"),c=t("../proto/dist/generated/aiserver/v1/repository_pb.js"),d=t("../../node_modules/.pnpm/@connectrpc+connect@1.6.1_patch_hash=a4b9a5e69295313832387f25b708426bcf53041a2f50bc7b95_a276813e7efa8e1efb8a7b0efc1d56a0/node_modules/@connectrpc/connect/dist/esm/promise-client.js"),a=t("../../node_modules/.pnpm/@connectrpc+connect-node@1.6.1_@bufbuild+protobuf@1.10.0_@connectrpc+connect@1.6.1_patc_5282c1319f527254b0f6f6e22c5be0c8/node_modules/@connectrpc/connect-node/dist/esm/index.js"),l=t("../../node_modules/.pnpm/chalk@5.4.1/node_modules/chalk/source/index.js"),p=t("./src/components/path-display.tsx"),u=t("./src/console-io.ts"),f=e([p]);p=(f.then?(await f)():f)[0];var h=function(e,n,t,o){return new(t||(t=Promise))((function(s,r){function i(e){try{d(o.next(e))}catch(e){r(e)}}function c(e){try{d(o.throw(e))}catch(e){r(e)}}function d(e){var n;e.done?s(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(i,c)}d((o=o.apply(e,n||[])).next())}))};function y(e){return n=>t=>h(this,void 0,void 0,(function*(){const o=yield e.getAccessToken();if(!o)throw new Error("No access token found");t.header.set("authorization",`Bearer ${o}`);const s=null!=="2026.05.09-0afadcc"?"2026.05.09-0afadcc":"unknown";return t.header.set("x-cursor-client-version",`cli-${s}`),yield n(t)}))}class m{constructor(e,n,t){this.repoName=e,this.repoOwner=n,this.pathEncryptionKey=t}loadRepositoryIdentity(){const e=new r.Gv(this.pathEncryptionKey);return Promise.resolve({repoName:this.repoName,repoOwner:this.repoOwner,encryptionScheme:e})}}function g(e,n,t,o){return h(this,void 0,void 0,(function*(){(0,u.OT)(`🔍 Searching for "${e}"...`);try{const f=(0,s.q6)(),h=yield n.getRepositoryInfo();h.repoName&&h.repoOwner||((0,u.p2)(l.Ay.red("❌ Repository not properly initialized")),process.exit(1));const g=(0,a.wQ)({baseUrl:o.repoEndpoint,httpVersion:o.repoHttpVersion,interceptors:[y(t)],nodeOptions:{rejectUnauthorized:!o.repoInsecure}}),b=(0,d.UU)(i.B,g),v=new c.Ym({}),w=new m(h.repoName,h.repoOwner,h.pathEncryptionKey||""),_=new r.q$(b,v,w,process.cwd()),x=yield _.search(f,e);(0,u.OT)("✅ Search completed"),(0,u.OT)(function(e,n){var t,o,s,r,i;if(0===n.length)return l.Ay.yellow(`No results found for "${e}"`);const c=[];c.push(l.Ay.green.bold(`Found ${n.length} result${1!==n.length?"s":""} for "${e}"`));for(let e=0;e<n.length;e+=1){const d=n[e].codeBlock;if(!d)continue;const a=null!==(t=d.relativeWorkspacePath)&&void 0!==t?t:"",u=l.Ay.cyan.bold(`${(e+1).toString().padStart(3," ")}.`),f=(0,p.j)(a),h=l.Ay.dim(`(L${null===(s=null===(o=d.range)||void 0===o?void 0:o.startPosition)||void 0===s?void 0:s.line} - L${null===(i=null===(r=d.range)||void 0===r?void 0:r.endPosition)||void 0===i?void 0:i.line})`);c.push(`${u} ${f} ${h}`)}return c.join("\n")}(e,null!=x?x:[])),process.exit(0)}catch(e){(0,u.p2)(e instanceof Error?e.message:String(e)),process.exit(1)}}))}o()}catch(b){o(b)}}))},"./src/components/path-display.tsx":(e,n,t)=>{t.a(e,(async(e,o)=>{try{t.d(n,{j:()=>i}),t("../../node_modules/.pnpm/react@19.2.3/node_modules/react/jsx-runtime.js");var s=t("../ink/build/index.js"),r=(t("../../node_modules/.pnpm/react@19.2.3/node_modules/react/index.js"),t("./src/constants.ts"),e([s]));s=(r.then?(await r)():r)[0];const i=(e,n=50)=>{const{segments:t,separator:o}=function(e,n){const t=e.includes("\\")?"\\":"/";if(e.length<=n)return{segments:e.split(t),separator:t};const o=e.split(t),s=o[o.length-1];if(s.length+3>n)return{segments:["...",s.substring(0,n-3)],ellipsisIndex:0,separator:t};const r=t.length,i=n-s.length-3;let c=0;const d=[];let a=-1;for(let e=0;e<o.length-1;e++){const n=o[e].length+(e>0?r:0);if(!(c+n<=i)){a=d.length;break}d.push(o[e]),c+=n}return-1!==a?(d.splice(a,0,"..."),d.push(s),{segments:d,ellipsisIndex:a,separator:t}):{segments:o,separator:t}}(e,n);let s="";return t.forEach(((e,n)=>{n>0&&"..."!==e&&(s+=o),s+=e})),s};o()}catch(e){o(e)}}))}};