scip-query 0.6.2 → 0.6.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (93) hide show
  1. package/dist/{chunk-6CTMG3IF.js → chunk-2OXZVIED.js} +2 -2
  2. package/dist/{chunk-F6F2QUIH.js → chunk-56LPZC3S.js} +2 -2
  3. package/dist/{chunk-AEMTUHQ7.js → chunk-5KWWENJZ.js} +2 -2
  4. package/dist/chunk-5OV6CUTY.js +2 -0
  5. package/dist/{chunk-PU7P5NPE.js → chunk-6QXYWGE5.js} +2 -2
  6. package/dist/{chunk-3QJ2NOYG.js → chunk-6TRXTRCW.js} +2 -2
  7. package/dist/{chunk-5NRGSXZQ.js → chunk-C6PQLWHR.js} +2 -2
  8. package/dist/{chunk-AZTWY4OT.js → chunk-CH47OLNL.js} +2 -2
  9. package/dist/{chunk-NLWXQMKR.js → chunk-DM56ECPZ.js} +2 -2
  10. package/dist/{chunk-NFOSOUH6.js → chunk-DX5YEUX4.js} +2 -2
  11. package/dist/{chunk-FPDWFGBQ.js → chunk-DXXROCSQ.js} +2 -2
  12. package/dist/{chunk-CW5K3KIF.js → chunk-EARGTC7U.js} +2 -2
  13. package/dist/{chunk-HS65NNKP.js → chunk-EJXPKSWV.js} +2 -2
  14. package/dist/{chunk-CHW7433E.js → chunk-EUHHVFTI.js} +2 -2
  15. package/dist/{chunk-QSTMORTI.js → chunk-F2TGKDMW.js} +2 -2
  16. package/dist/{chunk-MQ5FKM2F.js → chunk-GSVIC6KN.js} +2 -2
  17. package/dist/{chunk-7NEBSLI3.js → chunk-H4IWC7KJ.js} +2 -2
  18. package/dist/{chunk-HS5LX75F.js → chunk-H7BWAMFI.js} +2 -2
  19. package/dist/{chunk-GK6VXKLY.js → chunk-HLILTI7S.js} +2 -2
  20. package/dist/{chunk-5V76WMMZ.js → chunk-HUEIPY4M.js} +2 -2
  21. package/dist/{chunk-3FG3VLK3.js → chunk-ID7TO4P6.js} +2 -2
  22. package/dist/{chunk-67UXTIFZ.js → chunk-IUNRL2AQ.js} +2 -2
  23. package/dist/{chunk-4LBOHXT7.js → chunk-J22I2FWD.js} +2 -2
  24. package/dist/{chunk-7DKDFRXQ.js → chunk-KOGVTPGE.js} +2 -2
  25. package/dist/{chunk-ZJM2HD2Z.js → chunk-LUYN4IWJ.js} +2 -2
  26. package/dist/{chunk-3J463LOK.js → chunk-MDUIJELV.js} +2 -2
  27. package/dist/{chunk-T26XHATT.js → chunk-MMKNCPHB.js} +2 -2
  28. package/dist/{chunk-AZQ3ENHU.js → chunk-MSNW2AR2.js} +2 -2
  29. package/dist/{chunk-YRUHPGC3.js → chunk-NB3GIT4Z.js} +2 -2
  30. package/dist/{chunk-26LSAIEP.js → chunk-OBPP5RRE.js} +2 -2
  31. package/dist/{chunk-TWYHFB5K.js → chunk-ORBQ3HJD.js} +2 -2
  32. package/dist/{chunk-S65VVU3R.js → chunk-Q2MCCKWZ.js} +2 -2
  33. package/dist/{chunk-SPMLGXCE.js → chunk-QRULHDMO.js} +3 -3
  34. package/dist/{chunk-ORD3HEWI.js → chunk-RAJHIEBM.js} +2 -2
  35. package/dist/{chunk-TXADWK4I.js → chunk-RKZBRDFK.js} +2 -2
  36. package/dist/{chunk-3T53QAUS.js → chunk-RPRIZ43D.js} +2 -2
  37. package/dist/{chunk-FJV7QT4G.js → chunk-RXGCTLHY.js} +2 -2
  38. package/dist/{chunk-5VU2RVKI.js → chunk-S6IGA6KK.js} +2 -2
  39. package/dist/{chunk-LKCPNPHH.js → chunk-TPOYTT6O.js} +2 -2
  40. package/dist/{chunk-2HEJQBMS.js → chunk-TRBNQ273.js} +2 -2
  41. package/dist/{chunk-G2SX5EHW.js → chunk-TVJMEDHH.js} +2 -2
  42. package/dist/{chunk-OU2D2T4A.js → chunk-UDKLKBPQ.js} +2 -2
  43. package/dist/{chunk-6ALIV5SZ.js → chunk-UGUBEKK5.js} +2 -2
  44. package/dist/{chunk-AVLUWGXG.js → chunk-VKYLXCV6.js} +2 -2
  45. package/dist/{chunk-6XP3KWHC.js → chunk-VQXXSUQF.js} +2 -2
  46. package/dist/{chunk-5W22HCSF.js → chunk-VZE4SOJG.js} +2 -2
  47. package/dist/{chunk-RC2PKZSS.js → chunk-VZHI3TUX.js} +2 -2
  48. package/dist/{chunk-435YC4OF.js → chunk-YSEQFGGH.js} +2 -2
  49. package/dist/cli.js +2 -2
  50. package/dist/index.js +1 -1
  51. package/dist/queries/affected.js +1 -1
  52. package/dist/queries/bottlenecks.js +1 -1
  53. package/dist/queries/by-kind.js +1 -1
  54. package/dist/queries/call-graph.js +1 -1
  55. package/dist/queries/change-surface.js +1 -1
  56. package/dist/queries/code.js +1 -1
  57. package/dist/queries/complexity-hotspots.js +1 -1
  58. package/dist/queries/complexity.js +1 -1
  59. package/dist/queries/convergence.js +1 -1
  60. package/dist/queries/coupling.js +1 -1
  61. package/dist/queries/cycles.js +1 -1
  62. package/dist/queries/dataflow.js +1 -1
  63. package/dist/queries/dead.js +1 -1
  64. package/dist/queries/deep-chains.js +1 -1
  65. package/dist/queries/deps.js +1 -1
  66. package/dist/queries/drift.js +1 -1
  67. package/dist/queries/extract-candidates.js +1 -1
  68. package/dist/queries/fan.js +1 -1
  69. package/dist/queries/health.js +1 -1
  70. package/dist/queries/hierarchy.js +1 -1
  71. package/dist/queries/hotspots.js +1 -1
  72. package/dist/queries/imports.js +1 -1
  73. package/dist/queries/index.js +1 -1
  74. package/dist/queries/isolated.js +1 -1
  75. package/dist/queries/members.js +1 -1
  76. package/dist/queries/methods.js +1 -1
  77. package/dist/queries/outline.js +1 -1
  78. package/dist/queries/passthrough-candidates.js +1 -1
  79. package/dist/queries/redundant-reexports.js +1 -1
  80. package/dist/queries/refs.js +1 -1
  81. package/dist/queries/similar-chains.js +1 -1
  82. package/dist/queries/similar-files.js +1 -1
  83. package/dist/queries/similar-signatures.js +1 -1
  84. package/dist/queries/similar.js +1 -1
  85. package/dist/queries/slice.js +1 -1
  86. package/dist/queries/stale-abstractions.js +1 -1
  87. package/dist/queries/surface.js +1 -1
  88. package/dist/queries/symbols.js +1 -1
  89. package/dist/queries/system.js +1 -1
  90. package/dist/queries/trace.js +1 -1
  91. package/dist/queries/wrapper-candidates.js +1 -1
  92. package/package.json +1 -1
  93. package/dist/chunk-ZORIMKQO.js +0 -2
