scip-query 0.6.5 → 0.6.6

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 (87) hide show
  1. package/README.md +43 -6
  2. package/dist/augment-vue-worker.js +1 -1
  3. package/dist/{chunk-FG6A6ZUP.js → chunk-25HOGELX.js} +2 -2
  4. package/dist/{chunk-XV3XUZ3X.js → chunk-2TLYCK2L.js} +2 -2
  5. package/dist/chunk-3PVIYZ74.js +84 -0
  6. package/dist/{chunk-MO32JMOD.js → chunk-4TX5IMMK.js} +2 -2
  7. package/dist/{chunk-3UB2DPLP.js → chunk-6DVA22YE.js} +2 -2
  8. package/dist/{chunk-C5BFS23M.js → chunk-6GPFHZP3.js} +2 -2
  9. package/dist/{chunk-YDKWDTAW.js → chunk-7PRMSA4Z.js} +2 -2
  10. package/dist/{chunk-MTK3JAJT.js → chunk-7YI2M2AQ.js} +2 -2
  11. package/dist/{chunk-M5QTG55L.js → chunk-AADJ7MCQ.js} +2 -2
  12. package/dist/{chunk-A5UNS4DR.js → chunk-AV7BOODV.js} +2 -2
  13. package/dist/{chunk-PBFMZKXE.js → chunk-AXP4H62Q.js} +2 -2
  14. package/dist/{chunk-IJWIYZO5.js → chunk-C4C3T4K3.js} +2 -2
  15. package/dist/{chunk-ZFCQQ4B5.js → chunk-CSRPJCWO.js} +2 -2
  16. package/dist/{chunk-U5MVUPOO.js → chunk-CYJMOTIH.js} +2 -2
  17. package/dist/{chunk-URUVLDM7.js → chunk-DLWRLPKO.js} +2 -2
  18. package/dist/{chunk-5YYMKE3G.js → chunk-E2V5SE6M.js} +2 -2
  19. package/dist/{chunk-FHSD5RKF.js → chunk-GPY33RTH.js} +2 -2
  20. package/dist/{chunk-PFMGJ4BR.js → chunk-HVNVO6UW.js} +2 -2
  21. package/dist/{chunk-BNCTPTVX.js → chunk-I377UMS2.js} +2 -2
  22. package/dist/{chunk-F4KR22Z2.js → chunk-IKQYNTW3.js} +2 -2
  23. package/dist/{chunk-RT5PV5JQ.js → chunk-IZ4KV37N.js} +2 -2
  24. package/dist/{chunk-DRLWW74T.js → chunk-KBGFYKOJ.js} +2 -2
  25. package/dist/chunk-KW2F3WSV.js +5 -0
  26. package/dist/{chunk-FVVEIGP3.js → chunk-NIN762LD.js} +2 -2
  27. package/dist/{chunk-YDNCX5PF.js → chunk-O6VBAW7P.js} +2 -2
  28. package/dist/{chunk-EB5IVUNU.js → chunk-PIRXZGV6.js} +2 -2
  29. package/dist/{chunk-MKFH7QJG.js → chunk-Q4R2IYA3.js} +2 -2
  30. package/dist/{chunk-Z5CTXSWT.js → chunk-QFBJZHMV.js} +2 -2
  31. package/dist/{chunk-WHGCGENP.js → chunk-QPJG6VRT.js} +2 -2
  32. package/dist/{chunk-HUASU3AD.js → chunk-TBJDUS4E.js} +7 -7
  33. package/dist/{chunk-K6H3XJQW.js → chunk-TUV2VI7D.js} +2 -2
  34. package/dist/chunk-UAPNU7UP.js +2 -0
  35. package/dist/{chunk-WNMAH3P7.js → chunk-URCJTFOD.js} +2 -2
  36. package/dist/{chunk-QFCK6WV2.js → chunk-UUIWMLDX.js} +2 -2
  37. package/dist/{chunk-WIIZF5FP.js → chunk-VEXS3I3N.js} +2 -2
  38. package/dist/{chunk-ROWAEEOD.js → chunk-VRC3WKKE.js} +2 -2
  39. package/dist/{chunk-5LQ6CVX3.js → chunk-WFDTS7XL.js} +2 -2
  40. package/dist/chunk-Y4DS3MDC.js +5 -0
  41. package/dist/{chunk-LT2CPEQ4.js → chunk-YJODB2F5.js} +2 -2
  42. package/dist/{chunk-PK4U6NWP.js → chunk-YXMHTJYY.js} +2 -2
  43. package/dist/chunk-Z4AMQWVY.js +90 -0
  44. package/dist/cli.js +111 -111
  45. package/dist/index.d.ts +8 -5
  46. package/dist/index.js +11 -11
  47. package/dist/queries/affected.js +1 -1
  48. package/dist/queries/bottlenecks.js +1 -1
  49. package/dist/queries/call-graph.js +1 -1
  50. package/dist/queries/change-surface.js +1 -1
  51. package/dist/queries/complexity-hotspots.js +1 -1
  52. package/dist/queries/complexity.js +1 -1
  53. package/dist/queries/convergence.js +1 -1
  54. package/dist/queries/cycles.js +1 -1
  55. package/dist/queries/dataflow.js +1 -1
  56. package/dist/queries/dead.js +1 -1
  57. package/dist/queries/deep-chains.js +1 -1
  58. package/dist/queries/diff-impact.js +1 -1
  59. package/dist/queries/drift.js +1 -1
  60. package/dist/queries/extract-candidates.js +1 -1
  61. package/dist/queries/fan.js +1 -1
  62. package/dist/queries/health.js +1 -1
  63. package/dist/queries/hotspots.js +1 -1
  64. package/dist/queries/imports.js +1 -1
  65. package/dist/queries/index.js +1 -1
  66. package/dist/queries/isolated.js +1 -1
  67. package/dist/queries/members.js +1 -1
  68. package/dist/queries/methods.js +1 -1
  69. package/dist/queries/passthrough-candidates.js +1 -1
  70. package/dist/queries/redundant-reexports.js +1 -1
  71. package/dist/queries/refs.js +1 -1
  72. package/dist/queries/similar-chains.js +1 -1
  73. package/dist/queries/similar-files.js +1 -1
  74. package/dist/queries/similar-signatures.js +1 -1
  75. package/dist/queries/similar.js +1 -1
  76. package/dist/queries/slice.js +1 -1
  77. package/dist/queries/stale-abstractions.js +1 -1
  78. package/dist/queries/surface.js +1 -1
  79. package/dist/queries/trace.js +1 -1
  80. package/dist/queries/wrapper-candidates.js +1 -1
  81. package/dist/reindex-worker.js +1 -1
  82. package/package.json +2 -2
  83. package/dist/chunk-2ZGHRI2A.js +0 -5
  84. package/dist/chunk-32R4VYYA.js +0 -2
  85. package/dist/chunk-4X7C236P.js +0 -84
  86. package/dist/chunk-KTCODJNQ.js +0 -5
  87. package/dist/chunk-YU25IHJX.js +0 -90
