scip-query 0.19.0 → 0.19.1

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 (178) hide show
  1. package/dist/augment-vue-worker.js +1 -1
  2. package/dist/{chunk-YHYTDWFT.js → chunk-24ET4VLC.js} +2 -2
  3. package/dist/{chunk-IXORBCMR.js → chunk-2NA6TYP4.js} +2 -2
  4. package/dist/{chunk-XKWEMFHP.js → chunk-2WCXKANA.js} +2 -2
  5. package/dist/{chunk-GJ3FR5WG.js → chunk-34MLC6UI.js} +2 -2
  6. package/dist/{chunk-PAZFJMXB.js → chunk-3WLRW5TC.js} +2 -2
  7. package/dist/{chunk-EZHARAL4.js → chunk-4BU54UJG.js} +2 -2
  8. package/dist/{chunk-XTSVYYAL.js → chunk-4CZJ4YJB.js} +2 -2
  9. package/dist/{chunk-TCVRJ56J.js → chunk-4FMT4HPC.js} +2 -2
  10. package/dist/{chunk-7FG5M53V.js → chunk-53SUJOJA.js} +2 -2
  11. package/dist/{chunk-YBAC3RON.js → chunk-5GOBZI34.js} +2 -2
  12. package/dist/{chunk-X36LKKVG.js → chunk-5OZCNAVM.js} +2 -2
  13. package/dist/{chunk-FMC3BI4I.js → chunk-5TEUKVSM.js} +2 -2
  14. package/dist/{chunk-WT7TOU2C.js → chunk-5W2VAEVR.js} +2 -2
  15. package/dist/{chunk-AWSRND4W.js → chunk-63P42UR6.js} +2 -2
  16. package/dist/{chunk-GNJHHPZE.js → chunk-64QITTX7.js} +2 -2
  17. package/dist/{chunk-XPYXEEDO.js → chunk-6O5JOS7T.js} +2 -2
  18. package/dist/{chunk-X65VYV2S.js → chunk-6PKO2TNZ.js} +2 -2
  19. package/dist/{chunk-X3OOU7CF.js → chunk-7SGOWD2Y.js} +2 -2
  20. package/dist/{chunk-ZXWFN7CK.js → chunk-7TJJY2C3.js} +2 -2
  21. package/dist/{chunk-OGHGTD6Z.js → chunk-AEM24WSF.js} +2 -2
  22. package/dist/{chunk-IWK562KR.js → chunk-AGTATREV.js} +2 -2
  23. package/dist/{chunk-SATRCB5O.js → chunk-AOSFSYEA.js} +2 -2
  24. package/dist/{chunk-3OSRXJKK.js → chunk-APLNTJPJ.js} +2 -2
  25. package/dist/{chunk-TDGCALH6.js → chunk-AYRHVJXW.js} +2 -2
  26. package/dist/{chunk-AM2LGOEX.js → chunk-B2WQKQKP.js} +2 -2
  27. package/dist/{chunk-F5L7WEZF.js → chunk-BBBKPOIT.js} +2 -2
  28. package/dist/{chunk-2FAJTZSX.js → chunk-BCMOTIB6.js} +2 -2
  29. package/dist/{chunk-RJLU7IMR.js → chunk-BMTBVMA3.js} +2 -2
  30. package/dist/{chunk-JFGUBZWE.js → chunk-C3KCSAQ4.js} +2 -2
  31. package/dist/{chunk-FLIF3JWA.js → chunk-CAKPEQZB.js} +2 -2
  32. package/dist/{chunk-PKAPOFF5.js → chunk-CIYUFF24.js} +2 -2
  33. package/dist/{chunk-7EI4MU5A.js → chunk-CKFMZE77.js} +2 -2
  34. package/dist/{chunk-A45K6VUK.js → chunk-DCDOGW32.js} +2 -2
  35. package/dist/{chunk-4ZCNFENR.js → chunk-DFQNE73Y.js} +2 -2
  36. package/dist/{chunk-J3U47L4Q.js → chunk-DO775SYA.js} +2 -2
  37. package/dist/{chunk-NEG77KKH.js → chunk-DRH3AD7W.js} +2 -2
  38. package/dist/{chunk-UVMME4FI.js → chunk-DZXFZAZO.js} +2 -2
  39. package/dist/{chunk-GMZYT44R.js → chunk-E3KWOHH7.js} +2 -2
  40. package/dist/{chunk-F334Z5UA.js → chunk-EMIIOOTM.js} +2 -2
  41. package/dist/{chunk-GBB2RUDN.js → chunk-ESNRT7QN.js} +130 -130
  42. package/dist/{chunk-RIGY5DDE.js → chunk-FB6IKAKZ.js} +2 -2
  43. package/dist/{chunk-BGUYAA3Q.js → chunk-FBUNGRKI.js} +2 -2
  44. package/dist/{chunk-M2TRDR25.js → chunk-FC5K7T35.js} +1 -1
  45. package/dist/{chunk-4ZHJAHLE.js → chunk-FHLYJVXF.js} +2 -2
  46. package/dist/{chunk-KWBA6FDD.js → chunk-FRXB74RQ.js} +2 -2
  47. package/dist/{chunk-BYPVNKJT.js → chunk-FTRNGQGR.js} +2 -2
  48. package/dist/{chunk-54UYBTZW.js → chunk-FUFNRZFJ.js} +2 -2
  49. package/dist/{chunk-QNMOZ3CJ.js → chunk-GAE7WCBK.js} +2 -2
  50. package/dist/{chunk-547VY366.js → chunk-GIHVWNKQ.js} +2 -2
  51. package/dist/{chunk-AEDB4WXE.js → chunk-HCS5LB6U.js} +2 -2
  52. package/dist/{chunk-UXOVHGT6.js → chunk-HFBNIIZX.js} +2 -2
  53. package/dist/{chunk-JHK2DMUQ.js → chunk-HGFDYOVB.js} +1 -1
  54. package/dist/{chunk-6SHX42QQ.js → chunk-IOOCKVUA.js} +2 -2
  55. package/dist/{chunk-XDVT7QPG.js → chunk-J4MYRIYT.js} +2 -2
  56. package/dist/{chunk-TAB7AWKO.js → chunk-J5XJWCB3.js} +2 -2
  57. package/dist/{chunk-PXJIEMND.js → chunk-JBZXJXIS.js} +2 -2
  58. package/dist/{chunk-UJL3N6TC.js → chunk-JJZRS2OP.js} +2 -2
  59. package/dist/chunk-KC2IFAAU.js +3 -0
  60. package/dist/{chunk-4XTPZ5CR.js → chunk-KMOMNTB4.js} +2 -2
  61. package/dist/{chunk-YYR7ADNB.js → chunk-KMUFGAIK.js} +2 -2
  62. package/dist/{chunk-DWN7QDTV.js → chunk-LF5CIKWZ.js} +2 -2
  63. package/dist/{chunk-ZL5Y23AJ.js → chunk-LM72NQ7T.js} +1 -1
  64. package/dist/{chunk-3KQOIXLO.js → chunk-LQUDSHLB.js} +2 -2
  65. package/dist/{chunk-VV5WJLRO.js → chunk-MP43RX4O.js} +1 -1
  66. package/dist/{chunk-D5OXYOJP.js → chunk-MQ2B33LQ.js} +1 -1
  67. package/dist/{chunk-EZGT3NJX.js → chunk-NTOBQK5H.js} +2 -2
  68. package/dist/{chunk-TOYQTO44.js → chunk-OLG2YPLS.js} +2 -2
  69. package/dist/{chunk-J65FQLDL.js → chunk-OOUJBAKJ.js} +2 -2
  70. package/dist/{chunk-PBADFBRR.js → chunk-OQ6TCHBB.js} +2 -2
  71. package/dist/{chunk-BOXAKNN6.js → chunk-PNESKY2Z.js} +2 -2
  72. package/dist/{chunk-TDZXQAH7.js → chunk-PYMZU5EG.js} +2 -2
  73. package/dist/{chunk-HOXI4F5I.js → chunk-Q2WEWIKX.js} +2 -2
  74. package/dist/{chunk-DQIJMKNE.js → chunk-QHKXGMOI.js} +2 -2
  75. package/dist/{chunk-MTFHE7ZO.js → chunk-RPEA7P5Z.js} +2 -2
  76. package/dist/{chunk-DV6B262O.js → chunk-SJ6XSCG7.js} +2 -2
  77. package/dist/{chunk-LJD7V7UO.js → chunk-SSXEYWN3.js} +2 -2
  78. package/dist/{chunk-XESK6725.js → chunk-SYGAA54M.js} +2 -2
  79. package/dist/{chunk-TC3X33N6.js → chunk-TYEGFDOP.js} +2 -2
  80. package/dist/chunk-UJKZQLDB.js +2 -0
  81. package/dist/{chunk-QB5WSOTY.js → chunk-US44MEVU.js} +2 -2
  82. package/dist/{chunk-2ZNZSNVW.js → chunk-V5WBVF6K.js} +2 -2
  83. package/dist/{chunk-S65OEY2G.js → chunk-V7J4A3AH.js} +2 -2
  84. package/dist/{chunk-J6BR4MD6.js → chunk-VIKEPD4D.js} +2 -2
  85. package/dist/{chunk-XDSB47KO.js → chunk-WAU7HVDI.js} +2 -2
  86. package/dist/{chunk-T5CSWYAZ.js → chunk-WCZAABYF.js} +2 -2
  87. package/dist/{chunk-KD6TPIXM.js → chunk-WFRET75Z.js} +2 -2
  88. package/dist/chunk-WWCZCH7W.js +3 -0
  89. package/dist/{chunk-G6RQVDTI.js → chunk-XCPE3G75.js} +2 -2
  90. package/dist/{chunk-QN67MWDU.js → chunk-XYBNOILR.js} +2 -2
  91. package/dist/{chunk-MFBXBLHA.js → chunk-XZXUMGAA.js} +2 -2
  92. package/dist/{chunk-QHOUNTDZ.js → chunk-YCSTKIYU.js} +2 -2
  93. package/dist/{chunk-ZNSLF5AC.js → chunk-YGQBJUS6.js} +2 -2
  94. package/dist/{chunk-6DHPQS72.js → chunk-YILKXTIY.js} +2 -2
  95. package/dist/{chunk-G6QQCX45.js → chunk-ZJGZCBYT.js} +2 -2
  96. package/dist/{chunk-MDDF67O2.js → chunk-ZNK6K3LB.js} +2 -2
  97. package/dist/cli.js +1 -1
  98. package/dist/{command-descriptors-SWFWGIFK.js → command-descriptors-3EJHQLQZ.js} +55 -55
  99. package/dist/direct-navigation-C2A44KFT.js +3 -0
  100. package/dist/index.js +1 -1
  101. package/dist/queries/affected.js +1 -1
  102. package/dist/queries/architecture.js +1 -1
  103. package/dist/queries/bottlenecks.js +1 -1
  104. package/dist/queries/by-kind.js +1 -1
  105. package/dist/queries/call-graph.js +1 -1
  106. package/dist/queries/change-surface.js +1 -1
  107. package/dist/queries/cleanup-plan.js +1 -1
  108. package/dist/queries/co-change.js +1 -1
  109. package/dist/queries/code.js +1 -1
  110. package/dist/queries/complexity-hotspots.js +1 -1
  111. package/dist/queries/complexity.js +1 -1
  112. package/dist/queries/convergence.js +1 -1
  113. package/dist/queries/coupling.js +1 -1
  114. package/dist/queries/cycles.js +1 -1
  115. package/dist/queries/dataflow.js +1 -1
  116. package/dist/queries/dead.js +1 -1
  117. package/dist/queries/decorative-checkers.js +1 -1
  118. package/dist/queries/deep-chains.js +1 -1
  119. package/dist/queries/deps.js +1 -1
  120. package/dist/queries/diff-gate.js +1 -1
  121. package/dist/queries/diff-impact.js +1 -1
  122. package/dist/queries/doc-drift.js +1 -1
  123. package/dist/queries/drift.js +1 -1
  124. package/dist/queries/duplicate-bodies.js +1 -1
  125. package/dist/queries/extract-candidates.js +1 -1
  126. package/dist/queries/fan.js +1 -1
  127. package/dist/queries/health.js +1 -1
  128. package/dist/queries/hierarchy.js +1 -1
  129. package/dist/queries/hotspots.js +1 -1
  130. package/dist/queries/imports.js +1 -1
  131. package/dist/queries/incomplete-migration.js +1 -1
  132. package/dist/queries/index.js +1 -1
  133. package/dist/queries/isolated.js +1 -1
  134. package/dist/queries/locality-candidates.js +1 -1
  135. package/dist/queries/members.js +1 -1
  136. package/dist/queries/methods.js +1 -1
  137. package/dist/queries/not-implemented.js +1 -1
  138. package/dist/queries/outline.js +1 -1
  139. package/dist/queries/passthrough-candidates.js +1 -1
  140. package/dist/queries/plan-context.js +1 -1
  141. package/dist/queries/react-component-duplicates.js +1 -1
  142. package/dist/queries/react-hook-candidates.js +1 -1
  143. package/dist/queries/react-large-component-pressure.js +1 -1
  144. package/dist/queries/recent-duplicates.js +1 -1
  145. package/dist/queries/redundant-reexports.js +1 -1
  146. package/dist/queries/refs.js +1 -1
  147. package/dist/queries/self-audit.js +1 -1
  148. package/dist/queries/similar-chains.js +1 -1
  149. package/dist/queries/similar-files.js +1 -1
  150. package/dist/queries/similar-signatures.js +1 -1
  151. package/dist/queries/similar.js +1 -1
  152. package/dist/queries/slice.js +1 -1
  153. package/dist/queries/stale-abstractions.js +1 -1
  154. package/dist/queries/surface.js +1 -1
  155. package/dist/queries/symbols.js +1 -1
  156. package/dist/queries/system.js +1 -1
  157. package/dist/queries/test-quality.js +1 -1
  158. package/dist/queries/trace.js +1 -1
  159. package/dist/queries/twin-ab.js +1 -1
  160. package/dist/queries/twin-drift.js +1 -1
  161. package/dist/queries/unused-imports.js +1 -1
  162. package/dist/queries/unused-params.js +1 -1
  163. package/dist/queries/vue-component-duplicates.js +1 -1
  164. package/dist/queries/vue-composable-candidates.js +1 -1
  165. package/dist/queries/vue-large-view-pressure.js +1 -1
  166. package/dist/queries/wrapper-candidates.js +1 -1
  167. package/dist/reindex-worker.js +5 -5
  168. package/dist/reindex.js +15 -15
  169. package/dist/runtime.js +1 -1
  170. package/dist/rust-semantic-session-server.js +1 -1
  171. package/dist/rust-semantic-session-worker.js +1 -1
  172. package/dist/rust-semantic-worker.js +1 -1
  173. package/dist/watch-server.js +1 -1
  174. package/package.json +1 -1
  175. package/dist/chunk-42QYU6FD.js +0 -3
  176. package/dist/chunk-AERYQJ52.js +0 -3
  177. package/dist/chunk-OYYZLJVT.js +0 -2
  178. package/dist/direct-navigation-RKMPBXMI.js +0 -3
@@ -1,2 +1,2 @@
1
- import{c as t}from"./chunk-XDVT7QPG.js";import"./chunk-VV5WJLRO.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
1
+ import{c as t}from"./chunk-J4MYRIYT.js";import"./chunk-MP43RX4O.js";import{writeFileSync as o}from"fs";import{workerData as s}from"worker_threads";var e=s;try{let r=t({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles,tasks:e.tasks});o(e.resultPath,JSON.stringify({ok:!0,result:r}))}catch(r){o(e.resultPath,JSON.stringify({ok:!1,error:r instanceof Error?r.message:String(r)}))}finally{let r=new Int32Array(e.sharedBuffer);Atomics.add(r,0,1),Atomics.notify(r,0)}
2
2
  //# sourceMappingURL=augment-vue-worker.js.map
