scip-query 0.17.2 → 0.19.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 (300) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +3 -1
  3. package/dist/augment-vue-worker.js +1 -1
  4. package/dist/{chunk-ATC4MEVA.js → chunk-2FAJTZSX.js} +2 -2
  5. package/dist/{chunk-W7FNZKX5.js → chunk-2ZNZSNVW.js} +2 -2
  6. package/dist/chunk-35NLDRZC.js +2 -0
  7. package/dist/{chunk-PQD7P6WB.js → chunk-3KQOIXLO.js} +2 -2
  8. package/dist/{chunk-VCRMI56V.js → chunk-3OSRXJKK.js} +2 -2
  9. package/dist/chunk-42QYU6FD.js +3 -0
  10. package/dist/{chunk-BEGHYHOQ.js → chunk-4ZCNFENR.js} +2 -2
  11. package/dist/{chunk-O7NA5FCA.js → chunk-4ZHJAHLE.js} +2 -2
  12. package/dist/chunk-547VY366.js +18 -0
  13. package/dist/{chunk-NX2YAXVQ.js → chunk-54UYBTZW.js} +2 -2
  14. package/dist/{chunk-7ROLM67J.js → chunk-6DHPQS72.js} +2 -2
  15. package/dist/chunk-6SHX42QQ.js +6 -0
  16. package/dist/{chunk-FVLZB54V.js → chunk-7EI4MU5A.js} +2 -2
  17. package/dist/{chunk-J7IMQRCU.js → chunk-7FG5M53V.js} +2 -2
  18. package/dist/chunk-A45K6VUK.js +2 -0
  19. package/dist/{chunk-SXDXR5FH.js → chunk-AEDB4WXE.js} +2 -2
  20. package/dist/{chunk-O5A7BTMA.js → chunk-AERYQJ52.js} +2 -2
  21. package/dist/chunk-AM2LGOEX.js +3 -0
  22. package/dist/{chunk-P6FOIU7O.js → chunk-AWSRND4W.js} +2 -2
  23. package/dist/{chunk-5GAUXLOE.js → chunk-BOXAKNN6.js} +2 -2
  24. package/dist/{chunk-IKMOYFUM.js → chunk-BYPVNKJT.js} +2 -2
  25. package/dist/chunk-DQIJMKNE.js +3 -0
  26. package/dist/{chunk-K65T4TJS.js → chunk-DV6B262O.js} +2 -2
  27. package/dist/chunk-DWN7QDTV.js +26 -0
  28. package/dist/{chunk-G6DDSHMD.js → chunk-EZGT3NJX.js} +2 -2
  29. package/dist/{chunk-MFIA6EIT.js → chunk-EZHARAL4.js} +2 -2
  30. package/dist/chunk-F334Z5UA.js +38 -0
  31. package/dist/{chunk-2A7LUMZP.js → chunk-F5L7WEZF.js} +2 -2
  32. package/dist/{chunk-5CJ6AQN7.js → chunk-FLIF3JWA.js} +2 -2
  33. package/dist/chunk-FMC3BI4I.js +2 -0
  34. package/dist/{chunk-YMFHC5J2.js → chunk-G6QQCX45.js} +2 -2
  35. package/dist/{chunk-Q4GKL4CC.js → chunk-G6RQVDTI.js} +2 -2
  36. package/dist/chunk-GBB2RUDN.js +927 -0
  37. package/dist/{chunk-LL5NQB5V.js → chunk-GJ3FR5WG.js} +2 -2
  38. package/dist/chunk-GMZYT44R.js +5 -0
  39. package/dist/{chunk-OQFPCIXO.js → chunk-GNJHHPZE.js} +2 -2
  40. package/dist/chunk-HOXI4F5I.js +4 -0
  41. package/dist/{chunk-4QBRVI7D.js → chunk-IWK562KR.js} +2 -2
  42. package/dist/chunk-IXORBCMR.js +120 -0
  43. package/dist/chunk-J3U47L4Q.js +2 -0
  44. package/dist/{chunk-K4XL4HOK.js → chunk-J65FQLDL.js} +2 -2
  45. package/dist/{chunk-45QWQSWS.js → chunk-J6BR4MD6.js} +2 -2
  46. package/dist/{chunk-J7WYG63U.js → chunk-JFGUBZWE.js} +2 -2
  47. package/dist/{chunk-BPMBOZAN.js → chunk-KD6TPIXM.js} +2 -2
  48. package/dist/{chunk-3M2UCPFS.js → chunk-KHE7J5ZN.js} +1 -1
  49. package/dist/{chunk-IG6X65MG.js → chunk-KWBA6FDD.js} +2 -2
  50. package/dist/{chunk-KA7RMBVU.js → chunk-LJD7V7UO.js} +2 -2
  51. package/dist/{chunk-ROMKXEUM.js → chunk-MDDF67O2.js} +2 -2
  52. package/dist/{chunk-S22ICAWV.js → chunk-MFBXBLHA.js} +2 -2
  53. package/dist/{chunk-A2GX3PYV.js → chunk-MTFHE7ZO.js} +2 -2
  54. package/dist/chunk-NEG77KKH.js +4 -0
  55. package/dist/{chunk-WA64GKWB.js → chunk-NH7WNNQC.js} +3 -3
  56. package/dist/{chunk-K3UVTL3J.js → chunk-OGHGTD6Z.js} +2 -2
  57. package/dist/chunk-OYYZLJVT.js +2 -0
  58. package/dist/{chunk-DJI446FQ.js → chunk-PAZFJMXB.js} +2 -2
  59. package/dist/{chunk-U244OVE6.js → chunk-PBADFBRR.js} +2 -2
  60. package/dist/{chunk-UWR52GNZ.js → chunk-PKAPOFF5.js} +2 -2
  61. package/dist/{chunk-APCXCRED.js → chunk-PXJIEMND.js} +2 -2
  62. package/dist/{chunk-NJD4C5G5.js → chunk-QB5WSOTY.js} +2 -2
  63. package/dist/{chunk-AY44MGWS.js → chunk-QHOUNTDZ.js} +2 -2
  64. package/dist/chunk-QN67MWDU.js +2 -0
  65. package/dist/{chunk-JLZUM476.js → chunk-QNMOZ3CJ.js} +2 -2
  66. package/dist/{chunk-AWYKDRYV.js → chunk-RIGY5DDE.js} +2 -2
  67. package/dist/chunk-RJLU7IMR.js +10 -0
  68. package/dist/{chunk-N3JH45WR.js → chunk-S65OEY2G.js} +2 -2
  69. package/dist/chunk-SATRCB5O.js +20 -0
  70. package/dist/chunk-T5CSWYAZ.js +2 -0
  71. package/dist/{chunk-H4T2AST4.js → chunk-TC3X33N6.js} +2 -2
  72. package/dist/{chunk-3CJXFMR5.js → chunk-TCVRJ56J.js} +2 -2
  73. package/dist/{chunk-7XP7ZRSI.js → chunk-TDGCALH6.js} +2 -2
  74. package/dist/chunk-TDZXQAH7.js +2 -0
  75. package/dist/{chunk-SUYCF4SX.js → chunk-TOYQTO44.js} +2 -2
  76. package/dist/chunk-UJL3N6TC.js +5 -0
  77. package/dist/chunk-UVMME4FI.js +16 -0
  78. package/dist/{chunk-6JSTKSZH.js → chunk-UXOVHGT6.js} +2 -2
  79. package/dist/chunk-VV5WJLRO.js +67 -0
  80. package/dist/{chunk-4H7T7FIM.js → chunk-WT7TOU2C.js} +2 -2
  81. package/dist/{chunk-4FLF7BHJ.js → chunk-X36LKKVG.js} +2 -2
  82. package/dist/{chunk-C7MBQSIC.js → chunk-X3OOU7CF.js} +2 -2
  83. package/dist/chunk-X65VYV2S.js +2 -0
  84. package/dist/chunk-XBN5VO53.js +2 -0
  85. package/dist/{chunk-TLTLJ4SW.js → chunk-XDSB47KO.js} +2 -2
  86. package/dist/{chunk-4L4X66GE.js → chunk-XDVT7QPG.js} +2 -2
  87. package/dist/chunk-XESK6725.js +2 -0
  88. package/dist/{chunk-OQFA2SUQ.js → chunk-XPYXEEDO.js} +2 -2
  89. package/dist/{chunk-T4P27T6S.js → chunk-XTSVYYAL.js} +2 -2
  90. package/dist/{chunk-27YDE22N.js → chunk-YBAC3RON.js} +2 -2
  91. package/dist/{chunk-2DBY4MO7.js → chunk-YHYTDWFT.js} +2 -2
  92. package/dist/chunk-YYR7ADNB.js +2 -0
  93. package/dist/chunk-ZL5Y23AJ.js +3 -0
  94. package/dist/{chunk-CMLHZWRS.js → chunk-ZNSLF5AC.js} +2 -2
  95. package/dist/chunk-ZXWFN7CK.js +2 -0
  96. package/dist/cli.js +2 -2
  97. package/dist/{command-descriptors-7UUURHWT.js → command-descriptors-SWFWGIFK.js} +173 -167
  98. package/dist/{config-types-70s7NxKB.d.ts → config-types-BA3xLCfG.d.ts} +28 -1
  99. package/dist/{db-BBmJ0v3b.d.ts → db-CzA-9_rL.d.ts} +6 -18
  100. package/dist/direct-navigation-RKMPBXMI.js +3 -0
  101. package/dist/{health-CWpFL_6z.d.ts → health-DYy13GAe.d.ts} +3 -1
  102. package/dist/index.d.ts +23 -41
  103. package/dist/index.js +1 -1
  104. package/dist/postinstall.js +1 -1
  105. package/dist/queries/affected.d.ts +2 -2
  106. package/dist/queries/affected.js +1 -1
  107. package/dist/queries/architecture.d.ts +83 -0
  108. package/dist/queries/architecture.js +2 -0
  109. package/dist/queries/bottlenecks.d.ts +2 -2
  110. package/dist/queries/bottlenecks.js +1 -1
  111. package/dist/queries/by-kind.d.ts +2 -2
  112. package/dist/queries/by-kind.js +1 -1
  113. package/dist/queries/call-graph.d.ts +2 -2
  114. package/dist/queries/call-graph.js +1 -1
  115. package/dist/queries/change-surface.d.ts +2 -2
  116. package/dist/queries/change-surface.js +1 -1
  117. package/dist/queries/cleanup-plan.d.ts +2 -2
  118. package/dist/queries/cleanup-plan.js +1 -1
  119. package/dist/queries/co-change.d.ts +2 -2
  120. package/dist/queries/co-change.js +1 -1
  121. package/dist/queries/code.d.ts +2 -2
  122. package/dist/queries/code.js +1 -1
  123. package/dist/queries/complexity-hotspots.d.ts +2 -2
  124. package/dist/queries/complexity-hotspots.js +1 -1
  125. package/dist/queries/complexity.d.ts +2 -2
  126. package/dist/queries/complexity.js +1 -1
  127. package/dist/queries/convergence.d.ts +2 -2
  128. package/dist/queries/convergence.js +1 -1
  129. package/dist/queries/coupling.d.ts +2 -2
  130. package/dist/queries/coupling.js +1 -1
  131. package/dist/queries/cycles.d.ts +2 -2
  132. package/dist/queries/cycles.js +1 -1
  133. package/dist/queries/dataflow.d.ts +2 -2
  134. package/dist/queries/dataflow.js +1 -1
  135. package/dist/queries/dead.d.ts +2 -2
  136. package/dist/queries/dead.js +1 -1
  137. package/dist/queries/decorative-checkers.d.ts +2 -2
  138. package/dist/queries/decorative-checkers.js +1 -1
  139. package/dist/queries/deep-chains.d.ts +2 -2
  140. package/dist/queries/deep-chains.js +1 -1
  141. package/dist/queries/deps.d.ts +2 -2
  142. package/dist/queries/deps.js +1 -1
  143. package/dist/queries/diff-gate.d.ts +5 -3
  144. package/dist/queries/diff-gate.js +1 -1
  145. package/dist/queries/diff-impact.d.ts +2 -2
  146. package/dist/queries/diff-impact.js +1 -1
  147. package/dist/queries/doc-drift.d.ts +2 -2
  148. package/dist/queries/doc-drift.js +1 -1
  149. package/dist/queries/drift.d.ts +27 -10
  150. package/dist/queries/drift.js +1 -1
  151. package/dist/queries/duplicate-bodies.d.ts +2 -2
  152. package/dist/queries/duplicate-bodies.js +1 -1
  153. package/dist/queries/extract-candidates.d.ts +2 -2
  154. package/dist/queries/extract-candidates.js +1 -1
  155. package/dist/queries/fan.d.ts +2 -2
  156. package/dist/queries/fan.js +1 -1
  157. package/dist/queries/files.d.ts +2 -2
  158. package/dist/queries/health.d.ts +3 -3
  159. package/dist/queries/health.js +1 -1
  160. package/dist/queries/hierarchy.d.ts +2 -2
  161. package/dist/queries/hierarchy.js +1 -1
  162. package/dist/queries/hotspots.d.ts +2 -2
  163. package/dist/queries/hotspots.js +1 -1
  164. package/dist/queries/imports.d.ts +2 -2
  165. package/dist/queries/imports.js +1 -1
  166. package/dist/queries/incomplete-migration.d.ts +2 -2
  167. package/dist/queries/incomplete-migration.js +1 -1
  168. package/dist/queries/index.d.ts +5 -4
  169. package/dist/queries/index.js +1 -1
  170. package/dist/queries/isolated.d.ts +2 -2
  171. package/dist/queries/isolated.js +1 -1
  172. package/dist/queries/locality-candidates.d.ts +2 -2
  173. package/dist/queries/locality-candidates.js +1 -1
  174. package/dist/queries/members.d.ts +2 -2
  175. package/dist/queries/members.js +1 -1
  176. package/dist/queries/methods.d.ts +2 -2
  177. package/dist/queries/methods.js +1 -1
  178. package/dist/queries/not-implemented.d.ts +2 -2
  179. package/dist/queries/not-implemented.js +1 -1
  180. package/dist/queries/outline.d.ts +2 -2
  181. package/dist/queries/outline.js +1 -1
  182. package/dist/queries/passthrough-candidates.d.ts +2 -2
  183. package/dist/queries/passthrough-candidates.js +1 -1
  184. package/dist/queries/plan-context.d.ts +2 -2
  185. package/dist/queries/plan-context.js +1 -1
  186. package/dist/queries/react-component-duplicates.d.ts +2 -2
  187. package/dist/queries/react-component-duplicates.js +1 -1
  188. package/dist/queries/react-hook-candidates.d.ts +2 -2
  189. package/dist/queries/react-hook-candidates.js +1 -1
  190. package/dist/queries/react-large-component-pressure.d.ts +2 -2
  191. package/dist/queries/react-large-component-pressure.js +1 -1
  192. package/dist/queries/recent-duplicates.d.ts +2 -2
  193. package/dist/queries/recent-duplicates.js +1 -1
  194. package/dist/queries/redundant-reexports.d.ts +2 -2
  195. package/dist/queries/redundant-reexports.js +1 -1
  196. package/dist/queries/refs.d.ts +2 -2
  197. package/dist/queries/refs.js +1 -1
  198. package/dist/queries/self-audit.d.ts +2 -2
  199. package/dist/queries/self-audit.js +1 -1
  200. package/dist/queries/similar-chains.d.ts +2 -2
  201. package/dist/queries/similar-chains.js +1 -1
  202. package/dist/queries/similar-files.d.ts +2 -2
  203. package/dist/queries/similar-files.js +1 -1
  204. package/dist/queries/similar-signatures.d.ts +2 -2
  205. package/dist/queries/similar-signatures.js +1 -1
  206. package/dist/queries/similar.d.ts +2 -2
  207. package/dist/queries/similar.js +1 -1
  208. package/dist/queries/slice.d.ts +2 -2
  209. package/dist/queries/slice.js +1 -1
  210. package/dist/queries/stale-abstractions.d.ts +2 -2
  211. package/dist/queries/stale-abstractions.js +1 -1
  212. package/dist/queries/stats.d.ts +2 -2
  213. package/dist/queries/surface.d.ts +2 -2
  214. package/dist/queries/surface.js +1 -1
  215. package/dist/queries/symbols.d.ts +2 -2
  216. package/dist/queries/symbols.js +1 -1
  217. package/dist/queries/system.d.ts +2 -2
  218. package/dist/queries/system.js +1 -1
  219. package/dist/queries/test-quality.d.ts +2 -2
  220. package/dist/queries/test-quality.js +1 -1
  221. package/dist/queries/trace.d.ts +2 -2
  222. package/dist/queries/trace.js +1 -1
  223. package/dist/queries/twin-ab.d.ts +2 -2
  224. package/dist/queries/twin-ab.js +1 -1
  225. package/dist/queries/twin-drift.d.ts +2 -2
  226. package/dist/queries/twin-drift.js +1 -1
  227. package/dist/queries/unused-imports.d.ts +2 -2
  228. package/dist/queries/unused-imports.js +1 -1
  229. package/dist/queries/unused-params.d.ts +2 -2
  230. package/dist/queries/unused-params.js +1 -1
  231. package/dist/queries/vue-component-duplicates.d.ts +2 -2
  232. package/dist/queries/vue-component-duplicates.js +1 -1
  233. package/dist/queries/vue-composable-candidates.d.ts +2 -2
  234. package/dist/queries/vue-composable-candidates.js +1 -1
  235. package/dist/queries/vue-large-view-pressure.d.ts +2 -2
  236. package/dist/queries/vue-large-view-pressure.js +1 -1
  237. package/dist/queries/wrapper-candidates.d.ts +2 -2
  238. package/dist/queries/wrapper-candidates.js +1 -1
  239. package/dist/reindex-worker.js +24 -24
  240. package/dist/reindex.d.ts +12 -10
  241. package/dist/reindex.js +38 -38
  242. package/dist/runtime.d.ts +10 -9
  243. package/dist/runtime.js +2 -1
  244. package/dist/rust-semantic-session-server.js +1 -1
  245. package/dist/{scip-cli-CoMzb7Zu.d.ts → scip-cli-1bVKJgXi.d.ts} +1 -1
  246. package/dist/watch-server.js +7 -6
  247. package/docs/AI_FAILURE_MODES.md +1 -0
  248. package/docs/COMMAND_REFERENCE.md +4 -3
  249. package/docs/DETECTOR_GUIDE.md +5 -3
  250. package/docs/analyzer-inventory.md +16 -6
  251. package/docs/analyzer-validation-ledger.md +12 -1
  252. package/docs/architecture-coherence-vision.md +219 -0
  253. package/package.json +5 -1
  254. package/skills/_shared/SKILL.md +5 -4
  255. package/skills/scip-api-impact/SKILL.md +5 -1
  256. package/skills/scip-claim-audit/SKILL.md +1 -0
  257. package/skills/scip-cleanup-audit/SKILL.md +4 -0
  258. package/skills/scip-concrete-plan/SKILL.md +129 -48
  259. package/skills/scip-conductor/SKILL.md +1 -1
  260. package/skills/scip-debug/SKILL.md +6 -1
  261. package/skills/scip-directory-architecture/SKILL.md +116 -2
  262. package/skills/scip-explore/SKILL.md +2 -1
  263. package/skills/scip-integrity-audit/SKILL.md +17 -0
  264. package/skills/scip-maintainability/SKILL.md +9 -4
  265. package/skills/scip-query/SKILL.md +4 -1
  266. package/skills/scip-root-cause/SKILL.md +150 -0
  267. package/skills/scip-root-cause/agents/openai.yaml +4 -0
  268. package/skills/scip-tla-model-system/SKILL.md +7 -9
  269. package/skills/scip-twin-drift/SKILL.md +1 -1
  270. package/skills/scip-verify/SKILL.md +20 -3
  271. package/dist/chunk-6AITNECC.js +0 -928
  272. package/dist/chunk-7LERNHDG.js +0 -5
  273. package/dist/chunk-7VR5TNOI.js +0 -2
  274. package/dist/chunk-CHJ3QROR.js +0 -2
  275. package/dist/chunk-CVWX24IY.js +0 -2
  276. package/dist/chunk-ELLPMCWA.js +0 -3
  277. package/dist/chunk-IS7DZ7TB.js +0 -2
  278. package/dist/chunk-K53GNKY3.js +0 -2
  279. package/dist/chunk-KJOKTZUE.js +0 -2
  280. package/dist/chunk-KSD6IWF4.js +0 -38
  281. package/dist/chunk-LEKXKHIQ.js +0 -5
  282. package/dist/chunk-LFPQFRCX.js +0 -26
  283. package/dist/chunk-MBVHEPHQ.js +0 -16
  284. package/dist/chunk-NJTIAQY7.js +0 -3
  285. package/dist/chunk-OINSINYW.js +0 -2
  286. package/dist/chunk-QEIGJJBC.js +0 -20
  287. package/dist/chunk-RUQE7DZT.js +0 -2
  288. package/dist/chunk-RUV4KHWA.js +0 -2
  289. package/dist/chunk-SALRDXWM.js +0 -121
  290. package/dist/chunk-SMBIGBGN.js +0 -67
  291. package/dist/chunk-SON6DQNK.js +0 -7
  292. package/dist/chunk-SSGACGAD.js +0 -3
  293. package/dist/chunk-TFWDJDGO.js +0 -2
  294. package/dist/chunk-U4G4UYLB.js +0 -2
  295. package/dist/chunk-WD3PAQJT.js +0 -10
  296. package/dist/chunk-XLJORP6N.js +0 -4
  297. package/dist/chunk-XTF6ELXT.js +0 -3
  298. package/dist/chunk-YYYERNQL.js +0 -18
  299. package/dist/chunk-Z4MCFCGX.js +0 -3
  300. package/dist/direct-navigation-CVCFER5G.js +0 -3