@@ -0,0 +1,5 @@
1
+ import{a as b,b as w,c as q,d as X,e as Z,f as T,g as O,h as _,i as U,j as B,k as h,l as W,m as J}from"./chunk-Z4AMQWVY.js";import{a as $,c as H,d as k,f as j,g as Q,h as g}from"./chunk-QFZE73XF.js";function Y(e){return e.replace(/'''[\s\S]*?'''/g,C).replace(/"""[\s\S]*?"""/g,C).replace(/#.*$/gm,C).replace(/\/\/.*$/gm,C).replace(/\/\*[\s\S]*?\*\//g,C).replace(/`(?:\\[\s\S]|[^`])*`/g,C).replace(/'(?:\\.|[^'\\\r\n])*'/g,C).replace(/"(?:\\.|[^"\\\r\n])*"/g,C)}function C(e){return e.replace(/[^\r\n]/g," ")}var Ie=H("stripped-lines");function Dt(e,r,t){return Ie.get(e,r,t,()=>Y(t).split(`
2
+ `))}var K=null,z="";function Pe(e){return K===e||(K=e,z=Y(e)),z}function E(e,r,t){let s=Pe(e);return`${s.slice(0,r)}${" ".repeat(t-r)}${s.slice(t)}`}function S(e,r){return new RegExp(`\\b${G(r)}\\b`,"m").test(e)}function A(e,r){let t=new Set,s=new RegExp(`\\b${G(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let n of e.matchAll(s)){let i=n[1];i&&t.add(i)}return[...t]}function G(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var be=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function x(e){let r=[],t=0,s=0;for(let n=0;n<e.length;n++){let i=e[n];(i==="{"||i==="["||i==="(")&&t++,(i==="}"||i==="]"||i===")")&&t--,i===","&&t===0&&(r.push(e.slice(s,n)),s=n+1)}return r.push(e.slice(s)),r}function y(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function f(e,r){let t=new Set,s=(n,i)=>{let o=i||r.has(n.type);!o&&be.has(n.type)&&t.add(n.text);for(let a of n.children)s(a,o)};return s(e.rootNode,!1),t}function P(e,r,t,s,n,i,o){return{importedName:n,localName:i,sourcePath:o??h(e,s,Z(r)),kind:"named",used:S(t,i),usedMembers:[]}}function N(e,r,t){let s=[];for(let n of e.matchAll(r)){let i=n[0];if(!i||typeof n.index!="number")continue;let o=E(e,n.index,n.index+i.length);for(let a of t(n,o))s.push(a)}return s}function te(e,r,t){let s=g(e,r);return s?_e(e,r,s):je(t).flatMap(n=>we(e,r,n.clause,n.specifier,n.start,n.end,t))}function _e(e,r,t){let s=Ce(e,r,t),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))n.push(...Ee(e,r,t,i,s));return n}function Ce(e,r,t){let s=f(t,new Set(["import_statement"]));if(Q(r))for(let n of Xe(e,r))s.add(n);return s}function Ee(e,r,t,s,n){let i=Me(s);if(!i)return[];let o=T(e,r,i),a=y(s,"import_clause");return a?Re(t,a,o,n,$e(s.text)):[Te(o)]}function Re(e,r,t,s,n){let i=[];for(let o of r.namedChildren)if(o.type==="identifier")i.push(De(o.text,t,s,n));else if(o.type==="namespace_import"){let a=ke(e,o,t,s,n);a&&i.push(a)}else o.type==="named_imports"&&i.push(...Ae(o,t,s,n));return i}function Te(e){return{importedName:"*",localName:null,sourcePath:e,kind:"side-effect",used:!0,usedMembers:[]}}function De(e,r,t,s){return{importedName:"default",localName:e,sourcePath:r,kind:"default",used:t.has(e),usedMembers:[],isTypeOnly:s}}function ke(e,r,t,s,n){let o=y(r,"identifier")?.text??"";if(!o)return null;let a=Le(e,o);return{importedName:"*",localName:o,sourcePath:t,kind:"namespace",used:a.length>0||s.has(o),usedMembers:a,isTypeOnly:n}}function Ae(e,r,t,s){let n=[];for(let i of e.namedChildren){if(i.type!=="import_specifier")continue;let o=i.namedChild(0),a=i.namedChild(1);if(!o)continue;let c=o.text,p=a?.text??c;n.push({importedName:c,localName:p,sourcePath:r,kind:"named",used:t.has(p),usedMembers:[],isTypeOnly:s||Oe(i.text)})}return n}function Me(e){let r=y(e,"string");if(!r)return null;let t=y(r,"string_fragment");return t?t.text:null}function $e(e){return/^\s*import\s+type\b/.test(e)}function Oe(e){return/^\s*type\b/.test(e.trim())}function Le(e,r){let t=new Set;for(let s of e.rootNode.descendantsOfType("member_expression")){let n=s.namedChild(0),i=s.namedChild(1);!n||!i||n.type!=="identifier"||n.text!==r||(i.type==="property_identifier"||i.type==="identifier")&&t.add(i.text)}return[...t]}function je(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(t)){let i=n[0],o=n[1],a=n[2];!i||!a||typeof n.index!="number"||r.push({clause:o,specifier:a,start:n.index,end:n.index+i.length})}let s=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let n of e.matchAll(s)){let i=n[0],o=n[1];!i||!o||typeof n.index!="number"||r.push({clause:null,specifier:o,start:n.index,end:n.index+i.length})}return r.sort((n,i)=>n.start-i.start)}function we(e,r,t,s,n,i,o){let a=T(e,r,s),c=E(o,n,i);return t?ve(t).map(u=>({...u,sourcePath:a})).map(u=>{if(u.kind==="namespace"){let m=A(c,u.localName);return{...u,used:m.length>0||S(c,u.localName),usedMembers:m}}return u.kind==="side-effect"?{...u,used:!0,usedMembers:[]}:{...u,used:u.localName?S(c,u.localName):!1,usedMembers:[]}}):[{importedName:"*",localName:null,sourcePath:a,kind:"side-effect",used:!0,usedMembers:[]}]}function ve(e){let r=e.trim(),t=/^type\b/.test(r),s=r.replace(/^type\s+/,""),[n,i]=qe(s),o=[];return n&&o.push(...ee(n,t)),i&&o.push(...ee(i,t)),o}function ee(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let s=t.slice(1,-1).trim();return s?x(s).map(n=>{let i=n.trim(),o=r||/^type\b/.test(i),a=i.replace(/^type\s+/,""),[c,p]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(p??c).trim(),kind:"named",isTypeOnly:o}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function qe(e){let r=0;for(let t=0;t<e.length;t++){let s=e[t];if(s==="{"&&r++,s==="}"&&r--,s===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function re(e,r){let t=g(e,r);if(t)return Fe(e,r,t);let s=k(e,r);return s?Ue(e,r,s):[]}function Ue(e,r,t){return[...Be(e,r,t),...We(e,r,t),...Je(e,r,t)]}function Be(e,r,t){let s=[],n=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=i[2]??"",c=x(o).map(m=>ze(m.trim())).filter(m=>!!m),p=M(t,i.index),u=M(t,i.index+i[0].length-1);s.push({kind:"named",sourcePath:T(e,r,a),names:c,startLine:p,endLine:u})}return s}function We(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[2]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star-as",sourcePath:T(e,r,o),names:[],startLine:a,endLine:c})}return s}function Je(e,r,t){let s=[],n=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of t.matchAll(n)){if(typeof i.index!="number")continue;let o=i[1]??"",a=M(t,i.index),c=M(t,i.index+i[0].length-1);s.push({kind:"star",sourcePath:T(e,r,o),names:[],startLine:a,endLine:c})}return s}function ze(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 s=r.match(/^(\w+)$/);return s?s[1]??null:null}function M(e,r){let t=0;for(let s=0;s<r&&s<e.length;s++)e.charCodeAt(s)===10&&t++;return t}function Fe(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("export_statement")){let i=Ve(e,r,n);if(i===void 0)continue;let o=n.startPosition.row,a=n.endPosition.row,c=He(n,i,o,a);s.push(c)}return s}function Ve(e,r,t){let s=y(t,"string");if(!s)return;let n=y(s,"string_fragment");if(n)return T(e,r,n.text)}function He(e,r,t,s){let n=y(e,"export_clause");if(n){let o=[];for(let a of n.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),p=a.namedChild(1);c&&o.push((p??c).text)}return{kind:"named",sourcePath:r,names:o,startLine:t,endLine:s}}return y(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:s}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:s}}var Qe=$("vue-non-script-identifiers");function Xe(e,r){return Qe.get(e,r,()=>{let t=new Set,s=k(e,r);if(!s)return t;let i=s.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,o=>o.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,o=>o.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,o=>o.replace(/[^\r\n]/g," "));for(let o of i.matchAll(/[A-Za-z_$][\w$]*/g))t.add(o[0]);return t})}import{basename as se}from"path";function ne(e,r,t){let s=g(e,r);return s?Ze(e,r,s):N(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,i)=>{let o=n[1]?.trim();if(!o)return[];let a=se(o).replace(/\.[^.]+$/,"");return[{importedName:o,localName:a,sourcePath:B(e,r,o),kind:"named",used:S(i,a),usedMembers:[]}]})}function Ze(e,r,t){let s=f(t,new Set(["preproc_include"])),n=[];for(let i of t.rootNode.descendantsOfType("preproc_include")){let o=null;for(let c of i.namedChildren){if(c.type==="system_lib_string"){o=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){o=c.namedChildren.find(u=>u.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!o)continue;let a=se(o).replace(/\.[^.]+$/,"");n.push({importedName:o,localName:a,sourcePath:B(e,r,o),kind:"named",used:s.has(a),usedMembers:[]})}return n}function oe(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let i=n[1]?.trim(),o=n[2]?.trim()??null,a=n[0];if(!i||!a||typeof n.index!="number")continue;let c=E(t,n.index,n.index+a.length);s.push({importedName:i,localName:o,sourcePath:W(e,r,i),kind:o?"namespace":"side-effect",used:o?S(c,o):!0,usedMembers:o?A(c,o):[]})}return s}function ie(e,r,t){let s=[];for(let n of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let i=n[1]?.trim();i&&s.push({specifier:i,sourcePath:W(e,r,i)})}return s}function ae(e,r,t){let s=g(e,r),n=j(r);if(s&&n==="csharp")return Ye(e,r,s);if(s&&n==="vb")return Ke(e,r,s);let i=X(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return N(t,i,(o,a)=>{let c=o[1]?.trim();if(!c)return[];let[p,u]=c.split(/\s*=\s*/),m=!!u,l=(m?u:p)?.trim()??c,d=l.split(".").pop()??l,I=m?p?.trim()??d:d;return[P(e,r,a,l,d,I,h(e,l,w))]})}function Ke(e,r,t){let s=f(t,new Set(["imports_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("imports_statement")){let o=i.namedChildren.filter(l=>l.type==="namespace_name");if(o.length===0)continue;let a=o[o.length-1],c=o.length>1?o[0]:null,p=a.text,u=p.split(".").pop()??p,m=c?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,w),kind:c?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function Ye(e,r,t){let s=f(t,new Set(["using_directive"])),n=[];for(let i of t.rootNode.descendantsOfType("using_directive")){let o=i.namedChildren;if(o.length===0)continue;let a=null,c;o.length>=2&&o[0].type==="identifier"&&(o[1].type==="qualified_name"||o[1].type==="identifier")?(a=o[0],c=o[1]):c=o[o.length-1];let p=c.text,u=p.split(".").pop()??p,m=a?.text??u;n.push({importedName:u,localName:m,sourcePath:h(e,p,w),kind:a?"namespace":"named",used:s.has(m),usedMembers:[]})}return n}function ce(e,r,t){let s=g(e,r),n=j(r);return s&&n==="java"?Ge(e,r,s):s&&n==="kotlin"?et(e,r,s):s&&n==="scala"?tt(e,r,s):N(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(i,o)=>{let a=i[1]?.trim();return a?rt(e,r,a,o):[]})}function Ge(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.children.some(m=>m.type==="asterisk"),c=i.namedChildren.find(m=>m.type==="scoped_identifier")??i.namedChildren.find(m=>m.type==="identifier");if(!c)continue;let p=c.text;if(o){n.push({importedName:"*",localName:null,sourcePath:h(e,p,b),kind:"namespace",used:!0,usedMembers:[]});continue}let u=p.split(".").pop()??p;n.push({importedName:u,localName:u,sourcePath:h(e,p,b),kind:"named",used:s.has(u),usedMembers:[]})}return n}function et(e,r,t){let s=f(t,new Set(["import_header","import_list"])),n=[];for(let i of t.rootNode.descendantsOfType("import_header")){let o=i.namedChildren.find(d=>d.type==="identifier");if(!o)continue;let a=i.namedChildren.some(d=>d.type==="wildcard_import"),c=i.namedChildren.find(d=>d.type==="import_alias");if(a){n.push({importedName:"*",localName:null,sourcePath:h(e,o.text,b),kind:"namespace",used:!0,usedMembers:[]});continue}let p=o.text,u=p.split(".").pop()??p,l=c?.namedChild(0)?.text??u;n.push({importedName:u,localName:l,sourcePath:h(e,p,b),kind:"named",used:s.has(l),usedMembers:[]})}return n}function tt(e,r,t){let s=f(t,new Set(["import_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("import_declaration")){let o=i.namedChildren.find(m=>m.type==="namespace_selectors"||m.type==="namespace_wildcard"),a=i.namedChildren.filter(m=>m!==o&&(m.type==="identifier"||m.type==="stable_identifier")),c=a.map(m=>m.text).join(".");if(!c)continue;if(o?.type==="namespace_wildcard"){n.push({importedName:"*",localName:null,sourcePath:h(e,c,b),kind:"namespace",used:!0,usedMembers:[]});continue}if(o?.type==="namespace_selectors"){for(let m of o.namedChildren)if(m.type==="arrow_renamed_identifier"){let[l,d]=m.namedChildren;if(!l)continue;let I=l.text,R=d?.text??I;if(I==="_")continue;n.push({importedName:I,localName:R,sourcePath:h(e,`${c}.${I}`,b),kind:"named",used:s.has(R),usedMembers:[]})}else if(m.type==="identifier"){let l=m.text;n.push({importedName:l,localName:l,sourcePath:h(e,`${c}.${l}`,b),kind:"named",used:s.has(l),usedMembers:[]})}continue}let p=a[a.length-1]?.text??c,u=a.slice(0,-1).map(m=>m.text).join(".")||c;n.push({importedName:p,localName:p,sourcePath:h(e,u&&a.length>1?`${u}.${p}`:c,b),kind:"named",used:s.has(p),usedMembers:[]})}return n}function rt(e,r,t,s){if(t.includes("{")&&t.includes("}")){let n=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),i=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a)return[];let[c,p]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),u=c?.trim();if(!u||u==="_")return[];let m=(p??u.split(".").pop()??u).trim(),l=u==="_"?n:`${n}.${u}`.replace(/\.\./g,".");return[P(e,r,s,l,u,m)]})}return[P(e,r,s,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function me(e,r,t){let s=g(e,r);return s?st(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?x(o).flatMap(a=>{let c=a.trim();if(!c)return[];let[p,u]=c.split(/\s+as\s+/i),m=p?.trim()??c,l=m.split("\\").pop()??m,d=(u??l).trim();return[P(e,r,i,m,l,d,h(e,m.replace(/\\/g,"."),q))]}):[]})}function st(e,r,t){let s=f(t,new Set(["namespace_use_declaration"])),n=[],i=(o,a,c)=>{n.push({importedName:a,localName:c,sourcePath:h(e,o.replace(/\\/g,"."),q),kind:"named",used:s.has(c),usedMembers:[]})};for(let o of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=o.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=o.namedChildren.find(p=>p.type==="namespace_name")?.text??"";for(let p of a.namedChildren){if(p.type!=="namespace_use_clause")continue;let{importedName:u,localName:m,qualified:l}=pe(p,c);u&&i(l,u,m)}continue}for(let c of o.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=pe(c,"");p&&i(m,p,u)}}return n}function pe(e,r){let t=e.namedChildren.find(p=>p.type==="qualified_name"),s=e.namedChildren.filter(p=>p.type==="name"),n="";t?n=t.text:s.length>=1&&(n=s[0].text);let i=t&&s.length>0?s[s.length-1]:null,o=n.split("\\").pop()??n,a=i?.text??o,c=r?`${r}\\${n}`:n;return{importedName:o,localName:a,qualified:c}}function de(e,r,t){let s=g(e,r);return s?nt(e,r,s):it(t).flatMap(n=>ct(e,r,n,t))}function nt(e,r,t){let s=f(t,new Set(["import_statement","import_from_statement"])),n=[];for(let i of t.rootNode.descendantsOfType("import_statement"))for(let o of i.namedChildren){let a=ue(o);if(!a)continue;let c=O(e,r,a.qualifiedName);n.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:s.has(a.localName),usedMembers:[]})}for(let i of t.rootNode.descendantsOfType("import_from_statement")){let o=i.namedChild(0);if(!o)continue;let a=ot(o);if(a===null)continue;let c=O(e,r,a);for(let p=1;p<i.namedChildCount;p+=1){let u=i.namedChild(p);if(u.type==="wildcard_import"){n.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let m=ue(u);m&&n.push({importedName:m.qualifiedName,localName:m.localName,sourcePath:c,kind:"named",used:s.has(m.localName),usedMembers:[]})}}return n}function ue(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 ot(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=y(e,"import_prefix")?.text??"",t=y(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function it(e){let r=e.split(`
3
+ `),t=[],s=0;for(let n=0;n<r.length;n++){let i=r[n],o=i.trimStart(),a=s;if(s+=i.length+1,!o.startsWith("import ")&&!o.startsWith("from "))continue;let c=i,p=a+i.length,u=le(i);for(;n+1<r.length&&(u>0||c.trimEnd().endsWith("\\"));){n++;let l=r[n];c+=`
4
+ ${l}`,p+=1+l.length,u+=le(l),s+=l.length+1}let m=at(c);m&&t.push({...m,start:a,end:p})}return t}function at(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 s=t[2].trim();return s.startsWith("(")&&s.endsWith(")")&&(s=s.slice(1,-1).trim()),{kind:"from",module:t[1],clause:s}}function ct(e,r,t,s){let n=E(s,t.start,t.end),i=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return x(i).flatMap(c=>{let p=c.trim().replace(/,$/,"");if(!p)return[];let[u,m]=p.split(/\s+as\s+/),l=u.trim(),d=(m??l.split(".")[0]??l).trim(),I=O(e,r,l),R=A(n,d);return[{importedName:l,localName:d,sourcePath:I,kind:"namespace",used:S(n,d)||R.length>0,usedMembers:R}]});let o=t.module?O(e,r,t.module):null,a=[];for(let c of x(i)){let p=c.trim().replace(/,$/,"");if(!p)continue;if(p==="*"){a.push({importedName:"*",localName:null,sourcePath:o,kind:"side-effect",used:!0,usedMembers:[]});continue}let[u,m]=p.split(/\s+as\s+/),l=(m??u).trim();a.push({importedName:u.trim(),localName:l,sourcePath:o,kind:"named",used:S(n,l),usedMembers:[]})}return a}function le(e){let r=0;for(let t of e)t==="("&&r++,t===")"&&r--;return r}import{basename as pt}from"path";function fe(e,r,t){let s=g(e,r);return s?mt(e,r,s):N(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,i)=>{let o=n[1],a=n[2];if(!o||!a)return[];let c=o==="require_relative"?U(e,r,a):null;if(c){let p=ge(a);return[{importedName:p,localName:p,sourcePath:c,kind:"named",used:S(i,p),usedMembers:[]}]}return[{importedName:a,localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]}]})}function mt(e,r,t){let s=f(t,new Set([])),n=[],i=new Set(["require","require_relative","load"]);for(let o of t.rootNode.descendantsOfType("call")){let a=o.namedChild(0);if(!a||a.type!=="identifier"||!i.has(a.text))continue;let p=o.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!p||p.type!=="string")continue;let m=p.namedChildren.find(d=>d.type==="string_content")?.text;if(!m)continue;let l=a.text==="require_relative"?U(e,r,m):null;if(l){let d=ge(m);n.push({importedName:d,localName:d,sourcePath:l,kind:"named",used:s.has(d),usedMembers:[]})}else n.push({importedName:m,localName:null,sourcePath:l,kind:"side-effect",used:!0,usedMembers:[]})}return n}function ge(e){return pt(e).replace(/\.[^.]+$/,"").split("_").filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")}function he(e,r,t){let s=g(e,r);return s?ut(e,r,s):N(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?lt(e,r,o,i):[]})}function ut(e,r,t){let s=f(t,new Set(["use_declaration"])),n=[];for(let i of t.rootNode.descendantsOfType("use_declaration")){let o=i.namedChild(0);if(o)for(let a of L(o,"")){if(!a.importedName||a.importedName==="*")continue;let c=_(e,r,a.qualifiedName)??_(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));n.push({importedName:a.importedName,localName:a.localName,sourcePath:c,kind:"named",used:s.has(a.localName),usedMembers:[]})}}return n}function L(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:v(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,s=t.split("::").pop()??t;return[{qualifiedName:v(r,t),importedName:s,localName:s}]}case"scoped_use_list":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=v(r,t.text),i=[];for(let o of s.namedChildren)i.push(...L(o,n));return i}case"use_list":{let t=[];for(let s of e.namedChildren)t.push(...L(s,r));return t}case"use_as_clause":{let t=e.namedChild(0),s=e.namedChild(1);if(!t||!s)return[];let n=L(t,r),i=s.text;return n.map(o=>({...o,localName:i}))}case"use_wildcard":{let t=e.namedChild(0),s=t?t.text:"";return[{qualifiedName:v(r,`${s}::*`),importedName:"*",localName:"*"}]}default:return[]}}function v(e,r){return e?r?`${e}::${r}`:e:r}function lt(e,r,t,s){let n=t.trim();if(n.includes("{")&&n.includes("}")){let u=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),m=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return x(m).flatMap(l=>{let d=l.trim();if(!d||d==="self")return[];let[I,R]=d.split(/\s+as\s+/),D=I?.trim();if(!D)return[];let ye=(R??D.split("::").pop()??D).trim(),Ne=`${u}::${D}`.replace(/::::/g,"::");return[P(e,r,s,Ne,D.split("::").pop()??D,ye,_(e,r,u))]})}let[i,o]=n.split(/\s+as\s+/),a=i?.trim()??n,c=(o??a.split("::").pop()??a).trim(),p=_(e,r,a)??_(e,r,a.split("::").slice(0,-1).join("::"));return[P(e,r,s,a,a.split("::").pop()??a,c,p)]}function Se(e,r,t){let s=g(e,r);if(s)return dt(e,r,s);let n=[];for(let i of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let o=i[1]?.trim();o&&n.push(...gt(e,r,o))}return n}function dt(e,r,t){let s=[];for(let n of t.rootNode.descendantsOfType("use_declaration")){if(!ft(n))continue;let i=n.namedChildren.find(o=>o.type!=="visibility_modifier");if(i)for(let o of L(i,""))o.importedName&&s.push(F(e,r,o.qualifiedName))}return s}function ft(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function gt(e,r,t){let s=t.trim();if(s.includes("{")&&s.includes("}")){let n=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),i=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return x(i).flatMap(o=>{let a=o.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),p=`${n}::${c?.trim()??a}`.replace(/::::/g,"::");return[F(e,r,p)]})}return[F(e,r,s)]}function F(e,r,t){return{specifier:t,sourcePath:_(e,r,t)??_(e,r,t.split("::").slice(0,-1).join("::"))}}function xe(e,r){let t=r.toLowerCase();for(let s of e)for(let n of s.extensions)if(t.endsWith(n))return s;return null}var ht={language:"javascript",extensions:[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],parseImports:te},St={language:"python",extensions:[".py",".pyi"],parseImports:de},xt={language:"jvm",extensions:[".java",".scala",".kt",".kts"],parseImports:ce},yt={language:"rust",extensions:[".rs"],parseImports:he,parseExports:Se},Nt={language:"ruby",extensions:[".rb"],parseImports:fe},It={language:"c/cpp",extensions:[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],parseImports:ne},Pt={language:"dotnet",extensions:[".cs",".vb"],parseImports:ae},bt={language:"dart",extensions:[".dart"],parseImports:oe,parseExports:ie},_t={language:"php",extensions:[".php"],parseImports:me},Ct=[ht,St,xt,yt,Nt,It,Pt,bt,_t];function V(e){return xe(Ct,e)}function Ur(e,r){return re(e,r)}var Et=$("source-imports"),Rt=$("source-exports");function Br(e,r){let t=J(r);return Et.get(e,t,()=>{let s=V(t);if(!s)return[];let n=k(e,t);return n?s.parseImports(e,t,n):[]})}function Wr(e,r){let t=J(r);return Rt.get(e,t,()=>{let s=V(t);if(!s?.parseExports)return[];let n=k(e,t);return n?s.parseExports(e,t,n):[]})}export{Y as a,Dt as b,G as c,Ur as d,Br as e,Wr as f};
5
+ //# sourceMappingURL=chunk-KW2F3WSV.js.map
@@ -1,5 +1,5 @@
1
- import{a as w}from"./chunk-32R4VYYA.js";import{d as D}from"./chunk-2ZGHRI2A.js";import{a as S,d as p,f as C,h as x,j as I,n as L,o as v,p as d}from"./chunk-QFZE73XF.js";function le(n,e){let{scope:t,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:a=!1}=e??{},o=new w(n),l=o.scopedDefinitions(t),u=K(o,t),f=A(n,o,l,{minLoc:i,maxLoc:s}),m=$(o,f),g=E(n,o,l,f),T=_(f);return B(n,f,m,T).filter(c=>!g.has(c.definition.symbolId)).filter(c=>!c.transitivelyReachable).filter(c=>c.realConsumers.length<=1).filter(c=>!(c.realConsumers.length===0&&c.barrelConsumers>0)).filter(c=>W(c.definition,c.realConsumers.length,u)).map(c=>N(n,c)).filter(c=>a||c.confidence!=="low").sort((c,b)=>{let h={high:0,medium:1,low:2};return h[c.confidence]-h[b.confidence]||b.loc-c.loc||c.file.localeCompare(b.file)||c.startLine-b.startLine}).slice(0,r)}function A(n,e,t,i){return t.filter(s=>s.isTypeLike&&y(s)>=i.minLoc).filter(s=>y(s)<=i.maxLoc).filter(s=>!n.isIgnored(s.relativePath)).filter(s=>!V(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function $(n,e){return R(n.crossFileCallerMap(e),n.sourceFallbackCallerFiles(e))}function _(n){let e=new Map;for(let t of n){let i=e.get(t.relativePath);i||(i=new Map,e.set(t.relativePath,i));let s=d(t.symbol);s&&i.set(s,t)}return e}function B(n,e,t,i){return e.map(s=>{let a=[...t.get(s.symbolId)??new Set].filter(f=>f!==s.relativePath&&!n.isIgnored(f)),{realConsumers:o,barrelConsumers:l}=G(n,s.relativePath,s.symbol,a),u=Z(n,s,t,i);return{definition:s,realConsumers:o,barrelConsumers:l,transitivelyReachable:u}})}function N(n,e){let t=k(n,e.definition.relativePath,e.definition.startLine),i=P(e.definition.relativePath)?!0:X(n,e.definition),{confidence:s,reason:r}=Y(e.realConsumers.length,t,i);return{symbol:e.definition.symbol,shortName:v(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:y(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:t,definerUsesType:i,confidence:s,reason:r}}function E(n,e,t,i){let s=O(n,j(t),i),r=s.map(l=>l.singleton);if(s.length===0)return new Set;let a=R(e.crossFileCallerMap(r),e.sourceFallbackCallerFiles(r)),o=new Set;for(let{singleton:l,classId:u}of s)z(n,l,a)&&o.add(u);return o}function j(n){let e=new Map;for(let t of n){let i=d(t.symbol);i&&e.set(M(t.relativePath,i),t)}return e}function O(n,e,t){let i=[];for(let s of t){let r=U(n,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function U(n,e,t){if(k(n,t.relativePath,t.startLine)!=="class")return null;let i=d(t.symbol);if(!i)return null;let s=H(n,t.relativePath,i);return s?e.get(M(t.relativePath,s))??null:null}function z(n,e,t){let i=d(e.symbol),s=t.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!n.isIgnored(r)&&!F(n,r,i))}function M(n,e){return`${n}\0${e}`}function H(n,e,t){let i=p(n,e);if(!i)return null;let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function K(n,e){return new Set(n.scopedDefinitions(e).filter(t=>t.isFunctionLike).map(t=>t.relativePath))}function V(n){let e=L(n);if("kind"in e)return!1;let t=e.descriptors;if(t.length<2)return!1;let i=t[t.length-1],s=t[t.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function P(n){let t=(n.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(t==="types"||t==="models"||t==="schema"||t==="common"||t==="protocol"||t==="proto"||t==="dto"||t==="mod"||/(^|\/)types(\/|\.)/.test(n)||/(^|\/)models?(\/|\.)/.test(n)||/(^|\/)proto(?:col)?(\/|\.)/.test(n)||/(^|\/)schema(\/|\.)/.test(n))}function W(n,e,t){return!(P(n.relativePath)&&e>0||e===0&&t.has(n.relativePath))}function G(n,e,t,i){let s=[],r=0,a=d(t);for(let o of i)Q(n,o,e,a)||F(n,o,a)?r++:s.push(o);return{realConsumers:s,barrelConsumers:r}}function Z(n,e,t,i){let s=I(n,e.relativePath),r=d(e.symbol);if(!r)return!1;let a=s.get(r);if(!a||a.size===0)return!1;let o=i.get(e.relativePath);if(!o)return!1;for(let l of a){let u=o.get(l);if(!u)continue;let f=t.get(u.symbolId);if(f){for(let m of f)if(m!==e.relativePath&&!n.isIgnored(m))return!0}}return!1}var q=S("stale-abs-file-usage");function F(n,e,t){if(!t)return!1;let i=C(e);if(!i)return!1;let s=q.get(n,e,()=>J(n,e,i));return s.importedLeaves.has(t)&&!s.usedLeaves.has(t)}function J(n,e,t){let i=new Set,s=new Set,r=x(n,e);if(!r)return{importedLeaves:i,usedLeaves:s};let a=t==="rust"?new Set(["use_declaration"]):t==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(l,u)=>{let f=u||a.has(l.type);(l.type==="identifier"||l.type==="type_identifier"||l.type==="property_identifier"||l.type==="field_identifier")&&(f?i.add(l.text):s.add(l.text));for(let m of l.children)o(m,f)};return o(r.rootNode,!1),{importedLeaves:i,usedLeaves:s}}function Q(n,e,t,i){if(!i)return!1;let s=p(n,e);if(!s)return!1;let r=D(n,e);if(r.length===0)return!1;let a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`\\b${a}\\b`),l=s.split(`
1
+ import{a as w}from"./chunk-UAPNU7UP.js";import{d as D}from"./chunk-KW2F3WSV.js";import{a as S,d as p,f as C,h as x,j as I,n as L,o as v,p as d}from"./chunk-QFZE73XF.js";function le(n,e){let{scope:t,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:a=!1}=e??{},o=new w(n),l=o.scopedDefinitions(t),u=K(o,t),f=A(n,o,l,{minLoc:i,maxLoc:s}),m=$(o,f),g=E(n,o,l,f),T=_(f);return B(n,f,m,T).filter(c=>!g.has(c.definition.symbolId)).filter(c=>!c.transitivelyReachable).filter(c=>c.realConsumers.length<=1).filter(c=>!(c.realConsumers.length===0&&c.barrelConsumers>0)).filter(c=>W(c.definition,c.realConsumers.length,u)).map(c=>N(n,c)).filter(c=>a||c.confidence!=="low").sort((c,b)=>{let h={high:0,medium:1,low:2};return h[c.confidence]-h[b.confidence]||b.loc-c.loc||c.file.localeCompare(b.file)||c.startLine-b.startLine}).slice(0,r)}function A(n,e,t,i){return t.filter(s=>s.isTypeLike&&y(s)>=i.minLoc).filter(s=>y(s)<=i.maxLoc).filter(s=>!n.isIgnored(s.relativePath)).filter(s=>!V(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function $(n,e){return R(n.crossFileCallerMap(e),n.sourceFallbackCallerFiles(e))}function _(n){let e=new Map;for(let t of n){let i=e.get(t.relativePath);i||(i=new Map,e.set(t.relativePath,i));let s=d(t.symbol);s&&i.set(s,t)}return e}function B(n,e,t,i){return e.map(s=>{let a=[...t.get(s.symbolId)??new Set].filter(f=>f!==s.relativePath&&!n.isIgnored(f)),{realConsumers:o,barrelConsumers:l}=G(n,s.relativePath,s.symbol,a),u=Z(n,s,t,i);return{definition:s,realConsumers:o,barrelConsumers:l,transitivelyReachable:u}})}function N(n,e){let t=k(n,e.definition.relativePath,e.definition.startLine),i=P(e.definition.relativePath)?!0:X(n,e.definition),{confidence:s,reason:r}=Y(e.realConsumers.length,t,i);return{symbol:e.definition.symbol,shortName:v(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:y(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:t,definerUsesType:i,confidence:s,reason:r}}function E(n,e,t,i){let s=O(n,j(t),i),r=s.map(l=>l.singleton);if(s.length===0)return new Set;let a=R(e.crossFileCallerMap(r),e.sourceFallbackCallerFiles(r)),o=new Set;for(let{singleton:l,classId:u}of s)z(n,l,a)&&o.add(u);return o}function j(n){let e=new Map;for(let t of n){let i=d(t.symbol);i&&e.set(M(t.relativePath,i),t)}return e}function O(n,e,t){let i=[];for(let s of t){let r=U(n,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function U(n,e,t){if(k(n,t.relativePath,t.startLine)!=="class")return null;let i=d(t.symbol);if(!i)return null;let s=H(n,t.relativePath,i);return s?e.get(M(t.relativePath,s))??null:null}function z(n,e,t){let i=d(e.symbol),s=t.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!n.isIgnored(r)&&!F(n,r,i))}function M(n,e){return`${n}\0${e}`}function H(n,e,t){let i=p(n,e);if(!i)return null;let s=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${s}\\s*\\(`);return i.match(r)?.[1]??null}function K(n,e){return new Set(n.scopedDefinitions(e).filter(t=>t.isFunctionLike).map(t=>t.relativePath))}function V(n){let e=L(n);if("kind"in e)return!1;let t=e.descriptors;if(t.length<2)return!1;let i=t[t.length-1],s=t[t.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function P(n){let t=(n.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(t==="types"||t==="models"||t==="schema"||t==="common"||t==="protocol"||t==="proto"||t==="dto"||t==="mod"||/(^|\/)types(\/|\.)/.test(n)||/(^|\/)models?(\/|\.)/.test(n)||/(^|\/)proto(?:col)?(\/|\.)/.test(n)||/(^|\/)schema(\/|\.)/.test(n))}function W(n,e,t){return!(P(n.relativePath)&&e>0||e===0&&t.has(n.relativePath))}function G(n,e,t,i){let s=[],r=0,a=d(t);for(let o of i)Q(n,o,e,a)||F(n,o,a)?r++:s.push(o);return{realConsumers:s,barrelConsumers:r}}function Z(n,e,t,i){let s=I(n,e.relativePath),r=d(e.symbol);if(!r)return!1;let a=s.get(r);if(!a||a.size===0)return!1;let o=i.get(e.relativePath);if(!o)return!1;for(let l of a){let u=o.get(l);if(!u)continue;let f=t.get(u.symbolId);if(f){for(let m of f)if(m!==e.relativePath&&!n.isIgnored(m))return!0}}return!1}var q=S("stale-abs-file-usage");function F(n,e,t){if(!t)return!1;let i=C(e);if(!i)return!1;let s=q.get(n,e,()=>J(n,e,i));return s.importedLeaves.has(t)&&!s.usedLeaves.has(t)}function J(n,e,t){let i=new Set,s=new Set,r=x(n,e);if(!r)return{importedLeaves:i,usedLeaves:s};let a=t==="rust"?new Set(["use_declaration"]):t==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),o=(l,u)=>{let f=u||a.has(l.type);(l.type==="identifier"||l.type==="type_identifier"||l.type==="property_identifier"||l.type==="field_identifier")&&(f?i.add(l.text):s.add(l.text));for(let m of l.children)o(m,f)};return o(r.rootNode,!1),{importedLeaves:i,usedLeaves:s}}function Q(n,e,t,i){if(!i)return!1;let s=p(n,e);if(!s)return!1;let r=D(n,e);if(r.length===0)return!1;let a=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp(`\\b${a}\\b`),l=s.split(`
2
2
  `),u=0;for(let f=0;f<l.length;f++){if(!o.test(l[f]??""))continue;if(u++,!r.find(g=>g.startLine<=f&&f<=g.endLine))return!1}return u>0}function k(n,e,t){let i=p(n,e);if(!i)return"other";let s=i.split(`
3
3
  `),r=Math.max(0,t-2),a=Math.min(s.length-1,t+2);for(let o=r;o<=a;o++){let u=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(u))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(u))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(u))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(u))return"enum"}return"other"}function X(n,e){let t=p(n,e.relativePath);if(!t)return!1;let i=d(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),a=t.split(`
4
4
  `);for(let o=0;o<a.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(a[o]??""))return!0;return!1}function Y(n,e,t){return n===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:n===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:n===1&&!t?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}function y(n){return n.endLine-n.startLine+1}function R(...n){let e=new Map;for(let t of n)for(let[i,s]of t){let r=e.get(i);r||(r=new Set,e.set(i,r));for(let a of s)r.add(a)}return e}export{le as a};
5
- //# sourceMappingURL=chunk-FVVEIGP3.js.map
5
+ //# sourceMappingURL=chunk-NIN762LD.js.map
@@ -1,2 +1,2 @@
1
- import{g as y}from"./chunk-4X7C236P.js";function L(D,k={}){let{limit:x=10,scope:M,minDepth:j=3}=k,a=y(D,M),u=new Map,o=[],l=new Map,r=new Map,g=new Set,f=[],d=0;for(let t of a.keys()){if(l.has(t))continue;let n=[],s=(a.get(t)??new Set).values();for(l.set(t,d),r.set(t,d),d+=1,f.push(t),g.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let h=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(h)))}let c=e.iter.next();if(c.done){if(r.get(e.node)===l.get(e.node)){let h=[];for(;;){let p=f.pop();if(g.delete(p),h.push(p),u.set(p,o.length),p===e.node)break}o.push(h)}n.pop();continue}let i=c.value;if(l.has(i))g.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,d),r.set(i,d),d+=1,f.push(i),g.add(i);let h=(a.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:h,pendingChild:null})}}}let m=new Map,b=new Array(o.length);for(let t=0;t<o.length;t++)b[t]=o[t].length,m.set(t,new Set);for(let[t,n]of a){let s=u.get(t);for(let e of n){let c=u.get(e);c!==s&&m.get(s).add(c)}}let S=new Array(o.length),I=new Array(o.length);for(let t=0;t<o.length;t++){let n=[],s=0;for(let e of m.get(t)){let c=I[e];c>s&&(s=c,n=S[e])}S[t]=[t,...n],I[t]=b[t]+s}function v(t){return S[t]}let A=o.map(t=>[...t].sort()),C=new Set,w=[];for(let t=0;t<o.length;t++){let n=v(t),s=[];for(let c of n)s.push(...A[c]);if(s.length<j)continue;let e=s.join(" ");C.has(e)||(C.add(e),w.push({chain:s,depth:s.length}))}return w.sort((t,n)=>n.depth-t.depth),w.slice(0,x)}export{L as a};
2
- //# sourceMappingURL=chunk-YDNCX5PF.js.map
1
+ import{g as y}from"./chunk-3PVIYZ74.js";function L(D,k={}){let{limit:x=10,scope:M,minDepth:j=3}=k,a=y(D,M),u=new Map,o=[],l=new Map,r=new Map,g=new Set,f=[],d=0;for(let t of a.keys()){if(l.has(t))continue;let n=[],s=(a.get(t)??new Set).values();for(l.set(t,d),r.set(t,d),d+=1,f.push(t),g.add(t),n.push({node:t,iter:s,pendingChild:null});n.length>0;){let e=n[n.length-1];if(e.pendingChild!==null){let h=e.pendingChild;e.pendingChild=null,r.set(e.node,Math.min(r.get(e.node),r.get(h)))}let c=e.iter.next();if(c.done){if(r.get(e.node)===l.get(e.node)){let h=[];for(;;){let p=f.pop();if(g.delete(p),h.push(p),u.set(p,o.length),p===e.node)break}o.push(h)}n.pop();continue}let i=c.value;if(l.has(i))g.has(i)&&r.set(e.node,Math.min(r.get(e.node),l.get(i)));else{l.set(i,d),r.set(i,d),d+=1,f.push(i),g.add(i);let h=(a.get(i)??new Set).values();e.pendingChild=i,n.push({node:i,iter:h,pendingChild:null})}}}let m=new Map,b=new Array(o.length);for(let t=0;t<o.length;t++)b[t]=o[t].length,m.set(t,new Set);for(let[t,n]of a){let s=u.get(t);for(let e of n){let c=u.get(e);c!==s&&m.get(s).add(c)}}let S=new Array(o.length),I=new Array(o.length);for(let t=0;t<o.length;t++){let n=[],s=0;for(let e of m.get(t)){let c=I[e];c>s&&(s=c,n=S[e])}S[t]=[t,...n],I[t]=b[t]+s}function v(t){return S[t]}let A=o.map(t=>[...t].sort()),C=new Set,w=[];for(let t=0;t<o.length;t++){let n=v(t),s=[];for(let c of n)s.push(...A[c]);if(s.length<j)continue;let e=s.join(" ");C.has(e)||(C.add(e),w.push({chain:s,depth:s.length}))}return w.sort((t,n)=>n.depth-t.depth),w.slice(0,x)}export{L as a};
2
+ //# sourceMappingURL=chunk-O6VBAW7P.js.map
@@ -1,2 +1,2 @@
1
- import{a as p,b as g}from"./chunk-PK4U6NWP.js";import{g as B}from"./chunk-4X7C236P.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.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)),d=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=d.join(" -> ");b.has(S)||(b.add(S),i.push({path:d,kind:R(d)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(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":g(e)||g(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 a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{w as a};
2
- //# sourceMappingURL=chunk-EB5IVUNU.js.map
1
+ import{a as p,b as g}from"./chunk-YXMHTJYY.js";import{g as B}from"./chunk-3PVIYZ74.js";function w(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.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)),d=[...u.slice(m,-1),...u.slice(0,m),u[m]],S=d.join(" -> ");b.has(S)||(b.add(S),i.push({path:d,kind:R(d)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(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":g(e)||g(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 a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{w as a};
2
+ //# sourceMappingURL=chunk-PIRXZGV6.js.map
@@ -1,7 +1,7 @@
1
- import{a as m}from"./chunk-32R4VYYA.js";import{a as l}from"./chunk-ZHHMG4UC.js";import{o as a}from"./chunk-QFZE73XF.js";import{readFileSync as f}from"fs";import{join as u}from"path";function I(e,n){let t=l(e,n);if(!t)return null;let i=new m(e),c=S(h(e,t.relativePath,t.startLine,t.endLine),p(e,t.relativePath)),o=t.endLine-t.startLine+1,r=i.calleeMap([t],{additive:!0}).get(t.symbolId)??[],b=new Set(r.map(g=>g.symbol));return{symbol:t.symbol,shortName:a(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:o,branches:c,cyclomaticEstimate:c+1,calleeCount:b.size,fanIn:y(e,t.symbolId),fanOut:d(r,t.relativePath)}}function p(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function h(e,n,t,i){try{return f(u(e.config.projectRoot,n),"utf-8").split(`
1
+ import{a as m}from"./chunk-UAPNU7UP.js";import{a as l}from"./chunk-ZHHMG4UC.js";import{o as a}from"./chunk-QFZE73XF.js";import{readFileSync as f}from"fs";import{join as u}from"path";function I(e,n){let t=l(e,n);if(!t)return null;let i=new m(e),c=S(h(e,t.relativePath,t.startLine,t.endLine),p(e,t.relativePath)),o=t.endLine-t.startLine+1,r=i.calleeMap([t],{additive:!0}).get(t.symbolId)??[],b=new Set(r.map(g=>g.symbol));return{symbol:t.symbol,shortName:a(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:o,branches:c,cyclomaticEstimate:c+1,calleeCount:b.size,fanIn:y(e,t.symbolId),fanOut:d(r,t.relativePath)}}function p(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function h(e,n,t,i){try{return f(u(e.config.projectRoot,n),"utf-8").split(`
2
2
  `).slice(t,i+1).join(`
3
3
  `)}catch{return""}}function y(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
5
5
  JOIN chunks c ON m.chunk_id = c.id
6
6
  WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function d(e,n){return new Set(e.filter(t=>t.file!==n).map(t=>t.symbol)).size}function S(e,n){let t=P(e),i=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of c){let s=t.match(o);s&&(i+=s.length)}if(n==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}else if(n==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let s of o){let r=t.match(s);r&&(i+=r.length)}}return i}function P(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\/\/.*/g,"").replace(/#.*/g,"").replace(/"(?:[^"\\]|\\.)*"/g,'""').replace(/'(?:[^'\\]|\\.)*'/g,"''").replace(/`(?:[^`\\]|\\.)*`/g,"``")}export{I as a};
7
- //# sourceMappingURL=chunk-MKFH7QJG.js.map
7
+ //# sourceMappingURL=chunk-Q4R2IYA3.js.map
@@ -1,4 +1,4 @@
1
- import{i as d}from"./chunk-4X7C236P.js";import{B as l,o as m}from"./chunk-QFZE73XF.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",r=o.all(`SELECT
1
+ import{i as d}from"./chunk-3PVIYZ74.js";import{B as l,o as m}from"./chunk-QFZE73XF.js";function y(o,t={}){let{limit:s=30,scope:e}=t,n=e?`AND def_d.relative_path LIKE '%${e}%'`:"",r=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-4X7C236P.js";import{B as l,o as m}from"./chunk-QFZE73
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:m(i.symbol),refCount:i.ref_count,fileCount:i.file_count,definedIn:i.defined_in}));return r.length>0?r: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:m(t.symbol),refCount:s.length,fileCount:new Set(s.map(e=>e.file)).size,definedIn:t.relativePath}}export{y as a};
25
- //# sourceMappingURL=chunk-Z5CTXSWT.js.map
25
+ //# sourceMappingURL=chunk-QFBJZHMV.js.map
@@ -1,4 +1,4 @@
1
- import{a as h}from"./chunk-32R4VYYA.js";import{p}from"./chunk-YU25IHJX.js";import{o as u,r as c,t as g}from"./chunk-QFZE73XF.js";import{execFileSync as f}from"child_process";function O(e,t={}){let{base:n="HEAD"}=t,s;try{s=b(e.config.projectRoot,n)}catch{return y("Unable to compute git diff.")}if(s.length===0)return y("No changed files found.");let o=I(e,s);if(o.length===0)return{changedFiles:s,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:s.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}};let a=new h(e),l=new Set(o),m=D(a,o),r=[],i=new Map;for(let C of m)_(e,C,o,l,r,i);let d=R(i);return{changedFiles:o,changedSymbols:r,affectedConsumers:d,summary:{totalChangedFiles:o.length,totalChangedSymbols:r.length,totalAffectedFiles:d.length}}}function y(e){return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function b(e,t){let n=f("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),s=f("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),o=f("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([n,s,o].flatMap(a=>a.split(`
1
+ import{a as h}from"./chunk-UAPNU7UP.js";import{p}from"./chunk-Z4AMQWVY.js";import{o as u,r as c,t as g}from"./chunk-QFZE73XF.js";import{execFileSync as f}from"child_process";function O(e,t={}){let{base:n="HEAD"}=t,s;try{s=b(e.config.projectRoot,n)}catch{return y("Unable to compute git diff.")}if(s.length===0)return y("No changed files found.");let o=I(e,s);if(o.length===0)return{changedFiles:s,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:s.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}};let a=new h(e),l=new Set(o),m=D(a,o),r=[],i=new Map;for(let C of m)_(e,C,o,l,r,i);let d=R(i);return{changedFiles:o,changedSymbols:r,affectedConsumers:d,summary:{totalChangedFiles:o.length,totalChangedSymbols:r.length,totalAffectedFiles:d.length}}}function y(e){return{changedFiles:[],changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:0,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function b(e,t){let n=f("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),s=f("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),o=f("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([n,s,o].flatMap(a=>a.split(`
2
2
  `)).map(a=>a.trim()).filter(a=>a.length>0))]}function I(e,t){let n=[];for(let s of t){let o=e.get(`SELECT relative_path FROM documents
3
3
  WHERE relative_path LIKE ?
4
4
  LIMIT 1`,`%${s}`);o&&!e.isIgnored(o.relative_path)&&n.push(o.relative_path)}return n}function D(e,t){return t.flatMap(n=>e.definitionsForFile(n)).filter(x).sort((n,s)=>n.relativePath.localeCompare(s.relativePath)||n.startLine-s.startLine)}function _(e,t,n,s,o,a){let l=p(e,[t]).get(t.symbolId)??new Set,m=Math.max(F(e,t.symbolId),l.size);if(!E(t,m))return;let r=u(t.symbol);o.push({symbol:t.symbol,shortName:r,file:t.relativePath,fanIn:m});for(let i of N(e,t.symbolId,n))S(e,s,a,i,r);for(let i of l)S(e,s,a,i,r)}function F(e,t){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS fan_in
@@ -13,4 +13,4 @@ import{a as h}from"./chunk-32R4VYYA.js";import{p}from"./chunk-YU25IHJX.js";impor
13
13
  AND m.role != 1
14
14
  AND ref_d.relative_path NOT IN (${n.map(()=>"?").join(",")})
15
15
  ${e.pathExclusionsFor("ref_d")}`,t,...n).map(o=>o.relative_path)}function S(e,t,n,s,o){if(e.isIgnored(s)||t.has(s))return;let a=n.get(s);a||(a=new Set,n.set(s,a)),a.add(o)}function R(e){return[...e.entries()].map(([t,n])=>({file:t,consumedSymbols:n.size})).sort((t,n)=>n.consumedSymbols-t.consumedSymbols)}function x(e){return!(g(e.symbol)||e.parentTypeName!==null&&!c(e.symbol))}function E(e,t){return c(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&t>0}export{O as a};
16
- //# sourceMappingURL=chunk-WHGCGENP.js.map
16
+ //# sourceMappingURL=chunk-QPJG6VRT.js.map
@@ -1,4 +1,4 @@
1
- import se from"better-sqlite3";import{createRequire as ae}from"module";import{existsSync as ue,mkdtempSync as pn,readFileSync as v,rmSync as hn,statSync as bn,writeFileSync as Sn}from"fs";import{cpus as vn,tmpdir as Rn}from"os";import{dirname as F,extname as ce,join as O,relative as le,resolve as ge}from"path";import{pathToFileURL as fe}from"url";import{Worker as wn}from"worker_threads";import H from"better-sqlite3";import{execFileSync as G}from"child_process";import{existsSync as K,readdirSync as B,readFileSync as J}from"fs";import{extname as m,join as I}from"path";import _ from"ignore";import{readFileSync as A,existsSync as h}from"fs";import{dirname as b,isAbsolute as R,join as S,relative as P,resolve as j}from"path";function V(e){let n=_(),r=!1,t=W(e);for(let o of t)try{let i=A(o,"utf-8");n.add(i),r=!0}catch{}return r||n.add($),{isIgnored:o=>k(n,e,o),filter:o=>o.filter(i=>!k(n,e,i))}}function W(e){let n=[],r=S(e,".gitignore");h(r)&&n.push(r);let t=b(e),o=0;for(;t!==b(t)&&o<5;){let i=S(t,".gitignore");if(h(i)&&n.push(i),h(S(t,".git")))break;t=b(t),o++}return n}var $=`
1
+ import ue from"better-sqlite3";import{createRequire as ce}from"module";import{existsSync as le,mkdtempSync as Sn,readFileSync as v,rmSync as yn,statSync as vn,writeFileSync as Rn}from"fs";import{cpus as Vn,tmpdir as xn}from"os";import{dirname as F,extname as ge,join as O,relative as fe,resolve as de}from"path";import{pathToFileURL as me}from"url";import{Worker as In}from"worker_threads";import K from"better-sqlite3";import{execFileSync as B}from"child_process";import{existsSync as J,readdirSync as z,readFileSync as X}from"fs";import{extname as m,join as E}from"path";import M from"ignore";import{readFileSync as A,existsSync as h}from"fs";import{dirname as b,isAbsolute as R,join as S,relative as P,resolve as j}from"path";function V(e){let n=M(),r=!1,t=W(e);for(let o of t)try{let i=A(o,"utf-8");n.add(i),r=!0}catch{}return r||n.add($),{isIgnored:o=>k(n,e,o),filter:o=>o.filter(i=>!k(n,e,i))}}function W(e){let n=[],r=S(e,".gitignore");h(r)&&n.push(r);let t=b(e),o=0;for(;t!==b(t)&&o<5;){let i=S(t,".gitignore");if(h(i)&&n.push(i),h(S(t,".git")))break;t=b(t),o++}return n}var $=`
2
2
  # Dependencies
3
3
  node_modules/
4
4
  vendor/
@@ -55,10 +55,10 @@ Thumbs.db
55
55
 
56
56
  # Type definitions (often noise in queries)
57
57
  *.d.ts
58
- `;function k(e,n,r){let t=U(n,r);if(!t)return!1;try{return e.ignores(t)}catch{return!1}}function U(e,n){if(!n||n===".")return null;if(!R(n)&&!n.startsWith(".."))return n.replaceAll("\\","/");let r=R(n)?n:j(e,n),t=P(e,r).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}import{readdirSync as Ge}from"fs";import{extname as Be,join as Je}from"path";function x(e){let n=new WeakMap,r=t=>{let o=n.get(t);return o||(o=new Map,n.set(t,o)),o};return{get(t,o,i){let s=r(t);if(s.has(o))return s.get(o);let a=i();return s.set(o,a),a},invalidate(t,o){n.get(t)?.delete(o)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}var w=[".vue"],T=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var qe=x("source-files");function rn(e){let n=new Set((e.extensions??w).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!K(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=V(e.projectRoot),t=z(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new H(e.dbPath);try{let i=X(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
59
- VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let g of l){if(i.has(g))continue;let f=J(I(e.projectRoot,g),"utf-8"),M=s.run(Y(g),g,f);d+=Number(M.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function z(e,n){let r=q(e,n);if(r)return r;let t=[],o=i=>{let s=i?I(e,i):e,a;try{a=B(s,{withFileTypes:!0})}catch{return}for(let u of a){if(T.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function q(e,n){try{return G("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
60
- `).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function X(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Y(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as Q}from"child_process";import{createHash as Z}from"crypto";import{readdirSync as ee,readFileSync as ne}from"fs";import{join as C}from"path";function te(e){return(re(e)??oe(e)).filter(n=>n&&!E(n)).sort()}function ln(e){return te(e).map(n=>{let r=C(e,n);try{let t=ne(r);return{path:n,size:t.byteLength,hash:Z("sha256").update(t).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function re(e){try{return Q("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
61
- `).filter(Boolean)}catch{return null}}function oe(e){let n=[],r=[""];for(;r.length>0;){let t=r.pop(),o=t?C(e,t):e,i;try{i=ee(o,{withFileTypes:!0})}catch{continue}for(let s of i){let a=t?`${t}/${s.name}`:s.name;if(s.isDirectory()){E(a)||r.push(a);continue}n.push(a)}}return n}function E(e){return e.split("/").some(r=>ie.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ie=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);function Tn(e){let n=ge(e.projectRoot,e.tsconfig),r=ve(e.projectRoot,n),t=new se(e.dbPath,{readonly:!0});try{let o=Ne();return de({projectRoot:e.projectRoot,vueFiles:e.vueFiles??[],tasks:e.tasks,context:r,symbolLookup:we(t,e.projectRoot,o),vueSymbolLookup:Ce(t,e.projectRoot),sourceCache:o})}finally{t.close()}}function de(e){let n=[],r=0,t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=me(e,o);n.push(...i.occurrences),r+=i.skippedReferences}return{occurrences:n,skippedReferences:r}}function me(e,n){let r=e.context.language.scripts.get(n.fileName),t=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!t)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let o=e.sourceCache(n.fileName);if(!o)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let i=e.context.language.maps.get(t,r),s=p(e.projectRoot,n.fileName),a=[...Fe(o.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:be(a),processedStarts:new Set};return pe({...e,fileName:n.fileName,sourceInfo:o,sourceFile:s,map:i,tokenContext:u})}function pe(e){let n=[],r=0;for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start))continue;let o=Oe(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(u=>!Le(e.projectRoot,u.fileName));if(!s){r++;continue}let a=Ee(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}L(n,e.sourceInfo,e.sourceFile,t,a),e.tokenContext.processedStarts.add(t.start),he(n,e,t,o,a)}return{occurrences:n,skippedReferences:r}}function he(e,n,r,t,o){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let i of Se(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(i))continue;let s=n.tokenContext.tokenByStart.get(i);s&&(L(e,n.sourceInfo,n.sourceFile,s,o),n.tokenContext.processedStarts.add(i))}}function L(e,n,r,t,o){let i=N(n,t.start);e.push({sourceFile:r,sourceLine:i.line,sourceStartChar:i.character,sourceEndChar:i.character+t.text.length,symbolId:o})}function be(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function Se(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=ye(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function ye(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=D(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}function ve(e,n){let{vueCore:r,ts:t,volarTs:o}=Re(e),{parsed:i,vueOptions:s}=ke(r,t,n),a=F(n),u=r.createVueLanguagePlugin(t,i.options,s,f=>f),c=Ve(r,t,u),l=xe(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,f=>f,l),g=t.createLanguageService(d);return{ts:t,language:c,languageService:g,fileNames:i.fileNames,configDir:a}}function Re(e){let n=ae(fe(O(e,"package.json")).href);return{vueCore:y(n,"@vue/language-core",e),ts:y(n,"typescript",e),volarTs:y(n,"@volar/typescript",e)}}function ke(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,F(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function Ve(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!ue(i))return;let s=v(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??De(i))});return t.current=o,o}function xe(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function y(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function we(e,n,r){let t=Te(e);return o=>{let i=p(n,o.fileName),s=r(o.fileName);if(!s)return null;let a=N(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Ie(u.starts,a.line,2)}}function Te(e){let n=e.prepare(`
58
+ `;function k(e,n,r){let t=U(n,r);if(!t)return!1;try{return e.ignores(t)}catch{return!1}}function U(e,n){if(!n||n===".")return null;if(!R(n)&&!n.startsWith(".."))return n.replaceAll("\\","/");let r=R(n)?n:j(e,n),t=P(e,r).replaceAll("\\","/");return!t||t==="."||t.startsWith("..")?null:t}import{readdirSync as Be}from"fs";import{extname as ze,join as Xe}from"path";function x(e){let n=new WeakMap,r=t=>{let o=n.get(t);return o||(o=new Map,n.set(t,o)),o};return{get(t,o,i){let s=r(t);if(s.has(o))return s.get(o);let a=i();return s.set(o,a),a},invalidate(t,o){n.get(t)?.delete(o)},invalidateAll(t){n.delete(t)},size(t){return n.get(t)?.size??0}}}var H=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],G=new Set(H.map(e=>e.toLowerCase())),qe=[...G].sort().join(","),T=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);var Qe=x("source-files");function an(e){let n=new Set((e.extensions??w).map(i=>i.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!J(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let r=V(e.projectRoot),t=Y(e.projectRoot,n).filter(i=>!r.isIgnored(i)),o=new K(e.dbPath);try{let i=Q(o,t),s=o.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
59
+ VALUES (?, ?, NULL, ?)`),u=o.transaction(l=>{let d=0;for(let g of l){if(i.has(g))continue;let f=X(E(e.projectRoot,g),"utf-8"),_=s.run(Z(g),g,f);d+=Number(_.changes)}return d})(t),c={scanned:t.length,inserted:u,existing:t.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{o.close()}}function Y(e,n){let r=q(e,n);if(r)return r;let t=[],o=i=>{let s=i?E(e,i):e,a;try{a=z(s,{withFileTypes:!0})}catch{return}for(let u of a){if(T.has(u.name))continue;let c=i?`${i}/${u.name}`:u.name;if(u.isDirectory()){o(c);continue}n.has(m(u.name).toLowerCase())&&t.push(c)}};return o(""),t.sort()}function q(e,n){try{return B("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
60
+ `).filter(t=>t&&n.has(m(t).toLowerCase())).sort()}catch{return null}}function Q(e,n){let r=new Set,t=500;for(let o=0;o<n.length;o+=t){let i=n.slice(o,o+t),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${i.map(()=>"?").join(",")})`).all(...i);for(let a of s)r.add(a.relative_path)}return r}function Z(e){return m(e).toLowerCase()===".vue"?"vue":m(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as ee}from"child_process";import{createHash as ne}from"crypto";import{readdirSync as te,readFileSync as re}from"fs";import{join as I}from"path";function oe(e){return(ie(e)??se(e)).filter(n=>n&&!C(n)).sort()}function dn(e){return oe(e).map(n=>{let r=I(e,n);try{let t=re(r);return{path:n,size:t.byteLength,hash:ne("sha256").update(t).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function ie(e){try{return ee("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
61
+ `).filter(Boolean)}catch{return null}}function se(e){let n=[],r=[""];for(;r.length>0;){let t=r.pop(),o=t?I(e,t):e,i;try{i=te(o,{withFileTypes:!0})}catch{continue}for(let s of i){let a=t?`${t}/${s.name}`:s.name;if(s.isDirectory()){C(a)||r.push(a);continue}n.push(a)}}return n}function C(e){return e.split("/").some(r=>ae.has(r))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var ae=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);function Cn(e){let n=de(e.projectRoot,e.tsconfig),r=ke(e.projectRoot,n),t=new ue(e.dbPath,{readonly:!0});try{let o=Me();return pe({projectRoot:e.projectRoot,vueFiles:e.vueFiles??[],tasks:e.tasks,context:r,symbolLookup:Ee(t,e.projectRoot,o),vueSymbolLookup:Fe(t,e.projectRoot),sourceCache:o})}finally{t.close()}}function pe(e){let n=[],r=0,t=e.tasks??e.vueFiles.map(o=>({fileName:o,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let o of t){let i=he(e,o);n.push(...i.occurrences),r+=i.skippedReferences}return{occurrences:n,skippedReferences:r}}function he(e,n){let r=e.context.language.scripts.get(n.fileName),t=r?.generated?.languagePlugin.typescript?.getServiceScript(r.generated.root)?.code;if(!r||!t)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let o=e.sourceCache(n.fileName);if(!o)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let i=e.context.language.maps.get(t,r),s=p(e.projectRoot,n.fileName),a=[...Le(o.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:ye(a),processedStarts:new Set};return be({...e,fileName:n.fileName,sourceInfo:o,sourceFile:s,map:i,tokenContext:u})}function be(e){let n=[],r=0;for(let t of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(t.start))continue;let o=De(e.map,t.start);if(o===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,o+1)??[]).find(u=>!Ne(e.projectRoot,u.fileName));if(!s){r++;continue}let a=Oe(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){r++;continue}L(n,e.sourceInfo,e.sourceFile,t,a),e.tokenContext.processedStarts.add(t.start),Se(n,e,t,o,a)}return{occurrences:n,skippedReferences:r}}function Se(e,n,r,t,o){if(!((n.tokenContext.tokenTextCounts.get(r.text)??0)<=1))for(let i of ve(n.context.languageService,n.fileName,t+1,n.map,r,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(i))continue;let s=n.tokenContext.tokenByStart.get(i);s&&(L(e,n.sourceInfo,n.sourceFile,s,o),n.tokenContext.processedStarts.add(i))}}function L(e,n,r,t,o){let i=N(n,t.start);e.push({sourceFile:r,sourceLine:i.line,sourceStartChar:i.character,sourceEndChar:i.character+t.text.length,symbolId:o})}function ye(e){let n=new Map;for(let r of e)n.set(r.text,(n.get(r.text)??0)+1);return n}function ve(e,n,r,t,o,i){let s=e.getDocumentHighlights?.(n,r,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let l=Re(t,c.textSpan.start,i,o.text);l!==null&&a.push(l)}return a}function Re(e,n,r,t){let o=r.get(n);if(o?.text===t)return o.start;let i=D(e,n);if(i===null)return null;let s=r.get(i);return s?.text===t?s.start:null}function ke(e,n){let{vueCore:r,ts:t,volarTs:o}=Ve(e),{parsed:i,vueOptions:s}=xe(r,t,n),a=F(n),u=r.createVueLanguagePlugin(t,i.options,s,f=>f),c=we(r,t,u),l=Te(a,i),{languageServiceHost:d}=o.createLanguageServiceHost(t,t.sys,c,f=>f,l),g=t.createLanguageService(d);return{ts:t,language:c,languageService:g,fileNames:i.fileNames,configDir:a}}function Ve(e){let n=ce(me(O(e,"package.json")).href);return{vueCore:y(n,"@vue/language-core",e),ts:y(n,"typescript",e),volarTs:y(n,"@volar/typescript",e)}}function xe(e,n,r){let t=n.readConfigFile(r,n.sys.readFile);if(t.error||!t.config)throw new Error(`Failed to read ${r}`);let i=e.createParsedCommandLine(n,n.sys,r).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(i.globalTypesPath=e.createGlobalTypesWriter(i,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(t.config,n.sys,F(r),void 0,r,void 0,e.getAllExtensions(i).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:i}}function we(e,n,r){let t={},o=e.createLanguage([r],new Map,i=>{if(!le(i))return;let s=v(i,"utf-8");t.current?.scripts.set(i,n.ScriptSnapshot.fromString(s),r.getLanguageId(i)??_e(i))});return t.current=o,o}function Te(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function y(e,n,r){try{return e(n)}catch(t){throw(typeof t=="object"&&t!==null&&"code"in t?t.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${r}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:t}):t}}function Ee(e,n,r){let t=Ie(e);return o=>{let i=p(n,o.fileName),s=r(o.fileName);if(!s)return null;let a=N(s,o.textSpan.start),u=t.get(i);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Ce(u.starts,a.line,2)}}function Ie(e){let n=e.prepare(`
62
62
  SELECT
63
63
  d.relative_path AS relativePath,
64
64
  der.start_line AS startLine,
@@ -67,5 +67,5 @@ Thumbs.db
67
67
  FROM defn_enclosing_ranges der
68
68
  JOIN documents d ON d.id = der.document_id
69
69
  ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
70
- `).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,t.symbolId)}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function Ie(e,n,r){let t=0,o=e.length-1;for(;t<=o;){let s=Math.floor((t+o)/2);e[s].line<n?t=s+1:o=s-1}let i=null;for(let s of[o,t]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>r||(!i||u<i.distance)&&(i={distance:u,symbolId:a.symbolId})}return i?.symbolId??null}function Ce(e,n){let r=_e(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=p(n,i),a=Ae(r.name,r.version,s),c=t.get(a)?.id??null;return o.set(i,c),c}}}function Ee(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(D(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*Fe(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function Oe(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function D(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function N(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function Le(e,n){return p(e,n).startsWith("node_modules/")}function p(e,n){return le(e,n).replaceAll("\\","/")}function De(e){switch(ce(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function Ne(){let e=new Map;return n=>{if(e.has(n))return e.get(n)??null;try{let r=v(n,"utf-8"),t={text:r,lineStarts:Me(r)};return e.set(n,t),t}catch{return e.set(n,null),null}}}function Me(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function _e(e){try{let n=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Ae(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}export{rn as a,ln as b,Tn as c};
71
- //# sourceMappingURL=chunk-HUASU3AD.js.map
70
+ `).all(),r=new Map;for(let t of n){let o=r.get(t.relativePath);o||(o={containingByLine:new Map,starts:[]},r.set(t.relativePath,o)),o.starts.push({line:t.startLine,symbolId:t.symbolId});for(let i=t.startLine;i<=t.endLine;i++)o.containingByLine.set(i,t.symbolId)}for(let t of r.values())t.starts.sort((o,i)=>o.line-i.line);return r}function Ce(e,n,r){let t=0,o=e.length-1;for(;t<=o;){let s=Math.floor((t+o)/2);e[s].line<n?t=s+1:o=s-1}let i=null;for(let s of[o,t]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>r||(!i||u<i.distance)&&(i={distance:u,symbolId:a.symbolId})}return i?.symbolId??null}function Fe(e,n){let r=Pe(n),t=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=new Map;return{get(i){if(o.has(i))return o.get(i)??null;let s=p(n,i),a=je(r.name,r.version,s),c=t.get(a)?.id??null;return o.set(i,c),c}}}function Oe(e,n,r,t,o){if(e.fileName.endsWith(".vue")){let i=t.language.scripts.get(e.fileName),s=i?.generated?.languagePlugin.typescript?.getServiceScript(i.generated.root)?.code;if(i&&s){let a=t.language.maps.get(s,i);if(D(a,e.textSpan.start)!==null)return r.get(e.fileName)}return e.fileName.startsWith(o)?r.get(e.fileName):null}return n(e)}function*Le(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,r=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),t;for(;t=n.exec(e);){let o=t[0];r.has(o)||(yield{text:o,start:t.index,end:t.index+o.length})}}function De(e,n){for(let[r]of e.toGeneratedLocation(n,t=>!!t.navigation))return r;return null}function D(e,n){let r=e;for(let[t]of r.toSourceLocation(n,o=>!!o.navigation))return t;return null}function N(e,n){let r=0,t=e.lineStarts.length-1;for(;r<=t;){let i=Math.floor((r+t)/2);e.lineStarts[i]<=n?r=i+1:t=i-1}let o=Math.max(0,t);return{line:o,character:n-e.lineStarts[o]}}function Ne(e,n){return p(e,n).startsWith("node_modules/")}function p(e,n){return fe(e,n).replaceAll("\\","/")}function _e(e){switch(ge(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function Me(){let e=new Map;return n=>{if(e.has(n))return e.get(n)??null;try{let r=v(n,"utf-8"),t={text:r,lineStarts:Ae(r)};return e.set(n,t),t}catch{return e.set(n,null),null}}}function Ae(e){let n=[0];for(let r=0;r<e.length;r++)e.charCodeAt(r)===10&&n.push(r+1);return n}function Pe(e){try{let n=JSON.parse(v(O(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function je(e,n,r){let t=r.split("/").map(o=>`\`${o.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${t}/default.`}export{an as a,dn as b,Cn as c};
71
+ //# sourceMappingURL=chunk-TBJDUS4E.js.map
@@ -1,7 +1,7 @@
1
- import{a as M}from"./chunk-32R4VYYA.js";import{f as b}from"./chunk-4X7C236P.js";import{E as C,o as p,p as g,v as I}from"./chunk-QFZE73XF.js";import{basename as c,extname as d}from"path";function R(i,e){let{scope:n,maxLoc:o=15,limit:r=30}=e??{},t=new M(i),a=P(t.fileDependencyGraph(n)),s=x(t,n,o),u=v(t.crossFileCallerMap(s),t.sourceFallbackCallerFiles(s)),m=[];for(let f of s){let l=F(i,t,f,{callerFileMap:u,reverseFanIn:a});l&&m.push(l)}return m.sort((f,l)=>l.callerFanIn-f.callerFanIn||l.loc-f.loc),m.slice(0,r)}function F(i,e,n,o){let r=D(e,n,o.callerFileMap);if(r.length!==1)return null;let t=r[0],a=S(i,n.symbolId,t);if(!a)return null;let s=L(e,i,t,n.symbol,a);if(s&&I(s.symbol))return null;let u=y(o.callerFileMap,o.reverseFanIn,t,s);return u<=3?null:{symbol:n.symbol,shortName:p(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:h(n),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?p(s.symbol):c(t),callerFanIn:u}}function h(i){return i.endLine-i.startLine+1}function x(i,e,n){return i.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:n,requireFunctionLikeSymbol:!0})}function D(i,e,n){let o=c(e.relativePath,d(e.relativePath));return[...n.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>c(r,d(r))!==o).filter(r=>{let t=i.fileKind(r);return t!=="barrel"&&t!=="entry"&&t!=="test"})}function S(i,e,n){return i.get(`SELECT c.start_line, c.end_line
1
+ import{a as M}from"./chunk-UAPNU7UP.js";import{f as b}from"./chunk-3PVIYZ74.js";import{E as C,o as p,p as g,v as I}from"./chunk-QFZE73XF.js";import{basename as c,extname as d}from"path";function R(i,e){let{scope:n,maxLoc:o=15,limit:r=30}=e??{},t=new M(i),a=P(t.fileDependencyGraph(n)),s=x(t,n,o),u=v(t.crossFileCallerMap(s),t.sourceFallbackCallerFiles(s)),m=[];for(let f of s){let l=F(i,t,f,{callerFileMap:u,reverseFanIn:a});l&&m.push(l)}return m.sort((f,l)=>l.callerFanIn-f.callerFanIn||l.loc-f.loc),m.slice(0,r)}function F(i,e,n,o){let r=D(e,n,o.callerFileMap);if(r.length!==1)return null;let t=r[0],a=S(i,n.symbolId,t);if(!a)return null;let s=L(e,i,t,n.symbol,a);if(s&&I(s.symbol))return null;let u=y(o.callerFileMap,o.reverseFanIn,t,s);return u<=3?null:{symbol:n.symbol,shortName:p(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:h(n),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?p(s.symbol):c(t),callerFanIn:u}}function h(i){return i.endLine-i.startLine+1}function x(i,e,n){return i.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:n,requireFunctionLikeSymbol:!0})}function D(i,e,n){let o=c(e.relativePath,d(e.relativePath));return[...n.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>c(r,d(r))!==o).filter(r=>{let t=i.fileKind(r);return t!=="barrel"&&t!=="entry"&&t!=="test"})}function S(i,e,n){return i.get(`SELECT c.start_line, c.end_line
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
5
5
  WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
6
  LIMIT 1`,e,n)}function L(i,e,n,o,r){let t=i.definitionsForFile(n),a=k(e,n,o,r.start_line,r.end_line);return C(t,a)}function y(i,e,n,o){if(o?.isFunctionLike){let r=[...i.get(o.symbolId)??[]].filter(t=>t!==o.relativePath);if(r.length>0)return r.length}return _(e,n)}function k(i,e,n,o,r){let t=g(n);if(!t)return o;let a=b(i,e).get(t);if(!a||a.length===0)return o;for(let s of a)if(s>=o&&s<=r)return s;return o}function v(...i){let e=new Map;for(let n of i)for(let[o,r]of n){let t=e.get(o);t||(t=new Set,e.set(o,t));for(let a of r)t.add(a)}return e}function P(i){let e=new Map;for(let[n,o]of i){e.has(n)||e.set(n,e.get(n)??0);for(let r of o)e.set(r,(e.get(r)??0)+1)}return e}function _(i,e){let n=i.get(e)??0;if(n>0)return n;let o=c(e,d(e)),r=0;for(let[t,a]of i)t!==e&&c(t,d(t))===o&&a>r&&(r=a);return r}export{R as a};
7
- //# sourceMappingURL=chunk-K6H3XJQW.js.map
7
+ //# sourceMappingURL=chunk-TUV2VI7D.js.map
@@ -0,0 +1,2 @@
1
+ import{a as b,e as A}from"./chunk-YXMHTJYY.js";import{a as m,b as O,d as E}from"./chunk-VEXS3I3N.js";import{c as q}from"./chunk-Y4DS3MDC.js";import{b as F,c as L,f as D,g as M,k as v,m as N}from"./chunk-3PVIYZ74.js";import{A as P,C as T,e as p,f as g,g as h,l as R,r as C,s as I,u as x,v as k}from"./chunk-QFZE73XF.js";function V(i,e,o){let c=e.identifierResolution==="strict"?m:O;for(let t of e.paths){let l=g(t);if(!l&&!(e.includeVueSfc&&h(t))||i.isIgnored(t)||e.skipPath?.(t))continue;let u=D(i,t);for(let[n,s]of u)for(let f of c(i,t,n))o({sourceFile:t,name:n,target:f,occurrences:s.length,kind:"identifier"});if(e.includeCrossLanguageDispatchNames)for(let n of L(i,t))for(let s of m(i,t,n))o({sourceFile:t,name:n,target:s,occurrences:1,kind:"cross-language-dispatch"});if(e.includeRustAttributeNames&&l==="rust")for(let n of F(i,t))for(let s of c(i,t,n))o({sourceFile:t,name:n,target:s,occurrences:1,kind:"rust-attribute"})}}var G=class{constructor(e){this.db=e}db;scopedDefinitions(e){return T(this.db,e)}definitionsForFile(e){return P(this.db,e)}productionCallableDefinitions(e={}){let{scope:o,minLoc:c=1,maxLoc:t=Number.POSITIVE_INFINITY,excludeSymbol:l,excludeEntrySurfaces:u=!1,excludeTypesFiles:n=!1,requireFunctionLikeSymbol:s=!1,requireCallableSymbol:f=!1,excludeRustTraitImplMembers:K=!1,includeSuppressed:j=!1,sortByLocDesc:B=!1}=e,d=[];for(let r of this.scopedDefinitions(o)){let a=r.relativePath;if(this.db.isIgnored(a)||u&&A(this.db,a)||!H(r,{requireFunctionLikeSymbol:s,requireCallableSymbol:f})||l!==void 0&&r.symbol===l)continue;let S=y(r);S<c||S>t||n&&Y(a)||K&&x(r.symbol)||b(a)!=="test"&&(k(r.symbol)||!j&&p(this.db,a,r.startLine)||d.push(r))}return B?d.sort((r,a)=>y(a)-y(r)):d}calleeMap(e,o={}){return v(this.db,e,o)}crossFileCallerMap(e){return N(this.db,e)}sourceFallbackCallerFiles(e){return E(this.db,e)}fileDependencyGraph(e){return M(this.db,e)}fileKind(e){return b(e)}hasSuppressionComment(e){return p(this.db,e.relativePath,e.startLine)}sourceFiles(){return q(this.db)}scanSourceReferences(e,o){V(this.db,e,o)}callableSignature(e){return R(this.db,e.relativePath,e.startLine,e.endLine)}};function y(i){return i.endLine-i.startLine+1}function H(i,e){return e.requireCallableSymbol?C(i.symbol):e.requireFunctionLikeSymbol?I(i.symbol):i.isFunctionLike}function Y(i){return(i.split("/").pop()??"").includes("types")}export{G as a};
2
+ //# sourceMappingURL=chunk-UAPNU7UP.js.map
@@ -1,2 +1,2 @@
1
- import{a as m}from"./chunk-32R4VYYA.js";import{o as p}from"./chunk-QFZE73XF.js";function L(s,r){let{scope:l,minLoc:o=10,limit:u=30}=r??{},{definitions:d,callerMap:y,calleeMap:b}=f(s,l);return d.map(e=>{let a=e.endLine-e.startLine+1,n=y.get(e.symbolId)?.size??0,c=b.get(e.symbolId)??[],x=c.filter(t=>t.file!==e.relativePath),i=new Set(x.map(t=>`${t.symbol}|${t.file}`)).size,M=new Set(c.map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:a,fanIn:n,fanOut:i,calleeCount:M,score:Math.round(a/50*(n/5)*Math.max(i/5,1)*100)/100}}).filter(e=>e.loc>=o).sort((e,a)=>a.score-e.score||a.loc-e.loc).slice(0,u)}function f(s,r){let l=new m(s),o=l.productionCallableDefinitions({scope:r,requireCallableSymbol:!0,includeSuppressed:!0});return{definitions:o,callerMap:l.crossFileCallerMap(o),calleeMap:l.calleeMap(o)}}export{L as a};
2
- //# sourceMappingURL=chunk-WNMAH3P7.js.map
1
+ import{a as m}from"./chunk-UAPNU7UP.js";import{o as p}from"./chunk-QFZE73XF.js";function L(s,r){let{scope:l,minLoc:o=10,limit:u=30}=r??{},{definitions:d,callerMap:y,calleeMap:b}=f(s,l);return d.map(e=>{let a=e.endLine-e.startLine+1,n=y.get(e.symbolId)?.size??0,c=b.get(e.symbolId)??[],x=c.filter(t=>t.file!==e.relativePath),i=new Set(x.map(t=>`${t.symbol}|${t.file}`)).size,M=new Set(c.map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:a,fanIn:n,fanOut:i,calleeCount:M,score:Math.round(a/50*(n/5)*Math.max(i/5,1)*100)/100}}).filter(e=>e.loc>=o).sort((e,a)=>a.score-e.score||a.loc-e.loc).slice(0,u)}function f(s,r){let l=new m(s),o=l.productionCallableDefinitions({scope:r,requireCallableSymbol:!0,includeSuppressed:!0});return{definitions:o,callerMap:l.crossFileCallerMap(o),calleeMap:l.calleeMap(o)}}export{L as a};
2
+ //# sourceMappingURL=chunk-URCJTFOD.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-MO65UK5V.js";import{e as a}from"./chunk-2ZGHRI2A.js";import{n as u}from"./chunk-YU25IHJX.js";import{a as p}from"./chunk-ZHHMG4UC.js";import{o as l,p as c,t as f}from"./chunk-QFZE73XF.js";function T(t,r){return h(t,r)?.map(e=>({symbol:e.symbol,shortName:e.shortName,fromFile:e.fromFile}))??[]}function M(t,r){let e=E(t,r);return e.length>0?e:N(t,r)}function J(t,r){return h(t,r)?.filter(e=>!e.used).map(e=>({symbol:e.symbol,shortName:e.shortName,importedIn:e.importer}))??[]}function E(t,r){return t.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as g}from"./chunk-MO65UK5V.js";import{e as a}from"./chunk-KW2F3WSV.js";import{n as u}from"./chunk-Z4AMQWVY.js";import{a as p}from"./chunk-ZHHMG4UC.js";import{o as l,p as c,t as f}from"./chunk-QFZE73XF.js";function T(t,r){return h(t,r)?.map(e=>({symbol:e.symbol,shortName:e.shortName,fromFile:e.fromFile}))??[]}function M(t,r){let e=E(t,r);return e.length>0?e:N(t,r)}function J(t,r){return h(t,r)?.filter(e=>!e.used).map(e=>({symbol:e.symbol,shortName:e.shortName,importedIn:e.importer}))??[]}function E(t,r){return t.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -36,4 +36,4 @@ import{a as g}from"./chunk-MO65UK5V.js";import{e as a}from"./chunk-2ZGHRI2A.js";
36
36
  WHERE imp_d.relative_path = ?
37
37
  AND m.role = 2
38
38
  ORDER BY def_d.relative_path, gs.symbol`,r).filter(o=>!t.isIgnored(o.importer));if(s.length>0){let o=u(t,r);return s.map(i=>({symbol:i.symbol,shortName:l(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||o.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function F(t,r){let e=u(t,r);return e.length>0?e.map(s=>{let o=I(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:r,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function y(t,r){return a(t,r).map(e=>{let s=I(e.importedName,e.localName,e.kind),o=e.kind==="side-effect"?!0:e.used;return{symbol:s,shortName:s,fromFile:e.sourcePath??"(external)",importer:r,used:o}})}function I(t,r,e){return e==="namespace"&&t==="*"&&r?`* as ${r}`:e==="default"&&r?`default as ${r}`:e==="side-effect"?"(side effect import)":r&&r!==t?`${t} as ${r}`:t}function _(t){return t.replace(/\\/g,"/")}function R(t){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(t)}export{T as a,M as b,J as c};
39
- //# sourceMappingURL=chunk-QFCK6WV2.js.map
39
+ //# sourceMappingURL=chunk-UUIWMLDX.js.map
@@ -1,2 +1,2 @@
1
- import{c as p}from"./chunk-KTCODJNQ.js";import{d as b,e as S,l as u}from"./chunk-4X7C236P.js";import{e as y}from"./chunk-2ZGHRI2A.js";import{o as L}from"./chunk-YU25IHJX.js";import{c as x}from"./chunk-ZHHMG4UC.js";import{A as I,E as R,d,p as h}from"./chunk-QFZE73XF.js";function g(n,a,t){let e=u(n).get(t);if(!e||e.length===0)return[];if(e.length===1)return[m(e[0])];let s=e.filter(r=>r.file===a);if(s.length>0)return s.map(m);let i=F(n,a),o=i.get(t);if(o)for(let r of o){let f=e.filter(l=>w(r,l.file));if(f.length>0)return f.map(m)}let c=new Set;for(let r of i.values())for(let f of r)c.add(f);for(let r of c){let f=e.filter(l=>w(r,l.file));if(f.length>0&&f.length===e.length)return f.map(m)}return[]}function C(n,a,t){let e=g(n,a,t);if(e.length>0)return e;let s=u(n).get(t);return!s||s.length===0?[]:s.map(m)}function E(n,a){let t=x(n,a);if(!t)return[];let e=h(t.symbol);if(!e)return[];let s=L(n,{...t,leaf:e,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let r=o.get(c.file)??[];r.push(c.line),o.set(c.file,r)}return D(n,o)}let i=new Map;for(let o of p(n)){let c=d(n,o);if(!c||c.indexOf(e)===-1||o!==t.relativePath&&!g(n,o,e).some(l=>l.symbolId===t.symbolId))continue;let r=b(n,o,e,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});r.length>0&&i.set(o,r)}return D(n,i)}function A(n,a){let t=new Map;for(let i of a){if(!i.leaf)continue;let o=t.get(i.leaf)??[];o.push(i),t.set(i.leaf,o)}if(t.size===0)return new Map;let e=new Set(a.map(i=>i.symbolId)),s=new Map;for(let i of p(n)){let o=S(n,i);if(o.size!==0){for(let c of o)if(t.has(c))for(let r of g(n,i,c)){if(!e.has(r.symbolId)||i===r.relativePath)continue;let f=s.get(r.symbolId);f||(f=new Set,s.set(r.symbolId,f)),f.add(i)}}}return s}function F(n,a){let t=new Map;for(let e of y(n,a)){if(!e.sourcePath)continue;let s=e.localName??e.importedName;if(s){let i=t.get(s);i||(i=new Set,t.set(s,i)),i.add(e.sourcePath)}if(e.kind==="namespace")for(let i of e.usedMembers){let o=t.get(i);o||(o=new Set,t.set(i,o)),o.add(e.sourcePath)}}return t}function w(n,a){let t=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return t(n)===t(a)}function m(n){return{symbolId:n.symbolId,symbol:n.symbol,relativePath:n.file}}function D(n,a){let t=[],e=new Set;for(let[s,i]of a){let o=I(n,s);for(let c of i){let r=R(o,c),f=`${s}|${c}|${r?.symbol??""}`;e.has(f)||(e.add(f),t.push({file:s,line:c,enclosingSymbol:r?.symbol??null}))}}return t}export{g as a,C as b,E as c,A as d};
2
- //# sourceMappingURL=chunk-WIIZF5FP.js.map
1
+ import{c as p}from"./chunk-Y4DS3MDC.js";import{d as b,e as S,l as u}from"./chunk-3PVIYZ74.js";import{e as y}from"./chunk-KW2F3WSV.js";import{o as L}from"./chunk-Z4AMQWVY.js";import{c as x}from"./chunk-ZHHMG4UC.js";import{A as I,E as R,d,p as h}from"./chunk-QFZE73XF.js";function g(n,a,t){let e=u(n).get(t);if(!e||e.length===0)return[];if(e.length===1)return[m(e[0])];let s=e.filter(r=>r.file===a);if(s.length>0)return s.map(m);let i=F(n,a),o=i.get(t);if(o)for(let r of o){let f=e.filter(l=>w(r,l.file));if(f.length>0)return f.map(m)}let c=new Set;for(let r of i.values())for(let f of r)c.add(f);for(let r of c){let f=e.filter(l=>w(r,l.file));if(f.length>0&&f.length===e.length)return f.map(m)}return[]}function C(n,a,t){let e=g(n,a,t);if(e.length>0)return e;let s=u(n).get(t);return!s||s.length===0?[]:s.map(m)}function E(n,a){let t=x(n,a);if(!t)return[];let e=h(t.symbol);if(!e)return[];let s=L(n,{...t,leaf:e,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let r=o.get(c.file)??[];r.push(c.line),o.set(c.file,r)}return D(n,o)}let i=new Map;for(let o of p(n)){let c=d(n,o);if(!c||c.indexOf(e)===-1||o!==t.relativePath&&!g(n,o,e).some(l=>l.symbolId===t.symbolId))continue;let r=b(n,o,e,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});r.length>0&&i.set(o,r)}return D(n,i)}function A(n,a){let t=new Map;for(let i of a){if(!i.leaf)continue;let o=t.get(i.leaf)??[];o.push(i),t.set(i.leaf,o)}if(t.size===0)return new Map;let e=new Set(a.map(i=>i.symbolId)),s=new Map;for(let i of p(n)){let o=S(n,i);if(o.size!==0){for(let c of o)if(t.has(c))for(let r of g(n,i,c)){if(!e.has(r.symbolId)||i===r.relativePath)continue;let f=s.get(r.symbolId);f||(f=new Set,s.set(r.symbolId,f)),f.add(i)}}}return s}function F(n,a){let t=new Map;for(let e of y(n,a)){if(!e.sourcePath)continue;let s=e.localName??e.importedName;if(s){let i=t.get(s);i||(i=new Set,t.set(s,i)),i.add(e.sourcePath)}if(e.kind==="namespace")for(let i of e.usedMembers){let o=t.get(i);o||(o=new Set,t.set(i,o)),o.add(e.sourcePath)}}return t}function w(n,a){let t=e=>e.replace(/\\/g,"/").replace(/^\.\//,"");return t(n)===t(a)}function m(n){return{symbolId:n.symbolId,symbol:n.symbol,relativePath:n.file}}function D(n,a){let t=[],e=new Set;for(let[s,i]of a){let o=I(n,s);for(let c of i){let r=R(o,c),f=`${s}|${c}|${r?.symbol??""}`;e.has(f)||(e.add(f),t.push({file:s,line:c,enclosingSymbol:r?.symbol??null}))}}return t}export{g as a,C as b,E as c,A as d};
2
+ //# sourceMappingURL=chunk-VEXS3I3N.js.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-32R4VYYA.js";import{h as a,i}from"./chunk-4X7C236P.js";import{o as m}from"./chunk-QFZE73XF.js";function d(o,e={}){let{limit:r=20,scope:s,minFanIn:t=2,minFanOut:p=2}=e;return new c(o).productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0}).map(n=>u(o,n)).filter(n=>n.fanIn>=t&&n.fanOut>=p).sort((n,l)=>l.score-n.score||l.fanIn-n.fanIn).slice(0,r)}function u(o,e){let r=new Set(i(o,e,{limit:500}).map(t=>t.file)).size,s=new Set(a(o,e,{limit:500}).filter(t=>t.file!==e.relativePath).map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:m(e.symbol),fanIn:r,fanOut:s,score:r*s,definedIn:e.relativePath}}export{d as a};
2
- //# sourceMappingURL=chunk-ROWAEEOD.js.map
1
+ import{a as c}from"./chunk-UAPNU7UP.js";import{h as a,i}from"./chunk-3PVIYZ74.js";import{o as m}from"./chunk-QFZE73XF.js";function d(o,e={}){let{limit:r=20,scope:s,minFanIn:t=2,minFanOut:p=2}=e;return new c(o).productionCallableDefinitions({scope:s,requireCallableSymbol:!0,includeSuppressed:!0}).map(n=>u(o,n)).filter(n=>n.fanIn>=t&&n.fanOut>=p).sort((n,l)=>l.score-n.score||l.fanIn-n.fanIn).slice(0,r)}function u(o,e){let r=new Set(i(o,e,{limit:500}).map(t=>t.file)).size,s=new Set(a(o,e,{limit:500}).filter(t=>t.file!==e.relativePath).map(t=>`${t.symbol}|${t.file}`)).size;return{symbol:e.symbol,shortName:m(e.symbol),fanIn:r,fanOut:s,score:r*s,definedIn:e.relativePath}}export{d as a};
2
+ //# sourceMappingURL=chunk-VRC3WKKE.js.map
@@ -1,2 +1,2 @@
1
- import{r as S}from"./chunk-YU25IHJX.js";import{B as x,d as g,o as d,y as h,z as b}from"./chunk-QFZE73XF.js";function B(t,e={}){let{scope:s,minLoc:o=1,limit:i}=e,c=new Map;for(let r of x(t,{scope:s})){if(!r.isFunctionLike||t.isIgnored(r.relativePath))continue;let n=r.endLine-r.startLine+1;if(n<o)continue;let m=L(t,r);if(!m)continue;let u={symbol:r.symbol,shortName:d(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:n},l=c.get(m);l?l.push(u):c.set(m,[u])}let a=[];for(let[r,n]of c)n.length<2||a.push({signature:r,functions:n});return a.sort((r,n)=>{let m=n.functions.length-r.functions.length;if(m!==0)return m;let u=r.functions.reduce((f,p)=>f+p.loc,0);return n.functions.reduce((f,p)=>f+p.loc,0)-u}),i?a.slice(0,i):a}function L(t,e){let s=S(t,e);if(s)return s;let o=$(e.documentation),i=o?v(o):null;return i||w(D(t,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function $(t){return h(b(t))}function D(t,e,s,o,i){let c=g(t,e);if(!c)return null;let a=c.split(/\r?\n/),r=I(a,s,o,i);for(let n of r){let m=Math.min(a.length-1,Math.max(n,n+4)),u="";for(let l=n;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,M(u)))return u}if(u&&u.includes("("))return u}return null}function M(t){let e=t.replace(/\s+/g," ").trim();return!e.includes("(")||P(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function v(t){if(!t||!t.trim())return null;let e=t.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(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function w(t,e){if(!t||!t.trim())return null;let s=t.replace(/\s+/g," ").trim(),o=s.indexOf("(");if(o===-1)return null;let i=s.slice(0,o),a=new RegExp(`\\b${y(e)}\\b`,"i").exec(i);a&&typeof a.index=="number"&&(i=i.slice(0,a.index)),i=i.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 r=z(s.slice(o)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!r.startsWith("("))return null;let n=`${i?`${i} `:""}${r}`.replace(/\s+/g,"").toLowerCase();return n.length>=3?n:null}function z(t){let e=0,s=0,o=0,i=0,c=null,a=!1;for(let r=0;r<t.length;r+=1){let n=t[r];if(c){if(a){a=!1;continue}if(n==="\\"){a=!0;continue}n===c&&(c=null);continue}if(n==='"'||n==="'"||n==="`"){c=n;continue}if(n==="(")e+=1;else if(n===")")e=Math.max(0,e-1);else if(n==="[")o+=1;else if(n==="]")o=Math.max(0,o-1);else if(n==="<")i+=1;else if(n===">")i=Math.max(0,i-1);else if(n==="{"){if(e===0&&o===0&&i===0)return t.slice(0,r);s+=1}else if(n==="}")s=Math.max(0,s-1);else if(n==="="&&t[r+1]===">"&&e===0&&s===0&&o===0&&i===0)return t.slice(0,r)}return t}function I(t,e,s,o){let i=y(o),c=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${i}\\b`,"i"),r=[],n=new Set,m=Math.max(0,Math.min(e,t.length-1)),u=Math.max(m,Math.min(t.length-1,Math.max(s,e+4)));for(let l=m;l<=u;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}for(let l=0;l<t.length;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}return r}function P(t){let e=0;for(let s of t)s==="("&&(e+=1),s===")"&&(e-=1);return e}function y(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{B as a};
2
- //# sourceMappingURL=chunk-5LQ6CVX3.js.map
1
+ import{r as S}from"./chunk-Z4AMQWVY.js";import{B as x,d as g,o as d,y as h,z as b}from"./chunk-QFZE73XF.js";function B(t,e={}){let{scope:s,minLoc:o=1,limit:i}=e,c=new Map;for(let r of x(t,{scope:s})){if(!r.isFunctionLike||t.isIgnored(r.relativePath))continue;let n=r.endLine-r.startLine+1;if(n<o)continue;let m=L(t,r);if(!m)continue;let u={symbol:r.symbol,shortName:d(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:n},l=c.get(m);l?l.push(u):c.set(m,[u])}let a=[];for(let[r,n]of c)n.length<2||a.push({signature:r,functions:n});return a.sort((r,n)=>{let m=n.functions.length-r.functions.length;if(m!==0)return m;let u=r.functions.reduce((f,p)=>f+p.loc,0);return n.functions.reduce((f,p)=>f+p.loc,0)-u}),i?a.slice(0,i):a}function L(t,e){let s=S(t,e);if(s)return s;let o=$(e.documentation),i=o?v(o):null;return i||w(D(t,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function $(t){return h(b(t))}function D(t,e,s,o,i){let c=g(t,e);if(!c)return null;let a=c.split(/\r?\n/),r=I(a,s,o,i);for(let n of r){let m=Math.min(a.length-1,Math.max(n,n+4)),u="";for(let l=n;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,M(u)))return u}if(u&&u.includes("("))return u}return null}function M(t){let e=t.replace(/\s+/g," ").trim();return!e.includes("(")||P(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function v(t){if(!t||!t.trim())return null;let e=t.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(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function w(t,e){if(!t||!t.trim())return null;let s=t.replace(/\s+/g," ").trim(),o=s.indexOf("(");if(o===-1)return null;let i=s.slice(0,o),a=new RegExp(`\\b${y(e)}\\b`,"i").exec(i);a&&typeof a.index=="number"&&(i=i.slice(0,a.index)),i=i.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 r=z(s.slice(o)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!r.startsWith("("))return null;let n=`${i?`${i} `:""}${r}`.replace(/\s+/g,"").toLowerCase();return n.length>=3?n:null}function z(t){let e=0,s=0,o=0,i=0,c=null,a=!1;for(let r=0;r<t.length;r+=1){let n=t[r];if(c){if(a){a=!1;continue}if(n==="\\"){a=!0;continue}n===c&&(c=null);continue}if(n==='"'||n==="'"||n==="`"){c=n;continue}if(n==="(")e+=1;else if(n===")")e=Math.max(0,e-1);else if(n==="[")o+=1;else if(n==="]")o=Math.max(0,o-1);else if(n==="<")i+=1;else if(n===">")i=Math.max(0,i-1);else if(n==="{"){if(e===0&&o===0&&i===0)return t.slice(0,r);s+=1}else if(n==="}")s=Math.max(0,s-1);else if(n==="="&&t[r+1]===">"&&e===0&&s===0&&o===0&&i===0)return t.slice(0,r)}return t}function I(t,e,s,o){let i=y(o),c=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${i}\\b`,"i"),r=[],n=new Set,m=Math.max(0,Math.min(e,t.length-1)),u=Math.max(m,Math.min(t.length-1,Math.max(s,e+4)));for(let l=m;l<=u;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}for(let l=0;l<t.length;l+=1){let f=t[l]??"";(c.test(f)||a.test(f))&&!n.has(l)&&(n.add(l),r.push(l))}return r}function P(t){let e=0;for(let s of t)s==="("&&(e+=1),s===")"&&(e-=1);return e}function y(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{B as a};
2
+ //# sourceMappingURL=chunk-WFDTS7XL.js.map
@@ -0,0 +1,5 @@
1
+ import{a as l}from"./chunk-QFZE73XF.js";import{readdirSync as x}from"fs";import{extname as p,join as g}from"path";var f=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],w=[".vue"],S=new Set(f.map(e=>e.toLowerCase())),m=[...S].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function C(e,o={}){let s=o.includeIndexed??!0,i=o.includeAuxiliary??!0,t=o.extensions?.map(c=>c.toLowerCase()),r=t?new Set(t):S,a=t?[...r].sort().join(","):m,n=`${s?"1":"0"}|${i?"1":"0"}|${a}`;return h.get(e,n,()=>{let c=new Set;if(s){let u=e.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${e.pathExclusionsFor("documents")}`);for(let d of u)e.isIgnored(d.relative_path)||r.has(p(d.relative_path).toLowerCase())&&c.add(d.relative_path)}if(i)for(let u of y(e.config.projectRoot,r))e.isIgnored(u)||c.add(u);return[...c].sort()})}var h=l("source-files");function y(e,o){let s=new Set,i=t=>{let r=t?g(e,t):e,a;try{a=x(r,{withFileTypes:!0})}catch{return}for(let n of a)if(!E.has(n.name)){if(n.isDirectory()){i(t?`${t}/${n.name}`:n.name);continue}o.has(p(n.name).toLowerCase())&&s.add(t?`${t}/${n.name}`:n.name)}};return i(""),s}export{w as a,E as b,C as c};
5
+ //# sourceMappingURL=chunk-Y4DS3MDC.js.map
@@ -1,2 +1,2 @@
1
- import{h as a,i as n}from"./chunk-4X7C236P.js";import{a as m}from"./chunk-ZHHMG4UC.js";import{o as i}from"./chunk-QFZE73XF.js";function p(e,s){let o=m(e,s);if(!o)return null;let t=n(e,o,{limit:50}),r=y(a(e,o,{limit:50,additive:!0,callableOnly:!0}));return{symbol:o.symbol,shortName:i(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file}))}}function y(e){let s=new Set,o=[];for(let t of e){let r=`${t.symbol}|${t.file}`;s.has(r)||(s.add(r),o.push(t))}return o}export{p as a};
2
- //# sourceMappingURL=chunk-LT2CPEQ4.js.map
1
+ import{h as a,i as n}from"./chunk-3PVIYZ74.js";import{a as m}from"./chunk-ZHHMG4UC.js";import{o as i}from"./chunk-QFZE73XF.js";function p(e,s){let o=m(e,s);if(!o)return null;let t=n(e,o,{limit:50}),r=y(a(e,o,{limit:50,additive:!0,callableOnly:!0}));return{symbol:o.symbol,shortName:i(o.symbol),callers:t.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file})),callees:r.map(l=>({symbol:l.symbol,shortName:i(l.symbol),file:l.file}))}}function y(e){let s=new Set,o=[];for(let t of e){let r=`${t.symbol}|${t.file}`;s.has(r)||(s.add(r),o.push(t))}return o}export{p as a};
2
+ //# sourceMappingURL=chunk-YJODB2F5.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-KTCODJNQ.js";import{g as p}from"./chunk-4X7C236P.js";import{b as f}from"./chunk-QFZE73XF.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var v=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,v as g,B as h};
2
- //# sourceMappingURL=chunk-PK4U6NWP.js.map
1
+ import{c as a}from"./chunk-Y4DS3MDC.js";import{g as p}from"./chunk-3PVIYZ74.js";import{b as f}from"./chunk-QFZE73XF.js";function c(t){let r=o(t);return x(r)?"test":S(r)?"worker":y(r)?"entry":P(r)?"barrel":"source"}function _(t){return c(t)==="barrel"}function g(t){return h.get(t,()=>{let r=p(t),e=a(t).filter(s=>{let u=c(s);return u==="entry"||u==="worker"}),n=new Set,i=new Set;for(;e.length>0;){let s=e.shift();if(!n.has(s)){n.add(s),c(s)==="barrel"&&i.add(s);for(let u of r.get(s)??[])n.has(u)||e.push(u)}}return i})}var h=f("live-barrels");function b(t,r){return g(t).has(o(r))}function w(t){let r=g(t);return a(t).filter(e=>_(e)&&!r.has(e))}function D(t,r){let e=c(r);return e==="entry"||e==="worker"||b(t,r)}function E(t,r,e){let n=t.config.entryRoots;if(!n)return!1;let i=o(e);return!!(n.files?.some(s=>o(s)===i)||n.pathPrefixes?.some(s=>i.startsWith(o(s)))||n.qualifiedVars?.some(s=>$(r,s))||n.symbolPatterns?.some(s=>{try{return new RegExp(s).test(r)}catch{return!1}}))}var v=["%/__tests__/%","%.test.%","%.spec.%","%/test/%","%/tests/%","%_test.%","%_spec.%","%/test_%.%","%/spec_%.%"],B=["%/test-utils/%"];function x(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function S(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function y(t){let r=t.split("/"),e=r[r.length-1]??t;return e==="cli.ts"||e==="cli.js"||e==="postinstall.ts"||e==="postinstall.js"||e==="main.ts"||e==="main.js"||e==="main.rs"||e==="main.go"||e==="main.py"||e==="build.rs"||e==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:e==="index.ts"||e==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:r.length<=2:!1}function P(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function o(t){return t.replace(/\\/g,"/")}function $(t,r){let e=r.lastIndexOf("/");if(e<0)return!1;let n=r.slice(0,e),i=r.slice(e+1);return t.includes(l(n)+"/")&&t.includes(l(i)+".")}function l(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{c as a,_ as b,b as c,w as d,D as e,E as f,v as g,B as h};
2
+ //# sourceMappingURL=chunk-YXMHTJYY.js.map
@@ -0,0 +1,90 @@
1
+ import{A as F,b as z,p as C}from"./chunk-QFZE73XF.js";import g from"path";import{createRequire as Ye}from"module";import{existsSync as T,readdirSync as Ge,readFileSync as fe}from"fs";import{existsSync as D}from"fs";import{basename as he,dirname as y,extname as S,join as p,relative as E,resolve as f}from"path";var ye=z("indexed-paths"),N=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue"],Y=[".py",".pyi"],G=[".java",".scala",".kt",".kts"],q=[".rs"],Q=[".rb"],Z=[".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx"],ee=[".cs",".vb"],te=[".dart"],ne=[".php"],Ie=new Set(N),O=new Set(Y),re=new Set(G),P=new Set(q),A=new Set(Q),ie=new Set(Z),oe=new Set(ee),j=new Set(te),se=new Set(ne),xe=[{extensions:N,lookup:Ie},{extensions:Y,lookup:O},{extensions:G,lookup:re},{extensions:q,lookup:P},{extensions:Q,lookup:A},{extensions:Z,lookup:ie},{extensions:ee,lookup:oe},{extensions:te,lookup:j},{extensions:ne,lookup:se}];function I(n,e){return e.has(S(n).toLowerCase())}function Ee(n){return I(n,O)}function Ne(n){return I(n,re)}function be(n){return I(n,P)}function ve(n){return I(n,A)}function ke(n){return I(n,ie)}function Re(n){return I(n,oe)}function Rt(n){return S(n).toLowerCase()===".vb"}function De(n){return I(n,j)}function Te(n){return I(n,se)}function Le(n){let e=S(n).toLowerCase();for(let t of xe)if(t.lookup.has(e))return t.extensions;return N}function _e(n){return Ne(n)||Re(n)||Te(n)}function w(n,e,t){return Ee(e)?Ce(n,e,t):be(e)?Fe(n,e,t):ve(e)?Oe(n,e,t):ke(e)?Pe(n,e,t):_e(e)?Ae(n,t.replace(/\\/g,"."),Le(e)):De(e)?je(n,e,t):Me(n,e,t)}function Me(n,e,t){if(!t.startsWith(".")&&!t.startsWith("/"))return null;let r=y(p(n.config.projectRoot,e)),i=f(r,t),o=b(n);for(let s of Ke(i)){let a=x(E(n.config.projectRoot,s));if(o.has(a)||D(s))return a}return x(E(n.config.projectRoot,i))}function Ce(n,e,t){let r=b(n),i;if(t.startsWith(".")){let o=t.match(/^(\.+)(.*)$/);if(!o)return null;let s=o[1].length,a=o[2].replace(/^\./,""),c=y(p(n.config.projectRoot,e));for(let l=1;l<s;l++)c=y(c);i=a?f(c,a.replace(/\./g,"/")):c}else i=f(n.config.projectRoot,t.replace(/\./g,"/"));for(let o of we(i)){let s=x(E(n.config.projectRoot,o));if(r.has(s)||D(o))return s}return null}function Fe(n,e,t){if(!t)return null;let r=t.replace(/\s+as\s+.+$/,"").trim();if(!r.startsWith("crate::")&&!r.startsWith("self::")&&!r.startsWith("super::"))return null;let i=y(p(n.config.projectRoot,e)),o;return r.startsWith("crate::")?o=f(n.config.projectRoot,"src",r.slice(7).replace(/::/g,"/")):r.startsWith("self::")?o=f(i,r.slice(6).replace(/::/g,"/")):o=f(y(i),r.slice(7).replace(/::/g,"/")),W(n,We(o))}function Oe(n,e,t){let r=y(p(n.config.projectRoot,e)),i=f(r,t);return W(n,$e(i))}function Pe(n,e,t){let r=y(p(n.config.projectRoot,e)),i=[f(r,t),f(n.config.projectRoot,t),f(n.config.projectRoot,"include",t),f(n.config.projectRoot,"src",t)];return W(n,i)}function Ae(n,e,t){let r=b(n),i=e.replace(/\\/g,".").replace(/::/g,".").replace(/^global::/,""),o=i.replace(/\./g,"/"),s=i.split(".").pop()??i;for(let c of t){let l=`${o}${c}`,d=[...r].find(m=>m.endsWith(l));if(d)return d}for(let c of t){let l=[...r].find(d=>he(d)===`${s}${c}`);if(l)return l}let a=[...r].filter(c=>t.includes(S(c).toLowerCase())).filter(c=>c.includes(`/${o}/`)||c.includes(`/${s}/`)).sort((c,l)=>c.localeCompare(l));return a.length===1?a[0]:null}function je(n,e,t){let r=b(n);if(t.startsWith("package:")){let s=t.slice(8),a=s.indexOf("/");if(a<0)return null;let c=s.slice(a+1),l=x(c.startsWith("lib/")?c:`lib/${c}`);return r.has(l)?l:null}let i=y(p(n.config.projectRoot,e)),o=f(i,t);for(let s of Ue(o)){let a=x(E(n.config.projectRoot,s));if(r.has(a)||D(s))return a}return null}function we(n){let e=S(n);return O.has(e)?[n]:[`${n}.py`,`${n}.pyi`,p(n,"__init__.py"),p(n,"__init__.pyi")]}function W(n,e){let t=b(n);for(let r of e){let i=x(E(n.config.projectRoot,r));if(t.has(i)||D(r))return i}return null}function We(n){let e=S(n);return P.has(e)?[n]:[`${n}.rs`,p(n,"mod.rs")]}function $e(n){let e=S(n);return A.has(e)?[n]:[`${n}.rb`,p(n,"index.rb")]}function Ue(n){let e=S(n);return j.has(e)?[n]:[`${n}.dart`,n]}function Ke(n){let e=S(n),t=new Set;if(e){t.add(n);for(let r of N)t.add(n.slice(0,-e.length)+r)}else for(let r of N)t.add(`${n}${r}`),t.add(p(n,`index${r}`));return[...t]}function b(n){return ye.get(n,()=>new Set(n.all(`SELECT relative_path
2
+ FROM documents
3
+ WHERE 1 = 1
4
+ ${n.pathExclusionsFor("documents")}`).map(e=>x(e.relative_path)).filter(e=>!n.isIgnored(e))))}function x(n){return n.replace(/\\/g,"/")}import{existsSync as v,readFileSync as He,readdirSync as Xe,statSync as Je}from"fs";import u from"path";var U=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function K(n,e){let r=e?u.dirname(u.join(n,e)):n,i=u.resolve(n);for(;r.startsWith(i);){for(let s of U){let a=u.join(r,s);if(v(a))return a}let o=u.dirname(r);if(o===r)break;r=o}for(let o of U){let s=u.join(n,o);if(v(s))return s}return null}function ae(n){let e=n.config.projectRoot,t=new Set(Be(e,n.config.semantic?.typescript?.tsconfigs)),r=n.all(`SELECT relative_path
5
+ FROM documents
6
+ WHERE (
7
+ relative_path LIKE '%.ts'
8
+ OR relative_path LIKE '%.tsx'
9
+ OR relative_path LIKE '%.mts'
10
+ OR relative_path LIKE '%.cts'
11
+ OR relative_path LIKE '%.js'
12
+ OR relative_path LIKE '%.jsx'
13
+ OR relative_path LIKE '%.mjs'
14
+ OR relative_path LIKE '%.cjs'
15
+ )
16
+ ${n.pathExclusionsFor("documents")}`);for(let i of r){if(n.isIgnored(i.relative_path))continue;let o=K(e,i.relative_path);o&&t.add(u.resolve(o))}if(t.size===0){let i=K(e);i&&t.add(u.resolve(i))}return[...t].filter(i=>!ce(e,i)).sort((i,o)=>i.localeCompare(o))}function Be(n,e=[]){let t=new Set;for(let r of e){let i=u.isAbsolute(r)?r:u.join(n,r);v(i)&&t.add(u.resolve(i))}for(let r of Ve(n))for(let i of U){let o=u.join(r,i);v(o)&&t.add(u.resolve(o))}if(t.size===0){let r=K(n);r&&t.add(u.resolve(r))}return[...t].filter(r=>!ce(n,r)).sort((r,i)=>r.localeCompare(i))}function Ve(n){let e=u.join(n,"package.json");if(!v(e))return[];let t;try{t=JSON.parse(He(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>ze(n,i))}function ze(n,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=u.join(n,e);return $(s)?[s]:[]}let t=e.indexOf("*"),r=e.slice(0,t).replace(/\/$/,""),i=e.slice(t+1).replace(/^\//,""),o=u.join(n,r||".");return $(o)?Xe(o).map(s=>u.join(o,s,i)).filter($):[]}function $(n){try{return Je(n).isDirectory()}catch{return!1}}function ce(n,e){let t=u.relative(n,e).replace(/\\/g,"/");return t.startsWith("..")||t.includes("/node_modules/")||t.startsWith("node_modules/")||t.includes("/dist/")||t.startsWith("dist/")}var qe=Ye(import.meta.url),k;function pe(n,e){let t=Qe();if(!t)return H("ts-morph is not installed");let r=ae(n);if(r.length===0)return H("no tsconfig found");try{let i=r.map(o=>({tsconfigPath:o,project:new t.Project({tsConfigFilePath:o,skipFileDependencyResolution:!1})}));return new X(n,t,i)}catch(i){return H(i instanceof Error?i.message:String(i),r[0],r)}}function Qe(){if(k!==void 0)return k;try{k=qe("ts-morph")}catch{k=null}return k}function H(n,e,t){return{language:"typescript",availability:()=>({available:!1,reason:n,tsconfigPath:e,tsconfigPaths:t}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var X=class{constructor(e,t,r){this.db=e;this.tsMorph=t;this.projects=r;this.workspacePackages=rt(e.config.projectRoot)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;sourceFileCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return h(this.importUsageCache,e,()=>{let t=this.sourceFile(e);if(!t)return[];let r=[];for(let i of t.getImportDeclarations())for(let o of this.importUsageForDeclaration(e,i))r.push(o);return r})}referencesFor(e){return h(this.referencesCache,e.symbolId,()=>{let t=this.nodeForDefinition(e),r=this.packageImportReferencesForDefinition(e);return t?ut(t,e,r,this.db.config.projectRoot):r})}calleesFor(e){return h(this.calleesCache,e.symbolId,()=>h(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}signatureFor(e){return h(this.signatureCache,e.symbolId,()=>{let t=this.nodeForDefinition(e);if(!t||!this.tsMorph.Node.isFunctionDeclaration(t)&&!this.tsMorph.Node.isMethodDeclaration(t)&&!this.tsMorph.Node.isArrowFunction(t)&&!this.tsMorph.Node.isFunctionExpression(t)&&!this.tsMorph.Node.isConstructorDeclaration(t))return null;let r=t.getType().getCallSignatures()[0];if(!r)return null;let i=r.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return de(c)}),o=r.getReturnType().getText(t);return`(${i.join(",")})=>${de(o)}`})}importUsageForDeclaration(e,t){let r=w(this.db,e,t.getModuleSpecifierValue()),i=le(t);return t.getImportClause()?.isTypeOnly()?i.map(o=>tt(e,r,o)):i.map(o=>this.valueImportUsageForEntry(e,r,o))}valueImportUsageForEntry(e,t,r){let i=r.identifier?r.identifier.findReferences():[],o=[];for(let l of i)for(let d of dt(l,e,r.identifier,this.db.config.projectRoot))o.push(d);let s=o.some(l=>!ue(l.node)),a=o.some(l=>ue(l.node)),c=r.isTypeOnly;return{importer:e,sourcePath:t,importedName:r.importedName,localName:r.localName,kind:r.kind,isTypeOnly:c,isUsed:c||o.length>0,isTypeUsed:c||a,isValueUsed:s,references:o.map(l=>l.location)}}sourceFile(e){return this.sourceFileMatch(e)?.sourceFile??null}sourceFileMatch(e){return It(e)?h(this.sourceFileCache,e,()=>{let t=g.join(this.db.config.projectRoot,e);for(let{project:r}of this.projects){let i=r.getSourceFile(t)??r.addSourceFileAtPathIfExists(t)??null;if(i)return{project:r,sourceFile:i}}return null}):null}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,t=this.packageExports();for(let r of this.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,t,r);for(let[r,i]of e)e.set(r,J(i));return this.packageImportReferenceIndex=e,e}indexedTypeScriptLikeDocuments(){return this.db.all(`SELECT relative_path
17
+ FROM documents
18
+ WHERE (
19
+ relative_path LIKE '%.ts'
20
+ OR relative_path LIKE '%.tsx'
21
+ OR relative_path LIKE '%.mts'
22
+ OR relative_path LIKE '%.cts'
23
+ OR relative_path LIKE '%.js'
24
+ OR relative_path LIKE '%.jsx'
25
+ OR relative_path LIKE '%.mjs'
26
+ OR relative_path LIKE '%.cjs'
27
+ )
28
+ ${this.db.pathExclusionsFor("documents")}`).map(e=>e.relative_path)}addPackageImportReferencesForDocument(e,t,r){if(this.db.isIgnored(r))return;let i=this.sourceFileMatch(r);if(i)for(let o of i.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,t,r,o)}addPackageImportReferencesForDeclaration(e,t,r,i){let o=st(this.workspacePackages,i.getModuleSpecifierValue());if(!o)return;let s=t.get(o);if(s)for(let a of le(i)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=ft(a.identifier,r,this.db.config.projectRoot);l.length>0&&ht(e,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let t of this.workspacePackages){let r=new Map;for(let i of at(t))this.collectPackageExports(t,i,r,new Set);r.size>0&&e.set(t.name,r)}return this.packageExportIndex=e,e}collectPackageExports(e,t,r,i){if(i.has(t))return;i.add(t);let o=this.sourceFile(t);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?w(this.db,t,a):t;if(!c||!c.startsWith(`${e.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,r,i);continue}for(let d of l){let m=d.getNameNode().getText(),B=d.getAliasNode()?.getText()??m,V=this.indexedDefinitionByLeaf(c,m);if(!V)continue;let R=r.get(B);R||(R=new Set,r.set(B,R)),R.add(V.symbolId)}}}indexedDefinitionByLeaf(e,t){return h(this.indexedDefinitionLeafCache,e,()=>mt(this.db,e)).get(t)??null}nodeForDefinition(e){return h(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return h(this.fileDefinitionNodeCache,e,()=>{let t=this.sourceFile(e);if(!t)return new Map;let r=Ze(this.db,e);return r.size===0?new Map:et(this.tsMorph,t,r)})}definitionFromSymbol(e){let t=e.getDeclarations();for(let r of t){let i=r.getSourceFile(),o=_(this.db.config.projectRoot,i.getFilePath());if(!o||this.db.isIgnored(o))continue;let s=L(i,r),a=gt(this.db,o,s,e.getName());if(a)return{symbol:a.symbol,file:a.relativePath,line:a.startLine}}return null}calleeMapForFile(e){let t=this.sourceFile(e);if(!t)return new Map;let r=F(this.db,e).sort((o,s)=>o.startLine-s.startLine||s.endLine-o.endLine);if(r.length===0)return new Map;let i=new Map;t.forEachDescendant(o=>{if(!this.tsMorph.Node.isCallExpression(o)&&!this.tsMorph.Node.isNewExpression(o))return;let s=this.semanticCalleeForCallNode(t,r,o);s&&nt(i,s.callerId,s.target)});for(let[o,s]of i)i.set(o,yt(s));return i}semanticCalleeForCallNode(e,t,r){let i=St(t,L(e,r));if(!i)return null;let o=r.getExpression(),s=o.getSymbol()??o.getType().getSymbol(),a=s?this.definitionFromSymbol(s):null;return a?{callerId:i.symbolId,target:{symbol:a.symbol,file:a.file,line:a.line}}:null}};function le(n){let e=[],t=n.getDefaultImport();t&&e.push({identifier:t,importedName:"default",localName:t.getText(),kind:"default",isTypeOnly:n.getImportClause()?.isTypeOnly()??!1});let r=n.getNamespaceImport();r&&e.push({identifier:r,importedName:"*",localName:r.getText(),kind:"namespace",isTypeOnly:n.getImportClause()?.isTypeOnly()??!1});for(let i of n.getNamedImports()){let o=i.getNameNode(),a=i.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:i.isTypeOnly()||(n.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function Ze(n,e){let t=new Map;for(let r of F(n,e)){let i=C(r.symbol)??r.leaf;if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.push(r)}return t}function et(n,e,t){let r=new Map,i=new Map;return e.forEachDescendant(o=>{for(let s of pt(n,o)){let a=t.get(s);if(!a)continue;let c=L(e,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),m=i.get(l.symbolId);m!==void 0&&m<=d||(i.set(l.symbolId,d),r.set(l.symbolId,o))}}}),r}function tt(n,e,t){return{importer:n,sourcePath:e,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function nt(n,e,t){let r=n.get(e);r||(r=[],n.set(e,r)),r.push(t)}function rt(n){let e=g.join(n,"package.json");if(!T(e))return[];let t;try{t=JSON.parse(fe(e,"utf8"))}catch{return[]}return(Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[]).flatMap(i=>it(n,i)).flatMap(i=>ot(n,i))}function it(n,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=g.join(n,e);return T(g.join(s,"package.json"))?[s]:[]}let t=e.indexOf("*"),r=e.slice(0,t).replace(/\/$/,""),i=e.slice(t+1).replace(/^\//,""),o=g.join(n,r||".");if(!T(o))return[];try{return Ge(o).map(s=>g.join(o,s,i)).filter(s=>T(g.join(s,"package.json")))}catch{return[]}}function ot(n,e){try{let t=JSON.parse(fe(g.join(e,"package.json"),"utf8"));if(!t.name)return[];let r=g.relative(n,e).replace(/\\/g,"/");return[{name:t.name,rootRelative:r,sourceRootRelative:`${r}/src`}]}catch{return[]}}function st(n,e){for(let t of n)if(e===t.name||e.startsWith(`${t.name}/`))return t.name;return null}function at(n){return[`${n.sourceRootRelative}/index.ts`,`${n.sourceRootRelative}/index.tsx`,`${n.sourceRootRelative}/index.mts`,`${n.sourceRootRelative}/index.cts`]}function ct(n,e){return n.getReferences().map(t=>{let r=t.getNode();return ge(r,e)})}function lt(n){let e=n;return typeof e.findReferences=="function"?e.findReferences():[]}function ut(n,e,t,r){let i=[];for(let o of lt(n))for(let s of ct(o,r))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||i.push(s);for(let o of t)i.push(o);return J(i)}function dt(n,e,t,r){let i=[],o=t?.getStart();for(let s of n.getReferences()){let a=s.getNode();_(r,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||i.push({location:ge(a,r),node:a}))}return i}function ge(n,e){let t=n.getSourceFile(),r=t.getLineAndColumnAtPos(n.getStart());return{file:_(e,t.getFilePath())??t.getBaseName(),line:r.line-1,column:r.column-1}}function ft(n,e,t){let r=n.getSourceFile(),i=L(r,n),o=n.getText(),s=new RegExp(`\\b${xt(o)}\\b`,"g"),a=r.getFullText().split(`
29
+ `),c=[];for(let l=0;l<a.length;l++){if(l===i)continue;let d=a[l]??"";s.lastIndex=0;let m;for(;(m=s.exec(d))!==null;)c.push({file:e,line:l,column:m.index})}return J(c.filter(l=>_(t,g.join(t,l.file))===e))}function ue(n){for(let e=n;e;e=e.getParent()){let t=e.getKindName();if(t.includes("Type")||t==="InterfaceDeclaration"||t==="TypeAliasDeclaration")return!0;if(t==="CallExpression"||t==="NewExpression"||t==="ExpressionStatement")return!1}return!1}function pt(n,e){let t=[],r=i=>{i&&!t.includes(i)&&t.push(i)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let i=e.getNameNode();r(i?.getText())}if("getName"in e&&typeof e.getName=="function"){let i=e.getName();r(i)}return n.Node.isIdentifier(e)&&r(e.getText()),t}function gt(n,e,t,r){return n.all(`SELECT
30
+ gs.id AS symbolId,
31
+ gs.symbol,
32
+ d.relative_path AS relativePath,
33
+ COALESCE(der.start_line, c.start_line) AS startLine,
34
+ COALESCE(der.end_line, c.end_line) AS endLine,
35
+ COALESCE(gs.display_name, '') AS leaf,
36
+ NULL AS parentTypeName,
37
+ CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
38
+ CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
39
+ gs.kind AS kind,
40
+ gs.documentation AS documentation,
41
+ gs.enclosing_symbol AS enclosingSymbol
42
+ FROM global_symbols gs
43
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
44
+ LEFT JOIN chunks c ON c.document_id = der.document_id
45
+ JOIN documents d ON d.id = der.document_id
46
+ WHERE d.relative_path = ?
47
+ AND COALESCE(gs.display_name, gs.symbol) LIKE ?
48
+ ORDER BY ABS(COALESCE(der.start_line, c.start_line) - ?)
49
+ LIMIT 5`,e,`%${r}%`,t)[0]??null}function mt(n,e){let t=n.all(`SELECT
50
+ d.id AS documentId,
51
+ gs.id AS symbolId,
52
+ gs.symbol,
53
+ d.relative_path AS relativePath,
54
+ der.start_line AS startLine,
55
+ der.end_line AS endLine,
56
+ COALESCE(gs.display_name, '') AS leaf,
57
+ NULL AS parentTypeName,
58
+ CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
59
+ CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
60
+ gs.kind AS kind,
61
+ gs.documentation AS documentation,
62
+ gs.enclosing_symbol AS enclosingSymbol
63
+ FROM global_symbols gs
64
+ JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
65
+ JOIN documents d ON d.id = der.document_id
66
+ WHERE d.relative_path = ?
67
+ UNION ALL
68
+ SELECT
69
+ d.id AS documentId,
70
+ gs.id AS symbolId,
71
+ gs.symbol,
72
+ d.relative_path AS relativePath,
73
+ MIN(c.start_line) AS startLine,
74
+ MAX(c.end_line) AS endLine,
75
+ COALESCE(gs.display_name, '') AS leaf,
76
+ NULL AS parentTypeName,
77
+ CASE WHEN gs.kind IN (6, 12, 13) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
78
+ CASE WHEN gs.kind IN (5, 8, 11) THEN 1 ELSE 0 END AS isTypeLike,
79
+ gs.kind AS kind,
80
+ gs.documentation AS documentation,
81
+ gs.enclosing_symbol AS enclosingSymbol
82
+ FROM global_symbols gs
83
+ JOIN mentions m ON m.symbol_id = gs.id
84
+ JOIN chunks c ON c.id = m.chunk_id
85
+ JOIN documents d ON d.id = c.document_id
86
+ WHERE d.relative_path = ?
87
+ AND m.role = 1
88
+ GROUP BY gs.id, gs.symbol, d.id, d.relative_path, gs.display_name, gs.kind, gs.documentation, gs.enclosing_symbol
89
+ ORDER BY startLine, endLine`,e,e),r=new Set,i=new Map;for(let o of t){if(r.has(o.symbolId))continue;r.add(o.symbolId);let s=o.leaf||C(o.symbol);!s||i.has(s)||i.set(s,{...o,leaf:s})}return i}function St(n,e){let t=null;for(let r of n)e<r.startLine||e>r.endLine||(!t||r.startLine>=t.startLine)&&(t=r);return t}function L(n,e){return n.getLineAndColumnAtPos(e.getStart()).line-1}function J(n){let e=new Set,t=[];for(let r of n){let i=`${r.file}:${r.line}:${r.column}`;e.has(i)||(e.add(i),t.push(r))}return t}function ht(n,e,t){for(let r of e){let i=n.get(r)??[];i.push(...t),n.set(r,i)}}function yt(n){let e=new Set,t=[];for(let r of n){let i=`${r.symbol}|${r.file}|${r.line}`;e.has(i)||(e.add(i),t.push(r))}return t}function h(n,e,t){if(n.has(e))return n.get(e);let r=t();return n.set(e,r),r}function _(n,e){let t=g.relative(n||process.cwd(),e).replace(/\\/g,"/");return!t||t.startsWith("..")?null:t}function It(n){return/\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(n)}function de(n){return n.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}function xt(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}var me=new WeakMap;function Se(n,e){let t=`${n.config.projectRoot}:typescript-workspace`,r=me.get(n);r||(r=new Map,me.set(n,r));let i=r.get(t);if(i)return i;let o=pe(n,e);return r.set(t,o),o}function Kt(n,e){let t=M(n,e);return t?t.importUsage(e):[]}function Et(n,e){let t=M(n,e.relativePath);return t?t.referencesFor(e):[]}function Ht(n,e){let t=new Map;for(let r of e)for(let i of Et(n,r)){if(i.file===r.relativePath||n.isIgnored(i.file))continue;let o=t.get(r.symbolId);o||(o=new Set,t.set(r.symbolId,o)),o.add(i.file)}return t}function Xt(n,e){let t=new Map;for(let r of e){let i=M(n,r.relativePath);if(!i)continue;let o=i.calleesFor(r);o.length>0&&t.set(r.symbolId,o)}return t}function Jt(n,e){let t=M(n,e.relativePath);return t?t.signatureFor(e):null}function M(n,e){if(!Nt(e))return null;let t=Se(n,e);return t.availability().available?t:null}function Nt(n){return/\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs)$/.test(n)}export{G as a,ee as b,ne as c,Rt as d,Le as e,w as f,Ce as g,Fe as h,Oe as i,Pe as j,Ae as k,je as l,x as m,Kt as n,Et as o,Ht as p,Xt as q,Jt as r};
90
+ //# sourceMappingURL=chunk-Z4AMQWVY.js.map