@@ -1,2 +1,2 @@
1
- import{a as f,b as m}from"./chunk-QZ4JVECJ.js";import{a as u}from"./chunk-QNMOZ3CJ.js";import{B as g,E as d}from"./chunk-XDSB47KO.js";import{y as l}from"./chunk-M2TRDR25.js";import{readFileSync as E,readdirSync as h}from"fs";import{basename as k,join as c}from"path";function S(t,e,r={}){let a=new Set(t),n=new Set(e),o=[...n].filter(i=>!a.has(i)).sort(),s=r.allowExtra?[]:[...a].filter(i=>!n.has(i)).sort();return{missing:o,extra:s}}function b(t,e){let r=N(t,e.file,e.keys);if(!r.ok)return{name:e.name,file:e.file,status:"unavailable",missing:[],extra:[],unavailableReason:r.reason};let a=L(t.config.projectRoot,e.mustEqual),n=S(r.keys,a,{allowExtra:e.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:e.name,file:e.file,status:o,missing:n.missing,extra:n.extra}}function O(t,e){return e.map(r=>b(t,r))}function G(t,e){if(e.has(t.file))return!0;let r=t.mustEqual;switch(r.type){case"top-level-dirs":return[...e].some(a=>a===r.path||a.startsWith(`${r.path}/`));case"file-glob":return[...e].some(a=>f(r.pattern,a));case"registered-commands":return e.has("docs/COMMAND_REFERENCE.md");case"builtin-skills":return[...e].some(a=>a.startsWith("skills/"))}}function I(t){if(t.status==="unavailable")return`[coverage-contract] ${t.name}: DISCLOSED \u2014 could not evaluate (${t.unavailableReason})`;let e=[];return t.missing.length>0&&e.push(`missing ${t.missing.join(", ")}`),t.extra.length>0&&e.push(`extra ${t.extra.join(", ")}`),`[coverage-contract] ${t.name}: ${e.join("; ")}`}function N(t,e,r){return r.type==="markdown-list"?T(t,e,r.marker):R(t,e,r)}function R(t,e,r){if(!l(t,e))return{ok:!1,reason:`file not found: ${e}`};let n=g(e);if(!n)return{ok:!1,reason:`unsupported file type for ${r.type} extraction: ${e}`};let o=d(t,e);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${e}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let s=r.type==="object-literal-keys"?D(o,r.identifier):w(o,r.identifier);return s===null?{ok:!1,reason:`no ${r.type==="object-literal-keys"?"object literal":"string array"} named "${r.identifier}" found in ${e}`}:{ok:!0,keys:s}}function y(t){let e=t.childForFieldName("value");return e?e.type==="as_expression"||e.type==="satisfies_expression"?e.namedChild(0):e:null}function D(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type==="object")return $(n)}return null}function $(t){let e=new Set;for(let r of t.namedChildren)if(r.type==="pair"){let a=r.childForFieldName("key");a&&e.add(C(a.text))}else r.type==="shorthand_property_identifier"&&e.add(r.text);return[...e].sort()}function w(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type!=="array")continue;let o=new Set;for(let s of n.namedChildren)s.type==="string"&&o.add(C(s.text));return[...o].sort()}return null}function C(t){return t.length>=2&&(t[0]==="'"&&t.endsWith("'")||t[0]==='"'&&t.endsWith('"'))?t.slice(1,-1):t}function T(t,e,r){let a=l(t,e);if(!a)return{ok:!1,reason:`file not found: ${e}`};let n=v(a,r);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${r} --> ... <!-- END GENERATED ${r} --> block in ${e}`}:{ok:!0,keys:x(n)}}function v(t,e){let r=u(e),n=new RegExp(`<!--\\s*BEGIN GENERATED ${r}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${r}\\s*-->`).exec(t);return n?n[1]:null}function x(t){let e=new Set;for(let r of t.matchAll(/`([a-z][a-z0-9-]*)`/g))e.add(r[1]);for(let r of t.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))e.add(r[1]);return[...e].sort()}function L(t,e){switch(e.type){case"top-level-dirs":return p(c(t,e.path));case"file-glob":return[...new Set(m(t,e.pattern).map(r=>k(r)))].sort();case"registered-commands":return A(t);case"builtin-skills":return p(c(t,"skills"))}}function p(t){let e;try{e=h(t,{withFileTypes:!0})}catch{return[]}return e.filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>r.name).sort()}function A(t){let e;try{e=E(c(t,"docs/COMMAND_REFERENCE.md"),"utf-8")}catch{return[]}let r=v(e,"COMMAND REFERENCE");return r?x(r):[]}var z={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};export{b as a,O as b,G as c,I as d,z as e};
2
- //# sourceMappingURL=chunk-YHYTDWFT.js.map
1
+ import{a as f,b as m}from"./chunk-QZ4JVECJ.js";import{a as u}from"./chunk-GAE7WCBK.js";import{B as g,E as d}from"./chunk-WAU7HVDI.js";import{y as l}from"./chunk-FC5K7T35.js";import{readFileSync as E,readdirSync as h}from"fs";import{basename as k,join as c}from"path";function S(t,e,r={}){let a=new Set(t),n=new Set(e),o=[...n].filter(i=>!a.has(i)).sort(),s=r.allowExtra?[]:[...a].filter(i=>!n.has(i)).sort();return{missing:o,extra:s}}function b(t,e){let r=N(t,e.file,e.keys);if(!r.ok)return{name:e.name,file:e.file,status:"unavailable",missing:[],extra:[],unavailableReason:r.reason};let a=L(t.config.projectRoot,e.mustEqual),n=S(r.keys,a,{allowExtra:e.allowExtra??!1}),o=n.missing.length>0||n.extra.length>0?"violated":"ok";return{name:e.name,file:e.file,status:o,missing:n.missing,extra:n.extra}}function O(t,e){return e.map(r=>b(t,r))}function G(t,e){if(e.has(t.file))return!0;let r=t.mustEqual;switch(r.type){case"top-level-dirs":return[...e].some(a=>a===r.path||a.startsWith(`${r.path}/`));case"file-glob":return[...e].some(a=>f(r.pattern,a));case"registered-commands":return e.has("docs/COMMAND_REFERENCE.md");case"builtin-skills":return[...e].some(a=>a.startsWith("skills/"))}}function I(t){if(t.status==="unavailable")return`[coverage-contract] ${t.name}: DISCLOSED \u2014 could not evaluate (${t.unavailableReason})`;let e=[];return t.missing.length>0&&e.push(`missing ${t.missing.join(", ")}`),t.extra.length>0&&e.push(`extra ${t.extra.join(", ")}`),`[coverage-contract] ${t.name}: ${e.join("; ")}`}function N(t,e,r){return r.type==="markdown-list"?T(t,e,r.marker):R(t,e,r)}function R(t,e,r){if(!l(t,e))return{ok:!1,reason:`file not found: ${e}`};let n=g(e);if(!n)return{ok:!1,reason:`unsupported file type for ${r.type} extraction: ${e}`};let o=d(t,e);if(!o)return{ok:!1,reason:`tree-sitter parser unavailable for ${n} (${e}) \u2014 contract skipped, not silently passed`,disclosedUnavailable:{language:n,reason:"parser-unavailable"}};let s=r.type==="object-literal-keys"?D(o,r.identifier):w(o,r.identifier);return s===null?{ok:!1,reason:`no ${r.type==="object-literal-keys"?"object literal":"string array"} named "${r.identifier}" found in ${e}`}:{ok:!0,keys:s}}function y(t){let e=t.childForFieldName("value");return e?e.type==="as_expression"||e.type==="satisfies_expression"?e.namedChild(0):e:null}function D(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type==="object")return $(n)}return null}function $(t){let e=new Set;for(let r of t.namedChildren)if(r.type==="pair"){let a=r.childForFieldName("key");a&&e.add(C(a.text))}else r.type==="shorthand_property_identifier"&&e.add(r.text);return[...e].sort()}function w(t,e){for(let r of t.rootNode.descendantsOfType("variable_declarator")){if(r.childForFieldName("name")?.text!==e)continue;let n=y(r);if(n?.type!=="array")continue;let o=new Set;for(let s of n.namedChildren)s.type==="string"&&o.add(C(s.text));return[...o].sort()}return null}function C(t){return t.length>=2&&(t[0]==="'"&&t.endsWith("'")||t[0]==='"'&&t.endsWith('"'))?t.slice(1,-1):t}function T(t,e,r){let a=l(t,e);if(!a)return{ok:!1,reason:`file not found: ${e}`};let n=v(a,r);return n===null?{ok:!1,reason:`no <!-- BEGIN GENERATED ${r} --> ... <!-- END GENERATED ${r} --> block in ${e}`}:{ok:!0,keys:x(n)}}function v(t,e){let r=u(e),n=new RegExp(`<!--\\s*BEGIN GENERATED ${r}\\s*-->([\\s\\S]*?)<!--\\s*END GENERATED ${r}\\s*-->`).exec(t);return n?n[1]:null}function x(t){let e=new Set;for(let r of t.matchAll(/`([a-z][a-z0-9-]*)`/g))e.add(r[1]);for(let r of t.matchAll(/\[([a-z][a-z0-9-]*)\]\([^)]*\)/g))e.add(r[1]);return[...e].sort()}function L(t,e){switch(e.type){case"top-level-dirs":return p(c(t,e.path));case"file-glob":return[...new Set(m(t,e.pattern).map(r=>k(r)))].sort();case"registered-commands":return A(t);case"builtin-skills":return p(c(t,"skills"))}}function p(t){let e;try{e=h(t,{withFileTypes:!0})}catch{return[]}return e.filter(r=>r.isDirectory()&&!r.name.startsWith(".")).map(r=>r.name).sort()}function A(t){let e;try{e=E(c(t,"docs/COMMAND_REFERENCE.md"),"utf-8")}catch{return[]}let r=v(e,"COMMAND REFERENCE");return r?x(r):[]}var z={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0},isolated:{minLoc:3},similar:{minSimilarity:.6,limit:50,minCallees:4},duplicateBodies:{maxLoc:15,limit:50},extract:{minLoc:15,minCallees:5,limit:50},wrappers:{maxLoc:15,limit:50},passthroughs:{maxLoc:15,limit:50},stale:{minLoc:3,limit:50},drift:{},twinDrift:{minSimilarity:.3}};export{b as a,O as b,G as c,I as d,z as e};
2
+ //# sourceMappingURL=chunk-24ET4VLC.js.map
@@ -1,4 +1,4 @@
1
- import{g as En,h as x,i as pt,j as vn,k as ke,l as Tn}from"./chunk-VV5WJLRO.js";import{a as we,b as j}from"./chunk-KHE7J5ZN.js";import{a as Zt,b as er,e as tr}from"./chunk-JHK2DMUQ.js";import{readFileSync as as}from"fs";import{join as rr}from"path";var fd=4,md=5e3,cs="watch.lock",ls="watch-state.json",ps="watch-activity.json";function gd(e){return{lockPath:rr(e,cs),statePath:rr(e,ls),activityPath:rr(e,ps)}}function yd(e){try{return us(JSON.parse(as(e,"utf8")))}catch{return null}}function us(e){if(!e||typeof e!="object")return null;let t=e;return t.version!==1||typeof t.protocolVersion!="number"||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||t.worktreeId!==void 0&&(typeof t.worktreeId!="string"||t.worktreeId.length===0)||typeof t.cliVersion!="string"||!M(t.startedAt)||!M(t.heartbeatAt)||!M(t.lastActivityAt)||!ds(t.watcher)||t.idleDeadlineAt!==void 0&&!M(t.idleDeadlineAt)||t.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(t.indexGeneration)||t.lastError!==void 0&&!fs(t.lastError)||t.lastRefresh!==void 0&&!ms(t.lastRefresh)||t.typescriptSemantic!==void 0&&!gs(t.typescriptSemantic)||t.typescriptIndex!==void 0&&!ys(t.typescriptIndex)?null:t}function M(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function ds(e){if(!e||typeof e!="object"||!("state"in e))return!1;let t=e;switch(t.state){case"idle":return!0;case"waiting":return D(t.changedFiles)&&D(t.reindexAt);case"indexing":return D(t.startedAt);case"cooldown":return D(t.until)&&typeof t.dirty=="boolean";default:return!1}}function fs(e){if(!e||typeof e!="object")return!1;let t=e;return M(t.at)&&typeof t.message=="string"}function ms(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.trigger?.kind=="string"&&typeof t.result=="string"&&M(t.startedAt)&&M(t.completedAt)&&D(t.durationMs)}function gs(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.protocolVersion=="number"&&(t.state==="idle"||t.state==="ready"||t.state==="unavailable"||t.state==="error")&&D(t.requests)&&D(t.sessionsCreated)&&D(t.sessionsReused)&&D(t.sessionsRefreshed)&&D(t.sessionsReplaced)&&D(t.projectsCreated)&&(t.lastRequestAt===void 0||M(t.lastRequestAt))&&(t.lastError===void 0||typeof t.lastError=="string")&&(t.busyUntil===void 0||M(t.busyUntil))}function ys(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.protocolVersion=="number"&&(t.state==="idle"||t.state==="ready"||t.state==="unavailable"||t.state==="error")&&ae(t.requests)&&ae(t.sessionsCreated)&&ae(t.sessionsReplaced)&&ae(t.initializations)&&ae(t.programUpdates)&&ae(t.documentsEmitted)&&ae(t.documentsRemoved)&&(t.lastRequestAt===void 0||M(t.lastRequestAt))&&(t.lastDurationMs===void 0||D(t.lastDurationMs)&&t.lastDurationMs>=0)&&(t.lastError===void 0||typeof t.lastError=="string")&&(t.busyUntil===void 0||M(t.busyUntil))}function D(e){return typeof e=="number"&&Number.isFinite(e)}function ae(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}import{createHash as hs}from"crypto";import{mkdirSync as Ss,realpathSync as bs}from"fs";import{homedir as xs}from"os";import{join as ce,resolve as wn}from"path";function Is(e,t){let r=process.env.SCIP_QUERY_CACHE_DIR;if(r)return nr(r);if(t?.dbPath)return nr(wn(e,t.dbPath));let n=ir(e);return nr(n)}function kn(){let e=process.env.XDG_CACHE_HOME;return ce(e||ce(xs(),".cache"),"scip-query")}function ir(e){let t=wn(e);try{t=bs(t)}catch{}let r=hs("sha256").update(t).digest("hex").slice(0,12);return ce(kn(),"projects",r)}function or(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);return ce(kn(),"repositories",e)}function sr(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function Ed(e,t){let r=Is(e,t);return{cacheDir:r,dbPath:ce(r,"index.db"),indexPath:ce(r,"index.scip"),metaPath:ce(r,"meta.json")}}function nr(e){return Ss(e,{recursive:!0}),e}import{createHash as Es}from"crypto";import{readFileSync as vs}from"fs";import{dirname as Ts,join as ut}from"path";var ws=2,ks="typescript-index";function Cd(e){let t=ut(e,ks);return{rootDir:t,requestDir:ut(t,"requests"),responseDir:ut(t,"responses")}}function Rd(e){let t=JSON.parse(e);if(t.protocolVersion!==ws||typeof t.id!="string"||!t.id||typeof t.baseGeneration!="string"||!t.baseGeneration||typeof t.deadlineAtMs!="number"||!Number.isFinite(t.deadlineAtMs)||!Cs(t.request))throw new Error("TypeScript index service received an invalid mailbox request.");return t}function Nd(e){try{let t=JSON.parse(vs(ut(Ts(e),"meta.json"),"utf8"));return t.version!==2&&t.version!==3||t.status!=="complete"||typeof t.updatedAt!="string"||t.fingerprint===void 0?null:Es("sha256").update(JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages})).digest("hex")}catch{return null}}function Cs(e){if(!e||typeof e!="object")return!1;let t=e,r=Cn(t.modifiedFiles)?t.modifiedFiles:null,n=Cn(t.affectedFiles)?t.affectedFiles:null;return t.kind==="emit-documents"&&typeof t.tsconfigPath=="string"&&!!t.tsconfigPath&&typeof t.projectArgument=="string"&&!!t.projectArgument&&typeof t.projectIdentity=="string"&&!!t.projectIdentity&&typeof t.producerIdentity=="string"&&!!t.producerIdentity&&r!==null&&r.length>0&&new Set(r).size===r.length&&n!==null&&n.length>0&&new Set(n).size===n.length&&r.every(i=>n.includes(i))}function Cn(e){return Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.length>0)}import{spawnSync as Rs}from"child_process";import{createHash as Ns}from"crypto";import{existsSync as Ps,lstatSync as Ds,realpathSync as _s}from"fs";import{dirname as As,isAbsolute as Fs,join as Os,resolve as ft}from"path";var mt={run(e,t){let r=Nn(e,t);return r.kind==="success"?r.output:void 0},runResult:Nn},Ls=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Rn=/^[0-9a-f]{40,64}$/;function Pn(e,t=mt){let r=t.runResult(e,Ls);if(r.kind==="success"){let n=js(r.output);if(n)return Ms(n,t)}return $s(e,t)}function js(e){let t=e.split(`
1
+ import{g as En,h as x,i as pt,j as vn,k as ke,l as Tn}from"./chunk-MP43RX4O.js";import{a as we,b as j}from"./chunk-KHE7J5ZN.js";import{a as Zt,b as er,e as tr}from"./chunk-HGFDYOVB.js";import{readFileSync as as}from"fs";import{join as rr}from"path";var fd=4,md=5e3,cs="watch.lock",ls="watch-state.json",ps="watch-activity.json";function gd(e){return{lockPath:rr(e,cs),statePath:rr(e,ls),activityPath:rr(e,ps)}}function yd(e){try{return us(JSON.parse(as(e,"utf8")))}catch{return null}}function us(e){if(!e||typeof e!="object")return null;let t=e;return t.version!==1||typeof t.protocolVersion!="number"||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||t.worktreeId!==void 0&&(typeof t.worktreeId!="string"||t.worktreeId.length===0)||typeof t.cliVersion!="string"||!M(t.startedAt)||!M(t.heartbeatAt)||!M(t.lastActivityAt)||!ds(t.watcher)||t.idleDeadlineAt!==void 0&&!M(t.idleDeadlineAt)||t.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(t.indexGeneration)||t.lastError!==void 0&&!fs(t.lastError)||t.lastRefresh!==void 0&&!ms(t.lastRefresh)||t.typescriptSemantic!==void 0&&!gs(t.typescriptSemantic)||t.typescriptIndex!==void 0&&!ys(t.typescriptIndex)?null:t}function M(e){return typeof e=="string"&&Number.isFinite(Date.parse(e))}function ds(e){if(!e||typeof e!="object"||!("state"in e))return!1;let t=e;switch(t.state){case"idle":return!0;case"waiting":return D(t.changedFiles)&&D(t.reindexAt);case"indexing":return D(t.startedAt);case"cooldown":return D(t.until)&&typeof t.dirty=="boolean";default:return!1}}function fs(e){if(!e||typeof e!="object")return!1;let t=e;return M(t.at)&&typeof t.message=="string"}function ms(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.trigger?.kind=="string"&&typeof t.result=="string"&&M(t.startedAt)&&M(t.completedAt)&&D(t.durationMs)}function gs(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.protocolVersion=="number"&&(t.state==="idle"||t.state==="ready"||t.state==="unavailable"||t.state==="error")&&D(t.requests)&&D(t.sessionsCreated)&&D(t.sessionsReused)&&D(t.sessionsRefreshed)&&D(t.sessionsReplaced)&&D(t.projectsCreated)&&(t.lastRequestAt===void 0||M(t.lastRequestAt))&&(t.lastError===void 0||typeof t.lastError=="string")&&(t.busyUntil===void 0||M(t.busyUntil))}function ys(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.protocolVersion=="number"&&(t.state==="idle"||t.state==="ready"||t.state==="unavailable"||t.state==="error")&&ae(t.requests)&&ae(t.sessionsCreated)&&ae(t.sessionsReplaced)&&ae(t.initializations)&&ae(t.programUpdates)&&ae(t.documentsEmitted)&&ae(t.documentsRemoved)&&(t.lastRequestAt===void 0||M(t.lastRequestAt))&&(t.lastDurationMs===void 0||D(t.lastDurationMs)&&t.lastDurationMs>=0)&&(t.lastError===void 0||typeof t.lastError=="string")&&(t.busyUntil===void 0||M(t.busyUntil))}function D(e){return typeof e=="number"&&Number.isFinite(e)}function ae(e){return typeof e=="number"&&Number.isInteger(e)&&e>=0}import{createHash as hs}from"crypto";import{mkdirSync as Ss,realpathSync as bs}from"fs";import{homedir as xs}from"os";import{join as ce,resolve as wn}from"path";function Is(e,t){let r=process.env.SCIP_QUERY_CACHE_DIR;if(r)return nr(r);if(t?.dbPath)return nr(wn(e,t.dbPath));let n=ir(e);return nr(n)}function kn(){let e=process.env.XDG_CACHE_HOME;return ce(e||ce(xs(),".cache"),"scip-query")}function ir(e){let t=wn(e);try{t=bs(t)}catch{}let r=hs("sha256").update(t).digest("hex").slice(0,12);return ce(kn(),"projects",r)}function or(e){if(!/^[a-f0-9]{24}$/.test(e))throw new Error(`invalid repository cache identity: ${e}`);return ce(kn(),"repositories",e)}function sr(e){return process.env.SCIP_QUERY_SHARED_CACHE!=="0"&&!process.env.SCIP_QUERY_CACHE_DIR&&!process.env.SCIP_QUERY_INDEX_DB&&!e?.dbPath}function Ed(e,t){let r=Is(e,t);return{cacheDir:r,dbPath:ce(r,"index.db"),indexPath:ce(r,"index.scip"),metaPath:ce(r,"meta.json")}}function nr(e){return Ss(e,{recursive:!0}),e}import{createHash as Es}from"crypto";import{readFileSync as vs}from"fs";import{dirname as Ts,join as ut}from"path";var ws=2,ks="typescript-index";function Cd(e){let t=ut(e,ks);return{rootDir:t,requestDir:ut(t,"requests"),responseDir:ut(t,"responses")}}function Rd(e){let t=JSON.parse(e);if(t.protocolVersion!==ws||typeof t.id!="string"||!t.id||typeof t.baseGeneration!="string"||!t.baseGeneration||typeof t.deadlineAtMs!="number"||!Number.isFinite(t.deadlineAtMs)||!Cs(t.request))throw new Error("TypeScript index service received an invalid mailbox request.");return t}function Nd(e){try{let t=JSON.parse(vs(ut(Ts(e),"meta.json"),"utf8"));return t.version!==2&&t.version!==3||t.status!=="complete"||typeof t.updatedAt!="string"||t.fingerprint===void 0?null:Es("sha256").update(JSON.stringify({version:t.version,status:t.status,updatedAt:t.updatedAt,fingerprint:t.fingerprint,indexedLanguages:t.indexedLanguages})).digest("hex")}catch{return null}}function Cs(e){if(!e||typeof e!="object")return!1;let t=e,r=Cn(t.modifiedFiles)?t.modifiedFiles:null,n=Cn(t.affectedFiles)?t.affectedFiles:null;return t.kind==="emit-documents"&&typeof t.tsconfigPath=="string"&&!!t.tsconfigPath&&typeof t.projectArgument=="string"&&!!t.projectArgument&&typeof t.projectIdentity=="string"&&!!t.projectIdentity&&typeof t.producerIdentity=="string"&&!!t.producerIdentity&&r!==null&&r.length>0&&new Set(r).size===r.length&&n!==null&&n.length>0&&new Set(n).size===n.length&&r.every(i=>n.includes(i))}function Cn(e){return Array.isArray(e)&&e.every(t=>typeof t=="string"&&t.length>0)}import{spawnSync as Rs}from"child_process";import{createHash as Ns}from"crypto";import{existsSync as Ps,lstatSync as Ds,realpathSync as _s}from"fs";import{dirname as As,isAbsolute as Fs,join as Os,resolve as ft}from"path";var mt={run(e,t){let r=Nn(e,t);return r.kind==="success"?r.output:void 0},runResult:Nn},Ls=["rev-parse","--show-toplevel","--absolute-git-dir","--git-common-dir","HEAD","HEAD^{tree}"],Rn=/^[0-9a-f]{40,64}$/;function Pn(e,t=mt){let r=t.runResult(e,Ls);if(r.kind==="success"){let n=js(r.output);if(n)return Ms(n,t)}return $s(e,t)}function js(e){let t=e.split(`
2
2
  `).map(c=>c.trim());if(t.length!==5)return;let[r,n,i,o,s]=t;if(!r||!n||!i||!o||!s||!Rn.test(o)||!Rn.test(s))return;let a=le(r);return{root:a,gitDir:le(dt(a,n)),commonDir:le(dt(a,i)),headCommit:o,treeOid:s}}function Ms(e,t){let r=t.run(e.root,["status","--porcelain=v1","-z","--untracked-files=all"]);return r===void 0?void 0:{...Dn(e.root,e.gitDir),commonDir:e.commonDir,repositoryId:cr("repository",e.commonDir),headCommit:e.headCommit,treeOid:e.treeOid,clean:r.length===0}}function $s(e,t){let r=Gs(e,t);if(r.kind!=="worktree")return;let n=r.identity,i=n.projectRoot,o=t.run(i,["rev-parse","--git-common-dir"])?.trim();if(!o)return;let s=le(dt(i,o)),a=ar(t.run(i,["rev-parse","--verify","HEAD"])),c=ar(t.run(i,["rev-parse","--verify","HEAD^{tree}"])),l=t.run(i,["status","--porcelain=v1","-z","--untracked-files=all"]);if(l!==void 0)return{...n,commonDir:s,repositoryId:cr("repository",s),headCommit:a,treeOid:c,clean:l.length===0}}function Gs(e,t=mt){let r=t.runResult(e,["rev-parse","--show-toplevel"]);if(r.kind==="not-repository")return{kind:"non-git"};if(r.kind==="error")return r;let n=r.output.trim();if(!n)return{kind:"error",message:"Git returned an empty worktree root."};let i=le(n),o=t.run(i,["rev-parse","--absolute-git-dir"])?.trim();if(!o)return{kind:"error",message:"Git did not return an absolute worktree directory."};let s=le(dt(i,o));return{kind:"worktree",identity:Dn(i,s)}}function Dn(e,t){return{projectRoot:e,gitDir:t,worktreeId:cr("worktree",`${e}\0${t}`)}}function Ws(e,t=mt){let r=t.run(e,["worktree","list","--porcelain","-z"]);return r===void 0?[]:Vs(r)}function Vs(e){let t=[],r;for(let n of e.split("\0")){if(n===""){r&&t.push(r),r=void 0;continue}let i=n.indexOf(" "),o=i<0?n:n.slice(0,i),s=i<0?"":n.slice(i+1);if(o==="worktree"){r&&t.push(r),r={path:le(s),detached:!1,bare:!1,prunable:!1,locked:!1};continue}r&&(o==="HEAD"?r.head=s:o==="branch"?r.branch=s:o==="detached"?r.detached=!0:o==="bare"?r.bare=!0:o==="prunable"?r.prunable=!0:o==="locked"&&(r.locked=!0))}return r&&t.push(r),t}function Od(e,t,r=mt){return ar(r.run(e,t))}function dt(e,t){return Fs(t)?t:ft(e,t)}function le(e){try{return _s(e)}catch{return ft(e)}}function cr(e,t){return Ns("sha256").update(`${e}\0${t}`).digest("hex").slice(0,24)}function ar(e){return e?.trim()||void 0}function Nn(e,t){let r=Rs("git",["-C",e,...t],{encoding:"utf-8",env:{...process.env,LC_ALL:"C"},maxBuffer:52428800,stdio:["ignore","pipe","pipe"]});if(r.status===0)return{kind:"success",output:r.stdout.trimEnd()};let i=(typeof r.stderr=="string"?r.stderr.trim():"")||r.error?.message||`git exited with status ${r.status??"unknown"}`,o=r.error?.code;return(/not a git repository/i.test(i)||o==="ENOENT"&&Ps(ft(e)))&&!Bs(e)?{kind:"not-repository"}:{kind:"error",message:i}}function Bs(e){if(process.env.GIT_DIR||process.env.GIT_COMMON_DIR)return!0;let t=ft(e);for(;;){try{return Ds(Os(t,".git")),!0}catch(n){let i=n.code;if(i!=="ENOENT"&&i!=="ENOTDIR")return!0}let r=As(t);if(r===t)return!1;t=r}}import{randomUUID as _n}from"crypto";import{closeSync as An,mkdirSync as Us,openSync as Fn,readFileSync as On,unlinkSync as Ln,writeFileSync as jn}from"fs";import{dirname as Hs,join as qs}from"path";function Mn(e,t={}){return lr(qs(e,"gc.lock"),t)}function lr(e,t={}){let r=t.waitMs??0,n=t.pollMs??10,i=t.now??Date.now,o=Date.now()+r;Us(Hs(e),{recursive:!0});do{let s=_n();try{let a=Fn(e,"wx");try{let c={version:1,pid:process.pid,token:s,startedAt:new Date(i()).toISOString()};jn(a,`${JSON.stringify(c)}
3
3
  `)}finally{An(a)}return{release:()=>Gn(e,s)}}catch(a){if(a.code!=="EEXIST")return null;let c=$n(e);if(c&&(c.pid===void 0||!we(c.pid))){zs(e,c);continue}if(Date.now()>=o)return null;Js(Math.min(n,Math.max(1,o-Date.now())))}}while(Date.now()<=o);return null}function $n(e){try{let t=On(e,"utf8"),r=JSON.parse(t),n=typeof r.pid=="number"&&Number.isSafeInteger(r.pid)&&r.pid>0?r.pid:void 0;return{raw:t,...n===void 0?{}:{pid:n}}}catch{return null}}function zs(e,t){let r=`${e}.reclaim`,n=_n(),i;try{i=Fn(r,"wx")}catch{return!1}try{jn(i,`${JSON.stringify({version:1,pid:process.pid,token:n,startedAt:new Date().toISOString()})}
4
4
  `)}finally{An(i)}try{let o=$n(e);return!o||o.raw!==t.raw||o.pid!==void 0&&we(o.pid)?!1:(Ln(e),!0)}catch{return!1}finally{Gn(r,n)}}function Gn(e,t){try{let r=JSON.parse(On(e,"utf8"));r.pid===process.pid&&r.token===t&&Ln(e)}catch{}}function Js(e){let t=new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));Atomics.wait(t,0,0,e)}import Xs from"better-sqlite3";var Ys=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],Wn=class{db;config;pathFilter;statementCache=new Map;constructor(t,r){this.config=t,this.pathFilter=r??null,this.db=new Xs(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000"),this.db.pragma("query_only = ON"),this.db.pragma("temp_store = MEMORY"),this.db.pragma("cache_size = -64000"),this.db.pragma("mmap_size = 268435456")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
@@ -117,4 +117,4 @@ import{g as En,h as x,i as pt,j as vn,k as ke,l as Tn}from"./chunk-VV5WJLRO.js";
117
117
  `:" ",i+=1;continue}let o=e[i];if(o===";"){let s=zt(e,i);n+=Go(e.slice(i,s)),i=s;continue}if(o==='"'){let s=ct(e,i,0).index;n+=Go(e.slice(i,s)),i=s;continue}n+=o,i+=1}return n}function Zp(e){let t=0;for(;t<e.length&&(t=yn(e,t),!(t>=e.length));){let r=Yt(e,t);if(!r){t+=1;continue}if(Bp(r.form))return r.form;t=r.index}return null}function Yt(e,t){let r=yn(e,t);if(e.startsWith("#?@",r)||e.startsWith("#?",r))return eu(e,r);if(e.startsWith("#_",r)){let i=Yt(e,r+2);return i?{form:{type:"atom",text:"",start:r,end:i.index},index:i.index}:null}for(;ln(e[r]);)r+=1;let n=e[r];return n?n==="("?dn(e,r,"list",")"):n==="["?dn(e,r,"vector","]"):n==="{"?dn(e,r,"map","}"):n==='"'?{form:{type:"atom",text:"",start:r,end:ct(e,r,0).index},index:ct(e,r,0).index}:ru(e,r):null}function eu(e,t){let r=e.startsWith("#?@",t)?3:2,n=Yt(e,t+r);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?tu(n.form.children):[],start:t,end:n.index},index:n.index}:null}function tu(e){let t=[];for(let r=0;r<e.length;r+=2){let n=L(e[r]),i=e[r+1];n?.startsWith(":")&&i&&t.push(i)}return t}function dn(e,t,r,n){let i=[],o=t+1;for(;o<e.length;){if(o=yn(e,o),e[o]===n)return{form:{type:r,children:i,start:t,end:o+1},index:o+1};let s=Yt(e,o);if(!s){o+=1;continue}s.form.type==="atom"&&s.form.text===""||i.push(s.form),o=s.index}return{form:{type:r,children:i,start:t,end:e.length},index:e.length}}function ru(e,t){let r=t;for(;r<e.length&&!pn(e[r]);)r+=1;return{form:{type:"atom",text:e.slice(t,r),start:t,end:r},index:r}}function yn(e,t){let r=t;for(;r<e.length;){let n=e[r];if(/\s|,/.test(n)){r+=1;continue}if(n===";"){r=zt(e,r);continue}break}return r}function Go(e){return e.replace(/[^\r\n]/g," ")}function Vo(e,t,r){let n=[];for(let i of r.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=i[1]?.trim(),s=i[2]?.trim()??null,a=i[0];if(!o||!a||typeof i.index!="number")continue;let c=oe(r,i.index,i.index+a.length);n.push({importedName:o,localName:s,sourcePath:Gt(e,t,o),kind:s?"namespace":"side-effect",used:s?w(c,s):!0,usedMembers:s?Oe(c,s):[]})}return n}function Bo(e,t,r){let n=[];for(let i of r.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=i[1]?.trim();o&&n.push({specifier:o,sourcePath:Gt(e,t,o)})}return n}function Uo(e,t,r){return Jt(e,t,{csharp:n=>iu(e,t,n),vb:n=>nu(e,t,n)},()=>{let n=po(t)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return F(r,n,(i,o)=>{let s=i[1]?.trim();if(!s)return[];let[a,c]=s.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??s,u=p.split(".").pop()??p,d=l?a?.trim()??u:u;return[W(e,t,o,p,u,d,h(e,p,re))]})})}function nu(e,t,r){let n=S(r,new Set(["imports_statement"])),i=[];for(let o of r.rootNode.descendantsOfType("imports_statement")){let s=o.namedChildren.filter(d=>d.type==="namespace_name");if(s.length===0)continue;let a=s[s.length-1],c=s.length>1?s[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;i.push(g(p,u,h(e,l,re),n,c?"namespace":"named"))}return i}function iu(e,t,r){let n=S(r,new Set(["using_directive"])),i=[];for(let o of r.rootNode.descendantsOfType("using_directive")){let s=o.namedChildren;if(s.length===0)continue;let a=null,c;s.length>=2&&s[0].type==="identifier"&&(s[1].type==="qualified_name"||s[1].type==="identifier")?(a=s[0],c=s[1]):c=s[s.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;i.push(g(p,u,h(e,l,re),n,a?"namespace":"named"))}return i}var ou=x("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function Ho(e,t){return ou.get(e,t,()=>{let r=new Set,n=N(e,t);if(!n)return r;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,s=>s.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,s=>s.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,s=>s.replace(/[^\r\n]/g," "));for(let s of o.matchAll(/[A-Za-z_$][\w$]*/g))r.add(s[0]);return r})}function hn(e,t,r){return O(e,t,n=>au(e,t,n),()=>su(e,t,r))}function su(e,t,r){return Su(r).flatMap(n=>bu(e,t,n.clause,n.specifier,n.start,n.end,r))}function au(e,t,r){let n=cu(e,t,r),i=[];for(let o of r.rootNode.descendantsOfType("import_statement"))i.push(...lu(e,t,r,o,n));return i}function cu(e,t,r){let n=S(r,new Set(["import_statement"]));if(be(t))for(let i of Ho(e,t))n.add(i);return n}function lu(e,t,r,n,i){let o=mu(n);if(!o)return[];let s=ne(e,t,o),a=P(n,"import_clause");return a?pu(r,a,s,i,gu(n.text)):[Ie("*",s)]}function pu(e,t,r,n,i){let o=[];for(let s of t.namedChildren)if(s.type==="identifier")o.push(uu(s.text,r,n,i));else if(s.type==="namespace_import"){let a=du(e,s,r,n,i);a&&o.push(a)}else s.type==="named_imports"&&o.push(...fu(s,r,n,i));return o}function uu(e,t,r,n){return g("default",e,t,r,"default",{isTypeOnly:n})}function du(e,t,r,n,i){let s=P(t,"identifier")?.text??"";if(!s)return null;let a=hu(e,s);return Ee("*",r,{localName:s,usedMembers:a,isTypeOnly:i,used:a.length>0||n.has(s)})}function fu(e,t,r,n){let i=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let s=o.namedChild(0),a=o.namedChild(1);if(!s)continue;let c=s.text,l=a?.text??c;i.push(g(c,l,t,r,"named",{isTypeOnly:n||yu(o.text)}))}return i}function mu(e){let t=P(e,"string");if(!t)return null;let r=P(t,"string_fragment");return r?r.text:null}function gu(e){return/^\s*import\s+type\b/.test(e)}function yu(e){return/^\s*type\b/.test(e.trim())}function hu(e,t){let r=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let i=n.namedChild(0),o=n.namedChild(1);!i||!o||i.type!=="identifier"||i.text!==t||(o.type==="property_identifier"||o.type==="identifier")&&r.add(o.text)}return[...r]}function Su(e){let t=[],r=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(r)){let o=i[0],s=i[1],a=i[2];!o||!a||typeof i.index!="number"||t.push({clause:s,specifier:a,start:i.index,end:i.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let i of e.matchAll(n)){let o=i[0],s=i[1];!o||!s||typeof i.index!="number"||t.push({clause:null,specifier:s,start:i.index,end:i.index+o.length})}return t.sort((i,o)=>i.start-o.start)}function bu(e,t,r,n,i,o,s){let a=ne(e,t,n),c=oe(s,i,o);return r?xu(r).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=Oe(c,p.localName);return Ee(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||w(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?Ie(p.importedName,p.sourcePath):X(p.importedName,p.localName??"",p.sourcePath,p.localName?w(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[Ie("*",a)]}function xu(e){let t=e.trim(),r=/^type\b/.test(t),n=t.replace(/^type\s+/,""),[i,o]=Iu(n),s=[];return i&&s.push(...qo(i,r)),o&&s.push(...qo(o,r)),s}function qo(e,t){let r=e.trim();if(!r)return[];if(r.startsWith("{")){let n=r.slice(1,-1).trim();return n?k(n).map(i=>{let o=i.trim(),s=t||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:s}}):[]}return r.startsWith("* as ")?[{importedName:"*",localName:r.slice(5).trim(),kind:"namespace",isTypeOnly:t}]:[{importedName:"default",localName:r,kind:"default",isTypeOnly:t}]}function Iu(e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(n==="{"&&t++,n==="}"&&t--,n===","&&t===0)return[e.slice(0,r).trim(),e.slice(r+1).trim()]}return[e.trim(),null]}function Sn(e,t,r){let n=B(e,t);return n?Cu(e,t,n):Eu(e,t,r)}function Eu(e,t,r){return[...vu(e,t,r),...Tu(e,t,r),...wu(e,t,r)]}function vu(e,t,r){let n=[],i=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of r.matchAll(i)){if(typeof o.index!="number")continue;let s=o[1]??"",a=o[2]??"",c=k(s).map(u=>ku(u.trim())).filter(u=>!!u),l=Le(r,o.index),p=Le(r,o.index+o[0].length-1);n.push({kind:"named",sourcePath:ne(e,t,a),names:c,startLine:l,endLine:p})}return n}function Tu(e,t,r){let n=[],i=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of r.matchAll(i)){if(typeof o.index!="number")continue;let s=o[2]??"",a=Le(r,o.index),c=Le(r,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:ne(e,t,s),names:[],startLine:a,endLine:c})}return n}function wu(e,t,r){let n=[],i=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of r.matchAll(i)){if(typeof o.index!="number")continue;let s=o[1]??"",a=Le(r,o.index),c=Le(r,o.index+o[0].length-1);n.push({kind:"star",sourcePath:ne(e,t,s),names:[],startLine:a,endLine:c})}return n}function ku(e){if(!e)return null;let t=e.replace(/^type\s+/,"").trim();if(!t)return null;let r=t.match(/^(\w+)\s+as\s+(\w+)$/);if(r)return r[2]??null;let n=t.match(/^(\w+)$/);return n?n[1]??null:null}function Le(e,t){let r=0;for(let n=0;n<t&&n<e.length;n++)e.charCodeAt(n)===10&&r++;return r}function Cu(e,t,r){let n=[];for(let i of r.rootNode.descendantsOfType("export_statement")){let o=Ru(e,t,i);if(o===void 0)continue;let s=i.startPosition.row,a=i.endPosition.row,c=Nu(i,o,s,a);n.push(c)}return n}function Ru(e,t,r){let n=P(r,"string");if(!n)return;let i=P(n,"string_fragment");if(i)return ne(e,t,i.text)}function Nu(e,t,r,n){let i=P(e,"export_clause");if(i){let s=[];for(let a of i.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&s.push((l??c).text)}return{kind:"named",sourcePath:t,names:s,startLine:r,endLine:n}}return P(e,"namespace_export")?{kind:"star-as",sourcePath:t,names:[],startLine:r,endLine:n}:{kind:"star",sourcePath:t,names:[],startLine:r,endLine:n}}function zo(e,t,r){return Jt(e,t,{java:n=>Pu(e,t,n),kotlin:n=>Du(e,t,n),scala:n=>_u(e,t,n)},()=>F(r,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,i)=>{let o=n[1]?.trim();return o?Au(e,t,o,i):[]}))}function Pu(e,t,r){let n=S(r,new Set(["import_declaration"])),i=[];for(let o of r.rootNode.descendantsOfType("import_declaration")){let s=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(s){i.push(Ee("*",h(e,l,R)));continue}let p=l.split(".").pop()??l;i.push(g(p,p,h(e,l,R),n))}return i}function Du(e,t,r){let n=S(r,new Set(["import_header","import_list"])),i=[];for(let o of r.rootNode.descendantsOfType("import_header")){let s=o.namedChildren.find(m=>m.type==="identifier");if(!s)continue;let a=o.namedChildren.some(m=>m.type==="wildcard_import"),c=o.namedChildren.find(m=>m.type==="import_alias");if(a){i.push(Ee("*",h(e,s.text,R)));continue}let l=s.text,p=l.split(".").pop()??l,d=c?.namedChild(0)?.text??p;i.push(g(p,d,h(e,l,R),n))}return i}function _u(e,t,r){let n=S(r,new Set(["import_declaration"])),i=[];for(let o of r.rootNode.descendantsOfType("import_declaration")){let s=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==s&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(s?.type==="namespace_wildcard"){i.push(Ee("*",h(e,c,R)));continue}if(s?.type==="namespace_selectors"){for(let u of s.namedChildren)if(u.type==="arrow_renamed_identifier"){let[d,m]=u.namedChildren;if(!d)continue;let y=d.text,ve=m?.text??y;if(y==="_")continue;i.push(g(y,ve,h(e,`${c}.${y}`,R),n))}else if(u.type==="identifier"){let d=u.text;i.push(g(d,d,h(e,`${c}.${d}`,R),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;i.push(g(l,l,h(e,p&&a.length>1?`${p}.${l}`:c,R),n))}return i}function Au(e,t,r,n){if(r.includes("{")&&r.includes("}")){let i=r.slice(0,r.indexOf("{")).replace(/\.$/,"").trim(),o=r.slice(r.indexOf("{")+1,r.lastIndexOf("}")).trim();return k(o).flatMap(s=>{let a=s.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),d=p==="_"?i:`${i}.${p}`.replace(/\.\./g,".");return[W(e,t,n,d,p,u)]})}return[W(e,t,n,r,r.split(".").pop()??r,r.split(".").pop()??r)]}function Xo(e,t,r){return O(e,t,n=>Fu(e,t,n),()=>F(r,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?k(o).flatMap(s=>{let a=s.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,d=(l??u).trim();return[W(e,t,i,p,u,d,h(e,p.replace(/\\/g,"."),ye))]}):[]}))}function Fu(e,t,r){let n=S(r,new Set(["namespace_use_declaration"])),i=[],o=(s,a,c)=>{i.push(g(a,c,h(e,s.replace(/\\/g,"."),ye),n))};for(let s of r.rootNode.descendantsOfType("namespace_use_declaration")){let a=s.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=s.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:d}=Jo(l,c);p&&o(d,p,u)}continue}for(let c of s.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=Jo(c,"");l&&o(u,l,p)}}return i}function Jo(e,t){let r=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),i="";r?i=r.text:n.length>=1&&(i=n[0].text);let o=r&&n.length>0?n[n.length-1]:null,s=i.split("\\").pop()??i,a=o?.text??s,c=t?`${t}\\${i}`:i;return{importedName:s,localName:a,qualified:c}}function Ko(e,t,r){return O(e,t,n=>Ou(e,t,n),()=>ju(r).flatMap(n=>$u(e,t,n,r)))}function Ou(e,t,r){let n=S(r,new Set(["import_statement","import_from_statement"])),i=[];for(let o of r.rootNode.descendantsOfType("import_statement"))for(let s of o.namedChildren){let a=Yo(s);if(!a)continue;let c=Fe(e,t,a.qualifiedName);i.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of r.rootNode.descendantsOfType("import_from_statement")){let s=o.namedChild(0);if(!s)continue;let a=Lu(s);if(a===null)continue;let c=Fe(e,t,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){i.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=Yo(p);u&&i.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return i}function Yo(e){if(e.type==="aliased_import"){let t=e.namedChild(0),r=e.namedChild(1);return!t||!r?null:{qualifiedName:t.text,localName:r.text}}if(e.type==="dotted_name"){let t=e.text;return{qualifiedName:t,localName:t.split(".")[0]??t}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function Lu(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let t=P(e,"import_prefix")?.text??"",r=P(e,"dotted_name")?.text??"";return`${t}${r}`}return null}function ju(e){let t=e.split(`
118
118
  `),r=[],n=0;for(let i=0;i<t.length;i++){let o=t[i],s=o.trimStart(),a=n;if(n+=o.length+1,!s.startsWith("import ")&&!s.startsWith("from "))continue;let c=o,l=a+o.length,p=nn(o);for(;i+1<t.length&&(p>0||c.trimEnd().endsWith("\\"));){i++;let d=t[i];c+=`
119
119
  ${d}`,l+=1+d.length,p+=nn(d),n+=d.length+1}let u=Mu(c);u&&r.push({...u,start:a,end:l})}return r}function Mu(e){let t=e.replace(/\\\s*\n/g," ").trim();if(t.startsWith("import "))return{kind:"import",module:null,clause:t.slice(7).trim()};let r=t.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!r)return null;let n=r[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:r[1],clause:n}}function $u(e,t,r,n){let i=oe(n,r.start,r.end),o=r.clause.replace(/\n/g," ").trim();if(r.kind==="import")return k(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),d=p.trim(),m=(u??d.split(".")[0]??d).trim(),y=Fe(e,t,d),ve=Oe(i,m);return[{importedName:d,localName:m,sourcePath:y,kind:"namespace",used:w(i,m)||ve.length>0,usedMembers:ve}]});let s=r.module?Fe(e,t,r.module):null,a=[];for(let c of k(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:s,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),d=(u??p).trim();a.push({importedName:p.trim(),localName:d,sourcePath:s,kind:"named",used:w(i,d),usedMembers:[]})}return a}import{basename as Gu}from"path";function Qo(e,t,r){return O(e,t,n=>Vu(e,t,n),()=>Wu(e,t,r))}function Wu(e,t,r){return F(r,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,i)=>{let o=n[1],s=n[2];if(!o||!s)return[];let a=o==="require_relative"?Mt(e,t,s):null;if(a){let c=Zo(s);return[X(c,c,a,w(i,c))]}return[Ie(s,a)]})}function Vu(e,t,r){let n=S(r,new Set([])),i=[],o=new Set(["require","require_relative","load"]);for(let s of r.rootNode.descendantsOfType("call")){let a=s.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=s.namedChildren.find(m=>m.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(m=>m.type==="string_content")?.text;if(!u)continue;let d=a.text==="require_relative"?Mt(e,t,u):null;if(d){let m=Zo(u);i.push(g(m,m,d,n))}else i.push(Ie(u,d))}return i}function Zo(e){return jo(Gu(e).replace(/\.[^.]+$/,""),/_/)}function es(e,t,r){return O(e,t,n=>Bu(e,t,n),()=>F(r,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,i)=>{let o=n[1]?.trim();return o?Uu(e,t,o,i):[]}))}function Bu(e,t,r){let n=S(r,new Set(["use_declaration"])),i=[];for(let o of r.rootNode.descendantsOfType("use_declaration")){let s=o.namedChild(0);if(s)for(let a of lt(s,"")){if(!a.importedName||a.importedName==="*")continue;let c=z(e,t,a.qualifiedName)??z(e,t,a.qualifiedName.split("::").slice(0,-1).join("::"));i.push(g(a.importedName,a.localName,c,n))}}return i}function lt(e,t){switch(e.type){case"identifier":case"super":case"crate":{let r=e.text;return[{qualifiedName:Kt(t,r),importedName:r,localName:r}]}case"self":{let r=t.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:t||"self",importedName:r,localName:r}]}case"scoped_identifier":{let r=e.text,n=r.split("::").pop()??r;return[{qualifiedName:Kt(t,r),importedName:n,localName:n}]}case"scoped_use_list":{let r=e.namedChild(0),n=e.namedChild(1);if(!r||!n)return[];let i=Kt(t,r.text),o=[];for(let s of n.namedChildren)o.push(...lt(s,i));return o}case"use_list":{let r=[];for(let n of e.namedChildren)r.push(...lt(n,t));return r}case"use_as_clause":{let r=e.namedChild(0),n=e.namedChild(1);if(!r||!n)return[];let i=lt(r,t),o=n.text;return i.map(s=>({...s,localName:o}))}case"use_wildcard":{let r=e.namedChild(0),n=r?r.text:"";return[{qualifiedName:Kt(t,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function Kt(e,t){return e?t?`${e}::${t}`:e:t}function Uu(e,t,r,n){let i=r.trim();if(i.includes("{")&&i.includes("}")){let p=i.slice(0,i.indexOf("{")).replace(/::$/,"").trim(),u=i.slice(i.indexOf("{")+1,i.lastIndexOf("}")).trim();return k(u).flatMap(d=>{let m=d.trim();if(!m)return[];if(m==="self"){let Qt=p.split("::").filter(Boolean).pop();return Qt?[W(e,t,n,p,Qt,Qt)]:[]}let[y,ve]=m.split(/\s+as\s+/),Te=y?.trim();if(!Te)return[];let os=(ve??Te.split("::").pop()??Te).trim(),ss=`${p}::${Te}`.replace(/::::/g,"::");return[W(e,t,n,ss,Te.split("::").pop()??Te,os,z(e,t,p))]})}let[o,s]=i.split(/\s+as\s+/),a=o?.trim()??i,c=(s??a.split("::").pop()??a).trim(),l=z(e,t,a)??z(e,t,a.split("::").slice(0,-1).join("::"));return[W(e,t,n,a,a.split("::").pop()??a,c,l)]}function ts(e,t,r){let n=B(e,t);if(n)return Hu(e,t,n);let i=[];for(let o of r.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let s=o[1]?.trim();s&&i.push(...zu(e,t,s))}return i}function Hu(e,t,r){let n=[];for(let i of r.rootNode.descendantsOfType("use_declaration")){if(!qu(i))continue;let o=i.namedChildren.find(s=>s.type!=="visibility_modifier");if(o)for(let s of lt(o,""))s.importedName&&n.push(bn(e,t,s.qualifiedName))}return n}function qu(e){for(let t of e.children)if(t.type==="visibility_modifier"&&t.text.startsWith("pub"))return!0;return!1}function zu(e,t,r){let n=r.trim();if(n.includes("{")&&n.includes("}")){let i=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return k(o).flatMap(s=>{let a=s.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${i}::${c?.trim()??a}`.replace(/::::/g,"::");return[bn(e,t,l)]})}return[bn(e,t,n)]}function bn(e,t,r){return{specifier:r,sourcePath:z(e,t,r)??z(e,t,r.split("::").slice(0,-1).join("::"))}}function se({language:e,extensions:t,imports:r,parseImports:n}){return{language:e,extensions:t,capabilities:{imports:r},parseImports:n}}function rs(e,t){let r=t.toLowerCase();for(let n of e)for(let i of n.extensions)if(r.endsWith(i))return n;return null}var Ju={language:"javascript",extensions:me,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:hn,parseReExports:Sn},Xu=se({language:"python",extensions:At,imports:"ast-with-regex-fallback",parseImports:Ko}),Yu=se({language:"jvm",extensions:R,imports:"ast-dispatch-with-regex-fallback",parseImports:zo}),Ku={language:"rust",extensions:Ft,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:es,parseExports:ts},Qu=se({language:"ruby",extensions:Ot,imports:"ast-with-regex-fallback",parseImports:Qo}),Zu=se({language:"c/cpp",extensions:Lt,imports:"ast-with-regex-fallback",parseImports:$o}),ed=se({language:"dotnet",extensions:re,imports:"ast-dispatch-with-regex-fallback",parseImports:Uo}),td={language:"dart",extensions:jt,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:Vo,parseExports:Bo},rd=se({language:"php",extensions:ye,imports:"ast-with-regex-fallback",parseImports:Xo}),nd=se({language:"clojure",extensions:Ae,imports:"regex-only",parseImports:Wo}),id=[Ju,Xu,Yu,Ku,Qu,Zu,ed,td,rd,nd];function xn(e){return rs(id,e)}var In={clearGroups:["whole-project","source-file"]},od=x("source-imports",In),jh=x("source-exports",In),sd=x("source-reexports",In),ns=tt({kind:"source-imports",invalidation:rt("source-imports"),serialize:ad,deserialize:cd}),is=tt({kind:"source-reexports",invalidation:rt("source-reexports"),serialize:ld,deserialize:pd});function Mh(e,t){let r=T(t);return sd.get(e,r,()=>{let n=xn(r);if(!n?.parseReExports)return[];let i=N(e,r);if(!i)return[];let o=je(e,r,i),s=rn(e),a=is.read(e,r,o);if(a?.resolutionFingerprint===s)return a.reExports;let c=n.parseReExports(e,r,i);return is.write(e,r,o,{resolutionFingerprint:s,reExports:c}),c})}function $h(e,t){let r=T(t);return od.get(e,r,()=>{let n=xn(r);if(!n)return[];let i=N(e,r);if(!i)return[];let o=je(e,r,i),s=rn(e),a=ns.read(e,r,o);if(a?.resolutionFingerprint===s)return a.imports;let c=n.parseImports(e,r,i);return ns.write(e,r,o,{resolutionFingerprint:s,imports:c}),c})}function ad(e){return JSON.stringify(e)}function cd(e){try{let t=JSON.parse(e);return!mr(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.imports)?null:{resolutionFingerprint:t.resolutionFingerprint,imports:t.imports}}catch{return null}}function ld(e){return JSON.stringify(e)}function pd(e){try{let t=JSON.parse(e);return!mr(t)||typeof t.resolutionFingerprint!="string"||!Array.isArray(t.reExports)?null:{resolutionFingerprint:t.resolutionFingerprint,reExports:t.reExports}}catch{return null}}export{Pn as a,Gs as b,Ws as c,Od as d,dt as e,le as f,Mn as g,lr as h,Wn as i,yt as j,je as k,Bn as l,Xd as m,tt as n,Fm as o,rt as p,N as q,lg as r,B as s,Dp as t,Mp as u,jm as v,no as w,el as x,ne as y,mr as z,Kd as A,he as B,Mh as C,$h as D,fd as E,md as F,gd as G,yd as H,M as I,Wc as J,$m as K,Bc as L,Vm as M,Bm as N,Um as O,qm as P,rf as Q,cf as R,mf as S,gf as T,kn as U,ir as V,sr as W,Ed as X,wf as Y,kf as Z,Cf as _,Rf as $,Of as aa,Lf as ba,jf as ca,Mf as da,Ri as ea,Uf as fa,Pr as ga,hm as ha,Sm as ia,bm as ja,Ye as ka,xm as la,Im as ma,Em as na,xc as oa,Ic as pa,Cm as qa,Rm as ra,ws as sa,Cd as ta,Rd as ua,Nd as va};
