scip-query 0.10.8 → 0.10.10

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 (227) hide show
  1. package/README.md +3 -1
  2. package/dist/{chunk-E2CCBFLR.js → chunk-2UYQLFVC.js} +2 -2
  3. package/dist/chunk-2VM46FC5.js +8 -0
  4. package/dist/{chunk-24S6MYOC.js → chunk-3DGD6NKW.js} +2 -2
  5. package/dist/chunk-3Q77KKEY.js +2 -0
  6. package/dist/chunk-3VD3JMK2.js +2 -0
  7. package/dist/{chunk-RSKOYTSY.js → chunk-4KTOV4QN.js} +2 -2
  8. package/dist/chunk-4N4WONI4.js +102 -0
  9. package/dist/{chunk-EBIQY3RK.js → chunk-56P7PDST.js} +2 -2
  10. package/dist/{chunk-BWL2ECGQ.js → chunk-5NVUWIAN.js} +2 -2
  11. package/dist/{chunk-BEUQVBE3.js → chunk-5VG7RKEF.js} +2 -2
  12. package/dist/{chunk-C6BYNIH4.js → chunk-65AU3HFZ.js} +2 -2
  13. package/dist/{chunk-NWFSC356.js → chunk-6LNQOOTB.js} +2 -2
  14. package/dist/{chunk-6TDOT7B3.js → chunk-72KY2ZFO.js} +2 -2
  15. package/dist/{chunk-7KJBH4IP.js → chunk-736BLPHR.js} +2 -2
  16. package/dist/chunk-7JRRXGVZ.js +2 -0
  17. package/dist/{chunk-RHKMQNFI.js → chunk-7UQWUVRG.js} +2 -2
  18. package/dist/chunk-A6IDHNMC.js +4 -0
  19. package/dist/chunk-A6TANQNV.js +2 -0
  20. package/dist/{chunk-X3Z4MLVL.js → chunk-AW2QHPLL.js} +2 -2
  21. package/dist/chunk-BSN22NRK.js +9 -0
  22. package/dist/{chunk-ZDR4VTOP.js → chunk-BVRS7RKQ.js} +2 -2
  23. package/dist/{chunk-ANIOISCE.js → chunk-C5CTSJ6X.js} +2 -2
  24. package/dist/{chunk-MEKSFV6H.js → chunk-CCKPYPDI.js} +2 -2
  25. package/dist/chunk-CZ425R2B.js +18 -0
  26. package/dist/{chunk-QDGKE5HN.js → chunk-DQVKIG3D.js} +2 -2
  27. package/dist/chunk-F6ICF7HL.js +40 -0
  28. package/dist/chunk-FAYI6KZ5.js +2 -0
  29. package/dist/{chunk-ZL52RLDK.js → chunk-FDEQIPPK.js} +2 -2
  30. package/dist/chunk-FRPEPTYJ.js +5 -0
  31. package/dist/chunk-GBEYTDY5.js +2 -0
  32. package/dist/{chunk-VFLHKRTW.js → chunk-GRJY65YT.js} +2 -2
  33. package/dist/chunk-HF25DFSC.js +3 -0
  34. package/dist/chunk-HHN2B5KA.js +2 -0
  35. package/dist/{chunk-FKUCFCLU.js → chunk-I46WR7MT.js} +2 -2
  36. package/dist/{chunk-5SMUKUV5.js → chunk-IPQTC36U.js} +2 -2
  37. package/dist/{chunk-FGTHPJON.js → chunk-J7RWXLUL.js} +2 -2
  38. package/dist/{chunk-63MSELOP.js → chunk-KX5PLFZ5.js} +2 -2
  39. package/dist/{chunk-VMPB52FG.js → chunk-LPL4MA6R.js} +2 -2
  40. package/dist/chunk-LZHUWKGD.js +2 -0
  41. package/dist/{chunk-BJWNO6BU.js → chunk-MMLZEGMS.js} +2 -2
  42. package/dist/{chunk-5G5VI7J4.js → chunk-NZ4UDB5N.js} +2 -2
  43. package/dist/{chunk-3LQFMQPY.js → chunk-OBGRLXWF.js} +2 -2
  44. package/dist/chunk-P5RYBRIO.js +4 -0
  45. package/dist/chunk-PKMZCDQD.js +4 -0
  46. package/dist/{chunk-T633QLYF.js → chunk-PTQVNJ4Q.js} +2 -2
  47. package/dist/{chunk-FHWEEQVO.js → chunk-QPU7EXAW.js} +2 -2
  48. package/dist/chunk-QVI3NR7E.js +7 -0
  49. package/dist/{chunk-6EO3E3IP.js → chunk-QX7LLCGB.js} +2 -2
  50. package/dist/{chunk-AA7L7GKI.js → chunk-QYB5P7GL.js} +2 -2
  51. package/dist/chunk-RVWSAMTT.js +2 -0
  52. package/dist/{chunk-SHM5D3DQ.js → chunk-RXRLZFUL.js} +2 -2
  53. package/dist/{chunk-LGX2Y4BA.js → chunk-RYXW3KRC.js} +2 -2
  54. package/dist/{chunk-B4EHYG6M.js → chunk-SGLLBSCV.js} +2 -2
  55. package/dist/{chunk-ZMU6IWDK.js → chunk-SULEXAHO.js} +2 -2
  56. package/dist/{chunk-KZYHFI2X.js → chunk-TH2N6QHW.js} +2 -2
  57. package/dist/{chunk-JRUKS66S.js → chunk-TL6QPNF5.js} +2 -2
  58. package/dist/{chunk-JUIAOOK7.js → chunk-UDGXK2WA.js} +2 -2
  59. package/dist/{chunk-Q34NWRPP.js → chunk-UFX7EPBA.js} +2 -2
  60. package/dist/chunk-UQLFQLAF.js +2 -0
  61. package/dist/{chunk-VXT7WVIN.js → chunk-UWYJDBDW.js} +2 -2
  62. package/dist/{chunk-GZQID3FS.js → chunk-UYD7FJ3K.js} +2 -2
  63. package/dist/{chunk-2YI45TNM.js → chunk-VUKC6F77.js} +2 -2
  64. package/dist/{chunk-L4QKEQ4S.js → chunk-WG6KRH5F.js} +2 -2
  65. package/dist/{chunk-LWTML2AN.js → chunk-XIVO4SDZ.js} +2 -2
  66. package/dist/{chunk-N7F5UM6J.js → chunk-XSNRACLV.js} +2 -2
  67. package/dist/chunk-XUGQU7PM.js +41 -0
  68. package/dist/{chunk-BJG67TCR.js → chunk-XXZXDXTD.js} +2 -2
  69. package/dist/chunk-Y6E3JHC4.js +2 -0
  70. package/dist/{chunk-6BNOACLT.js → chunk-YBEEVDJQ.js} +2 -2
  71. package/dist/chunk-YGHUVQLR.js +2 -0
  72. package/dist/chunk-YWDVDAD7.js +2 -0
  73. package/dist/{chunk-6N6QTGSD.js → chunk-Z4I7BVIU.js} +2 -2
  74. package/dist/{chunk-3FYGJ2GY.js → chunk-ZQO43G2T.js} +2 -2
  75. package/dist/{chunk-JYSAYZNX.js → chunk-ZU6PROUY.js} +2 -2
  76. package/dist/cli.js +256 -205
  77. package/dist/{db-BAVwb4Pb.d.ts → db-Djj3Nqrb.d.ts} +2 -0
  78. package/dist/{health-B17sVFYf.d.ts → health-D5J42g4D.d.ts} +1 -1
  79. package/dist/index.d.ts +3 -2
  80. package/dist/index.js +3 -3
  81. package/dist/queries/affected.d.ts +1 -1
  82. package/dist/queries/affected.js +1 -1
  83. package/dist/queries/bottlenecks.d.ts +1 -1
  84. package/dist/queries/bottlenecks.js +1 -1
  85. package/dist/queries/by-kind.d.ts +1 -1
  86. package/dist/queries/by-kind.js +1 -1
  87. package/dist/queries/call-graph.d.ts +1 -1
  88. package/dist/queries/call-graph.js +1 -1
  89. package/dist/queries/change-surface.d.ts +1 -1
  90. package/dist/queries/change-surface.js +1 -1
  91. package/dist/queries/cleanup-plan.d.ts +1 -1
  92. package/dist/queries/cleanup-plan.js +1 -1
  93. package/dist/queries/co-change.d.ts +1 -1
  94. package/dist/queries/co-change.js +1 -1
  95. package/dist/queries/code.d.ts +1 -1
  96. package/dist/queries/code.js +1 -1
  97. package/dist/queries/complexity-hotspots.d.ts +1 -1
  98. package/dist/queries/complexity-hotspots.js +1 -1
  99. package/dist/queries/complexity.d.ts +1 -1
  100. package/dist/queries/complexity.js +1 -1
  101. package/dist/queries/convergence.d.ts +1 -1
  102. package/dist/queries/convergence.js +1 -1
  103. package/dist/queries/coupling.d.ts +1 -1
  104. package/dist/queries/coupling.js +1 -1
  105. package/dist/queries/cycles.d.ts +1 -1
  106. package/dist/queries/cycles.js +1 -1
  107. package/dist/queries/dataflow.d.ts +1 -1
  108. package/dist/queries/dataflow.js +1 -1
  109. package/dist/queries/dead.d.ts +1 -1
  110. package/dist/queries/dead.js +1 -1
  111. package/dist/queries/deep-chains.d.ts +1 -1
  112. package/dist/queries/deep-chains.js +1 -1
  113. package/dist/queries/deps.d.ts +1 -1
  114. package/dist/queries/deps.js +1 -1
  115. package/dist/queries/diff-gate.d.ts +1 -1
  116. package/dist/queries/diff-gate.js +1 -1
  117. package/dist/queries/diff-impact.d.ts +1 -1
  118. package/dist/queries/diff-impact.js +1 -1
  119. package/dist/queries/doc-drift.d.ts +1 -1
  120. package/dist/queries/doc-drift.js +1 -1
  121. package/dist/queries/drift.d.ts +2 -1
  122. package/dist/queries/drift.js +1 -1
  123. package/dist/queries/extract-candidates.d.ts +1 -1
  124. package/dist/queries/extract-candidates.js +1 -1
  125. package/dist/queries/fan.d.ts +1 -1
  126. package/dist/queries/fan.js +1 -1
  127. package/dist/queries/files.d.ts +1 -1
  128. package/dist/queries/health.d.ts +2 -2
  129. package/dist/queries/health.js +1 -1
  130. package/dist/queries/hierarchy.d.ts +1 -1
  131. package/dist/queries/hierarchy.js +1 -1
  132. package/dist/queries/hotspots.d.ts +1 -1
  133. package/dist/queries/hotspots.js +1 -1
  134. package/dist/queries/imports.d.ts +1 -1
  135. package/dist/queries/imports.js +1 -1
  136. package/dist/queries/incomplete-migration.d.ts +1 -1
  137. package/dist/queries/incomplete-migration.js +1 -1
  138. package/dist/queries/index.d.ts +2 -2
  139. package/dist/queries/index.js +1 -1
  140. package/dist/queries/isolated.d.ts +1 -1
  141. package/dist/queries/isolated.js +1 -1
  142. package/dist/queries/locality-candidates.d.ts +1 -1
  143. package/dist/queries/locality-candidates.js +1 -1
  144. package/dist/queries/members.d.ts +1 -1
  145. package/dist/queries/members.js +1 -1
  146. package/dist/queries/methods.d.ts +1 -1
  147. package/dist/queries/methods.js +1 -1
  148. package/dist/queries/outline.d.ts +1 -1
  149. package/dist/queries/outline.js +1 -1
  150. package/dist/queries/passthrough-candidates.d.ts +1 -1
  151. package/dist/queries/passthrough-candidates.js +1 -1
  152. package/dist/queries/plan-context.d.ts +1 -1
  153. package/dist/queries/plan-context.js +1 -1
  154. package/dist/queries/react-component-duplicates.d.ts +2 -1
  155. package/dist/queries/react-component-duplicates.js +1 -1
  156. package/dist/queries/react-hook-candidates.d.ts +2 -1
  157. package/dist/queries/react-hook-candidates.js +1 -1
  158. package/dist/queries/react-large-component-pressure.d.ts +1 -1
  159. package/dist/queries/react-large-component-pressure.js +1 -1
  160. package/dist/queries/recent-duplicates.d.ts +1 -1
  161. package/dist/queries/recent-duplicates.js +1 -1
  162. package/dist/queries/redundant-reexports.d.ts +1 -1
  163. package/dist/queries/redundant-reexports.js +1 -1
  164. package/dist/queries/refs.d.ts +1 -1
  165. package/dist/queries/refs.js +1 -1
  166. package/dist/queries/self-audit.d.ts +1 -1
  167. package/dist/queries/self-audit.js +1 -1
  168. package/dist/queries/similar-chains.d.ts +1 -1
  169. package/dist/queries/similar-chains.js +1 -1
  170. package/dist/queries/similar-files.d.ts +1 -1
  171. package/dist/queries/similar-files.js +1 -1
  172. package/dist/queries/similar-signatures.d.ts +1 -1
  173. package/dist/queries/similar-signatures.js +1 -1
  174. package/dist/queries/similar.d.ts +2 -1
  175. package/dist/queries/similar.js +1 -1
  176. package/dist/queries/slice.d.ts +1 -1
  177. package/dist/queries/slice.js +1 -1
  178. package/dist/queries/stale-abstractions.d.ts +1 -1
  179. package/dist/queries/stale-abstractions.js +1 -1
  180. package/dist/queries/stats.d.ts +1 -1
  181. package/dist/queries/surface.d.ts +1 -1
  182. package/dist/queries/surface.js +1 -1
  183. package/dist/queries/symbols.d.ts +1 -1
  184. package/dist/queries/symbols.js +1 -1
  185. package/dist/queries/system.d.ts +1 -1
  186. package/dist/queries/system.js +1 -1
  187. package/dist/queries/trace.d.ts +1 -1
  188. package/dist/queries/trace.js +1 -1
  189. package/dist/queries/unused-imports.d.ts +1 -1
  190. package/dist/queries/unused-imports.js +1 -1
  191. package/dist/queries/unused-params.d.ts +1 -1
  192. package/dist/queries/unused-params.js +1 -1
  193. package/dist/queries/vue-component-duplicates.d.ts +2 -1
  194. package/dist/queries/vue-component-duplicates.js +1 -1
  195. package/dist/queries/vue-composable-candidates.d.ts +2 -1
  196. package/dist/queries/vue-composable-candidates.js +1 -1
  197. package/dist/queries/vue-large-view-pressure.d.ts +1 -1
  198. package/dist/queries/wrapper-candidates.d.ts +1 -1
  199. package/dist/queries/wrapper-candidates.js +1 -1
  200. package/docs/analyzer-inventory.md +29 -0
  201. package/docs/analyzer-validation-ledger.md +32 -1
  202. package/package.json +1 -1
  203. package/dist/chunk-2H57MJLI.js +0 -2
  204. package/dist/chunk-4TMJDHC6.js +0 -5
  205. package/dist/chunk-5GVOJOBL.js +0 -2
  206. package/dist/chunk-7XWXGANX.js +0 -4
  207. package/dist/chunk-AETMKBZR.js +0 -40
  208. package/dist/chunk-BTCASU5J.js +0 -3
  209. package/dist/chunk-C6ROZBJA.js +0 -32
  210. package/dist/chunk-COUFCH64.js +0 -2
  211. package/dist/chunk-EKECQP6Z.js +0 -2
  212. package/dist/chunk-FVA3NH4P.js +0 -2
  213. package/dist/chunk-I274B3B3.js +0 -7
  214. package/dist/chunk-J6ADQKQA.js +0 -2
  215. package/dist/chunk-K7VBTWNR.js +0 -2
  216. package/dist/chunk-KLXVEBVC.js +0 -2
  217. package/dist/chunk-KRGBLZT2.js +0 -7
  218. package/dist/chunk-P3K7LX7M.js +0 -4
  219. package/dist/chunk-PVZMPG5I.js +0 -2
  220. package/dist/chunk-RY7CAOJF.js +0 -4
  221. package/dist/chunk-S7YOLFLX.js +0 -2
  222. package/dist/chunk-SOGKYB5I.js +0 -8
  223. package/dist/chunk-VAXDTQHE.js +0 -18
  224. package/dist/chunk-X3BJUFSN.js +0 -62
  225. package/dist/chunk-XPOZO76D.js +0 -2
  226. package/dist/chunk-XWC67C3Q.js +0 -2
  227. package/dist/chunk-YNSVAJR6.js +0 -2