@@ -1,5 +1,5 @@
1
- import{a as U}from"./chunk-QZ4JVECJ.js";import{a as G}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-4XTPZ5CR.js";import{h as F,o as O,p as L,q as H,s as $,v as K,x as z,y as X}from"./chunk-M2TRDR25.js";import{existsSync as Y,readFileSync as P,statSync as St}from"fs";import{join as T}from"path";function I(t,n){let e=it(t,n)??rt(t,n)??ot(t,n)??st(t,n);return ct(t,e,n)}function it(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=j(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(j(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function j(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function rt(t,n){if(!v(t[n]??""))return null;let e=n;for(;e>0&&v(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&v(t[i]??"");)i+=1;return{start:e,end:i}}function v(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function ot(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(w(o)!==null)break;if(N(o)!==null)return null;e-=1}if(e<0)return null;let i=w(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=w(o);if(s!==null){if(s<=i)break;r+=1;continue}if(N(o)!==null)break;r+=1}return{start:e,end:r}}function w(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function st(t,n){let e=t[n]??"";if(V(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&q(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&q(t[r]??"");)r+=1;return{start:i,end:r}}function q(t){return N(t)===null}function N(t){return t.trim().length===0?"blank":V(t)?"heading":j(t)?"fence":v(t)?"table":w(t)!==null?"list":null}function V(t){return/^#{1,6}\s+/.test(t.trim())}function ct(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
1
+ import{a as G}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-4XTPZ5CR.js";import{a as U}from"./chunk-QZ4JVECJ.js";import{h as F,o as O,p as L,q as H,s as $,v as K,x as z,y as X}from"./chunk-M2TRDR25.js";import{existsSync as Y,readFileSync as P,statSync as St}from"fs";import{join as T}from"path";function I(t,n){let e=it(t,n)??rt(t,n)??ot(t,n)??st(t,n);return ct(t,e,n)}function it(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=j(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(j(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function j(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function rt(t,n){if(!v(t[n]??""))return null;let e=n;for(;e>0&&v(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&v(t[i]??"");)i+=1;return{start:e,end:i}}function v(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function ot(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(w(o)!==null)break;if(N(o)!==null)return null;e-=1}if(e<0)return null;let i=w(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=w(o);if(s!==null){if(s<=i)break;r+=1;continue}if(N(o)!==null)break;r+=1}return{start:e,end:r}}function w(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function st(t,n){let e=t[n]??"";if(V(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&q(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&q(t[r]??"");)r+=1;return{start:i,end:r}}function q(t){return N(t)===null}function N(t){return t.trim().length===0?"blank":V(t)?"heading":j(t)?"fence":v(t)?"table":w(t)!==null?"list":null}function V(t){return/^#{1,6}\s+/.test(t.trim())}function ct(t,n,e){let{start:i,end:r}=n;if(r-i>40){let s=Math.floor(20);i=Math.max(i,e-s),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
2
2
  `).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function R(t,n){return n.filter(e=>t.includes(e))}import{existsSync as at,readFileSync as W}from"fs";var lt=/<!--\s*scip-query:\s*snapshot\s*-->/i;function Z(t,n){if((t.config.docs?.snapshotPaths??[]).some(r=>U(r,n)))return!0;let i=X(t,n);return i.length>0&&lt.test(i)}var J={classifyCitation:ut,citationContexts:ft,citationKindLabel:mt,citationRemediation:ht,referenceTargets:pt,hasLineAnchoredCitation:dt};function dt(t){return t.some(n=>(n.lineReferences?.length??0)>0)}function ut(t){let n=t.join(`