120
- //# sourceMappingURL=chunk-IXORBCMR.js.map
120
+ //# sourceMappingURL=chunk-2NA6TYP4.js.map
@@ -1,2 +1,2 @@
1
- import{s as u}from"./chunk-M2TRDR25.js";function x(e,i){let l=new Map;return e.forEach((t,f)=>{let o=new Set;for(let r of i(t)){if(o.has(r))continue;o.add(r);let n=l.get(r);n?n.push(f):l.set(r,[f])}}),{candidatesFor:(t,f)=>{let o=new Set;for(let r of i(t)){let n=l.get(r);if(n)for(let a of n)a!==f&&o.add(a)}return[...o].sort((r,n)=>r-n)}}}function R(e){let i=c(e.profile?.name),l=()=>{let t=[];i=c(e.profile?.name,e);let f=(r,n)=>{let a=e.profiles[r],s=e.profiles[n];i.candidatePairs+=1,i.comparedPairs+=1;let d=e.compare(a,s);d&&t.push(d)};if(e.filePattern){let r=e.profiles.findIndex(n=>n.file.includes(e.filePattern));if(r>=0){let n=e.profiles[r];for(let a of m(e,r)){let s=e.profiles[a];e.focusFiles&&!e.focusFiles.has(n.file)&&!e.focusFiles.has(s.file)||f(r,a)}}}else if(e.focusFiles?.size!==0){let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let n=0;n<e.profiles.length;n+=1){let a=e.profiles[n],s=e.focusFiles?.has(a.file)??!1;for(let d of p(e,n))e.focusFiles&&!s&&!e.focusFiles.has(e.profiles[d].file)||f(n,d);if(t.length>r){i.overrunApplied=!0;break}}}t.sort(e.sort??((r,n)=>n.similarity-r.similarity)),i.matchedResults=t.length;let o=t.slice(0,e.limit);return i.emittedResults=o.length,e.onProfile?.({...i}),o};return e.profile?u(`pairwise-profile:${e.profile.name}`,l,()=>({...b(e.profile?.metadata),...i})):l()}function m(e,i){if(e.candidateIndex)return P(e,i,-1);let l=[];for(let t=0;t<e.profiles.length;t+=1)t!==i&&l.push(t);return l}function p(e,i){if(e.candidateIndex)return P(e,i,i);let l=[];for(let t=i+1;t<e.profiles.length;t+=1)l.push(t);return l}function P(e,i,l){let t=e.profiles[i],f=new Set;for(let o of e.candidateIndex?.candidatesFor(t,i,e.profiles)??[])o<=l||o!==i&&(o<0||o>=e.profiles.length||f.add(o));return[...f].sort((o,r)=>o-r)}function c(e,i){return{pipeline:e,profileCount:i?.profiles.length??0,focusedProfileCount:i?.focusFiles?i.profiles.filter(l=>i.focusFiles.has(l.file)).length:0,candidatePairs:0,comparedPairs:0,matchedResults:0,emittedResults:0,candidateIndexApplied:i?.candidateIndex!==void 0,focusApplied:i?.focusFiles!==void 0,filePatternApplied:i?.filePattern!==void 0,overrunApplied:!1}}function b(e){return typeof e=="function"?e():e??{}}export{x as a,R as b};
2
- //# sourceMappingURL=chunk-XKWEMFHP.js.map
1
+ import{s as u}from"./chunk-FC5K7T35.js";function x(e,i){let l=new Map;return e.forEach((t,f)=>{let o=new Set;for(let r of i(t)){if(o.has(r))continue;o.add(r);let n=l.get(r);n?n.push(f):l.set(r,[f])}}),{candidatesFor:(t,f)=>{let o=new Set;for(let r of i(t)){let n=l.get(r);if(n)for(let a of n)a!==f&&o.add(a)}return[...o].sort((r,n)=>r-n)}}}function R(e){let i=c(e.profile?.name),l=()=>{let t=[];i=c(e.profile?.name,e);let f=(r,n)=>{let a=e.profiles[r],s=e.profiles[n];i.candidatePairs+=1,i.comparedPairs+=1;let d=e.compare(a,s);d&&t.push(d)};if(e.filePattern){let r=e.profiles.findIndex(n=>n.file.includes(e.filePattern));if(r>=0){let n=e.profiles[r];for(let a of m(e,r)){let s=e.profiles[a];e.focusFiles&&!e.focusFiles.has(n.file)&&!e.focusFiles.has(s.file)||f(r,a)}}}else if(e.focusFiles?.size!==0){let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let n=0;n<e.profiles.length;n+=1){let a=e.profiles[n],s=e.focusFiles?.has(a.file)??!1;for(let d of p(e,n))e.focusFiles&&!s&&!e.focusFiles.has(e.profiles[d].file)||f(n,d);if(t.length>r){i.overrunApplied=!0;break}}}t.sort(e.sort??((r,n)=>n.similarity-r.similarity)),i.matchedResults=t.length;let o=t.slice(0,e.limit);return i.emittedResults=o.length,e.onProfile?.({...i}),o};return e.profile?u(`pairwise-profile:${e.profile.name}`,l,()=>({...b(e.profile?.metadata),...i})):l()}function m(e,i){if(e.candidateIndex)return P(e,i,-1);let l=[];for(let t=0;t<e.profiles.length;t+=1)t!==i&&l.push(t);return l}function p(e,i){if(e.candidateIndex)return P(e,i,i);let l=[];for(let t=i+1;t<e.profiles.length;t+=1)l.push(t);return l}function P(e,i,l){let t=e.profiles[i],f=new Set;for(let o of e.candidateIndex?.candidatesFor(t,i,e.profiles)??[])o<=l||o!==i&&(o<0||o>=e.profiles.length||f.add(o));return[...f].sort((o,r)=>o-r)}function c(e,i){return{pipeline:e,profileCount:i?.profiles.length??0,focusedProfileCount:i?.focusFiles?i.profiles.filter(l=>i.focusFiles.has(l.file)).length:0,candidatePairs:0,comparedPairs:0,matchedResults:0,emittedResults:0,candidateIndexApplied:i?.candidateIndex!==void 0,focusApplied:i?.focusFiles!==void 0,filePatternApplied:i?.filePattern!==void 0,overrunApplied:!1}}function b(e){return typeof e=="function"?e():e??{}}export{x as a,R as b};
2
+ //# sourceMappingURL=chunk-2WCXKANA.js.map
@@ -1,3 +1,3 @@
1
- import{a as d}from"./chunk-UXOVHGT6.js";import{b as g,d as m}from"./chunk-TDGCALH6.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
1
+ import{a as d}from"./chunk-HFBNIIZX.js";import{b as g,d as m}from"./chunk-AYRHVJXW.js";function _(n,f){let a=d(n,f);if(!a)return[];let t=n.get(`SELECT symbol, enclosing_symbol FROM global_symbols
2
2
  WHERE id = ? LIMIT 1`,a.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],e=t.enclosing_symbol,r=1,c=new Set([t.symbol]);for(;e&&!c.has(e)&&r<20;){c.add(e);let s=n.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",e);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:r}),e=s.enclosing_symbol,r++}if(o.length>1)return o;let y=g(t.symbol);if("kind"in y)return o;let l=y.descriptors;if(l.length<=1)return o;let b=[o[0]];for(let s=l.length-2,h=1;s>=0;s--,h++){let p=l.slice(0,s+1).map(i=>i.suffix==="method"?`${i.name}()`:i.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");b.push({symbol:p,shortName:p,depth:h})}return b}export{_ as a};
