scip-query 0.14.0 → 0.16.0

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 (321) hide show
  1. package/CHANGELOG.md +14 -2
  2. package/README.md +158 -62
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/chunk-2EU6WVR3.js +3 -0
  5. package/dist/chunk-2HFXPIBT.js +2 -0
  6. package/dist/chunk-2LGPMYS2.js +35 -0
  7. package/dist/chunk-2Y7YX54K.js +16 -0
  8. package/dist/chunk-363TZ64I.js +2 -0
  9. package/dist/chunk-3I34FZ6R.js +2 -0
  10. package/dist/chunk-3LAKH6BV.js +2 -0
  11. package/dist/chunk-3M2UCPFS.js +3 -0
  12. package/dist/chunk-3OPIMH42.js +2 -0
  13. package/dist/{chunk-QZOAOLLZ.js → chunk-3YAZH3JU.js} +2 -2
  14. package/dist/chunk-5P26M63Y.js +2 -0
  15. package/dist/{chunk-72FR7KEZ.js → chunk-5TVNLPUM.js} +14 -12
  16. package/dist/chunk-5UKDCXVC.js +5 -0
  17. package/dist/{chunk-R7U2I55B.js → chunk-5XDNFOAH.js} +2 -2
  18. package/dist/chunk-62Y3PC27.js +4 -0
  19. package/dist/chunk-6DNE65QS.js +40 -0
  20. package/dist/{chunk-N2OTJWC2.js → chunk-6EVORGCB.js} +2 -2
  21. package/dist/chunk-6GZ7LM7S.js +2 -0
  22. package/dist/chunk-753JWTUH.js +3 -0
  23. package/dist/chunk-7II7NFRV.js +4 -0
  24. package/dist/{chunk-M7EEHYSU.js → chunk-7RAS466A.js} +2 -2
  25. package/dist/chunk-A46JTKTM.js +5 -0
  26. package/dist/{chunk-2XRXEIRK.js → chunk-AAMZRDJT.js} +2 -2
  27. package/dist/chunk-AMPN2VMF.js +3 -0
  28. package/dist/{chunk-6XA4LDHY.js → chunk-B3X6KU75.js} +2 -2
  29. package/dist/chunk-BFWVHD2P.js +16 -0
  30. package/dist/chunk-BVHP2B4D.js +61 -0
  31. package/dist/{chunk-BUNDZ6K2.js → chunk-BVUA3GZC.js} +2 -2
  32. package/dist/{chunk-EDSD3VJK.js → chunk-CKIAEVGM.js} +2 -2
  33. package/dist/chunk-CM4EZLW4.js +2 -0
  34. package/dist/chunk-CS3FXTUC.js +2 -0
  35. package/dist/chunk-CVBS2FD4.js +2 -0
  36. package/dist/chunk-D5OXYOJP.js +7 -0
  37. package/dist/chunk-DA34GNNO.js +29 -0
  38. package/dist/chunk-DKK2H4D7.js +7 -0
  39. package/dist/chunk-EBSSCVR4.js +5 -0
  40. package/dist/{chunk-OXTM2RX3.js → chunk-EVCSXWER.js} +2 -2
  41. package/dist/chunk-FFIYGYQR.js +67 -0
  42. package/dist/chunk-G4KQ7S74.js +20 -0
  43. package/dist/{chunk-44P4SJFN.js → chunk-GWWYLYD3.js} +2 -2
  44. package/dist/chunk-HGUNWXJX.js +2 -0
  45. package/dist/chunk-HLRWOFXC.js +9 -0
  46. package/dist/{chunk-YQKECTPV.js → chunk-IRIM3SUR.js} +2 -2
  47. package/dist/chunk-JHK2DMUQ.js +4 -0
  48. package/dist/chunk-JQ2PCFZW.js +3 -0
  49. package/dist/chunk-JRFCWCOD.js +16 -0
  50. package/dist/chunk-JXAJDINF.js +2 -0
  51. package/dist/chunk-K32ZOW3P.js +2 -0
  52. package/dist/{chunk-3H5OSDF7.js → chunk-KI4WPR7Q.js} +2 -2
  53. package/dist/{chunk-43GKP6LI.js → chunk-KP2DJY7D.js} +2 -2
  54. package/dist/{chunk-YTVKPJXW.js → chunk-L27UIF3E.js} +2 -2
  55. package/dist/chunk-LT6AHYVY.js +18 -0
  56. package/dist/chunk-MCNWCJYL.js +11 -0
  57. package/dist/{chunk-K6UI6EBZ.js → chunk-MZB3DTHW.js} +2 -2
  58. package/dist/chunk-NLRWGGPY.js +8 -0
  59. package/dist/chunk-NLVKD45E.js +13 -0
  60. package/dist/chunk-OO6S4ECV.js +112 -0
  61. package/dist/{chunk-QYOPMTZ6.js → chunk-OYGKBDAD.js} +2 -2
  62. package/dist/chunk-P5QZILZ4.js +2 -0
  63. package/dist/chunk-P5XHIJHI.js +2 -0
  64. package/dist/chunk-PCCMMI2M.js +3 -0
  65. package/dist/{chunk-2TPCIPYA.js → chunk-Q65QYKU7.js} +2 -2
  66. package/dist/{chunk-K7SPOJHZ.js → chunk-QB7NRST4.js} +2 -2
  67. package/dist/{chunk-7JZRFDCU.js → chunk-QSNG3NHQ.js} +2 -2
  68. package/dist/chunk-QVZSWLLZ.js +2 -0
  69. package/dist/chunk-RLB7FZKR.js +10 -0
  70. package/dist/{chunk-KYB7FPXT.js → chunk-RPMT6MTX.js} +2 -2
  71. package/dist/chunk-RQWNF2RM.js +2 -0
  72. package/dist/chunk-RYFIRFYJ.js +4 -0
  73. package/dist/{chunk-QARYU7R3.js → chunk-S2FZILCF.js} +2 -2
  74. package/dist/{chunk-HV27H2V2.js → chunk-S3IXCXW2.js} +2 -2
  75. package/dist/{chunk-TYCZ7S4I.js → chunk-S5MTSES5.js} +2 -2
  76. package/dist/chunk-S5RZQA6V.js +2 -0
  77. package/dist/{chunk-PEHDARNC.js → chunk-SEEJPIWG.js} +2 -2
  78. package/dist/chunk-SOCS3467.js +2 -0
  79. package/dist/chunk-U6BJVXWQ.js +2 -0
  80. package/dist/chunk-UO4IADXJ.js +38 -0
  81. package/dist/{chunk-ZEO4CXQR.js → chunk-VLSI5MYU.js} +2 -2
  82. package/dist/chunk-VSQRU3AP.js +2 -0
  83. package/dist/chunk-VYQY75NA.js +2 -0
  84. package/dist/{chunk-NOKUZU56.js → chunk-VZCR3VQY.js} +2 -2
  85. package/dist/chunk-W3ZVRLCH.js +2 -0
  86. package/dist/chunk-WA64GKWB.js +20 -0
  87. package/dist/chunk-WFRZGMWJ.js +71 -0
  88. package/dist/chunk-WN6XEYVX.js +2 -0
  89. package/dist/chunk-XAEU4ROB.js +101 -0
  90. package/dist/chunk-XBPAJASV.js +2 -0
  91. package/dist/{chunk-GY3HAWUA.js → chunk-XC6PUFNN.js} +2 -2
  92. package/dist/chunk-Y42DMR6F.js +6 -0
  93. package/dist/chunk-YCVYOV4A.js +7 -0
  94. package/dist/{chunk-WPZPB42I.js → chunk-YD37KSEK.js} +2 -2
  95. package/dist/{chunk-V5W7H7V4.js → chunk-YFEJIYWH.js} +2 -2
  96. package/dist/chunk-YSUD2S7T.js +3 -0
  97. package/dist/{chunk-KJCDEDQW.js → chunk-ZEKBAMCN.js} +2 -2
  98. package/dist/chunk-ZHGUZKJL.js +2 -0
  99. package/dist/cli.js +587 -305
  100. package/dist/{config-types-BrHl3Bge.d.ts → config-types-SVkUIufk.d.ts} +10 -2
  101. package/dist/{db-_Bdx0E1W.d.ts → db-CS0TuVH6.d.ts} +1 -1
  102. package/dist/{git-history-Dao3_Pu9.d.ts → git-history-ChNHbfZQ.d.ts} +2 -1
  103. package/dist/{health-BEZ1Rt0S.d.ts → health-Btal3mQi.d.ts} +4 -4
  104. package/dist/index.d.ts +7 -5
  105. package/dist/index.js +1 -19
  106. package/dist/queries/affected.d.ts +2 -2
  107. package/dist/queries/affected.js +1 -1
  108. package/dist/queries/bottlenecks.d.ts +8 -2
  109. package/dist/queries/bottlenecks.js +1 -1
  110. package/dist/queries/by-kind.d.ts +2 -2
  111. package/dist/queries/by-kind.js +1 -1
  112. package/dist/queries/call-graph.d.ts +2 -2
  113. package/dist/queries/call-graph.js +1 -1
  114. package/dist/queries/change-surface.d.ts +2 -2
  115. package/dist/queries/change-surface.js +1 -1
  116. package/dist/queries/cleanup-plan.d.ts +2 -2
  117. package/dist/queries/cleanup-plan.js +1 -1
  118. package/dist/queries/co-change.d.ts +4 -3
  119. package/dist/queries/co-change.js +1 -1
  120. package/dist/queries/code.d.ts +2 -2
  121. package/dist/queries/code.js +1 -1
  122. package/dist/queries/complexity-hotspots.d.ts +3 -3
  123. package/dist/queries/complexity-hotspots.js +1 -1
  124. package/dist/queries/complexity.d.ts +5 -4
  125. package/dist/queries/complexity.js +1 -1
  126. package/dist/queries/convergence.d.ts +2 -2
  127. package/dist/queries/convergence.js +1 -1
  128. package/dist/queries/coupling.d.ts +2 -2
  129. package/dist/queries/coupling.js +1 -1
  130. package/dist/queries/cycles.d.ts +2 -2
  131. package/dist/queries/cycles.js +1 -1
  132. package/dist/queries/dataflow.d.ts +2 -2
  133. package/dist/queries/dataflow.js +1 -1
  134. package/dist/queries/dead.d.ts +12 -3
  135. package/dist/queries/dead.js +1 -1
  136. package/dist/queries/decorative-checkers.d.ts +2 -2
  137. package/dist/queries/decorative-checkers.js +1 -1
  138. package/dist/queries/deep-chains.d.ts +8 -3
  139. package/dist/queries/deep-chains.js +1 -1
  140. package/dist/queries/deps.d.ts +2 -2
  141. package/dist/queries/deps.js +1 -1
  142. package/dist/queries/diff-gate.d.ts +5 -4
  143. package/dist/queries/diff-gate.js +1 -1
  144. package/dist/queries/diff-impact.d.ts +3 -3
  145. package/dist/queries/diff-impact.js +1 -1
  146. package/dist/queries/doc-drift.d.ts +4 -2
  147. package/dist/queries/doc-drift.js +1 -1
  148. package/dist/queries/drift.d.ts +2 -2
  149. package/dist/queries/drift.js +1 -1
  150. package/dist/queries/duplicate-bodies.d.ts +3 -3
  151. package/dist/queries/duplicate-bodies.js +1 -1
  152. package/dist/queries/extract-candidates.d.ts +2 -2
  153. package/dist/queries/extract-candidates.js +1 -1
  154. package/dist/queries/fan.d.ts +11 -5
  155. package/dist/queries/fan.js +1 -1
  156. package/dist/queries/files.d.ts +2 -2
  157. package/dist/queries/health.d.ts +3 -3
  158. package/dist/queries/health.js +1 -1
  159. package/dist/queries/hierarchy.d.ts +2 -2
  160. package/dist/queries/hierarchy.js +1 -1
  161. package/dist/queries/hotspots.d.ts +2 -2
  162. package/dist/queries/hotspots.js +1 -1
  163. package/dist/queries/imports.d.ts +2 -2
  164. package/dist/queries/imports.js +1 -1
  165. package/dist/queries/incomplete-migration.d.ts +3 -3
  166. package/dist/queries/incomplete-migration.js +1 -1
  167. package/dist/queries/index.d.ts +5 -5
  168. package/dist/queries/index.js +1 -1
  169. package/dist/queries/isolated.d.ts +2 -2
  170. package/dist/queries/isolated.js +1 -1
  171. package/dist/queries/locality-candidates.d.ts +2 -2
  172. package/dist/queries/locality-candidates.js +1 -1
  173. package/dist/queries/members.d.ts +2 -2
  174. package/dist/queries/members.js +1 -1
  175. package/dist/queries/methods.d.ts +2 -2
  176. package/dist/queries/methods.js +1 -1
  177. package/dist/queries/not-implemented.d.ts +2 -2
  178. package/dist/queries/not-implemented.js +1 -1
  179. package/dist/queries/outline.d.ts +2 -2
  180. package/dist/queries/outline.js +1 -1
  181. package/dist/queries/passthrough-candidates.d.ts +3 -3
  182. package/dist/queries/passthrough-candidates.js +1 -1
  183. package/dist/queries/plan-context.d.ts +4 -4
  184. package/dist/queries/plan-context.js +1 -1
  185. package/dist/queries/react-component-duplicates.d.ts +4 -2
  186. package/dist/queries/react-component-duplicates.js +1 -1
  187. package/dist/queries/react-hook-candidates.d.ts +4 -2
  188. package/dist/queries/react-hook-candidates.js +1 -1
  189. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  190. package/dist/queries/react-large-component-pressure.js +1 -1
  191. package/dist/queries/recent-duplicates.d.ts +4 -2
  192. package/dist/queries/recent-duplicates.js +1 -1
  193. package/dist/queries/redundant-reexports.d.ts +2 -2
  194. package/dist/queries/redundant-reexports.js +1 -1
  195. package/dist/queries/refs.d.ts +2 -2
  196. package/dist/queries/refs.js +1 -1
  197. package/dist/queries/self-audit.d.ts +2 -2
  198. package/dist/queries/self-audit.js +1 -1
  199. package/dist/queries/similar-chains.d.ts +2 -2
  200. package/dist/queries/similar-chains.js +1 -1
  201. package/dist/queries/similar-files.d.ts +2 -2
  202. package/dist/queries/similar-files.js +1 -1
  203. package/dist/queries/similar-signatures.d.ts +2 -2
  204. package/dist/queries/similar-signatures.js +1 -1
  205. package/dist/queries/similar.d.ts +2 -2
  206. package/dist/queries/similar.js +1 -1
  207. package/dist/queries/slice.d.ts +2 -2
  208. package/dist/queries/slice.js +1 -1
  209. package/dist/queries/stale-abstractions.d.ts +2 -2
  210. package/dist/queries/stale-abstractions.js +1 -1
  211. package/dist/queries/stats.d.ts +2 -2
  212. package/dist/queries/surface.d.ts +2 -2
  213. package/dist/queries/surface.js +1 -1
  214. package/dist/queries/symbols.d.ts +2 -2
  215. package/dist/queries/symbols.js +1 -1
  216. package/dist/queries/system.d.ts +2 -2
  217. package/dist/queries/system.js +1 -1
  218. package/dist/queries/test-quality.d.ts +2 -2
  219. package/dist/queries/test-quality.js +1 -1
  220. package/dist/queries/trace.d.ts +2 -2
  221. package/dist/queries/trace.js +1 -1
  222. package/dist/queries/twin-ab.d.ts +2 -2
  223. package/dist/queries/twin-ab.js +1 -1
  224. package/dist/queries/twin-drift.d.ts +2 -2
  225. package/dist/queries/twin-drift.js +1 -1
  226. package/dist/queries/unused-imports.d.ts +2 -2
  227. package/dist/queries/unused-imports.js +1 -1
  228. package/dist/queries/unused-params.d.ts +2 -2
  229. package/dist/queries/unused-params.js +1 -1
  230. package/dist/queries/vue-component-duplicates.d.ts +4 -2
  231. package/dist/queries/vue-component-duplicates.js +1 -1
  232. package/dist/queries/vue-composable-candidates.d.ts +4 -2
  233. package/dist/queries/vue-composable-candidates.js +1 -1
  234. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  235. package/dist/queries/vue-large-view-pressure.js +1 -1
  236. package/dist/queries/wrapper-candidates.d.ts +2 -2
  237. package/dist/queries/wrapper-candidates.js +1 -1
  238. package/dist/reindex-worker.js +256 -12
  239. package/dist/reindex.d.ts +29 -3
  240. package/dist/reindex.js +251 -22
  241. package/dist/runtime.d.ts +8 -4
  242. package/dist/runtime.js +2 -2
  243. package/dist/rust-semantic-session-server.js +2 -0
  244. package/dist/rust-semantic-session-worker.js +2 -0
  245. package/dist/rust-semantic-worker.js +2 -0
  246. package/dist/{scip-cli-C7cg4ZHR.d.ts → scip-cli-BKL-26TZ.d.ts} +2 -2
  247. package/dist/{symbol-types-DaoeXKUt.d.ts → symbol-types-BgWU6lhL.d.ts} +2 -0
  248. package/dist/watch-server.js +42 -0
  249. package/docs/AGENT_GUIDE.md +110 -34
  250. package/docs/AI_FAILURE_MODES.md +8 -3
  251. package/docs/COMMAND_REFERENCE.md +11 -6
  252. package/docs/REGEX_POLICY.md +3 -1
  253. package/docs/accuracy-audit-checklist.md +300 -0
  254. package/docs/accuracy-hardening-goal.md +493 -54
  255. package/docs/analyzer-inventory.md +31 -23
  256. package/docs/analyzer-validation-ledger.md +51 -21
  257. package/package.json +2 -1
  258. package/scripts/build-scip-windows.mjs +7 -7
  259. package/skills/_shared/SKILL.md +21 -18
  260. package/skills/scip-calibrate/SKILL.md +9 -3
  261. package/skills/scip-hyper-optimization/SKILL.md +5 -1
  262. package/skills/scip-query/SKILL.md +1 -1
  263. package/skills/scip-setup/SKILL.md +104 -4
  264. package/skills/scip-verify/SKILL.md +24 -13
  265. package/dist/chunk-27HMTUJE.js +0 -3
  266. package/dist/chunk-27XEGMCT.js +0 -7
  267. package/dist/chunk-3AMWF6V5.js +0 -3
  268. package/dist/chunk-5AAAEZ2Z.js +0 -2
  269. package/dist/chunk-5JRMZMLM.js +0 -2
  270. package/dist/chunk-5VY3RIEI.js +0 -38
  271. package/dist/chunk-6JUAGXR4.js +0 -4
  272. package/dist/chunk-6KDOYKCB.js +0 -40
  273. package/dist/chunk-6KMTPNZL.js +0 -3
  274. package/dist/chunk-7COVQPQQ.js +0 -9
  275. package/dist/chunk-7S5E7KWT.js +0 -2
  276. package/dist/chunk-7TVFPOD7.js +0 -102
  277. package/dist/chunk-A6KSEIRN.js +0 -61
  278. package/dist/chunk-AAMURYOK.js +0 -4
  279. package/dist/chunk-BP7S6V3M.js +0 -20
  280. package/dist/chunk-BRBF3E5X.js +0 -35
  281. package/dist/chunk-BZXE3HO4.js +0 -6
  282. package/dist/chunk-CXQQOXSI.js +0 -10
  283. package/dist/chunk-EVZSAR3S.js +0 -2
  284. package/dist/chunk-GMOEX7EV.js +0 -2
  285. package/dist/chunk-GNG622H3.js +0 -3
  286. package/dist/chunk-GUDKRIGW.js +0 -7
  287. package/dist/chunk-GULVO6NF.js +0 -43
  288. package/dist/chunk-HZZQKNVE.js +0 -2
  289. package/dist/chunk-I4R3SNMR.js +0 -2
  290. package/dist/chunk-IMQFJ53K.js +0 -2
  291. package/dist/chunk-ISLWJ4PY.js +0 -10
  292. package/dist/chunk-IUSSGHJO.js +0 -2
  293. package/dist/chunk-J5WVNZ6O.js +0 -2
  294. package/dist/chunk-JJUX2OAP.js +0 -2
  295. package/dist/chunk-JZBGTSAB.js +0 -13
  296. package/dist/chunk-K5N5RNGM.js +0 -2
  297. package/dist/chunk-KSJ544IV.js +0 -5
  298. package/dist/chunk-LY7NMOBW.js +0 -2
  299. package/dist/chunk-N23FT4EZ.js +0 -2
  300. package/dist/chunk-NCVFKOLB.js +0 -2
  301. package/dist/chunk-PESEPWZO.js +0 -2
  302. package/dist/chunk-PMY4UFGV.js +0 -2
  303. package/dist/chunk-Q7PWDXL5.js +0 -5
  304. package/dist/chunk-QVGFVRKD.js +0 -2
  305. package/dist/chunk-R5336VHZ.js +0 -2
  306. package/dist/chunk-RLB6SG25.js +0 -2
  307. package/dist/chunk-SFDVBARK.js +0 -2
  308. package/dist/chunk-TG7QSYCJ.js +0 -2
  309. package/dist/chunk-U3VMUDXJ.js +0 -2
  310. package/dist/chunk-UHPWZCYQ.js +0 -3
  311. package/dist/chunk-URSSPS5H.js +0 -2
  312. package/dist/chunk-WIBFXSYB.js +0 -6
  313. package/dist/chunk-WMO2VZZK.js +0 -3
  314. package/dist/chunk-WS3Z6W3M.js +0 -65
  315. package/dist/chunk-X3DTIEMU.js +0 -18
  316. package/dist/chunk-X5C43YVI.js +0 -2
  317. package/dist/chunk-X7CHWTZ2.js +0 -72
  318. package/dist/chunk-XC2PJOVM.js +0 -3
  319. package/dist/chunk-XDESMVOL.js +0 -4
  320. package/dist/chunk-XZBLZHXL.js +0 -16
  321. package/dist/chunk-ZMGBWSFZ.js +0 -2