@@ -1,6 +1,6 @@
1
1
  import{a as x,b as v,c as k,d as A,f as M}from"./chunk-5IM4IQ6N.js";function b(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i){let o=e(t);if(o.has(r))return o.get(r);let l=i();return o.set(r,l),l},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}function he(a){let n=new WeakMap;return{get(e,t){let r=n.get(e);if(r)return r.value;let i=t();return n.set(e,{value:i}),i},invalidate(e){n.delete(e)},has(e){return n.has(e)}}}function N(a){let n=new WeakMap,e=t=>{let r=n.get(t);return r||(r=new Map,n.set(t,r)),r};return{get(t,r,i,o){let l=e(t),s=l.get(r);if(s&&s.source===i)return s.value;let u=o();return l.set(r,{source:i,value:u}),u},invalidate(t,r){n.get(t)?.delete(r)},invalidateAll(t){n.delete(t)}}}import{existsSync as H,readFileSync as Y}from"fs";import{join as K}from"path";var U=b("source-text");function m(a,n){let e=n.replace(/\\/g,"/");return U.get(a,e,()=>{let t=K(a.config.projectRoot,e);return H(t)?Y(t,"utf-8"):""})}var z=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift)?/i;function Ce(a,n,e){if(e<=0)return!1;let t=m(a,n);if(!t)return!1;let r=t.split(`
2
- `);for(let i=e-1;i>=0&&i>=e-5;i-=1){let o=(r[i]??"").trim();if(o!==""){if(z.test(o))return!0;if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return!1}}return!1}import{extname as R}from"path";import{createRequire as G}from"module";var p=G(import.meta.url),y=null,I=!1;function P(){if(I)return null;if(y)return y;try{return y=p("tree-sitter"),y}catch{return I=!0,null}}var q={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},w=new Map,S=new Set;function O(a){if(S.has(a))return null;let n=w.get(a);if(n)return n;let e;try{switch(a){case"rust":e=p("tree-sitter-rust");break;case"typescript":e=p("tree-sitter-typescript").typescript;break;case"tsx":e=p("tree-sitter-typescript").tsx;break;case"javascript":e=p("tree-sitter-javascript");break;case"python":e=p("tree-sitter-python");break;case"java":e=p("tree-sitter-java");break;case"kotlin":e=p("tree-sitter-kotlin");break;case"scala":e=p("tree-sitter-scala");break;case"ruby":e=p("tree-sitter-ruby");break;case"c":e=p("tree-sitter-c");break;case"cpp":e=p("tree-sitter-cpp");break;case"csharp":e=p("tree-sitter-c-sharp");break;case"php":e=p("tree-sitter-php").php;break;case"vb":{let t=p("tree-sitter-vb-dotnet");e=t.language??t;break}}}catch{return S.add(a),null}return w.set(a,e),e}var T=new Map;function V(a){let n=T.get(a);if(n)return n;let e=O(a);if(!e)return null;let t=P();if(!t)return null;let r=new t;try{r.setLanguage(e)}catch{return S.add(a),null}return T.set(a,r),r}function h(a){return q[R(a).toLowerCase()]??null}function J(a){return R(a).toLowerCase()===".vue"}var j=N("ast-trees");function C(a,n){if(J(n))return Z(a,n);let e=h(n);if(!e)return null;let t=m(a,n);return t?j.get(a,n,t,()=>{let r=V(e);return r?r.parse(t):null}):null}function Z(a,n){let e=m(a,n);return e?j.get(a,n,e,()=>{let t=X(e);if(!t)return null;let r=V(t.language);if(!r)return null;let i=`
3
- `.repeat(t.startLine)+t.body;return r.parse(i)}):null}function X(a){let n=[],e=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let s of a.matchAll(e))typeof s.index=="number"&&n.push({tagOpen:s[1]??"",body:s[2]??"",openIdx:s.index+(s[0].length-(s[2]?.length??0)-9)});if(n.length===0)return null;let t=n.find(s=>/\bsetup\b/.test(s.tagOpen))??n[0],i=t.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),o=i==="ts"||i==="typescript"?"typescript":i==="tsx"?"tsx":"javascript",l=ee(a,t.openIdx);return{body:t.body,startLine:l,language:o}}function ee(a,n){let e=0;for(let t=0;t<n&&t<a.length;t++)a.charCodeAt(t)===10&&e++;return e}var g=new Map;function te(a,n){let e=`${a}::${n}`;if(g.has(e))return g.get(e)??null;let t=O(a);if(!t)return g.set(e,null),null;let r=P();if(!r)return g.set(e,null),null;let i=null;try{i=new r.Query(t,n)}catch{i=null}return g.set(e,i),i}var ne={rust:`
2
+ `);for(let i=e-1;i>=0&&i>=e-5;i-=1){let o=(r[i]??"").trim();if(o!==""){if(z.test(o))return!0;if(!o.startsWith("//")&&!o.startsWith("*")&&!o.startsWith("/*")&&!o.startsWith("@")&&!o.startsWith("#"))return!1}}return!1}import{extname as R}from"path";import{createRequire as G}from"module";var p=G(import.meta.url),y=null,I=!1;function P(){if(I)return null;if(y)return y;try{return y=p("tree-sitter"),y}catch{return I=!0,null}}var q={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},w=new Map,S=new Set;function O(a){if(S.has(a))return null;let n=w.get(a);if(n)return n;let e;try{switch(a){case"rust":e=p("tree-sitter-rust");break;case"typescript":e=p("tree-sitter-typescript").typescript;break;case"tsx":e=p("tree-sitter-typescript").tsx;break;case"javascript":e=p("tree-sitter-javascript");break;case"python":e=p("tree-sitter-python");break;case"java":e=p("tree-sitter-java");break;case"kotlin":e=p("tree-sitter-kotlin");break;case"scala":e=p("tree-sitter-scala");break;case"ruby":e=p("tree-sitter-ruby");break;case"c":e=p("tree-sitter-c");break;case"cpp":e=p("tree-sitter-cpp");break;case"csharp":e=p("tree-sitter-c-sharp");break;case"php":e=p("tree-sitter-php").php;break;case"vb":{let t=p("tree-sitter-vb-dotnet");e=t.language??t;break}}}catch{return S.add(a),null}return w.set(a,e),e}var T=new Map;function V(a){let n=T.get(a);if(n)return n;let e=O(a);if(!e)return null;let t=P();if(!t)return null;let r=new t;try{r.setLanguage(e)}catch{return S.add(a),null}return T.set(a,r),r}function h(a){return q[R(a).toLowerCase()]??null}function J(a){return R(a).toLowerCase()===".vue"}var j=N("ast-trees");function C(a,n){if(J(n))return Z(a,n);let e=h(n);if(!e)return null;let t=m(a,n);return t?j.get(a,n,t,()=>{let r=V(e);if(!r)return null;try{return r.parse(t)}catch{return null}}):null}function Z(a,n){let e=m(a,n);return e?j.get(a,n,e,()=>{let t=X(e);if(!t)return null;let r=V(t.language);if(!r)return null;let i=`
3
+ `.repeat(t.startLine)+t.body;try{return r.parse(i)}catch{return null}}):null}function X(a){let n=[],e=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let s of a.matchAll(e))typeof s.index=="number"&&n.push({tagOpen:s[1]??"",body:s[2]??"",openIdx:s.index+(s[0].length-(s[2]?.length??0)-9)});if(n.length===0)return null;let t=n.find(s=>/\bsetup\b/.test(s.tagOpen))??n[0],i=t.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),o=i==="ts"||i==="typescript"?"typescript":i==="tsx"?"tsx":"javascript",l=ee(a,t.openIdx);return{body:t.body,startLine:l,language:o}}function ee(a,n){let e=0;for(let t=0;t<n&&t<a.length;t++)a.charCodeAt(t)===10&&e++;return e}var g=new Map;function te(a,n){let e=`${a}::${n}`;if(g.has(e))return g.get(e)??null;let t=O(a);if(!t)return g.set(e,null),null;let r=P();if(!r)return g.set(e,null),null;let i=null;try{i=new r.Query(t,n)}catch{i=null}return g.set(e,i),i}var ne={rust:`
4
4
  (function_item name: (identifier) @name) @def
5
5
  (function_signature_item name: (identifier) @name) @def
6
6
  `,typescript:`
@@ -81,4 +81,4 @@ import{a as x,b as v,c as k,d as A,f as M}from"./chunk-5IM4IQ6N.js";function b(a
81
81
  ${a.pathExclusionsFor("documents")}
82
82
  ${e}
83
83
  ORDER BY relative_path`).flatMap(t=>D(a,t.relative_path)).filter(t=>!a.isIgnored(t.relativePath))}function Qe(a,n,e={}){if(n.length===0)return[];let t=n.flatMap(r=>D(a,r)).filter(r=>!a.isIgnored(r.relativePath));return e.onlyDocumented&&(t=t.filter(r=>r.documentation!==null&&r.documentation!=="")),e.sort&&(t=t.sort((r,i)=>r.relativePath.localeCompare(i.relativePath)||r.startLine-i.startLine||r.endLine-i.endLine)),t.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:v(r.symbol),signature:$(W(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function $e(a,n){let e=null;for(let t of a)t.startLine>n||t.endLine<n||(!e||t.endLine-t.startLine<e.endLine-e.startLine)&&(e=t);return e}function We(a,n){let e=D(a,n.relative_path).find(t=>t.symbolId===n.id);return e?{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function de(a,n,e){let t=F(a,n);if(t)return pe(e,t);let r=m(a,n);if(!r)return e;let i=r.split(/\r?\n/),o=e.some(c=>_(c.symbol))?me(i):null,l=new Map;for(let c of e)l.set(c.symbolId,fe(i,o,c));let s=new Map,u=e.filter(c=>_(c.symbol)).map(c=>({definition:c,startLine:l.get(c.symbolId)??c.startLine})).sort((c,d)=>c.startLine-d.startLine||c.definition.startLine-d.definition.startLine||c.definition.symbol.localeCompare(d.definition.symbol));for(let c=0;c<u.length;c+=1){let d=u[c],f=u[c+1],B=f?Math.max(d.startLine,f.startLine-1):i.length-1;s.set(d.definition.symbolId,{startLine:d.startLine,endLine:ge(i,d.definition,d.startLine,B)})}return e.map(c=>{let d=s.get(c.symbolId);return d?{...c,startLine:d.startLine,endLine:d.endLine}:c})}function pe(a,n){let e=new Map;for(let t of n){let r=e.get(t.name);r?r.push(t):e.set(t.name,[t])}return a.map(t=>{if(!_(t.symbol)||!t.leaf)return t;let r=e.get(t.leaf);if(!r||r.length===0)return t;let i=r[0],o=Math.abs(i.startLine-t.startLine);for(let l=1;l<r.length;l+=1){let s=r[l],u=Math.abs(s.startLine-t.startLine);u<o&&(i=s,o=u)}return{...t,startLine:i.startLine,endLine:i.endLine}})}function fe(a,n,e){if(!_(e.symbol))return e.startLine;let t=Math.max(0,Math.min(e.startLine,a.length-1));if(!n)return t;let r=n.get(e.leaf);if(!r||r.length===0)return t;let i=null;for(let o of r){let l=Math.abs(o-e.startLine);(!i||l<i.distance)&&(i={line:o,distance:l})}return i?.line??t}function me(a){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,e=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,t=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,i=new Map,o=(l,s)=>{let u=i.get(l);if(!u){i.set(l,[s]);return}u[u.length-1]!==s&&u.push(s)};for(let l=0;l<a.length;l+=1){let s=a[l]??"";for(let c of s.matchAll(n))c[1]&&o(c[1],l);for(let c of s.matchAll(e))c[1]&&o(c[1],l);let u=s.match(t);u?.[1]&&o(u[1],l);for(let c of s.matchAll(r))c[1]&&o(c[1],l)}return i}function ge(a,n,e,t){let r=Math.max(e,Math.min(a.length-1,t)),i=Math.max(e,Math.min(r,n.endLine)),o=0,l=0,s=!1;for(let u=e;u<=r;u+=1){let c=be(a[u]??"");for(let d of c)d==="{"?(o+=1,s=!0):d==="}"?o=Math.max(0,o-1):d==="("?l+=1:d===")"&&(l=Math.max(0,l-1));if(s&&o===0||!s&&l===0&&u>=i)return u}return i}function be(a){let n="",e=null,t=!1;for(let r=0;r<a.length;r+=1){let i=a[r],o=a[r+1];if(!e&&i==="/"&&o==="/"){n+=" ".repeat(a.length-r);break}if(e){if(t){t=!1,n+=" ";continue}if(i==="\\"){t=!0,n+=" ";continue}i===e&&(e=null),n+=" ";continue}if(i==='"'||i==="'"||i==="`"){e=i,n+=" ";continue}n+=i}return n}function _(a){return a.includes("().")}function ye(a){let n=x(a);if("kind"in n)return null;for(let e=n.descriptors.length-2;e>=0;e--){let t=n.descriptors[e];if(t?.suffix==="type")return t.name}return null}function Be(a){let n=x(a);if("kind"in n)return[];let e=[];for(let t=n.descriptors.length-2;t>=0;t-=1){let r=n.descriptors[t];r?.suffix==="type"&&r.name&&e.push(r.name)}return e}export{b as a,he as b,N as c,m as d,Ce as e,h as f,J as g,C as h,Ne as i,Ie as j,se as k,we as l,L as m,$ as n,W as o,D as p,Fe as q,ue as r,Qe as s,$e as t,We as u,Be as v};
84
- //# sourceMappingURL=chunk-SPMLGXCE.js.map
84
+ //# sourceMappingURL=chunk-QRULHDMO.js.map
@@ -1,4 +1,4 @@
1
- import{c as E}from"./chunk-AEMTUHQ7.js";import{e as h,f as _}from"./chunk-6XP3KWHC.js";import{p as b}from"./chunk-SPMLGXCE.js";import{b as m,d as p}from"./chunk-5IM4IQ6N.js";function C(e,s={}){let{scope:n,limit:i}=s,l=n?`AND barrel_d.relative_path LIKE '%${n}%'`:"",o=e.all(`SELECT DISTINCT
1
+ import{c as E}from"./chunk-5KWWENJZ.js";import{e as h,f as _}from"./chunk-VQXXSUQF.js";import{p as b}from"./chunk-QRULHDMO.js";import{b as m,d as p}from"./chunk-5IM4IQ6N.js";function C(e,s={}){let{scope:n,limit:i}=s,l=n?`AND barrel_d.relative_path LIKE '%${n}%'`:"",o=e.all(`SELECT DISTINCT
2
2
  barrel_d.id AS barrel_doc_id,
3
3
  barrel_d.relative_path AS barrel_path,
4
4
  gs.id AS symbol_id,
@@ -67,4 +67,4 @@ import{c as E}from"./chunk-AEMTUHQ7.js";import{e as h,f as _}from"./chunk-6XP3KW
67
67
  WHERE 1 = 1
68
68
  ${e.pathExclusionsFor("documents")}
69
69
  ORDER BY relative_path`),l=new Set;for(let o of i)if(!(e.isIgnored(o.relative_path)||o.relative_path===n))for(let a of h(e,o.relative_path))a.sourcePath===s&&l.add(o.relative_path);return l.size}function N(e,s){let n=b(e,s);return n.find(i=>p(i.symbol)==="method")??n[0]??null}function R(e){let s=new Set,n=[];for(let i of e){let l=`${i.barrelFile}|${i.symbol}|${i.originalFile}`;s.has(l)||(s.add(l),n.push(i))}return n}export{C as a};
70
- //# sourceMappingURL=chunk-ORD3HEWI.js.map
70
+ //# sourceMappingURL=chunk-RAJHIEBM.js.map
@@ -1,2 +1,2 @@
1
- import{d,q as b}from"./chunk-SPMLGXCE.js";import{b as g}from"./chunk-5IM4IQ6N.js";function I(n,e={}){let{scope:i,minLoc:u=1,limit:l}=e,p=new Map;for(let t of b(n,{scope:i})){if(!t.isFunctionLike||n.isIgnored(t.relativePath))continue;let s=t.endLine-t.startLine+1;if(s<u)continue;let f=x(n,t);if(!f)continue;let a={symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s},r=p.get(f);r?r.push(a):p.set(f,[a])}let c=[];for(let[t,s]of p)s.length<2||c.push({signature:t,functions:s});return c.sort((t,s)=>{let f=s.functions.length-t.functions.length;if(f!==0)return f;let a=t.functions.reduce((o,m)=>o+m.loc,0);return s.functions.reduce((o,m)=>o+m.loc,0)-a}),l?c.slice(0,l):c}function x(n,e){let i=S(e.documentation),u=i?L(i):null;return u||D($(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function S(n){if(!n||!n.includes("|"))return null;let e=n.slice(n.indexOf("|")+1).replace(/\n/g," ").trim();return e.length>0?e:null}function $(n,e,i,u,l){let p=d(n,e);if(!p)return null;let c=p.split(/\r?\n/),t=v(c,i,u,l);for(let s of t){let f=Math.min(c.length-1,Math.max(s,s+4)),a="";for(let r=s;r<=f;r+=1){let o=c[r]?.trim();if(o&&(a=a?`${a} ${o}`:o,y(a)))return a}if(a&&a.includes("("))return a}return null}function y(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||w(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function L(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),i=e.indexOf("(");return i===-1||(e=e.slice(i),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function D(n,e){if(!n||!n.trim())return null;let i=n.replace(/\s+/g," ").trim(),u=i.indexOf("(");if(u===-1)return null;let l=i.slice(0,u),c=new RegExp(`\\b${h(e)}\\b`,"i").exec(l);c&&typeof c.index=="number"&&(l=l.slice(0,c.index)),l=l.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let t=i.slice(u).replace(/\s*\{[\s\S]*$/,"").replace(/\s*=>[\s\S]*$/,"").replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!t.startsWith("("))return null;let s=`${l?`${l} `:""}${t}`.replace(/\s+/g,"").toLowerCase();return s.length>=3?s:null}function v(n,e,i,u){let l=h(u),p=new RegExp(`\\b${l}\\b\\s*\\(`,"i"),c=new RegExp(`\\bdef\\s+${l}\\b`,"i"),t=[],s=new Set,f=Math.max(0,Math.min(e,n.length-1)),a=Math.max(f,Math.min(n.length-1,Math.max(i,e+4)));for(let r=f;r<=a;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}for(let r=0;r<n.length;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}return t}function w(n){let e=0;for(let i of n)i==="("&&(e+=1),i===")"&&(e-=1);return e}function h(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{I as a};
2
- //# sourceMappingURL=chunk-TXADWK4I.js.map
1
+ import{d,q as b}from"./chunk-QRULHDMO.js";import{b as g}from"./chunk-5IM4IQ6N.js";function I(n,e={}){let{scope:i,minLoc:u=1,limit:l}=e,p=new Map;for(let t of b(n,{scope:i})){if(!t.isFunctionLike||n.isIgnored(t.relativePath))continue;let s=t.endLine-t.startLine+1;if(s<u)continue;let f=x(n,t);if(!f)continue;let a={symbol:t.symbol,shortName:g(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s},r=p.get(f);r?r.push(a):p.set(f,[a])}let c=[];for(let[t,s]of p)s.length<2||c.push({signature:t,functions:s});return c.sort((t,s)=>{let f=s.functions.length-t.functions.length;if(f!==0)return f;let a=t.functions.reduce((o,m)=>o+m.loc,0);return s.functions.reduce((o,m)=>o+m.loc,0)-a}),l?c.slice(0,l):c}function x(n,e){let i=S(e.documentation),u=i?L(i):null;return u||D($(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function S(n){if(!n||!n.includes("|"))return null;let e=n.slice(n.indexOf("|")+1).replace(/\n/g," ").trim();return e.length>0?e:null}function $(n,e,i,u,l){let p=d(n,e);if(!p)return null;let c=p.split(/\r?\n/),t=v(c,i,u,l);for(let s of t){let f=Math.min(c.length-1,Math.max(s,s+4)),a="";for(let r=s;r<=f;r+=1){let o=c[r]?.trim();if(o&&(a=a?`${a} ${o}`:o,y(a)))return a}if(a&&a.includes("("))return a}return null}function y(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||w(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function L(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),i=e.indexOf("(");return i===-1||(e=e.slice(i),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function D(n,e){if(!n||!n.trim())return null;let i=n.replace(/\s+/g," ").trim(),u=i.indexOf("(");if(u===-1)return null;let l=i.slice(0,u),c=new RegExp(`\\b${h(e)}\\b`,"i").exec(l);c&&typeof c.index=="number"&&(l=l.slice(0,c.index)),l=l.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let t=i.slice(u).replace(/\s*\{[\s\S]*$/,"").replace(/\s*=>[\s\S]*$/,"").replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!t.startsWith("("))return null;let s=`${l?`${l} `:""}${t}`.replace(/\s+/g,"").toLowerCase();return s.length>=3?s:null}function v(n,e,i,u){let l=h(u),p=new RegExp(`\\b${l}\\b\\s*\\(`,"i"),c=new RegExp(`\\bdef\\s+${l}\\b`,"i"),t=[],s=new Set,f=Math.max(0,Math.min(e,n.length-1)),a=Math.max(f,Math.min(n.length-1,Math.max(i,e+4)));for(let r=f;r<=a;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}for(let r=0;r<n.length;r+=1){let o=n[r]??"";(p.test(o)||c.test(o))&&!s.has(r)&&(s.add(r),t.push(r))}return t}function w(n){let e=0;for(let i of n)i==="("&&(e+=1),i===")"&&(e-=1);return e}function h(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{I as a};
2
+ //# sourceMappingURL=chunk-RKZBRDFK.js.map
@@ -1,2 +1,2 @@
1
- import{c as g}from"./chunk-QSTMORTI.js";import{h as u,j as h}from"./chunk-3FG3VLK3.js";import{a as d,b as y}from"./chunk-7NEBSLI3.js";import{p as S,t as p}from"./chunk-SPMLGXCE.js";import{b as m}from"./chunk-5IM4IQ6N.js";function N(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,t=d(e,o);return t?c==="backward"?w(e,t,s):R(e,t):null}function w(e,o,r){let c=[],s=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let l=[];for(let a of t){let i=u(e,a);for(let f of i){if(s.has(f.symbol))continue;s.add(f.symbol),c.push({symbol:f.symbol,shortName:m(f.symbol),file:f.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let b=y(e,f.symbol);b&&!e.isIgnored(b.relativePath)&&l.push(b)}}t=l}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:c}}function R(e,o){let r=g(e,o),c=r.length>0?r:h(e,o),s=new Set,t=[];for(let n of c){if(t.length>=30)break;if(e.isIgnored(n.file))continue;let l=n.enclosingSymbol??p(S(e,n.file),n.line)?.symbol??null;if(!l||l===o.symbol)continue;let a=y(e,l);if(a){for(let i of u(e,a))if(i.symbol!==o.symbol&&i.symbol!==l&&i.file!==n.file&&!e.isIgnored(i.file)&&!s.has(i.symbol)&&(s.add(i.symbol),t.push({symbol:i.symbol,shortName:m(i.symbol),file:i.file,relationship:`used alongside target in ${m(l)}`}),t.length>=30))break}}return t.sort((n,l)=>n.file.localeCompare(l.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:t}}export{N as a};
2
- //# sourceMappingURL=chunk-3T53QAUS.js.map
1
+ import{c as g}from"./chunk-F2TGKDMW.js";import{h as u,j as h}from"./chunk-ID7TO4P6.js";import{a as d,b as y}from"./chunk-H4IWC7KJ.js";import{p as S,t as p}from"./chunk-QRULHDMO.js";import{b as m}from"./chunk-5IM4IQ6N.js";function N(e,o,r={}){let{direction:c="backward",maxDepth:s=3}=r,t=d(e,o);return t?c==="backward"?w(e,t,s):R(e,t):null}function w(e,o,r){let c=[],s=new Set([o.symbol]),t=[o];for(let n=1;n<=r&&t.length!==0;n++){let l=[];for(let a of t){let i=u(e,a);for(let f of i){if(s.has(f.symbol))continue;s.add(f.symbol),c.push({symbol:f.symbol,shortName:m(f.symbol),file:f.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let b=y(e,f.symbol);b&&!e.isIgnored(b.relativePath)&&l.push(b)}}t=l}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:c}}function R(e,o){let r=g(e,o),c=r.length>0?r:h(e,o),s=new Set,t=[];for(let n of c){if(t.length>=30)break;if(e.isIgnored(n.file))continue;let l=n.enclosingSymbol??p(S(e,n.file),n.line)?.symbol??null;if(!l||l===o.symbol)continue;let a=y(e,l);if(a){for(let i of u(e,a))if(i.symbol!==o.symbol&&i.symbol!==l&&i.file!==n.file&&!e.isIgnored(i.file)&&!s.has(i.symbol)&&(s.add(i.symbol),t.push({symbol:i.symbol,shortName:m(i.symbol),file:i.file,relationship:`used alongside target in ${m(l)}`}),t.length>=30))break}}return t.sort((n,l)=>n.file.localeCompare(l.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:t}}export{N as a};
2
+ //# sourceMappingURL=chunk-RPRIZ43D.js.map
@@ -1,2 +1,2 @@
1
- import{i as S,m as M}from"./chunk-3FG3VLK3.js";import{a as g,b as I}from"./chunk-7NEBSLI3.js";import{p as d,t as p}from"./chunk-SPMLGXCE.js";import{b as u}from"./chunk-5IM4IQ6N.js";function N(s,f,n={}){let{maxDepth:a=5,scope:b}=n,c=g(s,f);if(!c)return[];let i=[],y=new Set([c.symbolId]),r=new Set,l=[c];for(let e=1;e<=a&&l.length!==0;e++){let t=[];for(let m of l)for(let o of w(s,m,b)){let h=`${o.file}|${o.shortName}`;if(o.symbolId!==null){if(y.has(o.symbolId))continue;y.add(o.symbolId)}else if(r.has(h))continue;r.add(h),i.push({symbol:o.symbol,shortName:o.shortName,file:o.file,depth:e}),o.symbolId!==null&&o.symbolMatch&&t.push(o.symbolMatch)}l=t}return i.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),i}function w(s,f,n){let a=S(s,f,{limit:500}).filter(e=>!s.isIgnored(e.file)).filter(e=>!n||e.file.includes(n)),b=new Set(a.map(e=>e.file)),c=M(s).get(f.symbolId)??new Set,i=[];for(let e of c){if(b.has(e)||s.isIgnored(e)||n&&!e.includes(n))continue;let t=d(s,e),m=t.length>0?p(t,t[0].startLine):null;i.push({symbol:m?.symbol??e,file:e})}let y=[...a,...i],r=[],l=new Set;for(let e of y){let t=I(s,e.symbol);if(!t){let o=`${e.file}|${e.symbol}`;if(l.has(o))continue;l.add(o),r.push({symbolId:null,symbol:e.symbol,shortName:u(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===f.symbolId||s.isIgnored(t.relativePath))continue;let m=`${t.symbolId}|${t.relativePath}`;l.has(m)||(l.add(m),r.push({symbolId:t.symbolId,symbol:t.symbol,shortName:u(t.symbol),file:t.relativePath,symbolMatch:t}))}return r}export{N as a};
2
- //# sourceMappingURL=chunk-FJV7QT4G.js.map
1
+ import{i as S,m as M}from"./chunk-ID7TO4P6.js";import{a as g,b as I}from"./chunk-H4IWC7KJ.js";import{p as d,t as p}from"./chunk-QRULHDMO.js";import{b as u}from"./chunk-5IM4IQ6N.js";function N(s,f,n={}){let{maxDepth:a=5,scope:b}=n,c=g(s,f);if(!c)return[];let i=[],y=new Set([c.symbolId]),r=new Set,l=[c];for(let e=1;e<=a&&l.length!==0;e++){let t=[];for(let m of l)for(let o of w(s,m,b)){let h=`${o.file}|${o.shortName}`;if(o.symbolId!==null){if(y.has(o.symbolId))continue;y.add(o.symbolId)}else if(r.has(h))continue;r.add(h),i.push({symbol:o.symbol,shortName:o.shortName,file:o.file,depth:e}),o.symbolId!==null&&o.symbolMatch&&t.push(o.symbolMatch)}l=t}return i.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),i}function w(s,f,n){let a=S(s,f,{limit:500}).filter(e=>!s.isIgnored(e.file)).filter(e=>!n||e.file.includes(n)),b=new Set(a.map(e=>e.file)),c=M(s).get(f.symbolId)??new Set,i=[];for(let e of c){if(b.has(e)||s.isIgnored(e)||n&&!e.includes(n))continue;let t=d(s,e),m=t.length>0?p(t,t[0].startLine):null;i.push({symbol:m?.symbol??e,file:e})}let y=[...a,...i],r=[],l=new Set;for(let e of y){let t=I(s,e.symbol);if(!t){let o=`${e.file}|${e.symbol}`;if(l.has(o))continue;l.add(o),r.push({symbolId:null,symbol:e.symbol,shortName:u(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===f.symbolId||s.isIgnored(t.relativePath))continue;let m=`${t.symbolId}|${t.relativePath}`;l.has(m)||(l.add(m),r.push({symbolId:t.symbolId,symbol:t.symbol,shortName:u(t.symbol),file:t.relativePath,symbolMatch:t}))}return r}export{N as a};
2
+ //# sourceMappingURL=chunk-RXGCTLHY.js.map
@@ -1,2 +1,2 @@
1
- import{h as f}from"./chunk-3FG3VLK3.js";import{a as m}from"./chunk-7NEBSLI3.js";import{b as r}from"./chunk-5IM4IQ6N.js";function w(i,g,p){let s=m(i,g),n=m(i,p);if(!s||!n)return null;let c=new Set(f(i,s).map(e=>e.symbol)),h=new Set(f(i,n).map(e=>e.symbol)),a=[];for(let e of c)h.has(e)&&a.push(e);let o=[];for(let e of c)h.has(e)||o.push(e);let l=[];for(let e of h)c.has(e)||l.push(e);let u=new Set([...c,...h]),d=u.size>0?a.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":a.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&l.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":l.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&l.length<=2?t=`Create a shared function with the ${a.length} common callees. Pass the ${o.length+l.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${a.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${l.length} in B).`;let y=s.endLine-s.startLine+1,b=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:r(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:b},similarity:d,sharedCallees:a.map(r),uniqueToA:o.map(r),uniqueToB:l.map(r),consolidationStrategy:t}}export{w as a};
2
- //# sourceMappingURL=chunk-5VU2RVKI.js.map
1
+ import{h as f}from"./chunk-ID7TO4P6.js";import{a as m}from"./chunk-H4IWC7KJ.js";import{b as r}from"./chunk-5IM4IQ6N.js";function w(i,g,p){let s=m(i,g),n=m(i,p);if(!s||!n)return null;let c=new Set(f(i,s).map(e=>e.symbol)),h=new Set(f(i,n).map(e=>e.symbol)),a=[];for(let e of c)h.has(e)&&a.push(e);let o=[];for(let e of c)h.has(e)||o.push(e);let l=[];for(let e of h)c.has(e)||l.push(e);let u=new Set([...c,...h]),d=u.size>0?a.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":a.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":o.length===0&&l.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":o.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":l.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":o.length<=2&&l.length<=2?t=`Create a shared function with the ${a.length} common callees. Pass the ${o.length+l.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${a.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${o.length} callees in A, ${l.length} in B).`;let y=s.endLine-s.startLine+1,b=n.endLine-n.startLine+1;return{symbolA:{symbol:s.symbol,shortName:r(s.symbol),file:s.relativePath,loc:y},symbolB:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:b},similarity:d,sharedCallees:a.map(r),uniqueToA:o.map(r),uniqueToB:l.map(r),consolidationStrategy:t}}export{w as a};
2
+ //# sourceMappingURL=chunk-S6IGA6KK.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-NFOSOUH6.js";function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
1
+ import{a as s}from"./chunk-DX5YEUX4.js";function r(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-NFOSOUH6.js";function r(e,d){let i=s(e,d);return i?e.
30
30
  WHERE d2.relative_path = ?
31
31
  AND d1.relative_path != ?
32
32
  ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{r as a,a as b};
33
- //# sourceMappingURL=chunk-LKCPNPHH.js.map
33
+ //# sourceMappingURL=chunk-TPOYTT6O.js.map
@@ -1,2 +1,2 @@
1
- import{c as g}from"./chunk-QSTMORTI.js";import{h as c,i as y,j as S}from"./chunk-3FG3VLK3.js";import{a}from"./chunk-7NEBSLI3.js";import{b as r}from"./chunk-5IM4IQ6N.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=g(l,o),s=(t.length>0?t:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
- //# sourceMappingURL=chunk-2HEJQBMS.js.map
1
+ import{c as g}from"./chunk-F2TGKDMW.js";import{h as c,i as y,j as S}from"./chunk-ID7TO4P6.js";import{a}from"./chunk-H4IWC7KJ.js";import{b as r}from"./chunk-5IM4IQ6N.js";function v(l,i){let o=a(l,i);if(!o)return null;let n=[{file:o.relativePath,line:o.startLine}],t=g(l,o),s=(t.length>0?t:S(l,o)).filter(e=>!l.isIgnored(e.file)).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{producers:u,consumers:b}=p(l,o,s);return{symbol:o.symbol,shortName:r(o.symbol),relativePath:o.relativePath,definitionSites:n.filter(e=>!l.isIgnored(e.file)),usageSites:s,producers:u.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),consumers:b.filter(e=>!l.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function p(l,i,o){let n=m(c(l,i,{limit:30}).map(s=>({symbol:s.symbol,file:s.file}))),t=m(y(l,i,{limit:30})),f=t.length>0?t:m(o.map(s=>({symbol:s.enclosingSymbol==="(top-level)"?s.file:s.enclosingSymbol,file:s.file})));return{producers:n,consumers:f}}function m(l){let i=new Set,o=[];for(let n of l){let t=`${n.symbol}|${n.file}`;i.has(t)||(i.add(t),o.push(n))}return o}export{v as a};
2
+ //# sourceMappingURL=chunk-TRBNQ273.js.map
@@ -1,2 +1,2 @@
1
- import{a as x}from"./chunk-AEMTUHQ7.js";import{k}from"./chunk-3FG3VLK3.js";import{e as w,r as v}from"./chunk-SPMLGXCE.js";import{b,f as C,i as L}from"./chunk-5IM4IQ6N.js";function A(i,F={}){let{scope:I,minLoc:P=10,minCallees:z=6,limit:D=20}=F,y=v(i,I).filter(e=>!i.isIgnored(e.relativePath)).filter(e=>h(e)>=P&&C(e.symbol)).filter(e=>!(e.relativePath.split("/").pop()??"").includes("types")).filter(e=>x(e.relativePath)!=="test").filter(e=>!L(e.symbol)).filter(e=>!w(i,e.relativePath,e.startLine)).sort((e,r)=>h(r)-h(e)),E=k(i,y),d=[];for(let e of y){let r=E.get(e.symbolId)??[],c=new Set(r.map(t=>t.symbol));if(c.size<z)continue;let l=new Map;for(let t of c)l.set(t,new Set);let a=new Map;for(let t of r)a.has(t.chunkId)||a.set(t.chunkId,new Set),a.get(t.chunkId).add(t.symbol);for(let t of a.values()){let s=[...t];for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)l.get(s[o]).add(s[n]),l.get(s[n]).add(s[o])}let f=new Set,m=[];for(let t of c){if(f.has(t))continue;let s=new Set,o=[t];for(;o.length>0;){let n=o.pop();if(!f.has(n)){f.add(n),s.add(n);for(let u of l.get(n)??[])f.has(u)||o.push(u)}}m.push(s)}if(m.length<2)continue;let S=m.filter(t=>t.size>=3).map(t=>{let s=new Set;for(let p of m)if(p!==t)for(let g of p)s.add(g);let o=0;for(let p of t)for(let g of l.get(p)??[])s.has(g)&&o++;let n=t.size*s.size,u=n>0?1-o/n:1;return{callees:[...t].map(b),isolation:u}}).filter(t=>t.isolation>.5).sort((t,s)=>s.isolation-t.isolation);S.length>0&&d.push({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),totalCallees:c.size,clusters:S})}return d.sort((e,r)=>r.clusters.length-e.clusters.length||r.loc-e.loc),d.slice(0,D)}function h(i){return i.endLine-i.startLine+1}export{A as a};
2
- //# sourceMappingURL=chunk-G2SX5EHW.js.map
1
+ import{a as x}from"./chunk-5KWWENJZ.js";import{k}from"./chunk-ID7TO4P6.js";import{e as w,r as v}from"./chunk-QRULHDMO.js";import{b,f as C,i as L}from"./chunk-5IM4IQ6N.js";function A(i,F={}){let{scope:I,minLoc:P=10,minCallees:z=6,limit:D=20}=F,y=v(i,I).filter(e=>!i.isIgnored(e.relativePath)).filter(e=>h(e)>=P&&C(e.symbol)).filter(e=>!(e.relativePath.split("/").pop()??"").includes("types")).filter(e=>x(e.relativePath)!=="test").filter(e=>!L(e.symbol)).filter(e=>!w(i,e.relativePath,e.startLine)).sort((e,r)=>h(r)-h(e)),E=k(i,y),d=[];for(let e of y){let r=E.get(e.symbolId)??[],c=new Set(r.map(t=>t.symbol));if(c.size<z)continue;let l=new Map;for(let t of c)l.set(t,new Set);let a=new Map;for(let t of r)a.has(t.chunkId)||a.set(t.chunkId,new Set),a.get(t.chunkId).add(t.symbol);for(let t of a.values()){let s=[...t];for(let o=0;o<s.length;o++)for(let n=o+1;n<s.length;n++)l.get(s[o]).add(s[n]),l.get(s[n]).add(s[o])}let f=new Set,m=[];for(let t of c){if(f.has(t))continue;let s=new Set,o=[t];for(;o.length>0;){let n=o.pop();if(!f.has(n)){f.add(n),s.add(n);for(let u of l.get(n)??[])f.has(u)||o.push(u)}}m.push(s)}if(m.length<2)continue;let S=m.filter(t=>t.size>=3).map(t=>{let s=new Set;for(let p of m)if(p!==t)for(let g of p)s.add(g);let o=0;for(let p of t)for(let g of l.get(p)??[])s.has(g)&&o++;let n=t.size*s.size,u=n>0?1-o/n:1;return{callees:[...t].map(b),isolation:u}}).filter(t=>t.isolation>.5).sort((t,s)=>s.isolation-t.isolation);S.length>0&&d.push({symbol:e.symbol,shortName:b(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),totalCallees:c.size,clusters:S})}return d.sort((e,r)=>r.clusters.length-e.clusters.length||r.loc-e.loc),d.slice(0,D)}function h(i){return i.endLine-i.startLine+1}export{A as a};
2
+ //# sourceMappingURL=chunk-TVJMEDHH.js.map
@@ -1,2 +1,2 @@
1
- import{b as p}from"./chunk-NFOSOUH6.js";import{s as u}from"./chunk-SPMLGXCE.js";import{k as f}from"./chunk-5IM4IQ6N.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
- //# sourceMappingURL=chunk-OU2D2T4A.js.map
1
+ import{b as p}from"./chunk-DX5YEUX4.js";import{s as u}from"./chunk-QRULHDMO.js";import{k as f}from"./chunk-5IM4IQ6N.js";function S(a,b){let y=p(a,b),o=u(a,y,{sort:!0});if(o.length===0)return[];let i=o.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,children:[]})),s=new Map;for(let e of i)s.set(e.symbol,e);let c=[];for(let e=0;e<o.length;e++){let r=o[e],n=i[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of i)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!f(t.symbol,n.symbol))continue;let d=t.endLine-t.startLine;d<m&&(m=d,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-UDKLKBPQ.js.map
@@ -1,2 +1,2 @@
1
- import{q as p}from"./chunk-SPMLGXCE.js";import{a as d,b as f,d as u}from"./chunk-5IM4IQ6N.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},c=new Map;for(let[e,i]of Object.entries(m))c.set(i.toLowerCase(),Number(e));function g(e){let i=parseInt(e,10);if(!isNaN(i))return i;let s=e.toLowerCase(),n=c.get(s);if(n!==void 0)return n;for(let[r,o]of c)if(r.includes(s))return o;return null}function N(e,i,s={}){let{scope:n,limit:r=100}=s,o=g(i);return o===null?[]:b(e,n).map(t=>({row:t,resolvedKind:y(t)})).filter(t=>t.resolvedKind===o).slice(0,r).map(({row:t,resolvedKind:l})=>({symbol:t.symbol,shortName:f(t.symbol),kind:l,kindName:m[l]??"Unknown",relativePath:t.relative_path,startLine:t.start_line,endLine:t.end_line}))}function P(e,i={}){let s=new Map;for(let n of b(e,i.scope)){let r=y(n);r===null||r===0||s.set(r,(s.get(r)??0)+1)}return[...s.entries()].sort((n,r)=>r[1]-n[1]||n[0]-r[0]).map(([n,r])=>({kind:n,kindName:m[n]??"Unknown",count:r}))}function b(e,i){return p(e,{scope:i}).map(S)}function S(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function y(e){return e.kind!==null&&e.kind!==0?h(e.kind,e.symbol,e.documentation):M(e.symbol,e.documentation,e.enclosing_symbol)}function h(e,i,s){let n=(s??"").toLowerCase();if(u(i)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function M(e,i,s){let n=d(e);if("kind"in n)return null;let r=n.descriptors,o=r[r.length-2]??null,a=u(e),t=(i??"").toLowerCase();return a==="type"?t.includes("type ")?76:t.includes("interface ")?27:t.includes("struct ")?68:t.includes("trait ")?73:(t.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:t.includes("async def ")||t.includes("def ")?23:(s?u(s):o?.suffix??null)==="type"?21:83}export{N as a,P as b};
2
- //# sourceMappingURL=chunk-6ALIV5SZ.js.map
1
+ import{q as p}from"./chunk-QRULHDMO.js";import{a as d,b as f,d as u}from"./chunk-5IM4IQ6N.js";var m={0:"UnspecifiedKind",1:"AbstractMethod",2:"Accessor",3:"Array",4:"Assertion",5:"AssociatedType",6:"Attribute",7:"Axiom",8:"Boolean",9:"Class",10:"Constant",11:"Constructor",12:"Contract",13:"DataFamily",14:"DefinitionMacro",15:"Delegate",16:"Enum",17:"EnumMember",18:"Error",19:"Event",20:"Fact",21:"Field",22:"File",23:"Function",24:"Getter",25:"Grammar",26:"Instance",27:"Interface",28:"Key",29:"Lang",30:"Lemma",31:"Library",32:"Macro",33:"Method",34:"MethodAlias",35:"MethodReceiver",36:"MethodSpecification",37:"Message",38:"Modifier",39:"Module",40:"Namespace",41:"Null",42:"Number",43:"Object",44:"Operator",45:"Package",46:"PackageObject",47:"Parameter",48:"ParameterLabel",49:"Pattern",50:"Predicate",51:"Property",52:"Protocol",53:"ProtocolMethod",54:"PureVirtualMethod",55:"Quasiquoter",56:"SelfParameter",57:"Setter",58:"Signature",59:"SingletonClass",60:"SingletonMethod",61:"StaticDataMember",62:"StaticEvent",63:"StaticField",64:"StaticMethod",65:"StaticProperty",66:"StaticVariable",67:"String",68:"Struct",69:"Subscript",70:"Tactic",71:"Theorem",72:"ThisParameter",73:"Trait",74:"TraitMethod",75:"Type",76:"TypeAlias",77:"TypeClass",78:"TypeClassMethod",79:"TypeFamily",80:"TypeParameter",81:"Union",82:"Value",83:"Variable"},c=new Map;for(let[e,i]of Object.entries(m))c.set(i.toLowerCase(),Number(e));function g(e){let i=parseInt(e,10);if(!isNaN(i))return i;let s=e.toLowerCase(),n=c.get(s);if(n!==void 0)return n;for(let[r,o]of c)if(r.includes(s))return o;return null}function N(e,i,s={}){let{scope:n,limit:r=100}=s,o=g(i);return o===null?[]:b(e,n).map(t=>({row:t,resolvedKind:y(t)})).filter(t=>t.resolvedKind===o).slice(0,r).map(({row:t,resolvedKind:l})=>({symbol:t.symbol,shortName:f(t.symbol),kind:l,kindName:m[l]??"Unknown",relativePath:t.relative_path,startLine:t.start_line,endLine:t.end_line}))}function P(e,i={}){let s=new Map;for(let n of b(e,i.scope)){let r=y(n);r===null||r===0||s.set(r,(s.get(r)??0)+1)}return[...s.entries()].sort((n,r)=>r[1]-n[1]||n[0]-r[0]).map(([n,r])=>({kind:n,kindName:m[n]??"Unknown",count:r}))}function b(e,i){return p(e,{scope:i}).map(S)}function S(e){return{symbol:e.symbol,kind:e.kind,documentation:e.documentation,enclosing_symbol:e.enclosingSymbol,relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine}}function y(e){return e.kind!==null&&e.kind!==0?h(e.kind,e.symbol,e.documentation):M(e.symbol,e.documentation,e.enclosing_symbol)}function h(e,i,s){let n=(s??"").toLowerCase();if(u(i)==="type"){if(n.includes("type "))return 76;if(n.includes("interface "))return 27;if(n.includes("struct "))return 68;if(n.includes("trait "))return 73;if(n.includes("class "))return 9}return e}function M(e,i,s){let n=d(e);if("kind"in n)return null;let r=n.descriptors,o=r[r.length-2]??null,a=u(e),t=(i??"").toLowerCase();return a==="type"?t.includes("type ")?76:t.includes("interface ")?27:t.includes("struct ")?68:t.includes("trait ")?73:(t.includes("class "),9):a==="method"?o?.suffix==="type"?33:23:a==="namespace"?39:a!=="term"?null:t.includes("async def ")||t.includes("def ")?23:(s?u(s):o?.suffix??null)==="type"?21:83}export{N as a,P as b};
2
+ //# sourceMappingURL=chunk-UGUBEKK5.js.map
@@ -1,2 +1,2 @@
1
- import{g as M}from"./chunk-3FG3VLK3.js";function H(o,c={}){let{minSimilarity:e=.5,limit:n=15,scope:r,minChainLength:g=3,maxChainLength:s=8}=c,l=M(o,r),t=R(l,g,s);if(t.length===0)return[];let h=new Map,u=new Map;for(let i of t){let a=new Set;for(let f of i)a.has(f)||(h.set(f,(h.get(f)??0)+1),a.add(f));for(let f=Math.max(0,i.length-2);f<i.length;f++)u.set(i[f],(u.get(i[f])??0)+1)}let P=t.length*.9,q=t.length*.8,x=new Set;for(let[i,a]of h)a>P&&x.add(i);for(let[i,a]of u)a>q&&x.add(i);let E=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let i of h.keys()){let a=i.split("/").pop()??"";E.includes(a)&&x.add(i)}let p=[];for(let i of t){let a=i.filter(f=>!x.has(f));a.length>=2&&p.push({original:i,filtered:a})}if(p.length<2)return[];let b=[];for(let i=0;i<p.length;i++){for(let a=i+1;a<p.length;a++){let f=p[i],m=p[a],F=new Set(f.filtered),S=!1;for(let d of m.filtered)if(F.has(d)){S=!0;break}if(!S)continue;let{distance:C,ops:A}=T(f.filtered,m.filtered),j=Math.max(f.filtered.length,m.filtered.length);if(j===0)continue;let B=1-C/j;if(B<e||C===0)continue;let w=A.filter(d=>d.type==="substitute").map(d=>({index:d.indexA,nodeA:f.filtered[d.indexA],nodeB:m.filtered[d.indexB]}));if(w.length===0||A.filter(d=>d.type==="match").length<2)continue;let N=v(f.original,m.original),O=z(f.original,m.original);b.push({chainA:f.original,chainB:m.original,similarity:B,editDistance:C,divergencePoints:w,commonPrefix:N,commonSuffix:O})}if(b.length>n*10)break}b.sort((i,a)=>Math.abs(a.similarity-i.similarity)>.01?a.similarity-i.similarity:i.divergencePoints.length-a.divergencePoints.length);let y=[];for(let i of b)if(y.some(f=>k(i.chainA,f.chainA)&&k(i.chainB,f.chainB))||y.push(i),y.length>=n)break;return y}function R(o,c,e){let n=[];for(let g of o.keys()){if(n.length>=500)break;D(o,g,[g],new Set([g]),c,e,n,500)}return n}function D(o,c,e,n,r,g,s,l){if(s.length>=l)return;if(e.length>=g){e.length>=r&&s.push([...e]);return}let t=o.get(c);if(!t||t.size===0){e.length>=r&&s.push([...e]);return}let h=!1;for(let u of t)if(!n.has(u)&&(n.add(u),e.push(u),D(o,u,e,n,r,g,s,l),e.pop(),n.delete(u),h=!0,s.length>=l))return;!h&&e.length>=r&&s.push([...e])}function T(o,c){let e=o.length,n=c.length,r=Array.from({length:e+1},()=>Array(n+1).fill(0));for(let t=0;t<=e;t++)r[t][0]=t;for(let t=0;t<=n;t++)r[0][t]=t;for(let t=1;t<=e;t++)for(let h=1;h<=n;h++)o[t-1]===c[h-1]?r[t][h]=r[t-1][h-1]:r[t][h]=1+Math.min(r[t-1][h],r[t][h-1],r[t-1][h-1]);let g=[],s=e,l=n;for(;s>0||l>0;)s>0&&l>0&&o[s-1]===c[l-1]?(g.unshift({type:"match",indexA:s-1,indexB:l-1}),s--,l--):s>0&&l>0&&r[s][l]===r[s-1][l-1]+1?(g.unshift({type:"substitute",indexA:s-1,indexB:l-1}),s--,l--):l>0&&r[s][l]===r[s][l-1]+1?(g.unshift({type:"insert",indexA:s,indexB:l-1}),l--):(g.unshift({type:"delete",indexA:s-1,indexB:l}),s--);return{distance:r[e][n],ops:g}}function v(o,c){let e=[];for(let n=0;n<Math.min(o.length,c.length)&&o[n]===c[n];n++)e.push(o[n]);return e}function z(o,c){let e=[],n=o.length-1,r=c.length-1;for(;n>=0&&r>=0&&o[n]===c[r];)e.unshift(o[n]),n--,r--;return e}function k(o,c){if(o.length>c.length)return!1;let e=c.join("\u2192"),n=o.join("\u2192");return e.includes(n)}export{H as a};
2
- //# sourceMappingURL=chunk-AVLUWGXG.js.map
1
+ import{g as M}from"./chunk-ID7TO4P6.js";function H(o,c={}){let{minSimilarity:e=.5,limit:n=15,scope:r,minChainLength:g=3,maxChainLength:s=8}=c,l=M(o,r),t=R(l,g,s);if(t.length===0)return[];let h=new Map,u=new Map;for(let i of t){let a=new Set;for(let f of i)a.has(f)||(h.set(f,(h.get(f)??0)+1),a.add(f));for(let f=Math.max(0,i.length-2);f<i.length;f++)u.set(i[f],(u.get(i[f])??0)+1)}let P=t.length*.9,q=t.length*.8,x=new Set;for(let[i,a]of h)a>P&&x.add(i);for(let[i,a]of u)a>q&&x.add(i);let E=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let i of h.keys()){let a=i.split("/").pop()??"";E.includes(a)&&x.add(i)}let p=[];for(let i of t){let a=i.filter(f=>!x.has(f));a.length>=2&&p.push({original:i,filtered:a})}if(p.length<2)return[];let b=[];for(let i=0;i<p.length;i++){for(let a=i+1;a<p.length;a++){let f=p[i],m=p[a],F=new Set(f.filtered),S=!1;for(let d of m.filtered)if(F.has(d)){S=!0;break}if(!S)continue;let{distance:C,ops:A}=T(f.filtered,m.filtered),j=Math.max(f.filtered.length,m.filtered.length);if(j===0)continue;let B=1-C/j;if(B<e||C===0)continue;let w=A.filter(d=>d.type==="substitute").map(d=>({index:d.indexA,nodeA:f.filtered[d.indexA],nodeB:m.filtered[d.indexB]}));if(w.length===0||A.filter(d=>d.type==="match").length<2)continue;let N=v(f.original,m.original),O=z(f.original,m.original);b.push({chainA:f.original,chainB:m.original,similarity:B,editDistance:C,divergencePoints:w,commonPrefix:N,commonSuffix:O})}if(b.length>n*10)break}b.sort((i,a)=>Math.abs(a.similarity-i.similarity)>.01?a.similarity-i.similarity:i.divergencePoints.length-a.divergencePoints.length);let y=[];for(let i of b)if(y.some(f=>k(i.chainA,f.chainA)&&k(i.chainB,f.chainB))||y.push(i),y.length>=n)break;return y}function R(o,c,e){let n=[];for(let g of o.keys()){if(n.length>=500)break;D(o,g,[g],new Set([g]),c,e,n,500)}return n}function D(o,c,e,n,r,g,s,l){if(s.length>=l)return;if(e.length>=g){e.length>=r&&s.push([...e]);return}let t=o.get(c);if(!t||t.size===0){e.length>=r&&s.push([...e]);return}let h=!1;for(let u of t)if(!n.has(u)&&(n.add(u),e.push(u),D(o,u,e,n,r,g,s,l),e.pop(),n.delete(u),h=!0,s.length>=l))return;!h&&e.length>=r&&s.push([...e])}function T(o,c){let e=o.length,n=c.length,r=Array.from({length:e+1},()=>Array(n+1).fill(0));for(let t=0;t<=e;t++)r[t][0]=t;for(let t=0;t<=n;t++)r[0][t]=t;for(let t=1;t<=e;t++)for(let h=1;h<=n;h++)o[t-1]===c[h-1]?r[t][h]=r[t-1][h-1]:r[t][h]=1+Math.min(r[t-1][h],r[t][h-1],r[t-1][h-1]);let g=[],s=e,l=n;for(;s>0||l>0;)s>0&&l>0&&o[s-1]===c[l-1]?(g.unshift({type:"match",indexA:s-1,indexB:l-1}),s--,l--):s>0&&l>0&&r[s][l]===r[s-1][l-1]+1?(g.unshift({type:"substitute",indexA:s-1,indexB:l-1}),s--,l--):l>0&&r[s][l]===r[s][l-1]+1?(g.unshift({type:"insert",indexA:s,indexB:l-1}),l--):(g.unshift({type:"delete",indexA:s-1,indexB:l}),s--);return{distance:r[e][n],ops:g}}function v(o,c){let e=[];for(let n=0;n<Math.min(o.length,c.length)&&o[n]===c[n];n++)e.push(o[n]);return e}function z(o,c){let e=[],n=o.length-1,r=c.length-1;for(;n>=0&&r>=0&&o[n]===c[r];)e.unshift(o[n]),n--,r--;return e}function k(o,c){if(o.length>c.length)return!1;let e=c.join("\u2192"),n=o.join("\u2192");return e.includes(n)}export{H as a};
2
+ //# sourceMappingURL=chunk-VKYLXCV6.js.map
@@ -1,8 +1,8 @@
1
- import{a as B,b as ie,c as ae,d as G,f as F,g as ce,h as S}from"./chunk-SPMLGXCE.js";import{existsSync as ve,readFileSync as Ae}from"fs";import{join as Oe}from"path";import{existsSync as w}from"fs";import{basename as Le,dirname as j,extname as R,join as E,relative as A,resolve as P}from"path";var qe=ie("indexed-paths"),H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],K=[".py",".pyi"],C=[".java",".scala",".kt",".kts"],Z=[".rs"],ee=[".rb"],pe=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],L=[".cs",".vb"],te=[".dart"],X=[".php"],Ue=[H,K,C,Z,ee,pe,L,te,X];function $(e,r){return r.includes(R(e).toLowerCase())}function We(e){return $(e,K)}function Be(e){return $(e,C)}function Xe(e){return $(e,Z)}function Je(e){return $(e,ee)}function Fe(e){return $(e,pe)}function He(e){return $(e,L)}function le(e){return R(e).toLowerCase()===".vb"}function ze(e){return $(e,te)}function Ve(e){return $(e,X)}function re(e){let r=R(e).toLowerCase();for(let t of Ue)if(t.includes(r))return t;return H}function Qe(e){return Be(e)||He(e)||Ve(e)}function O(e,r,t){return We(r)?q(e,r,t):Xe(r)?T(e,r,t):Je(r)?z(e,r,t):Fe(r)?V(e,r,t):Qe(r)?g(e,t.replace(/\\/g,"."),re(r)):ze(r)?Q(e,r,t):Ye(e,r,t)}function Ye(e,r,t){if(!t.startsWith(".")&&!t.startsWith("/"))return null;let n=j(E(e.config.projectRoot,r)),s=P(n,t),o=M(e);for(let i of tt(s)){let a=b(A(e.config.projectRoot,i));if(o.has(a)||w(i))return a}return b(A(e.config.projectRoot,s))}function q(e,r,t){let n=M(e),s;if(t.startsWith(".")){let o=t.match(/^(\.+)(.*)$/);if(!o)return null;let i=o[1].length,a=o[2].replace(/^\./,""),c=j(E(e.config.projectRoot,r));for(let p=1;p<i;p++)c=j(c);s=a?P(c,a.replace(/\./g,"/")):c}else s=P(e.config.projectRoot,t.replace(/\./g,"/"));for(let o of Ge(s)){let i=b(A(e.config.projectRoot,o));if(n.has(i)||w(o))return i}return null}function T(e,r,t){if(!t)return null;let n=t.replace(/\s+as\s+.+$/,"").trim();if(!n.startsWith("crate::")&&!n.startsWith("self::")&&!n.startsWith("super::"))return null;let s=j(E(e.config.projectRoot,r)),o;n.startsWith("crate::")?o=P(e.config.projectRoot,"src",n.slice(7).replace(/::/g,"/")):n.startsWith("self::")?o=P(s,n.slice(6).replace(/::/g,"/")):o=P(j(s),n.slice(7).replace(/::/g,"/"));for(let i of Ke(o)){let a=b(A(e.config.projectRoot,i));if(M(e).has(a)||w(i))return a}return null}function z(e,r,t){let n=j(E(e.config.projectRoot,r)),s=P(n,t);for(let o of Ze(s)){let i=b(A(e.config.projectRoot,o));if(M(e).has(i)||w(o))return i}return null}function V(e,r,t){let n=M(e),s=j(E(e.config.projectRoot,r)),o=[P(s,t),P(e.config.projectRoot,t),P(e.config.projectRoot,"include",t),P(e.config.projectRoot,"src",t)];for(let i of o){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function g(e,r,t){let n=M(e),s=r.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=s.replace(/\./g,"/"),i=s.split(".").pop()??s;for(let c of t){let p=`${o}${c}`,l=[...n].find(u=>u.endsWith(p));if(l)return l}for(let c of t){let p=[...n].find(l=>Le(l)===`${i}${c}`);if(p)return p}let a=[...n].filter(c=>t.includes(R(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${i}/`)).sort((c,p)=>c.localeCompare(p));return a.length===1?a[0]:null}function Q(e,r,t){let n=M(e);if(t.startsWith("package:")){let i=t.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),p=b(c.startsWith("lib/")?c:`lib/${c}`);return n.has(p)?p:null}let s=j(E(e.config.projectRoot,r)),o=P(s,t);for(let i of et(o)){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function Ge(e){let r=R(e);return K.includes(r)?[e]:[`${e}.py`,`${e}.pyi`,E(e,"__init__.py"),E(e,"__init__.pyi")]}function Ke(e){let r=R(e);return Z.includes(r)?[e]:[`${e}.rs`,E(e,"mod.rs")]}function Ze(e){let r=R(e);return ee.includes(r)?[e]:[`${e}.rb`,E(e,"index.rb")]}function et(e){let r=R(e);return te.includes(r)?[e]:[`${e}.dart`,e]}function tt(e){let r=R(e),t=new Set;if(r){t.add(e);for(let n of H)t.add(e.slice(0,-r.length)+n)}else for(let n of H)t.add(`${e}${n}`),t.add(E(e,`index${n}`));return[...t]}function M(e){return qe.get(e,()=>new Set(e.all(`SELECT relative_path
1
+ import{a as B,b as ie,c as ae,d as G,f as F,g as ce,h as S}from"./chunk-QRULHDMO.js";import{existsSync as ve,readFileSync as Ae}from"fs";import{join as Oe}from"path";import{existsSync as w}from"fs";import{basename as Le,dirname as j,extname as R,join as E,relative as A,resolve as P}from"path";var qe=ie("indexed-paths"),H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],K=[".py",".pyi"],C=[".java",".scala",".kt",".kts"],Z=[".rs"],ee=[".rb"],pe=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],L=[".cs",".vb"],te=[".dart"],X=[".php"],Ue=[H,K,C,Z,ee,pe,L,te,X];function $(e,r){return r.includes(R(e).toLowerCase())}function We(e){return $(e,K)}function Be(e){return $(e,C)}function Xe(e){return $(e,Z)}function Je(e){return $(e,ee)}function Fe(e){return $(e,pe)}function He(e){return $(e,L)}function le(e){return R(e).toLowerCase()===".vb"}function ze(e){return $(e,te)}function Ve(e){return $(e,X)}function re(e){let r=R(e).toLowerCase();for(let t of Ue)if(t.includes(r))return t;return H}function Qe(e){return Be(e)||He(e)||Ve(e)}function O(e,r,t){return We(r)?q(e,r,t):Xe(r)?T(e,r,t):Je(r)?z(e,r,t):Fe(r)?V(e,r,t):Qe(r)?g(e,t.replace(/\\/g,"."),re(r)):ze(r)?Q(e,r,t):Ye(e,r,t)}function Ye(e,r,t){if(!t.startsWith(".")&&!t.startsWith("/"))return null;let n=j(E(e.config.projectRoot,r)),s=P(n,t),o=M(e);for(let i of tt(s)){let a=b(A(e.config.projectRoot,i));if(o.has(a)||w(i))return a}return b(A(e.config.projectRoot,s))}function q(e,r,t){let n=M(e),s;if(t.startsWith(".")){let o=t.match(/^(\.+)(.*)$/);if(!o)return null;let i=o[1].length,a=o[2].replace(/^\./,""),c=j(E(e.config.projectRoot,r));for(let p=1;p<i;p++)c=j(c);s=a?P(c,a.replace(/\./g,"/")):c}else s=P(e.config.projectRoot,t.replace(/\./g,"/"));for(let o of Ge(s)){let i=b(A(e.config.projectRoot,o));if(n.has(i)||w(o))return i}return null}function T(e,r,t){if(!t)return null;let n=t.replace(/\s+as\s+.+$/,"").trim();if(!n.startsWith("crate::")&&!n.startsWith("self::")&&!n.startsWith("super::"))return null;let s=j(E(e.config.projectRoot,r)),o;n.startsWith("crate::")?o=P(e.config.projectRoot,"src",n.slice(7).replace(/::/g,"/")):n.startsWith("self::")?o=P(s,n.slice(6).replace(/::/g,"/")):o=P(j(s),n.slice(7).replace(/::/g,"/"));for(let i of Ke(o)){let a=b(A(e.config.projectRoot,i));if(M(e).has(a)||w(i))return a}return null}function z(e,r,t){let n=j(E(e.config.projectRoot,r)),s=P(n,t);for(let o of Ze(s)){let i=b(A(e.config.projectRoot,o));if(M(e).has(i)||w(o))return i}return null}function V(e,r,t){let n=M(e),s=j(E(e.config.projectRoot,r)),o=[P(s,t),P(e.config.projectRoot,t),P(e.config.projectRoot,"include",t),P(e.config.projectRoot,"src",t)];for(let i of o){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function g(e,r,t){let n=M(e),s=r.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=s.replace(/\./g,"/"),i=s.split(".").pop()??s;for(let c of t){let p=`${o}${c}`,l=[...n].find(u=>u.endsWith(p));if(l)return l}for(let c of t){let p=[...n].find(l=>Le(l)===`${i}${c}`);if(p)return p}let a=[...n].filter(c=>t.includes(R(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${i}/`)).sort((c,p)=>c.localeCompare(p));return a.length===1?a[0]:null}function Q(e,r,t){let n=M(e);if(t.startsWith("package:")){let i=t.slice(8),a=i.indexOf("/");if(a<0)return null;let c=i.slice(a+1),p=b(c.startsWith("lib/")?c:`lib/${c}`);return n.has(p)?p:null}let s=j(E(e.config.projectRoot,r)),o=P(s,t);for(let i of et(o)){let a=b(A(e.config.projectRoot,i));if(n.has(a)||w(i))return a}return null}function Ge(e){let r=R(e);return K.includes(r)?[e]:[`${e}.py`,`${e}.pyi`,E(e,"__init__.py"),E(e,"__init__.pyi")]}function Ke(e){let r=R(e);return Z.includes(r)?[e]:[`${e}.rs`,E(e,"mod.rs")]}function Ze(e){let r=R(e);return ee.includes(r)?[e]:[`${e}.rb`,E(e,"index.rb")]}function et(e){let r=R(e);return te.includes(r)?[e]:[`${e}.dart`,e]}function tt(e){let r=R(e),t=new Set;if(r){t.add(e);for(let n of H)t.add(e.slice(0,-r.length)+n)}else for(let n of H)t.add(`${e}${n}`),t.add(E(e,`index${n}`));return[...t]}function M(e){return qe.get(e,()=>new Set(e.all(`SELECT relative_path
2
2
  FROM documents
3
3
  WHERE 1 = 1
4
4
  ${e.pathExclusionsFor("documents")}`).map(r=>b(r.relative_path)).filter(r=>!e.isIgnored(r))))}function b(e){return e.replace(/\\/g,"/")}function me(e){return e.replace(/'''[\s\S]*?'''/g,v).replace(/"""[\s\S]*?"""/g,v).replace(/#.*$/gm,v).replace(/\/\/.*$/gm,v).replace(/\/\*[\s\S]*?\*\//g,v).replace(/`(?:\\[\s\S]|[^`])*`/g,v).replace(/'(?:\\.|[^'\\\r\n])*'/g,v).replace(/"(?:\\.|[^"\\\r\n])*"/g,v)}function v(e){return e.replace(/[^\r\n]/g," ")}var rt=ae("stripped-lines");function er(e,r,t){return rt.get(e,r,t,()=>me(t).split(`
5
5
  `))}var ue=null,ne="";function nt(e){return ue===e||(ue=e,ne=me(e)),ne}function x(e,r,t){let n=nt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function y(e,r){return new RegExp(`\\b${de(r)}\\b`,"m").test(e)}function U(e,r){let t=new Set,n=new RegExp(`\\b${de(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function de(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function I(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function _(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function h(e,r){let t=new Set,n=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]),s=(o,i)=>{let a=i||r.has(o.type);!a&&n.has(o.type)&&t.add(o.text);for(let c of o.children)s(c,a)};return s(e.rootNode,!1),t}function D(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??g(e,n,re(r)),kind:"named",used:y(t,o),usedMembers:[]}}function ge(e,r,t){let n=S(e,r);return n?st(e,r,n):at(t).flatMap(s=>ct(e,r,s.clause,s.specifier,s.start,s.end,t))}function st(e,r,t){let n=h(t,new Set(["import_statement"]));if(ce(r))for(let o of ht(e,r))n.add(o);let s=[];for(let o of t.rootNode.descendantsOfType("import_statement")){let i=ot(o);if(!i)continue;let a=O(e,r,i),c=_(o,"import_clause");if(!c){s.push({importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]});continue}for(let p of c.namedChildren)switch(p.type){case"identifier":{let l=p.text;s.push({importedName:"default",localName:l,sourcePath:a,kind:"default",used:n.has(l),usedMembers:[]});break}case"namespace_import":{let u=_(p,"identifier")?.text??"";if(!u)break;let m=it(t,u);s.push({importedName:"*",localName:u,sourcePath:a,kind:"namespace",used:m.length>0||n.has(u),usedMembers:m});break}case"named_imports":{for(let l of p.namedChildren){if(l.type!=="import_specifier")continue;let u=l.namedChild(0),m=l.namedChild(1);if(!u)continue;let d=u.text,f=m?.text??d;s.push({importedName:d,localName:f,sourcePath:a,kind:"named",used:n.has(f),usedMembers:[]})}break}}}return s}function ot(e){let r=_(e,"string");if(!r)return null;let t=_(r,"string_fragment");return t?t.text:null}function it(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function at(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function ct(e,r,t,n,s,o,i){let a=O(e,r,n),c=x(i,s,o);return t?pt(t).map(l=>({...l,sourcePath:a})).map(l=>{if(l.kind==="namespace"){let u=U(c,l.localName);return{...l,used:u.length>0||y(c,l.localName),usedMembers:u}}return l.kind==="side-effect"?{...l,used:!0,usedMembers:[]}:{...l,used:l.localName?y(c,l.localName):!1,usedMembers:[]}}):[{importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]}]}function pt(e){let r=e.trim().replace(/^type\s+/,""),[t,n]=lt(r),s=[];return t&&s.push(...fe(t)),n&&s.push(...fe(n)),s}function fe(e){let r=e.trim();if(!r)return[];if(r.startsWith("{")){let t=r.slice(1,-1).trim();return t?I(t).map(n=>{let s=n.trim().replace(/^type\s+/,""),[o,i]=s.split(/\s+as\s+/);return{importedName:o.trim(),localName:(i??o).trim(),kind:"named"}}):[]}return r.startsWith("* as ")?[{importedName:"*",localName:r.slice(5).trim(),kind:"namespace"}]:[{importedName:"default",localName:r,kind:"default"}]}function lt(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function he(e,r){let t=S(e,r);if(t)return mt(e,r,t);let n=G(e,r);if(!n)return[];let s=[],o=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(o)){if(typeof c.index!="number")continue;let p=c[1]??"",l=c[2]??"",u=I(p).map(f=>ut(f.trim())).filter(f=>!!f),m=W(n,c.index),d=W(n,c.index+c[0].length-1);s.push({kind:"named",sourcePath:O(e,r,l),names:u,startLine:m,endLine:d})}let i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(i)){if(typeof c.index!="number")continue;let p=c[2]??"",l=W(n,c.index),u=W(n,c.index+c[0].length-1);s.push({kind:"star-as",sourcePath:O(e,r,p),names:[],startLine:l,endLine:u})}let a=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let c of n.matchAll(a)){if(typeof c.index!="number")continue;let p=c[1]??"",l=W(n,c.index),u=W(n,c.index+c[0].length-1);s.push({kind:"star",sourcePath:O(e,r,p),names:[],startLine:l,endLine:u})}return s}function ut(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function W(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function mt(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=dt(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=ft(s,o,i,a);n.push(c)}return n}function dt(e,r,t){let n=_(t,"string");if(!n)return;let s=_(n,"string_fragment");if(s)return O(e,r,s.text)}function ft(e,r,t,n){let s=_(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&i.push((p??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return _(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}var gt=B("vue-non-script-identifiers");function ht(e,r){return gt.get(e,r,()=>{let t=new Set,n=G(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}import{basename as Se}from"path";function xe(e,r,t){let n=S(e,r);if(n)return St(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length),p=Se(i).replace(/\.[^.]+$/,"");s.push({importedName:i,localName:p,sourcePath:V(e,r,i),kind:"named",used:y(c,p),usedMembers:[]})}return s}function St(e,r,t){let n=h(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(l=>l.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=Se(i).replace(/\.[^.]+$/,"");s.push({importedName:i,localName:a,sourcePath:V(e,r,i),kind:"named",used:n.has(a),usedMembers:[]})}return s}function ye(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=x(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:Q(e,r,o),kind:i?"namespace":"side-effect",used:i?y(c,i):!0,usedMembers:i?U(c,i):[]})}return n}function Ne(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:Q(e,r,o)})}return n}function Ie(e,r,t){let n=S(e,r),s=F(r);if(n&&s==="csharp")return yt(e,r,n);if(n&&s==="vb")return xt(e,r,n);let o=[],i=le(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;for(let a of t.matchAll(i)){let c=a[1]?.trim(),p=a[0];if(!c||!p||typeof a.index!="number")continue;let l=x(t,a.index,a.index+p.length),[u,m]=c.split(/\s*=\s*/),d=!!m,f=(d?m:u)?.trim()??c,N=f.split(".").pop()??f,k=d?u?.trim()??N:N;o.push(D(e,r,l,f,N,k,g(e,f,L)))}return o}function xt(e,r,t){let n=h(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,p=a.text,l=p.split(".").pop()??p,u=c?.text??l;s.push({importedName:l,localName:u,sourcePath:g(e,p,L),kind:c?"namespace":"named",used:n.has(u),usedMembers:[]})}return s}function yt(e,r,t){let n=h(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c=null;if(i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1],!c)continue;let p=c.text,l=p.split(".").pop()??p,u=a?.text??l;s.push({importedName:l,localName:u,sourcePath:g(e,p,L),kind:a?"namespace":"named",used:n.has(u),usedMembers:[]})}return s}function Pe(e,r,t){let n=S(e,r),s=F(r);if(n&&s==="java")return Nt(e,r,n);if(n&&s==="kotlin")return It(e,r,n);if(n&&s==="scala")return Pt(e,r,n);let o=[];for(let i of t.matchAll(/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm)){let a=i[1]?.trim(),c=i[0];if(!a||!c||typeof i.index!="number")continue;let p=x(t,i.index,i.index+c.length);o.push(...bt(e,r,a,p))}return o}function Nt(e,r,t){let n=h(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let p=c.text;if(i){s.push({importedName:"*",localName:null,sourcePath:g(e,p,C),kind:"namespace",used:!0,usedMembers:[]});continue}let l=p.split(".").pop()??p;s.push({importedName:l,localName:l,sourcePath:g(e,p,C),kind:"named",used:n.has(l),usedMembers:[]})}return s}function It(e,r,t){let n=h(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push({importedName:"*",localName:null,sourcePath:g(e,i.text,C),kind:"namespace",used:!0,usedMembers:[]});continue}let p=i.text,l=p.split(".").pop()??p,m=c?.namedChild(0)?.text??l;s.push({importedName:l,localName:m,sourcePath:g(e,p,C),kind:"named",used:n.has(m),usedMembers:[]})}return s}function Pt(e,r,t){let n=h(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push({importedName:"*",localName:null,sourcePath:g(e,c,C),kind:"namespace",used:!0,usedMembers:[]});continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let f=m.text,N=d?.text??f;if(f==="_")continue;s.push({importedName:f,localName:N,sourcePath:g(e,`${c}.${f}`,C),kind:"named",used:n.has(N),usedMembers:[]})}else if(u.type==="identifier"){let m=u.text;s.push({importedName:m,localName:m,sourcePath:g(e,`${c}.${m}`,C),kind:"named",used:n.has(m),usedMembers:[]})}continue}let p=a[a.length-1]?.text??c,l=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push({importedName:p,localName:p,sourcePath:g(e,l&&a.length>1?`${l}.${p}`:c,C),kind:"named",used:n.has(p),usedMembers:[]})}return s}function bt(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return I(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),l=c?.trim();if(!l||l==="_")return[];let u=(p??l.split(".").pop()??l).trim(),m=l==="_"?s:`${s}.${l}`.replace(/\.\./g,".");return[D(e,r,n,m,l,u)]})}return[D(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function _e(e,r,t){let n=S(e,r);if(n)return _t(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length);for(let p of I(i)){let l=p.trim();if(!l)continue;let[u,m]=l.split(/\s+as\s+/i),d=u?.trim()??l,f=d.split("\\").pop()??d,N=(m??f).trim();s.push(D(e,r,c,d,f,N,g(e,d.replace(/\\/g,"."),X)))}}return s}function _t(e,r,t){let n=h(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push({importedName:a,localName:c,sourcePath:g(e,i.replace(/\\/g,"."),X),kind:"named",used:n.has(c),usedMembers:[]})};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:l,localName:u,qualified:m}=be(p,c);l&&o(m,l,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:l,qualified:u}=be(c,"");p&&o(u,p,l)}}return s}function be(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),n=e.namedChildren.filter(p=>p.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function De(e,r,t){let n=S(e,r);return n?Et(e,r,n):Dt(t).flatMap(s=>Tt(e,r,s,t))}function Et(e,r,t){let n=h(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=Ee(i);if(!a)continue;let c=q(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=Ct(i);if(a===null)continue;let c=q(e,r,a);for(let p=1;p<o.namedChildCount;p+=1){let l=o.namedChild(p);if(l.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=Ee(l);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function Ee(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function Ct(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=_(e,"import_prefix")?.text??"",t=_(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function Dt(e){let r=e.split(`
6
6
  `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,p=a+o.length,l=Ce(o);for(;s+1<r.length&&(l>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
7
7
  ${m}`,p+=1+m.length,l+=Ce(m),n+=m.length+1}let u=Rt(c);u&&t.push({...u,start:a,end:p})}return t}function Rt(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function Tt(e,r,t,n){let s=x(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return I(o).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[l,u]=p.split(/\s+as\s+/),m=l.trim(),d=(u??m.split(".")[0]??m).trim(),f=q(e,r,m),N=U(s,d);return[{importedName:m,localName:d,sourcePath:f,kind:"namespace",used:y(s,d)||N.length>0,usedMembers:N}]});let i=t.module?q(e,r,t.module):null,a=[];for(let c of I(o)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[l,u]=p.split(/\s+as\s+/),m=(u??l).trim();a.push({importedName:l.trim(),localName:m,sourcePath:i,kind:"named",used:y(s,m),usedMembers:[]})}return a}function Ce(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as kt}from"path";function Re(e,r,t){let n=S(e,r);if(n)return jt(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm)){let i=o[1],a=o[2],c=o[0];if(!i||!a||!c||typeof o.index!="number")continue;let p=x(t,o.index,o.index+c.length),l=i==="require_relative"?z(e,r,a):null;if(l){let u=Te(a);s.push({importedName:u,localName:u,sourcePath:l,kind:"named",used:y(p,u),usedMembers:[]});continue}s.push({importedName:a,localName:null,sourcePath:l,kind:"side-effect",used:!0,usedMembers:[]})}return s}function jt(e,r,t){let n=h(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let p=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let u=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?z(e,r,u):null;if(m){let d=Te(u);s.push({importedName:d,localName:d,sourcePath:m,kind:"named",used:n.has(d),usedMembers:[]})}else s.push({importedName:u,localName:null,sourcePath:m,kind:"side-effect",used:!0,usedMembers:[]})}return s}function Te(e){return kt(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function ke(e,r,t){let n=S(e,r);if(n)return $t(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim(),a=o[0];if(!i||!a||typeof o.index!="number")continue;let c=x(t,o.index,o.index+a.length);s.push(...vt(e,r,i,c))}return s}function $t(e,r,t){let n=h(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of J(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=T(e,r,a.qualifiedName)??T(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push({importedName:a.importedName,localName:a.localName,sourcePath:c,kind:"named",used:n.has(a.localName),usedMembers:[]})}}return s}function J(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:Y(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:Y(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=Y(r,t.text),o=[];for(let i of n.namedChildren)o.push(...J(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...J(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=J(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:Y(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function Y(e,r){return e?r?`${e}::${r}`:e:r}function vt(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let l=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return I(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[f,N]=d.split(/\s+as\s+/),k=f?.trim();if(!k)return[];let Me=(N??k.split("::").pop()??k).trim(),we=`${l}::${k}`.replace(/::::/g,"::");return[D(e,r,n,we,k.split("::").pop()??k,Me,T(e,r,l))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),p=T(e,r,a)??T(e,r,a.split("::").slice(0,-1).join("::"));return[D(e,r,n,a,a.split("::").pop()??a,c,p)]}function je(e,r,t){let n=S(e,r);if(n)return At(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Mt(e,r,i))}return s}function At(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!Ot(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of J(o,""))i.importedName&&n.push(se(e,r,i.qualifiedName))}return n}function Ot(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Mt(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return I(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[se(e,r,p)]})}return[se(e,r,n)]}function se(e,r,t){return{specifier:t,sourcePath:T(e,r,t)??T(e,r,t.split("::").slice(0,-1).join("::"))}}function $e(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var wt={language:"javascript",extensions:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],parseImports:ge},Lt={language:"python",extensions:[".py",".pyi"],parseImports:De},qt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:Pe},Ut={language:"rust",extensions:[".rs"],parseImports:ke,parseExports:je},Wt={language:"ruby",extensions:[".rb"],parseImports:Re},Bt={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:xe},Xt={language:"dotnet",extensions:[".cs",".vb"],parseImports:Ie},Jt={language:"dart",extensions:[".dart"],parseImports:ye,parseExports:Ne},Ft={language:"php",extensions:[".php"],parseImports:_e},Ht=[wt,Lt,qt,Ut,Wt,Bt,Xt,Jt,Ft];function oe(e){return $e(Ht,e)}function Sn(e,r){return he(e,r)}var zt=B("source-imports"),Vt=B("source-exports");function xn(e,r){let t=b(r);return zt.get(e,t,()=>{let n=oe(t);if(!n)return[];let s=Oe(e.config.projectRoot,t);if(!ve(s))return[];let o=Ae(s,"utf-8");return n.parseImports(e,t,o)})}function yn(e,r){let t=b(r);return Vt.get(e,t,()=>{let n=oe(t);if(!n?.parseExports)return[];let s=Oe(e.config.projectRoot,t);if(!ve(s))return[];let o=Ae(s,"utf-8");return n.parseExports(e,t,o)})}export{me as a,er as b,de as c,Sn as d,xn as e,yn as f};
8
- //# sourceMappingURL=chunk-6XP3KWHC.js.map
8
+ //# sourceMappingURL=chunk-VQXXSUQF.js.map
@@ -1,4 +1,4 @@
1
- import{i as d}from"./chunk-3FG3VLK3.js";import{q as l}from"./chunk-SPMLGXCE.js";import{b as r}from"./chunk-5IM4IQ6N.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
1
+ import{i as d}from"./chunk-ID7TO4P6.js";import{q as l}from"./chunk-QRULHDMO.js";import{b as r}from"./chunk-5IM4IQ6N.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",m=o.all(`SELECT
2
2
  gs.symbol,
3
3
  COUNT(*) AS ref_count,
4
4
  COUNT(DISTINCT ref_d.id) AS file_count,
@@ -22,4 +22,4 @@ import{i as d}from"./chunk-3FG3VLK3.js";import{q as l}from"./chunk-SPMLGXCE.js";
22
22
  GROUP BY gs.id
23
23
  ORDER BY ref_count DESC
24
24
  LIMIT ?`,s).filter(i=>!o.isIgnored(i.defined_in)).map(i=>({symbol:i.symbol,shortName:r(i.symbol),refCount:i.ref_count,fileCount:i.file_count,definedIn:i.defined_in}));return m.length>0?m:f(o,e,s)}function f(o,t,s){return l(o,{scope:t}).filter(e=>!o.isIgnored(e.relativePath)).map(e=>u(o,e)).filter(e=>e.refCount>0).sort((e,n)=>n.refCount-e.refCount||n.fileCount-e.fileCount).slice(0,s)}function u(o,t){let s=d(o,t,{limit:500});return{symbol:t.symbol,shortName:r(t.symbol),refCount:s.length,fileCount:new Set(s.map(e=>e.file)).size,definedIn:t.relativePath}}export{y as a};
25
- //# sourceMappingURL=chunk-5W22HCSF.js.map
25
+ //# sourceMappingURL=chunk-VZE4SOJG.js.map
@@ -1,6 +1,6 @@
1
- import{a as f}from"./chunk-NFOSOUH6.js";import{a as p}from"./chunk-7NEBSLI3.js";import{b as g}from"./chunk-5IM4IQ6N.js";import{readFileSync as v}from"fs";import{join as d}from"path";function _(e,u,l={}){let{context:a=0}=l,r=u.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(r)return y(e,r[1],parseInt(r[2],10),parseInt(r[3],10),a);let t=p(e,u);if(!t)return null;let n=e.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath),m=d(e.config.projectRoot,t.relativePath),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
1
+ import{a as f}from"./chunk-DX5YEUX4.js";import{a as p}from"./chunk-H4IWC7KJ.js";import{b as g}from"./chunk-5IM4IQ6N.js";import{readFileSync as v}from"fs";import{join as d}from"path";function _(e,u,l={}){let{context:a=0}=l,r=u.match(/^(.+\.\w+):(\d+)-(\d+)$/);if(r)return y(e,r[1],parseInt(r[2],10),parseInt(r[3],10),a);let t=p(e,u);if(!t)return null;let n=e.get("SELECT language FROM documents WHERE relative_path = ?",t.relativePath),m=d(e.config.projectRoot,t.relativePath),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
2
2
  `),s=Math.max(0,t.startLine-a),c=Math.min(i.length-1,t.endLine+a),h=i.slice(s,c+1).join(`
3
3
  `);return{symbol:t.symbol,shortName:g(t.symbol),relativePath:t.relativePath,startLine:s,endLine:c,language:n?.language??null,source:h}}function y(e,u,l,a,r){let t=f(e,u);if(!t)return null;let n=e.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",t);if(!n)return null;let m=d(e.config.projectRoot,n.relative_path),o;try{o=v(m,"utf-8")}catch{return null}let i=o.split(`
4
4
  `),s=Math.max(0,l-1-r),c=Math.min(i.length-1,a-1+r),h=i.slice(s,c+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${l}-${a}`,shortName:`${n.relative_path}:${l}-${a}`,relativePath:n.relative_path,startLine:s,endLine:c,language:n.language,source:h}}export{_ as a};
6
- //# sourceMappingURL=chunk-RC2PKZSS.js.map
6
+ //# sourceMappingURL=chunk-VZHI3TUX.js.map
@@ -1,2 +1,2 @@
1
- import{a as p,b as d}from"./chunk-AEMTUHQ7.js";import{g as B}from"./chunk-3FG3VLK3.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],l=new Set,a=new Set,f=[];function g(t,o){if(o>c)return;if(a.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),y=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=y.join(" -> ");b.has(S)||(b.add(S),i.push({path:y,kind:R(y)}))}return}if(l.has(t))return;l.add(t),a.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)g(h,o+1);f.pop(),a.delete(t)}let b=new Set;for(let t of n.keys())l.has(t)||g(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":d(e)||d(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let l=n[n.length-1],a=i[i.length-1];if(l&&l===a)return!0}return!1}export{w as a};
2
- //# sourceMappingURL=chunk-435YC4OF.js.map
1
+ import{a as p,b as d}from"./chunk-5KWWENJZ.js";import{g as B}from"./chunk-ID7TO4P6.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],l=new Set,a=new Set,f=[];function g(t,o){if(o>c)return;if(a.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),m=u.indexOf(u.reduce(($,x)=>$<x?$:x)),y=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=y.join(" -> ");b.has(S)||(b.add(S),i.push({path:y,kind:R(y)}))}return}if(l.has(t))return;l.add(t),a.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)g(h,o+1);f.pop(),a.delete(t)}let b=new Set;for(let t of n.keys())l.has(t)||g(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=p(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":d(e)||d(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||p(e)==="entry"||p(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let l=n[n.length-1],a=i[i.length-1];if(l&&l===a)return!0}return!1}export{w as a};
2
+ //# sourceMappingURL=chunk-YSEQFGGH.js.map
package/dist/cli.js CHANGED
@@ -137,8 +137,8 @@ Install manually from: https://github.com/sourcegraph/scip/releases`)}let c={...
137
137
  `+p)}if(d.length>0&&s(`Indexed ${u.length} of ${l.length} languages; skipped ${d.map(p=>p.language).join(", ")}.`),l.length>1&&(u.length>1?(s(`Merging ${u.length} language indexes...`),vs(u.map(p=>p.scipPath),o)):u[0].scipPath!==o&&Ws(u[0].scipPath,o)),s("Converting to SQLite..."),!Bs(o))throw new Error(`SCIP index not found at ${o} after indexing`);try{js("scip",["expt-convert","--output",a,o],{env:c,stdio:"pipe",maxBuffer:50*1024*1024})}catch(p){let f=p instanceof Error?p.message:String(p);throw new Error(`Failed to convert SCIP index to SQLite: ${f}`,{cause:p})}finally{for(let{scipPath:p}of m)p!==o&&Ja(p,{force:!0})}Be({projectRoot:n,dbPath:a,onStatus:s});let g=Date.now()-r;return s(`Done in ${(g/1e3).toFixed(1)}s`),{languages:u.map(p=>p.language),indexPath:o,dbPath:a,durationMs:g,skipped:d}}function Va(e,n,t){if(!e.defaultOutputPath)return;let s=At(n,e.defaultOutputPath);t!==s&&Bs(s)&&Ws(s,t)}function Ga(e,n,t){let s=za(e)||".scip",i=Ua(e,s);return At(qa(e),`${i}.${t+1}.${n}${s}`)}import{watch as Ya}from"fs";import{existsSync as Js,renameSync as Us}from"fs";import{join as Ka,relative as Qa}from"path";import{fork as Xa}from"child_process";import Za from"ignore";var jt=class{projectRoot;watchConfig;indexPaths;languages;pnpmWorkspaces;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitignoreFilter;extraIgnore;stopped=!1;constructor(n){this.projectRoot=n.projectRoot,this.watchConfig=ms(n.config),this.indexPaths=Ae(n.projectRoot,n.config),this.languages=n.languages,this.pnpmWorkspaces=n.config.indexer?.typescript?.pnpmWorkspaces??!1,this.onStatus=n.onStatus??(()=>{}),this.onReindexComplete=n.onReindexComplete??(()=>{}),this.onError=n.onError??(t=>console.error(t.message)),this.gitignoreFilter=Ue(n.projectRoot),this.extraIgnore=Za(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"});try{let n=Ya(this.projectRoot,{recursive:!0},(t,s)=>{s&&!this.stopped&&this.handleFileChange(s)});this.fsWatchers.push(n)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let n of this.fsWatchers)n.close();this.fsWatchers=[],this.debounceTimer&&clearTimeout(this.debounceTimer),this.cooldownTimer&&clearTimeout(this.cooldownTimer),this.setStatus({state:"idle"})}handleFileChange(n){let t=Qa(this.projectRoot,Ka(this.projectRoot,n));if(this.gitignoreFilter.isIgnored(t)||this.extraIgnore.ignores(t)||n.endsWith("index.db")||n.endsWith("index.scip")||n.endsWith("index.db.tmp")||n.endsWith(".scipquery.json"))return;if(this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.debounceTimer&&clearTimeout(this.debounceTimer);let s=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:s}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let n=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&n<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-n;this.dirty=!0;let i=Date.now()+s;this.setStatus({state:"cooldown",until:i,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let t=Date.now();this.setStatus({state:"indexing",startedAt:t}),this.runReindex().then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let i=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:i,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(){return new Promise((n,t)=>{let s=Date.now(),i=this.indexPaths.dbPath+".tmp",o=el(this.indexPaths.indexPath),a=Xa(new URL("./reindex-worker.js",import.meta.url).pathname,[],{env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:o,SCIP_REINDEX_OUTPUT_DB:i,SCIP_REINDEX_LANGUAGES:this.languages?.join(",")??"",SCIP_REINDEX_PNPM_WORKSPACES:this.pnpmWorkspaces?"1":""},stdio:"pipe"});a.on("exit",r=>{if(r===0)try{Js(i)&&Us(i,this.indexPaths.dbPath),Js(o)&&Us(o,this.indexPaths.indexPath),n(Date.now()-s)}catch(l){t(new Error(`Atomic swap failed: ${l}`))}else t(new Error(`Reindex worker exited with code ${r}`))}),a.on("error",t)})}setStatus(n){this.status=n,this.onStatus(n)}};function el(e){return e.endsWith(".scip")?e.slice(0,-5)+".tmp.scip":e+".tmp.scip"}function Bt(e){let n=e.get("SELECT COUNT(*) as c FROM documents").c,t=e.get("SELECT COUNT(*) as c FROM global_symbols").c,s=e.get("SELECT COUNT(*) as c FROM mentions WHERE role = 1").c,i=e.get("SELECT COUNT(*) as c FROM mentions WHERE role != 1").c;return{documents:n,symbols:t,definitions:s,references:i,indexSizeBytes:e.sizeBytes(),lastBuilt:e.lastModified()}}function tl(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function qs(e,n){let t=tl(n);return e.all(`SELECT relative_path FROM documents
138
138
  WHERE relative_path LIKE ?
139
139
  ORDER BY relative_path`,t).filter(i=>!e.isIgnored(i.relative_path)).map(i=>({relativePath:i.relative_path}))}import{extname as Ks}from"path";import{createRequire as al}from"module";import{existsSync as nl,readFileSync as sl}from"fs";import{join as il}from"path";var ol=W("source-text");function M(e,n){let t=n.replace(/\\/g,"/");return ol.get(e,t,()=>{let s=il(e.config.projectRoot,t);return nl(s)?sl(s,"utf-8"):""})}var rl=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale|wrapper|passthrough|drift)?/i;function pe(e,n,t){if(t<=0)return!1;let s=M(e,n);if(!s)return!1;let i=s.split(`
140
- `);for(let o=t-1;o>=0&&o>=t-5;o-=1){let a=(i[o]??"").trim();if(a!==""){if(rl.test(a))return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}var X=al(import.meta.url),Wt=null,zs=!1;function Qs(){if(zs)return null;if(Wt)return Wt;try{return Wt=X("tree-sitter"),Wt}catch{return zs=!0,null}}var ll={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},Vs=new Map,$n=new Set;function Xs(e){if($n.has(e))return null;let n=Vs.get(e);if(n)return n;let t;try{switch(e){case"rust":t=X("tree-sitter-rust");break;case"typescript":t=X("tree-sitter-typescript").typescript;break;case"tsx":t=X("tree-sitter-typescript").tsx;break;case"javascript":t=X("tree-sitter-javascript");break;case"python":t=X("tree-sitter-python");break;case"java":t=X("tree-sitter-java");break;case"kotlin":t=X("tree-sitter-kotlin");break;case"scala":t=X("tree-sitter-scala");break;case"ruby":t=X("tree-sitter-ruby");break;case"c":t=X("tree-sitter-c");break;case"cpp":t=X("tree-sitter-cpp");break;case"csharp":t=X("tree-sitter-c-sharp");break;case"php":t=X("tree-sitter-php").php;break;case"vb":{let s=X("tree-sitter-vb-dotnet");t=s.language??s;break}}}catch{return $n.add(e),null}return Vs.set(e,t),t}var Gs=new Map;function Zs(e){let n=Gs.get(e);if(n)return n;let t=Xs(e);if(!t)return null;let s=Qs();if(!s)return null;let i=new s;try{i.setLanguage(t)}catch{return $n.add(e),null}return Gs.set(e,i),i}function P(e){return ll[Ks(e).toLowerCase()]??null}function mt(e){return Ks(e).toLowerCase()===".vue"}var ei=Ot("ast-trees");function O(e,n){if(mt(n))return cl(e,n);let t=P(n);if(!t)return null;let s=M(e,n);return s?ei.get(e,n,s,()=>{let i=Zs(t);return i?i.parse(s):null}):null}function cl(e,n){let t=M(e,n);return t?ei.get(e,n,t,()=>{let s=ul(t);if(!s)return null;let i=Zs(s.language);if(!i)return null;let o=`
141
- `.repeat(s.startLine)+s.body;return i.parse(o)}):null}function ul(e){let n=[],t=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let l of e.matchAll(t))typeof l.index=="number"&&n.push({tagOpen:l[1]??"",body:l[2]??"",openIdx:l.index+(l[0].length-(l[2]?.length??0)-9)});if(n.length===0)return null;let s=n.find(l=>/\bsetup\b/.test(l.tagOpen))??n[0],o=s.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),a=o==="ts"||o==="typescript"?"typescript":o==="tsx"?"tsx":"javascript",r=ml(e,s.openIdx);return{body:s.body,startLine:r,language:a}}function ml(e,n){let t=0;for(let s=0;s<n&&s<e.length;s++)e.charCodeAt(s)===10&&t++;return t}var ct=new Map;function dl(e,n){let t=`${e}::${n}`;if(ct.has(t))return ct.get(t)??null;let s=Xs(e);if(!s)return ct.set(t,null),null;let i=Qs();if(!i)return ct.set(t,null),null;let o=null;try{o=new i.Query(s,n)}catch{o=null}return ct.set(t,o),o}var pl={rust:`
140
+ `);for(let o=t-1;o>=0&&o>=t-5;o-=1){let a=(i[o]??"").trim();if(a!==""){if(rl.test(a))return!0;if(!a.startsWith("//")&&!a.startsWith("*")&&!a.startsWith("/*")&&!a.startsWith("@")&&!a.startsWith("#"))return!1}}return!1}var X=al(import.meta.url),Wt=null,zs=!1;function Qs(){if(zs)return null;if(Wt)return Wt;try{return Wt=X("tree-sitter"),Wt}catch{return zs=!0,null}}var ll={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"},Vs=new Map,$n=new Set;function Xs(e){if($n.has(e))return null;let n=Vs.get(e);if(n)return n;let t;try{switch(e){case"rust":t=X("tree-sitter-rust");break;case"typescript":t=X("tree-sitter-typescript").typescript;break;case"tsx":t=X("tree-sitter-typescript").tsx;break;case"javascript":t=X("tree-sitter-javascript");break;case"python":t=X("tree-sitter-python");break;case"java":t=X("tree-sitter-java");break;case"kotlin":t=X("tree-sitter-kotlin");break;case"scala":t=X("tree-sitter-scala");break;case"ruby":t=X("tree-sitter-ruby");break;case"c":t=X("tree-sitter-c");break;case"cpp":t=X("tree-sitter-cpp");break;case"csharp":t=X("tree-sitter-c-sharp");break;case"php":t=X("tree-sitter-php").php;break;case"vb":{let s=X("tree-sitter-vb-dotnet");t=s.language??s;break}}}catch{return $n.add(e),null}return Vs.set(e,t),t}var Gs=new Map;function Zs(e){let n=Gs.get(e);if(n)return n;let t=Xs(e);if(!t)return null;let s=Qs();if(!s)return null;let i=new s;try{i.setLanguage(t)}catch{return $n.add(e),null}return Gs.set(e,i),i}function P(e){return ll[Ks(e).toLowerCase()]??null}function mt(e){return Ks(e).toLowerCase()===".vue"}var ei=Ot("ast-trees");function O(e,n){if(mt(n))return cl(e,n);let t=P(n);if(!t)return null;let s=M(e,n);return s?ei.get(e,n,s,()=>{let i=Zs(t);if(!i)return null;try{return i.parse(s)}catch{return null}}):null}function cl(e,n){let t=M(e,n);return t?ei.get(e,n,t,()=>{let s=ul(t);if(!s)return null;let i=Zs(s.language);if(!i)return null;let o=`
141
+ `.repeat(s.startLine)+s.body;try{return i.parse(o)}catch{return null}}):null}function ul(e){let n=[],t=/<script\b([^>]*)>([\s\S]*?)<\/script>/g;for(let l of e.matchAll(t))typeof l.index=="number"&&n.push({tagOpen:l[1]??"",body:l[2]??"",openIdx:l.index+(l[0].length-(l[2]?.length??0)-9)});if(n.length===0)return null;let s=n.find(l=>/\bsetup\b/.test(l.tagOpen))??n[0],o=s.tagOpen.match(/\blang\s*=\s*["']?([\w-]+)/)?.[1]?.toLowerCase(),a=o==="ts"||o==="typescript"?"typescript":o==="tsx"?"tsx":"javascript",r=ml(e,s.openIdx);return{body:s.body,startLine:r,language:a}}function ml(e,n){let t=0;for(let s=0;s<n&&s<e.length;s++)e.charCodeAt(s)===10&&t++;return t}var ct=new Map;function dl(e,n){let t=`${e}::${n}`;if(ct.has(t))return ct.get(t)??null;let s=Xs(e);if(!s)return ct.set(t,null),null;let i=Qs();if(!i)return ct.set(t,null),null;let o=null;try{o=new i.Query(s,n)}catch{o=null}return ct.set(t,o),o}var pl={rust:`
142
142
  (function_item name: (identifier) @name) @def
143
143
  (function_signature_item name: (identifier) @name) @def
144
144
  `,typescript:`
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import"./chunk-FVH3Y44U.js";import{a as zn}from"./chunk-HS65NNKP.js";import{a as Wn}from"./chunk-ZORIMKQO.js";import{a as qn}from"./chunk-3QJ2NOYG.js";import{a as Un}from"./chunk-HS5LX75F.js";import{a as Vn}from"./chunk-7DKDFRXQ.js";import{a as xr}from"./chunk-AVLUWGXG.js";import{a as yr}from"./chunk-NLWXQMKR.js";import{a as Fr}from"./chunk-TXADWK4I.js";import{a as Dr}from"./chunk-3T53QAUS.js";import{a as Kn,b as Qn,c as Yn}from"./chunk-3J463LOK.js";import{a as er}from"./chunk-CHW7433E.js";import{a as Bn}from"./chunk-MQ5FKM2F.js";import{a as Zn}from"./chunk-OU2D2T4A.js";import{a as Tr}from"./chunk-ORD3HEWI.js";import{a as Ir}from"./chunk-P6IUCZA3.js";import{a as tr,b as nr,c as rr,d as ir}from"./chunk-T26XHATT.js";import{a as Mn}from"./chunk-KYT47WU2.js";import{a as Pr}from"./chunk-ZJM2HD2Z.js";import{a as kr}from"./chunk-YRUHPGC3.js";import{a as fr,b as hr}from"./chunk-4LBOHXT7.js";import"./chunk-LORWXBOO.js";import{a as Er}from"./chunk-5V76WMMZ.js";import{a as $n}from"./chunk-N3Z2SJCR.js";import{a as cr}from"./chunk-AZQ3ENHU.js";import{a as Cr}from"./chunk-TWYHFB5K.js";import{a as wr}from"./chunk-FPDWFGBQ.js";import{a as br}from"./chunk-G2SX5EHW.js";import{a as dr}from"./chunk-GK6VXKLY.js";import{a as Xn}from"./chunk-5W22HCSF.js";import{a as _r}from"./chunk-5NRGSXZQ.js";import{a as Lr}from"./chunk-5VU2RVKI.js";import{a as sr,b as or}from"./chunk-AZTWY4OT.js";import{a as ar}from"./chunk-435YC4OF.js";import{a as Nr}from"./chunk-2HEJQBMS.js";import{a as Jn}from"./chunk-CW5K3KIF.js";import"./chunk-QSTMORTI.js";import{a as pr}from"./chunk-67UXTIFZ.js";import{a as Hn,b as Gn}from"./chunk-LKCPNPHH.js";import{a as Sr}from"./chunk-FJV7QT4G.js";import{a as lr}from"./chunk-6CTMG3IF.js";import{a as ur,b as gr}from"./chunk-6ALIV5SZ.js";import{a as mr}from"./chunk-26LSAIEP.js";import{a as vr}from"./chunk-PU7P5NPE.js";import{a as jr}from"./chunk-RC2PKZSS.js";import"./chunk-NFOSOUH6.js";import{a as Rr}from"./chunk-S65VVU3R.js";import"./chunk-AEMTUHQ7.js";import{a as ae,b as le}from"./chunk-F6F2QUIH.js";import"./chunk-3FG3VLK3.js";import"./chunk-6XP3KWHC.js";import"./chunk-7NEBSLI3.js";import"./chunk-SPMLGXCE.js";import{a as He,b as Ge,c as qe}from"./chunk-5IM4IQ6N.js";import ze from"better-sqlite3";import{statSync as ce}from"fs";var U=class{db;config;pathFilter;constructor(t,r){this.config=t,this.pathFilter=r??null,this.db=new ze(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
1
+ import"./chunk-FVH3Y44U.js";import{a as zn}from"./chunk-EJXPKSWV.js";import{a as Wn}from"./chunk-5OV6CUTY.js";import{a as qn}from"./chunk-6TRXTRCW.js";import{a as Un}from"./chunk-H7BWAMFI.js";import{a as Vn}from"./chunk-KOGVTPGE.js";import{a as xr}from"./chunk-VKYLXCV6.js";import{a as yr}from"./chunk-DM56ECPZ.js";import{a as Fr}from"./chunk-RKZBRDFK.js";import{a as Dr}from"./chunk-RPRIZ43D.js";import{a as Kn,b as Qn,c as Yn}from"./chunk-MDUIJELV.js";import{a as er}from"./chunk-EUHHVFTI.js";import{a as Bn}from"./chunk-GSVIC6KN.js";import{a as Zn}from"./chunk-UDKLKBPQ.js";import{a as Tr}from"./chunk-RAJHIEBM.js";import{a as Ir}from"./chunk-P6IUCZA3.js";import{a as tr,b as nr,c as rr,d as ir}from"./chunk-MMKNCPHB.js";import{a as Mn}from"./chunk-KYT47WU2.js";import{a as Pr}from"./chunk-LUYN4IWJ.js";import{a as kr}from"./chunk-NB3GIT4Z.js";import{a as fr,b as hr}from"./chunk-J22I2FWD.js";import"./chunk-LORWXBOO.js";import{a as Er}from"./chunk-HUEIPY4M.js";import{a as $n}from"./chunk-N3Z2SJCR.js";import{a as cr}from"./chunk-MSNW2AR2.js";import{a as Cr}from"./chunk-ORBQ3HJD.js";import{a as wr}from"./chunk-DXXROCSQ.js";import{a as br}from"./chunk-TVJMEDHH.js";import{a as dr}from"./chunk-HLILTI7S.js";import{a as Xn}from"./chunk-VZE4SOJG.js";import{a as _r}from"./chunk-C6PQLWHR.js";import{a as Lr}from"./chunk-S6IGA6KK.js";import{a as sr,b as or}from"./chunk-CH47OLNL.js";import{a as ar}from"./chunk-YSEQFGGH.js";import{a as Nr}from"./chunk-TRBNQ273.js";import{a as Jn}from"./chunk-EARGTC7U.js";import"./chunk-F2TGKDMW.js";import{a as pr}from"./chunk-IUNRL2AQ.js";import{a as Hn,b as Gn}from"./chunk-TPOYTT6O.js";import{a as Sr}from"./chunk-RXGCTLHY.js";import{a as lr}from"./chunk-2OXZVIED.js";import{a as ur,b as gr}from"./chunk-UGUBEKK5.js";import{a as mr}from"./chunk-OBPP5RRE.js";import{a as vr}from"./chunk-6QXYWGE5.js";import{a as jr}from"./chunk-VZHI3TUX.js";import"./chunk-DX5YEUX4.js";import{a as Rr}from"./chunk-Q2MCCKWZ.js";import"./chunk-5KWWENJZ.js";import{a as ae,b as le}from"./chunk-56LPZC3S.js";import"./chunk-ID7TO4P6.js";import"./chunk-VQXXSUQF.js";import"./chunk-H4IWC7KJ.js";import"./chunk-QRULHDMO.js";import{a as He,b as Ge,c as qe}from"./chunk-5IM4IQ6N.js";import ze from"better-sqlite3";import{statSync as ce}from"fs";var U=class{db;config;pathFilter;constructor(t,r){this.config=t,this.pathFilter=r??null,this.db=new ze(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
2
2
  EXISTS (
3
3
  SELECT 1
4
4
  FROM defn_enclosing_ranges local_der
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-FJV7QT4G.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as affected};
1
+ import{a}from"../chunk-RXGCTLHY.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as affected};
2
2
  //# sourceMappingURL=affected.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-6CTMG3IF.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as bottlenecks};
1
+ import{a}from"../chunk-2OXZVIED.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as bottlenecks};
2
2
  //# sourceMappingURL=bottlenecks.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"../chunk-6ALIV5SZ.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as byKind,b as kindCounts};
1
+ import{a,b}from"../chunk-UGUBEKK5.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as byKind,b as kindCounts};
2
2
  //# sourceMappingURL=by-kind.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-26LSAIEP.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as callGraph};
1
+ import{a}from"../chunk-OBPP5RRE.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as callGraph};
2
2
  //# sourceMappingURL=call-graph.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-PU7P5NPE.js";import"../chunk-NFOSOUH6.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as changeSurface};
1
+ import{a}from"../chunk-6QXYWGE5.js";import"../chunk-DX5YEUX4.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as changeSurface};
2
2
  //# sourceMappingURL=change-surface.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-RC2PKZSS.js";import"../chunk-NFOSOUH6.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as code};
1
+ import{a}from"../chunk-VZHI3TUX.js";import"../chunk-DX5YEUX4.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as code};
2
2
  //# sourceMappingURL=code.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-S65VVU3R.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as complexityHotspots};
1
+ import{a}from"../chunk-Q2MCCKWZ.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as complexityHotspots};
2
2
  //# sourceMappingURL=complexity-hotspots.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-5NRGSXZQ.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as complexity};
1
+ import{a}from"../chunk-C6PQLWHR.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as complexity};
2
2
  //# sourceMappingURL=complexity.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-5VU2RVKI.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as convergence};
1
+ import{a}from"../chunk-S6IGA6KK.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as convergence};
2
2
  //# sourceMappingURL=convergence.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"../chunk-AZTWY4OT.js";import"../chunk-NFOSOUH6.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as coupling,b as topCoupling};
1
+ import{a,b}from"../chunk-CH47OLNL.js";import"../chunk-DX5YEUX4.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as coupling,b as topCoupling};
2
2
  //# sourceMappingURL=coupling.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-435YC4OF.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as cycles};
1
+ import{a}from"../chunk-YSEQFGGH.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as cycles};
2
2
  //# sourceMappingURL=cycles.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-2HEJQBMS.js";import"../chunk-QSTMORTI.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as dataflow};
1
+ import{a}from"../chunk-TRBNQ273.js";import"../chunk-F2TGKDMW.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as dataflow};
2
2
  //# sourceMappingURL=dataflow.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-CW5K3KIF.js";import"../chunk-QSTMORTI.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as dead};
1
+ import{a}from"../chunk-EARGTC7U.js";import"../chunk-F2TGKDMW.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as dead};
2
2
  //# sourceMappingURL=dead.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-67UXTIFZ.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as deepChains};
1
+ import{a}from"../chunk-IUNRL2AQ.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as deepChains};
2
2
  //# sourceMappingURL=deep-chains.js.map
@@ -1,2 +1,2 @@
1
- import{a,b}from"../chunk-LKCPNPHH.js";import"../chunk-NFOSOUH6.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as deps,b as rdeps};
1
+ import{a,b}from"../chunk-TPOYTT6O.js";import"../chunk-DX5YEUX4.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as deps,b as rdeps};
2
2
  //# sourceMappingURL=deps.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-FPDWFGBQ.js";import"../chunk-QSTMORTI.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as drift};
1
+ import{a}from"../chunk-DXXROCSQ.js";import"../chunk-F2TGKDMW.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as drift};
2
2
  //# sourceMappingURL=drift.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-G2SX5EHW.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as extractCandidates};
1
+ import{a}from"../chunk-TVJMEDHH.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as extractCandidates};
2
2
  //# sourceMappingURL=extract-candidates.js.map
@@ -1,2 +1,2 @@
1
- import{a,b,c,d}from"../chunk-T26XHATT.js";import"../chunk-NFOSOUH6.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as fanIn,b as fanOut,c as topFanIn,d as topFanOut};
1
+ import{a,b,c,d}from"../chunk-MMKNCPHB.js";import"../chunk-DX5YEUX4.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as fanIn,b as fanOut,c as topFanIn,d as topFanOut};
2
2
  //# sourceMappingURL=fan.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-ZJM2HD2Z.js";import"../chunk-YRUHPGC3.js";import"../chunk-4LBOHXT7.js";import"../chunk-LORWXBOO.js";import"../chunk-5V76WMMZ.js";import"../chunk-N3Z2SJCR.js";import"../chunk-AZQ3ENHU.js";import"../chunk-TWYHFB5K.js";import"../chunk-FPDWFGBQ.js";import"../chunk-G2SX5EHW.js";import"../chunk-435YC4OF.js";import"../chunk-CW5K3KIF.js";import"../chunk-QSTMORTI.js";import"../chunk-S65VVU3R.js";import"../chunk-AEMTUHQ7.js";import"../chunk-F6F2QUIH.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as health};
1
+ import{a}from"../chunk-LUYN4IWJ.js";import"../chunk-NB3GIT4Z.js";import"../chunk-J22I2FWD.js";import"../chunk-LORWXBOO.js";import"../chunk-HUEIPY4M.js";import"../chunk-N3Z2SJCR.js";import"../chunk-MSNW2AR2.js";import"../chunk-ORBQ3HJD.js";import"../chunk-DXXROCSQ.js";import"../chunk-TVJMEDHH.js";import"../chunk-YSEQFGGH.js";import"../chunk-EARGTC7U.js";import"../chunk-F2TGKDMW.js";import"../chunk-Q2MCCKWZ.js";import"../chunk-5KWWENJZ.js";import"../chunk-56LPZC3S.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as health};
2
2
  //# sourceMappingURL=health.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-GK6VXKLY.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as hierarchy};
1
+ import{a}from"../chunk-HLILTI7S.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as hierarchy};
2
2
  //# sourceMappingURL=hierarchy.js.map
@@ -1,2 +1,2 @@
1
- import{a}from"../chunk-5W22HCSF.js";import"../chunk-3FG3VLK3.js";import"../chunk-6XP3KWHC.js";import"../chunk-7NEBSLI3.js";import"../chunk-SPMLGXCE.js";import"../chunk-5IM4IQ6N.js";export{a as hotspots};
1
+ import{a}from"../chunk-VZE4SOJG.js";import"../chunk-ID7TO4P6.js";import"../chunk-VQXXSUQF.js";import"../chunk-H4IWC7KJ.js";import"../chunk-QRULHDMO.js";import"../chunk-5IM4IQ6N.js";export{a as hotspots};
2
2
  //# sourceMappingURL=hotspots.js.map