3
- //# sourceMappingURL=chunk-GJ3FR5WG.js.map
3
+ //# sourceMappingURL=chunk-34MLC6UI.js.map
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-ZXWFN7CK.js";import{f as M}from"./chunk-F334Z5UA.js";import{j as N}from"./chunk-QB5WSOTY.js";import{d as w,g as y,i as x}from"./chunk-TDGCALH6.js";import{E as R}from"./chunk-XDSB47KO.js";import{execFileSync as g}from"child_process";import{existsSync as U,readFileSync as j}from"fs";import{basename as A}from"path";var q="Unable to compute git diff.";function Ne(e,n={}){let i=n.plan??H(e,n);return i.note?Y(i.note,i.changedFileLines):i.changedFiles.length===0?V(i.changedFileLines):Z(i.changedFiles,[J(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function H(e,n={}){let{base:i="HEAD"}=n;try{let t=K(e.config.projectRoot,i),r=t.changedFileLines,s=ie(e,r),a=re(e,t.changedRanges);return{changedFileLines:r,changedFiles:s,changedRanges:a,renamedFiles:ee(e.config.projectRoot,i,s,t),note:r.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:q}}}function J(e,n,i,t=[]){let r=new _(e),s=new Set(i),a=v(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(be),d=u.filter(f=>oe(f,a)),l=le(e,u,d,a),m=fe([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=pe(e,p),z=he(e,p,i),C=m.filter(f=>(F.get(f.symbolId)??0)===0),I=E(()=>N(e,C)),W=C.filter(f=>(I.get(f.symbolId)?.size??0)===0),G=E(()=>M(e,W));for(let f of m)ge(e,f,s,o,c,I.get(f.symbolId)??new Set,G.get(f.symbolId)??new Set,F.get(f.symbolId)??0,z.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Z(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=ye(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function Y(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function V(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function K(e,n){let i=g("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ne([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...T(r)])],changedRanges:O([...P(s),...P(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function L(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function _e(e,n,i=[]){let t=Q(e,n,i);return r=>(t.has(r)||t.set(r,L(e,n,r)),t.get(r)??null)}function ve(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function Q(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=t.map(o=>`${n}:./${o}
1
+ import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-7TJJY2C3.js";import{f as M}from"./chunk-EMIIOOTM.js";import{j as N}from"./chunk-US44MEVU.js";import{d as w,g as y,i as x}from"./chunk-AYRHVJXW.js";import{E as R}from"./chunk-WAU7HVDI.js";import{execFileSync as g}from"child_process";import{existsSync as U,readFileSync as j}from"fs";import{basename as A}from"path";var q="Unable to compute git diff.";function Ne(e,n={}){let i=n.plan??H(e,n);return i.note?Y(i.note,i.changedFileLines):i.changedFiles.length===0?V(i.changedFileLines):Z(i.changedFiles,[J(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function H(e,n={}){let{base:i="HEAD"}=n;try{let t=K(e.config.projectRoot,i),r=t.changedFileLines,s=ie(e,r),a=re(e,t.changedRanges);return{changedFileLines:r,changedFiles:s,changedRanges:a,renamedFiles:ee(e.config.projectRoot,i,s,t),note:r.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:q}}}function J(e,n,i,t=[]){let r=new _(e),s=new Set(i),a=v(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(be),d=u.filter(f=>oe(f,a)),l=le(e,u,d,a),m=fe([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=pe(e,p),z=he(e,p,i),C=m.filter(f=>(F.get(f.symbolId)??0)===0),I=E(()=>N(e,C)),W=C.filter(f=>(I.get(f.symbolId)?.size??0)===0),G=E(()=>M(e,W));for(let f of m)ge(e,f,s,o,c,I.get(f.symbolId)??new Set,G.get(f.symbolId)??new Set,F.get(f.symbolId)??0,z.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Z(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=ye(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function Y(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function V(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function K(e,n){let i=g("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ne([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...T(r)])],changedRanges:O([...P(s),...P(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function L(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function _e(e,n,i=[]){let t=Q(e,n,i);return r=>(t.has(r)||t.set(r,L(e,n,r)),t.get(r)??null)}function ve(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function Q(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=t.map(o=>`${n}:./${o}
2
2
  `).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return X(a,t)}catch{for(let s of t)r.set(s,L(e,n,s));return r}}function X(e,n){let i=new Map,t=0;for(let r of n){let s=e.indexOf(10,t);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(t,s).toString("utf-8");if(t=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,c,u]=o,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(t+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let l=e.subarray(t,t+d);i.set(r,c==="blob"?l.toString("utf-8"):null),t+=d,e[t]===10&&(t+=1)}return i}function ee(e,n,i,t){if(i.length===0)return[];let r=new Map,s=new Set;for(let o of t.renamedFiles)i.includes(o.to)&&(r.set(o.to,o),s.add(o.from));let a=t.deletedFiles;if(a.length===0)return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to));for(let o of i){if(r.has(o)||!U(`${e}/${o}`))continue;let c=a.filter(l=>!s.has(l)).filter(l=>A(l)===A(o));if(c.length===0)continue;let u=j(`${e}/${o}`,"utf-8"),d=c.map(l=>({from:l,to:o,similarity:te(L(e,n,l)??"",u)})).sort((l,m)=>m.similarity-l.similarity)[0];d&&d.similarity>=.45&&(r.set(o,d),s.add(d.from))}return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to))}function ne(e){let n=new Set,i=new Map,t=new Set;for(let r of e.flatMap(s=>T(s))){let[s,a,o]=r.split(" ");if(!(!s||!a)){if(s.startsWith("R")&&o){n.add(o),i.set(o,{from:a,to:o,similarity:Number(s.slice(1))/100});continue}n.add(a),s.startsWith("D")&&t.add(a)}}return{changedFiles:[...n],renamedFiles:[...i.values()],deletedFiles:[...t]}}function te(e,n){let i=new Set(B(e)),t=new Set(B(n));if(i.size===0&&t.size===0)return 1;if(i.size===0||t.size===0)return 0;let r=0;for(let s of i)t.has(s)&&(r+=1);return 2*r/(i.size+t.size)}function B(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function T(e){return e.split(`
3
3
  `).map(n=>n.trim()).filter(n=>n.length>0)}function ie(e,n){let i=$(e),t=[];for(let r of n){let s=i(r);s&&!e.isIgnored(s)&&t.push(s)}return t}function re(e,n){let i=$(e),t=[];for(let r of n){let s=i(r.file);s&&!e.isIgnored(s)&&t.push({...r,file:s})}return O(t)}function $(e){let n=e.all(`SELECT relative_path FROM documents
4
4
  ORDER BY id`).map(t=>t.relative_path),i=new Map(n.map(t=>[t,t]));return t=>{let r=t.replace(/\\/g,"/"),s=i.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function P(e){let n=[],i=null;for(let t of e.split(`
@@ -15,4 +15,4 @@ import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-ZXWFN7CK.js";
15
15
  AND m.role != 1
16
16
  AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
17
17
  ${e.pathExclusionsFor("ref_d")}`,...n,...i),r=new Map;for(let s of t){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function S(e,n,i,t,r){if(e.isIgnored(t)||n.has(t))return;let s=i.get(t);s||(s=new Set,i.set(t,s)),s.add(r)}function ye(e){return[...e.entries()].map(([n,i])=>({file:n,consumedSymbols:i.size})).sort((n,i)=>i.consumedSymbols-n.consumedSymbols)}function be(e){return!(x(e.symbol)||e.parentTypeName!==null&&!y(e.symbol))}function Se(e,n){return y(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{q as a,Ne as b,H as c,J as d,Z as e,L as f,_e as g,ve as h,Q as i,ae as j};
18
- //# sourceMappingURL=chunk-PAZFJMXB.js.map
18
+ //# sourceMappingURL=chunk-3WLRW5TC.js.map
@@ -1,2 +1,2 @@
1
- import{e as M}from"./chunk-AERYQJ52.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{n as I}from"./chunk-QB5WSOTY.js";import{d as D}from"./chunk-MTDBHTSF.js";import{d as b,j as h,p as x,q as y,t as L}from"./chunk-TDGCALH6.js";import{a as g,e as S}from"./chunk-QNMOZ3CJ.js";import{y as d}from"./chunk-M2TRDR25.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.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=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.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 o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
2
- //# sourceMappingURL=chunk-EZHARAL4.js.map
1
+ import{e as M}from"./chunk-WWCZCH7W.js";import{b as $}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{n as I}from"./chunk-US44MEVU.js";import{d as D}from"./chunk-MTDBHTSF.js";import{d as b,j as h,p as x,q as y,t as L}from"./chunk-AYRHVJXW.js";import{a as g,e as S}from"./chunk-GAE7WCBK.js";import{y as d}from"./chunk-FC5K7T35.js";var B=new Set(D());function X(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=w(e,F(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=P(t);return r?m.slice(0,r):m}function F(e,n){let s=L(e,{scope:n.scope}).filter(i=>v(i)&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),$(s,n.scanLimit)}function v(e){return!e.isFunctionLike||h(e.symbol)?!1:e.kind===null||B.has(e.kind)}function w(e,n,s){let i=[];for(let a of n){let o=G(e,a,s);o&&i.push({signature:o,definition:a,fn:z(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=C(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?M(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function z(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function P(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function C(e){return e<=5?"<=5":e<=20?"6-20":">20"}function G(e,n,s){if(s.semantic){let c=I(e,n);if(c)return c}let i=k(n.documentation),r=i?A(i):null;return r||E(N(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function k(e){return x(y(e))}function N(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=O(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,q(u)))return u}if(u&&u.includes("("))return u}return null}function q(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function A(e){if(!e||!e.trim())return null;let n=e.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=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function E(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.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 o=R(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function R(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function O(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{X as a};
2
+ //# sourceMappingURL=chunk-4BU54UJG.js.map
@@ -1,2 +1,2 @@
1
- import{b}from"./chunk-DV6B262O.js";import{m as d,x as f}from"./chunk-TDGCALH6.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
- //# sourceMappingURL=chunk-XTSVYYAL.js.map
1
+ import{b}from"./chunk-SJ6XSCG7.js";import{m as d,x as f}from"./chunk-AYRHVJXW.js";function S(a,g){let p=b(a,g),i=f(a,p,{sort:!0});if(i.length===0)return[];let o=i.map(e=>({symbol:e.symbol,shortName:e.shortName,startLine:e.startLine,endLine:e.endLine,signature:e.signature,children:[]})),s=new Map;for(let e of o)s.set(e.symbol,e);let c=[];for(let e=0;e<i.length;e++){let r=i[e],n=o[e];if(r.enclosingSymbol&&s.has(r.enclosingSymbol)){s.get(r.enclosingSymbol).children.push(n);continue}let l=null,m=1/0;for(let t of o)if(t!==n&&t.startLine<=n.startLine&&t.endLine>=n.endLine){if(t.startLine===n.startLine&&t.endLine===n.endLine&&!d(t.symbol,n.symbol))continue;let u=t.endLine-t.startLine;u<m&&(m=u,l=t)}l?l.children.push(n):c.push(n)}return c}export{S as a};
2
+ //# sourceMappingURL=chunk-4CZJ4YJB.js.map
@@ -1,2 +1,2 @@
1
- import{a as R,b as H}from"./chunk-XKWEMFHP.js";import{a as B,b,c as y,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{N as v}from"./chunk-XDSB47KO.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=R(l,r=>r.tokens);return H({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=b(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return B({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return y([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
2
- //# sourceMappingURL=chunk-TCVRJ56J.js.map
1
+ import{a as R,b as H}from"./chunk-2WCXKANA.js";import{a as B,b,c as y,e as h,f as k}from"./chunk-B3X6KU75.js";import{a as p,b as g}from"./chunk-KMVGRIO2.js";import{N as v}from"./chunk-WAU7HVDI.js";function V(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:i=6,limit:o=20,scope:c,scanLimit:n,filePattern:d,focusFiles:f}=s,l=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,i),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),t=R(l,r=>r.tokens);return H({profiles:l,limit:o,filePattern:d,focusFiles:f,candidateIndex:t,profile:{name:"react-hook-candidates"},compare:(r,a)=>C(r,a,m,i),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function C(e,s,m,i){let o=p(e.tokens,s.tokens);if(o.size<i||!E(o))return null;let c=b(e.tokens,s.tokens);if(c<m)return null;let n=h(o,"hook:"),d=h(o,"react-hook:"),f=h(o,"effect:"),l=h(o,"state:"),t=h(o,"request:"),r=h(o,"handler:"),a=h(o,"handler-verb:"),u=A({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:k(o),sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:f,sharedState:l,sharedRequests:t,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function A(e){return B({genericWords:q,stripPrefixes:w,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:S})}function S(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,m=0,i=0,o=0,c=0,n=0,d=0;for(let t of e)t.startsWith("hook:")?s+=1:t.startsWith("react-hook:")?m+=1:t.startsWith("effect:")?i+=1:t.startsWith("request:")?o+=1:t.startsWith("handler:")||t.startsWith("handler-verb:")?c+=1:t.startsWith("state:")?n+=1:t.startsWith("state-hook:")&&(d+=1);let f=n+d,l=s+m+i+o+c+f;return y([{name:"requests",count:o},{name:"customHooks",count:s},{name:"namedStates",count:n},{name:"handlers",count:c},{name:"effects",count:i},{name:"reactHooks",count:m},{name:"namedBehavior",count:l}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{customHooks:1,requests:1,namedBehavior:5},reason:"shared custom hook and request workflow"},{min:{customHooks:1,namedStates:1,namedBehavior:5},reason:"shared custom hook and state"},{min:{customHooks:1,handlers:2,namedBehavior:5},reason:"shared custom hook and handlers"},{min:{namedStates:1,handlers:2,effects:1,namedBehavior:5},reason:"shared stateful effects"},{min:{namedStates:1,handlers:2,reactHooks:2,namedBehavior:5},reason:"shared stateful React primitives"}]).pass}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var q=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),w=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{V as a};
2
+ //# sourceMappingURL=chunk-4FMT4HPC.js.map
@@ -1,2 +1,2 @@
1
- import{f as B,g as S}from"./chunk-AERYQJ52.js";import{b as L,c as k}from"./chunk-FLIF3JWA.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{d as P}from"./chunk-MTDBHTSF.js";import{d as I,g as z,j as D,t as $}from"./chunk-TDGCALH6.js";import{b as T,k as v,p as A}from"./chunk-QNMOZ3CJ.js";import{c as b}from"./chunk-XDSB47KO.js";import{C as _,s as p}from"./chunk-M2TRDR25.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
2
- //# sourceMappingURL=chunk-7FG5M53V.js.map
1
+ import{f as B,g as S}from"./chunk-WWCZCH7W.js";import{b as L,c as k}from"./chunk-CAKPEQZB.js";import{b as O}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-BGBBVSH4.js";import{d as P}from"./chunk-MTDBHTSF.js";import{d as I,g as z,j as D,t as $}from"./chunk-AYRHVJXW.js";import{b as T,k as v,p as A}from"./chunk-GAE7WCBK.js";import{c as b}from"./chunk-WAU7HVDI.js";import{C as _,s as p}from"./chunk-FC5K7T35.js";var U=new Set(P());function $e(e,t={}){let{includeHomonyms:n=!1,limit:i}=t,s=X(e,t).filter(r=>r.relationship==="divergent"||n&&r.relationship==="homonym");return i?s.slice(0,i):s}function X(e,t={}){let{scope:n,minSimilarity:i=.3,scanLimit:s}=t,r=Q(e,{scope:n,scanLimit:s});return Y(r,{minSimilarity:i,isDelegatePair:De(e)}).filter(a=>!a.members.some(o=>_(e,o.file,o.startLine,"twin")))}function Y(e,t={}){let n=t.minSimilarity??.3,i=t.isDelegatePair,s=e.filter(c=>!V(c.leaf)&&!fe(c.leaf)&&L(c.file)!=="test"&&!D(c.symbol)&&!Z(c.symbol)&&!j(c.symbol,c.leaf)),{recordsByLeaf:r,recordOrder:a}=p("twin-drift.group-by-leaf",()=>q(s),()=>({records:s.length})),o=p("twin-drift.cluster-leaf-names",()=>W([...r.keys()]),()=>({leaves:r.size}));return p("twin-drift.compare-clusters",()=>{let c=[];for(let h of o){let u=J(h,r,a);if(u.length<2||new Set(u.map(f=>f.file)).size<2)continue;let m=null,R=!1,C=!1,y=new Set;for(let f=0;f<u.length;f+=1)for(let w=f+1;w<u.length;w+=1){let d=u[f],g=u[w];if(d.file===g.file||!ge(d,g)||i?.(d,g,u)||i?.(g,d,u))continue;if(R=!0,y.add(d.symbol),y.add(g.symbol),d.normalizedBody===g.normalizedBody){C=!0;continue}let M=oe(d.tokens,g.tokens);(!m||M>m.similarity)&&(m={a:d,b:g,similarity:M})}if(!R)continue;let x=u.filter(f=>y.has(f.symbol)).sort((f,w)=>f.file.localeCompare(w.file)||f.startLine-w.startLine).map(se);if(!m){c.push({leaf:G(h),relationship:C?"identical":"homonym",maxDivergence:0,members:x});continue}let N=m.similarity>=n?"divergent":"homonym";c.push({leaf:G(h),relationship:N,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:x,...N==="divergent"?{firstDivergentTokens:ae(m.a.tokens,m.b.tokens)}:{}})}return c},()=>({clusters:o.length,records:s.length})).sort((c,h)=>h.members.length-c.members.length||h.maxDivergence-c.maxDivergence||c.leaf.localeCompare(h.leaf))}function q(e){let t=new Map,n=new Map;for(let[i,s]of e.entries()){let r=t.get(s.leaf)??[];r.push(s),t.set(s.leaf,r),n.set(s,i)}return{recordsByLeaf:t,recordOrder:n}}function J(e,t,n){let i=[...e].flatMap(s=>t.get(s)??[]);return e.size>1&&i.sort((s,r)=>(n.get(s)??0)-(n.get(r)??0)),i}function Q(e,t){let n=p("twin-drift.load-definitions",()=>$(e,{scope:t.scope}).filter(r=>ee(r)&&!e.isIgnored(r.relativePath)).filter(r=>!k(r.relativePath)));p("twin-drift.sort-definitions",()=>n.sort((r,a)=>r.relativePath.localeCompare(a.relativePath)||r.startLine-a.startLine),()=>({definitions:n.length}));let i=O(n,t.scanLimit),s=p("twin-drift.select-candidates",()=>te(i),()=>({scanned:i.length}));return p("twin-drift.build-records",()=>{let r=[];for(let a of s){let o=ne(e,a);o&&r.push(o)}return r},()=>({candidates:s.length,scanned:i.length}))}function ee(e){return e.isFunctionLike?e.symbol.startsWith("rust-analyzer ")?typeof e.kind=="number"&&U.has(e.kind):!0:!1}function te(e){let t=e.filter(r=>r.leaf&&!V(r.leaf)&&!D(r.symbol)&&!Z(r.symbol)&&!j(r.symbol,r.leaf)),n=new Map;for(let r of t){let a=n.get(r.leaf)??[];a.push(r),n.set(r.leaf,a)}let i=W([...n.keys()]),s=new Set;for(let r of i){let a=[...r].flatMap(o=>n.get(o)??[]);if(!(a.length<2)&&!(new Set(a.map(o=>o.relativePath)).size<2)&&!a.every(o=>L(o.relativePath)==="test"))for(let o of a)s.add(o)}return e.filter(r=>s.has(r))}function ne(e,t){if(!t.leaf)return null;let n=B(e,t);if(!n||!z(t.symbol)&&!re(n,t.leaf))return null;let i=T(S(n)),s=i.replace(/\s+/g,"");if(!s||s.length<8)return null;let r=i.match(ie)??[];return r.length===0?null:{leaf:t.leaf,symbol:t.symbol,shortName:I(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:E(t),normalizedBody:s,tokens:r,isThinForwarder:H(i)}}function re(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return new RegExp(`\\b(?:const|let|var)\\s+${n}(?:\\s*:[^=]+)?\\s*=\\s*(?:async\\s*)?(?:\\([^)]*\\)|[A-Za-z_$][\\w$]*)\\s*=>`,"s").test(e)}var ie=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function se(e){return{symbol:e.symbol,shortName:e.shortName,file:e.file,startLine:e.startLine,endLine:e.endLine,loc:e.loc}}function oe(e,t){let n=new Set(e),i=new Set(t);if(n.size===0&&i.size===0)return 1;if(n.size===0||i.size===0)return 0;let s=0;for(let a of n)i.has(a)&&(s+=1);let r=n.size+i.size-s;return r===0?0:s/r}function ae(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;let s=e.slice(i,i+6).join(" "),r=t.slice(i,i+6).join(" ");return!s&&!r?"(bodies differ only in trailing length)":`A: ${s||"(end)"} | B: ${r||"(end)"}`}function W(e){let t=new Map;for(let a of e)t.set(a,a);let n=a=>{let o=a;for(;t.get(o)!==o;)o=t.get(o);let l=a;for(;t.get(l)!==o;){let c=t.get(l);t.set(l,o),l=c}return o},i=(a,o)=>{let l=n(a),c=n(o);l!==c&&t.set(l,c)},s=new Map;for(let a of e){let o=a.slice(0,2).toLowerCase(),l=s.get(o)??[];l.push(a),s.set(o,l)}for(let a of s.values())for(let o=0;o<a.length;o+=1)for(let l=o+1;l<a.length;l+=1)le(a[o],a[l])&&i(a[o],a[l]);let r=new Map;for(let a of e){let o=n(a),l=r.get(o)??new Set;l.add(a),r.set(o,l)}return[...r.values()]}function le(e,t){return e===t||e.toLowerCase()===t.toLowerCase()?!0:e.length<8||t.length<8||Math.abs(e.length-t.length)>2||ce(e.toLowerCase(),t.toLowerCase())/Math.max(e.length,t.length)<.8?!1:pe(e.toLowerCase(),t.toLowerCase(),2)}function ce(e,t){let n=Math.min(e.length,t.length),i=0;for(;i<n&&e[i]===t[i];)i+=1;return i}function fe(e){return/^[A-Z][A-Z0-9_]*$/.test(e)||/^__[^_].*__$/.test(e)||ue.has(e.toLowerCase())}var ue=new Set(["main","row"]),me=new Set(["app","component","components","feature","features","impl","index","lib","route","routes","shared","src","tsx","typescript","ui"]);function Z(e){return e.startsWith("rust-analyzer ")&&/\/(?:tests?|benches?)\//.test(e)}var de=new Set(["default","new","reset"]);function j(e,t){return e.startsWith("rust-analyzer ")&&de.has(t.toLowerCase())}function ge(e,t){if(e.leaf.toLowerCase()!==t.leaf.toLowerCase()||e.leaf.length>4)return!0;let n=F(e);return[...F(t)].some(i=>n.has(i))}function F(e){let t=e.leaf.toLowerCase();return new Set(`${e.file}/${e.shortName}`.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>2&&n!==t&&!me.has(n)))}function pe(e,t,n){if(Math.abs(e.length-t.length)>n)return!1;let i=Array.from({length:t.length+1},(s,r)=>r);for(let s=1;s<=e.length;s+=1){let r=[s],a=r[0];for(let o=1;o<=t.length;o+=1){let l=e[s-1]===t[o-1]?0:1,c=Math.min(i[o]+1,r[o-1]+1,i[o-1]+l);r.push(c),a=Math.min(a,c)}if(a>n)return!1;i=r}return i[t.length]<=n}function ke(e){return H(T(S(e)))}function H(e){let t=e.trim();if(!t||he.test(t))return!1;let n=be(t);return n.length===0||n.length>2?!1:ye(n[n.length-1])}var he=/\b(?:if|else|for|while|switch|try|catch|do)\b/,we=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function ye(e){let t=e.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return we.test(t)}function be(e){let t=[],n=0,i="";for(let s of e){if(s==="("||s==="["||s==="{"?n+=1:(s===")"||s==="]"||s==="}")&&(n=Math.max(0,n-1)),s===";"&&n===0){t.push(i),i="";continue}i+=s}return i.trim()&&t.push(i),t.map(s=>s.trim()).filter(s=>s.length>0)}var Te=3;function De(e){let t=new Map;return(n,i,s)=>{if(!n.isThinForwarder)return!1;let r=`${n.symbol}\0${i.symbol}`,a=t.get(r);if(a!==void 0)return a;let o=K(e,n,i,s,Te,new Set);return t.set(r,o),o}}function K(e,t,n,i,s,r){if(s<=0||r.has(t.symbol)||(r.add(t.symbol),(v(e,t.file)??[]).filter(l=>l.line>=t.startLine&&l.line<=t.endLine&&l.calleeLeaf===n.leaf).length===0))return!1;let o=new Set(A(e,t.file).filter(l=>l.sourcePath&&(l.kind!=="namespace"||l.usedMembers.includes(n.leaf))).map(l=>l.sourcePath));if([...o].some(l=>b(l,n.file)))return!0;for(let l of i)if(!(l.symbol===t.symbol||l.symbol===n.symbol||!l.isThinForwarder)&&[...o].some(c=>b(c,l.file))&&K(e,l,n,i,s-1,r))return!0;return!1}function V(e){return e.startsWith("<")&&e.endsWith(">")}function G(e){return[...e].sort()[0]}export{$e as a,X as b,Y as c,ke as d,be as e};
2
+ //# sourceMappingURL=chunk-53SUJOJA.js.map
@@ -1,2 +1,2 @@
1
- import{b as m,c as d}from"./chunk-FLIF3JWA.js";import{a as $}from"./chunk-SATRCB5O.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s,{scipEdges:"imports-only"}),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
2
- //# sourceMappingURL=chunk-YBAC3RON.js.map
1
+ import{b as m,c as d}from"./chunk-CAKPEQZB.js";import{a as $}from"./chunk-AOSFSYEA.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s,{scipEdges:"imports-only"}),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
2
+ //# sourceMappingURL=chunk-5GOBZI34.js.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-SATRCB5O.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
2
- //# sourceMappingURL=chunk-X36LKKVG.js.map
1
+ import{a as c}from"./chunk-AOSFSYEA.js";function j(e,s={}){let{minSimilarity:t=.5,limit:n=15,scope:i,minChainLength:r=3,maxChainLength:l=8}=s,a=c(e,i),o=y(a,r,l);if(o.length===0)return[];let f=d(o);return f.length<2?[]:S(x(f,t,n),n)}function d(e){let s=m(e),t=[];for(let n of e){let i=n.filter(r=>!s.has(r));i.length>=2&&t.push({original:n,filtered:i})}return t}function m(e){let{nodeFreq:s,tailFreq:t}=p(e),n=e.length*.9,i=e.length*.8,r=new Set;for(let[a,o]of s)o>n&&r.add(a);for(let[a,o]of t)o>i&&r.add(a);let l=["index.ts","index.js","cli.ts","main.ts","health.ts","health.js"];for(let a of s.keys()){let o=a.split("/").pop()??"";l.includes(o)&&r.add(a)}return r}function p(e){let s=new Map,t=new Map;for(let n of e){let i=new Set;for(let r of n)i.has(r)||(s.set(r,(s.get(r)??0)+1),i.add(r));for(let r=Math.max(0,n.length-2);r<n.length;r++)t.set(n[r],(t.get(n[r])??0)+1)}return{nodeFreq:s,tailFreq:t}}function x(e,s,t){let n=[];for(let i=0;i<e.length;i++){for(let r=i+1;r<e.length;r++){let l=b(e[i],e[r],s);l&&n.push(l)}if(n.length>t*10)break}return n.sort((i,r)=>Math.abs(r.similarity-i.similarity)>.01?r.similarity-i.similarity:i.divergencePoints.length-r.divergencePoints.length),n}function b(e,s,t){if(!C(e.filtered,s.filtered))return null;let{distance:n,ops:i}=A(e.filtered,s.filtered),r=Math.max(e.filtered.length,s.filtered.length);if(r===0)return null;let l=1-n/r;if(l<t||n===0)return null;let a=i.filter(f=>f.type==="substitute").map(f=>({index:f.indexA,nodeA:e.filtered[f.indexA],nodeB:s.filtered[f.indexB]}));return a.length===0||i.filter(f=>f.type==="match").length<2?null:{chainA:e.original,chainB:s.original,similarity:l,editDistance:n,divergencePoints:a,commonPrefix:F(e.original,s.original),commonSuffix:B(e.original,s.original)}}function C(e,s){let t=new Set(e);return s.some(n=>t.has(n))}function S(e,s){let t=[];for(let n of e)if(t.some(r=>h(n.chainA,r.chainA)&&h(n.chainB,r.chainB))||t.push(n),t.length>=s)break;return t}function y(e,s,t){let n=[];for(let r of e.keys()){if(n.length>=500)break;g(e,r,[r],new Set([r]),s,t,n,500)}return n}function g(e,s,t,n,i,r,l,a){if(l.length>=a)return;if(t.length>=r){t.length>=i&&l.push([...t]);return}let o=e.get(s);if(!o||o.size===0){t.length>=i&&l.push([...t]);return}let f=!1;for(let u of o)if(!n.has(u)&&(n.add(u),t.push(u),g(e,u,t,n,i,r,l,a),t.pop(),n.delete(u),f=!0,l.length>=a))return;!f&&t.length>=i&&l.push([...t])}function A(e,s){let t=e.length,n=s.length,i=Array.from({length:t+1},()=>Array(n+1).fill(0));for(let o=0;o<=t;o++)i[o][0]=o;for(let o=0;o<=n;o++)i[0][o]=o;for(let o=1;o<=t;o++)for(let f=1;f<=n;f++)e[o-1]===s[f-1]?i[o][f]=i[o-1][f-1]:i[o][f]=1+Math.min(i[o-1][f],i[o][f-1],i[o-1][f-1]);let r=[],l=t,a=n;for(;l>0||a>0;)l>0&&a>0&&e[l-1]===s[a-1]?(r.unshift({type:"match",indexA:l-1,indexB:a-1}),l--,a--):l>0&&a>0&&i[l][a]===i[l-1][a-1]+1?(r.unshift({type:"substitute",indexA:l-1,indexB:a-1}),l--,a--):a>0&&i[l][a]===i[l][a-1]+1?(r.unshift({type:"insert",indexA:l,indexB:a-1}),a--):(r.unshift({type:"delete",indexA:l-1,indexB:a}),l--);return{distance:i[t][n],ops:r}}function F(e,s){let t=[];for(let n=0;n<Math.min(e.length,s.length)&&e[n]===s[n];n++)t.push(e[n]);return t}function B(e,s){let t=[],n=e.length-1,i=s.length-1;for(;n>=0&&i>=0&&e[n]===s[i];)t.unshift(e[n]),n--,i--;return t}function h(e,s){if(e.length>s.length)return!1;let t=s.join("\u2192"),n=e.join("\u2192");return t.includes(n)}export{j as a};
2
+ //# sourceMappingURL=chunk-5OZCNAVM.js.map
@@ -1,2 +1,2 @@
1
- import{c as a}from"./chunk-B75HZHUP.js";import{a as g,c as S}from"./chunk-F334Z5UA.js";import{m as b,n as m}from"./chunk-UVMME4FI.js";import{a as y}from"./chunk-UXOVHGT6.js";import{d as n}from"./chunk-TDGCALH6.js";function N(i,t,r={}){let o=y(i,t);if(!o)return null;let c=[{file:o.relativePath,line:o.startLine}],s=b(i,o,{semantic:r.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?n(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:l}=p(i,o,s,{semantic:r.semantic!==!1});return{symbol:o.symbol,shortName:n(o.symbol),relativePath:o.relativePath,definitionSites:c.filter(e=>!i.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!i.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:n(e.symbol),file:e.file})),consumers:l.filter(e=>!i.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":n(e.symbol),file:e.file}))}}function p(i,t,r,o){let c=a(g(i,t,{limit:30,semantic:o.semantic,semanticEvidence:m}).map(l=>({symbol:l.symbol,file:l.file}))),s=a(S(i,t,{limit:30,semantic:o.semantic,semanticEvidence:m})),f=s.length>0?s:a(r.map(l=>({symbol:l.enclosingSymbol==="(top-level)"?l.file:l.enclosingSymbol,file:l.file})));return{producers:c,consumers:f}}export{N as a};
2
- //# sourceMappingURL=chunk-FMC3BI4I.js.map
1
+ import{c as a}from"./chunk-B75HZHUP.js";import{a as g,c as S}from"./chunk-EMIIOOTM.js";import{m as b,n as m}from"./chunk-DZXFZAZO.js";import{a as y}from"./chunk-HFBNIIZX.js";import{d as n}from"./chunk-AYRHVJXW.js";function N(i,t,r={}){let o=y(i,t);if(!o)return null;let c=[{file:o.relativePath,line:o.startLine}],s=b(i,o,{semantic:r.semantic,semanticEvidence:m}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?n(e.enclosingSymbol):"(top-level)"})),{producers:f,consumers:l}=p(i,o,s,{semantic:r.semantic!==!1});return{symbol:o.symbol,shortName:n(o.symbol),relativePath:o.relativePath,definitionSites:c.filter(e=>!i.isIgnored(e.file)),usageSites:s,producers:f.filter(e=>!i.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:n(e.symbol),file:e.file})),consumers:l.filter(e=>!i.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":n(e.symbol),file:e.file}))}}function p(i,t,r,o){let c=a(g(i,t,{limit:30,semantic:o.semantic,semanticEvidence:m}).map(l=>({symbol:l.symbol,file:l.file}))),s=a(S(i,t,{limit:30,semantic:o.semantic,semanticEvidence:m})),f=s.length>0?s:a(r.map(l=>({symbol:l.enclosingSymbol==="(top-level)"?l.file:l.enclosingSymbol,file:l.file})));return{producers:c,consumers:f}}export{N as a};
2
+ //# sourceMappingURL=chunk-5TEUKVSM.js.map
@@ -1,4 +1,4 @@
1
- import{a as D,b as v,c as $,d as B}from"./chunk-IWK562KR.js";import{a as K}from"./chunk-BGUYAA3Q.js";import{a as A}from"./chunk-ZXWFN7CK.js";import{b as M,g as R}from"./chunk-FLIF3JWA.js";import{a as g}from"./chunk-BGBBVSH4.js";import{h as I}from"./chunk-F334Z5UA.js";import{b as k,d as F,e as b}from"./chunk-TDGCALH6.js";import{l as w}from"./chunk-QNMOZ3CJ.js";import{y as C}from"./chunk-M2TRDR25.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>g(c)-g(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:u=>{let c=U(u),f=W(t,a,u,c,{semantic:d}),h=u.filter(P=>{let x=S(t,P,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&j(P,x.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,h,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=S(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(u,c)=>p[u.confidence]-p[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,i){return n.filter(s=>s.isTypeLike&&g(s)>=i.minLoc).filter(s=>g(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!s.relativePath.endsWith(".d.ts")).filter(s=>M(s.relativePath)!=="test").filter(s=>!R(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function L(t,e,n,i){return v(D(t,e).forDefinitions(n,{semantic:i.semantic,sourceFallback:i.sourceFallback}))}function W(t,e,n,i,s){let r=L(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let m=S(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&T(a.relativePath))}),o=s.semantic&&l.length>0?I(r,L(t,e,l,{semantic:!0,sourceFallback:!1})):r,d=l.filter(a=>S(t,a,o,i).realConsumers.length<=1);return I(o,L(t,e,d,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=b(n.symbol);s&&i.set(s,n)}return e}function S(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:l,barrelConsumers:o+d,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),i=T(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),l=z(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let r=_(t,Z(n),i),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=v(D(t,e).forDefinitions(l,{semantic:s.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,o)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=b(n.symbol);i&&e.set(N(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let r=q(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let i=b(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(N(n.relativePath,s))??null:null}function G(t,e,n){let i=b(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,i))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let i=C(t,e);if(!i)return null;let s=n.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 Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(T(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=i.get(e.relativePath);if(!l)return!1;let o=[...s.get(r)??[]],d=new Set;for(;o.length>0;){let a=o.pop();if(d.has(a))continue;d.add(a);let m=l.get(a);if(!m)continue;let y=n.get(m.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of s.get(a)??[])o.push(p)}return!1}function E(t,e,n){let i=C(t,e);if(!i)return"other";let s=i.split(`
1
+ import{a as D,b as v,c as $,d as B}from"./chunk-AGTATREV.js";import{a as K}from"./chunk-FBUNGRKI.js";import{a as A}from"./chunk-7TJJY2C3.js";import{b as M,g as R}from"./chunk-CAKPEQZB.js";import{a as g}from"./chunk-BGBBVSH4.js";import{h as I}from"./chunk-EMIIOOTM.js";import{b as k,d as F,e as b}from"./chunk-AYRHVJXW.js";import{l as w}from"./chunk-GAE7WCBK.js";import{y as C}from"./chunk-FC5K7T35.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:l=!1,scanLimit:o}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),y=Q(a,n),p={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>g(c)-g(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:o,profile:{name:"stale-abstractions"},prepare:u=>{let c=U(u),f=W(t,a,u,c,{semantic:d}),h=u.filter(P=>{let x=S(t,P,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&j(P,x.realConsumers.length,y)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,h,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=S(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,y))return null;let h=V(t,f);return!l&&h.confidence==="low"?null:h},orderResults:(u,c)=>p[u.confidence]-p[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,i){return n.filter(s=>s.isTypeLike&&g(s)>=i.minLoc).filter(s=>g(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>!s.relativePath.endsWith(".d.ts")).filter(s=>M(s.relativePath)!=="test").filter(s=>!R(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function L(t,e,n,i){return v(D(t,e).forDefinitions(n,{semantic:i.semantic,sourceFallback:i.sourceFallback}))}function W(t,e,n,i,s){let r=L(t,e,n,{semantic:!1,sourceFallback:!1}),l=n.filter(a=>{let m=S(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&T(a.relativePath))}),o=s.semantic&&l.length>0?I(r,L(t,e,l,{semantic:!0,sourceFallback:!1})):r,d=l.filter(a=>S(t,a,o,i).realConsumers.length<=1);return I(o,L(t,e,d,{semantic:!1,sourceFallback:!0}))}function U(t){let e=new Map;for(let n of t){let i=e.get(n.relativePath);i||(i=new Map,e.set(n.relativePath,i));let s=b(n.symbol);s&&i.set(s,n)}return e}function S(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:l,barrelConsumers:o,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:l,barrelConsumers:o+d,transitivelyReachable:a}}function V(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),i=T(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),l=z(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:F(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:g(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:l.actionTier,stalenessKind:l.stalenessKind,recommendation:l.recommendation}}function z(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,i,s){let r=_(t,Z(n),i),l=r.map(a=>a.singleton);if(r.length===0)return new Set;let o=v(D(t,e).forDefinitions(l,{semantic:s.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,o)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=b(n.symbol);i&&e.set(N(n.relativePath,i),n)}return e}function _(t,e,n){let i=[];for(let s of n){let r=q(t,e,s);r&&i.push({singleton:r,classId:s.symbolId})}return i}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let i=b(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(N(n.relativePath,s))??null:null}function G(t,e,n){let i=b(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,i))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let i=C(t,e);if(!i)return null;let s=n.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 Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=k(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let i=n[n.length-1],s=n[n.length-2];return i?.suffix==="type"&&s?.suffix==="type"}function T(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(T(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=w(t,e.relativePath),r=b(e.symbol);if(!r)return!1;let l=i.get(e.relativePath);if(!l)return!1;let o=[...s.get(r)??[]],d=new Set;for(;o.length>0;){let a=o.pop();if(d.has(a))continue;d.add(a);let m=l.get(a);if(!m)continue;let y=n.get(m.symbolId);if(y){for(let p of y)if(p!==e.relativePath&&!t.isIgnored(p))return!0}for(let p of s.get(a)??[])o.push(p)}return!1}function E(t,e,n){let i=C(t,e);if(!i)return"other";let s=i.split(`
2
2
  `),r=Math.max(0,n-2),l=Math.min(s.length-1,n+2);for(let o=r;o<=l;o++){let a=(s[o]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=C(t,e.relativePath);if(!n)return!1;let i=b(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),l=n.split(`
3
3
  `);for(let o=0;o<l.length;o++)if(!(o>=e.startLine&&o<=e.endLine)&&r.test(l[o]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{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"}}export{de as a};
4
- //# sourceMappingURL=chunk-WT7TOU2C.js.map
4
+ //# sourceMappingURL=chunk-5W2VAEVR.js.map
@@ -1,4 +1,4 @@
1
- import{a as d}from"./chunk-ZXWFN7CK.js";import{a as h}from"./chunk-UXOVHGT6.js";import{d as f}from"./chunk-TDGCALH6.js";import{b as u}from"./chunk-QNMOZ3CJ.js";import{E as l}from"./chunk-XDSB47KO.js";import{readFileSync as E}from"fs";import{join as B}from"path";function j(t,e,s={}){let n=h(t,e);if(!n)return null;let a=new d(t),o=N(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(x=>x.symbol));return{symbol:n.symbol,shortName:f(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:P(t,n.symbolId),fanOut:w(m,n.relativePath)}}function N(t,e){let s=l(t,e.relativePath);if(s){let n=g(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function H(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});C(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,L(t,c))}return s}function L(t,e){return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function y(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function p(t,e,s,n){try{return E(B(t.config.projectRoot,e),"utf-8").split(`
1
+ import{a as d}from"./chunk-7TJJY2C3.js";import{a as h}from"./chunk-HFBNIIZX.js";import{d as f}from"./chunk-AYRHVJXW.js";import{b as u}from"./chunk-GAE7WCBK.js";import{E as l}from"./chunk-WAU7HVDI.js";import{readFileSync as E}from"fs";import{join as B}from"path";function j(t,e,s={}){let n=h(t,e);if(!n)return null;let a=new d(t),o=N(t,n),r=n.endLine-n.startLine+1,m=a.calleeMap([n],{additive:!0,semantic:s.semantic}).get(n.symbolId)??[],c=new Set(m.map(x=>x.symbol));return{symbol:n.symbol,shortName:f(n.symbol),relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:r,branches:o.branches,estimateBasis:o.estimateBasis,cyclomaticEstimate:o.branches+1,calleeCount:c.size,fanIn:P(t,n.symbolId),fanOut:w(m,n.relativePath)}}function N(t,e){let s=l(t,e.relativePath);if(s){let n=g(s.rootNode,e.startLine,e.endLine);if(n)return{branches:v(n),estimateBasis:"ast"}}return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function H(t,e){let s=new Map,n=new Map;for(let a of e){let o=n.get(a.relativePath)??[];o.push(a),n.set(a.relativePath,o)}for(let[a,o]of n){let r=l(t,a),i=r===null?[]:o.filter(c=>r.rootNode.startPosition.row<=c.startLine&&r.rootNode.endPosition.row>=c.endLine),m=new Set(i.map(c=>c.symbolId));if(r&&i.length>0){for(let c of i)s.set(c.symbolId,{branches:0,estimateBasis:"ast"});C(r.rootNode,i,s)}for(let c of o)m.has(c.symbolId)||s.set(c.symbolId,L(t,c))}return s}function L(t,e){return{branches:_(p(t,e.relativePath,e.startLine,e.endLine),y(t,e.relativePath)),estimateBasis:"regex-fallback"}}function y(t,e){return t.get("SELECT language FROM documents WHERE relative_path = ?",e)?.language??"unknown"}function p(t,e,s,n){try{return E(B(t.config.projectRoot,e),"utf-8").split(`
2
2
  `).slice(s,n+1).join(`
3
3
  `)}catch{return""}}function P(t,e){return t.get(`SELECT COUNT(DISTINCT c.document_id) AS c
4
4
  FROM mentions m
@@ -13,4 +13,4 @@ import{a as d}from"./chunk-ZXWFN7CK.js";import{a as h}from"./chunk-UXOVHGT6.js";
13
13
  WHERE m.symbol_id = ?
14
14
  AND m.role != 1
15
15
  AND sym_def.document_id != c.document_id`,e)?.c??0}function w(t,e){return new Set(t.filter(s=>s.file!==e).map(s=>s.symbol)).size}function v(t){let e=0;return b(t,s=>{e+=S(s)}),e}function C(t,e,s){let n=[...e].sort((a,o)=>a.startLine-o.startLine||o.endLine-a.endLine);b(t,a=>{let o=S(a);if(o===0)return;let r=a.startPosition.row,i=a.endPosition.row;for(let m of n){if(m.startLine>r)break;if(m.endLine<i)continue;let c=s.get(m.symbolId);c&&(c.branches+=o)}})}function b(t,e){e(t);for(let s of t.namedChildren)b(s,e)}function g(t,e,s){if(t.startPosition.row>e||t.endPosition.row<s)return null;for(let n of t.namedChildren){let a=g(n,e,s);if(a)return a}return t}var D=new Set(["if_statement","conditional_expression","ternary_expression","for_statement","for_in_statement","for_of_statement","while_statement","do_statement","switch_case","case_statement","catch_clause","except_clause","elif_clause","match_arm"]);function S(t){return D.has(t.type)?1:t.type==="binary_expression"&&t.parent?.type!=="binary_expression"&&(t.text.includes("&&")||t.text.includes("||"))?I(t.text):0}function I(t){return(t.match(/&&|\|\|/g)??[]).length}function _(t,e){let s=u(t),n=0,a=[/\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 a){let r=s.match(o);r&&(n+=r.length)}if(e==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}else if(e==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let r of o){let i=s.match(r);i&&(n+=i.length)}}return n}export{j as a,N as b,H as c,v as d};
16
- //# sourceMappingURL=chunk-AWSRND4W.js.map
16
+ //# sourceMappingURL=chunk-63P42UR6.js.map
@@ -1,6 +1,6 @@
1
- import{a as m}from"./chunk-DV6B262O.js";import{a as h}from"./chunk-UXOVHGT6.js";import{d as g}from"./chunk-TDGCALH6.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
1
+ import{a as m}from"./chunk-SJ6XSCG7.js";import{a as h}from"./chunk-HFBNIIZX.js";import{d as g}from"./chunk-AYRHVJXW.js";import{readFileSync as f}from"fs";import{extname as y,join as d}from"path";function M(t,e,a={}){let{context:s=0}=a,r=L(e);if(r)return j(t,r.filePath,r.startLine,r.endLine,s);let i=h(t,e);return i?R(t,i,s):null}function L(t){let e=t.match(/^(.+\.\w+):(\d+)-(\d+)$/);return e?{filePath:e[1],startLine:parseInt(e[2],10),endLine:parseInt(e[3],10)}:null}function R(t,e,a){let s=t.get("SELECT language FROM documents WHERE relative_path = ?",e.relativePath),r=d(t.config.projectRoot,e.relativePath),i;try{i=f(r,"utf-8")}catch{return null}let n=i.split(`
2
2
  `),c=Math.max(0,e.startLine-a),l=Math.min(n.length-1,e.endLine+a),u=n.slice(c,l+1).join(`
3
3
  `);return{symbol:e.symbol,shortName:g(e.symbol),relativePath:e.relativePath,startLine:c,endLine:l,language:s?.language??v(e.relativePath),source:u}}function j(t,e,a,s,r){let i=m(t,e);if(!i)return null;let n=t.get("SELECT relative_path, language FROM documents WHERE relative_path = ?",i);if(!n)return null;let c=d(t.config.projectRoot,n.relative_path),l;try{l=f(c,"utf-8")}catch{return null}let u=l.split(`
4
4
  `),o=Math.max(0,a-1-r),p=Math.min(u.length-1,s-1+r),b=u.slice(o,p+1).join(`
5
5
  `);return{symbol:`${n.relative_path}:${a}-${s}`,shortName:`${n.relative_path}:${a}-${s}`,relativePath:n.relative_path,startLine:o,endLine:p,language:n.language??v(n.relative_path),source:b}}function v(t){switch(y(t).toLowerCase()){case".ts":case".tsx":case".mts":case".cts":return"typescript";case".js":case".jsx":case".mjs":case".cjs":return"javascript";case".py":case".pyi":return"python";case".rs":return"rust";case".go":return"go";case".java":return"java";case".kt":case".kts":return"kotlin";case".scala":return"scala";case".rb":return"ruby";case".php":return"php";case".cs":return"csharp";case".vb":return"vb";case".dart":return"dart";case".c":case".h":return"c";case".cc":case".cpp":case".cxx":case".hpp":case".hh":case".hxx":return"cpp";case".vue":return"vue";default:return null}}export{M as a};
6
- //# sourceMappingURL=chunk-GNJHHPZE.js.map
6
+ //# sourceMappingURL=chunk-64QITTX7.js.map
@@ -1,7 +1,7 @@
1
- import{b as k}from"./chunk-AM2LGOEX.js";import{a as D}from"./chunk-ZXWFN7CK.js";import{f as v,g as L}from"./chunk-FLIF3JWA.js";import{l as S}from"./chunk-UVMME4FI.js";import{d as h,s as y}from"./chunk-TDGCALH6.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
1
+ import{b as k}from"./chunk-B2WQKQKP.js";import{a as D}from"./chunk-7TJJY2C3.js";import{f as v,g as L}from"./chunk-CAKPEQZB.js";import{l as S}from"./chunk-DZXFZAZO.js";import{d as h,s as y}from"./chunk-AYRHVJXW.js";function z(e,n={}){let{scope:s,minLoc:c=1,maxDepth:a=5,scanLimit:f}=n,t=new D(e),i=_(e,s,c,f),o=new P;for(let r of i)o.add(r);let m=[],I=[];i.length>0&&m.push(C(e,0,i,o));let b=i.map(r=>r.definition).filter(r=>r!==null),x=new Set(i.map(r=>r.symbol));for(let r=1;r<=a&&b.length>0;r++){let u=t.calleeMap(b,{semantic:!1}),E=new Set;for(let d of b)for(let l of u.get(d.symbolId)??[])x.has(l.symbol)||E.add(l.symbol);let p=[];for(let d of E){x.add(d);let l=F(e,d);if(!l||e.isIgnored(l.relativePath)||v(e,l.relativePath)||L(e,l.symbol,l.relativePath)||t.fileKind(l.relativePath)==="test"||t.hasSuppressionComment(l))continue;let g=B(e,l,o);g.removable?p.push(w(l,"cascade")):g.blockingFiles.length>0&&I.push({shortName:h(l.symbol),file:l.relativePath,blockingFiles:g.blockingFiles.slice(0,3)})}if(p.length===0)break;for(let d of p)o.add(d);m.push(C(e,r,p,o)),b=p.map(d=>d.definition).filter(d=>d!==null)}let N=m.reduce((r,u)=>r+u.loc,0),R=m.reduce((r,u)=>r+u.entries.length,0);return{batches:m,totalSymbols:R,totalLoc:N,blocked:I}}function _(e,n,s,c){let a=k(e,{scope:n,minLoc:s,skipBarrels:!0,deadCodeOnly:!0,scanLimit:c,semantic:!1}),f=[];for(let t of a.symbols)t.kind==="dead-code"&&(v(e,t.relativePath)||L(e,t.symbol,t.relativePath)||f.push({symbol:t.symbol,shortName:t.shortName,file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:t.loc,evidence:"graph-fact",definition:F(e,t.symbol)}));return f}function w(e,n){return{symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:e.endLine-e.startLine+1,evidence:n,definition:e}}function F(e,n){let s=e.get(`SELECT d.relative_path
2
2
  FROM global_symbols gs
3
3
  JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
4
4
  JOIN documents d ON d.id = der.document_id
5
5
  WHERE gs.symbol = ?
6
6
  LIMIT 1`,n);return s?y(e,s.relative_path).find(c=>c.symbol===n)??null:null}function B(e,n,s){let c=S(e,n);if(c.length===0)return{removable:!1,blockingFiles:[]};let a=new Set;for(let f of c)f.file===n.relativePath&&f.line>=n.startLine&&f.line<=n.endLine||s.contains(f.file,f.line)||a.add(f.file);return{removable:a.size===0,blockingFiles:[...a]}}function C(e,n,s,c){let a=[...s].sort((i,o)=>i.file.localeCompare(o.file)||i.startLine-o.startLine),f=new Set(a.map(i=>i.file)),t=[];for(let i of f){let o=y(e,i);o.length>0&&o.every(m=>c.contains(i,m.startLine))&&t.push(i)}return{depth:n,entries:a.map(({definition:i,...o})=>o),loc:a.reduce((i,o)=>i+o.loc,0),filesEmptied:t.sort()}}var P=class{ranges=new Map;add(n){let s=this.ranges.get(n.file)??[];s.push({start:n.startLine,end:n.endLine}),this.ranges.set(n.file,s)}contains(n,s){let c=this.ranges.get(n);return c?c.some(a=>s>=a.start&&s<=a.end):!1}};export{z as a,P as b};
7
- //# sourceMappingURL=chunk-XPYXEEDO.js.map
7
+ //# sourceMappingURL=chunk-6O5JOS7T.js.map
@@ -1,2 +1,2 @@
1
- import{a as p}from"./chunk-ZXWFN7CK.js";import{a as u}from"./chunk-F334Z5UA.js";import{m as h,n as y}from"./chunk-UVMME4FI.js";import{a as S,c as b}from"./chunk-UXOVHGT6.js";import{d as m,z as d}from"./chunk-TDGCALH6.js";function P(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=S(e,o);return r?c==="backward"?M(e,r,s,{semantic:l.semantic!==!1}):k(e,r,{semantic:l.semantic!==!1}):null}function M(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let g of t){let w=u(e,g,{semantic:c.semantic,semanticEvidence:y});for(let a of w){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function k(e,o,l){let c=new Set,s=[],r=new p(e);for(let t of h(e,o,{semantic:l.semantic,semanticEvidence:y})){if(s.length>=30)break;let n=t.enclosingSymbol??d(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{P as a};
2
- //# sourceMappingURL=chunk-X65VYV2S.js.map
1
+ import{a as p}from"./chunk-7TJJY2C3.js";import{a as u}from"./chunk-EMIIOOTM.js";import{m as h,n as y}from"./chunk-DZXFZAZO.js";import{a as S,c as b}from"./chunk-HFBNIIZX.js";import{d as m,z as d}from"./chunk-AYRHVJXW.js";function P(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=S(e,o);return r?c==="backward"?M(e,r,s,{semantic:l.semantic!==!1}):k(e,r,{semantic:l.semantic!==!1}):null}function M(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let g of t){let w=u(e,g,{semantic:c.semantic,semanticEvidence:y});for(let a of w){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function k(e,o,l){let c=new Set,s=[],r=new p(e);for(let t of h(e,o,{semantic:l.semantic,semanticEvidence:y})){if(s.length>=30)break;let n=t.enclosingSymbol??d(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{P as a};
2
+ //# sourceMappingURL=chunk-6PKO2TNZ.js.map
@@ -1,3 +1,3 @@
1
- import{a as S}from"./chunk-TAB7AWKO.js";import{a as y}from"./chunk-BGUYAA3Q.js";import{a as x}from"./chunk-ZXWFN7CK.js";import{a as h,g as b}from"./chunk-FLIF3JWA.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as d}from"./chunk-TDGCALH6.js";import{a as u,h as m,i as g}from"./chunk-QNMOZ3CJ.js";import{z as f}from"./chunk-M2TRDR25.js";import{basename as L,extname as D}from"path";function K(n,e){let{scope:i,maxLoc:t=15,limit:r=30,scanLimit:a}=e??{},s=new x(n);return y({candidates:()=>A(n,s,i,t),orderCandidates:P,scanLimit:a,profile:{name:"passthrough-candidates"},prepare:o=>s.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,c)=>w(n,o,c.get(o.symbolId)??[]),orderResults:(o,c)=>o.loc-c.loc||o.file.localeCompare(c.file),limit:r})}function w(n,e,i){let t=j(i);if(t.size!==1||!m(n,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0],a=I(n,e,r),s=T(n,e),o=a.length>0||s.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:r.symbol,forwardsToShort:l(r.symbol),forwardsToFile:r.file,actionTier:o,boundaryEvidence:a,publicFacadeEvidence:s,recommendation:E(o,a,s)}}function I(n,e,i){return S(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(i.file,D(i.file))}])}function E(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return C(n,e)?h(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(n,e){let i=f(n,e.relativePath);if(i.length===0)return!1;let t=p(e.symbol);if(!t)return!1;let r=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{a as S}from"./chunk-J5XJWCB3.js";import{a as y}from"./chunk-FBUNGRKI.js";import{a as x}from"./chunk-7TJJY2C3.js";import{a as h,g as b}from"./chunk-CAKPEQZB.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as d}from"./chunk-AYRHVJXW.js";import{a as u,h as m,i as g}from"./chunk-GAE7WCBK.js";import{z as f}from"./chunk-FC5K7T35.js";import{basename as L,extname as D}from"path";function K(n,e){let{scope:i,maxLoc:t=15,limit:r=30,scanLimit:a}=e??{},s=new x(n);return y({candidates:()=>A(n,s,i,t),orderCandidates:P,scanLimit:a,profile:{name:"passthrough-candidates"},prepare:o=>s.calleeMap(o,{semantic:e?.semantic!==!1}),evaluate:(o,c)=>w(n,o,c.get(o.symbolId)??[]),orderResults:(o,c)=>o.loc-c.loc||o.file.localeCompare(c.file),limit:r})}function w(n,e,i){let t=j(i);if(t.size!==1||!m(n,e.relativePath,e.startLine,e.endLine))return null;let[,r]=[...t.entries()][0],a=I(n,e,r),s=T(n,e),o=a.length>0||s.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:r.symbol,forwardsToShort:l(r.symbol),forwardsToFile:r.file,actionTier:o,boundaryEvidence:a,publicFacadeEvidence:s,recommendation:E(o,a,s)}}function I(n,e,i){return S(n,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(i.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(i.file,D(i.file))}])}function E(n,e,i){if(n==="signal"){if(i.length>0)return`Review the public API before inlining; public-facade evidence: ${i.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function T(n,e){return C(n,e)?h(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(n,e){let i=f(n,e.relativePath);if(i.length===0)return!1;let t=p(e.symbol);if(!t)return!1;let r=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `),a=u(t);return new RegExp(`^\\s*export\\s+(?:default\\s+)?(?:(?:async\\s+)?function\\s+${a}\\b|(?:const|let|var)\\s+${a}\\b)`,"m").test(r)?!0:R(i,t)}function R(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${u(e)}\\b`);return n.some(t=>i.test(t))}function F(n){return n.includes("public surface")}function j(n){let e=n.some(t=>d(t.symbol))?n.filter(t=>d(t.symbol)):n,i=new Map;for(let t of e)i.has(t.symbol)||i.set(t.symbol,t);return i}function A(n,e,i,t){return e.productionCallableDefinitions({scope:i,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(r=>!g(n,r))}export{K as a,C as b};
3
- //# sourceMappingURL=chunk-X3OOU7CF.js.map
3
+ //# sourceMappingURL=chunk-7SGOWD2Y.js.map
@@ -1,2 +1,2 @@
1
- import{b as I,f as Y,g as _}from"./chunk-FLIF3JWA.js";import{a as M}from"./chunk-BGBBVSH4.js";import{b as X,e as Z,f as $,g as ee}from"./chunk-F334Z5UA.js";import{a as z,f as J,g as Q,i as w,j as U,n as v}from"./chunk-UVMME4FI.js";import{a as B}from"./chunk-SATRCB5O.js";import{a as V,g as T,h as P,j as H,k as O,s as D,u as G,v as W,w as N}from"./chunk-TDGCALH6.js";import{m as F}from"./chunk-QNMOZ3CJ.js";import{B as R,C as K,L as j}from"./chunk-XDSB47KO.js";import{B as h,s as E,y as A}from"./chunk-M2TRDR25.js";import{a as q}from"./chunk-64MNV6AB.js";function ne(n,e,t){let r=e.identifierResolution==="strict"?w:U,l=e.candidateNames?J(e.candidateNames):null,o=0,f=0,m=0,p=0,y="";for(let a of e.paths)if(o+=1,y=a,!(!R(a)&&!(e.includeVueSfc&&K(a)))&&!n.isIgnored(a)&&!e.skipPath?.(a))try{if(l&&!Q(A(n,a),l))continue;f+=1;let S=(s,u,L,b)=>{if(e.candidateNames&&!e.candidateNames.has(s))return;m+=1;let g=e.resolveTargets?e.resolveTargets({sourceFile:a,name:s,kind:u,defaultTargets:b}):b();for(let k of g)p+=1,t({sourceFile:a,name:s,target:k,occurrences:L,kind:u})},C=z(n,a);for(let[s,u]of C)S(s,"identifier",u.length,()=>r(n,a,s));for(let s of F(n,a,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let u=s.kind==="cross-language-dispatch"?()=>w(n,a,s.name):()=>r(n,a,s.name);S(s.name,s.kind,s.occurrences,u)}}finally{e.afterPath?.(a),o%10===0&&E("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:y,candidateMatchedPaths:f,visitedNames:m,visitedHits:p}))}}function te(n,e={}){let{scope:t,files:r,minLoc:l=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:m=!1,excludeTypesFiles:p=!1,excludeRootedSymbols:y=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:x=!1,excludeRustTraitImplMembers:S=!1,includeSuppressed:C=!1,sortByLocDesc:s=!1}=e,u=[],L=oe(n,{scope:t,files:r,requireFunctionLikeSymbol:a,requireCallableSymbol:x}),b=new Map,g=new Map,k=i=>{let c=b.get(i);if(c!==void 0)return c;let d=Y(n,i);return b.set(i,d),d},re=i=>{let c=g.get(i);if(c!==void 0)return c;let d=I(i);return g.set(i,d),d};for(let i of L){let c=i.relativePath;if(n.isIgnored(c)||m&&k(c)||!ae(i,{requireFunctionLikeSymbol:a,requireCallableSymbol:x})||f!==void 0&&i.symbol===f)continue;let d=M(i);d<l||d>o||p&&se(c)||y&&_(n,i.symbol,c)||S&&H(i.symbol)||re(c)!=="test"&&(O(i.symbol)||!C&&h(n,c,i.startLine)||u.push(i))}return s?u.sort((i,c)=>M(c)-M(i)):u}function oe(n,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>D(n,r)):e.requireCallableSymbol?N(n,{scope:e.scope,symbolMatches:T,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?N(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"function-like"}):W(n,e.scope)}function ae(n,e){return e.requireCallableSymbol?T(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function se(n){return(n.split("/").pop()??"").includes("types")}var ie=class{constructor(e){this.db=e}db;scopedDefinitions(e){return G(this.db,e)}definitionsForFile(e){return D(this.db,e)}productionCallableDefinitions(e={}){return te(this.db,e)}calleeMap(e,t={}){return X(this.db,e,{...t,semanticEvidence:v})}crossFileCallerMap(e,t={}){return Z(this.db,e,{...t,semanticEvidence:v})}sourceFallbackCallerFiles(e,t={}){return $(this.db,e,t)}callerFileMap(e,t={}){return ee(this.db,e,{...t,semanticEvidence:v})}frameworkReferencedSymbolIds(e){let t=new Map;for(let l of e){if(!l.leaf)continue;let o=t.get(l.leaf)??[];o.push(l.symbolId),t.set(l.leaf,o)}let r=new Set;for(let l of q(this.db,{includeIgnored:!1}))if(R(l)==="rust")for(let{name:o}of F(this.db,l,{includeRustAttributeNames:!0}))for(let f of t.get(o)??[])r.add(f);return r}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),l=this.calleeMap(e,t);return new Set([...l.entries()].filter(([o,f])=>{let m=r.get(o);return f.some(p=>p.symbol!==m)}).map(([o])=>o))}fileDependencyGraph(e){return B(this.db,e)}fileKind(e){return I(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return j(this.db)}scanSourceReferences(e,t){ne(this.db,e,t)}callableSignature(e){let t=V(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{ie as a};
2
- //# sourceMappingURL=chunk-ZXWFN7CK.js.map
1
+ import{b as I,f as Y,g as _}from"./chunk-CAKPEQZB.js";import{a as M}from"./chunk-BGBBVSH4.js";import{b as X,e as Z,f as $,g as ee}from"./chunk-EMIIOOTM.js";import{a as z,f as J,g as Q,i as w,j as U,n as v}from"./chunk-DZXFZAZO.js";import{a as B}from"./chunk-AOSFSYEA.js";import{a as V,g as T,h as P,j as H,k as O,s as D,u as G,v as W,w as N}from"./chunk-AYRHVJXW.js";import{m as F}from"./chunk-GAE7WCBK.js";import{B as R,C as K,L as j}from"./chunk-WAU7HVDI.js";import{B as h,s as E,y as A}from"./chunk-FC5K7T35.js";import{a as q}from"./chunk-64MNV6AB.js";function ne(n,e,t){let r=e.identifierResolution==="strict"?w:U,l=e.candidateNames?J(e.candidateNames):null,o=0,f=0,m=0,p=0,y="";for(let a of e.paths)if(o+=1,y=a,!(!R(a)&&!(e.includeVueSfc&&K(a)))&&!n.isIgnored(a)&&!e.skipPath?.(a))try{if(l&&!Q(A(n,a),l))continue;f+=1;let S=(s,u,L,b)=>{if(e.candidateNames&&!e.candidateNames.has(s))return;m+=1;let g=e.resolveTargets?e.resolveTargets({sourceFile:a,name:s,kind:u,defaultTargets:b}):b();for(let k of g)p+=1,t({sourceFile:a,name:s,target:k,occurrences:L,kind:u})},C=z(n,a);for(let[s,u]of C)S(s,"identifier",u.length,()=>r(n,a,s));for(let s of F(n,a,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let u=s.kind==="cross-language-dispatch"?()=>w(n,a,s.name):()=>r(n,a,s.name);S(s.name,s.kind,s.occurrences,u)}}finally{e.afterPath?.(a),o%10===0&&E("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:y,candidateMatchedPaths:f,visitedNames:m,visitedHits:p}))}}function te(n,e={}){let{scope:t,files:r,minLoc:l=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:m=!1,excludeTypesFiles:p=!1,excludeRootedSymbols:y=!1,requireFunctionLikeSymbol:a=!1,requireCallableSymbol:x=!1,excludeRustTraitImplMembers:S=!1,includeSuppressed:C=!1,sortByLocDesc:s=!1}=e,u=[],L=oe(n,{scope:t,files:r,requireFunctionLikeSymbol:a,requireCallableSymbol:x}),b=new Map,g=new Map,k=i=>{let c=b.get(i);if(c!==void 0)return c;let d=Y(n,i);return b.set(i,d),d},re=i=>{let c=g.get(i);if(c!==void 0)return c;let d=I(i);return g.set(i,d),d};for(let i of L){let c=i.relativePath;if(n.isIgnored(c)||m&&k(c)||!ae(i,{requireFunctionLikeSymbol:a,requireCallableSymbol:x})||f!==void 0&&i.symbol===f)continue;let d=M(i);d<l||d>o||p&&se(c)||y&&_(n,i.symbol,c)||S&&H(i.symbol)||re(c)!=="test"&&(O(i.symbol)||!C&&h(n,c,i.startLine)||u.push(i))}return s?u.sort((i,c)=>M(c)-M(i)):u}function oe(n,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>D(n,r)):e.requireCallableSymbol?N(n,{scope:e.scope,symbolMatches:T,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?N(n,{scope:e.scope,symbolMatches:P,sqlPrefilter:"function-like"}):W(n,e.scope)}function ae(n,e){return e.requireCallableSymbol?T(n.symbol):e.requireFunctionLikeSymbol?P(n.symbol):n.isFunctionLike}function se(n){return(n.split("/").pop()??"").includes("types")}var ie=class{constructor(e){this.db=e}db;scopedDefinitions(e){return G(this.db,e)}definitionsForFile(e){return D(this.db,e)}productionCallableDefinitions(e={}){return te(this.db,e)}calleeMap(e,t={}){return X(this.db,e,{...t,semanticEvidence:v})}crossFileCallerMap(e,t={}){return Z(this.db,e,{...t,semanticEvidence:v})}sourceFallbackCallerFiles(e,t={}){return $(this.db,e,t)}callerFileMap(e,t={}){return ee(this.db,e,{...t,semanticEvidence:v})}frameworkReferencedSymbolIds(e){let t=new Map;for(let l of e){if(!l.leaf)continue;let o=t.get(l.leaf)??[];o.push(l.symbolId),t.set(l.leaf,o)}let r=new Set;for(let l of q(this.db,{includeIgnored:!1}))if(R(l)==="rust")for(let{name:o}of F(this.db,l,{includeRustAttributeNames:!0}))for(let f of t.get(o)??[])r.add(f);return r}symbolsWithNonSelfCallees(e,t={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),l=this.calleeMap(e,t);return new Set([...l.entries()].filter(([o,f])=>{let m=r.get(o);return f.some(p=>p.symbol!==m)}).map(([o])=>o))}fileDependencyGraph(e){return B(this.db,e)}fileKind(e){return I(e)}hasSuppressionComment(e){return h(this.db,e.relativePath,e.startLine)}sourceFiles(){return j(this.db)}scanSourceReferences(e,t){ne(this.db,e,t)}callableSignature(e){let t=V(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return t?{paramCount:t.paramCount}:null}};export{ie as a};
2
+ //# sourceMappingURL=chunk-7TJJY2C3.js.map