@@ -1,2 +1,2 @@
1
- import{a as F,b as A}from"./chunk-I4R3SNMR.js";import{a as C}from"./chunk-IMQFJ53K.js";import{a as k}from"./chunk-27HMTUJE.js";import{d as S}from"./chunk-X5C43YVI.js";import{a as y}from"./chunk-GNG622H3.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as h}from"path";var _=20,G=1,O=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ce(e,n={}){let t=L(n.limit,_),i=L(n.minConsumers,G),r=new C(e),s=r.fileDependencyGraph(n.scope),o=ge(p(e,{includeIgnored:!1})),a=pe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,s,c,n,o,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(me).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:S(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function J(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),r=L(t,i.length);return i.slice(0,r).map(s=>I(s))}function Q(e,n,t,i,r,s,o){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"exact":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=w([...T(c),...u?T(u):[]]),b=ie(i.unit,c,u,a),g=re(b,i.unit,c,u,a,s,o),j=le(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=ue(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonOwner:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:de(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(F(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return E(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return E(t)}function Z(e,n){let t=y(n),i=p(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:S(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function T(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return w($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=O.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":U(t,"package")?"package-level-shared":U(t,"app")?"app-level-shared":N(t,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function re(e,n,t,i,r,s,o){let a=oe(e,i);if(a)return m(a);let d=fe(n.file),f=se(e,t,d,r,o);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common owner for its consumers.`);let u=ae(c,t,d,o);return u||ce(c,t,d,s,o)}function oe(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function se(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?v(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=l(h.dirname(i[0])),o=H(n,t,s,r);return o?m(o):v(s)}return null}function ae(e,n,t,i){return be(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function ce(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=P(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let s=H(n,t,e,i);return s?m(s):v(e)}function v(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function le(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function ue(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function me(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function ge(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function fe(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function he(e,n,t){let i=x(e),r=x(n);return(M(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function H(e,n,t,i){return l(e)===l(t)||!he(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function pe(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=ye(i);r&&n.add(r)}return n}function ye(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function be(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=y(e);return n===""?".":n}function x(e){let n=y(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function E(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{Ce as a};
2
- //# sourceMappingURL=chunk-GY3HAWUA.js.map
1
+ import{a as F,b as A}from"./chunk-CVBS2FD4.js";import{a as C}from"./chunk-3I34FZ6R.js";import{a as k}from"./chunk-YSUD2S7T.js";import{d as S}from"./chunk-OO6S4ECV.js";import{a as y}from"./chunk-MCNWCJYL.js";import{a as p}from"./chunk-64MNV6AB.js";import{posix as h}from"path";var _=20,G=1,O=new Map([["app","app"],["apps","app"],["component","component"],["components","component"],["composable","composable"],["composables","composable"],["contract","contract"],["contracts","contract"],["domain","domain"],["domains","domain"],["feature","feature"],["features","feature"],["hook","hook"],["hooks","hook"],["lib","library"],["module","module"],["modules","module"],["package","package"],["packages","package"],["page","page"],["pages","page"],["route","route"],["routes","route"],["screen","screen"],["screens","screen"],["service","service"],["services","service"],["shared","shared"],["src","source-root"],["store","state"],["stores","state"],["test","test"],["tests","test"],["util","utility"],["utils","utility"],["view","view"],["views","view"]]),q=new Set(["components","contracts","hooks","lib","services","shared","stores","utils"]),Y=new Set(["access","api","auth","config","db","effect","errors","hooks","lib","middleware","permissions","routes","schemas","servicetasks","services","startup","store","stores","test-utils","repository","repositories","tests","types","ui","utils","workflow","workflows"]);function Ce(e,n={}){let t=L(n.limit,_),i=L(n.minConsumers,G),r=new C(e),s=r.fileDependencyGraph(n.scope),o=ge(p(e,{includeIgnored:!1})),a=pe(e.config.locality?.architecturalBoundarySegments,n.architecturalBoundarySegments);return(n.target?K(e,r,n.target):J(e,n.scope,n.scanLimit)).map(c=>Q(e,r,s,c,n,o,a)).filter(c=>c.consumerFiles.length>=i||n.target).sort(me).slice(0,t)}function K(e,n,t){let i=Z(e,t);if(i)return[I(i)];let r=k(e,t);if(!r)return[];let s=n.definitionsForFile(r.relativePath).find(o=>o.symbolId===r.symbolId);return s?[ee(s)]:[{unit:{kind:"symbol",file:r.relativePath,shortName:S(r.symbol),symbol:r.symbol,startLine:r.startLine,endLine:r.endLine}}]}function J(e,n,t){let i=p(e,{scope:n,includeIgnored:!1}),r=L(t,i.length);return i.slice(0,r).map(s=>I(s))}function Q(e,n,t,i,r,s,o){let a=i.definition?V(e,n,i.definition,r.semantic):X(t,i.unit.file),d=i.definition?a.length>0?"exact":"none":a.length>0?"file-level":"none",f=i.unit.file,c=l(h.dirname(f)),u=te(a),B=ne(c),W=w([...T(c),...u?T(u):[]]),b=ie(i.unit,c,u,a),g=re(b,i.unit,c,u,a,s,o),j=le(i.unit,d,u,a,c,g.whyNoSuggestedHome),z=ue(i.unit,c,u,a,g.suggestedHome,g.whyNoSuggestedHome);return{actionTier:"signal",sourceUnit:i.unit,candidatePath:f,currentDirectory:c,directoryAncestry:B,consumerFiles:a,consumerCoverage:d,nearestCommonOwner:u,boundaryMarkers:W,recommendedTier:b,suggestedHome:g.suggestedHome,destinationConfidence:g.confidence,whyNoSuggestedHome:g.whyNoSuggestedHome,counterevidence:j,reasons:z,recommendation:de(b,g.suggestedHome,d)}}function V(e,n,t,i){let r=A(F(e,n).forDefinitions([t],{semantic:i!==!1,sourceFallback:!0}));return E(r.get(t.symbolId)??[])}function X(e,n){let t=[];for(let[i,r]of e.entries())i!==n&&r.has(n)&&t.push(i);return E(t)}function Z(e,n){let t=y(n),i=p(e,{includeIgnored:!1}),r=i.find(o=>o===t);if(r)return r;let s=i.find(o=>o.endsWith(`/${t}`));return s||(i.find(o=>o.includes(t))??null)}function ee(e){return{definition:e,unit:{kind:"symbol",file:e.relativePath,shortName:S(e.symbol),symbol:e.symbol,startLine:e.startLine,endLine:e.endLine}}}function I(e){return{unit:{kind:"file",file:e,shortName:h.basename(e)}}}function ne(e){if(e===".")return[{path:".",depth:0,markers:[]}];let n=[],t=e.split("/").filter(Boolean);for(let i=0;i<t.length;i+=1){let r=t.slice(0,i+1).join("/");n.push({path:r,depth:i,markers:D(r)})}return n}function T(e){return e==="."?[]:$(e).map(({marker:n,prefix:t})=>`${n}: ${t}`)}function D(e){return w($(e).map(({marker:n})=>n))}function $(e){let n=e.split("/").filter(Boolean),t=[];for(let i=0;i<n.length;i+=1){let r=O.get(n[i]);r&&t.push({marker:r,prefix:n.slice(0,i+1).join("/")})}return t}function te(e){if(e.length===0)return null;let n=e.map(i=>l(h.dirname(i))),t=n[0].split("/").filter(Boolean);for(let i of n.slice(1)){let r=i.split("/").filter(Boolean),s=[],o=Math.min(t.length,r.length);for(let a=0;a<o&&t[a]===r[a];a+=1)s.push(t[a]);t=s}return t.length===0?".":t.join("/")}function ie(e,n,t,i){return t?e.kind==="symbol"&&i.length===1?i[0]===e.file?"same-file":"sibling-folder":t==="."||t==="src"?"repository-level-review":U(t,"package")?"package-level-shared":U(t,"app")?"app-level-shared":N(t,["feature","domain","module"])||N(n,["feature","domain","module"])?"feature-local-shared":"sibling-folder":"no-exact-consumers"}function re(e,n,t,i,r,s,o){let a=oe(e,i);if(a)return m(a);let d=fe(n.file),f=se(e,t,d,r,o);if(f)return f;let c=i;if(l(t)===l(c))return m(`${t} is already the nearest common owner for its consumers.`);let u=ae(c,t,d,o);return u||ce(c,t,d,s,o)}function oe(e,n){return n?e==="no-exact-consumers"||e==="repository-level-review"?"The inferred owner is too broad or unsupported for an exact destination.":null:"No consumer owner could be inferred from the current index."}function se(e,n,t,i,r){if(e==="same-file"){let s=i[0]??null;return s?v(s):m("No same-file consumer path was available.")}if(e==="sibling-folder"&&i.length===1){let s=l(h.dirname(i[0])),o=H(n,t,s,r);return o?m(o):v(s)}return null}function ae(e,n,t,i){return be(e)?P(e,n,t,i,`Nearest shared owner ${e} is outside source root ${t}.`):null}function ce(e,n,t,i,r){if(e===".")return m("The nearest common owner is the repository root.");let s=`${e}/shared`,o=P(s,n,t,r,`Proposed home ${s} is outside source root ${t}.`);return o.confidence==="withheld"||i.has(s)?o:m(`${s} does not exist in the indexed project.`)}function P(e,n,t,i,r){if(!M(e,t))return m(r);let s=H(n,t,e,i);return s?m(s):v(e)}function v(e){return{suggestedHome:e,confidence:"exact",whyNoSuggestedHome:null}}function m(e){return{suggestedHome:null,confidence:"withheld",whyNoSuggestedHome:e}}function le(e,n,t,i,r,s){let o=["Report-only signal; review ownership before moving files."];return n==="none"&&o.push("No consumers were found in the current index."),n==="file-level"&&o.push("File-level import evidence can hide which exported unit is actually used."),(t==="."||t==="src")&&o.push("Nearest common owner is broad, so this is not enough evidence for automatic placement."),i.length===1&&o.push("Only one consumer was found; inlining or same-folder placement may be better than shared extraction."),e.kind==="file"&&o.push("File targets describe module locality, not symbol-level usage."),t&&r.startsWith(`${t}/`)&&o.push("Candidate already lives under the nearest common owner."),s&&o.push(`No exact suggested home: ${s}`),o}function ue(e,n,t,i,r,s){let o=[];return o.push(`${e.shortName} currently lives in ${n}.`),t?o.push(`${i.length} consumer file(s) share ${t} as their nearest common owner.`):o.push("No consumer owner could be inferred from the current index."),r?o.push(`Suggested home is ${r}.`):s&&o.push(`No exact suggested home: ${s}`),o}function de(e,n,t){return e==="no-exact-consumers"?"Review references before moving; no consumers were found.":e==="repository-level-review"?"Keep this as a broad locality signal; the inferred owner is too general for automatic relocation.":n?`Review whether ${t==="exact"?"symbol usage":"module import"} supports moving or extracting toward ${n}.`:"Review ownership manually before changing structure."}function me(e,n){return R(n)-R(e)||e.candidatePath.localeCompare(n.candidatePath)}function R(e){let n=e.consumerFiles.length*10;return e.consumerCoverage==="exact"&&(n+=5),e.suggestedHome&&(n+=3),e.recommendedTier==="repository-level-review"&&(n*=.1),e.recommendedTier==="no-exact-consumers"&&(n*=.05),n}function ge(e){let n=new Set(["."]);for(let t of e){let i=l(h.dirname(t));for(;!n.has(i)&&(n.add(i),i!==".");)i=l(h.dirname(i))}return n}function fe(e){let n=x(e),t=n.indexOf("src");return t>=0?n.slice(0,t+1).join("/"):n.length<=1?".":n[0]}function M(e,n){let t=l(e),i=l(n);return i==="."||t===i||t.startsWith(`${i}/`)}function he(e,n,t){let i=x(e),r=x(n);return(M(e,n)?i.slice(r.length):i).some(o=>t.has(o.toLowerCase()))}function H(e,n,t,i){return l(e)===l(t)||!he(e,n,i)?null:`${e} is a named architectural boundary; an exact move to ${t} needs human design.`}function pe(...e){let n=new Set(Y);for(let t of e)for(let i of t??[]){let r=ye(i);r&&n.add(r)}return n}function ye(e){let n=e.trim().toLowerCase();return n===""?null:n}function U(e,n){return D(e).includes(n)}function N(e,n){let t=D(e);return n.some(i=>t.includes(i))}function be(e){let n=e.split("/").filter(Boolean),t=n[n.length-1];return t?q.has(t):!1}function l(e){let n=y(e);return n===""?".":n}function x(e){let n=y(e);return n==="."?[]:n.split("/").filter(Boolean)}function L(e,n){return!Number.isFinite(e)||e===void 0||e<1?n:Math.floor(e)}function E(e){return w([...e]).sort((n,t)=>n.localeCompare(t))}function w(e){return[...new Set(e)]}export{Ce as a};
2
+ //# sourceMappingURL=chunk-XC6PUFNN.js.map
@@ -0,0 +1,6 @@
1
+ import{a as n}from"./chunk-QVZSWLLZ.js";import{execFileSync as l}from"child_process";import{createRequire as m}from"module";import{existsSync as d}from"fs";import{platform as s,arch as p}from"os";var u="v0.8.1",c="https://github.com/sourcegraph/scip",g="SCIP_QUERY_SCIP_BIN";function h(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[g];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function y(e){let r=m(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function f(e=process.env){return h({platform:s(),arch:p(),env:e,isOnPath:n,fileExists:d,resolveSidecar:y})?.path??null}function E(){return f()!==null}function $(){let e=f();if(!e)return null;try{return l(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function v(){let e=s(),r=p(),i,o,t;switch(e){case"darwin":i="darwin",t="tar.gz";break;case"linux":i="linux",t="tar.gz";break;default:return null}switch(r){case"arm64":o="arm64";break;case"x64":o="amd64";break;default:return null}let a=`scip-${i}-${o}.${t}`;return{url:`${c}/releases/download/${u}/${a}`,filename:a}}function B(){let e=v();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),s()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
2
+ `),console.log("Or download manually:")):s()==="win32"?(console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(" npm install -g scip-query-scip-windows"),console.log(`Or set ${g} to a local scip.exe path.
3
+ `),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
4
+ `:` ${c}/releases/tag/${u}
5
+ `),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function C(e){if(s()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(l("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(l("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${c}/releases`),!1}export{f as a,E as b,$ as c,B as d,C as e};
6
+ //# sourceMappingURL=chunk-Y42DMR6F.js.map
@@ -0,0 +1,7 @@
1
+ import{a as j}from"./chunk-S2FZILCF.js";import{a as N,b as g,c as R}from"./chunk-CVBS2FD4.js";import{a as _}from"./chunk-MZB3DTHW.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as P}from"./chunk-3I34FZ6R.js";import{a as k}from"./chunk-BGBBVSH4.js";import{g as C}from"./chunk-UO4IADXJ.js";import{a as w}from"./chunk-2Y7YX54K.js";import{d,e as y,k as v,z as L}from"./chunk-OO6S4ECV.js";import{i as S}from"./chunk-NLVKD45E.js";import{s as x}from"./chunk-WFRZGMWJ.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&x("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=T(t,c.symbolId,D);if(!M)continue;let p=W(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=T(t,e.symbolId,o);if(!r)return null;let s=W(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0,excludeRustTraitImplMembers:!0}).filter(a=>!S(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return R(t,e,o).realConsumers}function T(t,n,e){return t.get(`SELECT c.start_line, c.end_line
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents d ON c.document_id = d.id
5
+ WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
+ LIMIT 1`,n,e)}function W(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
7
+ //# sourceMappingURL=chunk-YCVYOV4A.js.map
@@ -1,2 +1,2 @@
1
- import{b as A}from"./chunk-6KMTPNZL.js";import{a as _}from"./chunk-I4R3SNMR.js";import{f as R,g as L}from"./chunk-3AMWF6V5.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-IMQFJ53K.js";import{f as x,g as I}from"./chunk-BZXE3HO4.js";import{a as w}from"./chunk-BGBBVSH4.js";import{d as N}from"./chunk-X5C43YVI.js";import{b as T,c as h}from"./chunk-JZBGTSAB.js";import{p as S}from"./chunk-WS3Z6W3M.js";import{a as g}from"./chunk-64MNV6AB.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=R(e,n);if(!o)return null;let r=L(o),l=r.trim();if(l==="")return!z(o)||!A(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
2
- //# sourceMappingURL=chunk-WPZPB42I.js.map
1
+ import{b as A}from"./chunk-2EU6WVR3.js";import{a as _}from"./chunk-CVBS2FD4.js";import{f as R,g as L}from"./chunk-753JWTUH.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-3I34FZ6R.js";import{f as x,g as I}from"./chunk-NLRWGGPY.js";import{a as w}from"./chunk-BGBBVSH4.js";import{d as N}from"./chunk-OO6S4ECV.js";import{b as T,c as h}from"./chunk-NLVKD45E.js";import{a as g}from"./chunk-64MNV6AB.js";import{y as S}from"./chunk-WFRZGMWJ.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=R(e,n);if(!o)return null;let r=L(o),l=r.trim();if(l==="")return!z(o)||!A(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
2
+ //# sourceMappingURL=chunk-YD37KSEK.js.map
@@ -1,4 +1,4 @@
1
- import{b as l}from"./chunk-K7SPOJHZ.js";import{a}from"./chunk-IMQFJ53K.js";import{d as i,g as n}from"./chunk-X5C43YVI.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
1
+ import{b as l}from"./chunk-QB7NRST4.js";import{a}from"./chunk-3I34FZ6R.js";import{d as i,g as n}from"./chunk-OO6S4ECV.js";function _(e,r){let t=l(e,r);return t.length===0?[]:m([...d(e,t),...c(e,t)]).filter(o=>!e.isIgnored(o.relative_path)).map(u)}function d(e,r){let t=r.map(()=>"?").join(", ");return e.all(`SELECT DISTINCT d1.relative_path, gs.symbol
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
@@ -26,4 +26,4 @@ import{b as l}from"./chunk-K7SPOJHZ.js";import{a}from"./chunk-IMQFJ53K.js";impor
26
26
  AND ${e.localSymbolPredicate}
27
27
  ${e.pathExclusionsFor("d1")}
28
28
  ORDER BY d1.relative_path`,...r,...r,...r)}function c(e,r){let t=new a(e);return r.flatMap(o=>t.definitionsForFile(o).filter(s=>n(s.symbol)).map(s=>({relative_path:o,symbol:s.symbol})))}function m(e){let r=new Set;return e.filter(t=>{let o=`${t.relative_path}|${t.symbol}`;return r.has(o)?!1:(r.add(o),!0)})}function u(e){return{consumer:e.relative_path,symbol:e.symbol,shortName:i(e.symbol)}}export{_ as a};
29
- //# sourceMappingURL=chunk-V5W7H7V4.js.map
29
+ //# sourceMappingURL=chunk-YFEJIYWH.js.map
@@ -0,0 +1,3 @@
1
+ import{A as C,c as M,d as L,e as Q,g as I,h as E,i as K,n as y,o as d,r as b}from"./chunk-OO6S4ECV.js";function se(e,n){return O(e,n).match}function O(e,n){let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=G(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=W(e,n);return i.length>0?S(e,i):X(e,n)}function W(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return j(e,i,r,t)}function j(e,n,t,o){let i=b([],[...q(e,n,t),...T(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function q(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function T(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function X(e,n){let t=N(n),o=P(n),i=V(e,o),r=ee(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=Y(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?Z(t,o):[],total:t.length}}function Z(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function G(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return H(e,o,a,s)??J(e,o,a,s)}function H(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function le(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function ce(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=U(e,n.symbolId)[0];return t?C(e,t):null}function U(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function V(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
2
+ AND `),r=y(e,{where:i,params:o,limit:200}),a=d(e,{where:i,params:o,limit:200});return b(r,a)}function Y(e,n,t,o){let i=n.trim(),r=t,a=r.replace(/\(\)$/,""),s=n.toLowerCase(),c=t.toLowerCase(),h=c.replace(/\(\)$/,""),k=e.symbol,v=L(e.symbol),g=Q(e.symbol),A=e.display_name??"",w=e.symbol.toLowerCase(),m=v.toLowerCase(),u=g.toLowerCase(),D=A.toLowerCase(),p=e.relative_path.toLowerCase(),F=/[/:.]/.test(t),$=x(t),_=$?.leaf.toLowerCase(),l=0;return(k===i||k===r)&&(l+=1150),(v===i||v===r)&&(l+=1100),A===a&&(l+=1180),g===a&&(l+=1160),(`${g}()`===i||`${g}()`===r)&&(l+=955),(w===s||w===c)&&(l+=1e3),(m===s||m===c)&&(l+=950),(p===s||p===c)&&(l+=925),(p.endsWith(`/${c}`)||p.endsWith(`/${s}`))&&(l+=875),D===h&&(l+=850),u===h&&(l+=825),(`${u}()`===s||`${u}()`===c)&&(l+=820),(m.endsWith(`:${c}`)||m.endsWith(`:${h}`)||m.endsWith(`:${h}()`))&&(l+=800),w.includes(c)&&(l+=120),m.includes(c)&&(l+=140),p.includes(c)&&(l+=140),D.includes(c)&&(l+=110),o.every(B=>{let R=B.toLowerCase();return w.includes(R)||m.includes(R)||p.includes(R)||D.includes(R)})&&(l+=100+o.length*15),$&&p.includes($.path.toLowerCase())&&(l+=360,_&&(u===_||`${u}()`===_||`${u}()`==`${_}()`)&&(l+=700),I(e.symbol)&&(l+=180)),E(e.symbol)&&u===h&&(l+=60),!F&&K(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function x(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function N(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function P(e){let n=N(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function ee(e,n,t){let o=n.trim(),i=e.filter(r=>{let a=L(r.symbol),s=(r.display_name??"").trim();return r.symbol===o||a===o||a===t||s===o||s===t||`${s}()`===o||f(r,t)>1||r.relative_path===o});return i.length===0?[]:(i.sort((r,a)=>f(a,t)-f(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),i)}function f(e,n){let t=x(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),i=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return o.includes(r)?i!==a?1:I(e.symbol)?M(e.symbol)===null?5:4:M(e.symbol)===null?3:2:0}export{se as a,O as b,le as c,ce as d};
3
+ //# sourceMappingURL=chunk-YSUD2S7T.js.map
@@ -1,2 +1,2 @@
1
- import{l as u}from"./chunk-WS3Z6W3M.js";function x(e,i){let l=new Map;return e.forEach((t,f)=>{let o=new Set;for(let r of i(t)){if(o.has(r))continue;o.add(r);let n=l.get(r);n?n.push(f):l.set(r,[f])}}),{candidatesFor:(t,f)=>{let o=new Set;for(let r of i(t)){let n=l.get(r);if(n)for(let a of n)a!==f&&o.add(a)}return[...o].sort((r,n)=>r-n)}}}function R(e){let i=c(e.profile?.name),l=()=>{let t=[];i=c(e.profile?.name,e);let f=(r,n)=>{let a=e.profiles[r],s=e.profiles[n];i.candidatePairs+=1,i.comparedPairs+=1;let d=e.compare(a,s);d&&t.push(d)};if(e.filePattern){let r=e.profiles.findIndex(n=>n.file.includes(e.filePattern));if(r>=0){let n=e.profiles[r];for(let a of m(e,r)){let s=e.profiles[a];e.focusFiles&&!e.focusFiles.has(n.file)&&!e.focusFiles.has(s.file)||f(r,a)}}}else if(e.focusFiles?.size!==0){let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let n=0;n<e.profiles.length;n+=1){let a=e.profiles[n],s=e.focusFiles?.has(a.file)??!1;for(let d of p(e,n))e.focusFiles&&!s&&!e.focusFiles.has(e.profiles[d].file)||f(n,d);if(t.length>r){i.overrunApplied=!0;break}}}t.sort(e.sort??((r,n)=>n.similarity-r.similarity)),i.matchedResults=t.length;let o=t.slice(0,e.limit);return i.emittedResults=o.length,e.onProfile?.({...i}),o};return e.profile?u(`pairwise-profile:${e.profile.name}`,l,()=>({...b(e.profile?.metadata),...i})):l()}function m(e,i){if(e.candidateIndex)return P(e,i,-1);let l=[];for(let t=0;t<e.profiles.length;t+=1)t!==i&&l.push(t);return l}function p(e,i){if(e.candidateIndex)return P(e,i,i);let l=[];for(let t=i+1;t<e.profiles.length;t+=1)l.push(t);return l}function P(e,i,l){let t=e.profiles[i],f=new Set;for(let o of e.candidateIndex?.candidatesFor(t,i,e.profiles)??[])o<=l||o!==i&&(o<0||o>=e.profiles.length||f.add(o));return[...f].sort((o,r)=>o-r)}function c(e,i){return{pipeline:e,profileCount:i?.profiles.length??0,focusedProfileCount:i?.focusFiles?i.profiles.filter(l=>i.focusFiles.has(l.file)).length:0,candidatePairs:0,comparedPairs:0,matchedResults:0,emittedResults:0,candidateIndexApplied:i?.candidateIndex!==void 0,focusApplied:i?.focusFiles!==void 0,filePatternApplied:i?.filePattern!==void 0,overrunApplied:!1}}function b(e){return typeof e=="function"?e():e??{}}export{x as a,R as b};
2
- //# sourceMappingURL=chunk-KJCDEDQW.js.map
1
+ import{s as u}from"./chunk-WFRZGMWJ.js";function x(e,i){let l=new Map;return e.forEach((t,f)=>{let o=new Set;for(let r of i(t)){if(o.has(r))continue;o.add(r);let n=l.get(r);n?n.push(f):l.set(r,[f])}}),{candidatesFor:(t,f)=>{let o=new Set;for(let r of i(t)){let n=l.get(r);if(n)for(let a of n)a!==f&&o.add(a)}return[...o].sort((r,n)=>r-n)}}}function R(e){let i=c(e.profile?.name),l=()=>{let t=[];i=c(e.profile?.name,e);let f=(r,n)=>{let a=e.profiles[r],s=e.profiles[n];i.candidatePairs+=1,i.comparedPairs+=1;let d=e.compare(a,s);d&&t.push(d)};if(e.filePattern){let r=e.profiles.findIndex(n=>n.file.includes(e.filePattern));if(r>=0){let n=e.profiles[r];for(let a of m(e,r)){let s=e.profiles[a];e.focusFiles&&!e.focusFiles.has(n.file)&&!e.focusFiles.has(s.file)||f(r,a)}}}else if(e.focusFiles?.size!==0){let r=typeof e.overrunFactor=="number"&&Number.isFinite(e.limit)?e.limit*e.overrunFactor:Number.POSITIVE_INFINITY;for(let n=0;n<e.profiles.length;n+=1){let a=e.profiles[n],s=e.focusFiles?.has(a.file)??!1;for(let d of p(e,n))e.focusFiles&&!s&&!e.focusFiles.has(e.profiles[d].file)||f(n,d);if(t.length>r){i.overrunApplied=!0;break}}}t.sort(e.sort??((r,n)=>n.similarity-r.similarity)),i.matchedResults=t.length;let o=t.slice(0,e.limit);return i.emittedResults=o.length,e.onProfile?.({...i}),o};return e.profile?u(`pairwise-profile:${e.profile.name}`,l,()=>({...b(e.profile?.metadata),...i})):l()}function m(e,i){if(e.candidateIndex)return P(e,i,-1);let l=[];for(let t=0;t<e.profiles.length;t+=1)t!==i&&l.push(t);return l}function p(e,i){if(e.candidateIndex)return P(e,i,i);let l=[];for(let t=i+1;t<e.profiles.length;t+=1)l.push(t);return l}function P(e,i,l){let t=e.profiles[i],f=new Set;for(let o of e.candidateIndex?.candidatesFor(t,i,e.profiles)??[])o<=l||o!==i&&(o<0||o>=e.profiles.length||f.add(o));return[...f].sort((o,r)=>o-r)}function c(e,i){return{pipeline:e,profileCount:i?.profiles.length??0,focusedProfileCount:i?.focusFiles?i.profiles.filter(l=>i.focusFiles.has(l.file)).length:0,candidatePairs:0,comparedPairs:0,matchedResults:0,emittedResults:0,candidateIndexApplied:i?.candidateIndex!==void 0,focusApplied:i?.focusFiles!==void 0,filePatternApplied:i?.filePattern!==void 0,overrunApplied:!1}}function b(e){return typeof e=="function"?e():e??{}}export{x as a,R as b};
2
+ //# sourceMappingURL=chunk-ZEKBAMCN.js.map
@@ -0,0 +1,2 @@
1
+ import{a as k,b as C}from"./chunk-ZEKBAMCN.js";import{a as V,b as R,c as F,e as o,f as v}from"./chunk-B3X6KU75.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{N as y}from"./chunk-MCNWCJYL.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(r=>({file:r.file,tokens:r.behaviorTokens,profile:r})),n=k(u,r=>r.tokens);return C({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:n,profile:{name:"vue-composable-candidates"},compare:(r,a)=>T(r,a,m,t),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.fileB.localeCompare(a.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=R(e.tokens,s.tokens);if(l<m)return null;let c=o(i,"composable:"),d=o(i,"store:"),h=o(i,"reactivity:"),u=o(i,"lifecycle:"),n=o(i,"request:"),r=o(i,"function:"),a=o(i,"function-verb:"),b=o(i,"template-binding:"),p=o(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,tokenCountA:e.tokens.size,tokenCountB:s.tokens.size,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:n,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:n,sharedLifecycle:u,sharedFunctions:r,sharedFunctionVerbs:a,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return V({genericWords:A,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:w})}function w(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 s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let n of e)n.startsWith("composable:")?s+=1:n.startsWith("store:")?m+=1:n.startsWith("request:")?t+=1:n.startsWith("lifecycle:")?i+=1:n.startsWith("function:")?l+=1:n.startsWith("reactivity:")?c+=1:(n.startsWith("function-verb:")||n.startsWith("template-binding:")||n.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return F([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var A=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{j as a};
2
+ //# sourceMappingURL=chunk-ZHGUZKJL.js.map