"use strict";exports.id=9073,exports.ids=[9073],exports.modules={"./src/commands/search.ts"(e,n,t){t.a(e,(async(e,r)=>{try{t.r(n),t.d(n,{handleSearch:()=>x});var o=t("../context/dist/index.js"),c=t("../indexing-client/dist/index.js"),s=t("../proto/dist/generated/aiserver/v1/repository_connect.js"),i=t("../proto/dist/generated/aiserver/v1/repository_pb.js"),a=t("../../../../var/folders/gy/wcfhjzc55d96bnvx1zv223lc0000gn/T/agent-cli-mac-macos-arm64-019f4933-2c84-47c5-80c6-8513f384d287.ekQPhryL/pnpm-virtual-store/@connectrpc+connect@1.6.1_patch_hash=a4b9a5e69295313832387f25b708426bcf53041a2f50bc7b95_d0a2f6c9e28298af3d10922a7e4db69f/node_modules/@connectrpc/connect/dist/esm/promise-client.js"),l=t("../../../../var/folders/gy/wcfhjzc55d96bnvx1zv223lc0000gn/T/agent-cli-mac-macos-arm64-019f4933-2c84-47c5-80c6-8513f384d287.ekQPhryL/pnpm-virtual-store/@connectrpc+connect-node@1.6.1_@bufbuild+protobuf@1.10.1_@connectrpc+connect@1.6.1_patc_9bab583985fee5f125b6d3e9531066e1/node_modules/@connectrpc/connect-node/dist/esm/index.js"),d=t("../../../../var/folders/gy/wcfhjzc55d96bnvx1zv223lc0000gn/T/agent-cli-mac-macos-arm64-019f4933-2c84-47c5-80c6-8513f384d287.ekQPhryL/pnpm-virtual-store/chalk@5.6.2/node_modules/chalk/source/index.js"),p=t("./src/components/path-display.tsx"),h=t("./src/console-io.ts"),u=e([p]),f=u.then?(await u)():u;p=f[0];var m=function(e,n,t,r){return new(t||(t=Promise))((function(o,c){function s(e){try{a(r.next(e))}catch(e){c(e)}}function i(e){try{a(r.throw(e))}catch(e){c(e)}}function a(e){var n;e.done?o(e.value):(n=e.value,n instanceof t?n:new t((function(e){e(n)}))).then(s,i)}a((r=r.apply(e,n||[])).next())}))};function v(e){return n=>t=>m(this,void 0,void 0,(function*(){const r=yield e.getAccessToken();if(!r)throw new Error("No access token found");t.header.set("authorization",`Bearer ${r}`);const o=null!=="2026.07.09-a3815c0"?"2026.07.09-a3815c0":"unknown";return t.header.set("x-cursor-client-version",`cli-${o}`),yield n(t)}))}class g{constructor(e,n,t){this.repoName=e,this.repoOwner=n,this.pathEncryptionKey=t}loadRepositoryIdentity(){const e=new c.Gv(this.pathEncryptionKey);return Promise.resolve({repoName:this.repoName,repoOwner:this.repoOwner,encryptionScheme:e})}}function y(e,n){var t,r,o,c,s;if(0===n.length)return d.Ay.yellow(`No results found for "${e}"`);const i=[];i.push(d.Ay.green.bold(`Found ${n.length} result${1!==n.length?"s":""} for "${e}"`));for(let e=0;e<n.length;e+=1){const a=n[e].codeBlock;if(!a)continue;const l=null!==(t=a.relativeWorkspacePath)&&void 0!==t?t:"",h=d.Ay.cyan.bold(`${(e+1).toString().padStart(3," ")}.`),u=(0,p.j)(l),f=d.Ay.dim(`(L${null===(o=null===(r=a.range)||void 0===r?void 0:r.startPosition)||void 0===o?void 0:o.line} - L${null===(s=null===(c=a.range)||void 0===c?void 0:c.endPosition)||void 0===s?void 0:s.line})`);i.push(`${h} ${u} ${f}`)}return i.join("\n")}function x(e,n,t,r){return m(this,void 0,void 0,(function*(){(0,h.OT)(`🔍 Searching for "${e}"...`);try{const p=(0,o.q6)(),u=yield n.getRepositoryInfo();u.repoName&&u.repoOwner||((0,h.p2)(d.Ay.red("❌ Repository not properly initialized")),process.exit(1));const f=(0,l.wQ)({baseUrl:r.repoEndpoint,httpVersion:r.repoHttpVersion,interceptors:[v(t)],nodeOptions:{rejectUnauthorized:!r.repoInsecure}}),m=(0,a.UU)(s.B,f),x=new i.Ym({}),w=new g(u.repoName,u.repoOwner,u.pathEncryptionKey||""),b=new c.q$(m,x,w,process.cwd()),j=yield b.search(p,e);(0,h.OT)("✅ Search completed"),(0,h.OT)(y(e,null!=j?j:[])),process.exit(0)}catch(e){(0,h.p2)(e instanceof Error?e.message:String(e)),process.exit(1)}}))}r()}catch(w){r(w)}}))},"./src/components/path-display.tsx"(e,n,t){t.a(e,(async(e,r)=>{try{t.d(n,{j:()=>i}),t("../../../../var/folders/gy/wcfhjzc55d96bnvx1zv223lc0000gn/T/agent-cli-mac-macos-arm64-019f4933-2c84-47c5-80c6-8513f384d287.ekQPhryL/pnpm-virtual-store/react@19.2.4/node_modules/react/jsx-runtime.js");var o=t("../ink/build/index.js"),c=(t("../../../../var/folders/gy/wcfhjzc55d96bnvx1zv223lc0000gn/T/agent-cli-mac-macos-arm64-019f4933-2c84-47c5-80c6-8513f384d287.ekQPhryL/pnpm-virtual-store/react@19.2.4/node_modules/react/index.js"),t("./src/constants.ts"),e([o]));function s(e,n){const t=e.includes("\\")?"\\":"/";if(e.length<=n)return{segments:e.split(t),separator:t};const r=e.split(t),o=r[r.length-1];if(o.length+3>n)return{segments:["...",o.substring(0,n-3)],ellipsisIndex:0,separator:t};const c=t.length,s=n-o.length-3;let i=0;const a=[];let l=-1;for(let e=0;e<r.length-1;e++){const n=r[e].length+(e>0?c:0);if(!(i+n<=s)){l=a.length;break}a.push(r[e]),i+=n}return-1!==l?(a.splice(l,0,"..."),a.push(o),{segments:a,ellipsisIndex:l,separator:t}):{segments:r,separator:t}}o=(c.then?(await c)():c)[0];const i=(e,n=50)=>{const{segments:t,separator:r}=s(e,n);let o="";return t.forEach(((e,n)=>{n>0&&"..."!==e&&(o+=r),o+=e})),o};r()}catch(a){r(a)}}))}};