3
3
  `).toLowerCase(),e=[],i=R(n,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(i.length>0)return e.push(`configuration/example terms near citation: ${i.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:e};let r=R(n,["accepted","intentional","intentionally","retained","historical"]);if(r.length>0)return e.push(`intentional-record terms near citation: ${r.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:e};let o=R(n,["command","cli","usage","example","run","workflow"]);return o.length>0?(e.push(`guide/reference terms near citation: ${o.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:e}):(e.push(t.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:e})}function ft(t,n,e){let i;try{i=W(`${t.config.projectRoot}/${n}`,"utf-8").split(/\r?\n/)}catch{return[]}let r=e.flatMap(gt),o=[];for(let s=0;s<i.length;s+=1){let c=i[s]??"";r.some(a=>c.includes(a))&&o.push(I(i,s))}return o}function gt(t){let n=t.split("/");return[t,`./${t}`,n.slice(-3).join("/"),n.slice(-2).join("/")].filter((e,i,r)=>e.length>0&&r.indexOf(e)===i)}function mt(t){switch(t){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 ht(t,n){switch(t){case"behavioral-claim":return`Re-read ${n} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${n} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${n} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${n} is still meant to name this file.`}}function pt(t,n,e){let i=G(e),r=new Set;for(let o of n)yt(t,o,i.get(o)??[])&&r.add(o);return r}function yt(t,n,e){if(!Ct.test(n))return!0;let i=`${t.config.projectRoot}/${n}`;if(!at(i))return!0;if(e.length===0)return!1;let r=W(i,"utf-8").split(/\r?\n/),o=bt(r);for(let s of e)for(let c=s.startLine;c<=s.endLine;c+=1)if((r[c]??"").trim()!==""&&!o.has(c))return!0;return!1}var Ct=/\.(?:[cm]?[jt]sx?)$/i;function bt(t){let n=new Set,e=!1;for(let i=0;i<t.length;i+=1){let r=t[i].trim();!e&&Dt(r)&&(e=!0),e&&(n.add(i),r.endsWith(";")&&(e=!1))}return n}function Dt(t){return/^import(?:\s|$)/.test(t)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(t)}var Q=K({kind:"doc-path-evidence",invalidation:z("doc-path-evidence"),serialize:Nt,deserialize:Bt}),M=/\.(?:md|mdx|rst|txt)$/i;function xt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var Rt=3,Tt=/([A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6})(?::([1-9][0-9]*))?\b/g;function sn(t,n={}){let{doc:e,limit:i=20,minCoupling:r=Rt,includeSnapshotExcluded:o=!1}=n,s=wt(t,n.historyMode??"bounded");if(!s)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let a of s.docFiles){if(e!==void 0&&!a.includes(e)||e===void 0&&!tt(t,a)||e!==void 0&&!Y(T(t.config.projectRoot,a)))continue;let d=Z(t,a);if(d&&!o)continue;let{value:p,estimated:y}=At(t,a,s.changeTimes.get(a)),g=Mt(t,a),u=new Map,{resolved:l,broken:m,citations:D}=kt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),S=new Map(D.map(f=>[f.file,f]));for(let f of l){if(f===a||M.test(f))continue;let C=(s.changeTimes.get(f)??[]).filter(b=>b>p).length;if(C===0)continue;let h=S.get(f);u.set(f,{file:f,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",g,h?.contexts),citationContexts:h?.contexts,citedLines:h?.lineReferences})}for(let[f,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(f))continue;let h=(s.changeTimes.get(f)??[]).filter(A=>A>p).length;if(h===0)continue;let b=u.get(f);b?(b.evidence="both",b.coChanges=C,Object.assign(b,B("both",g,b.citationContexts))):u.set(f,{file:f,evidence:"co-change",coChanges:C,changesSinceDocUpdate:h,...B("co-change",g)})}if(u.size===0&&m.length===0)continue;let x=[...u.values()].sort((f,C)=>C.changesSinceDocUpdate-f.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:p,staleness:x.reduce((f,C)=>f+C.changesSinceDocUpdate,0)+m.length*10,subjects:x.slice(0,8),brokenReferences:m,...d?{snapshotExcluded:!0}:{},...y?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,d)=>d.staleness-a.staleness),{available:!0,commitsAnalyzed:s.historyCommitCount,docsScanned:s.docFiles.length,findings:c.slice(0,i)}}function At(t,n,e){if(e&&e.length>0)return{value:Math.max(...e),estimated:!1};try{return{value:Math.floor(St(T(t.config.projectRoot,n)).mtimeMs/1e3),estimated:!0}}catch{return{value:0,estimated:!1}}}function Mt(t,n){let e;try{e=P(T(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
4
4
  ${e}`.toLowerCase(),r=R(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=R(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function B(t,n,e=[]){let i=t==="co-change"||e.length===0?null:J.classifyCitation(e);return{actionTier:vt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function vt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function wt(t,n){let e=_(t,{historyMode:n}),i=e.commitHistory();if(!i)return null;let r=e.trackedFiles()??new Set,o=new Map,s=new Map,c=new Set;for(let a of i.commits){let d=[...new Set(a.files)],p=d.filter(g=>M.test(g)),y=d.filter(g=>!M.test(g));for(let g of d){c.add(g);let u=o.get(g)??[];u.push(a.timestamp),o.set(g,u)}for(let g of p){let u=s.get(g);u||(u=new Map,s.set(g,u));for(let l of y)u.set(l,(u.get(l)??0)+1)}}return{changeTimes:o,coupling:s,docFiles:[...r].filter(a=>M.test(a)),everSeenInHistory:c,historyCommitCount:i.commits.length,tracked:r,trackedBySuffix:nt(r)}}function cn(t,n){if(n.size===0)return[];let e=H(),i=0,r=0,o=0,s=0,c=0,a=0;return $("doc-reference.docs-citing-files",()=>{let d=_(t).trackedFiles()??new Set;i=d.size;let p=nt(d),y=It(n,p),g=[];for(let u of d){if(!tt(t,u))continue;e&&(r+=1);let l;try{l=P(T(t.config.projectRoot,u),"utf-8")}catch{e&&(o+=1);continue}if(!_t(l,y)){e&&(s+=1);continue}let m=et(t,u,l);if(!m)continue;e&&(c+=1);let D=Et(m.candidates,n,y,d,p);if(D.size===0)continue;let S=[...new Set([...D.values()].flatMap(h=>[...h]))],x=Lt(m.contextsByCandidate,S),f=[...D].map(([h,b])=>({file:h,contexts:E([...b].flatMap(A=>x.get(A)??[])).slice(0,3),lineReferences:k([...b].flatMap(A=>m.lineReferencesByCandidate.get(A)??[]))})).filter(h=>h.contexts.length>0),C=[...D.keys()];if(C.length>0){e&&(a+=1);let h=C.sort();g.push({doc:u,cited:h,citations:f,citedClaims:E(f.flatMap(b=>b.contexts)).slice(0,3)})}}return g},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function tt(t,n){return M.test(n)&&!xt(n)&&Y(T(t.config.projectRoot,n))}function nt(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),s=n.get(o)??[];s.push(e),n.set(o,s)}}return n}function It(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let s=r.slice(-o).join("/"),c=n.get(s);c?.length===1&&c[0]===i&&e.add(s)}}return e}function Et(t,n,e,i,r){let o=new Map;for(let s of t){if(!e.has(s))continue;let c;if(n.has(s))c=s;else if(i.has(s))c=s;else{let d=r.get(s);d?.length===1&&(c=d[0])}if(!c||!n.has(c))continue;let a=o.get(c)??new Set;a.add(s),o.set(c,a)}return o}function kt(t,n,e,i,r){let o=new Set,s=new Set,c=et(t,n);if(!c)return{resolved:o,broken:[],citations:[]};let a=c.candidates,d=c.contextsByCandidate,p=c.lineReferencesByCandidate,y=new Map,g=new Map,u=(l,m)=>{let D=d.get(m);if(D&&D.length>0){let x=y.get(l)??[];x.push(...D),y.set(l,E(x).slice(0,3))}let S=p.get(m);S&&S.length>0&&g.set(l,k([...g.get(l)??[],...S]))};for(let l of a){if(e.has(l)){o.add(l),u(l,l);continue}let m=i.get(l);if(m&&m.length===1){o.add(m[0]),u(m[0],l);continue}m&&m.length>1||r.has(l)&&s.add(l)}return{resolved:o,broken:[...s],citations:[...y].map(([l,m])=>({file:l,contexts:m,lineReferences:g.get(l)}))}}function Lt(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function et(t,n,e){let i=e;if(i===void 0)try{i=P(T(t.config.projectRoot,n),"utf-8")}catch{return null}let r=F(t,n,i),o=Q.read(t,n,r);if(o)return o;let s=jt(i);return Q.write(t,n,r,s),s}function _t(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function jt(t){let n=t.split(/\r?\n/),e=new Set,i=new Map,r=new Map;for(let o=0;o<n.length;o+=1){let s=n[o]??"";for(let c of s.matchAll(Tt)){let a=(c[1]??"").replace(/^\.?\//,"");if(a.length===0)continue;e.add(a);let d=c[2]?Number(c[2]):null;d!==null&&Number.isSafeInteger(d)&&r.set(a,k([...r.get(a)??[],d]));let p=I(n,o);if(p.length===0)continue;let y=i.get(a)??[];y.push(p),i.set(a,E(y).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i,lineReferencesByCandidate:r}}function Nt(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()],lineReferencesByCandidate:[...t.lineReferencesByCandidate.entries()]};return JSON.stringify(n)}function Bt(t){try{let n=JSON.parse(t);if(!O(n))return null;let e=L(n.candidates),i=Ft(n.contextsByCandidate),r=Pt(n.lineReferencesByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i),lineReferencesByCandidate:new Map(r??[])}}catch{return null}}function Pt(t){if(t===void 0)return[];if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string"||!Array.isArray(e[1]))return null;let i=[];for(let r of e[1]){if(typeof r!="number"||!Number.isSafeInteger(r))return null;i.push(r)}n.push([e[0],k(i)])}return n}function Ft(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=L(e[1]);if(!i)return null;n.push([e[0],i])}return n}function E(t){let n=[];for(let e of new Set(t))n.some(i=>Ot(i,e))||n.push(e);return n}function k(t){return[...new Set(t)].sort((n,e)=>n-e)}function Ot(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),i=n.split(/\r?\n/).map(c=>c.trim()).filter(c=>c.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),s=e.filter(c=>o.has(c)).length;return s>=3&&s/r>=.6}export{Z as a,J as b,xt as c,sn as d,cn as e};
5
- //# sourceMappingURL=chunk-IG6X65MG.js.map
5
+ //# sourceMappingURL=chunk-KWBA6FDD.js.map
@@ -1,4 +1,4 @@
1
- import{a as g}from"./chunk-K65T4TJS.js";import{h as p}from"./chunk-NJD4C5G5.js";import{a as f}from"./chunk-6JSTKSZH.js";import{d as u,e as _,i as N}from"./chunk-7XP7ZRSI.js";import{p as d}from"./chunk-JLZUM476.js";import{B as l,b as c}from"./chunk-TLTLJ4SW.js";import{a as I}from"./chunk-64MNV6AB.js";import{y as b}from"./chunk-M2TRDR25.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){return e.all(`SELECT DISTINCT gs.symbol, d.relative_path AS importer
1
+ import{a as g}from"./chunk-DV6B262O.js";import{h as p}from"./chunk-QB5WSOTY.js";import{a as f}from"./chunk-UXOVHGT6.js";import{d as u,e as _,i as N}from"./chunk-TDGCALH6.js";import{p as d}from"./chunk-QNMOZ3CJ.js";import{B as l,b as c}from"./chunk-XDSB47KO.js";import{y as b}from"./chunk-M2TRDR25.js";import{a as I}from"./chunk-64MNV6AB.js";function Y(e,t,r={}){return T(e,t,r)?.map(s=>({symbol:s.symbol,shortName:s.shortName,fromFile:s.fromFile}))??[]}function Z(e,t){let r=f(e,t),s=O(e,t);if(s.length>0&&!x(r))return s;let o=k(e,t,r);return h(t)&&o.length>0?o:D([...s,...o])}function G(e,t,r={}){let s=g(e,t);if(!s)return[];let o=S(e,s),n=r.semantic===!1?null:E(e,s);return(n?R(n,o):o).filter(m=>!m.used).map(m=>({symbol:m.symbol,shortName:m.shortName,importedIn:m.importer}))}function R(e,t){let r=new Map;for(let o of t){let n=r.get(o.shortName);n?n.push(o):r.set(o.shortName,[o])}let s=e.map(o=>{let n=r.get(o.shortName),i=n?.shift();return n?.length===0&&r.delete(o.shortName),i?{...o,used:o.used||i.used}:o});return s.push(...[...r.values()].flat()),s}function O(e,t){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-K65T4TJS.js";import{h as p}from"./chunk-NJD4C5G5.js";
32
32
  WHERE imp_d.relative_path = ?
33
33
  AND m.role = 2
34
34
  ORDER BY def_d.relative_path, gs.symbol`,t).filter(n=>!e.isIgnored(n.importer));if(o.length>0){let n=r.semantic===!1?[]:p(e,t);return o.map(i=>({symbol:i.symbol,shortName:u(i.symbol),fromFile:i.from_file??"(external)",importer:i.importer,used:i.used!==0||n.some(m=>m.isUsed&&m.sourcePath===i.from_file)}))}return null}function E(e,t){let r=p(e,t);return r.length>0?r.map(s=>{let o=y(s.importedName,s.localName,s.kind);return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:s.kind==="side-effect"?!0:s.isUsed}}):null}function S(e,t){let r=A(t,b(e,t));return d(e,t).map(s=>{let o=y(s.importedName,s.localName,s.kind),n=s.kind==="side-effect"||v(t,s)||r.has(s.localName??s.importedName)?!0:s.used;return{symbol:o,shortName:o,fromFile:s.sourcePath??"(external)",importer:t,used:n}})}function A(e,t){let r=new Set;if(l(e)!=="python")return r;let s=/(?:^|\n)\s*__all__\s*(?:\+?=)\s*[[(]([\s\S]*?)[\])]/g;for(let o of t.matchAll(s)){let n=o[1]??"";for(let i of n.matchAll(/(['"])([A-Za-z_]\w*)\1/g))r.add(i[2])}return r}function v(e,t){if(l(e)!=="rust"||t.used||t.kind==="side-effect")return!1;let r=t.localName??t.importedName;return r==="_"||/^[A-Z]/.test(r)}function y(e,t,r){return r==="namespace"&&e==="*"&&t?`* as ${t}`:r==="default"&&t?`default as ${t}`:r==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function $(e){return/\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx)$/i.test(e)}export{Y as a,Z as b,G as c};
35
- //# sourceMappingURL=chunk-KA7RMBVU.js.map
35
+ //# sourceMappingURL=chunk-LJD7V7UO.js.map
@@ -1,4 +1,4 @@
1
- import{a as R}from"./chunk-RUV4KHWA.js";import{a as _,d as f}from"./chunk-5CJ6AQN7.js";import{d as l}from"./chunk-7XP7ZRSI.js";import{o as u,p,q as a}from"./chunk-JLZUM476.js";import{a as d}from"./chunk-64MNV6AB.js";import{y as m}from"./chunk-M2TRDR25.js";function $(e,o={}){let{scope:n,limit:r}=o,i=new R(e),t=D([...x(e,n),...O(e,i,n)]);return y(t),r?t.slice(0,r):t}function x(e,o){let n=[];for(let r of S(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||m(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=N(e,r),t=i?.barrel_consumers??0,s=i?.direct_consumers??0;t!==0||s!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:l(r.symbol),originalFile:r.original_path,barrelConsumers:t,directConsumers:s,...b(e,r.barrel_path)})}return n}function S(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
1
+ import{a as R}from"./chunk-ZXWFN7CK.js";import{a as _,d as f}from"./chunk-FLIF3JWA.js";import{d as l}from"./chunk-TDGCALH6.js";import{o as u,p,q as a}from"./chunk-QNMOZ3CJ.js";import{y as m}from"./chunk-M2TRDR25.js";import{a as d}from"./chunk-64MNV6AB.js";function $(e,o={}){let{scope:n,limit:r}=o,i=new R(e),t=D([...x(e,n),...O(e,i,n)]);return y(t),r?t.slice(0,r):t}function x(e,o){let n=[];for(let r of S(e,o)){if(e.isIgnored(r.barrel_path)||e.isIgnored(r.original_path)||f(e,r.barrel_path)||m(e,r.barrel_path)&&a(e,r.barrel_path).length===0)continue;let i=N(e,r),t=i?.barrel_consumers??0,s=i?.direct_consumers??0;t!==0||s!==0||n.push({barrelFile:r.barrel_path,symbol:r.symbol,shortName:l(r.symbol),originalFile:r.original_path,barrelConsumers:t,directConsumers:s,...b(e,r.barrel_path)})}return n}function S(e,o){let n=o?"AND barrel_d.relative_path LIKE ?":"",r=o?[`%${o}%`]:[];return e.all(`SELECT DISTINCT
2
2
  barrel_d.id AS barrel_doc_id,
3
3
  barrel_d.relative_path AS barrel_path,
4
4
  gs.id AS symbol_id,
@@ -58,4 +58,4 @@ import{a as R}from"./chunk-RUV4KHWA.js";import{a as _,d as f}from"./chunk-5CJ6AQ
58
58
  ${e.pathExclusionsFor("consumer_d")}
59
59
  GROUP BY consumer_d.id
60
60
  )`,o.barrel_doc_id,o.symbol_id,o.barrel_doc_id,o.original_doc_id)}function O(e,o,n){let r=[];for(let i of C(e,n))h(e,i,i)>0||r.push(...I(e,o,i));return r}function C(e,o){return d(e,{scope:o,includeIgnored:!1}).filter(n=>a(e,n).length>0||u(e,n).length>0)}function I(e,o,n){let r=a(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,[A(t.specifier)])),i=u(e,n).filter(t=>t.sourcePath&&!e.isIgnored(t.sourcePath)).flatMap(t=>g(e,o,n,t.sourcePath,t.kind==="named"&&t.names.length>0?t.names:[t.kind==="star"?`* from ${t.sourcePath}`:`* namespace from ${t.sourcePath}`]));return[...r,...i]}function g(e,o,n,r,i){let t=o.definitionsForFile(r);return i.map(s=>{let c=t.find(E=>E.leaf===s);return{barrelFile:n,symbol:c?.symbol??`source-reexport:${n}:${s}`,shortName:c?l(c.symbol):s,originalFile:r,barrelConsumers:0,directConsumers:h(e,r,n),...b(e,n)}})}function A(e){return e.split("::").at(-1)?.split("/").at(-1)?.replace(/\.[^.]+$/,"")??e}function b(e,o){return _(e,o)?{actionTier:"signal",surfaceEvidence:["barrel file is declared on the package public surface"],recommendation:"Review the package API before removing this re-export; local consumers are zero, but external consumers may import through the public barrel."}:{actionTier:"direct",surfaceEvidence:[],recommendation:"Remove this unused re-export when the barrel is not part of an external API surface."}}function h(e,o,n){let r=new Set;for(let i of d(e,{includeIgnored:!1}))if(i!==n)for(let t of p(e,i))t.sourcePath===o&&r.add(i);return r.size}function D(e){let o=new Set,n=[];for(let r of e){let i=`${r.barrelFile}|${r.symbol}|${r.originalFile}`;o.has(i)||(o.add(i),n.push(r))}return n}function y(e){e.sort((o,n)=>n.directConsumers-o.directConsumers||o.barrelFile.localeCompare(n.barrelFile)||o.shortName.localeCompare(n.shortName))}export{$ as a};
61
- //# sourceMappingURL=chunk-ROMKXEUM.js.map
61
+ //# sourceMappingURL=chunk-MDDF67O2.js.map
@@ -1,7 +1,7 @@
1
- import{a as j}from"./chunk-TAB7AWKO.js";import{a as N,b as g,c as R}from"./chunk-4QBRVI7D.js";import{a as _}from"./chunk-BGUYAA3Q.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as P}from"./chunk-RUV4KHWA.js";import{a as k}from"./chunk-BGBBVSH4.js";import{h as C}from"./chunk-KSD6IWF4.js";import{a as w}from"./chunk-MBVHEPHQ.js";import{d,e as y,k as v,z as L}from"./chunk-7XP7ZRSI.js";import{i as S}from"./chunk-JLZUM476.js";import{s as x}from"./chunk-M2TRDR25.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
1
+ import{a as j}from"./chunk-TAB7AWKO.js";import{a as N,b as g,c as R}from"./chunk-IWK562KR.js";import{a as _}from"./chunk-BGUYAA3Q.js";import{a as P}from"./chunk-ZXWFN7CK.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as k}from"./chunk-BGBBVSH4.js";import{h as C}from"./chunk-F334Z5UA.js";import{a as w}from"./chunk-UVMME4FI.js";import{d,e as y,k as v,z as L}from"./chunk-TDGCALH6.js";import{i as S}from"./chunk-QNMOZ3CJ.js";import{s as x}from"./chunk-M2TRDR25.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
2
  FROM mentions m
3
3
  JOIN chunks c ON m.chunk_id = c.id
4
4
  JOIN documents d ON c.document_id = d.id
5
5
  WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
6
6
  LIMIT 1`,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-S22ICAWV.js.map
7
+ //# sourceMappingURL=chunk-MFBXBLHA.js.map
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import{E as p,F as g,Ha as R,Jd as D,Kd as a,Od as u,Qd as j,Sa as w,Td as y,gd as P,ic as C,jd as c,kd as O,ld as L,nd as h,yd as b,z as f}from"./chunk-6AITNECC.js";var _=P,J=(o=>parseInt(o,10)),z=(o=>{let e=parseInt(o,10);if(!Number.isFinite(e)||e<1)throw new Error(`Expected a positive integer, got ${o}`);return e}),H=parseFloat,K=parseInt;function l(o,e,t,...n){return n.length>0?{flags:o,description:e,parser:t,defaultValue:n[0]}:{flags:o,description:e,parser:t}}function F(){return l("--json","Output as JSON for programmatic consumption")}function N(o=[]){return o.some(e=>e.flags==="--json")?o:[...o,F()]}function d(o,e=[]){return{category:o,examples:e}}function x(o,e){let t=p(o,e),n=A(t);for(let r of n)console.log(r)}function S(o,e,t="No results found for resolved symbol."){return p(o,e).match?t:k(e,g(o,e,5))}function v(o,e,t,n){return{...T(o,e),[n]:t}}function T(o,e){let t=p(o,e);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:f(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(n=>({shortName:n.shortName,relativePath:n.relativePath,startLine:n.startLine})),totalMatches:t.total}:{matched:!1,suggestions:g(o,e,5)}}function k(o,e){let t=`No definition matched '${o}'.`;return e.length>0?`${t} Suggestions: ${e.join(", ")}`:t}function A(o){if(!o.match||o.total<=1)return[];let e=o.match,t=Math.max(0,o.total-1),n=[`Resolved: ${f(e.symbol)} (${e.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=o.candidates.slice(0,3);return r.length>0&&n.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${c(s.startLine)})`).join("; ")}`),n.push(""),n}var B=b(({db:o,args:e,opts:t})=>{let n=a(e,0),r=u(t,"signatures"),s=w(o,n);if(u(t,"json")){y("outline",e,t,s);return}if(s.length===0)return h.empty(`No symbols found for "${n}".`);function i(M,$){for(let m of M){let I=" ".repeat($),E=r&&m.signature?` - ${V(m.signature)}`:"";console.log(`${I}${O(m.startLine,m.endLine)} ${m.shortName}${E}`),i(m.children,$+1)}}i(s,0)});function V(o){return o.length>120?`${o.slice(0,117)}...`:o}var q=D("refs",{query:({db:o,args:e,budget:t})=>R(o,a(e,0),{semantic:t.semantic}),format:o=>` line ${c(o.line)}`,before:(o,{db:e,args:t})=>x(e,a(t,0)),emptyMessage:({db:o,args:e})=>S(o,a(e,0),"No references found."),toJson:(o,{db:e,args:t})=>v(e,a(t,0),o,"references")}),G=b(({db:o,args:e,opts:t})=>{let n=a(e,0),r=C(o,n,{context:j(t,"context",0)});if(u(t,"json")){y("code",e,t,v(o,n,r,"code"));return}if(!r)return h.empty(S(o,n,"Symbol found, but source was unreadable."));x(o,n),console.log(`${L(r.relativePath,r.startLine,r.endLine)} ${r.shortName} [${r.language??"unknown"}]
2
+ import{Ba as R,E as p,F as g,Fd as D,Gd as a,Kd as u,Ma as w,Md as j,Pd as y,cd as P,ec as C,fd as c,gd as O,hd as L,jd as h,ud as b,z as f}from"./chunk-GBB2RUDN.js";var _=P,J=(o=>parseInt(o,10)),z=(o=>{let e=parseInt(o,10);if(!Number.isFinite(e)||e<1)throw new Error(`Expected a positive integer, got ${o}`);return e}),H=parseFloat,K=parseInt;function l(o,e,t,...n){return n.length>0?{flags:o,description:e,parser:t,defaultValue:n[0]}:{flags:o,description:e,parser:t}}function F(){return l("--json","Output as JSON for programmatic consumption")}function N(o=[]){return o.some(e=>e.flags==="--json")?o:[...o,F()]}function d(o,e=[]){return{category:o,examples:e}}function x(o,e){let t=p(o,e),n=A(t);for(let r of n)console.log(r)}function S(o,e,t="No results found for resolved symbol."){return p(o,e).match?t:k(e,g(o,e,5))}function v(o,e,t,n){return{...T(o,e),[n]:t}}function T(o,e){let t=p(o,e);return t.match?{matched:!0,resolved:{symbol:t.match.symbol,shortName:f(t.match.symbol),relativePath:t.match.relativePath},otherMatches:t.candidates.map(n=>({shortName:n.shortName,relativePath:n.relativePath,startLine:n.startLine})),totalMatches:t.total}:{matched:!1,suggestions:g(o,e,5)}}function k(o,e){let t=`No definition matched '${o}'.`;return e.length>0?`${t} Suggestions: ${e.join(", ")}`:t}function A(o){if(!o.match||o.total<=1)return[];let e=o.match,t=Math.max(0,o.total-1),n=[`Resolved: ${f(e.symbol)} (${e.relativePath}) -- ${t} other definition(s) share this name; qualify as <dir/leaf> to target another.`],r=o.candidates.slice(0,3);return r.length>0&&n.push(`Alternates: ${r.map(s=>`${s.shortName} (${s.relativePath}:${c(s.startLine)})`).join("; ")}`),n.push(""),n}var B=b(({db:o,args:e,opts:t})=>{let n=a(e,0),r=u(t,"signatures"),s=w(o,n);if(u(t,"json")){y("outline",e,t,s);return}if(s.length===0)return h.empty(`No symbols found for "${n}".`);function i(M,$){for(let m of M){let I=" ".repeat($),E=r&&m.signature?` - ${V(m.signature)}`:"";console.log(`${I}${O(m.startLine,m.endLine)} ${m.shortName}${E}`),i(m.children,$+1)}}i(s,0)});function V(o){return o.length>120?`${o.slice(0,117)}...`:o}var q=D("refs",{query:({db:o,args:e,budget:t})=>R(o,a(e,0),{semantic:t.semantic}),format:o=>` line ${c(o.line)}`,before:(o,{db:e,args:t})=>x(e,a(t,0)),emptyMessage:({db:o,args:e})=>S(o,a(e,0),"No references found."),toJson:(o,{db:e,args:t})=>v(e,a(t,0),o,"references")}),G=b(({db:o,args:e,opts:t})=>{let n=a(e,0),r=C(o,n,{context:j(t,"context",0)});if(u(t,"json")){y("code",e,t,v(o,n,r,"code"));return}if(!r)return h.empty(S(o,n,"Symbol found, but source was unreadable."));x(o,n),console.log(`${L(r.relativePath,r.startLine,r.endLine)} ${r.shortName} [${r.language??"unknown"}]
3
3
  `);let s=r.source.split(`
4
4
  `);for(let i=0;i<s.length;i++)console.log(` ${String(c(r.startLine+i)).padStart(4)} ${s[i]}`)}),ao=[{id:"refs",command:"refs <symbol>",description:"Find all files referencing a symbol",options:[l("--full","Run unbounded semantic analysis on large indexes"),l("--json","Output as JSON for programmatic consumption")],budget:"semantic",renderShape:"grouped-by-file",docs:d("Navigation",["scip-query refs login"]),handler:q},{id:"outline",command:"outline <file>",description:"Tree view of symbols in a file, with line ranges",options:N([l("--signatures","Show trimmed symbol signatures")]),renderShape:"custom",docs:d("Navigation"),handler:B},{id:"code",command:"code <symbol>",description:"Read the source code for a symbol (bounded to its definition range)",options:N([l("-C, --context <n>","Extra lines of context above/below",J,0)]),renderShape:"custom",docs:d("Navigation"),handler:G}];export{_ as a,J as b,z as c,H as d,K as e,l as f,F as g,N as h,d as i,x as j,S as k,v as l,T as m,ao as n};
5
- //# sourceMappingURL=chunk-A2GX3PYV.js.map
5
+ //# sourceMappingURL=chunk-MTFHE7ZO.js.map
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import{Bc as Y,Cc as Q,Pc as X,Qc as Z,V as y,W as k,Wc as ee,b as B,ca as F,da as H,fa as w,ga as T,ha as b,ic as C,ja as _,jc as J,ka as U,kc as K,la as z,oa as L}from"./chunk-GBB2RUDN.js";import{spawn as me}from"child_process";import{closeSync as ke,existsSync as we,mkdirSync as Ie,openSync as We,readFileSync as ie,rmSync as I,writeFileSync as Re}from"fs";import{dirname as be,resolve as E}from"path";import{fileURLToPath as Ce}from"url";var te=5e3,Ae=2e3,oe=10,Pe=new Set(["bench","config-validate","hook-context","hook-stop","init","reindex","setup","setup-agent","setup-ci","setup-hooks","uninstall","watch","work-audit"]);function ze(e){let t=e.classification;if(t.kind!=="live")return;let{state:r}=t;return r.watcher.state==="idle"&&r.lastError===void 0?r.indexGeneration:void 0}function Ee(e,t=process.env){return t.SCIP_QUERY_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!Pe.has(e)}function Je(e){let t=e.env??process.env;if(t.SCIP_QUERY_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!Ee(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let r=xe({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:r.disposition,state:r.state}}catch(r){return{kind:"failed",message:r instanceof Error?r.message:String(r)}}}function se(e,t,r){let n=L(E(e));if(r&&L(r.projectRoot)===n)return{projectRoot:n,worktreeKind:"git",worktreeId:r.worktreeId,cliVersion:t};let i=U(n);if(i.kind==="error")throw new Error(`Could not establish Git worktree identity for ${n}: ${i.message}`);return i.kind==="non-git"?{projectRoot:n,worktreeKind:"non-git",cliVersion:t}:{projectRoot:n,worktreeKind:"git",worktreeId:i.identity.worktreeId,cliVersion:t}}function Ke(e){return P(e,se(e.projectRoot,e.cliVersion,e.gitContext))}function P(e,t){let r=e.runtime??O,n=w(e.cacheDir),i=T(n.statePath),s=m(n.lockPath);return{identity:t,classification:_e(i,t,r.now(),r.isProcessAlive),lock:s,lockIsLive:s!==null&&r.isProcessAlive(s.pid),paths:n}}function xe(e){let t=e.runtime??O,r=se(e.projectRoot,e.cliVersion,e.gitContext),n=P(e,r),i=G("ensure",n.classification);if(i.kind==="reuse")return A(n.paths.activityPath,t.now()),{disposition:"reused",state:i.state};if(i.kind==="replace")M(i.state.pid,e,t),W(n.paths,i.state.pid,t);else if(i.kind==="start"){if(n.lockIsLive){let o=re(e,r,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(o)return A(n.paths.activityPath,t.now()),{disposition:"reused",state:o};throw new Error(`scip-query watch is already running for ${E(e.projectRoot)} (pid ${n.lock?.pid}; lock: ${n.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}n.classification.kind==="stale"&&W(n.paths,n.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${i.kind}`);if(n=P(e,r),i=G("ensure",n.classification),i.kind==="reuse")return A(n.paths.activityPath,t.now()),{disposition:"reused",state:i.state};let s=e.serverPath??Ce(new URL("./watch-server.js",import.meta.url));t.spawnServer(s,r.projectRoot,e.cliVersion,e.watchOverrides??{});let a=re(e,r,t,e.startupTimeoutMs??te);if(!a)throw new Error(`scip-query watch service did not become ready within ${e.startupTimeoutMs??te}ms.`);return A(n.paths.activityPath,t.now()),{disposition:"started",state:a}}function ae(e){let t=e.runtime??O,r=w(e.cacheDir),n=T(r.statePath),i=n?t.isProcessAlive(n.pid)?{kind:"live",state:n}:{kind:"stale",state:n,reason:"dead-process"}:{kind:"stopped"},s=G("stop",i);if(s.kind==="signal-stop")return M(s.state.pid,e,t),W(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};if(s.kind==="clean-stale")return W(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};let a=m(r.lockPath);return s.kind==="already-stopped"&&a&&t.isProcessAlive(a.pid)?(M(a.pid,e,t),W(r,a.pid,t),{disposition:"stopped",pid:a.pid}):{disposition:"already-stopped"}}function A(e,t=Date.now()){let r=Te(e);k(e,{version:1,at:new Date(t).toISOString(),...r?.refreshRequestedAtMs===void 0?{}:{refreshRequestedAt:new Date(r.refreshRequestedAtMs).toISOString(),...r.refreshDetail?{refreshDetail:r.refreshDetail}:{}}})}function Ye(e,t,r=Date.now()){k(e,{version:1,at:new Date(r).toISOString(),refreshRequestedAt:new Date(r).toISOString(),refreshDetail:t})}function Te(e){try{let t=JSON.parse(ie(e,"utf8"));return t.version!==1||!b(t.at)||t.refreshRequestedAt!==void 0&&!b(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function Qe(e,t,r={}){let n=r.pid??process.pid,i=r.isProcessAlive??y,s=()=>{},a=m(e);if(a&&i(a.pid))return{acquired:!1,lockPath:e,message:ne(e,t,a),release:s};a&&I(e,{force:!0}),Ie(be(e),{recursive:!0});let o;try{o=We(e,"wx")}catch(d){if(Le(d)==="EEXIST")return{acquired:!1,lockPath:e,message:ne(e,t,m(e)),release:s};throw d}let l={version:1,pid:n,projectRoot:E(t),startedAt:(r.now??(()=>new Date))().toISOString()};Re(o,`${JSON.stringify(l)}
3
+ `);let c=!1;return{acquired:!0,lockPath:e,message:"",release:()=>{if(c)return;c=!0,ke(o);let d=m(e);d?.pid===l.pid&&d.startedAt===l.startedAt&&I(e,{force:!0})}}}function m(e){try{let t=JSON.parse(ie(e,"utf-8"));return t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!b(t.startedAt)?null:t}catch{return null}}function _e(e,t,r,n){if(!e)return{kind:"stopped"};if(e.protocolVersion!==F)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let i=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==i)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!n(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let s=Date.parse(e.heartbeatAt);return r-s>H?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function G(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"replace",state:t.state}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return D(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return D(t)}default:return D(e)}}function re(e,t,r,n){let i=r.now()+n;for(;r.now()<=i;){let s=P(e,t).classification;if(s.kind==="live")return s.state;r.sleep(oe)}return null}function M(e,t,r){if(!r.isProcessAlive(e))return;r.signalProcess(e);let n=t.stopTimeoutMs??Ae,i=r.now()+n;for(;r.now()<=i;){if(!r.isProcessAlive(e))return;r.sleep(oe)}throw new Error(`scip-query watch service pid ${e} did not stop within ${n}ms.`)}function W(e,t,r){I(e.statePath,{force:!0}),I(e.activityPath,{force:!0}),m(e.lockPath)?.pid===t&&!r.isProcessAlive(t)&&I(e.lockPath,{force:!0})}function ne(e,t,r){return`error: scip-query watch is already running for ${E(t)}${r?` (pid ${r.pid}, started ${r.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function Le(e){return typeof e=="object"&&e&&"code"in e?e.code:void 0}var O={now:Date.now,isProcessAlive:y,spawnServer(e,t,r,n){if(!we(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);me(process.execPath,[e,t,r,JSON.stringify(n)],{detached:!0,stdio:"ignore",env:{...process.env,SCIP_QUERY_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function D(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}import{existsSync as ue,lstatSync as x,readFileSync as N,readdirSync as pe,realpathSync as ce,rmSync as R,statSync as he}from"fs";import{join as h,resolve as g,sep as de}from"path";var De=3600*1e3,Ge=2*1024*1024*1024,Me=300*1e3;function Oe(e){let t=e.leases.filter(o=>o.managed&&!o.live&&!o.busy),r=fe(e.leases,e.locks),n={};for(let o of e.generations)r.has(o.generationId)||(n[o.generationId]=o.unreferencedAt??e.nowMs);let i=e.generations.filter(o=>!r.has(o.generationId)).sort((o,l)=>n[o.generationId]-n[l.generationId]||o.generationId.localeCompare(l.generationId)),s=new Set;for(let o of i)e.nowMs-n[o.generationId]>=e.policy.generationTtlMs&&s.add(o.generationId);let a=e.generations.filter(o=>!s.has(o.generationId)).reduce((o,l)=>o+l.size,0);for(let o of i){if(a<=e.policy.budgetBytes)break;s.has(o.generationId)||(s.add(o.generationId),a-=o.size)}for(let o of s)delete n[o];return{deleteWorktrees:t,deleteGenerations:e.generations.filter(o=>s.has(o.generationId)),deleteLocks:e.locks.filter(o=>!o.live),deleteTemporaries:e.temporaries.filter(o=>!o.live),protectedGenerationIds:[...r].sort(),unreferencedSince:n}}function fe(e,t){let r=new Set(e.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of t)n.live&&r.add(n.generationId);return r}function lt(e,t,r={}){if(!K())return{kind:"disabled"};let n=_(e);if(!n)return{kind:"unavailable"};let i=h(C(),"repositories",n.repositoryId);if(!ue(i))return{kind:"unavailable"};let s=(r.now??Date.now)(),a=h(i,"gc-state.json"),o=ge(a);if(!r.force&&o&&s-Date.parse(o.lastSweepAt)<Me)return{kind:"throttled",sweptAt:o.lastSweepAt};let l=Y(i,{now:()=>s});if(!l)return{kind:"busy"};try{let c=Se(e,i,n.repositoryId,o?.unreferencedSince??{}),d=Oe({nowMs:s,...c,policy:{generationTtlMs:r.policy?.generationTtlMs??De,budgetBytes:r.policy?.budgetBytes??Ge}}),u=0,f=0;for(let p of d.deleteWorktrees){if(!ve(p.lease))continue;let q=Q(h(p.lease.localCacheDir,"cache-lifecycle.lock"));if(q)try{if(V(p.lease,!0))continue;try{ae({projectRoot:p.lease.projectRoot,cacheDir:p.lease.localCacheDir,cliVersion:t})}catch{continue}if(V(p.lease,!0))continue;R(p.lease.localCacheDir,{recursive:!0,force:!0}),R(p.leasePath,{force:!0}),f+=1}finally{q.release()}}for(let p of d.deleteLocks)R(p.path,{force:!0});for(let p of d.deleteTemporaries)R(p.path,{recursive:!0,force:!0});for(let p of d.deleteGenerations)R(p.path,{recursive:!0,force:!0}),u+=p.size;B(h(i,"evidence.db"));let v={kind:"swept",sweptAt:new Date(s).toISOString(),deletedWorktrees:f,deletedGenerations:d.deleteGenerations.length,deletedBytes:u,protectedGenerations:d.protectedGenerationIds.length},S={version:1,lastSweepAt:v.sweptAt,unreferencedSince:d.unreferencedSince,lastResult:v};return k(a,S,{spacing:2,trailingNewline:!0}),v}catch(c){return{kind:"failed",error:c instanceof Error?c.message:String(c)}}finally{l.release()}}function ut(e,t,r){let n=X(e,r.dbPath,t);if(n)return{state:"bypassed",reason:n,localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=_(e);if(!i)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let s=h(C(),"repositories",i.repositoryId),a=ye(h(s,"worktrees",`${i.worktreeId}.json`)),o=ge(h(s,"gc-state.json")),l=Se(e,s,i.repositoryId,o?.unreferencedSince??{}),c=fe(l.leases,l.locks),d=l.generations.filter(S=>!c.has(S.generationId)),u=l.generations.reduce((S,p)=>S+p.size,0),f=Z(e,t),v=0;return f&&(v=je(f)),{state:"managed",repositoryId:i.repositoryId,worktreeId:i.worktreeId,localCacheDir:r.cacheDir,...a?{baseGenerationId:a.baseGenerationId,activeGenerationId:a.activeGenerationId,lastAction:a.lastAction,reason:a.lastReason,lastSeenAt:a.lastSeenAt}:{},generations:l.generations.length,generationBytes:u,protectedGenerations:l.generations.filter(S=>c.has(S.generationId)).length,unreferencedGenerations:d.length,unreferencedBytes:d.reduce((S,p)=>S+p.size,0),temporaryGenerations:l.temporaries.length,sharedEvidence:{path:f,exists:v>0,bytes:v},cleanup:o?.lastResult}}function je(e){return[e,`${e}-wal`,`${e}-shm`].reduce((t,r)=>{try{return t+he(r).size}catch{return t}},0)}function Se(e,t,r,n){let i=new Set(z(e).map(c=>g(c.path))),s=[];for(let c of j(h(t,"worktrees"))){if(!c.endsWith(".json"))continue;let d=h(t,"worktrees",c),u=ye(d);if(!u)continue;let f=g(u.projectRoot);s.push({leasePath:d,lease:u,managed:u.repositoryId===r&&ve(u),live:i.has(f)||ue(f),busy:V(u)})}let a=[];for(let c of j(h(t,"locks"))){let d=/^([a-f0-9]{64})\.lock$/.exec(c);if(!d)continue;let u=h(t,"locks",c),f=$(u),v=f!==void 0&&y(f),S=d[1];a.push({generationId:S,path:u,live:v})}let o=[],l=[];for(let c of j(h(t,"generations"))){let d=/^\.tmp-(\d+)-/.exec(c);if(d){let v=h(t,"generations",c),S=Number(d[1]);try{l.push({path:v,size:le(v),live:Number.isSafeInteger(S)&&y(S)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(c))continue;let u=h(t,"generations",c),f;try{f=x(u)}catch{continue}!f.isDirectory()||f.isSymbolicLink()||o.push({generationId:c,path:u,size:le(u),...n[c]===void 0?{}:{unreferencedAt:n[c]}})}return{leases:s,generations:o,locks:a,temporaries:l}}function ve(e){if(e.ownershipChecksum!==ee(e)||g(e.localCacheDir)!==g(J(e.projectRoot)))return!1;let t=g(C()),r=g(h(t,"projects")),n=g(e.localCacheDir);if(!n.startsWith(`${r}${de}`))return!1;try{let i=x(t),s=x(r),a=x(n);if(!i.isDirectory()||i.isSymbolicLink()||!s.isDirectory()||s.isSymbolicLink()||!a.isDirectory()||a.isSymbolicLink())return!1;let o=ce(r);return ce(n).startsWith(`${o}${de}`)}catch{return!1}}function V(e,t=!1){for(let n of t?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let i=$(h(e.localCacheDir,n));if(i!==void 0&&y(i))return!0}let r=$(w(e.localCacheDir).lockPath);return r!==void 0&&y(r)}function ye(e){try{let t=JSON.parse(N(e,"utf8"));return t.version!==1||typeof t.repositoryId!="string"||typeof t.worktreeId!="string"||typeof t.projectRoot!="string"||t.treeOid!==void 0&&typeof t.treeOid!="string"||typeof t.localCacheDir!="string"||t.baseGenerationId!==void 0&&typeof t.baseGenerationId!="string"||t.activeGenerationId!==void 0&&typeof t.activeGenerationId!="string"||typeof t.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(t.ownershipChecksum)||typeof t.lastAction!="string"||t.lastReason!==void 0&&typeof t.lastReason!="string"||typeof t.lastSeenAt!="string"?null:t}catch{return null}}function $(e){try{let t=JSON.parse(N(e,"utf8"));return typeof t.pid=="number"&&Number.isSafeInteger(t.pid)&&t.pid>0?t.pid:void 0}catch{return}}function ge(e){try{let t=JSON.parse(N(e,"utf8"));return t.version!==1||typeof t.lastSweepAt!="string"||!Number.isFinite(Date.parse(t.lastSweepAt))||!t.unreferencedSince||typeof t.unreferencedSince!="object"||!t.lastResult?null:t}catch{return null}}function j(e){try{return pe(e)}catch{return[]}}function le(e){let t=0,r=[e];for(;r.length>0;){let n=r.pop();for(let i of pe(n,{withFileTypes:!0})){let s=h(n,i.name);i.isDirectory()?r.push(s):i.isFile()&&(t+=he(s).size)}}return t}export{ze as a,Ee as b,Je as c,Ke as d,xe as e,ae as f,Ye as g,Qe as h,lt as i,ut as j};
4
+ //# sourceMappingURL=chunk-NEG77KKH.js.map
@@ -1,4 +1,4 @@
1
- import s from"better-sqlite3";var i=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],r=class{db;config;pathFilter;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null,this.db=new s(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000"),this.db.pragma("query_only = ON"),this.db.pragma("temp_store = MEMORY"),this.db.pragma("cache_size = -64000"),this.db.pragma("mmap_size = 268435456")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
1
+ import n from"better-sqlite3";var i=["node_modules",".git","dist","build","out","coverage","target",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs",".scipquery-cache","__pycache__",".venv","venv"],s=class{db;config;pathFilter;statementCache=new Map;constructor(t,e){this.config=t,this.pathFilter=e??null,this.db=new n(t.dbPath,{readonly:!0}),this.db.pragma("busy_timeout = 5000"),this.db.pragma("query_only = ON"),this.db.pragma("temp_store = MEMORY"),this.db.pragma("cache_size = -64000"),this.db.pragma("mmap_size = 268435456")}isIgnored(t){return this.pathFilter?.isIgnored(t)??!1}get localSymbolPredicate(){return`(
2
2
  EXISTS (
3
3
  SELECT 1
4
4
  FROM defn_enclosing_ranges local_der
@@ -16,5 +16,5 @@ import s from"better-sqlite3";var i=["node_modules",".git","dist","build","out",
16
16
  ${this.pathExclusionsFor("local_d").trimStart()}
17
17
  )
18
18
  )`}get pathExclusions(){return this.pathExclusionsFor("d")}get symbolNoise(){return this.symbolNoiseFor("gs")}pathExclusionsFor(...t){return t.flatMap(e=>i.flatMap(a=>[`AND ${e}.relative_path NOT LIKE '${a}/%'`,`AND ${e}.relative_path NOT LIKE '%/${a}/%'`])).join(`
19
- `)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.db.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.db.prepare(t),this.statementCache.set(t,e)),e}};export{r as a};
20
- //# sourceMappingURL=chunk-WA64GKWB.js.map
19
+ `)}symbolNoiseFor(t){return`AND ${t}.symbol NOT LIKE '%().(%' AND ${t}.symbol NOT LIKE '%typeLiteral%'`}all(t,...e){return this.statement(t).all(...e)}get(t,...e){return this.statement(t).get(...e)}close(){this.statementCache.clear(),this.db.close()}statement(t){let e=this.statementCache.get(t);return e||(e=this.db.prepare(t),this.statementCache.set(t,e)),e}};export{s as a};
20
+ //# sourceMappingURL=chunk-NH7WNNQC.js.map
@@ -1,2 +1,2 @@
1
- import{a as C,b as B}from"./chunk-XKWEMFHP.js";import{a as R,c as P,e as a,f}from"./chunk-B3X6KU75.js";import{a as v,b as h,c as k}from"./chunk-KMVGRIO2.js";import{N as g}from"./chunk-TLTLJ4SW.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=C(c,t=>t.tokens);return B({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,tokenCountA:e.tokens.size,tokenCountB:o.tokens.size,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return P([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return R({genericWords:w,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var w=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{D as a};
2
- //# sourceMappingURL=chunk-K3UVTL3J.js.map
1
+ import{a as C,b as B}from"./chunk-XKWEMFHP.js";import{a as R,c as P,e as a,f}from"./chunk-B3X6KU75.js";import{a as v,b as h,c as k}from"./chunk-KMVGRIO2.js";import{N as g}from"./chunk-XDSB47KO.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=C(c,t=>t.tokens);return B({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,tokenCountA:e.tokens.size,tokenCountB:o.tokens.size,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return P([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return R({genericWords:w,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var w=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{D as a};
2
+ //# sourceMappingURL=chunk-OGHGTD6Z.js.map
@@ -0,0 +1,2 @@
1
+ import{b as r}from"./chunk-DV6B262O.js";import{x as e}from"./chunk-TDGCALH6.js";function l(t,s){let o=r(t,s);return e(t,o).map(({relativePath:n,...a})=>a)}export{l as a};
2
+ //# sourceMappingURL=chunk-OYYZLJVT.js.map
@@ -1,4 +1,4 @@
1
- import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-RUV4KHWA.js";import{f as N}from"./chunk-KSD6IWF4.js";import{j as M}from"./chunk-NJD4C5G5.js";import{d as w,g as y,i as x}from"./chunk-7XP7ZRSI.js";import{E as R}from"./chunk-TLTLJ4SW.js";import{execFileSync as g}from"child_process";import{existsSync as U,readFileSync as j}from"fs";import{basename as A}from"path";var q="Unable to compute git diff.";function Ne(e,n={}){let i=n.plan??H(e,n);return i.note?Y(i.note,i.changedFileLines):i.changedFiles.length===0?V(i.changedFileLines):Z(i.changedFiles,[J(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function H(e,n={}){let{base:i="HEAD"}=n;try{let t=K(e.config.projectRoot,i),r=t.changedFileLines,s=ie(e,r),a=re(e,t.changedRanges);return{changedFileLines:r,changedFiles:s,changedRanges:a,renamedFiles:ee(e.config.projectRoot,i,s,t),note:r.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:q}}}function J(e,n,i,t=[]){let r=new _(e),s=new Set(i),a=v(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(be),d=u.filter(f=>oe(f,a)),l=le(e,u,d,a),m=fe([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=pe(e,p),z=he(e,p,i),C=m.filter(f=>(F.get(f.symbolId)??0)===0),I=E(()=>M(e,C)),W=C.filter(f=>(I.get(f.symbolId)?.size??0)===0),G=E(()=>N(e,W));for(let f of m)ge(e,f,s,o,c,I.get(f.symbolId)??new Set,G.get(f.symbolId)??new Set,F.get(f.symbolId)??0,z.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Z(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=ye(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function Y(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function V(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function K(e,n){let i=g("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ne([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...T(r)])],changedRanges:O([...P(s),...P(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function L(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function _e(e,n,i=[]){let t=Q(e,n,i);return r=>(t.has(r)||t.set(r,L(e,n,r)),t.get(r)??null)}function ve(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function Q(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=t.map(o=>`${n}:./${o}
1
+ import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-ZXWFN7CK.js";import{f as M}from"./chunk-F334Z5UA.js";import{j as N}from"./chunk-QB5WSOTY.js";import{d as w,g as y,i as x}from"./chunk-TDGCALH6.js";import{E as R}from"./chunk-XDSB47KO.js";import{execFileSync as g}from"child_process";import{existsSync as U,readFileSync as j}from"fs";import{basename as A}from"path";var q="Unable to compute git diff.";function Ne(e,n={}){let i=n.plan??H(e,n);return i.note?Y(i.note,i.changedFileLines):i.changedFiles.length===0?V(i.changedFileLines):Z(i.changedFiles,[J(e,i.changedFiles,i.changedFiles,i.changedRanges)])}function H(e,n={}){let{base:i="HEAD"}=n;try{let t=K(e.config.projectRoot,i),r=t.changedFileLines,s=ie(e,r),a=re(e,t.changedRanges);return{changedFileLines:r,changedFiles:s,changedRanges:a,renamedFiles:ee(e.config.projectRoot,i,s,t),note:r.length===0?"No changed files found.":void 0}}catch{return{changedFileLines:[],changedFiles:[],changedRanges:[],renamedFiles:[],note:q}}}function J(e,n,i,t=[]){let r=new _(e),s=new Set(i),a=v(t),o=[],c=new Map,u=n.flatMap(f=>r.definitionsForFile(f)).filter(be),d=u.filter(f=>oe(f,a)),l=le(e,u,d,a),m=fe([...d,...l.definitions]).sort((f,h)=>f.relativePath.localeCompare(h.relativePath)||f.startLine-h.startLine),p=m.map(f=>f.symbolId),F=pe(e,p),z=he(e,p,i),C=m.filter(f=>(F.get(f.symbolId)??0)===0),I=E(()=>N(e,C)),W=C.filter(f=>(I.get(f.symbolId)?.size??0)===0),G=E(()=>M(e,W));for(let f of m)ge(e,f,s,o,c,I.get(f.symbolId)??new Set,G.get(f.symbolId)??new Set,F.get(f.symbolId)??0,z.get(f.symbolId)??new Set);return{changedSymbols:o,consumerEntries:[...c.entries()].map(([f,h])=>({file:f,symbols:[...h].sort()})),attributionNotes:l.notes}}function Z(e,n){let i=new Map,t=n.flatMap(a=>a.changedSymbols),r=n.flatMap(a=>a.attributionNotes??[]);for(let a of n)for(let o of a.consumerEntries){let c=i.get(o.file);c||(c=new Set,i.set(o.file,c));for(let u of o.symbols)c.add(u)}let s=ye(i);return{changedFiles:[...e],changedSymbols:t,affectedConsumers:s,attributionNotes:r,summary:{totalChangedFiles:e.length,totalChangedSymbols:t.length,totalAffectedFiles:s.length}}}function Y(e,n=[]){return{changedFiles:n,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:n.length,totalChangedSymbols:0,totalAffectedFiles:0,note:e}}}function V(e){return{changedFiles:e,changedSymbols:[],affectedConsumers:[],attributionNotes:[],summary:{totalChangedFiles:e.length,totalChangedSymbols:0,totalAffectedFiles:0,note:"Changed files are not present in the current SCIP index."}}}function K(e,n){let i=g("git",["diff","--name-status","--find-renames",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:67108864}),t=g("git",["diff","--name-status","--find-renames","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),r=g("git",["ls-files","--others","--exclude-standard"],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),s=g("git",["diff","--unified=0",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),a=g("git",["diff","--unified=0","--cached",n],{encoding:"utf-8",cwd:e,timeout:3e4,maxBuffer:64*1024*1024}),o=ne([i,t]);return{changedFileLines:[...new Set([...o.changedFiles,...T(r)])],changedRanges:O([...P(s),...P(a)]),renamedFiles:o.renamedFiles,deletedFiles:o.deletedFiles}}function L(e,n,i){try{return g("git",["show",`${n}:./${i}`],{encoding:"utf-8",cwd:e,timeout:1e4,stdio:["ignore","pipe","ignore"]})}catch{return null}}function _e(e,n,i=[]){let t=Q(e,n,i);return r=>(t.has(r)||t.set(r,L(e,n,r)),t.get(r)??null)}function ve(e,n=e.changedFiles){let i=new Map(e.renamedFiles.map(t=>[t.to,t.from]));return[...new Set(n.map(t=>i.get(t)??t))]}function Q(e,n,i){let t=[...new Set(i)],r=new Map;if(t.length===0)return r;try{let s=t.map(o=>`${n}:./${o}
2
2
  `).join(""),a=g("git",["cat-file","--batch"],{cwd:e,input:s,maxBuffer:256*1024*1024,timeout:1e4,stdio:["pipe","pipe","ignore"]});return X(a,t)}catch{for(let s of t)r.set(s,L(e,n,s));return r}}function X(e,n){let i=new Map,t=0;for(let r of n){let s=e.indexOf(10,t);if(s<0)throw new Error("git cat-file batch output ended before object header");let a=e.subarray(t,s).toString("utf-8");if(t=s+1,a.endsWith(" missing")){i.set(r,null);continue}let o=/^[0-9a-f]+ ([^ ]+) (\d+)$/.exec(a);if(!o)throw new Error(`unexpected git cat-file batch header: ${a}`);let[,c,u]=o,d=Number(u);if(!Number.isFinite(d)||d<0)throw new Error(`unexpected git cat-file batch size: ${a}`);if(t+d>e.length)throw new Error("git cat-file batch output ended before blob payload");let l=e.subarray(t,t+d);i.set(r,c==="blob"?l.toString("utf-8"):null),t+=d,e[t]===10&&(t+=1)}return i}function ee(e,n,i,t){if(i.length===0)return[];let r=new Map,s=new Set;for(let o of t.renamedFiles)i.includes(o.to)&&(r.set(o.to,o),s.add(o.from));let a=t.deletedFiles;if(a.length===0)return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to));for(let o of i){if(r.has(o)||!U(`${e}/${o}`))continue;let c=a.filter(l=>!s.has(l)).filter(l=>A(l)===A(o));if(c.length===0)continue;let u=j(`${e}/${o}`,"utf-8"),d=c.map(l=>({from:l,to:o,similarity:te(L(e,n,l)??"",u)})).sort((l,m)=>m.similarity-l.similarity)[0];d&&d.similarity>=.45&&(r.set(o,d),s.add(d.from))}return[...r.values()].sort((o,c)=>o.to.localeCompare(c.to))}function ne(e){let n=new Set,i=new Map,t=new Set;for(let r of e.flatMap(s=>T(s))){let[s,a,o]=r.split(" ");if(!(!s||!a)){if(s.startsWith("R")&&o){n.add(o),i.set(o,{from:a,to:o,similarity:Number(s.slice(1))/100});continue}n.add(a),s.startsWith("D")&&t.add(a)}}return{changedFiles:[...n],renamedFiles:[...i.values()],deletedFiles:[...t]}}function te(e,n){let i=new Set(B(e)),t=new Set(B(n));if(i.size===0&&t.size===0)return 1;if(i.size===0||t.size===0)return 0;let r=0;for(let s of i)t.has(s)&&(r+=1);return 2*r/(i.size+t.size)}function B(e){return e.match(/[A-Za-z_$][\w$]*|[{}()[\].,]/g)??[]}function T(e){return e.split(`
3
3
  `).map(n=>n.trim()).filter(n=>n.length>0)}function ie(e,n){let i=$(e),t=[];for(let r of n){let s=i(r);s&&!e.isIgnored(s)&&t.push(s)}return t}function re(e,n){let i=$(e),t=[];for(let r of n){let s=i(r.file);s&&!e.isIgnored(s)&&t.push({...r,file:s})}return O(t)}function $(e){let n=e.all(`SELECT relative_path FROM documents
4
4
  ORDER BY id`).map(t=>t.relative_path),i=new Map(n.map(t=>[t,t]));return t=>{let r=t.replace(/\\/g,"/"),s=i.get(r);return s||(n.find(a=>a.endsWith(r))??null)}}function P(e){let n=[],i=null;for(let t of e.split(`
@@ -15,4 +15,4 @@ import{a as v}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-RUV4KHWA.js";
15
15
  AND m.role != 1
16
16
  AND ref_d.relative_path NOT IN (${i.map(()=>"?").join(",")})
17
17
  ${e.pathExclusionsFor("ref_d")}`,...n,...i),r=new Map;for(let s of t){let a=r.get(s.symbol_id);a||(a=new Set,r.set(s.symbol_id,a)),a.add(s.relative_path)}return r}function S(e,n,i,t,r){if(e.isIgnored(t)||n.has(t))return;let s=i.get(t);s||(s=new Set,i.set(t,s)),s.add(r)}function ye(e){return[...e.entries()].map(([n,i])=>({file:n,consumedSymbols:i.size})).sort((n,i)=>i.consumedSymbols-n.consumedSymbols)}function be(e){return!(x(e.symbol)||e.parentTypeName!==null&&!y(e.symbol))}function Se(e,n){return y(e.symbol)||e.isTypeLike?!0:e.parentTypeName===null&&n>0}export{q as a,Ne as b,H as c,J as d,Z as e,L as f,_e as g,ve as h,Q as i,ae as j};
18
- //# sourceMappingURL=chunk-DJI446FQ.js.map
18
+ //# sourceMappingURL=chunk-PAZFJMXB.js.map
@@ -1,2 +1,2 @@
1
- import{a as C,b}from"./chunk-XKWEMFHP.js";import{a as P,c as y,e as r,f}from"./chunk-B3X6KU75.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{N as v}from"./chunk-TLTLJ4SW.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=C(s,t=>t.tokens);return b({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return y([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return P({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
2
- //# sourceMappingURL=chunk-U244OVE6.js.map
1
+ import{a as C,b}from"./chunk-XKWEMFHP.js";import{a as P,c as y,e as r,f}from"./chunk-B3X6KU75.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{N as v}from"./chunk-XDSB47KO.js";function L(e,i={}){let{minSimilarity:o=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=B(e,{scope:l,minTokens:n,scanLimit:u}),p=C(s,t=>t.tokens);return b({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,o),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function B(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(o=>({file:o.file,tokens:o.templateTokens,loc:T(o)}))}function T(e){return e.totalLines}function V(e,i,o){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<o)return null;let l=r(n,"component:"),u=r(n,"prop:"),m=r(n,"event:"),d=r(n,"directive:"),s=r(n,"slot:"),p=r(n,"id:"),t=S({sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p});return{fileA:e.file,fileB:i.file,similarity:c,tokenCountA:e.tokens.size,tokenCountB:i.tokens.size,sharedTokens:f(n),sharedComponents:l,sharedProps:u,sharedEvents:m,sharedDirectives:d,sharedSlots:s,sharedIdentifiers:p,evidenceClass:t.evidenceClass,actionTier:t.actionTier,evidenceClassReasons:t.reasons,recommendation:t.recommendation,uniqueToA:f(h(e.tokens,i.tokens)).slice(0,25),uniqueToB:f(h(i.tokens,e.tokens)).slice(0,25),locA:e.loc,locB:i.loc}}function R(e){let i=0,o=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(o+=1);return y([{name:"component",count:i},{name:"behavior",count:o}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return P({genericWords:x,primitiveGroups:[{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"},{values:e.sharedDirectives,reasonPrefix:"shared directives",bucket:"generic"},{values:e.sharedSlots,reasonPrefix:"shared slots",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedIdentifiers,label:"shared identifier",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific Vue primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{L as a};
2
+ //# sourceMappingURL=chunk-PBADFBRR.js.map
@@ -1,2 +1,2 @@
1
- import{E as s}from"./chunk-TLTLJ4SW.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
- //# sourceMappingURL=chunk-UWR52GNZ.js.map
1
+ import{E as s}from"./chunk-XDSB47KO.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
2
+ //# sourceMappingURL=chunk-PKAPOFF5.js.map
@@ -1,4 +1,4 @@
1
- import{b as w}from"./chunk-C7MBQSIC.js";import{b as g}from"./chunk-6JSTKSZH.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{d as u,e as c,h as m,p as b,q as p}from"./chunk-7XP7ZRSI.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${u(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${u(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:c(e.symbol)||u(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
1
+ import{b as w}from"./chunk-X3OOU7CF.js";import{b as g}from"./chunk-UXOVHGT6.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{d as u,e as c,h as m,p as b,q as p}from"./chunk-TDGCALH6.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${u(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${u(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:c(e.symbol)||u(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
2
2
  * Generated by 'scip-query twin-ab'. scip-integrity-audit drill 5
3
3
  * ("cross-examine same-concept twins"): where one concept is computed in
4
4
  * more than one place, feed both the same input and require the same
@@ -37,4 +37,4 @@ describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${n.shortName}'
37
37
  });
38
38
  });
39
39
  `}export{O as a,I as b};
40
- //# sourceMappingURL=chunk-APCXCRED.js.map
40
+ //# sourceMappingURL=chunk-PXJIEMND.js.map
@@ -1,4 +1,4 @@
1
- import{D as G,F as W,G as Z,k as te,l as ie,m as re,n as $,w as B,x}from"./chunk-LEKXKHIQ.js";import{a as J}from"./chunk-JLZUM476.js";import{d as X,g as U,i as z,k as ee,m as ne,q as O,s as P,v as L,w as j,x as F}from"./chunk-M2TRDR25.js";import{existsSync as Re,readFileSync as Ie}from"fs";import{resolve as De}from"path";function Je(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT
1
+ import{B as W,C as Z,i as te,j as ie,k as re,l as $,w as B,x,z as G}from"./chunk-GMZYT44R.js";import{a as J}from"./chunk-QNMOZ3CJ.js";import{d as X,g as U,i as z,k as ee,m as ne,q as O,s as P,v as L,w as j,x as F}from"./chunk-M2TRDR25.js";import{existsSync as Re,readFileSync as Ie}from"fs";import{resolve as De}from"path";function Je(n,e){return N(n,e,t=>{let i=t?`AND m.symbol_id IN (${t.map(()=>"?").join(",")})`:"";return n.all(`SELECT
2
2
  m.symbol_id,
3
3
  d.relative_path,
4
4
  COUNT(*) AS ref_count
@@ -26,4 +26,4 @@ import{D as G,F as W,G as Z,k as te,l as ie,m as re,n as $,w as B,x}from"./chunk
26
26
  ${i}
27
27
  ${n.pathExclusionsFor("d")}
28
28
  ORDER BY d.relative_path, c.start_line`,...t??[])})}function N(n,e,t){if(!e)return t();if(e.length===0)return[];let i=[];for(let r=0;r<e.length;r+=750)i.push(...t(e.slice(r,r+750)));return i}var ve=/^[A-Za-z_][A-Za-z0-9_]*$/,oe=/\bDefault::default\b/g,Me=/^\.\.\s*Default::default\b/;function se(n,e){let t=new Map,i=new Map;for(let r of e){let a=Y(n,r,i);a!==null&&t.set(r.symbolId,a)}return t}function Y(n,e,t=new Map){let i=xe(e.symbol);if(!i)return null;let r=ae(n,[e.symbolId]);if(r.length===0)return null;let a=new RegExp(`(^|[^A-Za-z0-9_])${J(i)}::default\\b`,"g"),o=new RegExp(`(^|[^A-Za-z0-9_])${J(i)}\\s*$`),f=Ce(n,e.symbolId),m=[];for(let S of r){let d=Ee(n,S.relative_path,t);if(d===null)return null;let l=d.split(/\r?\n/),u=0,p=[],b=0;for(let R=S.chunk_start;R<=S.chunk_end&&R<l.length;R+=1){let D=l[R]??"",w=new Set;a.lastIndex=0;let M;for(;M=a.exec(D);)m.push({file:S.relative_path,line:R,column:M.index+M[1].length+i.length+2}),b+=1;for(let c=0;c<D.length;c+=1){let y=Me.exec(D.slice(c));if(y){if(f&&p.includes(u)){let g=c+y[0].lastIndexOf("default");m.push({file:S.relative_path,line:R,column:g}),w.add(g),b+=1}c+=y[0].length-1;continue}let h=D[c];if(h==="{"){let g=o.test(D.slice(0,c));u+=1,g&&p.push(u);continue}if(h==="}")for(u=Math.max(0,u-1);p.length>0&&p[p.length-1]>u;)p.pop()}for(oe.lastIndex=0;M=oe.exec(D);){let c=M.index+9;if(!w.has(c))return null}}if(b===0)return null}return te(m)}function Ce(n,e){return n.get("SELECT 1 AS present FROM mentions WHERE symbol_id = ? AND role = 1 LIMIT 1",e)?.present===1}function xe(n){let e=/impl#\[([^\]]+)\]\[Default\]default\(\)\./.exec(n)?.[1]??null;return!e||!ve.test(e)?null:e}function Ee(n,e,t){if(t.has(e))return t.get(e)??null;let i=n.get("SELECT text FROM documents WHERE relative_path = ?",e),r=typeof i?.text=="string"?i.text:_e(n,e);return t.set(e,r),r}function _e(n,e){let t=De(n.config.projectRoot,e);if(!Re(t))return null;try{return Ie(t,"utf8")}catch{return null}}function ce(n){let e=new Map;for(let t of n){let i=e.get(t.relativePath)??[];i.push(t),e.set(t.relativePath,i)}return e}var Pe="typescript-import-usage-v1",we="typescript-signatures-v1",Q=X("semantic-prefetched-callees",{clearGroups:["whole-project","source-file","semantic-provider"]}),le=j({kind:"semantic-import-usage",invalidation:F("semantic-import-usage"),serialize:n=>JSON.stringify(n),deserialize:he}),ue=j({kind:"semantic-signatures",invalidation:F("semantic-signatures"),serialize:n=>JSON.stringify(n),deserialize:Le}),fe=L({kind:"typescript-import-usage",invalidation:F("typescript-import-usage"),serialize:n=>JSON.stringify(n),deserialize:he}),me=L({kind:"typescript-signatures",invalidation:F("typescript-signatures"),serialize:n=>JSON.stringify(n),deserialize:je});function k(n){let e=new Map,t=new Set;return{capability:(i,r)=>ye(n,i,r),importUsage:i=>Fe(n,i),references:i=>de(n,i),materializeReferences:(i,r)=>ge(n,i,e,t,r),callerMap:i=>Ae(n,i,e,t),calleeMap:i=>He(n,i),signature:i=>Ue(n,i)}}function Te(n,e){if(e.size===0)return;let t=Q.get(n,()=>new Map);for(let[i,r]of e)t.set(i,[...r])}function fn(n,e){if(!Q.has(n))return{hits:[],misses:[...e]};let t=Q.get(n,()=>new Map),i=[],r=[];for(let a of e)t.has(a.symbolId)?i.push({definition:a,callees:t.get(a.symbolId)??[]}):r.push(a);return{hits:i,misses:r}}function mn(n,e){return k(n).importUsage(e)}function Fe(n,e){if(x(e)==="typescript"){let a="fallback",o=0,f=0,m=0,S=0;return P("typescript.import-usage.materialize",()=>{let d=G(n,e,Pe);if(d?.key){o=1;let u=fe.read(n,e,d.key);if(u)return a="hit",f=1,u;m=1;let p=E(n,e);if(!p)return a="unavailable",[];let b=p.importUsage(e);return fe.write(n,e,d.key,b),a="computed",b}S=1;let l=E(n,e);return l?(a="direct-fallback",l.importUsage(e)):(a="unavailable",[])},()=>({state:a,eligible:o,cacheHits:f,cacheMisses:m,fallbacks:S}))}let t=Se(n,"semantic-import-usage",e);if(t){let a=le.read(n,e,t);if(a)return a}let i=E(n,e);if(!i)return[];let r=i.importUsage(e);return t&&le.write(n,e,t,r),r}function pn(n,e){return k(n).references(e)}function de(n,e){let t=Y(n,e);if(t)return t;let i=re(n,e);if(i)return i;let r=E(n,e.relativePath);return r?r.referencesFor(e):[]}function dn(n,e){return k(n).callerMap(e)}function gn(n,e){let t=new Map,i=new Map;for(let r of e){if(x(r.relativePath)==="typescript"){let a=E(n,r.relativePath);if(!a)continue;let o=i.get(a)??[];o.push(r),i.set(a,o);continue}K(n,t,r,de(n,r))}for(let[r,a]of i){let o=Z(n,a),f=o?.references??(r.referencesForDefinitions?r.referencesForDefinitions(a,{exact:!0}):new Map(a.map(m=>[m.symbolId,r.referencesFor(m)])));!o&&O()&&W(n,a,f);for(let m of a)K(n,t,m,f.get(m.symbolId)??[])}return t}function Ae(n,e,t=new Map,i=new Set){let r=new Map,a=ge(n,e,t,i),o=0;return P("semantic.callers.from-references",()=>{for(let f of e)o+=K(n,r,f,t.get(f.symbolId)??[])},()=>({definitions:e.length,materialized:a.definitions,inMemoryHits:a.inMemoryHits,incompleteInMemoryHits:a.incompleteInMemoryHits,resultRows:r.size,callerFiles:o})),r}function ge(n,e,t,i,r={}){let a=z(n),o=[],f=[],m=[],S=0,d=0,l=0,u=0,p=0,b=0,R=0,_=0,D=0,w=0,M=0,c=0,y=[],h=new Map,g=e.filter(s=>x(s.relativePath)==="typescript"&&!t.has(s.symbolId)&&!i.has(s.symbolId)),v=Z(n,g);if(v){D=g.length,w=v.cacheHits,M=v.cacheMisses,c=v.computedFiles;for(let s of g)t.set(s.symbolId,v.references.get(s.symbolId)??[])}if(P("semantic.references.cache-scan",()=>{for(let[s,I]of ce(e)){let T=[];for(let C of I)t.has(C.symbolId)?d+=1:i.has(C.symbolId)?_+=1:T.push(C);if(T.length===0){R+=1;continue}let H=ke(n,a,s);if(!H){for(let C of T)x(C.relativePath)||(S+=1),m.push(C);continue}b+=1;let be=ee(n,s,H);for(let C of T){let V=be.get(C.symbol)??null;if(V!==null){let q=Ne(V);if(q){l+=1,t.set(C.symbolId,q);continue}u+=1}f.push({definition:C,cacheFingerprint:H})}}},()=>({definitions:e.length,skippedUnsupportedLanguage:S,cacheHits:l,parseFailures:u,misses:f.length,unkeyed:m.length,inMemoryHits:d,incompleteInMemoryHits:_,fullyInMemoryFiles:R,cacheReadFiles:b})),f.length>0||m.length>0){y=[...m,...f.map(s=>s.definition)],h=P("semantic.references.compute-misses",()=>{let s=Oe(n,y,r);return p=s.size,s},()=>({definitions:y.length,misses:f.length,unkeyed:m.length,rows:p}));for(let s of y)h.has(s.symbolId)?(t.set(s.symbolId,h.get(s.symbolId)??[]),i.delete(s.symbolId)):i.add(s.symbolId);for(let{definition:s,cacheFingerprint:I}of f)h.has(s.symbolId)&&ye(n,"semantic-references",s.relativePath).available&&o.push({relativePath:s.relativePath,symbol:s.symbol,projectFingerprint:I,payload:JSON.stringify(h.get(s.symbolId)??[])})}return o.length>0&&P("semantic.references.cache-write",()=>ne(n,o),()=>({entries:o.length})),h.size>0&&W(n,y,h),{definitions:e.length,inMemoryHits:d,incompleteInMemoryHits:_,cacheHits:l,misses:f.length,unkeyed:m.length,skippedUnsupportedLanguage:S,parseFailures:u,computed:p,incomplete:i.size,cacheWrites:o.length,fragmentDefinitions:D,fragmentCacheHits:w,fragmentCacheMisses:M,fragmentComputedFiles:c}}function ke(n,e,t){if(!e)return null;let i=x(t);return i==="typescript"?e:i==="rust"?U(JSON.stringify({kind:"semantic-references",language:i,engine:$(n.config.projectRoot),projectFingerprint:e})):null}function Oe(n,e,t={}){let i=O(),r=new Map,a=0,o=0,f=0,m=0,S=0,d=0,l=0,u=0,p=0;return P("semantic.references.provider-loop",()=>{let b=se(n,e),R=ie(n,e),_=new Map,D=t.prefetchCallees?new Map:null,w=[];for(let c of e){let y,h=()=>(y??=E(n,c.relativePath),y);if(D){let I=h();if(I?.referencesAndCalleesForDefinitions){let T=D.get(I);T?T.push(c):D.set(I,[c]),p+=1}}let g=b.get(c.symbolId);if(g){f+=1,m+=g.length,A(r,c.symbolId,g,i,I=>{l+=1,u+=I});continue}let v=R.get(c.symbolId);if(v){S+=1,d+=v.length,A(r,c.symbolId,v,i,I=>{l+=1,u+=I});continue}let s=h();if(!s){i&&(o+=1);continue}if(i&&(a+=1),s.referencesForDefinitions){let I=_.get(s);I?I.push(c):_.set(s,[c])}else w.push({provider:s,definition:c})}let M=new Set;if(D)for(let[c,y]of D){if(!c.referencesAndCalleesForDefinitions)continue;let h=_.get(c)??[],g=c.referencesAndCalleesForDefinitions(h,y);M.add(c),Te(n,g.callees);for(let v of h){if(!g.references.has(v.symbolId))continue;let s=g.references.get(v.symbolId)??[];A(r,v.symbolId,s,i,I=>{l+=1,u+=I})}}for(let[c,y]of _){if(M.has(c))continue;let h=c.referencesForDefinitions(y);for(let g of y){if(!h.has(g.symbolId))continue;let v=h.get(g.symbolId)??[];A(r,g.symbolId,v,i,s=>{l+=1,u+=s})}}for(let{provider:c,definition:y}of w){let h=c.referencesFor(y);A(r,y.symbolId,h,i,g=>{l+=1,u+=g})}return r},()=>({definitions:e.length,providerHits:a,providerMisses:o,rustDefaultFastPathRows:f,rustDefaultFastPathReferences:m,rustScipOccurrenceFastPathRows:S,rustScipOccurrenceFastPathReferences:d,prefetchCalleeDefinitions:p,definitionsWithReferences:l,referenceCount:u,rows:r.size}))}function A(n,e,t,i,r){n.set(e,t),i&&t.length>0&&r(t.length)}function K(n,e,t,i){let r=0;for(let a of i){if(a.file===t.relativePath||n.isIgnored(a.file))continue;let o=e.get(t.symbolId);o||(o=new Set,e.set(t.symbolId,o));let f=o.size;o.add(a.file),o.size!==f&&(r+=1)}return r}function Ne(n){try{return JSON.parse(n)}catch{return null}}function Sn(n,e){return k(n).calleeMap(e)}function He(n,e){let t=O(),i=new Map,r=0,a=0,o=0,f=0;return P("semantic.callees.provider-loop",()=>{let m=new Map,S=[];for(let d of e){let l=E(n,d.relativePath);if(!l){t&&(a+=1);continue}t&&(r+=1);let u=d;if(l.calleesForDefinitions){let p=m.get(l);p?p.push(u):m.set(l,[u])}else S.push({provider:l,definition:u})}for(let[d,l]of m){let u=d.calleesForDefinitions(l);for(let p of l){let b=u.get(p.symbolId)??[];pe(i,p.symbolId,b,t,R=>{o+=1,f+=R})}}for(let{provider:d,definition:l}of S){let u=d.calleesFor(l);pe(i,l.symbolId,u,t,p=>{o+=1,f+=p})}return i},()=>({definitions:e.length,providerHits:r,providerMisses:a,definitionsWithCallees:o,calleeCount:f,rows:i.size}))}function pe(n,e,t,i,r){t.length>0&&(n.set(e,t),i&&r(t.length))}function hn(n,e){return k(n).signature(e)}function Ue(n,e){if(x(e.relativePath)==="typescript"){let o="fallback",f=0,m=0,S=0,d=0;return P("typescript.signature.materialize",()=>{let l=G(n,e.relativePath,we);if(l?.key){f=1;let p=me.read(n,e.relativePath,l.key)??{};if(Object.prototype.hasOwnProperty.call(p,e.symbol))return o="hit",m=1,p[e.symbol]??null;S=1;let b=E(n,e.relativePath);if(!b)return o="unavailable",null;let R=b.signatureFor(e);return me.write(n,e.relativePath,l.key,{...p,[e.symbol]:R}),o="computed",R}d=1;let u=E(n,e.relativePath);return u?(o="direct-fallback",u.signatureFor(e)):(o="unavailable",null)},()=>({state:o,eligible:f,cacheHits:m,cacheMisses:S,fallbacks:d}))}let t=Se(n,"semantic-signatures",e.relativePath),i=ze(e);if(t){let o=ue.read(n,i,t);if(o)return o.signature}let r=E(n,e.relativePath);if(!r)return null;let a=r.signatureFor(e);return t&&ue.write(n,i,t,{signature:a}),a}function Se(n,e,t){let i=z(n);if(!i)return null;let r=x(t);return r!=="rust"?null:U(JSON.stringify({kind:e,language:r,engine:$(n.config.projectRoot),projectFingerprint:i}))}function ze(n){return`${n.relativePath}\0${n.symbol}`}function he(n){try{let e=JSON.parse(n);return Array.isArray(e)?e:null}catch{return null}}function Le(n){try{let e=JSON.parse(n);if(!e||typeof e!="object")return null;let t=e.signature;return t!==null&&typeof t!="string"?null:{signature:t}}catch{return null}}function je(n){try{let e=JSON.parse(n);if(!e||typeof e!="object"||Array.isArray(e))return null;for(let t of Object.values(e))if(t!==null&&typeof t!="string")return null;return e}catch{return null}}function ye(n,e,t){let i=x(t);if(!i)return{slot:e,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript or Rust files"};try{return{slot:e,language:i,...B(n,t).availability()}}catch(r){return{slot:e,language:i,available:!1,reason:r instanceof Error?r.message:String(r)}}}function E(n,e){if(!x(e))return null;let t=B(n,e);return t.availability().available?t:null}export{Je as a,$e as b,Be as c,ae as d,ce as e,k as f,fn as g,mn as h,pn as i,dn as j,gn as k,Oe as l,Sn as m,hn as n};
29
- //# sourceMappingURL=chunk-NJD4C5G5.js.map
29
+ //# sourceMappingURL=chunk-QB5WSOTY.js.map
@@ -1,2 +1,2 @@
1
- import{a as g}from"./chunk-BGUYAA3Q.js";import{a as m}from"./chunk-RUV4KHWA.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-7XP7ZRSI.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
- //# sourceMappingURL=chunk-AY44MGWS.js.map
1
+ import{a as g}from"./chunk-BGUYAA3Q.js";import{a as m}from"./chunk-ZXWFN7CK.js";import{a as d}from"./chunk-BGBBVSH4.js";import{d as u}from"./chunk-TDGCALH6.js";function k(n,c={}){let{scope:e,minLoc:t=10,minCallees:a=6,limit:r=20,scanLimit:i}=c,o=new m(n);return g({candidates:()=>o.productionCallableDefinitions({scope:e,minLoc:t,excludeTypesFiles:!0,requireFunctionLikeSymbol:!0,sortByLocDesc:!0}),scanLimit:i,profile:{name:"extract-candidates"},prepare:s=>o.calleeMap(s,{semantic:c.semantic!==!1}),evaluate:(s,l)=>h(s,l.get(s.symbolId)??[],a),orderResults:(s,l)=>l.clusters.length-s.clusters.length||l.loc-s.loc,limit:r})}function h(n,c,e){let t=new Set(c.map(l=>l.symbol));if(t.size<e)return null;let a=S(t,c),r=y(t,a);if(r.length<2)return null;let i=C(r,a);if(i.length===0)return null;let o=u(n.symbol),s=p(o,t.size,r.length,i);return{symbol:n.symbol,shortName:o,relativePath:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:d(n),totalCallees:t.size,extractionKind:s.extractionKind,actionTier:"signal",evidenceReasons:s.evidenceReasons,recommendation:s.recommendation,clusters:i}}function p(n,c,e,t){let a=Math.max(...t.map(s=>s.callees.length)),r=Math.max(...t.map(s=>s.isolation)),i=[`${c} distinct callees across ${e} co-occurrence cluster(s)`,`${t.length} extractable cluster(s) passed size and isolation thresholds`,`largest extractable cluster has ${a} callees at ${Math.round(r*100)}% isolation`],o=f(n,c,e);return o!==null?{extractionKind:"workflow-orchestration",evidenceReasons:[...i,o],recommendation:"Review the isolated helper group as a possible private or feature-local helper, but keep the orchestration sequence together when it preserves the workflow."}:a>=6?{extractionKind:"broad-helper-cluster",evidenceReasons:[...i,"one isolated helper group is broad enough to deserve a named review"],recommendation:"Review whether the broad helper cluster has a stable concept name before extracting it; avoid creating a bag-of-helpers abstraction."}:{extractionKind:"cohesive-helper-cluster",evidenceReasons:i,recommendation:"Review the isolated callee group as a possible same-file or feature-local helper; extract only if the new name preserves the current behavior."}}function f(n,c,e){if(c>=10)return`callee breadth suggests orchestration: ${c} callees`;if(e>=4)return`multiple disconnected callee groups suggest orchestration: ${e} groups`;let t=b(n);return x.has(t)?`caller verb suggests orchestration: ${t}`:null}function b(n){return n.split(":").pop()?.replace(/\(\)$/,"").replace(/[^A-Za-z0-9_]/g,"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[_\s-]+/).filter(Boolean)[0]?.toLowerCase()??""}var x=new Set(["apply","build","check","collect","create","diff","execute","find","handle","load","prepare","process","render","resolve","run","select","sync","update","validate","verify","write"]);function S(n,c){let e=new Map;for(let a of n)e.set(a,new Set);let t=new Map;for(let a of c){let r=t.get(a.chunkId);r||(r=new Set,t.set(a.chunkId,r)),r.add(a.symbol)}for(let a of t.values()){let r=[...a];for(let i=0;i<r.length;i++)for(let o=i+1;o<r.length;o++)e.get(r[i]).add(r[o]),e.get(r[o]).add(r[i])}return e}function y(n,c){let e=new Set,t=[];for(let a of n){if(e.has(a))continue;let r=new Set,i=[a];for(;i.length>0;){let o=i.pop();if(!e.has(o)){e.add(o),r.add(o);for(let s of c.get(o)??[])e.has(s)||i.push(s)}}t.push(r)}return t}function C(n,c){return n.filter(e=>e.size>=3).map(e=>v(e,n,c)).filter(e=>e.isolation>.5).sort((e,t)=>t.isolation-e.isolation)}function v(n,c,e){let t=new Set;for(let o of c)if(o!==n)for(let s of o)t.add(s);let a=0;for(let o of n)for(let s of e.get(o)??[])t.has(s)&&a++;let r=n.size*t.size,i=r>0?1-a/r:1;return{callees:[...n].map(u),isolation:i}}export{k as a};
2
+ //# sourceMappingURL=chunk-QHOUNTDZ.js.map
@@ -0,0 +1,2 @@
1
+ import{a as C}from"./chunk-35NLDRZC.js";import{a as b}from"./chunk-SATRCB5O.js";function L(t,n={}){let{limit:s=10,scope:c,minDepth:l=3}=n,p=b(t,c),{components:h,componentOf:m}=C(p),d=new Map;for(let e=0;e<h.length;e++)d.set(e,new Set);for(let[e,r]of p){let o=m.get(e);for(let a of r){let i=m.get(a);i!==o&&d.get(o).add(i)}}let f=new Array(h.length),S=new Array(h.length);for(let e=0;e<h.length;e++){let r=[],o=0;for(let a of d.get(e)){let i=S[a];i>o&&(o=i,r=f[a])}f[e]=[e,...r],S[e]=1+o}function D(e){return f[e]}let R=h.map(e=>[...e].sort()),y=new Set,u=[];for(let e=0;e<h.length;e++){let o=D(e).map(g=>R[g]),a=o.map(g=>g[0]);if(o.length<l)continue;let i=a.join(" ");y.has(i)||(y.add(i),u.push(w(a,o)))}return u.sort((e,r)=>r.depth-e.depth),I(u).slice(0,s)}function w(t,n){let s=n.reduce((l,p)=>l+p.length,0),c=n.filter(l=>l.length>1).length;return{chain:t,components:n,depth:n.length,fileCount:s,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${n.length} condensed dependency component(s) form the representative transitive path`,`${s} file(s) are represented; ${c} component(s) contain a dependency cycle`,"cycles count once toward depth and retain their full membership separately"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function I(t){let n=[];for(let s of t)n.some(c=>v(s.chain,c.chain))||n.push(s);return n}function v(t,n){if(t.length>=n.length)return!1;let s=n.length-t.length;for(let c=0;c<t.length;c++)if(t[c]!==n[s+c])return!1;return!0}export{L as a};
2
+ //# sourceMappingURL=chunk-QN67MWDU.js.map
@@ -1,4 +1,4 @@
1
- import{A as Se,B as Q,C as G,D as He,E,F as Je,G as xe,H as Ke,I as Xe,b as ne,g as Oe,h as Me,i as _,j as ve,k as $e,l as Ue,m as B,n as qe,o as H,p as Be,q as ze,r as Ve,s as A,t as J,u as L,v as fe,w as de,x as S,y as ge,z as We}from"./chunk-TLTLJ4SW.js";import{a as De,c as q,f as re,h as W,o as he,v as K,x as X,y as k}from"./chunk-M2TRDR25.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ft(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function zn(e){return Qe(e,{maskStrings:!1})}function Vn(e){return Qe(e,{maskStrings:!0})}function Qe(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
1
+ import{A as Se,B as Q,C as G,D as He,E,F as Je,G as xe,H as Ke,I as Xe,b as ne,g as Oe,h as Me,i as _,j as ve,k as $e,l as Ue,m as B,n as qe,o as H,p as Be,q as ze,r as Ve,s as A,t as J,u as L,v as fe,w as de,x as S,y as ge,z as We}from"./chunk-XDSB47KO.js";import{a as De,c as q,f as re,h as W,o as he,v as K,x as X,y as k}from"./chunk-M2TRDR25.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ft(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function zn(e){return Qe(e,{maskStrings:!1})}function Vn(e){return Qe(e,{maskStrings:!0})}function Qe(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
2
2
  `,n),a=i===-1?s:i;t+=ye(e,n,a),n=a;continue}if(e[n]==="/"&&e[n+1]==="*"){let i=e.indexOf("*/",n+2),a=i===-1?s:i+2;t+=ye(e,n,a),n=a;continue}let o=e[n];if(o==="`"||o==="'"||o==='"'){let i=o,a=n+1;for(;a<s;){if(e[a]==="\\"){a+=2;continue}if(e[a]===i){a+=1;break}if(i!=="`"&&e[a]===`
3
3
  `)break;a+=1}t+=r.maskStrings?ye(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function ye(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
4
4
  `?`
@@ -10,4 +10,4 @@ import{A as Se,B as Q,C as G,D as He,E,F as Je,G as xe,H as Ke,I as Xe,b as ne,g
10
10
  `:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=ct(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=ct(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function _r(e){let r=0;for(;r<e.length&&(r=Ae(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(gr(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Ae(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Rr(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ce(e[t]);)t+=1;let n=e[t];return n?n==="("?Re(e,t,"list",")"):n==="["?Re(e,t,"vector","]"):n==="{"?Re(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Tr(e,t):null}function Rr(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Er(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Er(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Re(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Ae(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Tr(e,r){let t=r;for(;t<e.length&&!Pe(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Ae(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function ct(e){return e.replace(/[^\r\n]/g," ")}function pt(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:ge(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function ut(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:ge(e,r,o)})}return n}function mt(e,r,t){return ae(e,r,{csharp:n=>Ar(e,r,n),vb:n=>Fr(e,r,n)},()=>{let n=ze(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[R(e,r,o,p,u,m,S(e,p,B))]})})}function Fr(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(d(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Ar(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(d(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Lr=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function ft(e,r){return Lr.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function Le(e,r,t){return C(e,r,n=>wr(e,r,n),()=>kr(e,r,t))}function kr(e,r,t){return Vr(t).flatMap(n=>Wr(e,r,n.clause,n.specifier,n.start,n.end,t))}function wr(e,r,t){let n=jr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Dr(e,r,t,o,n));return s}function jr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of ft(e,r))n.add(s);return n}function Dr(e,r,t,n,s){let o=Ur(n);if(!o)return[];let i=A(e,r,o),a=b(n,"import_clause");return a?Or(t,a,i,s,qr(n.text)):[M("*",i)]}function Or(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Mr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=vr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...$r(i,t,n,s));return o}function Mr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function vr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=zr(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function $r(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(d(c,l,r,t,"named",{isTypeOnly:n||Br(o.text)}))}return s}function Ur(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function qr(e){return/^\s*import\s+type\b/.test(e)}function Br(e){return/^\s*type\b/.test(e.trim())}function zr(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Vr(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function Wr(e,r,t,n,s,o,i){let a=A(e,r,n),c=j(i,s,o);return t?Hr(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Hr(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=Jr(n),i=[];return s&&i.push(...dt(s,t)),o&&i.push(...dt(o,t)),i}function dt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function Jr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function ke(e,r,t){let n=E(e,r);return n?Zr(e,r,n):Kr(e,r,t)}function Kr(e,r,t){return[...Xr(e,r,t),...Qr(e,r,t),...Gr(e,r,t)]}function Xr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Yr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:A(e,r,a),names:c,startLine:l,endLine:p})}return n}function Qr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:A(e,r,i),names:[],startLine:a,endLine:c})}return n}function Gr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:A(e,r,i),names:[],startLine:a,endLine:c})}return n}function Yr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Zr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=en(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=tn(s,o,i,a);n.push(c)}return n}function en(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return A(e,r,s.text)}function tn(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function gt(e,r,t){return ae(e,r,{java:n=>rn(e,r,n),kotlin:n=>nn(e,r,n),scala:n=>sn(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?on(e,r,o,s):[]}))}function rn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(d(p,p,S(e,l,_),n))}return s}function nn(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(f=>f.type==="identifier");if(!i)continue;let a=o.namedChildren.some(f=>f.type==="wildcard_import"),c=o.namedChildren.find(f=>f.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(d(p,m,S(e,l,_),n))}return s}function sn(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,f]=u.namedChildren;if(!m)continue;let h=m.text,$=f?.text??h;if(h==="_")continue;s.push(d(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(d(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(d(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function on(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[R(e,r,n,m,p,u)]})}return[R(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function ht(e,r,t){return C(e,r,n=>an(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[R(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function an(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(d(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=St(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=St(c,"");l&&o(u,l,p)}}return s}function St(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function yt(e,r,t){return C(e,r,n=>cn(e,r,n),()=>pn(t).flatMap(n=>mn(e,r,n,t)))}function cn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=xt(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=ln(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=xt(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function xt(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function ln(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function pn(e){let r=e.split(`
11
11
  `),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=be(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
12
12
  ${m}`,l+=1+m.length,p+=be(m),n+=m.length+1}let u=un(c);u&&t.push({...u,start:a,end:l})}return t}function un(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function mn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),f=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,f);return[{importedName:m,localName:f,sourcePath:h,kind:"namespace",used:x(s,f)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as fn}from"path";function bt(e,r,t){return C(e,r,n=>gn(e,r,n),()=>dn(e,r,t))}function dn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?fe(e,r,i):null;if(a){let c=Nt(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function gn(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(f=>f.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(f=>f.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?fe(e,r,u):null;if(m){let f=Nt(u);s.push(d(f,f,m,n))}else s.push(M(u,m))}return s}function Nt(e){return Xe(fn(e).replace(/\.[^.]+$/,""),/_/)}function It(e,r,t){return C(e,r,n=>Sn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?hn(e,r,o,s):[]}))}function Sn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=L(e,r,a.qualifiedName)??L(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(d(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"self":{let t=r.split("::").filter(Boolean).pop()??"self";return[{qualifiedName:r||"self",importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function hn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let f=m.trim();if(!f)return[];if(f==="self"){let me=p.split("::").filter(Boolean).pop();return me?[R(e,r,n,p,me,me)]:[]}let[h,$]=f.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Et=($??U.split("::").pop()??U).trim(),Tt=`${p}::${U}`.replace(/::::/g,"::");return[R(e,r,n,Tt,U.split("::").pop()??U,Et,L(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=L(e,r,a)??L(e,r,a.split("::").slice(0,-1).join("::"));return[R(e,r,n,a,a.split("::").pop()??a,c,l)]}function Ct(e,r,t){let n=E(e,r);if(n)return xn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...bn(e,r,i))}return s}function xn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!yn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(we(e,r,i.qualifiedName))}return n}function yn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function bn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[we(e,r,l)]})}return[we(e,r,n)]}function we(e,r,t){return{specifier:t,sourcePath:L(e,r,t)??L(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function Pt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var Nn={language:"javascript",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Le,parseReExports:ke},In=D({language:"python",extensions:Me,imports:"ast-with-regex-fallback",parseImports:yt}),Cn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:gt}),Pn={language:"rust",extensions:ve,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:It,parseExports:Ct},_n=D({language:"ruby",extensions:$e,imports:"ast-with-regex-fallback",parseImports:bt}),Rn=D({language:"c/cpp",extensions:Ue,imports:"ast-with-regex-fallback",parseImports:at}),En=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:mt}),Tn={language:"dart",extensions:qe,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:pt,parseExports:ut},Fn=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:ht}),An=D({language:"clojure",extensions:Be,imports:"regex-only",parseImports:lt}),Ln=[Nn,In,Cn,Pn,_n,Rn,En,Tn,Fn,An];function ue(e){return Pt(Ln,e)}var je={clearGroups:["whole-project","source-file"]},kn=q("source-imports",je),wn=q("source-exports",je),jn=q("source-reexports",je),_t=K({kind:"source-imports",invalidation:X("source-imports"),serialize:Dn,deserialize:On}),Rt=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:Mn,deserialize:vn});function Xo(e,r){let t=ne(r);return jn.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=Se(e),a=Rt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return Rt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Qo(e,r){let t=ne(r);return kn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=Se(e),a=_t.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return _t.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Go(e,r){let t=ne(r);return wn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function Dn(e){return JSON.stringify(e)}function On(e){try{let r=JSON.parse(e);return!he(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function Mn(e){return JSON.stringify(e)}function vn(e){try{let r=JSON.parse(e);return!he(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,Ft as b,zn as c,Vn as d,be as e,T as f,Yt as g,nr as h,sr as i,ar as j,cr as k,lr as l,pr as m,pe as n,Xo as o,Qo as p,Go as q};
13
- //# sourceMappingURL=chunk-JLZUM476.js.map
13
+ //# sourceMappingURL=chunk-QNMOZ3CJ.js.map
@@ -1,2 +1,2 @@
1
- import{a as y}from"./chunk-4XTPZ5CR.js";import{b as u}from"./chunk-5CJ6AQN7.js";import{a as p}from"./chunk-QEIGJJBC.js";import{existsSync as v}from"fs";import{join as w}from"path";function ne(e){return b.test(e)}var b=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|uv\.lock|poetry\.lock|Pipfile\.lock|bun\.lockb?|\.SRCINFO|CHANGELOG(?:\.[a-z]+)?|.*\.(?:map|tsbuildinfo))$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function se(e,t,n={}){let{minTogether:s=4,minConfidence:i=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=y(e,{historyMode:n.historyMode,...n.head?{head:n.head}:{}}),r=g.commitHistory(),c=t!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:i,maxFilesPerCommit:l});if(!r||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,E=p(e),R=k(e),j=F(e,E,R),L=n.includeLinked===!0||c,m=[];for(let o of f){if(b.test(o.fileA)||b.test(o.fileB)||!x(e,o.fileA)||!x(e,o.fileB)||c&&!o.fileA.includes(t)&&!o.fileB.includes(t)||!c&&(u(o.fileA)==="test"||u(o.fileB)==="test"||D(o.fileA,o.fileB)||N(o.fileA,o.fileB)))continue;let h=j(o.fileA,o.fileB);if(!L&&h)continue;let C=$(o.fileA,o.fileB),S=_(o,C,h);if(m.push({...o,structurallyLinked:h,partnerClass:C.partnerClass,partnerClassReasons:C.reasons,...S?{declaredCouplingSuggestion:S}:{}}),m.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:m}}function x(e,t){return v(w(e.config.projectRoot,t))}function $(e,t){let n=T(e),s=T(t),i=[],a=r=>{i.includes(r)||i.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:i};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:i};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:i};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:i};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:i};let g=U(n.tokens,s.tokens).filter(r=>!J.has(r));return A(e,t)||g.length>=2?(a(A(e,t)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:i}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:i})}function _(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!Z.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${V(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function F(e,t=p(e),n=k(e)){return(s,i)=>B(t,n,s,i)}var I=/(?:^|\/)(?:locales|i18n)\//i;function P(e){return I.test(e)}function N(e,t){return P(e)&&P(t)?!0:O(e,t)}function O(e,t){if(!e.endsWith(".json")||!t.endsWith(".json"))return!1;let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(n<0||s<0)return!1;let i=e.slice(0,n),a=t.slice(0,s);if(i===a)return!1;let l=e.slice(n+1),g=t.slice(s+1);if(l!==g)return!1;let r=i.lastIndexOf("/"),c=a.lastIndexOf("/"),d=r>=0?i.slice(0,r):"",f=c>=0?a.slice(0,c):"";return d===f}function D(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let i=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return i!==""&&i===a}function k(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function B(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(i=>i.has(n)&&i.has(s))}var M=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,z=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,G=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,H=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,q=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,W=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,Z=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),J=new Set(["src","lib","app","apps","packages","frontend","backend","examples","python","typescript","javascript","test","tests","spec","index","main","utils","util","types","type","config","docs","doc","package","requirements","ts","tsx","js","jsx","mjs","cjs","vue","py","md","mdx","json","yaml","yml","toml","txt"]);function T(e){let t=e.replace(/\\/g,"/"),n=new Set;return M.test(t)&&n.add("doc"),z.test(t)&&n.add("config"),G.test(t)&&n.add("schema"),H.test(t)&&n.add("script"),q.test(t)&&n.add("model"),W.test(t)&&n.add("view"),u(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:K(t)}}function A(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),i=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return i!==""&&i===a}function K(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function U(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function V(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{ne as a,se as b,$ as c,_ as d,F as e};
2
- //# sourceMappingURL=chunk-AWYKDRYV.js.map
1
+ import{a as y}from"./chunk-4XTPZ5CR.js";import{b as u}from"./chunk-FLIF3JWA.js";import{a as p}from"./chunk-SATRCB5O.js";import{existsSync as v}from"fs";import{join as w}from"path";function ne(e){return b.test(e)}var b=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|uv\.lock|poetry\.lock|Pipfile\.lock|bun\.lockb?|\.SRCINFO|CHANGELOG(?:\.[a-z]+)?|.*\.(?:map|tsbuildinfo))$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function se(e,t,n={}){let{minTogether:s=4,minConfidence:i=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=y(e,{historyMode:n.historyMode,...n.head?{head:n.head}:{}}),r=g.commitHistory(),c=t!==void 0,d=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:i,maxFilesPerCommit:l});if(!r||!d)return{available:!1,commitsAnalyzed:0,findings:[]};let f=typeof n.scanLimit=="number"?d.slice(0,n.scanLimit):d,E=p(e),R=k(e),j=F(e,E,R),L=n.includeLinked===!0||c,m=[];for(let o of f){if(b.test(o.fileA)||b.test(o.fileB)||!x(e,o.fileA)||!x(e,o.fileB)||c&&!o.fileA.includes(t)&&!o.fileB.includes(t)||!c&&(u(o.fileA)==="test"||u(o.fileB)==="test"||D(o.fileA,o.fileB)||N(o.fileA,o.fileB)))continue;let h=j(o.fileA,o.fileB);if(!L&&h)continue;let C=$(o.fileA,o.fileB),S=_(o,C,h);if(m.push({...o,structurallyLinked:h,partnerClass:C.partnerClass,partnerClassReasons:C.reasons,...S?{declaredCouplingSuggestion:S}:{}}),m.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:m}}function x(e,t){return v(w(e.config.projectRoot,t))}function $(e,t){let n=T(e),s=T(t),i=[],a=r=>{i.includes(r)||i.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:i};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:i};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:i};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:i};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:i};let g=U(n.tokens,s.tokens).filter(r=>!J.has(r));return A(e,t)||g.length>=2?(a(A(e,t)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:i}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:i})}function _(e,t,n){if(n||e.together<4||e.confidence<.75||e.commitScope==="broad-sweep"||e.recency==="stale"||!Z.has(t.partnerClass))return;let s=[e.fileA,e.fileB].sort();return{name:`co-change ${t.partnerClass}: ${V(s)}`,files:s,reason:`${t.partnerClass} pair changed together ${e.together}x with ${Math.round(e.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function F(e,t=p(e),n=k(e)){return(s,i)=>B(t,n,s,i)}var I=/(?:^|\/)(?:locales|i18n)\//i;function P(e){return I.test(e)}function N(e,t){return P(e)&&P(t)?!0:O(e,t)}function O(e,t){if(!e.endsWith(".json")||!t.endsWith(".json"))return!1;let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(n<0||s<0)return!1;let i=e.slice(0,n),a=t.slice(0,s);if(i===a)return!1;let l=e.slice(n+1),g=t.slice(s+1);if(l!==g)return!1;let r=i.lastIndexOf("/"),c=a.lastIndexOf("/"),d=r>=0?i.slice(0,r):"",f=c>=0?a.slice(0,c):"";return d===f}function D(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/");if(e.slice(0,n)!==t.slice(0,s))return!1;let i=e.slice(n+1).split(".")[0],a=t.slice(s+1).split(".")[0];return i!==""&&i===a}function k(e){return(e.config.declaredCouplings??[]).filter(t=>Array.isArray(t.files)&&t.files.length>=2).map(t=>new Set(t.files))}function B(e,t,n,s){return e.get(n)?.has(s)===!0||e.get(s)?.has(n)===!0?!0:t.some(i=>i.has(n)&&i.has(s))}var M=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,z=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,G=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,H=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,q=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,W=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,Z=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),J=new Set(["src","lib","app","apps","packages","frontend","backend","examples","python","typescript","javascript","test","tests","spec","index","main","utils","util","types","type","config","docs","doc","package","requirements","ts","tsx","js","jsx","mjs","cjs","vue","py","md","mdx","json","yaml","yml","toml","txt"]);function T(e){let t=e.replace(/\\/g,"/"),n=new Set;return M.test(t)&&n.add("doc"),z.test(t)&&n.add("config"),G.test(t)&&n.add("schema"),H.test(t)&&n.add("script"),q.test(t)&&n.add("model"),W.test(t)&&n.add("view"),u(t)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:K(t)}}function A(e,t){let n=e.lastIndexOf("/"),s=t.lastIndexOf("/"),i=n>=0?e.slice(0,n):"",a=s>=0?t.slice(0,s):"";return i!==""&&i===a}function K(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(t=>t.toLowerCase()).filter(t=>t.length>=2)}function U(e,t){let n=new Set(t);return[...new Set(e.filter(s=>n.has(s)))].sort()}function V(e){return e.map(t=>t.split("/").pop()?.replace(/\.[^.]+$/,"")||t).join(" + ")}export{ne as a,se as b,$ as c,_ as d,F as e};
2
+ //# sourceMappingURL=chunk-RIGY5DDE.js.map
@@ -0,0 +1,10 @@
1
+ import{d as D}from"./chunk-F334Z5UA.js";import{n as R}from"./chunk-UVMME4FI.js";import{a as M,c as N}from"./chunk-UXOVHGT6.js";import{d as b,f as g,s as S,z as I}from"./chunk-TDGCALH6.js";import{B as p}from"./chunk-XDSB47KO.js";function O(o,n,l={}){let{maxDepth:u=5,scope:m}=l,i=M(o,n);if(!i)return[];let c=[],d=new Set([i.symbolId]),a=new Set,r=[i];for(let e=1;e<=u&&r.length!==0;e++){let t=[],f=D(o,r,{limit:500,semanticEvidence:R});for(let y of r)for(let s of w(o,y,m,f.get(y.symbolId)??[])){let h=`${s.file}|${s.shortName}`;if(s.symbolId!==null){if(d.has(s.symbolId))continue;d.add(s.symbolId)}else if(a.has(h))continue;a.add(h),c.push({symbol:s.symbol,shortName:s.shortName,file:s.file,depth:e}),s.symbolId!==null&&s.symbolMatch&&t.push(s.symbolMatch)}r=t}return c.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),c}function w(o,n,l,u){let m=u.filter(e=>!o.isIgnored(e.file)).filter(e=>!l||e.file.includes(l)),i=new Set(m.map(e=>e.file)),c=[];for(let e of A(o,n,l)){if(i.has(e))continue;let t=S(o,e),f=t.length>0?I(t,t[0].startLine):null;c.push({symbol:f?.symbol??e,file:e})}let d=[...m,...c],a=[],r=new Set;for(let e of d){let t=N(o,e.symbol);if(!t){let y=`${e.file}|${e.symbol}`;if(r.has(y))continue;r.add(y),a.push({symbolId:null,symbol:e.symbol,shortName:b(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===n.symbolId||o.isIgnored(t.relativePath)||!_(t))continue;let f=`${t.symbolId}|${t.relativePath}`;r.has(f)||(r.add(f),a.push({symbolId:t.symbolId,symbol:t.symbol,shortName:b(t.symbol),file:t.relativePath,symbolMatch:t}))}return a}function A(o,n,l){let u=l?"AND consumer_d.relative_path LIKE ?":"",m=[n.symbolId,n.documentId];return l&&m.push(`%${l}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
2
+ FROM mentions m
3
+ JOIN chunks c ON m.chunk_id = c.id
4
+ JOIN documents consumer_d ON consumer_d.id = c.document_id
5
+ WHERE m.symbol_id = ?
6
+ AND m.role != 1
7
+ AND c.document_id != ?
8
+ ${o.pathExclusionsFor("consumer_d")}
9
+ ${u}`,...m).map(i=>i.relative_path).filter(i=>!o.isIgnored(i)))}function _(o){if(o.symbol.startsWith("scip-clojure ")||p(o.relativePath)==="clojure")return!0;let n=g(o.symbol);return n==="method"||n==="type"||o.symbol.endsWith("().")}export{O as a};
10
+ //# sourceMappingURL=chunk-RJLU7IMR.js.map