@@ -0,0 +1,4 @@
1
+ import{a as ae}from"./chunk-7JRRXGVZ.js";import{a as se}from"./chunk-2VM46FC5.js";import{a as S}from"./chunk-B32FX5KB.js";import{a as re}from"./chunk-QVI3NR7E.js";import{a as ne}from"./chunk-AW2QHPLL.js";import{a as oe}from"./chunk-C2QSK7E7.js";import{a as te,c as ie}from"./chunk-FRPEPTYJ.js";import{a as X}from"./chunk-A6TANQNV.js";import{a as ee}from"./chunk-KX5PLFZ5.js";import{a as Q}from"./chunk-ZU6PROUY.js";import{a as O,c as U,d as V,h as L,i as B}from"./chunk-DQVKIG3D.js";import{a as q,b as x,e as W}from"./chunk-PKMZCDQD.js";import{a as Z}from"./chunk-CZ425R2B.js";import{b as J}from"./chunk-3Q77KKEY.js";import{a as E,c as H,d as _,e as z}from"./chunk-65AU3HFZ.js";import{g as M}from"./chunk-BSN22NRK.js";import{a as Y}from"./chunk-QYB5P7GL.js";import{a as I}from"./chunk-GBEYTDY5.js";import{f as F,g as v}from"./chunk-C5CTSJ6X.js";import{d as k,e as N,f as P}from"./chunk-JM72FNGA.js";import{createHash as Me}from"crypto";import{existsSync as ge}from"fs";function ce(e){let[i,t]=A(e,":"),n=i||"unknown",o=(s={})=>{let r=s.actionTier??pe(n);return{sourceAnalyzer:n,actionTier:r,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${n} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??ye(r,n),file:s.file}};if(!t)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(n)){let[s,r]=A(t,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:r?`${s}:${r}`:t,label:`${n} finding`,why:r?[`Baseline subject: ${r}.`]:[]})}if(n==="cycle"){let s=t.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(n==="similar"){let s=t.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(n==="drift"){let[s,r]=A(t,":"),[l,a]=A(r,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:l,relatedFiles:[...new Set([l,a].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function pe(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function ye(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function A(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as be,readFileSync as le}from"fs";var w={classifyCitation:Ce,citationContexts:Se,citationKindLabel:De,citationRemediation:we,referenceTargets:Re};function Ce(e){let i=e.join(`
2
+ `).toLowerCase(),t=[],n=x(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(n.length>0)return t.push(`configuration/example terms near citation: ${n.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:t};let o=x(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return t.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:t};let s=x(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(t.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:t}):(t.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:t})}function Se(e,i,t){let n;try{n=le(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=t.flatMap($e),s=[];for(let r=0;r<n.length;r+=1){let l=n[r]??"";o.some(a=>l.includes(a))&&s.push(q(n,r))}return s}function $e(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((t,n,o)=>t.length>0&&o.indexOf(t)===n)}function De(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function we(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function Re(e,i,t){let n=O(t),o=new Set;for(let s of i)Te(e,s,n.get(s)??[])&&o.add(s);return o}function Te(e,i,t){if(t.length===0)return!1;if(!ke.test(i))return!0;let n=`${e.config.projectRoot}/${i}`;if(!be(n))return!0;let o=le(n,"utf-8").split(/\r?\n/),s=Fe(o);for(let r of t)for(let l=r.startLine;l<=r.endLine;l+=1)if((o[l]??"").trim()!==""&&!s.has(l))return!0;return!1}var ke=/\.(?:[cm]?[jt]sx?)$/i;function Fe(e){let i=new Set,t=!1;for(let n=0;n<e.length;n+=1){let o=e[n].trim();!t&&ve(o)&&(t=!0),t&&(i.add(n),o.endsWith(";")&&(t=!1))}return i}function ve(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}import{existsSync as xe,readFileSync as Ae,writeFileSync as Ge}from"fs";import{isAbsolute as je,join as Ee}from"path";var Le=75e3,Be=5e3,Ke=2500;function Ne(e){let i=oe(e);return i.symbols>=Le||i.documents>=Be?Ke:void 0}var Pe=".scipquery-baseline.json";function G(e,i){return i&&je(i)?i:Ee(e.config.projectRoot,i??Pe)}function fe(e,i={}){let{scope:t}=i,n=Ne(e),o=[],s=J(e,{scope:t,...S.dead,scanLimit:n});for(let r of s.symbols)F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||r.kind==="dead-code"&&o.push(`dead:${r.relativePath}:${r.shortName}`);for(let r of X(e,{scope:t,...S.isolated,scanLimit:n}))F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||o.push(`isolated:${r.relativePath}:${r.shortName}`);for(let r of Y(e,{scope:t}))r.kind==="real"&&o.push(`cycle:${Ie(r.path)}`);for(let r of ie(e,{scope:t,...S.similar,scanLimit:n}))o.push(`similar:${[r.symbolA,r.symbolB].sort().join("|")}`);for(let r of Q(e,{scope:t,...S.extract,scanLimit:n}))o.push(`extract:${r.relativePath}:${r.shortName}`);for(let r of re(e,{scope:t,...S.wrappers,scanLimit:n}))o.push(`wrapper:${r.file}:${r.shortName}`);for(let r of ee(e,{scope:t,...S.passthroughs,scanLimit:n}))o.push(`passthrough:${r.file}:${r.shortName}`);for(let r of ne(e,{scope:t,...S.stale,scanLimit:n}))o.push(`stale:${r.file}:${r.shortName}`);for(let r of Z(e,{scope:t,...S.drift,includePatternDeviations:!1}).results)o.push(`drift:${r.kind}:${r.file}:${r.dep}`);return[...new Set(o)].sort()}function Ie(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function Bt(e,i={}){let t=fe(e,{scope:i.scope}),n=G(e,i.path);return Ge(n,JSON.stringify({version:1,findings:t},null,2)+`
3
+ `),{path:n,findingCount:t.length}}function de(e,i={}){let t=G(e,i.path);if(!xe(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let n=JSON.parse(Ae(t,"utf-8")),o=new Set(n.findings??[]),s=fe(e,{scope:i.scope}),r=new Set(s);return{baselinePath:t,baselineCount:o.size,current:s,newFindings:s.filter(l=>!o.has(l)),fixedFindings:[...o].filter(l=>!r.has(l))}}var Qt=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function Xt(e,i={}){let t=i.base??"HEAD",{minTogether:n=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:r=Number.POSITIVE_INFINITY,minSimilarity:l=.8,includeBaseline:a=!1,scanLimit:c}=i,y=i.semantic!==!1,h=new Set(i.skip??[]),f=V(e,{base:t}),m=U(e,{base:t,plan:f}),g=m.changedFiles,d=new Set(g),u=new Set(f.changedFileLines),b=new Set([...d,...u]),C=L(e.config.projectRoot,t,B(f,g)),T=dt(e.config.projectRoot,t,f,C),p={base:t,changedFiles:g,changedSymbols:m.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:m.summary.note};if(g.length===0)return p;let $=(K,me)=>{if(h.has(K)){p.skipped.push({check:K,reason:"skipped via --skip"});return}me()};return $("echo",()=>Ve(e,m.changedSymbols,d,T,s,l,c,y,p)),$("incomplete-migration",()=>tt(e,t,f,r,c,y,C,p)),$("co-change-partner",()=>it(e,b,n,o,p)),$("doc-reference",()=>at(e,d,u,f.changedRanges,p)),$("unused-params",()=>ct(e,g,p)),$("new-dead",()=>lt(e,m.changedSymbols,T,p)),a&&$("baseline",()=>gt(e,p)),Oe(p,e.config.suppressions??[]),p.rootCauseGroups=He(p.findings),p}function He(e){let i=new Map;for(let t of e){let n=t.groupKey??`${t.check}:${t.id}`,o=i.get(n);o||(o={groupKey:n,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(n,o)),o.count+=1,o.findingIds.push(t.id),o.severity=_e(o.severity,t.severity),o.actionTier=ze(o.actionTier,t.actionTier),t.file&&o.files.add(t.file);for(let s of t.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,n)=>n.count-t.count||j(n.severity)-j(t.severity)||t.groupKey.localeCompare(n.groupKey))}function _e(e,i){return j(i)>j(e)?i:e}function j(e){return e==="error"?2:e==="warning"?1:0}function ze(e,i){return e?i&&ue(i)>ue(e)?i:e:i}function ue(e){return e==="direct"?2:e==="signal"?1:0}function Oe(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let n of e.findings){let o=i.find(s=>Ue(s,n));o?e.suppressed.push({finding:n,suppression:o}):t.push(n)}e.findings=t}function Ue(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function R(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function Ve(e,i,t,n,o,s,r,l,a){a.checksRun.push("echo");for(let c of i.slice(0,o)){if(!P(c.symbol)||n(c))continue;let y=te(e,c.symbol,{minSimilarity:s,limit:5,scanLimit:r,semantic:l}),h=[];for(let d of y){let u=d.fileA===c.file?d.fileB:d.fileA,b=d.fileA===c.file?d.shortNameB:d.shortNameA,C=d.fileA===c.file?d.symbolB:d.symbolA;t.has(u)||h.push({otherFile:u,otherShort:b,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(h.length===0)continue;let f=h[0],m=D("echo",c.symbol,c.file,...h.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),g=qe(c,h);R(a,{id:m,groupKey:m,actionTier:g,check:"echo",severity:"warning",evidence:"heuristic",confidence:f.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(h.map(d=>d.otherFile))].sort(),message:Qe(c,h),why:Xe(c,h),remediation:et(g,c.shortName,f.otherShort)})}i.length>o&&a.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function qe(e,i){return i.some(n=>We(e.symbol,n))?"direct":"signal"}function We(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=k(e),n=k(i.otherSymbol);return!t||!n?!1:t===n?!0:Ze(i.sharedEvidence)?!1:Ye(t,n)}function Ye(e,i){let t=he(e),n=he(i);if(t.length===0||n.length===0)return!1;let o=new Set(n),s=t.filter(r=>o.has(r)).length;return s>=2&&s/Math.min(t.length,n.length)>=.5}function he(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var Je=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function Ze(e){return e.length>=3&&e.every(i=>Je.has(i.toLowerCase()))}function Qe(e,i){let t=i[0],n=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${n}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${n}% similar to ${t.otherShort} (${t.otherFile})`}function Xe(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let n of i.slice(0,3))t.push(`${n.otherShort} is outside this diff and scored ${Math.round(n.similarity*100)}% similar by ${n.similarityBasis} evidence.`),t.push(`Shared evidence: ${n.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function et(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function tt(e,i,t,n,o,s,r,l){let a=se(e,{base:i,maxHelpers:n,diffPlan:t,scanLimit:o,semantic:s,baseContentAt:r});if(!a.available){l.skipped.push({check:"incomplete-migration",reason:"no git history"});return}l.checksRun.push("incomplete-migration"),a.note&&l.skipped.push({check:"incomplete-migration",reason:a.note});for(let c of a.findings){let y=c.leftovers.map(u=>`${u.shortName} (${u.file}, ${Math.round(u.containment*100)}% helper / ${Math.round(u.siteCoverage*100)}% site, ${u.migrationScope})`).join(", "),h=c.leftovers.map(u=>`${u.shortName}: ${u.migrationScope} (${u.migrationScopeReasons[0]})`).join("; "),f=[...c.migratedFiles,...c.leftovers.map(u=>u.file)],m=c.leftovers.length===0?void 0:Math.max(...c.leftovers.map(u=>Math.min(u.containment,u.siteCoverage))),g=c.leftovers.some(u=>u.migrationScope==="possible-subtype"),d=D("incomplete-migration",c.helperSymbol,c.helperFile,f.join("|"));R(l,{id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:m,file:c.helperFile,symbol:c.helperSymbol,relatedFiles:f,message:`new helper ${c.helperShortName} (${c.helperFile}) is wired into ${c.migratedFiles.length} file(s), but ${c.leftovers.length} similar un-migrated site(s) remain: ${y}`,why:[`${c.helperShortName} is new in this diff and already referenced by ${c.migratedFiles.join(", ")}.`,`Helper shape: ${c.helperShape}; ${c.specificHelperCalleeCount}/${c.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${y}.`,`Migration scope hints: ${h}.`],remediation:g?`Migrate same-scope sites to ${c.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${c.helperShortName}, or confirm they are intentionally different.`})}}function it(e,i,t,n,o){let s=M(e,i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let r=new Set,l;for(let a of s){let c=i.has(a.fileA),y=i.has(a.fileB);if(c===y)continue;let h=c?a.fileA:a.fileB,f=c?a.fileB:a.fileA,m=c?a.changesA:a.changesB,g=m>0?a.together/m:0;if(g<n||E(f)||E(h)||!ge(`${e.config.projectRoot}/${f}`))continue;let d=`${h}|${f}`;if(r.has(d))continue;r.add(d);let u=D("co-change-partner",h,f,String(a.together)),b=H(h,f),C=_({fileA:h,fileB:f,together:a.together,confidence:g,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(l??=z(e))(h,f)),T=[h,f].sort().join("|");o.findings.push({id:u,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${T}`,confidence:g,file:h,relatedFiles:[f],sourceAnalyzer:"co-change",rootCauseKey:T,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${h} changed, but ${f} did not \u2014 they change together ${a.together}x (${Math.round(g*100)}% of the time)`,why:[`${h} is in this diff and ${f} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(g*100)}% of changes to the edited side.`,`History context: ${nt(a)}.`,`Subject context: ${ot(a.subjectContext)}.`,...rt(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:C?`Update ${f} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${f} alongside this change, or confirm the coupling no longer holds.`})}}function nt(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${st(e.lastTogetherAt)}`}function ot(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",n=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${n}; external issue/PR labels ${e.externalIssueLabelStatus}`}function rt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function st(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function at(e,i,t,n,o){o.checksRun.push("doc-reference");let s=w.referenceTargets(e,i,n);if(s.size!==0)for(let r of W(e,s)){if(t.has(r.doc))continue;let l=r.citedClaims.length>0?r.citedClaims:w.citationContexts(e,r.doc,r.cited),a=w.classifyCitation(l),c=D("doc-reference",r.doc,r.cited.join("|"));R(o,{id:c,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:r.doc,relatedFiles:r.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:l,message:`${r.doc} cites ${r.cited.join(", ")} as ${w.citationKindLabel(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${r.cited.join(", ")} changed in this diff.`,`${r.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(y=>`Citation kind evidence: ${y}`)],remediation:w.citationRemediation(a.citationKind,r.doc)})}}function ct(e,i,t){t.checksRun.push("unused-params");for(let n of ae(e,{files:i,limit:50})){let o=D("unused-params",n.symbol,n.file,n.unusedTrailing.join("|"));R(t,{id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:n.file,startLine:n.startLine,endLine:n.endLine,symbol:n.symbol,message:`${n.shortName} (${n.file}) has trailing unused parameter(s): ${n.unusedTrailing.join(", ")}`,why:[`${n.shortName} is in a changed file.`,`The trailing parameter(s) ${n.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function lt(e,i,t,n){n.checksRun.push("new-dead");let o=new I(e);for(let s of i){if(t(s)||s.fanIn>0||o.fileKind(s.file)==="test"||F(e,s.file)||v(e,s.symbol,s.file)||ft(s.symbol))continue;let r=D("new-dead",s.symbol,s.file);R(n,{id:r,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code."})}}function ft(e){if(N(e)!=="type")return!1;let i=k(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function dt(e,i,t,n){let o=new Map(t.renamedFiles.map(r=>[r.to,r.from])),s=n??L(e,i,B(t));return r=>{let l=o.get(r.file)??r.file,a=k(r.symbol);if(!a)return!1;let c=s(l);return c!==null&&ut(c,a)}}function ut(e,i){return new RegExp(`\\b${ht(i)}\\b`).test(e)}function ht(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function gt(e,i){if(!ge(G(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=de(e);for(let n of t.newFindings){let o=ce(n),s=D("baseline",n);R(i,{id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${n}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation})}}function D(e,...i){return`SQ${Me("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{fe as a,Bt as b,de as c,Qt as d,Xt as e,dt as f};
4
+ //# sourceMappingURL=chunk-A6IDHNMC.js.map
@@ -0,0 +1,2 @@
1
+ import{b as h}from"./chunk-B75HZHUP.js";import{a as u}from"./chunk-GBEYTDY5.js";import{a as o}from"./chunk-BGBBVSH4.js";import{e as p}from"./chunk-4KTOV4QN.js";import{c as y}from"./chunk-JM72FNGA.js";function W(m,c={}){let{scope:I,minLoc:C=3,scanLimit:r}=c,s=new u(m),d=c.semantic!==!1,b=h(s.productionCallableDefinitions({scope:I,minLoc:C,excludeEntrySurfaces:!0,excludeRustTraitImplMembers:!0,includeSuppressed:!0,sortByLocDesc:typeof r=="number"&&r>0}),r),l=s.symbolsWithNonSelfCallees(b,{additive:!1,semantic:!1}),i=b.filter(e=>!l.has(e.symbolId)),L=s.crossFileCallerMap(i,{semantic:!1}),a=new Set(L.keys());for(let e of s.frameworkReferencedSymbolIds(i))a.add(e);let t=i.filter(e=>!a.has(e.symbolId));if(d&&t.length>0){for(let e of p(m,t).keys())a.add(e);for(let e of s.symbolsWithNonSelfCallees(t,{additive:!1,semantic:!0}))l.add(e);t=t.filter(e=>!a.has(e.symbolId)).filter(e=>!l.has(e.symbolId))}let S=s.sourceFallbackCallerFiles(t);for(let e of S.keys())a.add(e);let f=t.filter(e=>!a.has(e.symbolId)),v=s.symbolsWithNonSelfCallees(f,{additive:!0,semantic:d});for(let e of v)l.add(e);return f.filter(e=>!l.has(e.symbolId)).sort((e,n)=>o(n)-o(e)||e.relativePath.localeCompare(n.relativePath)||e.startLine-n.startLine).map(e=>({symbol:e.symbol,shortName:y(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:o(e)}))}export{W as a};
2
+ //# sourceMappingURL=chunk-A6TANQNV.js.map
@@ -1,4 +1,4 @@
1
- import{a as I,b as K,c as $}from"./chunk-VFLHKRTW.js";import{a as A}from"./chunk-PFOCOG57.js";import{a as R}from"./chunk-XPOZO76D.js";import{b as M,g as k}from"./chunk-ANIOISCE.js";import{a as b}from"./chunk-BGBBVSH4.js";import{e as S}from"./chunk-YNSVAJR6.js";import{e as F}from"./chunk-RSKOYTSY.js";import{a as P,c as w,d as p}from"./chunk-JM72FNGA.js";import{e as T}from"./chunk-6TDOT7B3.js";import{a as h}from"./chunk-DS6QEB3G.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new R(t),m=a.scopedDefinitions(n),g=Q(a,n),v={high:0,medium:1,low:2};return A({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,prepare:u=>{let c=z(u),f=W(t,a,u,c,{semantic:d}),y=u.filter(L=>{let x=C(t,L,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&B(L,x.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!B(f.definition,f.realConsumers.length,g))return null;let y=E(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>v[u.confidence]-v[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&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>M(s.relativePath)!=="test").filter(s=>!k(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function U(t,e,n){return I(t,e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function W(t,e,n,i,s){let r=U(e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&D(a.relativePath))}),l=s.semantic&&o.length>0?S(r,F(t,o)):r,d=o.filter(a=>C(t,a,l,i).realConsumers.length<=1);return S(l,e.sourceFallbackCallerFiles(d))}function z(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=p(n.symbol);s&&i.set(s,n)}return e}function C(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=K(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function E(t,e){let n=N(t,e.definition.relativePath,e.definition.startLine),i=D(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),o=V(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(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),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=I(e,o,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(j(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(N(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(j(n.relativePath,s))??null:null}function G(t,e,n){let i=p(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!$(t,r,i))}function j(t,e){return`${t}\0${e}`}function J(t,e,n){let i=h(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=P(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 D(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 B(t,e,n){return!(D(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=T(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=s.get(r);if(!o||o.size===0)return!1;let l=i.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function N(t,e,n){let i=h(t,e);if(!i)return"other";let s=i.split(`
1
+ import{a as I,b as K,c as $}from"./chunk-GRJY65YT.js";import{a as A}from"./chunk-PFOCOG57.js";import{a as R}from"./chunk-GBEYTDY5.js";import{b as M,g as k}from"./chunk-C5CTSJ6X.js";import{a as b}from"./chunk-BGBBVSH4.js";import{e as S}from"./chunk-UQLFQLAF.js";import{e as F}from"./chunk-4KTOV4QN.js";import{a as P,c as w,d as p}from"./chunk-JM72FNGA.js";import{e as T}from"./chunk-72KY2ZFO.js";import{a as h}from"./chunk-DS6QEB3G.js";function de(t,e){let{scope:n,minLoc:i=3,maxLoc:s=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new R(t),m=a.scopedDefinitions(n),g=Q(a,n),v={high:0,medium:1,low:2};return A({candidates:()=>O(t,a,m,{minLoc:i,maxLoc:s}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,prepare:u=>{let c=z(u),f=W(t,a,u,c,{semantic:d}),y=u.filter(L=>{let x=C(t,L,f,c);return x.realConsumers.length<=1&&!x.transitivelyReachable&&B(L,x.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!B(f.definition,f.realConsumers.length,g))return null;let y=E(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>v[u.confidence]-v[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&&b(s)>=i.minLoc).filter(s=>b(s)<=i.maxLoc).filter(s=>!t.isIgnored(s.relativePath)).filter(s=>M(s.relativePath)!=="test").filter(s=>!k(t,s.symbol,s.relativePath)).filter(s=>!X(s.symbol)).filter(s=>!e.hasSuppressionComment(s))}function U(t,e,n){return I(t,e,{semantic:n.semantic,sourceFallback:n.sourceFallback})}function W(t,e,n,i,s){let r=U(e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,i);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&D(a.relativePath))}),l=s.semantic&&o.length>0?S(r,F(t,o)):r,d=o.filter(a=>C(t,a,l,i).realConsumers.length<=1);return S(l,e.sourceFallbackCallerFiles(d))}function z(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=p(n.symbol);s&&i.set(s,n)}return e}function C(t,e,n,i){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=K(t,e,r),a=Y(t,e,n,i);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function E(t,e){let n=N(t,e.definition.relativePath,e.definition.startLine),i=D(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:s,reason:r}=ne(e.realConsumers.length,n,i),o=V(e.realConsumers.length,n,i);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:i,confidence:s,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(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),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=I(e,o,{semantic:s.semantic}),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let i=p(n.symbol);i&&e.set(j(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(N(t,n.relativePath,n.startLine)!=="class")return null;let i=p(n.symbol);if(!i)return null;let s=J(t,n.relativePath,i);return s?e.get(j(n.relativePath,s))??null:null}function G(t,e,n){let i=p(e.symbol),s=n.get(e.symbolId);return!i||!s?!1:[...s].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!$(t,r,i))}function j(t,e){return`${t}\0${e}`}function J(t,e,n){let i=h(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=P(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 D(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 B(t,e,n){return!(D(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,i){let s=T(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=s.get(r);if(!o||o.size===0)return!1;let l=i.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function N(t,e,n){let i=h(t,e);if(!i)return"other";let s=i.split(`
2
2
  `),r=Math.max(0,n-2),o=Math.min(s.length-1,n+2);for(let l=r;l<=o;l++){let a=(s[l]??"").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=h(t,e.relativePath);if(!n)return!1;let i=p(e.symbol);if(!i)return!1;let s=i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${s}\\b`),o=n.split(`
3
3
  `);for(let l=0;l<o.length;l++)if(!(l>=e.startLine&&l<=e.endLine)&&r.test(o[l]??""))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-X3Z4MLVL.js.map
4
+ //# sourceMappingURL=chunk-AW2QHPLL.js.map
@@ -0,0 +1,9 @@
1
+ import{d as _,e as E}from"./chunk-XUGQU7PM.js";import{d as H}from"./chunk-7S5E7KWT.js";import{execFileSync as O}from"child_process";var y=2e3,S=50,L=64,N=8,j=3,B=2160*60*60,I=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,v=3,G=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,U=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function T(e){let t=H(e,{clearGroups:["whole-project"]});return(n,r)=>{let i=D(n.config.projectRoot);if(!i)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===i?o.value:(t.invalidate(n),t.get(n,()=>({head:i,value:r(n.config.projectRoot,i)})).value)}}var J=T("git-commit-history");function x(e){return J(e,K)}function D(e){try{return p(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function p(e,t){return O("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function K(e,t){let n;try{n=p(e,["log","--no-merges","--name-only","-n",String(y),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...R(n,S)}}function V(e){return I.test(e.subject)}function de(e){let t=x(e);if(!t)return null;let n=new Map;for(let r of t.commits){let i=V(r);for(let o of r.files){let c=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};c.changes+=1,i&&(c.fixChanges+=1),r.timestamp>c.lastChangedAt&&(c.lastChangedAt=r.timestamp),n.set(o,c)}}return n}function ge(e){let t=x(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(r=>r.files.length).filter(r=>r>0).sort((r,i)=>r-i);return n.length===0?null:{medianFilesPerCommit:P(n,.5),p90FilesPerCommit:P(n,.9),commitsAnalyzed:n.length}}function P(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var W=T("git-tracked-files");function fe(e){return W(e,t=>{try{let n=p(t,["ls-files"]);return new Set(n.split(`
2
+ `).map(r=>r.trim()).filter(r=>r!==""))}catch{return null}})}var X=T("git-file-adds"),k="__git__/file-adds";function he(e){return X(e,(t,n)=>Y(e,t,n))}function Y(e,t,n){let r=$(_(e,"git-file-adds",k,n));if(r)return r;let i=q(t);return i&&E(e,"git-file-adds",k,n,Z(i)),i}function Z(e){return JSON.stringify([...e.entries()])}function $(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let r of t){if(!Array.isArray(r)||r.length!==2||typeof r[0]!="string")return null;let i=r[1];if(!i||typeof i.commitsAgo!="number"||!Number.isFinite(i.commitsAgo)||typeof i.addedAt!="number"||!Number.isFinite(i.addedAt))return null;n.set(r[0],{commitsAgo:i.commitsAgo,addedAt:i.addedAt})}return n}catch{return null}}function q(e){let t;try{t=p(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(y),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,r=-1;for(let i of t.split("")){if(i.trim()==="")continue;r+=1;let o=i.indexOf(`
3
+ `),c=o>=0?i.slice(0,o):i,[,m]=c.split("\0"),l=Number(m)||0;if(!(o<0))for(let g of i.slice(o+1).split(`
4
+ `)){let h=g.trim();h!==""&&n.set(h,{commitsAgo:r,addedAt:l})}}return n}function pe(e,t={}){let n=x(e);return n?F(n,t):null}function Q(e,t,n={}){let r=x(e);return r?t.size===0?[]:F(r,n,t):null}function Ce(e,t,n={}){if(t.size===0)return[];let r=D(e.config.projectRoot);if(!r)return null;let i=n.maxFilesPerCommit??S;if(t.size>L)return Q(e,t,n);let o=ee(e.config.projectRoot,r,t,i);return o?F(o,n,t):null}function F(e,t,n){let{minTogether:r=4,minConfidence:i=.6,maxFilesPerCommit:o=S}=t,c=new Map,m=new Map,l=e.newestAnalyzedAt??0;for(let s of e.commits){let a=[...new Set(s.files)].sort();if(a.length>o)continue;e.newestAnalyzedAt===void 0&&s.timestamp>l&&(l=s.timestamp);let f=re(a),A=n===void 0||a.some(u=>n.has(u));for(let u of a)c.set(u,(c.get(u)??0)+1);if(A)for(let u=0;u<a.length;u++)for(let C=u+1;C<a.length;C++){if(n&&!n.has(a[u])&&!n.has(a[C]))continue;let b=`${a[u]}\0${a[C]}`,d=m.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};d.together+=1,f?d.broadTogether+=1:d.focusedTogether+=1,s.timestamp>d.lastTogetherAt&&(d.lastTogetherAt=s.timestamp),d.timestamps.push(s.timestamp),d.subjects.push(s.subject),m.set(b,d)}}let g=[],h=l-B;for(let[s,a]of m){let f=a.together;if(f<r)continue;let[A,u]=s.split("\0"),C=c.get(A)??f,b=c.get(u)??f,d=Math.max(f/C,f/b);if(d<i)continue;let M=a.broadTogether/f,w=a.timestamps.filter(z=>z>=h).length;g.push({fileA:A,fileB:u,together:f,confidence:d,changesA:C,changesB:b,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:M,lastTogetherAt:a.lastTogetherAt,recentTogether:w,commitScope:oe(a.broadTogether,f),recency:w>0?"recent":"stale",subjectContext:se(a.subjects)})}return g.sort((s,a)=>a.together-s.together||a.confidence-s.confidence||s.fileA.localeCompare(a.fileA)),g}function ee(e,t,n,r){let i;try{i=te(e)}catch{return null}if(i.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let o;try{o=p(e,["log","--no-merges","--format=%H","-n",String(y),"--",...[...n].sort()])}catch{return null}let c=new Set(i.map(s=>s.hash)),m=o.split(`
5
+ `).map(s=>s.trim()).filter(s=>s!==""&&c.has(s)),l=ne(e,i,r);if(m.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:l};let g;try{g=p(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...m])}catch{return null}let h=R(g,r);return{head:t,...h,newestAnalyzedAt:l}}function te(e){return p(e,["log","--no-merges","--format=%H%x00%ct","-n",String(y)]).split(`
6
+ `).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[r,i]=n.split("\0");return{hash:r??"",timestamp:Number(i)||0}}).filter(n=>n.hash!=="")}function ne(e,t,n){for(let i=0;i<t.length;i+=20){let o=t.slice(i,i+20),c;try{c=p(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(l=>l.hash)])}catch{return t[0]?.timestamp??0}let m=R(c,n);if(m.commits.length>0)return m.commits[0].timestamp}return 0}function R(e,t){let n=[],r=0;for(let i of e.split("")){if(i.trim()==="")continue;let o=i.indexOf(`
7
+ `),c=o>=0?i.slice(0,o):i,[m,l,g]=c.split("\0");if(!m||!l)continue;let h=o>=0?i.slice(o+1).split(`
8
+ `).map(s=>s.trim()).filter(s=>s!==""):[];if(h.length>t){r+=1;continue}n.push({hash:m,timestamp:Number(l)||0,subject:g??"",files:h})}return{commits:n,skippedBulkCommits:r}}function re(e){return e.length>=N?!0:ie(e).size>=j}function ie(e){let t=new Set;for(let n of e){let r=n.indexOf("/");t.add(r>=0?n.slice(0,r):".")}return t}function oe(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function se(e){let t=new Set,n=[],r=[];for(let i of e){!r.includes(i)&&r.length<v&&r.push(i);for(let o of ae(i))t.add(o);for(let o of i.match(G)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:r,externalIssueLabelStatus:"unavailable"}}function ae(e){let t=new Set,n=U.exec(e)?.[1]?.toLowerCase();return n&&t.add(ce(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function ce(e){return e==="feat"?"feature":e}export{x as a,de as b,ge as c,fe as d,he as e,pe as f,Ce as g};
9
+ //# sourceMappingURL=chunk-BSN22NRK.js.map
@@ -1,2 +1,2 @@
1
- import{a as k}from"./chunk-2YI45TNM.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
2
- //# sourceMappingURL=chunk-ZDR4VTOP.js.map
1
+ import{a as k}from"./chunk-VUKC6F77.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
2
+ //# sourceMappingURL=chunk-BVRS7RKQ.js.map
@@ -1,6 +1,6 @@
1
- import{a as E}from"./chunk-2YI45TNM.js";import{d as _}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-6TDOT7B3.js";import{c as P}from"./chunk-A536TEU4.js";import{d as p}from"./chunk-7S5E7KWT.js";import{existsSync as d,readFileSync as D,readdirSync as y}from"fs";import{join as l}from"path";var R={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,F=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],C=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),I=4,M=p("package-surface",{clearGroups:["whole-project"]});function X(t){return M.get(t,()=>W(t.config.projectRoot))}function T(t,e){let r=X(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function W(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of U(t))for(let n of B(s))G(t,i,n,e,r);return e.size===0&&r.length===0?R:{files:e,pathPrefixes:r}}function U(t){let e=[],r=k(t,"");return r&&e.push({manifest:r,packageRoot:""}),w(t,"",e,0),e}function w(t,e,r,s){if(s>=I)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||C.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=k(t,a);o&&r.push({manifest:o,packageRoot:a}),w(t,a,r,s+1)}}function k(t,e){try{let r=D(l(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function B(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return $(t.exports,e),e}function $(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))$(r,e)}function G(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of m(c))u!==""&&i.push(f(e,u));return}let o=n.replace(F,"");for(let c of m(o)){c===o&&c===n&&s.add(f(e,n));for(let u of j)L(t,s,e,c+u)}s.add(f(e,n))}function m(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function L(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(h=>s.endsWith(h));if(!n)return;let a=s.slice(0,-n.length);V(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let h of v(t,r,c,`${u}${n}`))e.add(h)}function V(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(l(t,n))&&e.add(n)}function v(t,e,r,s){let i=l(t,e,r);if(!d(i))return[];let n=[];for(let a of y(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...v(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}function S(t){let e=g(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return S(t)==="barrel"}function N(t){return K.get(t,()=>{let e=E(t),r=P(t).filter(n=>{let a=S(n);return a==="entry"||a==="worker"}),s=new Set,i=new Set;for(;r.length>0;){let n=r.shift();if(!s.has(n)){s.add(n),S(n)==="barrel"&&i.add(n);for(let a of e.get(n)??[])s.has(a)||r.push(a)}}return i})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(g(e))}function yt(t){let e=N(t);return P(t).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=g(e),s=b(t,r)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
1
+ import{a as E}from"./chunk-VUKC6F77.js";import{d as _}from"./chunk-JM72FNGA.js";import{a as b}from"./chunk-72KY2ZFO.js";import{c as P}from"./chunk-A536TEU4.js";import{d as p}from"./chunk-7S5E7KWT.js";import{existsSync as d,readFileSync as D,readdirSync as y}from"fs";import{join as l}from"path";var R={files:new Set,pathPrefixes:[]},x=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,F=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,j=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],C=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),I=4,M=p("package-surface",{clearGroups:["whole-project"]});function X(t){return M.get(t,()=>W(t.config.projectRoot))}function T(t,e){let r=X(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function W(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of U(t))for(let n of B(s))G(t,i,n,e,r);return e.size===0&&r.length===0?R:{files:e,pathPrefixes:r}}function U(t){let e=[],r=k(t,"");return r&&e.push({manifest:r,packageRoot:""}),w(t,"",e,0),e}function w(t,e,r,s){if(s>=I)return;let i=l(t,e);if(d(i))for(let n of y(i,{withFileTypes:!0})){if(!n.isDirectory()||C.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=k(t,a);o&&r.push({manifest:o,packageRoot:a}),w(t,a,r,s+1)}}function k(t,e){try{let r=D(l(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function B(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return $(t.exports,e),e}function $(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))$(r,e)}function G(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of m(c))u!==""&&i.push(f(e,u));return}let o=n.replace(F,"");for(let c of m(o)){c===o&&c===n&&s.add(f(e,n));for(let u of j)L(t,s,e,c+u)}s.add(f(e,n))}function m(t){let e=[t];return x.test(t)&&(e.push(t.replace(x,"src/")),e.push(t.replace(x,""))),e}function L(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(l(t,i)))return;let n=j.find(h=>s.endsWith(h));if(!n)return;let a=s.slice(0,-n.length);V(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let h of v(t,r,c,`${u}${n}`))e.add(h)}function V(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(l(t,n))&&e.add(n)}function v(t,e,r,s){let i=l(t,e,r);if(!d(i))return[];let n=[];for(let a of y(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...v(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}function S(t){let e=g(t);return ct(e)?"test":ut(e)?"worker":ft(e)?"entry":gt(e)?"barrel":"source"}function H(t){return S(t)==="barrel"}function N(t){return K.get(t,()=>{let e=E(t),r=P(t).filter(n=>{let a=S(n);return a==="entry"||a==="worker"}),s=new Set,i=new Set;for(;r.length>0;){let n=r.shift();if(!s.has(n)){s.add(n),S(n)==="barrel"&&i.add(n);for(let a of e.get(n)??[])s.has(a)||r.push(a)}}return i})}var K=p("live-barrels",{clearGroups:["whole-project"]});function J(t,e){return N(t).has(g(e))}function yt(t){let e=N(t);return P(t).filter(r=>H(r)&&!e.has(r)&&!Q(t,r))}function Q(t,e){let r=g(e),s=b(t,r)?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
2
2
  FROM defn_enclosing_ranges der
3
3
  JOIN documents d ON d.id = der.document_id
4
4
  WHERE d.relative_path = ?
5
5
  AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function jt(t,e){let r=S(e);return r==="entry"||r==="worker"||J(t,e)}function Tt(t,e,r){let s=g(r);if(T(t,s)||et(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>g(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(g(n)))||i.qualifiedVars?.some(n=>lt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var A=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Y=new Set(["default","generateMetadata","generateStaticParams"]),Z=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),q=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),z=new Set(["load","actions","entries",...A]),tt=new Set(["default"]);function et(t,e){let r=_(t);return r===""?!1:rt(e)?A.has(r):st(e)?Y.has(r):nt(e)?Z.has(r):it(e)?q.has(r):at(e)?z.has(r):ot(e)?tt.has(r):!1}function rt(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function nt(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function it(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function at(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ot(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function ct(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function ut(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function ft(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function gt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function g(t){return t.replace(/\\/g,"/")}function lt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(O(s)+"/")&&t.includes(O(i)+".")}function O(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{T as a,S as b,H as c,J as d,yt as e,jt as f,Tt as g};
6
- //# sourceMappingURL=chunk-ANIOISCE.js.map
6
+ //# sourceMappingURL=chunk-C5CTSJ6X.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-LGX2Y4BA.js";import{c as u}from"./chunk-RSKOYTSY.js";import{a as p}from"./chunk-T633QLYF.js";import{b as a}from"./chunk-RY7CAOJF.js";import{c as l,d as c,h as f}from"./chunk-JM72FNGA.js";import{a as d}from"./chunk-64MNV6AB.js";function J(e,s,t={}){return I(e,s,t)?.map(r=>({symbol:r.symbol,shortName:r.shortName,fromFile:r.fromFile}))??[]}function P(e,s){let t=N(e,s);return t.length>0?t:E(e,s)}function v(e,s,t={}){return I(e,s,t)?.filter(r=>!r.used).map(r=>({symbol:r.symbol,shortName:r.shortName,importedIn:r.importer}))??[]}function N(e,s){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as g}from"./chunk-RYXW3KRC.js";import{c as u}from"./chunk-4KTOV4QN.js";import{a as p}from"./chunk-PTQVNJ4Q.js";import{b as a}from"./chunk-P5RYBRIO.js";import{c as l,d as c,h as f}from"./chunk-JM72FNGA.js";import{a as d}from"./chunk-64MNV6AB.js";function J(e,s,t={}){return I(e,s,t)?.map(r=>({symbol:r.symbol,shortName:r.shortName,fromFile:r.fromFile}))??[]}function P(e,s){let t=N(e,s);return t.length>0?t:E(e,s)}function v(e,s,t={}){return I(e,s,t)?.filter(r=>!r.used).map(r=>({symbol:r.symbol,shortName:r.shortName,importedIn:r.importer}))??[]}function N(e,s){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
@@ -32,4 +32,4 @@ import{a as g}from"./chunk-LGX2Y4BA.js";import{c as u}from"./chunk-RSKOYTSY.js";
32
32
  WHERE imp_d.relative_path = ?
33
33
  AND m.role = 2
34
34
  ORDER BY def_d.relative_path, gs.symbol`,s).filter(m=>!e.isIgnored(m.importer));if(o.length>0){let m=t.semantic===!1?[]:u(e,s);return o.map(i=>({symbol:i.symbol,shortName:l(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||m.some(n=>n.isUsed&&n.sourcePath===i.from_file)}))}return null}function F(e,s){let t=u(e,s);return t.length>0?t.map(r=>{let o=h(r.importedName,r.localName,r.kind);return{symbol:o,shortName:o,fromFile:r.sourcePath??"(external)",importer:s,used:r.kind==="side-effect"?!0:r.isUsed}}):null}function O(e,s){return a(e,s).map(t=>{let r=h(t.importedName,t.localName,t.kind),o=t.kind==="side-effect"?!0:t.used;return{symbol:r,shortName:r,fromFile:t.sourcePath??"(external)",importer:s,used:o}})}function h(e,s,t){return t==="namespace"&&e==="*"&&s?`* as ${s}`:t==="default"&&s?`default as ${s}`:t==="side-effect"?"(side effect import)":s&&s!==e?`${e} as ${s}`:e}function b(e){return e.replace(/\\/g,"/")}function R(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{J as a,P as b,v as c};
35
- //# sourceMappingURL=chunk-MEKSFV6H.js.map
35
+ //# sourceMappingURL=chunk-CCKPYPDI.js.map
@@ -0,0 +1,18 @@
1
+ import{a as y}from"./chunk-GBEYTDY5.js";import{b}from"./chunk-C5CTSJ6X.js";import{c as D}from"./chunk-4KTOV4QN.js";import{b as p}from"./chunk-P5RYBRIO.js";import{a as h}from"./chunk-64MNV6AB.js";import g from"path";function d(e){let n=e.replace(/\\/g,"/").split("/").filter(Boolean);return n.length<=1?"(root)":n.length>=3&&["src","lib","app","server","client"].includes(n[0])?`${n[0]}/${n[1]}`:n[0]}function S(e,t){if(e===t)return"ok";let n=m(e),i=m(t);return n&&i?k(n,i)?"ok":"violation":x(e,t)}function v(e,t){let n=m(d(e)),i=m(d(t));return!!n&&!!i}function m(e){return/^src\/([^/]+)$/.exec(e)?.[1]??null}function k(e,t){return t==="domain"?!0:e==="domain"?!1:{analysis:new Set(["domain","source","storage","symbols"]),core:new Set(["analysis","domain","resolution","source","storage","symbols"]),"language-parsers":new Set(["domain","resolution","source","storage"]),queries:new Set(["analysis","core","domain","language-parsers","resolution","semantic","source","storage","symbols"]),reindex:new Set(["domain","language-parsers","resolution","runtime","semantic","source","storage","symbols"]),resolution:new Set(["domain","source","storage","symbols"]),runtime:new Set(["domain","queries","reindex","resolution","semantic","source","storage","symbols"]),semantic:new Set(["domain","resolution","storage","symbols"]),source:new Set(["domain","storage"]),storage:new Set(["domain","source"]),symbols:new Set(["analysis","domain","language-parsers","resolution","semantic","source","storage"])}[e]?.has(t)??!1}function x(e,t){if(t==="shared")return"ok";let n={app:new Set(["core","shared","ui"]),core:new Set(["shared"]),infra:new Set(["core","shared"]),ui:new Set(["core","shared"])};return n[e]?n[e].has(t)?"ok":"violation":null}function Z(e,t){let{scope:n,minDeviation:i=5}=t??{},r=t?.semantic!==!1,s=t?.includePatternDeviations!==!1,o=new y(e).fileDependencyGraph(n);return M([...$(e,o,{scope:n,semantic:r}),...P(o),...s?_(o,i):[]])}function $(e,t,n){let i=N(e,n.scope),r=[],s=new Set;for(let[o,a]of t){if(l(o))continue;let u=i.get(o)??new Set;for(let f of a)l(f)||u.has(f)||I(e,o,f,n)||(r.push({file:o,dep:f}),s.add(o))}s.size>0&&A(e,i,{paths:[...s]});let c=[];for(let{file:o,dep:a}of r)(i.get(o)??new Set).has(a)||c.push({file:o,kind:"unused-import",description:`Depends on ${a} but references none of its symbols`,dep:a,actionTier:"direct",evidenceReasons:[`dependency edge exists from ${o} to ${a}`,"no semantic, source, type-only, side-effect, or Vue-template usage survived the conservative skip gates"],recommendation:"Remove the unused import or dependency edge after running the project checks."});return c}function I(e,t,n,i){return i.semantic&&B(e,t,n)||V(e,t,n)||q(e,t,n)||j(n)||U(e,t,n)?!0:J(n)}function P(e){let t=[],n=L(e);for(let[i,r]of e){if(l(i))continue;let s=d(i);for(let c of r){if(l(c))continue;let o=d(c);if(s===o)continue;let a=S(s,o),u=a?"explicit":"inferred";if((a??n.get(`${s}->${o}`))==="violation"){let R=u==="explicit"?"direct":"signal";t.push({file:i,kind:"layer-violation",description:`Imports from ${o}/ (${c}) \u2014 may cross architectural boundary`,dep:c,detail:`${s}/ should not depend on ${o}/`,actionTier:R,policyBasis:u,evidenceReasons:[`dependency edge exists from ${i} to ${c}`,u==="explicit"?`explicit layer policy rejects ${s}/ -> ${o}/`:`rare cross-layer edge ${s}/ -> ${o}/ is inferred as a violation`],recommendation:u==="explicit"?"Move the dependency behind an allowed layer boundary or document a policy change.":"Review whether this is a real boundary break or an intentional exception before moving code."})}}}return t}function _(e,t){let n=[];for(let[i,r]of O(e)){let s=r.filter(o=>!l(o));if(s.length<t)continue;let c=E(e,s);for(let o of s)for(let a of e.get(o)??[])l(a)||(c.get(a)??0)===1&&g.dirname(a)!==i&&g.dirname(a)!==g.dirname(i)&&(v(o,a)||n.push({file:o,kind:"pattern-deviation",description:`Only file in ${i}/ that depends on ${a}`,dep:a,actionTier:"signal",evidenceReasons:[`${s.length} sibling file(s) in ${i}/ were compared`,`${o} is the only non-skipped sibling depending on ${a}`],recommendation:"Review sibling ownership before changing this import; unique dependency shape can be intentional specialization."}))}return n}function M(e){return{results:e,unusedImports:e.filter(t=>t.kind==="unused-import").length,layerViolations:e.filter(t=>t.kind==="layer-violation").length,patternDeviations:e.filter(t=>t.kind==="pattern-deviation").length}}function O(e){let t=new Map;for(let n of e.keys()){let i=g.dirname(n),r=t.get(i);r||(r=[],t.set(i,r)),r.push(n)}return t}function E(e,t){let n=new Map;for(let i of t)for(let r of e.get(i)??[])l(r)||n.set(r,(n.get(r)??0)+1);return n}function N(e,t){let n=new Map;return F(e,n,t),n}function F(e,t,n){for(let i of T(e,n))w(e,t,i.from_file,i.to_file)}function T(e,t){let n=t?`AND d1.relative_path LIKE '%${t}%'`:"";return e.all(`SELECT DISTINCT d1.relative_path AS from_file, d2.relative_path AS to_file
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d1 ON c.document_id = d1.id
5
+ JOIN global_symbols gs ON m.symbol_id = gs.id
6
+ JOIN (
7
+ SELECT m2.symbol_id, c2.document_id
8
+ FROM mentions m2
9
+ JOIN chunks c2 ON m2.chunk_id = c2.id
10
+ WHERE m2.role = 1
11
+ GROUP BY m2.symbol_id
12
+ ) sym_def ON sym_def.symbol_id = gs.id
13
+ JOIN documents d2 ON sym_def.document_id = d2.id
14
+ WHERE d1.id != d2.id
15
+ AND m.role != 1
16
+ ${e.pathExclusionsFor("d1","d2")}
17
+ ${n}`)}function A(e,t,n={}){new y(e).scanSourceReferences({paths:n.paths??h(e,{includeIgnored:!1}),includeRustAttributeNames:!0,identifierResolution:"permissive"},r=>{r.target.relativePath!==r.sourceFile&&(e.isIgnored(r.target.relativePath)||w(e,t,r.sourceFile,r.target.relativePath))})}function w(e,t,n,i){if(e.isIgnored(n)||e.isIgnored(i))return;let r=t.get(n);r||(r=new Set,t.set(n,r)),r.add(i)}function L(e){let t=new Map;for(let[i,r]of e){if(l(i))continue;let s=d(i);for(let c of r){if(l(c))continue;let o=d(c);if(s===o||S(s,o))continue;let a=`${s}->${o}`;t.set(a,(t.get(a)??0)+1)}}let n=new Map;for(let[i,r]of t)n.set(i,r<=2?"violation":"ok");return n}function j(e){return e.includes("types")||e.endsWith(".d.ts")}function B(e,t,n){let i=D(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.isUsed)}function V(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.some(r=>r.used)}function q(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length>0&&i.every(r=>r.isTypeOnly===!0)}function J(e){return e.endsWith(".vue")}function U(e,t,n){let i=p(e,t).filter(r=>r.sourcePath===n);return i.length===0?!1:i.every(r=>r.kind==="side-effect"||r.kind==="namespace"&&r.usedMembers.length===0&&!r.used)}function l(e){let t=b(e);return!!(t==="entry"||t==="barrel"||t==="test"||t==="worker"||z(g.basename(e)))}function z(e){return!!(e==="index.ts"||e==="index.js"||e==="cli.ts"||e==="main.ts"||e==="main.rs"||e.includes("worker.")||e.includes("postinstall.")||e==="health.ts"||e==="health.js")}export{Z as a};
18
+ //# sourceMappingURL=chunk-CZ425R2B.js.map
@@ -1,4 +1,4 @@
1
- import{a as C}from"./chunk-XPOZO76D.js";import{e as S}from"./chunk-RSKOYTSY.js";import{c as y,f as p,h as b}from"./chunk-JM72FNGA.js";import{execFileSync as g}from"child_process";import{existsSync as v,readFileSync as E}from"fs";import{basename as F}from"path";function R(e){let t=new Map;for(let i of e){let n=t.get(i.file);n||(n=[],t.set(i.file,n)),n.push(i)}return t}var B="Unable to compute git diff.";function ge(e,t={}){let i=t.plan??P(e,t);return i.note?A(i.note,i.changedFileLines):i.changedFiles.length===0?O(i.changedFileLines):T(i.changedFiles,[$(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function P(e,t={}){let{base:i="HEAD"}=t;try{let n=k(e.config.projectRoot,i),r=Y(e,n),s=j(e,z(e.config.projectRoot,i));return{changedFileLines:n,changedFiles:r,changedRanges:s,renamedFiles:H(e.config.projectRoot,i,r),note:n.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:B}}}function $(e,t,i,n=[]){let r=new C(e),s=new Set(i),a=R(n),o=[],d=new Map,f=t.flatMap(c=>r.definitionsForFile(c)).filter(te).filter(c=>Z(c,a)).sort((c,m)=>c.relativePath.localeCompare(m.relativePath)||c.startLine-m.startLine),l=f.map(c=>c.symbolId),u=X(e,l),M=ee(e,l,i),N=S(e,f.filter(c=>u.get(c.symbolId)===0));for(let c of f)Q(e,c,s,o,d,N.get(c.symbolId)??new Set,u.get(c.symbolId)??0,M.get(c.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...d.entries()].map(([c,m])=>({file:c,symbols:[...m].sort()}))}}function T(e,t){let i=new Map,n=t.flatMap(s=>s.changedSymbols);for(let s of t)for(let a of s.consumerEntries){let o=i.get(a.file);o||(o=new Set,i.set(a.file,o));for(let d of a.symbols)o.add(d)}let r=ne(i);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:r.length}}}function A(e,t=[]){return{changedFiles:t,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:t.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function k(e,t){let i=g("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([i,n,r].flatMap(s=>s.split(`
1
+ import{a as C}from"./chunk-GBEYTDY5.js";import{e as S}from"./chunk-4KTOV4QN.js";import{c as y,f as p,h as b}from"./chunk-JM72FNGA.js";import{execFileSync as g}from"child_process";import{existsSync as v,readFileSync as E}from"fs";import{basename as F}from"path";function R(e){let t=new Map;for(let i of e){let n=t.get(i.file);n||(n=[],t.set(i.file,n)),n.push(i)}return t}var B="Unable to compute git diff.";function ge(e,t={}){let i=t.plan??P(e,t);return i.note?A(i.note,i.changedFileLines):i.changedFiles.length===0?O(i.changedFileLines):T(i.changedFiles,[$(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function P(e,t={}){let{base:i="HEAD"}=t;try{let n=k(e.config.projectRoot,i),r=Y(e,n),s=j(e,z(e.config.projectRoot,i));return{changedFileLines:n,changedFiles:r,changedRanges:s,renamedFiles:H(e.config.projectRoot,i,r),note:n.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:B}}}function $(e,t,i,n=[]){let r=new C(e),s=new Set(i),a=R(n),o=[],d=new Map,f=t.flatMap(c=>r.definitionsForFile(c)).filter(te).filter(c=>Z(c,a)).sort((c,m)=>c.relativePath.localeCompare(m.relativePath)||c.startLine-m.startLine),l=f.map(c=>c.symbolId),u=X(e,l),M=ee(e,l,i),N=S(e,f.filter(c=>u.get(c.symbolId)===0));for(let c of f)Q(e,c,s,o,d,N.get(c.symbolId)??new Set,u.get(c.symbolId)??0,M.get(c.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...d.entries()].map(([c,m])=>({file:c,symbols:[...m].sort()}))}}function T(e,t){let i=new Map,n=t.flatMap(s=>s.changedSymbols);for(let s of t)for(let a of s.consumerEntries){let o=i.get(a.file);o||(o=new Set,i.set(a.file,o));for(let d of a.symbols)o.add(d)}let r=ne(i);return{changedFiles:[...e],changedSymbols:n,affectedConsumers:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:n.length,totalAffectedFiles:r.length}}}function A(e,t=[]){return{changedFiles:t,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:t.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function O(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function k(e,t){let i=g("git",["diff","--name-only",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([i,n,r].flatMap(s=>s.split(`
2
2
  `)).map(s=>s.trim()).filter(s=>s.length>0))]}function z(e,t){let i=g("git",["diff","--unified=0",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--unified=0","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return _([...D(i),...D(n)])}function h(e,t,i){try{return g("git",["show",`${t}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function ue(e,t,i=[]){let n=W(e,t,i);return r=>(n.has(r)||n.set(r,h(e,t,r)),n.get(r)??null)}function me(e,t=e.changedFiles){let i=new Map(e.renamedFiles.map(n=>[n.to,n.from]));return[...new Set(t.map(n=>i.get(n)??n))]}function W(e,t,i){let n=[...new Set(i)],r=new Map;if(n.length===0)return r;try{let s=n.map(o=>`${t}:./${o}
3
3
  `).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return U(a,n)}catch{for(let s of n)r.set(s,h(e,t,s));return r}}function U(e,t){let i=new Map,n=0;for(let r of t){let s=e.indexOf(10,n);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(n,s).toString("utf-8");if(n=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[,d,f]=o,l=Number(f);if(!Number.isFinite(l)||l<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(n+l>e.length)throw new Error("git cat-file batch output ended before blob payload");let u=e.subarray(n,n+l);i.set(r,d==="blob"?u.toString("utf-8"):null),n+=l,e[n]===10&&(n+=1)}return i}function H(e,t,i){if(i.length===0)return[];let n=new Map,r=new Set;for(let a of q(e,t))i.includes(a.to)&&(n.set(a.to,a),r.add(a.from));let s=J(e,t);if(s.length===0)return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to));for(let a of i){if(n.has(a)||!v(`${e}/${a}`))continue;let o=s.filter(l=>!r.has(l)).filter(l=>F(l)===F(a));if(o.length===0)continue;let d=E(`${e}/${a}`,"utf-8"),f=o.map(l=>({from:l,to:a,similarity:G(h(e,t,l)??"",d)})).sort((l,u)=>u.similarity-l.similarity)[0];f&&f.similarity>=.45&&(n.set(a,f),r.add(f.from))}return[...n.values()].sort((a,o)=>a.to.localeCompare(o.to))}function J(e,t){let i=g("git",["diff","--name-only","--diff-filter=D",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-only","--diff-filter=D","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...new Set([...w(i),...w(n)])]}function q(e,t){let i=g("git",["diff","--name-status","--find-renames",t],{encoding:"utf-8",cwd:e,timeout:1e4}),n=g("git",["diff","--name-status","--find-renames","--cached",t],{encoding:"utf-8",cwd:e,timeout:1e4});return[...i.split(`
4
4
  `),...n.split(`
@@ -18,4 +18,4 @@ import{a as C}from"./chunk-XPOZO76D.js";import{e as S}from"./chunk-RSKOYTSY.js";
18
18
  AND m.role != 1
19
19
  AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
20
20
  ${e.pathExclusionsFor("ref_d")}`,...t,...i),r=new Map;for(let s of n){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 L(e,t,i,n,r){if(e.isIgnored(n)||t.has(n))return;let s=i.get(n);s||(s=new Set,i.set(n,s)),s.add(r)}function ne(e){return[...e.entries()].map(([t,i])=>({file:t,consumedSymbols:i.size})).sort((t,i)=>i.consumedSymbols-t.consumedSymbols)}function te(e){return!(b(e.symbol)||e.parentTypeName!==null&&!p(e.symbol))}function ie(e,t){return p(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&t>0}export{R as a,B as b,ge as c,P as d,$ as e,T as f,h as g,ue as h,me as i,W as j};
21
- //# sourceMappingURL=chunk-QDGKE5HN.js.map
21
+ //# sourceMappingURL=chunk-DQVKIG3D.js.map
@@ -0,0 +1,40 @@
1
+ import{d as F}from"./chunk-4KTOV4QN.js";import{c as R}from"./chunk-PTQVNJ4Q.js";import{b as h}from"./chunk-P5RYBRIO.js";import{u as w}from"./chunk-OBGRLXWF.js";import{f as y,l as _}from"./chunk-4N4WONI4.js";import{d}from"./chunk-JM72FNGA.js";import{a as S}from"./chunk-72KY2ZFO.js";import{a as k}from"./chunk-HF25DFSC.js";import{a as m}from"./chunk-DS6QEB3G.js";import{c as E}from"./chunk-A536TEU4.js";import{c as u,d as v}from"./chunk-7S5E7KWT.js";function I(e,t,n,r={}){if(!n)return[];let i=m(e,t);return i?i.indexOf(n)===-1?[]:(N(e,t).get(n)??[]).filter(s=>!J(s,r)):[]}function J(e,t){return typeof t.excludeStartLine=="number"&&typeof t.excludeEndLine=="number"&&e>=t.excludeStartLine&&e<=t.excludeEndLine}var U=u("file-identifiers",{clearGroups:["whole-project","source-file"]});function A(e,t){let n=S(e,t);return n?n.fileIdentifiers:U.get(e,t,()=>new Set(N(e,t).keys()))}var Z=u("file-ident-lines",{clearGroups:["whole-project","source-file"]});function N(e,t){let n=S(e,t);return n?n.identifierLineMap:Z.get(e,t,()=>Y(e,t))}var W=u("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function me(e,t){let n=S(e,t);return n?n.identifiersByLine:W.get(e,t,()=>{let r=N(e,t),i=0;for(let s of r.values()){let o=s[s.length-1];o!==void 0&&o>i&&(i=o)}let a=new Array(i+1);for(let s=0;s<=i;s+=1)a[s]=new Set;for(let[s,o]of r)for(let c of o)a[c].add(s);return a})}function Y(e,t){let n=new Map,r=(o,c)=>{let l=n.get(o);if(!l){n.set(o,[c]);return}l[l.length-1]!==c&&l.push(c)},i=m(e,t);if(!i)return n;let a=w(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let o=0;o<a.length;o+=1){let c=a[o]??"";for(let l of c.matchAll(s))l[1]&&r(l[1],o)}return n}function pe(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT
2
+ m.symbol_id,
3
+ d.relative_path,
4
+ COUNT(*) AS ref_count
5
+ FROM mentions m
6
+ JOIN chunks c ON m.chunk_id = c.id
7
+ JOIN documents d ON c.document_id = d.id
8
+ WHERE m.role != 1
9
+ ${r}
10
+ ${e.pathExclusionsFor("d")}
11
+ GROUP BY m.symbol_id, d.relative_path`,...n??[])})}function ge(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path
12
+ FROM mentions m
13
+ JOIN chunks c ON m.chunk_id = c.id
14
+ JOIN documents d ON c.document_id = d.id
15
+ WHERE m.role != 1
16
+ ${r}
17
+ ${e.pathExclusionsFor("d")}`,...n??[])}).filter(n=>n.symbol_id!==null)}function O(e,t){return x(e,t,n=>{let r=n?`AND m.symbol_id IN (${n.map(()=>"?").join(",")})`:"";return e.all(`SELECT DISTINCT m.symbol_id, d.relative_path, c.document_id,
18
+ c.start_line AS chunk_start, c.end_line AS chunk_end
19
+ FROM mentions m
20
+ JOIN chunks c ON m.chunk_id = c.id
21
+ JOIN documents d ON c.document_id = d.id
22
+ WHERE m.role != 1
23
+ ${r}
24
+ ${e.pathExclusionsFor("d")}
25
+ ORDER BY d.relative_path, c.start_line`,...n??[])})}function x(e,t,n){if(!t)return n();if(t.length===0)return[];let r=[];for(let i=0;i<t.length;i+=750)r.push(...n(t.slice(i,i+750)));return r}function L(e){return e.replace(/\\/g,"/").replace(/^\.\//,"")}function p(e,t){return L(e)===L(t)}var Q=u("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function P(e,t){let n=L(t);return Q.get(e,n,()=>V(e,n))}function V(e,t){let n=new Map;for(let r of h(e,t)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&T(n,i,r.sourcePath),r.kind==="namespace")for(let a of r.usedMembers)T(n,a,r.sourcePath)}return n}function T(e,t,n){let r=e.get(t);r||(r=new Set,e.set(t,r)),r.add(n)}function Ce(e,t){let n=$(e);return n?t.filter(r=>$(r.file)===n):t}function Me(e,t,n,r){let i=n.find(a=>a.file===t);if(i)return i;if(r){let a=new Set(h(e,t).map(s=>s.sourcePath).filter(s=>!!s));for(let s of n)for(let o of a)if(p(o,s.file))return s;return null}return n.length===1?n[0]:null}function $(e){let t=k(e);return t?t==="typescript"||t==="tsx"||t==="javascript"?"javascript-family":t:null}var X=v("global-leaf-index",{clearGroups:["whole-project"]});function C(e){return X.get(e,()=>{let t=e.all(`SELECT gs.id, gs.symbol,
26
+ COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
27
+ FROM global_symbols gs
28
+ LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
29
+ LEFT JOIN documents der_doc ON der_doc.id = der.document_id
30
+ LEFT JOIN (
31
+ SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
32
+ FROM mentions m
33
+ JOIN chunks c ON m.chunk_id = c.id
34
+ JOIN documents d ON c.document_id = d.id
35
+ WHERE m.role = 1
36
+ GROUP BY m.symbol_id
37
+ ) mention_doc ON mention_doc.symbol_id = gs.id
38
+ WHERE 1 = 1
39
+ ${e.symbolNoiseFor("gs")}`),n=new Map;for(let r of t){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=d(r.symbol);if(!i)continue;let a=n.get(i);a||(a=[],n.set(i,a)),a.some(s=>s.symbolId===r.id)||a.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return n})}var j=/[A-Za-z_$][A-Za-z0-9_$]*/g,q=/^[A-Za-z_$][A-Za-z0-9_$]*$/;function M(e){let t=[],n=!1;for(let r of e)r&&(n=!0,q.test(r)||t.push(r));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:t}}function B(e,t){let n=K(t)?t:M(t);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;j.lastIndex=0;let r;for(;(r=j.exec(e))!==null;)if(n.candidateNames.has(r[0]))return!0;for(let i of n.nonIdentifierNames)if(e.includes(i))return!0;return!1}function K(e){return"candidateNames"in e}function D(e,t,n){let r=C(e).get(n);if(!r||r.length===0)return[];if(r.length===1)return[g(r[0])];let i=r.filter(c=>c.file===t);if(i.length>0)return i.map(g);let a=P(e,t),s=a.get(n);if(s)for(let c of s){let l=r.filter(f=>p(c,f.file));if(l.length>0)return l.map(g)}let o=new Set;for(let c of a.values())for(let l of c)o.add(l);for(let c of o){let l=r.filter(f=>p(c,f.file));if(l.length>0&&l.length===r.length)return l.map(g)}return[]}function Ge(e,t,n){let r=D(e,t,n);if(r.length>0)return r;let i=C(e).get(n);return!i||i.length===0?[]:i.map(g)}function G(e,t,n={}){let r=R(e,t);if(!r)return[];let i=d(r.symbol);if(!i)return[];if(n.semantic!==!1){let s=F(e,{...r,leaf:i,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let o=new Map;for(let c of s){let l=o.get(c.file)??[];l.push(c.line),o.set(c.file,l)}return H(e,o)}}let a=new Map;for(let s of E(e)){let o=m(e,s);if(!o||o.indexOf(i)===-1||s!==r.relativePath&&!D(e,s,i).some(f=>f.symbolId===r.symbolId))continue;let c=I(e,s,i,s===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{});c.length>0&&a.set(s,c)}return H(e,a)}function ze(e,t){let n=new Map;for(let o of t){if(!o.leaf)continue;let c=n.get(o.leaf)??[];c.push(o),n.set(o.leaf,c)}if(n.size===0)return new Map;let r=new Set(t.map(o=>o.symbolId)),i=new Set(n.keys()),a=M(i),s=new Map;for(let o of E(e)){if(!B(m(e,o),a))continue;let c=A(e,o);if(c.size!==0){for(let l of c)if(n.has(l))for(let f of D(e,o,l)){if(!r.has(f.symbolId)||o===f.relativePath)continue;let b=s.get(f.symbolId);b||(b=new Set,s.set(f.symbolId,b)),b.add(o)}}}return s}function g(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function H(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}function ee(e,t){let n=se(e,t);return n?ae(e,te(e,n.match,n.identifier)):[]}function Xe(e,t,n={}){return ne(e,t,n).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function ne(e,t,n={}){let r=G(e,t,{semantic:n.semantic}),i=r.length>0?z(r,"source-attribution"):z(ee(e,t),"scip-reference-chunk");return n.includeIgnored===!0?i:i.filter(a=>!e.isIgnored(a.file))}function z(e,t){return e.map(n=>({...n,provenance:t}))}function te(e,t,n){let r=new Map;for(let[i,a]of re(e,t.symbolId))r.set(i,ie(e,i,a,t,n));return r}function re(e,t){let n=new Map;for(let r of O(e,[t])){if(e.isIgnored(r.relative_path))continue;let i=n.get(r.relative_path);i||(i=[],n.set(r.relative_path,i)),i.push({start_line:r.chunk_start,end_line:r.chunk_end})}return n}function ie(e,t,n,r,i){let a=t===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?I(e,t,i,a):[];return n.flatMap(o=>oe(s,o))}function oe(e,t){let n=e.filter(r=>r>=t.start_line&&r<=t.end_line);return n.length>0?n:[t.start_line]}function se(e,t){let n=R(e,t);return n?{match:n,identifier:d(n.symbol)||null}:null}function ae(e,t){let n=[],r=new Set;for(let[i,a]of t){let s=y(e,i);for(let o of a){let c=_(s,o),l=`${i}|${o}|${c?.symbol??""}`;r.has(l)||(r.add(l),n.push({file:i,line:o,enclosingSymbol:c?.symbol??null}))}}return n}export{N as a,me as b,pe as c,ge as d,O as e,p as f,Ce as g,Me as h,C as i,M as j,B as k,P as l,D as m,Ge as n,ze as o,ee as p,Xe as q};
40
+ //# sourceMappingURL=chunk-F6ICF7HL.js.map
@@ -0,0 +1,2 @@
1
+ import{c as s,d as l}from"./chunk-BZ53S4ZN.js";import{a as u}from"./chunk-3VD3JMK2.js";import{a as p,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{e as c}from"./chunk-HF25DFSC.js";function y(i,t={}){let{minSimilarity:r=.62,minTokens:e=8,limit:a=20,scope:d,scanLimit:g,filePattern:h,focusFiles:k}=t,P=c(i,{scope:d,minJsxTokens:e,scanLimit:g}).filter(n=>n.kind==="component").map(n=>({file:n.file,component:n.name,tokens:n.jsxTokens,profile:n}));return u({profiles:P,limit:a,filePattern:h,focusFiles:k,compare:(n,o)=>B(n,o,r),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.componentA.localeCompare(o.componentA)||n.fileB.localeCompare(o.fileB)||n.componentB.localeCompare(o.componentB)})}function B(i,t,r){let e=p(i.tokens,t.tokens);if(e.size<6||!C(e))return null;let a=f(i.tokens,t.tokens);return a<r?null:{fileA:i.file,componentA:i.component,fileB:t.file,componentB:t.component,similarity:a,sharedTokens:l(e),sharedComponents:s(e,"component:"),sharedNativeTags:s(e,"native:"),sharedProps:s(e,"prop:"),sharedEvents:s(e,"event:"),sharedBindings:s(e,"binding:"),uniqueToA:l(m(i.tokens,t.tokens)).slice(0,25),uniqueToB:l(m(t.tokens,i.tokens)).slice(0,25),locA:i.profile.loc,locB:t.profile.loc}}function C(i){let t=0,r=0;for(let e of i)e.startsWith("component:")&&(t+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("native:")||e.startsWith("jsx:"))&&(r+=1);return t>=1||r>=4}export{y as a};
2
+ //# sourceMappingURL=chunk-FAYI6KZ5.js.map
@@ -1,2 +1,2 @@
1
- import{a as c}from"./chunk-2YI45TNM.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-ZL52RLDK.js.map
1
+ import{a as c}from"./chunk-VUKC6F77.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-FDEQIPPK.js.map
@@ -0,0 +1,5 @@
1
+ import{a as j,b as w,e as A,f as T,g as M,h as G,i as U}from"./chunk-YWOOQ4FF.js";import{b as E}from"./chunk-B75HZHUP.js";import{a as R}from"./chunk-GBEYTDY5.js";import{a as P}from"./chunk-SULEXAHO.js";import{a as L}from"./chunk-PTQVNJ4Q.js";import{c as b,d as D,g as I}from"./chunk-JM72FNGA.js";import{a as _,b as v}from"./chunk-DS6QEB3G.js";import{b as q,d as $,e as O}from"./chunk-XUGQU7PM.js";import{d as C}from"./chunk-7S5E7KWT.js";function Ve(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,o=ue(e,n,{semantic:t.semantic!==!1});if(!o)return[];if(!I(o.symbol))return[];if(o.callees.size===0)return K(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit});let s=oe(e,o,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return s.length>0?s.slice(0,r):K(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit})}function oe(e,n,t,i){let r=Z(e,{minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),o=pe(n,r),s=ae(n,r),a=T(s),l=M(n.callees,s),c=[];for(let u of o){if(u.callees.size<3)continue;let m=M(u.callees,s),d=H(n,u,s,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:a,magnitudeA:l,magnitudeB:m});d&&c.push(d)}return c.sort((u,m)=>m.similarity-u.similarity),c}function ae(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return A(t,n.corpus.length+1)}function H(e,n,t,i){let r=i.magnitudeA===void 0||i.magnitudeB===void 0?G(e.callees,n.callees,t,{medianIdf:i.medianIdf}):U(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB}),{similarity:o,significantShared:s,trivialShared:a}=r;if(o<i.minSimilarity)return null;let l=s.length+a.length;if(s.length<i.requireSignificantShared&&l<i.requireSharedCount)return null;let c=s.length>0?s:a,u=J(c,"callees");return{symbolA:e.symbol,shortNameA:b(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:b(n.symbol),fileB:n.file,similarity:o,similarityBasis:"callees",sharedCallees:c.map(b),uniqueToA:[...w(e.callees,n.callees)].map(b),uniqueToB:[...w(n.callees,e.callees)].map(b),...u}}function We(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:o=4,crossFileOnly:s=!1,scanLimit:a}=n,l=Z(e,{minCallees:o,scope:r,scanLimit:a,semantic:n.semantic!==!1}),c=l.corpus,u=n.focusFiles,m=[],d=0;for(let g=0;g<c.length;g+=1){let f=c[g],x=u?.has(f.file)??!1,y=l.weightedMagnitudes[g],F=new Set;for(let S of f.callees){let p=l.candidateIndexesByCallee.get(S);if(p)for(let h of p)h<=g||u&&!x&&!u.has(c[h].file)||F.add(h)}for(let S of F){let p=c[S];if(s&&f.file===p.file)continue;if(f.paramCount>=0&&p.paramCount>=0){let re=Math.abs(f.paramCount-p.paramCount),se=Math.max(2,Math.ceil(Math.max(f.paramCount,p.paramCount)*.5));if(re>se)continue}let h=H(f,p,l.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:l.medianIdf,magnitudeA:y,magnitudeB:l.weightedMagnitudes[S]});h&&(le(m,h,i,d),d+=1)}}return m.sort((g,f)=>f.result.similarity-g.result.similarity||g.order-f.order),m.map(g=>g.result)}function le(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let s=1;s<e.length;s+=1){let a=e[s],l=e[r];(a.result.similarity<l.result.similarity||a.result.similarity===l.result.similarity&&a.order>l.order)&&(r=s)}let o=e[r];n.similarity<=o.result.similarity||(e[r]={result:n,order:i})}var ce=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function ue(e,n,t){let i=L(e,n);if(!i||!I(i.symbol))return null;let r=new R(e),o=P(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:X(o.map(s=>s.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var me=C("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),fe=C("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ge(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:o}=n,s=n.semantic!==!1,a=me.get(e,()=>new Map),l=`${t}|${i??""}|${o??""}|${s}`,c=a.get(l);return c||(c=be(e,{minCallees:t,scope:i,scanLimit:o,semantic:s}),a.set(l,c)),r===void 0?c:c.filter(u=>u.symbol!==r)}function Z(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,o=n.semantic!==!1,s=fe.get(e,()=>new Map),a=`${t}|${i??""}|${r??""}|${o}`,l=s.get(a);return l||(l=de(ge(e,{minCallees:t,scope:i,scanLimit:r,semantic:o})),s.set(a,l)),l}function de(e){let n=new Map;for(let s of e)for(let a of s.callees)n.set(a,(n.get(a)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=A(n,e.length),r=e.map(s=>M(s.callees,i)),o=new Map;for(let s=0;s<e.length;s+=1){let a=e[s];for(let l of a.callees){if((n.get(l)??0)>t)continue;let c=o.get(l);c||(c=[],o.set(l,c)),c.push(s)}}return{corpus:e,candidateIndexesByCallee:o,docFreq:n,idfWeights:i,weightedMagnitudes:r,medianIdf:T(i),ubiquityThreshold:t}}function pe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let o=n.corpus[r];o.symbol!==e.symbol&&t.set(o.symbol,o)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function be(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:o}=n,s=new R(e),a=E(s.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r),l=s.calleeMap(a,{semantic:o});return a.map(c=>({symbol:c.symbol,file:c.relativePath,callees:X((l.get(c.symbolId)??[]).map(u=>u.symbol)),paramCount:s.callableSignature(c)?.paramCount??-1})).filter(c=>c.callees.size>=t)}function X(e){return new Set([...e].filter(n=>!ye(n)))}function ye(e){return ce.some(n=>e.includes(n))}function K(e,n,t){let i=Ce(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,o=[],s=ve(i,Re(e,{scanLimit:t.scanLimit}));for(let a of s){if(a.symbol===i.symbol||a.tokens.size<3)continue;let l=j(i.tokens,a.tokens);if(l.size<2)continue;let c=new Set([...i.tokens,...a.tokens]),u=c.size>0?l.size/c.size:0;u<r||o.push({symbolA:i.symbol,shortNameA:b(i.symbol),fileA:i.file,symbolB:a.symbol,shortNameB:b(a.symbol),fileB:a.file,similarity:u,similarityBasis:"source-tokens",sharedCallees:[...l].sort(),uniqueToA:[...w(i.tokens,a.tokens)].sort(),uniqueToB:[...w(a.tokens,i.tokens)].sort(),...J([...l],"source-tokens")})}return o.sort((a,l)=>l.similarity-a.similarity||a.shortNameB.localeCompare(l.shortNameB)),o.slice(0,t.limit)}function J(e,n){let t=e.flatMap(B),i=e.flatMap(y=>V(y,n)),r=N(t,Q),o=N(t,Y),s=N(i,z),a=[...new Set(i.filter(W))],l=e.filter(y=>{let F=V(y,n);return F.some(S=>z.has(S))&&F.some(W)}).length,c=[];r.length>0&&c.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),o.length>0&&c.push(`framework/generic scaffolding: ${o.slice(0,5).join(", ")}`),s.length>0&&c.push(`domain behavior verbs: ${s.slice(0,5).join(", ")}`),s.length>0&&a.length>0&&c.push(`domain-specific terms: ${a.slice(0,5).join(", ")}`);let u=n==="source-tokens"&&t.length>0&&t.every(y=>ee.has(y));u&&c.push("shared source tokens are generic scaffolding");let m=s.length>0&&a.length>0,d=r.length+o.length>0,g=n==="callees"&&m&&e.length>=4&&a.length>=4&&l>=2,f=g?"domain-behavior":m?d?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":o.length>0||u?"framework-scaffolding":"structural-overlap";f==="structural-overlap"&&e.length>0&&c.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let x=f==="domain-behavior"&&(e.length>=3||g)?"direct":"signal";return{evidenceClass:f,actionTier:x,evidenceClassReasons:c,recommendation:Se(f,x)}}function Se(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function N(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function B(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function V(e,n){if(n==="source-tokens")return B(e);let t=D(e);return B(t.length>0?t:he(e))}function he(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function W(e){return e.length>3&&!z.has(e)&&!Q.has(e)&&!Y.has(e)&&!ee.has(e)&&!Fe.has(e)}var z=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),Q=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),Y=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),ee=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),Fe=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Ce(e,n){let t=L(e,n);if(!t||!I(t.symbol))return null;let i=we(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function we(e,n){let t=D(n.symbol),i=Ee(e,n.relativePath,n.startLine,n.endLine,t),r=te(i,t);return r.size>0?r:null}var ke=C("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),xe=C("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function ne(e){return`${e.scanLimit??""}`}function Ie(e,n={}){let t=ke.get(e,()=>new Map),i=ne(n),r=t.get(i);return r||(r=De(e,n),t.set(i,r)),r}function Re(e,n={}){let t=xe.get(e,()=>new Map),i=ne(n),r=t.get(i);return r||(r=Me(Ie(e,n)),t.set(i,r)),r}function Me(e){let n=new Map;for(let r of e)for(let o of r.tokens)n.set(o,(n.get(o)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let o of r.tokens){if((n.get(o)??0)>t)continue;let s=i.get(o);s||(s=[],i.set(o,s)),s.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function ve(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function De(e,n={}){let t=new R(e),{scanLimit:i}=n,r=E(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return Le(e,r)}function Le(e,n){let t=new Map;for(let r of n){let o=t.get(r.relativePath)??[];o.push(r),t.set(r.relativePath,o)}let i=new Map;for(let[r,o]of t){let s=_(e,r);if(!s)continue;let a=q(e,r,s),l=Te(e,r,a),c=!1,u=null;for(let m of o){let d=Ae(m),g=l.get(d),f=g?new Set(g.tokens):null;f||(u??=v(e,r),f=te(ie(u,m.startLine,m.endLine,m.leaf),m.leaf),l.set(d,{key:d,symbol:m.symbol,startLine:m.startLine,endLine:m.endLine,leaf:m.leaf,tokens:[...f].sort()}),c=!0),f.size>0&&i.set(m.symbol,{symbol:m.symbol,file:m.relativePath,tokens:f})}c&&Ne(e,r,a,l)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function Ee(e,n,t,i,r){let o=v(e,n);return o.length===0?"":ie(o,t,i,r)}function ie(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
2
+ `);let r=[new RegExp(`\\bdef\\s+${k(i)}\\b`),new RegExp(`\\bfun\\s+${k(i)}\\b`),new RegExp(`\\bfn\\s+${k(i)}\\b`),new RegExp(`\\bfunction\\s+${k(i)}\\b`),new RegExp(`\\b${k(i)}\\s*\\(`)],o=e.findIndex(s=>r.some(a=>a.test(s)));if(o>=0){let s=o;for(let a=o+1;a<e.length&&a<=o+8;a++){let l=e[a]??"";if(a>o&&ze(l)||(s=a,l.trim()===""&&a>o+1))break}return e.slice(o,s+1).join(`
3
+ `)}return e.slice(n,Math.min(e.length,n+8)).join(`
4
+ `)}function Ae(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function Te(e,n,t){let i=$(e,"source-fingerprints",n,t);if(!i)return new Map;try{let r=JSON.parse(i);if(!Array.isArray(r.entries))return new Map;let o=new Map;for(let s of r.entries){if(!s||typeof s.key!="string"||typeof s.symbol!="string"||typeof s.startLine!="number"||typeof s.endLine!="number"||typeof s.leaf!="string"||!Array.isArray(s.tokens)||!s.tokens.every(a=>typeof a=="string"))return new Map;o.set(s.key,s)}return o}catch{return new Map}}function Ne(e,n,t,i){let r={entries:[...i.values()].sort((o,s)=>o.key.localeCompare(s.key))};O(e,"source-fingerprints",n,t,JSON.stringify(r))}function te(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=Be(n),o=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(s=>s.trim()).filter(s=>s.length>1).filter(s=>!t.has(s)).filter(s=>!i.has(s));return new Set(o)}function Be(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function ze(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}function k(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{Ve as a,ae as b,We as c,le as d,ge as e,Z as f,de as g,pe as h,X as i,J as j};
5
+ //# sourceMappingURL=chunk-FRPEPTYJ.js.map
@@ -0,0 +1,2 @@
1
+ import{b as R,f as j,g as V}from"./chunk-C5CTSJ6X.js";import{a as F}from"./chunk-BGBBVSH4.js";import{b as z,c as J,d as Q}from"./chunk-UQLFQLAF.js";import{c as _}from"./chunk-SULEXAHO.js";import{a as O,j as H,k as W,m as L,n as Y}from"./chunk-F6ICF7HL.js";import{a as q}from"./chunk-VUKC6F77.js";import{f as h,h as D,i as G}from"./chunk-4N4WONI4.js";import{f as M,g as E,i as K,j as B}from"./chunk-JM72FNGA.js";import{a as w,f as g}from"./chunk-72KY2ZFO.js";import{a as S,b as P}from"./chunk-HF25DFSC.js";import{a as N,d as y}from"./chunk-DS6QEB3G.js";import{c as A}from"./chunk-A536TEU4.js";import{a as k}from"./chunk-64MNV6AB.js";function U(t,e,i){let o=e.identifierResolution==="strict"?L:Y,s=e.candidateNames?H(e.candidateNames):null;for(let n of e.paths)if(!(!S(n)&&!(e.includeVueSfc&&P(n)))&&!t.isIgnored(n)&&!e.skipPath?.(n))try{if(s&&!W(N(t,n),s))continue;let d=(a,c,p,b)=>{if(e.candidateNames&&!e.candidateNames.has(a))return;let I=e.resolveTargets?e.resolveTargets({sourceFile:n,name:a,kind:c,defaultTargets:b}):b();for(let x of I)i({sourceFile:n,name:a,target:x,occurrences:p,kind:c})},m=O(t,n);for(let[a,c]of m)d(a,"identifier",c.length,()=>o(t,n,a));for(let a of g(t,n,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let c=a.kind==="cross-language-dispatch"?()=>L(t,n,a.name):()=>o(t,n,a.name);d(a.name,a.kind,a.occurrences,c)}}finally{e.afterPath?.(n)}}function X(t,e={}){let{scope:i,files:o,minLoc:s=1,maxLoc:n=Number.POSITIVE_INFINITY,excludeSymbol:f,excludeEntrySurfaces:d=!1,excludeTypesFiles:m=!1,excludeRootedSymbols:a=!1,requireFunctionLikeSymbol:c=!1,requireCallableSymbol:p=!1,excludeRustTraitImplMembers:b=!1,includeSuppressed:I=!1,sortByLocDesc:x=!1}=e,C=[],$=te(t,{scope:i,files:o,requireCallableSymbol:p}),v=new Map,T=new Map,ee=r=>{let l=v.get(r);if(l!==void 0)return l;let u=j(t,r);return v.set(r,u),u},ne=r=>{let l=T.get(r);if(l!==void 0)return l;let u=R(r);return T.set(r,u),u};for(let r of $){let l=r.relativePath;if(t.isIgnored(l)||d&&ee(l)||!ie(r,{requireFunctionLikeSymbol:c,requireCallableSymbol:p})||f!==void 0&&r.symbol===f)continue;let u=F(r);u<s||u>n||m&&re(l)||a&&V(t,r.symbol,l)||b&&K(r.symbol)||ne(l)!=="test"&&(B(r.symbol)||!I&&y(t,l,r.startLine)||C.push(r))}return x?C.sort((r,l)=>F(l)-F(r)):C}function te(t,e){return e.files!==void 0?[...new Set(e.files.map(o=>o.replace(/\\/g,"/")))].sort().filter(o=>!e.scope||o.includes(e.scope)).flatMap(o=>h(t,o)):e.requireCallableSymbol?G(t,{scope:e.scope,symbolMatches:M,sqlPrefilter:"callable"}):D(t,e.scope)}function ie(t,e){return e.requireCallableSymbol?M(t.symbol):e.requireFunctionLikeSymbol?E(t.symbol):t.isFunctionLike}function re(t){return(t.split("/").pop()??"").includes("types")}var Z=class{constructor(e){this.db=e}db;scopedDefinitions(e){return D(this.db,e)}definitionsForFile(e){return h(this.db,e)}productionCallableDefinitions(e={}){return X(this.db,e)}calleeMap(e,i={}){return _(this.db,e,i)}crossFileCallerMap(e,i={}){return z(this.db,e,i)}sourceFallbackCallerFiles(e){return J(this.db,e)}callerFileMap(e,i={}){return Q(this.db,e,i)}frameworkReferencedSymbolIds(e){let i=new Map;for(let s of e){if(!s.leaf)continue;let n=i.get(s.leaf)??[];n.push(s.symbolId),i.set(s.leaf,n)}let o=new Set;for(let s of k(this.db,{includeIgnored:!1}))if(S(s)==="rust")for(let{name:n}of g(this.db,s,{includeRustAttributeNames:!0}))for(let f of i.get(n)??[])o.add(f);return o}symbolsWithNonSelfCallees(e,i={}){if(e.length===0)return new Set;let o=new Map(e.map(n=>[n.symbolId,n.symbol])),s=this.calleeMap(e,i);return new Set([...s.entries()].filter(([n,f])=>{let d=o.get(n);return f.some(m=>m.symbol!==d)}).map(([n])=>n))}fileDependencyGraph(e){return q(this.db,e)}fileKind(e){return R(e)}hasSuppressionComment(e){return y(this.db,e.relativePath,e.startLine)}sourceFiles(){return A(this.db)}scanSourceReferences(e,i){U(this.db,e,i)}callableSignature(e){let i=w(this.db,e.relativePath)?.callables.find(o=>o.startLine===e.startLine&&o.endLine===e.endLine);return i?{paramCount:i.paramCount}:null}};export{Z as a};
2
+ //# sourceMappingURL=chunk-GBEYTDY5.js.map
@@ -1,2 +1,2 @@
1
- import{a as F}from"./chunk-RY7CAOJF.js";import{d as x}from"./chunk-JM72FNGA.js";import{a as v,d as S}from"./chunk-BTCASU5J.js";import{a as L,b as y}from"./chunk-DS6QEB3G.js";import{b as m,d as g,e as d}from"./chunk-C6ROZBJA.js";import{c as p}from"./chunk-7S5E7KWT.js";var C=p("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function k(t,e,r){return t.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function z(t,e,r){let n=[],i=0,s=0,c=x(e.symbol);for(let a of r)_(t,a,e.relativePath,c)?i++:h(t,a,c)?s++:n.push(a);return{realConsumers:n,barrelConsumers:i,importOnlyConsumers:s}}function h(t,e,r){if(!r)return!1;let n=v(e);if(!n)return!1;let i=C.get(t,e,()=>b(t,e,n));return i.importedLeaves.has(r)&&!i.usedLeaves.has(r)}function b(t,e,r){let n=L(t,e);if(!n)return U();let i=m(t,e,n),s=g(t,"consumer-file-usage",e,i);if(s){let a=E(s);if(a)return a}let c=w(t,e,r);return d(t,"consumer-file-usage",e,i,D(c)),c}function w(t,e,r){let n=new Set,i=new Set,s=S(t,e);if(!s)return{importedLeaves:n,usedLeaves:i};let c=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let u=f||c.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(u?n.add(o.text):i.add(o.text));for(let l of o.children)a(l,u)};return a(s.rootNode,!1),{importedLeaves:n,usedLeaves:i}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function D(t){return JSON.stringify({importedLeaves:[...t.importedLeaves],usedLeaves:[...t.usedLeaves]})}function E(t){try{let e=JSON.parse(t);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(e.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function _(t,e,r,n){if(!n)return!1;let i=y(t,e);if(i.length===0)return!1;let s=F(t,e);if(s.length===0)return!1;let c=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),o=0;for(let f=0;f<i.length;f++){if(!a.test(i[f]??""))continue;if(o++,!s.find(l=>l.startLine<=f&&f<=l.endLine))return!1}return o>0}export{k as a,z as b,h as c};
2
- //# sourceMappingURL=chunk-VFLHKRTW.js.map
1
+ import{a as F}from"./chunk-P5RYBRIO.js";import{d as x}from"./chunk-JM72FNGA.js";import{a as v,d as S}from"./chunk-HF25DFSC.js";import{a as L,b as y}from"./chunk-DS6QEB3G.js";import{b as m,d as g,e as d}from"./chunk-XUGQU7PM.js";import{c as p}from"./chunk-7S5E7KWT.js";var C=p("definition-consumer-file-usage",{clearGroups:["whole-project","source-file"]});function k(t,e,r){return t.callerFileMap(e,{semantic:r.semantic,sourceFallback:r.sourceFallback})}function z(t,e,r){let n=[],i=0,s=0,c=x(e.symbol);for(let a of r)_(t,a,e.relativePath,c)?i++:h(t,a,c)?s++:n.push(a);return{realConsumers:n,barrelConsumers:i,importOnlyConsumers:s}}function h(t,e,r){if(!r)return!1;let n=v(e);if(!n)return!1;let i=C.get(t,e,()=>b(t,e,n));return i.importedLeaves.has(r)&&!i.usedLeaves.has(r)}function b(t,e,r){let n=L(t,e);if(!n)return U();let i=m(t,e,n),s=g(t,"consumer-file-usage",e,i);if(s){let a=E(s);if(a)return a}let c=w(t,e,r);return d(t,"consumer-file-usage",e,i,D(c)),c}function w(t,e,r){let n=new Set,i=new Set,s=S(t,e);if(!s)return{importedLeaves:n,usedLeaves:i};let c=r==="rust"?new Set(["use_declaration"]):r==="python"?new Set(["import_statement","import_from_statement"]):new Set(["import_statement"]),a=(o,f)=>{let u=f||c.has(o.type);(o.type==="identifier"||o.type==="type_identifier"||o.type==="property_identifier"||o.type==="field_identifier")&&(u?n.add(o.text):i.add(o.text));for(let l of o.children)a(l,u)};return a(s.rootNode,!1),{importedLeaves:n,usedLeaves:i}}function U(){return{importedLeaves:new Set,usedLeaves:new Set}}function D(t){return JSON.stringify({importedLeaves:[...t.importedLeaves],usedLeaves:[...t.usedLeaves]})}function E(t){try{let e=JSON.parse(t);return!Array.isArray(e.importedLeaves)||!Array.isArray(e.usedLeaves)?null:{importedLeaves:new Set(e.importedLeaves.filter(r=>typeof r=="string")),usedLeaves:new Set(e.usedLeaves.filter(r=>typeof r=="string"))}}catch{return null}}function _(t,e,r,n){if(!n)return!1;let i=y(t,e);if(i.length===0)return!1;let s=F(t,e);if(s.length===0)return!1;let c=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),a=new RegExp(`\\b${c}\\b`),o=0;for(let f=0;f<i.length;f++){if(!a.test(i[f]??""))continue;if(o++,!s.find(l=>l.startLine<=f&&f<=l.endLine))return!1}return o>0}export{k as a,z as b,h as c};
2
+ //# sourceMappingURL=chunk-GRJY65YT.js.map
@@ -0,0 +1,3 @@
1
+ import{a as p,b as k,e as g,g as b,i as C}from"./chunk-DS6QEB3G.js";import{b as y,d as S,e as v,j as _,k as l}from"./chunk-XUGQU7PM.js";import{c as T}from"./chunk-A536TEU4.js";import{e as N,f as x}from"./chunk-7S5E7KWT.js";import{extname as R}from"path";var G={".rs":"rust",".ts":"typescript",".mts":"typescript",".cts":"typescript",".tsx":"tsx",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".py":"python",".pyi":"python",".java":"java",".kt":"kotlin",".kts":"kotlin",".scala":"scala",".sc":"scala",".rb":"ruby",".c":"c",".h":"c",".cc":"cpp",".cpp":"cpp",".cxx":"cpp",".hpp":"cpp",".hh":"cpp",".hxx":"cpp",".cs":"csharp",".php":"php",".vb":"vb"};function d(e){return G[R(e).toLowerCase()]??null}function j(e){return R(e).toLowerCase()===".vue"}import{extname as Y}from"path";import{parse as Q}from"@vue/compiler-sfc";function w(e){let t=Q(e),n=t.descriptor.scriptSetup??t.descriptor.script;if(!n||n.src)return null;let s=b(n.lang??null);return s?{body:n.content,startLine:Math.max(0,n.loc.start.line-1),language:s}:null}var L=x("ast-trees",{clearGroups:["whole-project","source-file"]});function A(e,t){if(j(t))return X(e,t);let n=d(t);if(!n)return null;let s=p(e,t);return s?L.get(e,t,s,()=>g(n,s)):null}function X(e,t){let n=p(e,t);return n?L.get(e,t,n,()=>{let s=w(n);if(!s)return null;let o=`
2
+ `.repeat(s.startLine)+s.body;return g(s.language,o)}):null}var ee=[".tsx",".jsx"],F=new Set(["useActionState","useCallback","useContext","useDebugValue","useDeferredValue","useEffect","useId","useImperativeHandle","useInsertionEffect","useLayoutEffect","useMemo","useOptimistic","useReducer","useRef","useState","useSyncExternalStore","useTransition"]),te=new Set(["useEffect","useInsertionEffect","useLayoutEffect"]),ne=new Set(["useActionState","useOptimistic","useReducer","useRef","useState"]),se=new Set(["useLocation","useNavigate","useParams","useSearchParams","useTranslation"]),oe=new Set(["axios","fetch","gql","graphql","mutate","query","request","useMutation","useQuery","useSuspenseQuery"]),re=new Set(["add","apply","cancel","change","clear","close","create","delete","fetch","filter","handle","load","open","refresh","remove","render","reset","save","select","submit","toggle","update"]),ae=new Set(["children","className","false","key","null","style","true","undefined"]),ie=new Set(["aria-hidden","className","clipRule","d","fill","fillRule","height","role","stroke","strokeLinecap","strokeLinejoin","strokeWidth","style","viewBox","width","xmlns"]),ce=N("react-component-behavior-profiles");function et(e,t={}){let n=T(e,{extensions:ee}).filter(o=>!t.scope||o.includes(t.scope)).sort();return(typeof t.scanLimit=="number"&&t.scanLimit>0?n.slice(0,t.scanLimit):n).flatMap(o=>le(e,o)).filter(o=>(t.minJsxTokens===void 0||o.jsxTokens.size>=t.minJsxTokens)&&(t.minBehaviorTokens===void 0||o.behaviorTokens.size>=t.minBehaviorTokens))}function le(e,t){let n=t.replace(/\\/g,"/"),s=p(e,n);return ce.get(e,n,s,()=>ue(e,n,s)).map(pe)}function ue(e,t,n){let s=y(e,t,n),o=S(e,"react-component-behavior-profiles",t,s);if(o){let r=de(o);if(r)return r}let a=me(e,t);return v(e,"react-component-behavior-profiles",t,s,fe(a)),a}function me(e,t){let n=ge(t);if(!n)return[];let s=A(e,t);if(!s)return[];let o=k(e,t).length;return Ne(s.rootNode,n).filter(r=>r.kind==="hook"||$(r.bodyNode)).map(r=>{let i=ke(r.bodyNode),u=Re(r.bodyNode,n);return{file:t,name:r.name,kind:r.kind,startLine:r.node.startPosition.row,endLine:r.node.endPosition.row,loc:Math.max(1,r.node.endPosition.row-r.node.startPosition.row+1),fileLines:o,jsxTokens:i.tokens,behaviorTokens:u.tokens,componentNames:m(i.componentNames),nativeTags:m(i.nativeTags),propNames:m(i.propNames),eventNames:m(i.eventNames),hookNames:m(u.hookNames),requestNames:m(u.requestNames),stateNames:m(u.stateNames),effectNames:m(u.effectNames),handlerNames:m(u.handlerNames)}})}function pe(e){return{...e,jsxTokens:new Set(e.jsxTokens),behaviorTokens:new Set(e.behaviorTokens),componentNames:[...e.componentNames],nativeTags:[...e.nativeTags],propNames:[...e.propNames],eventNames:[...e.eventNames],hookNames:[...e.hookNames],requestNames:[...e.requestNames],stateNames:[...e.stateNames],effectNames:[...e.effectNames],handlerNames:[...e.handlerNames]}}function fe(e){return JSON.stringify(e.map(t=>({...t,jsxTokens:[...t.jsxTokens],behaviorTokens:[...t.behaviorTokens]})))}function de(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=[];for(let s of t){let o=he(s);if(!o)return null;n.push(o)}return n}catch{return null}}function he(e){if(!_(e))return null;let{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:u,behaviorTokens:J,componentNames:z,nativeTags:D,propNames:I,eventNames:V,hookNames:H,requestNames:Z,stateNames:M,effectNames:K,handlerNames:U}=e;if(typeof t!="string"||typeof n!="string"||s!=="component"&&s!=="hook"||!h(o)||!h(a)||!h(r)||!h(i))return null;let c={jsxTokens:l(u),behaviorTokens:l(J),componentNames:l(z),nativeTags:l(D),propNames:l(I),eventNames:l(V),hookNames:l(H),requestNames:l(Z),stateNames:l(M),effectNames:l(K),handlerNames:l(U)};return Object.values(c).some(W=>W===null)?null:{file:t,name:n,kind:s,startLine:o,endLine:a,loc:r,fileLines:i,jsxTokens:new Set(c.jsxTokens),behaviorTokens:new Set(c.behaviorTokens),componentNames:c.componentNames,nativeTags:c.nativeTags,propNames:c.propNames,eventNames:c.eventNames,hookNames:c.hookNames,requestNames:c.requestNames,stateNames:c.stateNames,effectNames:c.effectNames,handlerNames:c.handlerNames}}function h(e){return typeof e=="number"&&Number.isFinite(e)}function ge(e){let t=Y(e).toLowerCase();return t!==".tsx"&&t!==".jsx"?null:d(e)}function Ne(e,t){let n=[],s=new Set,o=a=>{let r=xe(a);if(r&&!Se(a)){let i=`${r.name}:${r.node.startIndex}:${r.node.endIndex}`;s.has(i)||(s.add(i),n.push(r));return}for(let i of a.namedChildren)o(i)};return(t==="tsx"||t==="javascript")&&o(e),n}function xe(e){if(e.type==="function_declaration"){let a=O(e);return!a||!B(a)?null:{name:a,kind:P(a),node:e,bodyNode:e}}if(e.type!=="variable_declarator")return null;let t=e.childForFieldName("name")??e.namedChild(0),n=e.childForFieldName("value")??e.namedChild(1),s=f(t);if(!s||!n||!B(s))return null;let o=ye(n);return o?{name:s,kind:P(s),node:e,bodyNode:o}:null}function B(e){return/^[A-Z]/.test(e)||/^use[A-Z0-9_]/.test(e)}function P(e){return/^use[A-Z0-9_]/.test(e)?"hook":"component"}function ye(e){if(e.type==="arrow_function"||e.type==="function_expression")return e;if(e.type!=="call_expression")return null;let t=ve(e);return t!=="memo"&&t!=="forwardRef"?null:e.namedChildren.find(o=>o.type==="arguments")?.namedChildren.find(o=>o.type==="arrow_function"||o.type==="function_expression")??null}function Se(e){let t=e.parent;for(;t;){if(t.type==="function_declaration"||t.type==="function_expression"||t.type==="arrow_function"||t.type==="method_definition")return!0;t=t.parent}return!1}function O(e){return f(e.childForFieldName("name")??e.namedChild(0))}function ve(e){let t=e.childForFieldName("function")??e.namedChild(0);return t?t.text.split(".").pop()??t.text:null}function $(e){return e.type.startsWith("jsx_")?!0:e.namedChildren.some($)}function ke(e){let t={tokens:new Set,componentNames:new Set,nativeTags:new Set,propNames:new Set,eventNames:new Set},n=s=>{s.type==="jsx_opening_element"||s.type==="jsx_self_closing_element"?be(s,t):s.type==="jsx_expression"?Ce(s,t):s.type==="jsx_fragment"&&t.tokens.add("jsx:fragment");for(let o of s.namedChildren)n(o)};return n(e),t}function be(e,t){let n=Te(e),s=!1;if(n){let o=E(n);s=Fe(o),s?(t.componentNames.add(o),t.tokens.add(`component:${o}`)):(t.nativeTags.add(o),t.tokens.add(`native:${o}`))}for(let o of e.namedChildren)if(o.type==="jsx_attribute"){let a=_e(o);if(!a)continue;let r=E(a);if(r.startsWith("on")&&r.length>2){let i=r.slice(2).replace(/^[A-Z]/,u=>u.toLowerCase());t.eventNames.add(i),t.tokens.add(`event:${i}`)}else ie.has(r)||(t.propNames.add(r),t.tokens.add(`${s?"prop":"native-prop"}:${r}`))}else o.type==="jsx_spread_attribute"&&t.tokens.add("prop:spread")}function Ce(e,t){let n=e.text;(n.includes("&&")||n.includes("?"))&&t.tokens.add("jsx:conditional"),(n.includes(".map(")||n.includes(".flatMap("))&&t.tokens.add("jsx:list");for(let s of Be(n))ae.has(s)||t.tokens.add(`binding:${s}`)}function Te(e){for(let t of e.namedChildren)if(t.type==="identifier"||t.type==="jsx_identifier"||t.type==="property_identifier"||t.type==="member_expression"||t.type==="jsx_member_expression")return t.text;return/^<\s*([A-Za-z][\w$.]*)/.exec(e.text)?.[1]??null}function _e(e){for(let t of e.namedChildren)if(t.type==="property_identifier"||t.type==="identifier"||t.type==="jsx_identifier")return t.text;return/^([A-Za-z_$][\w$:-]*)/.exec(e.text)?.[1]??null}function Re(e,t){let n={tokens:new Set,hookNames:new Set,requestNames:new Set,stateNames:new Set,effectNames:new Set,handlerNames:new Set},s=o=>{if(o.type==="call_expression"){let a=C(o,t);a&&je(a.calleeLeaf,n)}else if(o.type==="variable_declarator")Le(o,n);else if(o.type==="function_declaration"){let a=O(o);a&&q(a,n)}for(let a of o.namedChildren)s(a)};return s(e),n}function je(e,t){/^use[A-Z0-9_]/.test(e)&&(t.hookNames.add(e),!F.has(e)&&!se.has(e)&&t.tokens.add(`hook:${e}`)),F.has(e)&&t.tokens.add(`react-hook:${e}`),te.has(e)&&(t.effectNames.add(e),t.tokens.add(`effect:${e}`)),ne.has(e)&&t.tokens.add(`state-hook:${e}`),we(e)&&(t.requestNames.add(e),t.tokens.add(`request:${e}`))}function we(e){if(oe.has(e))return!0;let t=/^use([A-Z0-9_].*)$/.exec(e)?.[1];return t?/(Query|Mutation|Fetch|Resource)$/.test(t):!1}function Le(e,t){let n=e.childForFieldName("name")??e.namedChild(0),s=e.childForFieldName("value")??e.namedChild(1);if(n?.type==="array_pattern"&&s?.text.includes("useState")){let a=n.namedChildren.find(i=>f(i)),r=f(a);r&&(t.stateNames.add(r),t.tokens.add(`state:${r}`))}let o=f(n);o&&q(o,t)}function q(e,t){let n=Ae(e);!n||!re.has(n)||(t.handlerNames.add(e),t.tokens.add(`handler:${e}`),t.tokens.add(`handler-verb:${n}`))}function Ae(e){let t=e.startsWith("handle")&&e.length>6?e.slice(6).replace(/^[A-Z]/,n=>n.toLowerCase()):e;return/^[a-z]+/.exec(t)?.[0]??null}function Fe(e){return/^[A-Z]/.test(e)||e.includes(".")}function E(e){return e.replace(/^this\./,"").replace(/\$/g,".")}function f(e){return e&&(e.type==="identifier"||e.type==="property_identifier"||e.type==="shorthand_property_identifier"||/^[A-Za-z_$][\w$]*$/.test(e.text))?e.text:null}function Be(e){let t=[];for(let n of e.matchAll(/\b[A-Za-z_$][\w$]*\b/g)){let s=n[0];t.includes(s)||t.push(s)}return t}function m(e){return[...e].sort()}export{d as a,j as b,w as c,A as d,et as e};
3
+ //# sourceMappingURL=chunk-HF25DFSC.js.map
@@ -0,0 +1,2 @@
1
+ import{c as o,d as a}from"./chunk-BZ53S4ZN.js";import{a as p}from"./chunk-3VD3JMK2.js";import{a as c,b as m,c as f}from"./chunk-YWOOQ4FF.js";import{c as u}from"./chunk-YZA6PPZL.js";function D(n,i={}){let{minSimilarity:t=.62,minTokens:e=8,limit:l=20,scope:d,scanLimit:h,filePattern:k,focusFiles:g}=i,P=C(n,{scope:d,minTokens:e,scanLimit:h});return p({profiles:P,limit:l,filePattern:k,focusFiles:g,compare:(r,s)=>T(r,s,t),sort:(r,s)=>s.similarity-r.similarity||r.fileA.localeCompare(s.fileA)||r.fileB.localeCompare(s.fileB)})}function C(n,i){return u(n,{scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(t=>({file:t.file,tokens:t.templateTokens,loc:v(t)}))}function v(n){return n.totalLines}function T(n,i,t){let e=c(n.tokens,i.tokens);if(e.size<6||!b(e))return null;let l=f(n.tokens,i.tokens);return l<t?null:{fileA:n.file,fileB:i.file,similarity:l,sharedTokens:a(e),sharedComponents:o(e,"component:"),sharedProps:o(e,"prop:"),sharedEvents:o(e,"event:"),sharedDirectives:o(e,"directive:"),sharedSlots:o(e,"slot:"),sharedIdentifiers:o(e,"id:"),uniqueToA:a(m(n.tokens,i.tokens)).slice(0,25),uniqueToB:a(m(i.tokens,n.tokens)).slice(0,25),locA:n.loc,locB:i.loc}}function b(n){let i=0,t=0;for(let e of n)e.startsWith("component:")&&(i+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("directive:")||e.startsWith("slot:"))&&(t+=1);return i>=1||t>=3}export{D as a};
2
+ //# sourceMappingURL=chunk-HHN2B5KA.js.map
@@ -1,4 +1,4 @@
1
- import{a as N}from"./chunk-YNSVAJR6.js";import{a as I,b as S}from"./chunk-T633QLYF.js";import{f as p,k as g}from"./chunk-X3BJUFSN.js";import{c as h,e as b}from"./chunk-JM72FNGA.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
1
+ import{a as N}from"./chunk-UQLFQLAF.js";import{a as I,b as S}from"./chunk-PTQVNJ4Q.js";import{f as p,l as g}from"./chunk-4N4WONI4.js";import{c as h,e as b}from"./chunk-JM72FNGA.js";function x(o,s,r={}){let{maxDepth:c=5,scope:a}=r,l=I(o,s);if(!l)return[];let u=[],f=new Set([l.symbolId]),m=new Set,t=[l];for(let e=1;e<=c&&t.length!==0;e++){let i=[];for(let y of t)for(let n of D(o,y,a)){let d=`${n.file}|${n.shortName}`;if(n.symbolId!==null){if(f.has(n.symbolId))continue;f.add(n.symbolId)}else if(m.has(d))continue;m.add(d),u.push({symbol:n.symbol,shortName:n.shortName,file:n.file,depth:e}),n.symbolId!==null&&n.symbolMatch&&i.push(n.symbolMatch)}t=i}return u.sort((e,i)=>e.depth-i.depth||e.file.localeCompare(i.file)),u}function D(o,s,r){let c=N(o,s,{limit:500}).filter(t=>!o.isIgnored(t.file)).filter(t=>!r||t.file.includes(r)),a=new Set(c.map(t=>t.file)),l=[];for(let t of M(o,s,r)){if(a.has(t))continue;let e=p(o,t),i=e.length>0?g(e,e[0].startLine):null;l.push({symbol:i?.symbol??t,file:t})}let u=[...c,...l],f=[],m=new Set;for(let t of u){let e=S(o,t.symbol);if(!e){let y=`${t.file}|${t.symbol}`;if(m.has(y))continue;m.add(y),f.push({symbolId:null,symbol:t.symbol,shortName:h(t.symbol),file:t.file,symbolMatch:null});continue}if(e.symbolId===s.symbolId||o.isIgnored(e.relativePath)||!_(e.symbol))continue;let i=`${e.symbolId}|${e.relativePath}`;m.has(i)||(m.add(i),f.push({symbolId:e.symbolId,symbol:e.symbol,shortName:h(e.symbol),file:e.relativePath,symbolMatch:e}))}return f}function M(o,s,r){let c=r?"AND consumer_d.relative_path LIKE ?":"",a=[s.symbolId,s.documentId];return r&&a.push(`%${r}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents consumer_d ON consumer_d.id = c.document_id
@@ -7,4 +7,4 @@ import{a as N}from"./chunk-YNSVAJR6.js";import{a as I,b as S}from"./chunk-T633QL
7
7
  AND c.document_id != ?
8
8
  ${o.pathExclusionsFor("consumer_d")}
9
9
  ${c}`,...a).map(l=>l.relative_path).filter(l=>!o.isIgnored(l)))}function _(o){let s=b(o);return s==="method"||s==="type"||o.endsWith("().")}export{x as a};
10
- //# sourceMappingURL=chunk-FKUCFCLU.js.map
10
+ //# sourceMappingURL=chunk-I46WR7MT.js.map
@@ -1,4 +1,4 @@
1
- import{a as s}from"./chunk-LGX2Y4BA.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
1
+ import{a as s}from"./chunk-RYXW3KRC.js";function m(e,d){let i=s(e,d);return i?e.all(`SELECT DISTINCT d2.relative_path
2
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d1 ON c.document_id = d1.id
@@ -30,4 +30,4 @@ import{a as s}from"./chunk-LGX2Y4BA.js";function m(e,d){let i=s(e,d);return i?e.
30
30
  WHERE d2.relative_path = ?
31
31
  AND d1.relative_path != ?
32
32
  ORDER BY d1.relative_path`,i,i).filter(t=>!e.isIgnored(t.relative_path)).map(t=>({relativePath:t.relative_path})):[]}export{m as a,o as b};
33
- //# sourceMappingURL=chunk-5SMUKUV5.js.map
33
+ //# sourceMappingURL=chunk-IPQTC36U.js.map
@@ -1,4 +1,4 @@
1
- import{q as f}from"./chunk-AETMKBZR.js";import{a as d}from"./chunk-T633QLYF.js";import{c as m,d as g}from"./chunk-X3BJUFSN.js";import{c as s,g as u}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-DS6QEB3G.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
1
+ import{q as f}from"./chunk-F6ICF7HL.js";import{a as d}from"./chunk-PTQVNJ4Q.js";import{c as m,d as g}from"./chunk-4N4WONI4.js";import{c as s,g as u}from"./chunk-JM72FNGA.js";import{a as c}from"./chunk-DS6QEB3G.js";function E(e,r,i={}){let n=d(e,r);if(!n)return{definitions:[],referencedBy:[]};let t=e.get("SELECT display_name, documentation FROM global_symbols WHERE id = ?",n.symbolId),a=g(t?.documentation??null),o=e.isIgnored(n.relativePath)?[]:[{relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,signature:y(a,t?.display_name??null,n.symbol),source:S(e,n.relativePath,n.startLine,n.endLine)}],b=f(e,n,{semantic:i.semantic}).map(l=>({relativePath:l.file,line:l.line,enclosingSymbol:l.enclosingSymbol,enclosingShort:l.enclosingSymbol?s(l.enclosingSymbol):"(top-level)"}));return{definitions:o,referencedBy:b}}function S(e,r,i,n){let t=c(e,r);if(!t)return null;let o=t.split(`
2
2
  `).slice(i,n+1).join(`
3
3
  `).trimEnd();return o.length>0?o:null}function y(e,r,i){let n=m(e);if(n&&!p(n))return n;let t=(r??"").trim();return t?u(i)&&!t.endsWith("()")?`${t}()`:t:s(i)}function p(e){return e.startsWith("undefined")||e.includes("|")||e.includes("```")}export{E as a};
4
- //# sourceMappingURL=chunk-FGTHPJON.js.map
4
+ //# sourceMappingURL=chunk-J7RWXLUL.js.map
@@ -1,3 +1,3 @@
1
- import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-XPOZO76D.js";import{a as g,g as p}from"./chunk-ANIOISCE.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-6TDOT7B3.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(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:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(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(C);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 E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
1
+ import{a as P}from"./chunk-LM5SHAN4.js";import{a as x}from"./chunk-PFOCOG57.js";import{a as v}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-GBEYTDY5.js";import{a as g,g as p}from"./chunk-C5CTSJ6X.js";import{a as h}from"./chunk-BGBBVSH4.js";import{c as l,d as m,g as u}from"./chunk-JM72FNGA.js";import{b as f}from"./chunk-72KY2ZFO.js";import{b as d}from"./chunk-DS6QEB3G.js";import{basename as y,extname as L}from"path";function X(n,e){let{scope:i,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new b(n);return x({candidates:()=>A(a,i,t),orderCandidates:v,scanLimit:s,prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>S(n,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function S(n,e,i){let t=R(i);if(t.size!==1||!f(n,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=I(n,e,o),a=T(n,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:h(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:D(r,s,a)}}function I(n,e,i){return P(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:y(e.relativePath,L(e.relativePath))},{label:"callee module",value:y(i.file,L(i.file))}])}function D(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(C);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 E(n,e)?g(n,e.relativePath)?["exported passthrough is declared on the package public surface"]:p(n,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function E(n,e){let i=d(n,e.relativePath);if(i.length===0)return!1;let t=i.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
2
2
  `);return j.test(t)?!0:w(i,m(e.symbol))}function w(n,e){if(!e)return!1;let i=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${F(e)}\\b`);return n.some(t=>i.test(t))}function C(n){return n.includes("public surface")}function F(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function R(n){let e=n.some(t=>u(t.symbol))?n.filter(t=>u(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){return n.productionCallableDefinitions({scope:e,minLoc:3,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0})}var j=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{X as a};
3
- //# sourceMappingURL=chunk-63MSELOP.js.map
3
+ //# sourceMappingURL=chunk-KX5PLFZ5.js.map
@@ -1,2 +1,2 @@
1
- import{a as d}from"./chunk-PVZMPG5I.js";import{c as a}from"./chunk-YWOOQ4FF.js";import{a as c}from"./chunk-2YI45TNM.js";function F(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:f}=e,r=e.minDeps??(f?1:3),{profiles:s,distinctiveDeps:p}=m(t,{scope:n,minDeps:r});return d({profiles:s,limit:l,filePattern:f,overrunFactor:5,compare:(i,u)=>D(i,u,o,p)})}function m(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:f,distinctiveDeps:r}=g(n),s=[];for(let[p,i]of n)i.size>=l&&s.push({file:p,deps:new Set([...i].filter(u=>!f.has(u)))});return{profiles:s,distinctiveDeps:r}}function g(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let s of r)n.set(s,(n.get(s)??0)+1);let f=Math.max(3,Math.ceil(l*.03));for(let[r,s]of n)s>=5&&s/l>.3?e.add(r):s<=f&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function D(t,e,o,l){let n=new Set;for(let i of t.deps)e.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let f=0;for(let i of n)l.has(i)&&f++;if(f<2)return null;let r=a(t.deps,e.deps);if(r<o)return null;let s=[];for(let i of t.deps)e.deps.has(i)||s.push(i);let p=[];for(let i of e.deps)t.deps.has(i)||p.push(i);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:s,uniqueToB:p}}export{F as a};
2
- //# sourceMappingURL=chunk-VMPB52FG.js.map
1
+ import{a as d}from"./chunk-3VD3JMK2.js";import{c as a}from"./chunk-YWOOQ4FF.js";import{a as c}from"./chunk-VUKC6F77.js";function F(t,e={}){let{minSimilarity:o=.5,limit:l=20,scope:n,filePattern:f}=e,r=e.minDeps??(f?1:3),{profiles:s,distinctiveDeps:p}=m(t,{scope:n,minDeps:r});return d({profiles:s,limit:l,filePattern:f,overrunFactor:5,compare:(i,u)=>D(i,u,o,p)})}function m(t,e){let{scope:o,minDeps:l}=e,n=c(t,o),{universalDeps:f,distinctiveDeps:r}=g(n),s=[];for(let[p,i]of n)i.size>=l&&s.push({file:p,deps:new Set([...i].filter(u=>!f.has(u)))});return{profiles:s,distinctiveDeps:r}}function g(t){let e=new Set,o=new Set,l=t.size;if(l===0)return{universalDeps:e,distinctiveDeps:o};let n=new Map;for(let r of t.values())for(let s of r)n.set(s,(n.get(s)??0)+1);let f=Math.max(3,Math.ceil(l*.03));for(let[r,s]of n)s>=5&&s/l>.3?e.add(r):s<=f&&o.add(r);return{universalDeps:e,distinctiveDeps:o}}function D(t,e,o,l){let n=new Set;for(let i of t.deps)e.deps.has(i)&&n.add(i);if(n.size<3||t.deps.size<4||e.deps.size<4)return null;let f=0;for(let i of n)l.has(i)&&f++;if(f<2)return null;let r=a(t.deps,e.deps);if(r<o)return null;let s=[];for(let i of t.deps)e.deps.has(i)||s.push(i);let p=[];for(let i of e.deps)t.deps.has(i)||p.push(i);return{fileA:t.file,fileB:e.file,similarity:r,sharedDeps:[...n],uniqueToA:s,uniqueToB:p}}export{F as a};
2
+ //# sourceMappingURL=chunk-LPL4MA6R.js.map
@@ -0,0 +1,2 @@
1
+ import{a as C,b as k,c as o,d as f}from"./chunk-BZ53S4ZN.js";import{a as V}from"./chunk-3VD3JMK2.js";import{a as B,b}from"./chunk-YWOOQ4FF.js";import{c as y}from"./chunk-YZA6PPZL.js";function L(e,i={}){let{minSimilarity:u=.45,minSharedBehaviors:a=6,limit:r=20,scope:n,scanLimit:c,filePattern:d,focusFiles:h}=i,t=y(e,{scope:n,minBehaviorTokens:Math.max(3,a),scanLimit:c}).map(s=>({file:s.file,tokens:s.behaviorTokens,profile:s}));return V({profiles:t,limit:r,filePattern:d,focusFiles:h,compare:(s,l)=>R(s,l,u,a),sort:(s,l)=>l.similarity-s.similarity||s.fileA.localeCompare(l.fileA)||s.fileB.localeCompare(l.fileB)})}function R(e,i,u,a){let r=B(e.tokens,i.tokens);if(r.size<a||!P(r))return null;let n=k(e.tokens,i.tokens);if(n<u)return null;let c=o(r,"composable:"),d=o(r,"store:"),h=o(r,"reactivity:"),t=o(r,"lifecycle:"),s=o(r,"request:"),l=o(r,"function:"),g=o(r,"function-verb:"),v=o(r,"template-binding:"),p=o(r,"template-event:"),m=F({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p});return{fileA:e.file,fileB:i.file,similarity:n,sharedTokens:f(r),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:t,sharedRequests:s,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v,sharedTemplateEvents:p,evidenceClass:m.evidenceClass,actionTier:m.actionTier,evidenceClassReasons:m.reasons,recommendation:m.recommendation,uniqueToA:f(b(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(b(i.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:s,sharedLifecycle:t,sharedFunctions:l,sharedFunctionVerbs:g,sharedBindings:v}),locA:e.profile.totalLines,locB:i.profile.totalLines}}function F(e){return C({genericWords:q,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:T})}function T(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store 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 composable-extraction evidence."}}function P(e){let i=0,u=0,a=0,r=0,n=0,c=0,d=0;for(let s of e)s.startsWith("composable:")?i+=1:s.startsWith("store:")?u+=1:s.startsWith("request:")?a+=1:s.startsWith("lifecycle:")?r+=1:s.startsWith("function:")?n+=1:s.startsWith("reactivity:")?c+=1:(s.startsWith("function-verb:")||s.startsWith("template-binding:")||s.startsWith("template-event:"))&&(d+=1);let h=i+u,t=h+a+r+n+d;return a>=1&&t>=4||r>=1&&n>=2&&t>=4||h>=2&&(a>=1||n>=2)&&t>=5||n>=2&&c>=1&&t>=4}function S(e){let i=[];return e.sharedComposables.length&&i.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&i.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&i.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&i.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&i.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&i.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&i.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),i.join("; ")||"shared Vue behavior profile"}var q=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{L as a};
2
+ //# sourceMappingURL=chunk-LZHUWKGD.js.map