scip-query 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/README.md +158 -62
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2EU6WVR3.js +3 -0
- package/dist/chunk-2HFXPIBT.js +2 -0
- package/dist/chunk-2LGPMYS2.js +35 -0
- package/dist/chunk-2Y7YX54K.js +16 -0
- package/dist/chunk-363TZ64I.js +2 -0
- package/dist/chunk-3I34FZ6R.js +2 -0
- package/dist/chunk-3LAKH6BV.js +2 -0
- package/dist/chunk-3M2UCPFS.js +3 -0
- package/dist/chunk-3OPIMH42.js +2 -0
- package/dist/{chunk-QZOAOLLZ.js → chunk-3YAZH3JU.js} +2 -2
- package/dist/chunk-5P26M63Y.js +2 -0
- package/dist/{chunk-72FR7KEZ.js → chunk-5TVNLPUM.js} +14 -12
- package/dist/chunk-5UKDCXVC.js +5 -0
- package/dist/{chunk-R7U2I55B.js → chunk-5XDNFOAH.js} +2 -2
- package/dist/chunk-62Y3PC27.js +4 -0
- package/dist/chunk-6DNE65QS.js +40 -0
- package/dist/{chunk-N2OTJWC2.js → chunk-6EVORGCB.js} +2 -2
- package/dist/chunk-6GZ7LM7S.js +2 -0
- package/dist/chunk-753JWTUH.js +3 -0
- package/dist/chunk-7II7NFRV.js +4 -0
- package/dist/{chunk-M7EEHYSU.js → chunk-7RAS466A.js} +2 -2
- package/dist/chunk-A46JTKTM.js +5 -0
- package/dist/{chunk-2XRXEIRK.js → chunk-AAMZRDJT.js} +2 -2
- package/dist/chunk-AMPN2VMF.js +3 -0
- package/dist/{chunk-6XA4LDHY.js → chunk-B3X6KU75.js} +2 -2
- package/dist/chunk-BFWVHD2P.js +16 -0
- package/dist/chunk-BVHP2B4D.js +61 -0
- package/dist/{chunk-BUNDZ6K2.js → chunk-BVUA3GZC.js} +2 -2
- package/dist/{chunk-EDSD3VJK.js → chunk-CKIAEVGM.js} +2 -2
- package/dist/chunk-CM4EZLW4.js +2 -0
- package/dist/chunk-CS3FXTUC.js +2 -0
- package/dist/chunk-CVBS2FD4.js +2 -0
- package/dist/chunk-D5OXYOJP.js +7 -0
- package/dist/chunk-DA34GNNO.js +29 -0
- package/dist/chunk-DKK2H4D7.js +7 -0
- package/dist/chunk-EBSSCVR4.js +5 -0
- package/dist/{chunk-OXTM2RX3.js → chunk-EVCSXWER.js} +2 -2
- package/dist/chunk-FFIYGYQR.js +67 -0
- package/dist/chunk-G4KQ7S74.js +20 -0
- package/dist/{chunk-44P4SJFN.js → chunk-GWWYLYD3.js} +2 -2
- package/dist/chunk-HGUNWXJX.js +2 -0
- package/dist/chunk-HLRWOFXC.js +9 -0
- package/dist/{chunk-YQKECTPV.js → chunk-IRIM3SUR.js} +2 -2
- package/dist/chunk-JHK2DMUQ.js +4 -0
- package/dist/chunk-JQ2PCFZW.js +3 -0
- package/dist/chunk-JRFCWCOD.js +16 -0
- package/dist/chunk-JXAJDINF.js +2 -0
- package/dist/chunk-K32ZOW3P.js +2 -0
- package/dist/{chunk-3H5OSDF7.js → chunk-KI4WPR7Q.js} +2 -2
- package/dist/{chunk-43GKP6LI.js → chunk-KP2DJY7D.js} +2 -2
- package/dist/{chunk-YTVKPJXW.js → chunk-L27UIF3E.js} +2 -2
- package/dist/chunk-LT6AHYVY.js +18 -0
- package/dist/chunk-MCNWCJYL.js +11 -0
- package/dist/{chunk-K6UI6EBZ.js → chunk-MZB3DTHW.js} +2 -2
- package/dist/chunk-NLRWGGPY.js +8 -0
- package/dist/chunk-NLVKD45E.js +13 -0
- package/dist/chunk-OO6S4ECV.js +112 -0
- package/dist/{chunk-QYOPMTZ6.js → chunk-OYGKBDAD.js} +2 -2
- package/dist/chunk-P5QZILZ4.js +2 -0
- package/dist/chunk-P5XHIJHI.js +2 -0
- package/dist/chunk-PCCMMI2M.js +3 -0
- package/dist/{chunk-2TPCIPYA.js → chunk-Q65QYKU7.js} +2 -2
- package/dist/{chunk-K7SPOJHZ.js → chunk-QB7NRST4.js} +2 -2
- package/dist/{chunk-7JZRFDCU.js → chunk-QSNG3NHQ.js} +2 -2
- package/dist/chunk-QVZSWLLZ.js +2 -0
- package/dist/chunk-RLB7FZKR.js +10 -0
- package/dist/{chunk-KYB7FPXT.js → chunk-RPMT6MTX.js} +2 -2
- package/dist/chunk-RQWNF2RM.js +2 -0
- package/dist/chunk-RYFIRFYJ.js +4 -0
- package/dist/{chunk-QARYU7R3.js → chunk-S2FZILCF.js} +2 -2
- package/dist/{chunk-HV27H2V2.js → chunk-S3IXCXW2.js} +2 -2
- package/dist/{chunk-TYCZ7S4I.js → chunk-S5MTSES5.js} +2 -2
- package/dist/chunk-S5RZQA6V.js +2 -0
- package/dist/{chunk-PEHDARNC.js → chunk-SEEJPIWG.js} +2 -2
- package/dist/chunk-SOCS3467.js +2 -0
- package/dist/chunk-U6BJVXWQ.js +2 -0
- package/dist/chunk-UO4IADXJ.js +38 -0
- package/dist/{chunk-ZEO4CXQR.js → chunk-VLSI5MYU.js} +2 -2
- package/dist/chunk-VSQRU3AP.js +2 -0
- package/dist/chunk-VYQY75NA.js +2 -0
- package/dist/{chunk-NOKUZU56.js → chunk-VZCR3VQY.js} +2 -2
- package/dist/chunk-W3ZVRLCH.js +2 -0
- package/dist/chunk-WA64GKWB.js +20 -0
- package/dist/chunk-WFRZGMWJ.js +71 -0
- package/dist/chunk-WN6XEYVX.js +2 -0
- package/dist/chunk-XAEU4ROB.js +101 -0
- package/dist/chunk-XBPAJASV.js +2 -0
- package/dist/{chunk-GY3HAWUA.js → chunk-XC6PUFNN.js} +2 -2
- package/dist/chunk-Y42DMR6F.js +6 -0
- package/dist/chunk-YCVYOV4A.js +7 -0
- package/dist/{chunk-WPZPB42I.js → chunk-YD37KSEK.js} +2 -2
- package/dist/{chunk-V5W7H7V4.js → chunk-YFEJIYWH.js} +2 -2
- package/dist/chunk-YSUD2S7T.js +3 -0
- package/dist/{chunk-KJCDEDQW.js → chunk-ZEKBAMCN.js} +2 -2
- package/dist/chunk-ZHGUZKJL.js +2 -0
- package/dist/cli.js +587 -305
- package/dist/{config-types-BrHl3Bge.d.ts → config-types-SVkUIufk.d.ts} +10 -2
- package/dist/{db-_Bdx0E1W.d.ts → db-CS0TuVH6.d.ts} +1 -1
- package/dist/{git-history-Dao3_Pu9.d.ts → git-history-ChNHbfZQ.d.ts} +2 -1
- package/dist/{health-BEZ1Rt0S.d.ts → health-Btal3mQi.d.ts} +4 -4
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -19
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +8 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +4 -3
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +3 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +5 -4
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +12 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -3
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +5 -4
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +3 -3
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +11 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +3 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -4
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +4 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +4 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +4 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +4 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +4 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +256 -12
- package/dist/reindex.d.ts +29 -3
- package/dist/reindex.js +251 -22
- package/dist/runtime.d.ts +8 -4
- package/dist/runtime.js +2 -2
- package/dist/rust-semantic-session-server.js +2 -0
- package/dist/rust-semantic-session-worker.js +2 -0
- package/dist/rust-semantic-worker.js +2 -0
- package/dist/{scip-cli-C7cg4ZHR.d.ts → scip-cli-BKL-26TZ.d.ts} +2 -2
- package/dist/{symbol-types-DaoeXKUt.d.ts → symbol-types-BgWU6lhL.d.ts} +2 -0
- package/dist/watch-server.js +42 -0
- package/docs/AGENT_GUIDE.md +110 -34
- package/docs/AI_FAILURE_MODES.md +8 -3
- package/docs/COMMAND_REFERENCE.md +11 -6
- package/docs/REGEX_POLICY.md +3 -1
- package/docs/accuracy-audit-checklist.md +300 -0
- package/docs/accuracy-hardening-goal.md +493 -54
- package/docs/analyzer-inventory.md +31 -23
- package/docs/analyzer-validation-ledger.md +51 -21
- package/package.json +2 -1
- package/scripts/build-scip-windows.mjs +7 -7
- package/skills/_shared/SKILL.md +21 -18
- package/skills/scip-calibrate/SKILL.md +9 -3
- package/skills/scip-hyper-optimization/SKILL.md +5 -1
- package/skills/scip-query/SKILL.md +1 -1
- package/skills/scip-setup/SKILL.md +104 -4
- package/skills/scip-verify/SKILL.md +24 -13
- package/dist/chunk-27HMTUJE.js +0 -3
- package/dist/chunk-27XEGMCT.js +0 -7
- package/dist/chunk-3AMWF6V5.js +0 -3
- package/dist/chunk-5AAAEZ2Z.js +0 -2
- package/dist/chunk-5JRMZMLM.js +0 -2
- package/dist/chunk-5VY3RIEI.js +0 -38
- package/dist/chunk-6JUAGXR4.js +0 -4
- package/dist/chunk-6KDOYKCB.js +0 -40
- package/dist/chunk-6KMTPNZL.js +0 -3
- package/dist/chunk-7COVQPQQ.js +0 -9
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7TVFPOD7.js +0 -102
- package/dist/chunk-A6KSEIRN.js +0 -61
- package/dist/chunk-AAMURYOK.js +0 -4
- package/dist/chunk-BP7S6V3M.js +0 -20
- package/dist/chunk-BRBF3E5X.js +0 -35
- package/dist/chunk-BZXE3HO4.js +0 -6
- package/dist/chunk-CXQQOXSI.js +0 -10
- package/dist/chunk-EVZSAR3S.js +0 -2
- package/dist/chunk-GMOEX7EV.js +0 -2
- package/dist/chunk-GNG622H3.js +0 -3
- package/dist/chunk-GUDKRIGW.js +0 -7
- package/dist/chunk-GULVO6NF.js +0 -43
- package/dist/chunk-HZZQKNVE.js +0 -2
- package/dist/chunk-I4R3SNMR.js +0 -2
- package/dist/chunk-IMQFJ53K.js +0 -2
- package/dist/chunk-ISLWJ4PY.js +0 -10
- package/dist/chunk-IUSSGHJO.js +0 -2
- package/dist/chunk-J5WVNZ6O.js +0 -2
- package/dist/chunk-JJUX2OAP.js +0 -2
- package/dist/chunk-JZBGTSAB.js +0 -13
- package/dist/chunk-K5N5RNGM.js +0 -2
- package/dist/chunk-KSJ544IV.js +0 -5
- package/dist/chunk-LY7NMOBW.js +0 -2
- package/dist/chunk-N23FT4EZ.js +0 -2
- package/dist/chunk-NCVFKOLB.js +0 -2
- package/dist/chunk-PESEPWZO.js +0 -2
- package/dist/chunk-PMY4UFGV.js +0 -2
- package/dist/chunk-Q7PWDXL5.js +0 -5
- package/dist/chunk-QVGFVRKD.js +0 -2
- package/dist/chunk-R5336VHZ.js +0 -2
- package/dist/chunk-RLB6SG25.js +0 -2
- package/dist/chunk-SFDVBARK.js +0 -2
- package/dist/chunk-TG7QSYCJ.js +0 -2
- package/dist/chunk-U3VMUDXJ.js +0 -2
- package/dist/chunk-UHPWZCYQ.js +0 -3
- package/dist/chunk-URSSPS5H.js +0 -2
- package/dist/chunk-WIBFXSYB.js +0 -6
- package/dist/chunk-WMO2VZZK.js +0 -3
- package/dist/chunk-WS3Z6W3M.js +0 -65
- package/dist/chunk-X3DTIEMU.js +0 -18
- package/dist/chunk-X5C43YVI.js +0 -2
- package/dist/chunk-X7CHWTZ2.js +0 -72
- package/dist/chunk-XC2PJOVM.js +0 -3
- package/dist/chunk-XDESMVOL.js +0 -4
- package/dist/chunk-XZBLZHXL.js +0 -16
- package/dist/chunk-ZMGBWSFZ.js +0 -2
package/dist/chunk-JZBGTSAB.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import{A as R,B as He,C as he,D as Je,E as Ke,c as De,d as Oe,e as _,f as Me,g as ve,h as $e,i as B,j as Ue,k as H,l as qe,m as Be,n as ze,o as L,p as J,q as k,r as me,s as fe,t as S,u as de,v as Ve,w as ge,x as Q,y as G,z as We}from"./chunk-ISLWJ4PY.js";import{b as W,i as Se,m as K,o as X,p as A}from"./chunk-WS3Z6W3M.js";import{b as ne}from"./chunk-GNG622H3.js";import{a as je,c as q,f as re}from"./chunk-7S5E7KWT.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Et(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 qn(e){return Xe(e,{maskStrings:!1})}function Bn(e){return Xe(e,{maskStrings:!0})}function Xe(e,r){let t="",n=0,s=e.length;for(;n<s;){if(e[n]==="/"&&e[n+1]==="/"){let i=e.indexOf(`
|
|
2
|
-
`,n),a=i===-1?s:i;t+=xe(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+=xe(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
|
-
`)break;a+=1}t+=r.maskStrings?xe(e,n,a):e.slice(n,a),n=a;continue}t+=o,n+=1}return t}function xe(e,r,t){let n="";for(let s=r;s<t;s+=1)n+=e[s]===`
|
|
4
|
-
`?`
|
|
5
|
-
`:" ";return n}function w(e){return e.replace(/[^\r\n]/g," ")}var zn=re("stripped-lines",{clearGroups:["whole-project","source-file"]});je({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function Tt(e){return se===e||(se=e,Y=Et(e)),Y}function j(e,r,t){let n=Tt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function ye(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Ft=new Set(["identifier","type_identifier","field_identifier"]),Lt=new Set(["identifier"]),kt=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),At=new Set(["rust","python"]),wt=/\{([^{}]*)\}/g,jt=/\b([A-Za-z_][\w]*)\b/g;function Qe(e,r){return Dt(r).has(e.type)}function Ge(e,r){return At.has(r)&&e.type==="string_content"}function be(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function Dt(e){return e==="rust"?Ft:e==="python"?Lt:kt}function Ye(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(wt)){let s=n[1]??"";for(let o of s.matchAll(jt))o[1]&&r(o[1],t)}}var Ot=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Mt=/^#!?\[\s*serde\s*\(/,vt=/^#!?\[\s*schemars\s*\(/,$t=/^#!?\[\s*validate\s*\(/,Ut=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Ze(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=he(n);if(!s||!Ut.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function et(e,r){let t=Mt.test(e),n=vt.test(e),s=$t.test(e);if(!(!t&&!n&&!s))for(let o of Ot){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function tt(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="block");if(c)for(let l of c.descendantsOfType("type"))for(let p of l.descendantsOfType("identifier"))p.text!==a&&n(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var qt=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),Ne=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function rt(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
6
|
-
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Bt(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ie(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ce(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let f={text:m,line:p};zt(o[o.length-1],f),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Kt(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Bt(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=qt.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Vt(e,r),!n||Ne.has(t.text)||Ne.has(n)||n.startsWith(":"))return;let o=Jt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function zt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Vt(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Ht(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(Wt)}function Wt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!Ne.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Ht(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Jt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
7
|
-
`;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
8
|
-
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ie(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ce(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Kt(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var Xt=re("source-facts",{clearGroups:["whole-project","source-file"]}),Pe=K({kind:"source-facts",invalidation:X("source-facts"),serialize:Zt,deserialize:er});function T(e,r){return Qt(e,r).facts}function Qt(e,r){let t=A(e,r);if(!t)return{facts:null};let n=Gt(e,r,t);return n?Xt.get(e,r,t,()=>Yt(e,r,n,t)):{facts:null}}function Gt(e,r,t){return G(r)?We(e,r,t)?.language??null:Q(r)}function Yt(e,r,t,n){let s=W(e,r,n),o=Pe.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=rt(n);return Pe.write(e,r,s,c),{facts:c}}let i=R(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=sr(i,t);return Pe.write(e,r,s,a),{facts:a}}function Zt(e){let r={language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function er(e){try{let r=JSON.parse(e);if(r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:be(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function tr(e,r,t,n){let s=T(e,r);return s?nr(s,t,n)?.isLiteralPassthrough??!0:!0}function rr(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function nr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function sr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=Je(l,r);p&&t.push(p);let u=He(l,r);u&&n.push(u),Ze(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&et(l.text,s),Qe(l,r)&&a(l.text,l.startPosition.row),Ge(l,r)&&Ye(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:tt(e,r),identifierLineMap:i,identifiersByLine:be(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var nt=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function or(e,r){let t=T(e,r);return!t||!nt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function ir(e,r){let t=T(e,r);return!t||!nt.has(t.language)?null:t.callSites}function ar(e,r){return T(e,r)?.typeContainerMap??new Map}function cr(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as st}from"path";var lr=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&lr.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function E(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,ze(r)),kind:"named",used:x(t,o),usedMembers:[]}}function d(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=R(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=R(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function ot(e,r,t){return C(e,r,n=>ur(e,r,n),()=>pr(e,r,t))}function pr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=st(o).replace(/\.[^.]+$/,"");return[F(o,i,fe(e,r,o),x(s,i))]})}function ur(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=st(i).replace(/\.[^.]+$/,"");s.push(d(i,a,fe(e,r,i),n))}return s}var mr=new Set([":require",":require-macros",":use"]),Ee=String.raw`A-Za-z0-9_$*+!?.<>=-`;function at(e,r,t){let n=Cr(t);if(!n)return[];let s=Ir(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(mr.has(a)){for(let c of gr(i.children.slice(1)))o.push(...dr(e,c,s));continue}if(a===":import")for(let c of hr(i.children.slice(1)))o.push(c)}}return o}function fr(e){return e.type==="list"&&P(e.children[0])==="ns"}function dr(e,r,t){let n=Ve(e,r.namespace),s=r.alias??r.namespace,o=yr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||br(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:Nr(t,a),usedMembers:[]});return i}function gr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:Re(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):Sr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,Re(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function Sr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:Re(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(xr)),s+=1)}return[n]}function hr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function Re(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function xr(e){return!!(e&&!e.startsWith(":"))}function yr(e,r){let t=new Set,n=new RegExp(`${Te()}${O(r)}\\s*/\\s*([${Ee}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function br(e,r){return new RegExp(`${Te()}${O(r)}\\s*/`,"m").test(e)}function Nr(e,r){return new RegExp(`${Te()}${O(r)}(?![${Ee}])`,"m").test(e)}function Te(){return`(?<![${Ee}])`}function Ir(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
9
|
-
`?`
|
|
10
|
-
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=it(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=it(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Cr(e){let r=0;for(;r<e.length&&(r=Fe(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(fr(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Fe(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Pr(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(;Ie(e[t]);)t+=1;let n=e[t];return n?n==="("?_e(e,t,"list",")"):n==="["?_e(e,t,"vector","]"):n==="{"?_e(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Rr(e,t):null}function Pr(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"?_r(n.form.children):[],start:r,end:n.index},index:n.index}:null}function _r(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 _e(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Fe(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 Rr(e,r){let t=r;for(;t<e.length&&!Ce(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Fe(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 it(e){return e.replace(/[^\r\n]/g," ")}function ct(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:de(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function lt(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:de(e,r,o)})}return n}function pt(e,r,t){return ae(e,r,{csharp:n=>Tr(e,r,n),vb:n=>Er(e,r,n)},()=>{let n=Be(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[E(e,r,o,p,u,m,S(e,p,B))]})})}function Er(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 Tr(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 Fr=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function ut(e,r){return Fr.get(e,r,()=>{let t=new Set,n=A(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=>kr(e,r,n),()=>Lr(e,r,t))}function Lr(e,r,t){return Br(t).flatMap(n=>zr(e,r,n.clause,n.specifier,n.start,n.end,t))}function kr(e,r,t){let n=Ar(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...wr(e,r,t,o,n));return s}function Ar(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of ut(e,r))n.add(s);return n}function wr(e,r,t,n,s){let o=vr(n);if(!o)return[];let i=L(e,r,o),a=b(n,"import_clause");return a?jr(t,a,i,s,$r(n.text)):[M("*",i)]}function jr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(Dr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=Or(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Mr(i,t,n,s));return o}function Dr(e,r,t,n){return d("default",e,r,t,"default",{isTypeOnly:n})}function Or(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=qr(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Mr(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||Ur(o.text)}))}return s}function vr(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function $r(e){return/^\s*import\s+type\b/.test(e)}function Ur(e){return/^\s*type\b/.test(e.trim())}function qr(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 Br(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 zr(e,r,t,n,s,o,i){let a=L(e,r,n),c=j(i,s,o);return t?Vr(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 Vr(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=Wr(n),i=[];return s&&i.push(...mt(s,t)),o&&i.push(...mt(o,t)),i}function mt(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 Wr(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=R(e,r);return n?Gr(e,r,n):Hr(e,r,t)}function Hr(e,r,t){return[...Jr(e,r,t),...Kr(e,r,t),...Xr(e,r,t)]}function Jr(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=>Qr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:L(e,r,a),names:c,startLine:l,endLine:p})}return n}function Kr(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:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Xr(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:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Qr(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 Gr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Yr(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=Zr(s,o,i,a);n.push(c)}return n}function Yr(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return L(e,r,s.text)}function Zr(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 ft(e,r,t){return ae(e,r,{java:n=>en(e,r,n),kotlin:n=>tn(e,r,n),scala:n=>rn(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?nn(e,r,o,s):[]}))}function en(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 tn(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 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.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 nn(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[E(e,r,n,m,p,u)]})}return[E(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function gt(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?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[E(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function sn(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}=dt(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}=dt(c,"");l&&o(u,l,p)}}return s}function dt(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 ht(e,r,t){return C(e,r,n=>on(e,r,n),()=>cn(t).flatMap(n=>pn(e,r,n,t)))}function on(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=St(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=an(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=St(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function St(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 an(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 cn(e){let r=e.split(`
|
|
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=ye(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
12
|
-
${m}`,l+=1+m.length,p+=ye(m),n+=m.length+1}let u=ln(c);u&&t.push({...u,start:a,end:l})}return t}function ln(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 pn(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 un}from"path";function xt(e,r,t){return C(e,r,n=>fn(e,r,n),()=>mn(e,r,t))}function mn(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"?me(e,r,i):null;if(a){let c=yt(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function fn(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"?me(e,r,u):null;if(m){let f=yt(u);s.push(d(f,f,m,n))}else s.push(M(u,m))}return s}function yt(e){return Ke(un(e).replace(/\.[^.]+$/,""),/_/)}function bt(e,r,t){return C(e,r,n=>dn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?gn(e,r,o,s):[]}))}function dn(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=k(e,r,a.qualifiedName)??k(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"self":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),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 gn(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||f==="self")return[];let[h,$]=f.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let _t=($??U.split("::").pop()??U).trim(),Rt=`${p}::${U}`.replace(/::::/g,"::");return[E(e,r,n,Rt,U.split("::").pop()??U,_t,k(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=k(e,r,a)??k(e,r,a.split("::").slice(0,-1).join("::"));return[E(e,r,n,a,a.split("::").pop()??a,c,l)]}function Nt(e,r,t){let n=R(e,r);if(n)return Sn(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(...xn(e,r,i))}return s}function Sn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!hn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(Ae(e,r,i.qualifiedName))}return n}function hn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function xn(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[Ae(e,r,l)]})}return[Ae(e,r,n)]}function Ae(e,r,t){return{specifier:t,sourcePath:k(e,r,t)??k(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 It(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 yn={language:"javascript",extensions:De,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Le,parseReExports:ke},bn=D({language:"python",extensions:Oe,imports:"ast-with-regex-fallback",parseImports:ht}),Nn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:ft}),In={language:"rust",extensions:Me,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:bt,parseExports:Nt},Cn=D({language:"ruby",extensions:ve,imports:"ast-with-regex-fallback",parseImports:xt}),Pn=D({language:"c/cpp",extensions:$e,imports:"ast-with-regex-fallback",parseImports:ot}),_n=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:pt}),Rn={language:"dart",extensions:Ue,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:ct,parseExports:lt},En=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:gt}),Tn=D({language:"clojure",extensions:qe,imports:"regex-only",parseImports:at}),Fn=[yn,bn,Nn,In,Cn,Pn,_n,Rn,En,Tn];function ue(e){return It(Fn,e)}var we={clearGroups:["whole-project","source-file"]},Ln=q("source-imports",we),kn=q("source-exports",we),An=q("source-reexports",we),Ct=K({kind:"source-imports",invalidation:X("source-imports"),serialize:wn,deserialize:jn}),Pt=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:Dn,deserialize:On});function Jo(e,r){let t=ne(r);return An.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=A(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Pt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return Pt.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Ko(e,r){let t=ne(r);return Ln.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=A(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Ct.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Ct.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Xo(e,r){let t=ne(r);return kn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=A(e,t);return s?n.parseExports(e,t,s):[]})}function wn(e){return JSON.stringify(e)}function jn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function Dn(e){return JSON.stringify(e)}function On(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,Et as b,qn as c,Bn as d,ye as e,T as f,Qt as g,tr as h,rr as i,or as j,ir as k,ar as l,cr as m,Jo as n,Ko as o,Xo as p};
|
|
13
|
-
//# sourceMappingURL=chunk-JZBGTSAB.js.map
|
package/dist/chunk-K5N5RNGM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as D}from"./chunk-URSSPS5H.js";import{a as F}from"./chunk-TG7QSYCJ.js";import{a as f}from"./chunk-5AAAEZ2Z.js";import{a as g}from"./chunk-J5WVNZ6O.js";import{a as h}from"./chunk-7COVQPQQ.js";import{e as y}from"./chunk-KSJ544IV.js";import{h as p}from"./chunk-GNG622H3.js";var v=.7,R=.62,S=.45;function Y(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=h(i).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let l=I(s,e);if(l.size===0)return{available:!0,windowCommits:e,findings:[]};let d=A(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:l}).map(r=>w(r,s,e)).filter(r=>r!==null);d.sort((r,c)=>(r.kind===c.kind?0:r.kind==="echo"?-1:1)||c.similarity-r.similarity||r.echoFile.localeCompare(c.echoFile)||r.echoSymbol.localeCompare(c.echoSymbol)||r.domain.localeCompare(c.domain));let b=d.slice(0,n).map(T);return{available:!0,windowCommits:e,findings:b,rootCauseGroups:N(b)}}function A(i,t){let e=P(t.limit),n=[...B(i,{scope:t.scope,minSimilarity:t.minSimilarity??v,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=p(i,{scope:t.scope});return a.react&&n.push(...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??R,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function B(i,t){return y(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).map(e=>({domain:"callable",basis:e.similarityBasis??"callees",symbolA:e.shortNameA,fileA:e.fileA,symbolB:e.shortNameB,fileB:e.fileB,similarity:e.similarity,sharedEvidence:e.sharedCallees,sharedCallees:e.sharedCallees}))}function k(i,t){return u(i,t,{query:f,domain:"react-component",basis:"jsx-structure",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["component",e.sharedComponents],["tag",e.sharedNativeTags],["prop",e.sharedProps],["event",e.sharedEvents],["binding",e.sharedBindings]]})}function u(i,t,e){return e.query(i,t).filter(n=>n.fileA!==n.fileB).map(n=>({domain:e.domain,basis:e.basis,symbolA:e.symbolA(n),fileA:n.fileA,symbolB:e.symbolB(n),fileB:n.fileB,similarity:n.similarity,sharedEvidence:K(...e.evidenceBuckets(n)),sharedCallees:[]}))}function E(i,t){return u(i,t,{query:g,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}function L(i,t){return u(i,t,{query:F,domain:"vue-component",basis:"vue-template",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["component",e.sharedComponents],["prop",e.sharedProps],["event",e.sharedEvents],["directive",e.sharedDirectives],["slot",e.sharedSlots],["identifier",e.sharedIdentifiers]]})}function x(i,t){return u(i,t,{query:D,domain:"vue-composable",basis:"vue-behavior",symbolA:e=>m(e.fileA),symbolB:e=>m(e.fileB),evidenceBuckets:e=>[["composable",e.sharedComposables],["store",e.sharedStores],["reactivity",e.sharedReactivity],["lifecycle",e.sharedLifecycle],["request",e.sharedRequests],["function",e.sharedFunctions],["action",e.sharedFunctionVerbs],["binding",e.sharedBindings],["template-event",e.sharedTemplateEvents]]})}function I(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function w(i,t,e){let n=t.get(i.fileA)?.commitsAgo??null,a=t.get(i.fileB)?.commitsAgo??null,o=n!==null&&n<=e,s=a!==null&&a<=e;if(!o&&!s)return null;if(o&&s){let l=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:l?i.symbolA:i.symbolB,echoFile:l?i.fileA:i.fileB,echoAgeCommits:(l?n:a)??0,establishedSymbol:l?i.symbolB:i.symbolA,establishedFile:l?i.fileB:i.fileA,establishedAgeCommits:l?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}return{kind:"echo",domain:i.domain,basis:i.basis,echoSymbol:o?i.symbolA:i.symbolB,echoFile:o?i.fileA:i.fileB,echoAgeCommits:(o?n:a)??0,establishedSymbol:o?i.symbolB:i.symbolA,establishedFile:o?i.fileB:i.fileA,establishedAgeCommits:o?a:n,similarity:i.similarity,sharedEvidence:i.sharedEvidence,sharedCallees:i.sharedCallees}}function T(i){let t=C(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function C(i){if(i.kind==="echo")return["echo",i.domain,i.basis,i.establishedSymbol].join(":");let t=i.sharedEvidence.slice().sort().join("|"),e=[i.echoSymbol,i.establishedSymbol].sort().join("|");return["twin",i.domain,i.basis,t||e].join(":")}function N(i){let t=new Map;for(let[e,n]of i.entries()){let a=n.rootCauseKey??C(n),o=n.groupKey??`recent-duplicate:${a}`,s=t.get(o);s||(s={groupKey:o,rootCauseKey:a,kind:n.kind,domain:n.domain,basis:n.basis,count:0,maxSimilarity:n.similarity,findingIndexes:[],echoFiles:new Set,establishedFile:n.kind==="echo"?n.establishedFile:void 0,establishedSymbol:n.kind==="echo"?n.establishedSymbol:void 0,relatedFiles:new Set,sharedEvidence:new Set,recommendation:O(n)},t.set(o,s)),s.count+=1,s.maxSimilarity=Math.max(s.maxSimilarity,n.similarity),s.findingIndexes.push(e),s.echoFiles.add(n.echoFile),s.relatedFiles.add(n.echoFile),s.relatedFiles.add(n.establishedFile);for(let l of n.sharedEvidence)s.sharedEvidence.add(l)}return[...t.values()].map(e=>({...e,echoFiles:[...e.echoFiles].sort(),relatedFiles:[...e.relatedFiles].sort(),sharedEvidence:[...e.sharedEvidence].sort().slice(0,16)})).sort((e,n)=>n.count-e.count||n.maxSimilarity-e.maxSimilarity||e.groupKey.localeCompare(n.groupKey))}function O(i){return i.kind==="echo"?"Review the established side once, then migrate or delete every echo in this group.":"Pick one owner for the new twins and consolidate the group before the copies diverge."}function P(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function K(...i){let t=[],e=new Set;for(let[n,a]of i)for(let o of a){let s=`${n}:${o}`;e.has(s)||(e.add(s),t.push(s))}return t}function m(i){return(i.split("/").pop()??i).replace(/\.[^.]+$/,"")}export{Y as a};
|
|
2
|
-
//# sourceMappingURL=chunk-K5N5RNGM.js.map
|
package/dist/chunk-KSJ544IV.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as ie,b as N,e as V,f as j,g as E,h as te,i as re}from"./chunk-KMVGRIO2.js";import{b as _}from"./chunk-B75HZHUP.js";import{a as q}from"./chunk-IMQFJ53K.js";import{a as ne}from"./chunk-5VY3RIEI.js";import{a as D}from"./chunk-27HMTUJE.js";import{d as I,e as K,h as $}from"./chunk-X5C43YVI.js";import{a as B}from"./chunk-JZBGTSAB.js";import{b as J,k as A,l as y,m as Q,o as ee,p as U,q as H}from"./chunk-WS3Z6W3M.js";import{a as Y}from"./chunk-64MNV6AB.js";import{d as z}from"./chunk-7S5E7KWT.js";function Ie(e,n,t={}){let{minSimilarity:i=.4,limit:r=20}=t,s=Ee(e,n,{semantic:t.semantic!==!1});if(!s)return[];if(!$(s.symbol))return[];if(s.callees.size===0)return se(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"});let a=we(e,s,i,{scanLimit:t.scanLimit,semantic:t.semantic!==!1});return a.length>0?a.slice(0,r):se(e,n,{minSimilarity:i,limit:r,scanLimit:t.scanLimit,candidateMode:t.sourceCandidateMode??"full"})}function vn(e,n,t,i={}){let r=D(e,n),s=D(e,t);if(!r||!s)return null;let a=Ie(e,r.symbol,{minSimilarity:0,limit:Number.POSITIVE_INFINITY,semantic:i.semantic,scanLimit:i.scanLimit}).find(m=>m.symbolB===s.symbol||m.symbolA===s.symbol);if(!a)return null;let l=r.endLine-r.startLine+1,c=s.endLine-s.startLine+1;return{symbolA:{symbol:r.symbol,shortName:I(r.symbol),file:r.relativePath,loc:l},symbolB:{symbol:s.symbol,shortName:I(s.symbol),file:s.relativePath,loc:c},similarity:a.similarity,similarityBasis:a.similarityBasis??"callees",sharedEvidence:a.sharedCallees,uniqueToA:a.uniqueToA,uniqueToB:a.uniqueToB,evidenceClass:a.evidenceClass,actionTier:a.actionTier,recommendation:a.recommendation,consolidationStrategy:ve(a)}}function ve(e){let n=e.similarityBasis==="source-tokens"?"source-token":"tracked callee";return e.sharedCallees.length===0?`No shared ${n} evidence survived similar's weighting. Inspect the source before attempting consolidation.`:e.uniqueToA.length===0&&e.uniqueToB.length===0?`The functions have identical ${n} evidence under similar's weighting. Verify signatures, guards, and return values before consolidating.`:e.uniqueToA.length===0?`A's ${n} evidence is a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToB.length===0?`B's ${n} evidence is a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic first.`:e.uniqueToA.length<=2&&e.uniqueToB.length<=2?`Create a shared helper around the ${e.sharedCallees.length} shared ${n}(s). Pass the ${e.uniqueToA.length+e.uniqueToB.length} divergent point(s) as parameters or callbacks.`:`Extract the ${e.sharedCallees.length} shared ${n}(s) into a common helper. Keep each function's unique logic outside that helper (${e.uniqueToA.length} item(s) in A, ${e.uniqueToB.length} in B).`}function we(e,n,t,i){let r=G(e).calleeIndex({minCallees:3,scanLimit:i.scanLimit,semantic:i.semantic}),s=_e(n,r.corpus),a=Pe(s,r),l=Me(s,r),c=j(l),m=E(s.callees,l),g=[];for(let f of a){if(f.callees.size<3)continue;let o=E(f.callees,l),u=ce(s,f,l,{minSimilarity:t,requireSignificantShared:1,requireSharedCount:0,medianIdf:c,magnitudeA:m,magnitudeB:o});u&&g.push(u)}return g.sort((f,o)=>o.similarity-f.similarity),g}function Me(e,n){let t=new Map(n.docFreq);for(let i of e.callees)t.set(i,(t.get(i)??0)+1);return V(t,n.corpus.length+1)}function ce(e,n,t,i){let r=Le(e,n,t,i);if(!Re(r,i))return null;let{similarity:s,significantShared:a,trivialShared:l}=r,c=a.length>0?a:l,m=pe(c,"callees");return{symbolA:e.symbol,shortNameA:I(e.symbol),fileA:e.file,symbolB:n.symbol,shortNameB:I(n.symbol),fileB:n.file,similarity:s,similarityBasis:"callees",sharedCallees:c.map(I),uniqueToA:[...N(e.callees,n.callees)].map(I),uniqueToB:[...N(n.callees,e.callees)].map(I),...m}}function Te(e,n,t,i){let r=i.magnitudeA??E(e.callees,t),s=i.magnitudeB??E(n.callees,t),a=0,l=0,c=0,m=i.medianIdf??j(t);for(let o of e.callees){if(!n.callees.has(o))continue;let u=t.get(o)??0;a+=u*u,c+=1,u>=m&&(l+=1)}if(c===0)return!1;let g=r*s;return(g>0?a/g:0)<i.minSimilarity?!1:l>=i.requireSignificantShared||c>=i.requireSharedCount}function Le(e,n,t,i){return i.magnitudeA===void 0||i.magnitudeB===void 0?te(e.callees,n.callees,t,{medianIdf:i.medianIdf}):re(e.callees,n.callees,t,{medianIdf:i.medianIdf,magnitudeA:i.magnitudeA,magnitudeB:i.magnitudeB})}function Re(e,n){if(e.similarity<n.minSimilarity)return!1;let t=e.significantShared.length+e.trivialShared.length;return e.significantShared.length>=n.requireSignificantShared||t>=n.requireSharedCount}function wn(e,n={}){let{minSimilarity:t=.5,limit:i=20,scope:r,minCallees:s=4,crossFileOnly:a=!1,scanLimit:l}=n,c=n.semantic!==!1,m=A(),g=0,f=0,o=0,u=0,d=0,p=0,S=0;return y("similar.all",()=>{let b=G(e).calleeIndex({minCallees:s,scope:r,scanLimit:l,semantic:c}),C=b.corpus;g=C.length;let v=n.focusFiles,k=[],P=0;return y("similar.all.pair-scan",()=>{for(let x=0;x<C.length;x+=1){let F=C[x],T=v?.has(F.file)??!1,w=b.weightedMagnitudes[x],M=new Set;for(let O of F.callees){let L=b.candidateIndexesByCallee.get(O);if(L)for(let R of L)R<=x||v&&!T&&!v.has(C[R].file)||M.add(R)}m&&(o+=M.size,M.size>0&&(f+=1));for(let O of M){let L=C[O];if(a&&F.file===L.file){m&&(d+=1);continue}if(ue(F,L)){m&&(p+=1);continue}m&&(u+=1);let R=ce(F,L,b.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:b.medianIdf,magnitudeA:w,magnitudeB:b.weightedMagnitudes[O]});R&&(Ae(k,R,i,P),m&&(S+=1),P+=1)}}},()=>({corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S,topResults:k.length})),y("similar.all.sort-project",()=>(k.sort((x,F)=>F.result.similarity-x.result.similarity||x.order-F.order),k.map(x=>x.result)),()=>({topResults:k.length}))},()=>({minSimilarity:t,limit:i,scope:r,minCallees:s,crossFileOnly:a,scanLimit:l,semantic:c,corpusSize:g,candidateSets:f,candidatePairs:o,comparedPairs:u,crossFileSkips:d,signatureSkips:p,insertedResults:S}))}function Mn(e,n={}){let{minSimilarity:t=.5,scope:i,minCallees:r=4,crossFileOnly:s=!1,scanLimit:a}=n,l=n.semantic!==!1,c=A(),m=0,g=0,f=0,o=0,u=0,d=0,p=0;return y("similar.all-count",()=>{let h=G(e).calleeIndex({minCallees:r,scope:i,scanLimit:a,semantic:l}),b=h.corpus;m=b.length;let C=n.focusFiles;return y("similar.all-count.pair-scan",()=>{for(let v=0;v<b.length;v+=1){let k=b[v],P=C?.has(k.file)??!1,x=h.weightedMagnitudes[v],F=new Set;for(let T of k.callees){let w=h.candidateIndexesByCallee.get(T);if(w)for(let M of w)M<=v||C&&!P&&!C.has(b[M].file)||F.add(M)}c&&(f+=F.size,F.size>0&&(g+=1));for(let T of F){let w=b[T];if(s&&k.file===w.file){c&&(u+=1);continue}if(ue(k,w)){c&&(d+=1);continue}c&&(o+=1),Te(k,w,h.idfWeights,{minSimilarity:t,requireSignificantShared:2,requireSharedCount:4,medianIdf:h.medianIdf,magnitudeA:x,magnitudeB:h.weightedMagnitudes[T]})&&(p+=1)}}},()=>({corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p})),p},()=>({minSimilarity:t,scope:i,minCallees:r,crossFileOnly:s,scanLimit:a,semantic:l,corpusSize:m,candidateSets:g,candidatePairs:f,comparedPairs:o,crossFileSkips:u,signatureSkips:d,insertedResults:p}))}function ue(e,n){if(e.paramCount<0||n.paramCount<0)return!1;let t=Math.abs(e.paramCount-n.paramCount),i=Math.max(2,Math.ceil(Math.max(e.paramCount,n.paramCount)*.5));return t>i}var me=Q({kind:"source-fingerprints",invalidation:ee("source-fingerprints"),serialize:ln,deserialize:on});function Ae(e,n,t,i){if(t<=0)return;if(e.length<t){e.push({result:n,order:i});return}let r=0;for(let a=1;a<e.length;a+=1){let l=e[a],c=e[r];(l.result.similarity<c.result.similarity||l.result.similarity===c.result.similarity&&l.order>c.order)&&(r=a)}let s=e[r];n.similarity<=s.result.similarity||(e[r]={result:n,order:i})}var Be=["ScipDatabase#all","ScipDatabase#get","ScipDatabase#prepare","ScipDatabase#pathExclusionsFor","ScipDatabase#isIgnored","ScipDatabase#symbolNoiseFor","PerDbValue#get","PerDbValue#has",":storage:db:ScipDatabase:all",":storage:db:ScipDatabase:get",":storage:db:ScipDatabase:prepare",":storage:db:ScipDatabase:pathExclusionsFor",":storage:db:ScipDatabase:isIgnored",":storage:db:ScipDatabase:symbolNoiseFor",":storage:per-db-cache:PerDbValue:get",":storage:per-db-cache:PerDbValue:has"];function Ee(e,n,t){let i=D(e,n);if(!i||!$(i.symbol))return null;let r=new q(e),s=ne(e,i,{semantic:t.semantic});return{symbol:i.symbol,file:i.relativePath,callees:ge(s.map(a=>a.symbol)),paramCount:r.callableSignature(i)?.paramCount??-1}}var ze=z("callee-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),De=z("callee-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function de(e,n){let{minCallees:t,scope:i,excludeSymbol:r,scanLimit:s}=n,a=n.semantic!==!1,l=ze.get(e,()=>new Map),c=`${t}|${i??""}|${s??""}|${a}`,m=!0,g=0,f=0;return y("similar.callee-fingerprints.resolve",()=>{let o=l.get(c);if(m=o!==void 0,o||(o=Oe(e,{minCallees:t,scope:i,scanLimit:s,semantic:a}),l.set(c,o)),g=o.length,r===void 0)return o;let u=o.filter(d=>d.symbol!==r);return f=o.length-u.length,u},()=>({minCallees:t,scope:i,scanLimit:s,semantic:a,cacheHit:m,corpusSize:g,excludeSymbol:r!==void 0,excludedSymbols:f}))}function qe(e,n){let{minCallees:t,scope:i,scanLimit:r}=n,s=n.semantic!==!1,a=De.get(e,()=>new Map),l=`${t}|${i??""}|${r??""}|${s}`,c=!0,m=0,g=0,f=0;return y("similar.callee-index.resolve",()=>{let o=a.get(l);return c=o!==void 0,o||(o=Ne(de(e,{minCallees:t,scope:i,scanLimit:r,semantic:s})),a.set(l,o)),m=o.corpus.length,g=o.docFreq.size,f=o.candidateIndexesByCallee.size,o},()=>({minCallees:t,scope:i,scanLimit:r,semantic:s,cacheHit:c,corpusSize:m,indexedCallees:g,candidateBuckets:f}))}function G(e){return{calleeCorpus:n=>de(e,n),calleeIndex:n=>qe(e,n),sourceCorpus:(n={})=>Ce(e,n),sourceIndex:(n={})=>le(e,n),sourceCandidates:(n,t)=>(t.candidateMode??"full")==="target-pruned"?Ye(e,n,{minSimilarity:t.minSimilarity,scanLimit:t.scanLimit}):Je(n,le(e,{scanLimit:t.scanLimit}))}}function Ne(e){let n=A(),t=0,i=y("similar.callee-index.doc-frequency",()=>{let o=new Map;for(let u of e)for(let d of u.callees)o.set(d,(o.get(d)??0)+1);return t=o.size,o},()=>({corpusSize:e.length,uniqueCallees:t})),r=Math.max(8,Math.ceil(Math.sqrt(e.length))),s=y("similar.callee-index.idf-weights",()=>V(i,e.length),()=>({corpusSize:e.length,uniqueCallees:i.size})),a=y("similar.callee-index.weighted-magnitudes",()=>e.map(o=>E(o.callees,s)),()=>({corpusSize:e.length})),l=0,c=0,m=0,g=y("similar.callee-index.candidate-buckets",()=>{let o=new Map;for(let u=0;u<e.length;u+=1){let d=e[u];for(let p of d.callees){if((i.get(p)??0)>r){n&&(c+=1);continue}let S=o.get(p);S||(S=[],o.set(p,S)),S.push(u),n&&(l+=1)}}return n&&(m=o.size),o},()=>({corpusSize:e.length,buckets:m,candidateRefs:l,ubiquitousSkips:c,ubiquityThreshold:r})),f=y("similar.callee-index.median-idf",()=>j(s),()=>({uniqueCallees:s.size}));return{corpus:e,candidateIndexesByCallee:g,docFreq:i,idfWeights:s,weightedMagnitudes:a,medianIdf:f,ubiquityThreshold:r}}function Pe(e,n){let t=new Map;for(let i of e.callees)for(let r of n.candidateIndexesByCallee.get(i)??[]){let s=n.corpus[r];s.symbol!==e.symbol&&t.set(s.symbol,s)}return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Oe(e,n){let{minCallees:t,scope:i,scanLimit:r,semantic:s}=n,a=A(),l=new q(e),c=0,m=y("similar.callee-fingerprints.candidates",()=>{let p=_(l.productionCallableDefinitions({scope:i,minLoc:5,sortByLocDesc:typeof r=="number"&&r>0}),r);return c=p.length,p},()=>({scope:i,scanLimit:r,candidateCount:c})),g=0,f=y("similar.callee-fingerprints.callee-map",()=>{let p=l.calleeMap(m,{semantic:s});if(a)for(let S of p.values())g+=S.length;return p},()=>({candidateCount:c,semantic:s,calleeEdges:g})),o=0,u=0,d=0;return y("similar.callee-fingerprints.shape",()=>{let p=m.map(b=>({symbol:b.symbol,file:b.relativePath,callees:ge((f.get(b.symbolId)??[]).map(C=>C.symbol)),paramCount:l.callableSignature(b)?.paramCount??-1})),S=$e(p);a&&(d=S.filter((b,C)=>b.callees.size!==p[C].callees.size).length);let h=S.filter(b=>b.callees.size>=t);return o=h.length,a&&(u=h.reduce((b,C)=>b+C.callees.size,0)),h},()=>({candidateCount:c,fingerprintCount:o,retainedCalleeCount:u,minCallees:t,siblingSaturatedFingerprints:d}))}var fe=5;function $e(e){let n=new Map;for(let t of e){let i=n.get(t.file);i||(i=new Map,n.set(t.file,i));for(let r of t.callees)i.set(r,(i.get(r)??0)+1)}return e.map(t=>{let i=n.get(t.file);if(!i)return t;let r=[...t.callees].filter(a=>(i.get(a)??0)>=fe);if(r.length===0)return t;let s=new Set(t.callees);for(let a of r)s.delete(a);return{...t,callees:s}})}function _e(e,n){let t=new Map;for(let s of n)if(!(s.file!==e.file||s.symbol===e.symbol))for(let a of s.callees)t.set(a,(t.get(a)??0)+1);let i=[...e.callees].filter(s=>(t.get(s)??0)+1>=fe);if(i.length===0)return e;let r=new Set(e.callees);for(let s of i)r.delete(s);return{...e,callees:r}}function ge(e){return new Set([...e].filter(n=>!je(n)))}function je(e){return Be.some(n=>e.includes(n))}function se(e,n,t){let i=Ke(e,n);if(!i||i.tokens.size<3)return[];let r=t.minSimilarity>=.5?t.minSimilarity:.3,s=[],a=t.candidateMode??"full",l=0,c=0,m=0,g=0;return y("similar.source-shape",()=>{let o=G(e).sourceCandidates(i,{minSimilarity:r,scanLimit:t.scanLimit,candidateMode:a});l=o.length;for(let u of o){if(u.symbol===i.symbol||u.tokens.size<3)continue;c+=1;let d=ie(i.tokens,u.tokens);if(d.size<2){m+=1;continue}let p=new Set([...i.tokens,...u.tokens]),S=p.size>0?d.size/p.size:0;if(S<r){g+=1;continue}s.push({symbolA:i.symbol,shortNameA:I(i.symbol),fileA:i.file,symbolB:u.symbol,shortNameB:I(u.symbol),fileB:u.file,similarity:S,similarityBasis:"source-tokens",sharedCallees:[...d].sort(),uniqueToA:[...N(i.tokens,u.tokens)].sort(),uniqueToB:[...N(u.tokens,i.tokens)].sort(),...pe([...d],"source-tokens")})}return s.sort((u,d)=>d.similarity-u.similarity||u.shortNameB.localeCompare(d.shortNameB)),s.slice(0,t.limit)},()=>({symbol:i.symbol,file:i.file,targetTokens:i.tokens.size,candidateMode:a,candidates:l,comparedPairs:c,sharedSkips:m,similaritySkips:g,results:s.length}))}function pe(e,n){let t=e.flatMap(W),i=e.flatMap(S=>ae(S,n)),r=Z(t,Se),s=Z(t,be),a=Z(i,X),l=[...new Set(i.filter(oe))],c=e.filter(S=>{let h=ae(S,n);return h.some(b=>X.has(b))&&h.some(oe)}).length,m=[];r.length>0&&m.push(`access/query scaffolding: ${r.slice(0,5).join(", ")}`),s.length>0&&m.push(`framework/generic scaffolding: ${s.slice(0,5).join(", ")}`),a.length>0&&m.push(`domain behavior verbs: ${a.slice(0,5).join(", ")}`),a.length>0&&l.length>0&&m.push(`domain-specific terms: ${l.slice(0,5).join(", ")}`);let g=n==="source-tokens"&&t.length>0&&t.every(S=>ye.has(S));g&&m.push("shared source tokens are generic scaffolding");let f=a.length>0&&l.length>0,o=r.length+s.length>0,u=n==="callees"&&f&&e.length>=4&&l.length>=4&&c>=2,d=u?"domain-behavior":f?o?"mixed":"domain-behavior":r.length>0?"access-query-scaffolding":s.length>0||g?"framework-scaffolding":"structural-overlap";d==="structural-overlap"&&e.length>0&&m.push(`shared ${n} overlap has no recognized domain or scaffolding category`);let p=d==="domain-behavior"&&(e.length>=3||u)?"direct":"signal";return{evidenceClass:d,actionTier:p,evidenceClassReasons:m,recommendation:Ge(d,p)}}function Ge(e,n){return n==="direct"?"Shared domain behavior looks concrete; review for an extract/reuse opportunity.":e==="mixed"?"Shared evidence mixes domain behavior with scaffolding; review semantics before extracting anything.":e==="access-query-scaffolding"?"Shared evidence is mostly access/query scaffolding; compare product semantics before reusing code.":e==="structural-overlap"?"Shared structure has no domain or scaffolding classification; inspect names and behavior before reusing code.":"Shared evidence is mostly framework or generic scaffolding; treat as a contextual signal."}function Z(e,n){return[...new Set(e.filter(t=>n.has(t)))]}function W(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1)}function ae(e,n){if(n==="source-tokens")return W(e);let t=K(e);return W(t.length>0?t:Ue(e))}function Ue(e){return e.replace(/[()`]/g," ").replace(/\.[a-z][a-z0-9]+(?=\s|$)/gi," ").split(/[:/\\\s]+/).map(i=>i.trim()).filter(i=>/[A-Za-z]/.test(i)).at(-1)?.replace(/\.$/,"")??e}function oe(e){return e.length>3&&!X.has(e)&&!Se.has(e)&&!be.has(e)&&!ye.has(e)&&!He.has(e)}var X=new Set(["archive","assign","book","cancel","create","delete","ensure","export","import","notify","persist","publish","restore","schedule","send","set","submit","sync","update","upload","validate","write"]),Se=new Set(["access","auth","authorize","cache","context","db","find","get","guard","list","permission","permissions","prisma","query","request","response","role","route","session","sql","where"]),be=new Set(["bytes","computed","crypto","describe","effect","expect","fetch","filter","hex","hook","json","map","mounted","on","promise","random","react","reduce","ref","render","state","test","token","trim","uuid","vue","watch"]),ye=new Set(["bytes","crypto","data","false","get","hex","id","key","map","name","num","random","result","secret","set","string","to","token","true","type","value"]),He=new Set(["best","backend","conflict","database","effect","effects","error","errors","frontend","found","helpers","javascript","module","modules","scip","shared","source","typescript","utils","with","workflow","workflows"]);function Ke(e,n){let t=D(e,n);if(!t||!$(t.symbol))return null;let i=Ve(e,t);return i?{symbol:t.symbol,file:t.relativePath,tokens:i}:null}function Ve(e,n){let t=K(n.symbol),i=rn(e,n.relativePath,n.startLine,n.endLine,t),r=ke(i,t);return r.size>0?r:null}var Ze=z("source-fingerprint-corpus",{clearGroups:["whole-project","definition-catalog"]}),We=z("source-fingerprint-index",{clearGroups:["whole-project","definition-catalog"]});function he(e){return`${e.scanLimit??""}`}function Ce(e,n={}){let t=Ze.get(e,()=>new Map),i=he(n),r=t.get(i);return r||(r=tn(e,n),t.set(i,r)),r}function le(e,n={}){let t=We.get(e,()=>new Map),i=he(n),r=t.get(i);return r||(r=Xe(Ce(e,n)),t.set(i,r)),r}function Xe(e){let n=new Map;for(let r of e)for(let s of r.tokens)n.set(s,(n.get(s)??0)+1);let t=Math.max(8,Math.ceil(Math.sqrt(e.length))),i=new Map;for(let r of e)for(let s of r.tokens){if((n.get(s)??0)>t)continue;let a=i.get(s);a||(a=[],i.set(s,a)),a.push(r)}return{corpus:e,candidateByToken:i,docFreq:n,ubiquityThreshold:t}}function Je(e,n){let t=new Map;for(let i of e.tokens)for(let r of n.candidateByToken.get(i)??[])r.symbol!==e.symbol&&t.set(r.symbol,r);return t.size>0?[...t.values()]:n.corpus.filter(i=>i.symbol!==e.symbol)}function Ye(e,n,t){let i=A(),r=new q(e),s=Qe(n.tokens.size,t.minSimilarity),a=0,l=0,c=0,m=y("similar.source-shape.target-files",()=>{let d=[...n.tokens],p=[];for(let S of Y(e,{includeIgnored:!1})){a+=1;let h=U(e,S);h&&(l+=1,en(h,d,s)&&p.push(S))}return c=p.length,p},()=>({symbol:n.symbol,targetTokens:n.tokens.size,requiredSharedTokens:s,scannedFiles:a,readableFiles:l,candidateFiles:c})),g=0,f=y("similar.source-shape.target-definitions",()=>{let d=_(r.productionCallableDefinitions({files:m,sortByLocDesc:typeof t.scanLimit=="number"&&t.scanLimit>0}),t.scanLimit);return g=d.length,d},()=>({symbol:n.symbol,candidateFiles:c,scanLimit:t.scanLimit,definitionCount:g})),o=0;return y("similar.source-shape.target-fingerprints",()=>{let d=Fe(e,f);return i&&(o=d.length),d},()=>({symbol:n.symbol,definitionCount:g,fingerprintCount:o})).filter(d=>d.symbol!==n.symbol)}function Qe(e,n){return Math.max(2,Math.ceil(e*n))}function en(e,n,t){if(n.length<t)return!1;let i=e.toLowerCase(),r=0;for(let s of n)if(nn(i,s)&&(r+=1,r>=t))return!0;return!1}function nn(e,n){return n==="num"?/\b\d+\b/.test(e):e.includes(n)}function tn(e,n={}){let t=new q(e),{scanLimit:i}=n,r=_(t.productionCallableDefinitions({sortByLocDesc:typeof i=="number"&&i>0}),i);return Fe(e,r)}function Fe(e,n){let t=new Map;for(let r of n){let s=t.get(r.relativePath)??[];s.push(r),t.set(r.relativePath,s)}let i=new Map;for(let[r,s]of t){let a=U(e,r);if(!a)continue;let l=J(e,r,a),c=an(e,r,l),m=!1,g=null;for(let f of s){let o=sn(f),u=c.get(o),d=u?new Set(u.tokens):null;d||(g??=H(e,r),d=ke(xe(g,f.startLine,f.endLine,f.leaf),f.leaf),c.set(o,{key:o,symbol:f.symbol,startLine:f.startLine,endLine:f.endLine,leaf:f.leaf,tokens:[...d].sort()}),m=!0),d.size>0&&i.set(f.symbol,{symbol:f.symbol,file:f.relativePath,tokens:d})}m&&cn(e,r,l,c)}return n.map(r=>i.get(r.symbol)).filter(r=>!!r)}function rn(e,n,t,i,r){let s=H(e,n);return s.length===0?"":xe(s,t,i,r)}function xe(e,n,t,i){if(t>=n&&t-n<=12)return e.slice(n,t+1).join(`
|
|
2
|
-
`);let r=[new RegExp(`\\bdef\\s+${B(i)}\\b`),new RegExp(`\\bfun\\s+${B(i)}\\b`),new RegExp(`\\bfn\\s+${B(i)}\\b`),new RegExp(`\\bfunction\\s+${B(i)}\\b`),new RegExp(`\\b${B(i)}\\s*\\(`)],s=e.findIndex(a=>r.some(l=>l.test(a)));if(s>=0){let a=s;for(let l=s+1;l<e.length&&l<=s+8;l++){let c=e[l]??"";if(l>s&&mn(c)||(a=l,c.trim()===""&&l>s+1))break}return e.slice(s,a+1).join(`
|
|
3
|
-
`)}return e.slice(n,Math.min(e.length,n+8)).join(`
|
|
4
|
-
`)}function sn(e){return`${e.symbol}\0${e.startLine}\0${e.endLine}\0${e.leaf}`}function an(e,n,t){return me.read(e,n,t)??new Map}function on(e){try{let n=JSON.parse(e);if(!Array.isArray(n.entries))return null;let t=new Map;for(let i of n.entries){if(!i||typeof i.key!="string"||typeof i.symbol!="string"||typeof i.startLine!="number"||typeof i.endLine!="number"||typeof i.leaf!="string"||!Array.isArray(i.tokens)||!i.tokens.every(r=>typeof r=="string"))return null;t.set(i.key,i)}return t}catch{return null}}function ln(e){let n={entries:[...e.values()].sort((t,i)=>t.key.localeCompare(i.key))};return JSON.stringify(n)}function cn(e,n,t,i){me.write(e,n,t,new Map(i))}function ke(e,n){if(!e)return new Set;let t=new Set(["public","private","protected","final","static","class","def","fun","fn","function","return","string","bool","boolean","void","unit","self","this","new","const","let","var","end","pub"]),i=un(n),s=e.replace(/["'`]/g," ").replace(/\b\d+\b/g," NUM ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[^A-Za-z0-9_]+/g," ").replace(/_/g," ").toLowerCase().split(/\s+/).map(a=>a.trim()).filter(a=>a.length>1).filter(a=>!t.has(a)).filter(a=>!i.has(a));return new Set(s)}function un(e){return new Set(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9_]+|_/).map(n=>n.toLowerCase()).filter(n=>n.length>1))}function mn(e){return/^\s*(?:def|fun|fn|function|class|trait|module|object|enum|interface|public|private|protected)\b/.test(e)}export{Ie as a,vn as b,Me as c,ce as d,wn as e,Mn as f,Ae as g,de as h,qe as i,G as j,Ne as k,Pe as l,fe as m,$e as n,ge as o,pe as p};
|
|
5
|
-
//# sourceMappingURL=chunk-KSJ544IV.js.map
|
package/dist/chunk-LY7NMOBW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as m,c as d}from"./chunk-BZXE3HO4.js";import{a as $}from"./chunk-BP7S6V3M.js";function v(r,e={}){return P(r,e).cycles}function P(r,e={}){let{scope:s,maxDepth:i=10}=e,n=$(r,s),c=[],a=new Set,l=new Set,f=[],g=!1;function b(t,o){if(o>i){g=!0;return}if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),y=u.indexOf(u.reduce((C,D)=>C<D?C:D)),p=[...u.slice(y,-1),...u.slice(0,y),u[y]],k=p.join(" -> ");S.has(k)||(S.add(k),c.push({path:p,kind:w(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let x=n.get(t);if(x)for(let h of x)b(h,o+1);f.pop(),l.delete(t)}let S=new Set;for(let t of n.keys())a.has(t)||b(t,0);return c.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),{cycles:c,truncated:g,maxDepth:i}}function w(r){for(let i of r){let n=m(i);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(r.length!==3)return"real";let[e,s]=r;return!e||!s?"real":d(e)||d(s)||B(e,s)||B(s,e)||R(e,s)||R(s,e)||m(e)==="entry"||m(s)==="entry"?"module-hierarchy":"real"}function B(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=e.replace(/\.rs$/,"/");return r.startsWith(s)?!r.slice(s.length).includes("/"):!1}function R(r,e){if(!/\.rs$/.test(r)||!/\.rs$/.test(e))return!1;let s=r.replace(/\.rs$/,""),i=e.replace(/\.rs$/,"");if(s===i+"_tests"||s===i+"/tests")return!0;let n=r.split("/"),c=e.split("/");if(n.length===c.length&&n.includes("tests")&&c.includes("src")){let a=n[n.length-1],l=c[c.length-1];if(a&&a===l)return!0}return!1}export{v as a,P as b};
|
|
2
|
-
//# sourceMappingURL=chunk-LY7NMOBW.js.map
|
package/dist/chunk-N23FT4EZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as k}from"./chunk-BP7S6V3M.js";function K(i,l={}){let{limit:d=10,scope:h,minDepth:x=3}=l,f=k(i,h),w=new Map,o=[],p=new Map,a=new Map,m=new Set,b=[],g=0;for(let e of f.keys()){if(p.has(e))continue;let t=[],s=(f.get(e)??new Set).values();for(p.set(e,g),a.set(e,g),g+=1,b.push(e),m.add(e),t.push({node:e,iter:s,pendingChild:null});t.length>0;){let n=t[t.length-1];if(n.pendingChild!==null){let u=n.pendingChild;n.pendingChild=null,a.set(n.node,Math.min(a.get(n.node),a.get(u)))}let c=n.iter.next();if(c.done){if(a.get(n.node)===p.get(n.node)){let u=[];for(;;){let S=b.pop();if(m.delete(S),u.push(S),w.set(S,o.length),S===n.node)break}o.push(u)}t.pop();continue}let r=c.value;if(p.has(r))m.has(r)&&a.set(n.node,Math.min(a.get(n.node),p.get(r)));else{p.set(r,g),a.set(r,g),g+=1,b.push(r),m.add(r);let u=(f.get(r)??new Set).values();n.pendingChild=r,t.push({node:r,iter:u,pendingChild:null})}}}let C=new Map,D=new Array(o.length);for(let e=0;e<o.length;e++)D[e]=o[e].length,C.set(e,new Set);for(let[e,t]of f){let s=w.get(e);for(let n of t){let c=w.get(n);c!==s&&C.get(s).add(c)}}let y=new Array(o.length),R=new Array(o.length);for(let e=0;e<o.length;e++){let t=[],s=0;for(let n of C.get(e)){let c=R[n];c>s&&(s=c,t=y[n])}y[e]=[e,...t],R[e]=D[e]+s}function M(e){return y[e]}let T=o.map(e=>[...e].sort()),v=new Set,I=[];for(let e=0;e<o.length;e++){let t=M(e),s=[];for(let c of t)s.push(...T[c]);if(s.length<x)continue;let n=s.join(" ");v.has(n)||(v.add(n),I.push(A(s)))}return I.sort((e,t)=>t.depth-e.depth),F(I).slice(0,d)}function A(i){return{chain:i,depth:i.length,actionTier:"signal",chainKind:"transitive-dependency-depth",evidenceReasons:[`${i.length} file(s) form the representative transitive dependency path`,"cycles are condensed before longest-path calculation"],recommendation:"Review whether the chain crosses ownership or layer boundaries; shorten it only when the dependency direction is accidental."}}function F(i){let l=[];for(let d of i)l.some(h=>L(d.chain,h.chain))||l.push(d);return l}function L(i,l){if(i.length>=l.length)return!1;let d=l.length-i.length;for(let h=0;h<i.length;h++)if(i[h]!==l[d+h])return!1;return!0}export{K as a};
|
|
2
|
-
//# sourceMappingURL=chunk-N23FT4EZ.js.map
|
package/dist/chunk-NCVFKOLB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as T}from"./chunk-V5W7H7V4.js";import{a as I}from"./chunk-YQKECTPV.js";import{a as H}from"./chunk-AAMURYOK.js";import{a as p}from"./chunk-5JRMZMLM.js";import{a as F}from"./chunk-R5336VHZ.js";import{a as v}from"./chunk-3H5OSDF7.js";import{a as k,b as G}from"./chunk-EDSD3VJK.js";import{b as D}from"./chunk-IUSSGHJO.js";import{a as S}from"./chunk-7COVQPQQ.js";import{a as j}from"./chunk-XZBLZHXL.js";import{a as w}from"./chunk-CXQQOXSI.js";import{a as P}from"./chunk-SFDVBARK.js";import{a as A}from"./chunk-NOKUZU56.js";function X(t,e,n={}){let o=n.impactDepth??3,r=n.sliceDepth??3,l=n.semantic,s=!z(e),a=s?H(t,e,{semantic:l}):{definitions:[],referencedBy:[]},m=s?P(t,e,{semantic:l}):null,f=s?j(t,e,{semantic:l}):null,h=s?v(t,e,{semantic:l}):null,y=s?p(t,e,{direction:"backward",maxDepth:r,semantic:l}):null,R=s?p(t,e,{direction:"forward",maxDepth:r,semantic:l}):null,d=s?w(t,e,{maxDepth:o,scope:n.scope}):[],i=A(t,e,{semantic:l}),C=k(t,e),g=G(t,e),u=I(t,e),x=T(t,e),c={symbol:a.definitions.length>0||a.referencedBy.length>0||m!==null||f!==null||h!==null||y!==null||R!==null||d.length>0,file:i!==null||C.length>0||g.length>0,module:u.files.length>0||u.symbols.length>0||x.length>0},b=[];!c.symbol&&!c.file&&!c.module&&b.push("No symbol, file, or module matched target.");let B=i?.file??a.definitions[0]?.relativePath??null;return{target:e,matched:c,history:O(t,B),trace:a,callGraph:m,complexity:f,dataflow:h,backwardSlice:y,forwardSlice:R,affected:d,changeSurface:i,deps:C,rdeps:g,system:u,surface:x,warnings:b}}function O(t,e){let n={available:!1,file:e,churn:null,coChangePartners:[],suppressionsInFile:0};if(!e)return n;let o=S(t).fileChurn();if(!o)return n;let r=D(t,e,{limit:5});return{available:!0,file:e,churn:o.get(e)??{changes:0,fixChanges:0,lastChangedAt:0},coChangePartners:r.findings.map(l=>({file:l.fileA===e?l.fileB:l.fileA,together:l.together,confidence:l.confidence,subjectContext:l.subjectContext})),suppressionsInFile:F(t).byFile.get(e)??0}}function z(t){return t.includes("/")||t.includes("\\")||/\.[A-Za-z0-9]+(?::\d+(?:-\d+)?)?$/.test(t)}export{X as a};
|
|
2
|
-
//# sourceMappingURL=chunk-NCVFKOLB.js.map
|
package/dist/chunk-PESEPWZO.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as x}from"./chunk-HZZQKNVE.js";import{f as m,g as f}from"./chunk-3AMWF6V5.js";import{b as v}from"./chunk-B75HZHUP.js";import{a as E}from"./chunk-IMQFJ53K.js";import{a as y}from"./chunk-BGBBVSH4.js";import{a as b}from"./chunk-5VY3RIEI.js";import{b as h}from"./chunk-27HMTUJE.js";import{f as g}from"./chunk-7TVFPOD7.js";import{d as u}from"./chunk-X5C43YVI.js";import{c as p}from"./chunk-JZBGTSAB.js";var T=/^(?:validate|verify|check|assert)(?:[A-Z].*)?$/,R=/^(?:is|has)(?:[A-Z].*)?$/,L=/[{,]\s*(?:ok|success|valid|isValid)\s*:\s*false\b/,d=/\breturn\b/g,N=/\bfunction\b|=>|\)\s*(?::\s*[^{;=]+)?\s*\{/,I=/\.(?:addIssue|push)\s*\(/;function q(e,i={}){let{scope:t,limit:n=30,scanLimit:s}=i,l=new E(e),c=v(l.productionCallableDefinitions({scope:t,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),s),o=[];for(let r of c){let a=A(e,r);a&&o.push({symbol:r.symbol,shortName:u(r.symbol),file:r.relativePath,startLine:r.startLine,endLine:r.endLine,loc:y(r),...a})}return o.sort((r,a)=>r.file.localeCompare(a.file)||r.startLine-a.startLine||r.loc-a.loc),n?o.slice(0,n):o}function S(e){return T.test(e)?"imperative":R.test(e)?"predicate":null}function A(e,i){let t=S(i.leaf);if(!t)return null;let n=m(e,i);if(!n||!N.test(n))return null;if(x(n)){let l=P(e,i);return!l||D(l.body,C(l.snippet))?null:{nameKind:t,resolvedVia:"one-hop-delegate",delegateTarget:l.shortName}}let s=f(n);return D(s,C(n))?null:{nameKind:t,resolvedVia:"direct"}}function C(e){let i=e.indexOf("=>");return i===-1?!1:!/^\s*\{/.test(e.slice(i+2))}function D(e,i){let t=p(e);if(/\bthrow\b/.test(t)||/\.reject\s*\(/.test(t)||L.test(t)||I.test(t))return!0;let n=k(t);if(i&&n.length===0){let s=t.trim();return s!==""&&s!=="true"}for(let s of n)if(s!==""&&s!=="true")return!0;return!1}function k(e){let i=[];d.lastIndex=0;let t;for(;t=d.exec(e);){let n=t.index+t[0].length,s=0,l=e.length;for(let c=n;c<e.length;c+=1){let o=e[c];if(o==="("||o==="["||o==="{")s+=1;else if(o===")"||o==="]"||o==="}"){if(s===0){l=c;break}s-=1}else if(o===";"&&s===0){l=c;break}}i.push(e.slice(n,l).trim()),d.lastIndex=l}return i}function P(e,i){let t=b(e,i,{callableOnly:!0,limit:3}),n=[...new Set(t.map(r=>r.symbol))].filter(r=>r!==i.symbol);if(n.length!==1)return null;let l=h(e,n[0]).match;if(!l)return null;let c=g(e,l.relativePath).find(r=>r.symbolId===l.symbolId);if(!c)return null;let o=m(e,c);return o?{body:f(o),snippet:o,shortName:u(c.symbol)}:null}export{q as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PESEPWZO.js.map
|
package/dist/chunk-PMY4UFGV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-IMQFJ53K.js";import{a as c,c as f}from"./chunk-5VY3RIEI.js";import{d as m}from"./chunk-X5C43YVI.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
|
|
2
|
-
//# sourceMappingURL=chunk-PMY4UFGV.js.map
|
package/dist/chunk-Q7PWDXL5.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{a as G}from"./chunk-QZ4JVECJ.js";import{a as U}from"./chunk-WXVGNFAO.js";import{a as _}from"./chunk-7COVQPQQ.js";import{b as F,i as O,j as L,k as $,l as K,m as H,o as z,p as X}from"./chunk-WS3Z6W3M.js";import{existsSync as Y,readFileSync as P,statSync as St}from"fs";import{join as T}from"path";function M(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(!w(t[n]??""))return null;let e=n;for(;e>0&&w(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&w(t[i]??"");)i+=1;return{start:e,end:i}}function w(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(I(o)!==null)break;if(N(o)!==null)return null;e-=1}if(e<0)return null;let i=I(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",s=I(o);if(s!==null){if(s<=i)break;r+=1;continue}if(N(o)!==null)break;r+=1}return{start:e,end:r}}function I(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":w(t)?"table":I(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
|
-
`).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=>G(r,n)))return!0;let i=X(t,n);return i.length>0&<.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
|
-
`).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(M(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=U(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=H({kind:"doc-path-evidence",invalidation:z("doc-path-evidence"),serialize:Nt,deserialize:Bt}),v=/\.(?: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=It(t);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 f=Z(t,a);if(f&&!o)continue;let{value:y,estimated:l}=At(t,a,s.changeTimes.get(a)),m=vt(t,a),h=new Map,{resolved:d,broken:g,citations:D}=kt(t,a,s.tracked,s.trackedBySuffix,s.everSeenInHistory),S=new Map(D.map(u=>[u.file,u]));for(let u of d){if(u===a||v.test(u))continue;let C=(s.changeTimes.get(u)??[]).filter(b=>b>y).length;if(C===0)continue;let p=S.get(u);h.set(u,{file:u,evidence:"reference",coChanges:0,changesSinceDocUpdate:C,...B("reference",m,p?.contexts),citationContexts:p?.contexts,citedLines:p?.lineReferences})}for(let[u,C]of s.coupling.get(a)??[]){if(C<r||!s.tracked.has(u))continue;let p=(s.changeTimes.get(u)??[]).filter(A=>A>y).length;if(p===0)continue;let b=h.get(u);b?(b.evidence="both",b.coChanges=C,Object.assign(b,B("both",m,b.citationContexts))):h.set(u,{file:u,evidence:"co-change",coChanges:C,changesSinceDocUpdate:p,...B("co-change",m)})}if(h.size===0&&g.length===0)continue;let x=[...h.values()].sort((u,C)=>C.changesSinceDocUpdate-u.changesSinceDocUpdate);c.push({doc:a,docLastChangedAt:y,staleness:x.reduce((u,C)=>u+C.changesSinceDocUpdate,0)+g.length*10,subjects:x.slice(0,8),brokenReferences:g,...f?{snapshotExcluded:!0}:{},...l?{docLastChangedAtEstimated:!0}:{}})}return c.sort((a,f)=>f.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 vt(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
|
-
${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:wt(t,n.docIntent,i?.actionTier),docIntent:n.docIntent,docIntentReasons:n.reasons,...i?{citationKind:i.citationKind,citationKindReasons:i.reasons}:{}}}function wt(t,n,e){return n==="historical-note"?"support":e||(t==="co-change"?"signal":"direct")}function It(t){let n=_(t),e=n.commitHistory();if(!e)return null;let i=n.trackedFiles()??new Set,r=new Map,o=new Map,s=new Set;for(let c of e.commits){let a=[...new Set(c.files)],f=a.filter(l=>v.test(l)),y=a.filter(l=>!v.test(l));for(let l of a){s.add(l);let m=r.get(l)??[];m.push(c.timestamp),r.set(l,m)}for(let l of f){let m=o.get(l);m||(m=new Map,o.set(l,m));for(let h of y)m.set(h,(m.get(h)??0)+1)}}return{changeTimes:r,coupling:o,docFiles:[...i].filter(c=>v.test(c)),everSeenInHistory:s,historyCommitCount:e.commits.length,tracked:i,trackedBySuffix:nt(i)}}function cn(t,n){if(n.size===0)return[];let e=$(),i=0,r=0,o=0,s=0,c=0,a=0;return K("doc-reference.docs-citing-files",()=>{let f=_(t).trackedFiles()??new Set;i=f.size;let y=nt(f),l=Mt(n,y),m=[];for(let h of f){if(!tt(t,h))continue;e&&(r+=1);let d;try{d=P(T(t.config.projectRoot,h),"utf-8")}catch{e&&(o+=1);continue}if(!_t(d,l)){e&&(s+=1);continue}let g=et(t,h,d);if(!g)continue;e&&(c+=1);let D=Et(g.candidates,n,l,f,y);if(D.size===0)continue;let S=[...new Set([...D.values()].flatMap(p=>[...p]))],x=Lt(g.contextsByCandidate,S),u=[...D].map(([p,b])=>({file:p,contexts:E([...b].flatMap(A=>x.get(A)??[])).slice(0,3),lineReferences:k([...b].flatMap(A=>g.lineReferencesByCandidate.get(A)??[]))})).filter(p=>p.contexts.length>0),C=[...D.keys()];if(C.length>0){e&&(a+=1);let p=C.sort();m.push({doc:h,cited:p,citations:u,citedClaims:E(u.flatMap(b=>b.contexts)).slice(0,3)})}}return m},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:s,evidenceDocs:c,citedDocs:a}))}function tt(t,n){return v.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 Mt(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 f=r.get(s);f?.length===1&&(c=f[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,f=c.contextsByCandidate,y=c.lineReferencesByCandidate,l=new Map,m=new Map,h=(d,g)=>{let D=f.get(g);if(D&&D.length>0){let x=l.get(d)??[];x.push(...D),l.set(d,E(x).slice(0,3))}let S=y.get(g);S&&S.length>0&&m.set(d,k([...m.get(d)??[],...S]))};for(let d of a){if(e.has(d)){o.add(d),h(d,d);continue}let g=i.get(d);if(g&&g.length===1){o.add(g[0]),h(g[0],d);continue}g&&g.length>1||r.has(d)&&s.add(d)}return{resolved:o,broken:[...s],citations:[...l].map(([d,g])=>({file:d,contexts:g,lineReferences:m.get(d)}))}}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 f=c[2]?Number(c[2]):null;f!==null&&Number.isSafeInteger(f)&&r.set(a,k([...r.get(a)??[],f]));let y=M(n,o);if(y.length===0)continue;let l=i.get(a)??[];l.push(y),i.set(a,E(l).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-Q7PWDXL5.js.map
|
package/dist/chunk-QVGFVRKD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as oe}from"./chunk-B75HZHUP.js";import{a as N}from"./chunk-IMQFJ53K.js";import{b as J,e as $,f as G,g as X}from"./chunk-BZXE3HO4.js";import{c as se}from"./chunk-5VY3RIEI.js";import{c as Y,d as ee,e as te,f as ne,l as ie}from"./chunk-GULVO6NF.js";import{e as re}from"./chunk-WMO2VZZK.js";import{j as Q,o as _}from"./chunk-7TVFPOD7.js";import{d as U,g as H,h as V,i as K,j as Z,k as q}from"./chunk-X5C43YVI.js";import{o as W}from"./chunk-JZBGTSAB.js";import{A as P,x as z}from"./chunk-ISLWJ4PY.js";import{b as O,l as b,m as B,o as j,p as I}from"./chunk-WS3Z6W3M.js";import{c as w}from"./chunk-GNG622H3.js";import{a as R}from"./chunk-64MNV6AB.js";import{b as L}from"./chunk-7S5E7KWT.js";var x=new WeakMap,ae=B({kind:"definition-exclusions",invalidation:j("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:De});function le(e,t){let n=z(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let s=O(e,t,r),a=ae.read(e,t,s);if(a)return a;let u=n==="rust"?Te(e,t):Pe(e,t);return ae.write(e,t,s,u),u}function De(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(Le)?null:t}catch{return null}}function Le(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"?!1:t.containerName===void 0||typeof t.containerName=="string"}var ue=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),we=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Ie=/\b(?:export\s+)?(?:async\s+)?function\s+use[A-Z][A-Za-z0-9_$]*\b|\b(?:const|let|var)\s+use[A-Z][A-Za-z0-9_$]*\s*(?::[^=;]+)?=\s*(?:async\s*)?(?:function\b|(?:<[^=;{]+>\s*)?(?:\([^)]*\)|[A-Za-z_$][\w$]*)\s*=>)/;function Pe(e,t){let n=I(e,t);if(!n||!Ne(n))return[];let i=P(e,t);if(!i)return[];let r=x.get(i);if(r)return r;let s=!1,a=i.rootNode;for(let l of a.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let o=d.namedChild(0);if(!o)continue;let c=o.type==="member_expression"?o.namedChild(o.namedChildCount-1)?.text:o.text;if(c&&ue.has(c)){s=!0;break}}let u=[];s&&u.push({startLine:0,endLine:a.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)"});for(let l of a.namedChildren){let d=null,o=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,o=l;else if(l.type==="export_statement"){let c=l.namedChild(0);c?.type==="function_declaration"&&(d=c.namedChild(0)?.text??null,o=c)}else if(l.type==="lexical_declaration"){let c=l.namedChild(0);if(c?.type==="variable_declarator"){let p=c.namedChild(0)?.text,m=c.namedChild(1);p&&(m?.type==="arrow_function"||m?.type==="function_expression")&&(d=p,o=c)}}d&&/^use[A-Z]/.test(d)&&o&&u.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"React custom hook (use*)"})}return u.push(...de(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),x.set(i,u),u}function Ne(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of ue)if(e.includes(n)){t=!0;break}return t&&we.test(e)?!0:e.includes("use")&&Ie.test(e)}var ke=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Fe(e){return ke.test(e)}function de(e,t,n){let i=[],r=s=>{if(t.has(s.type)&&s.parent){let u=s.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===s.startIndex&&u[d].type===s.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let o=u[d];if(n.has(o.type)){if(Fe(o.text)){i.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"scip-query suppression comment"});break}continue}if(!(o.type==="attribute_item"||o.type==="inner_attribute_item"))break}}for(let a of s.namedChildren)r(a)};return r(e.rootNode),i}function Te(e,t){let n=P(e,t);if(!n)return[];let i=x.get(n);if(i)return i;let r=[],s=Ae(n);return s?(x.set(n,s),s):(fe(n.rootNode,r,!1,!1),r.push(...de(n,new Set(["function_item","function_signature_item","struct_item","enum_item","union_item","impl_item","mod_item","static_item","const_item"]),new Set(["line_comment","block_comment"]))),r.push(...He(n.rootNode)),x.set(n,r),r)}function Ae(e){return Ve(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)"}]:null}function fe(e,t,n,i){let r=n,s=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(s=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)"})),e.type==="function_item"||e.type==="function_signature_item"?Me(e,t,n,i):i&&Ue(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?Oe(e,t,n):e.type==="mod_item"&&k(e).some(a=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(a))&&(r=!0);for(let a of e.namedChildren)fe(a,t,r,s)}function Me(e,t,n,i){let r=k(e),s=null;i?s="trait impl method (dynamic dispatch)":n&&(s="inside #[cfg(test)] mod");for(let a of r){let u=je(a);if(u){s=u;break}if(me(a)){s="#[allow(dead_code)]";break}}s&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:s})}function Oe(e,t,n){let i=k(e),r=e.namedChildren.find(s=>s.type==="type_identifier")?.text;i.some(We)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(<reflective>)] \u2014 fields accessed via macro/reflection",containerName:r}),i.some(me)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",containerName:r})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let s=0;s<n.length;s+=1)if(n[s].startIndex===e.startIndex&&n[s].type===e.type){i=s;break}if(i<=0)return[];let r=[];for(let s=i-1;s>=0;s-=1){let a=n[s];if(a.type==="attribute_item"||a.type==="inner_attribute_item")r.push(a.text);else{if(a.type==="line_comment"||a.type==="block_comment")continue;break}}return r}var Be=[{re:/#\[\s*tauri::command\b/,reason:"#[tauri::command]"},{re:/#\[\s*command\b/,reason:"#[command]"},{re:/#\[\s*test\b/,reason:"#[test]"},{re:/#\[\s*bench\b/,reason:"#[bench]"},{re:/#\[\s*tokio::test\b/,reason:"#[tokio::test]"},{re:/#\[\s*async_std::test\b/,reason:"#[async_std::test]"},{re:/#\[\s*wasm_bindgen\b/,reason:"#[wasm_bindgen]"},{re:/#\[\s*no_mangle\b/,reason:"#[no_mangle]"},{re:/#\[\s*napi\b/,reason:"#[napi]"},{re:/#\[\s*pyfunction\b/,reason:"#[pyfunction]"},{re:/#\[\s*pymethod\b/,reason:"#[pymethod]"},{re:/#\[\s*pyo3\b/,reason:"#[pyo3]"},{re:/#\[\s*cfg\s*\(\s*test\s*\)/,reason:"#[cfg(test)]"},{re:/#\[\s*doc\s*\(\s*hidden\s*\)/,reason:"#[doc(hidden)]"}];function je(e){return Be.find(({re:t})=>t.test(e))?.reason??null}var ze=[/\bSerialize\b/,/\bDeserialize\b/,/\bFromRow\b/,/\bsqlx::FromRow\b/,/\bDeriveEntityModel\b/,/\bIntoSchema\b/,/\bToSchema\b/,/\bDeriveValueType\b/,/\bError\b/,/\bthiserror::Error\b/];function We(e){return/#\[\s*derive\s*\(/.test(e)?ze.some(t=>t.test(e)):!1}function me(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Ue(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function He(e){let t=Ze(e);if(t.size===0)return[];let n=[];for(let i of e.descendantsOfType("mod_item")){let r=i.childForFieldName("name")?.text;r&&t.has(r)&&n.push({startLine:i.startPosition.row,endLine:i.endPosition.row,reason:'serde `with = "..."` module \u2014 body invoked via reflection',containerName:r})}return n}function Ve(e){for(let t=0;t<Math.min(e.namedChildCount,12);t+=1){let n=e.namedChild(t);if(!n||n.type!=="line_comment"&&n.type!=="block_comment")break;if(/@generated\b/.test(n.text)||/This file is .*generated\b/i.test(n.text)||/Code generated by/i.test(n.text)||/Generated by:\s*https?:\/\/openapi-generator/i.test(n.text)||/openapi-generator/i.test(n.text)&&/Generated by/i.test(n.text))return!0}return!1}var Ke=/^#!?\[\s*serde\s*\(/,ce=/\bwith\s*=\s*"([^"]+)"/g;function Ze(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){if(!Ke.test(n.text))continue;ce.lastIndex=0;let i;for(;(i=ce.exec(n.text))!==null;){let r=i[1],s=r.split("::").pop()??r;s&&t.add(s)}}return t}function pe(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let s=le(e,i);return r={ranges:s.map(a=>({startLine:a.startLine,endLine:a.endLine})),containers:new Set(s.map(a=>a.containerName).filter(a=>!!a))},t.set(i,r),r};return(i,r,s,a)=>{let u=n(i);for(let l of u.ranges)if(r>=l.startLine&&r<=l.endLine)return!0;if(a&&u.containers.has(a))return!0;for(let l of _(s))if(u.containers.has(l))return!0;return!1}}function gt(e,t={}){L(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function be(e,t,n={}){L(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function ye(e,t){return t.isIgnoredPath(e.relativePath)?y("ignored-file"):K(e.symbol)?y("module-like-symbol"):E(e.symbol)?!e.isFunctionLike&&e.enclosingSymbol&&E(e.enclosingSymbol)?y("nested-non-callable-value"):!t.includeTests&&!S(e.relativePath)?y("test-file"):!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName)?y("excluded-file-region"):Z(e.symbol)?y("rust-trait-impl-member"):q(e.symbol)?y("rust-test-module"):!t.includeMembers&&!qe(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}:y("non-value-symbol")}function S(e){return J(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function E(e){return V(e)||e.endsWith("().")||e.endsWith(".")}function qe(e){return H(e.symbol)||_(e.symbol).length===0}function ge(){return new Map}function he(e,t,n){let i=new Map;for(let r of Y(e,n))e.isIgnored(r.relative_path)||t.has(r.relative_path)||v(i,r.symbol_id,r.relative_path,r.ref_count,"scip-mention");return i}function xe(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let s of te(e,t))r.add(s.symbol_id);return r}for(let s of ee(e,t))e.isIgnored(s.relative_path)||n.has(s.relative_path)||r.add(s.symbol_id);return r}function F(e,t){let n=e.get(t);if(!n)return!1;for(let i of n.values())if(i.occurrences>0)return!0;return!1}function C(e,t,n){let i=e.get(t);if(!i)return!1;for(let[r,s]of i)if(r!==n&&s.occurrences>0)return!0;return!1}function Se(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let s=_e(e,t,n);s.occurrences+=i,s.sources.add(r)}function Re(e,t,n,i,r){if(i<=0)return;let s=_e(e,t,n);s.occurrences=Math.max(i,s.occurrences),s.sources.add(r)}function _e(e,t,n){let i=e.get(t);i||(i=new Map,e.set(t,i));let r=i.get(n);return r||(r={occurrences:0,sources:new Set},i.set(n,r)),r}var Je=3e3,$e=1e3;function Ut(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:s=!1,includeMembers:a=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,o=0,c=b("dead.candidates",()=>{let f=oe(Ge(e,{scope:n,minLoc:i,includeTests:r,includeMembers:a}),l);return o=f.length,f},()=>({definitions:o})),p=0,m=s?b("dead.inactive-barrels",()=>{let f=new Set($(e));return p=f.size,f},()=>({paths:p})):new Set,T=0,g=u?ge():b("dead.mention-reference-counts",()=>{let f=he(e,m,c.map(D=>D.symbolId));return T=f.size,f},()=>({definitions:c.length,symbolsWithReferences:T})),A=0,Ce=u?b("dead.mentioned-symbol-ids",()=>{let f=xe(e,c.map(D=>D.symbolId),m,{conservative:m.size===0});return A=f.size,f},()=>({definitions:c.length,referencedSymbols:A})):new Set,h=u?c.filter(f=>!Ce.has(f.symbolId)):c.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>tt(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r})):b("dead.source-fallback.ast",()=>et(e,h,g,{includeTests:r,inactiveBarrelPaths:m}),()=>({definitions:h.length,includeTests:r}));let M=u?h.filter(f=>!F(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>ot(e,M,g,{includeTests:r,inactiveBarrelPaths:m,includeSemantic:!u&&d}),()=>({definitions:M.length,semantic:!u&&d}));let ve=u?h.filter(f=>!F(g,f.symbolId)):c;return Ye(e,Xe(ve,g))}function Ge(e,t){let n=pe(e),i=[];for(let r of Q(e,{scope:t.scope,symbolMatches:E,sqlPrefilter:"function-like"}))ye(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:a=>e.isIgnored(a),isExcludedRegion:n}).accepted&&i.push(r);return i}function Xe(e,t){return e.map(n=>Qe(n,t)).filter(n=>n.cross_file_refs===0).sort((n,i)=>i.loc-n.loc||n.relative_path.localeCompare(i.relative_path)||n.start_line-i.start_line)}function Qe(e,t){let n=t.get(e.symbolId)??new Map,i=Se(n.get(e.relativePath)),r=0;for(let[s,a]of n)s!==e.relativePath&&(r+=a.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,same_file_refs:i,cross_file_refs:r}}function Ye(e,t){let n=[],i=0,r=0,s=0;for(let a of t){if(e.isIgnored(a.relative_path)||G(e,a.relative_path)||X(e,a.symbol,a.relative_path))continue;let u=a.same_file_refs===0?"dead-code":"file-internal";u==="dead-code"?i++:r++,s+=a.loc,n.push({relativePath:a.relative_path,startLine:a.start_line,endLine:a.end_line,loc:a.loc,symbol:a.symbol,shortName:U(a.symbol),sameFileRefs:a.same_file_refs,kind:u})}return{symbols:n,counts:{total:n.length,deadCode:i,fileInternal:r,loc:s},totalCount:n.length,deadCodeCount:i,fileInternalCount:r,totalLoc:s}}function et(e,t,n,i){if(t.length===0)return;let r=new N(e),s=new Set(t.map(l=>l.symbolId)),a=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of R(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:a,skipPath:l=>i.inactiveBarrelPaths.has(l)||!i.includeTests&&!S(l)},l=>{s.has(l.target.symbolId)&&(it(e,l)||v(n,l.target.symbolId,l.sourceFile,st(l),"source-fallback"))})}function tt(e,t,n,i){if(t.length===0)return;let r=new N(e),s=nt(t),a=new Set(r.sourceFiles());for(let o of R(e))a.add(o);let u=new Set(s.keys()),l=new Map,d=o=>{let c=l.get(o);return c||(c=ie(e,o),l.set(o,c)),c};r.scanSourceReferences({paths:a,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:o=>i.inactiveBarrelPaths.has(o)||!i.includeTests&&!S(o),resolveTargets:({sourceFile:o,name:c,kind:p})=>{let m=s.get(c);return m?rt(o,c,m,()=>d(o),{permissive:p!=="cross-language-dispatch"}):[]},afterPath:o=>{l.delete(o),be(e,o)}},o=>{let c=o.kind==="identifier"&&o.sourceFile===o.target.relativePath?Math.max(0,o.occurrences-1):o.occurrences;o.kind==="identifier"&&Ee(e,{sourceFile:o.sourceFile,name:o.name,target:o.target,occurrences:c})||v(n,o.target.symbolId,o.sourceFile,c,"source-fallback")})}function nt(e){let t=new Map;for(let n of e){if(!n.leaf)continue;let i=t.get(n.leaf)??[];i.push(n),t.set(n.leaf,i)}return t}function rt(e,t,n,i,r){let s=n.filter(d=>d.relativePath===e);if(s.length>0)return s;if(!r.permissive&&n.length===1)return[...n];let a=i(),u=a.get(t);if(u)for(let d of u){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0)return o}let l=new Set;for(let d of a.values())for(let o of d)l.add(o);for(let d of l){let o=n.filter(c=>w(d,c.relativePath));if(o.length>0&&o.length===n.length)return o}return r.permissive?[...n]:[]}function it(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&Ee(e,t)}function st(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function Ee(e,t){return t.occurrences>1?!1:W(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function ot(e,t,n,i){let r=i.includeSemantic!==!1,s=r&&t.length>=Je&&R(e).length>=$e,a=(o,c)=>{c===o.relativePath||e.isIgnored(c)||i.inactiveBarrelPaths.has(c)||!i.includeTests&&!S(c)||Re(n,o.symbolId,c,1,"caller-map")};if(s?b("dead.caller-map.mention-chunks",()=>at(e,t,a),()=>({definitions:t.length})):b("dead.caller-map.per-symbol",()=>{for(let o of t){let c=se(e,o,{semantic:r});if(c.length!==0)for(let p of c)a(o,p.file)}},()=>({definitions:t.length,semantic:r})),!s)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let o=t.filter(c=>!C(n,c.symbolId,c.relativePath));return u=o.length,o},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=re(e,l);for(let o of l){let c=d.get(o.symbolId);if(c)for(let p of c)a(o,p)}}function at(e,t,n){let i=new Map(t.map(r=>[r.symbolId,r]));for(let r of ne(e,[...i.keys()])){let s=i.get(r.symbol_id);s&&n(s,r.relative_path)}}export{gt as a,Ut as b};
|
|
2
|
-
//# sourceMappingURL=chunk-QVGFVRKD.js.map
|
package/dist/chunk-R5336VHZ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{p,r as u}from"./chunk-WS3Z6W3M.js";import{g as c}from"./chunk-GNG622H3.js";import{d as a}from"./chunk-7S5E7KWT.js";var l=a("suppression-inventory",{clearGroups:["whole-project"]});function b(e){return l.get(e,()=>f(e))}function f(e){let r={dead:0,stale:0,wrapper:0,passthrough:0,drift:0,extract:0,similar:0,uncategorized:0},t=new Map,s=0;for(let o of c(e)){let n=p(e,o);if(!(!n||!n.includes("scip-query")))for(let g of n.split(/\r?\n/)){let i=u(g);if(i===null)continue;s+=1,t.set(o,(t.get(o)??0)+1);let y=d(i);r[y]+=1}}return{total:s,byCategory:r,byFile:t}}function d(e){if(!e)return"uncategorized";let r=e.toLowerCase();return r==="dead-code"?"dead":r}export{b as a};
|
|
2
|
-
//# sourceMappingURL=chunk-R5336VHZ.js.map
|
package/dist/chunk-RLB6SG25.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as $}from"./chunk-3AMWF6V5.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as p}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-WMO2VZZK.js";import{c as h,d as x,g as y}from"./chunk-7TVFPOD7.js";import{d as b}from"./chunk-X5C43YVI.js";import{a as g,e as S}from"./chunk-JZBGTSAB.js";import{p as d}from"./chunk-WS3Z6W3M.js";function K(e,n={}){let{scope:s,minLoc:i=1,limit:r,scanLimit:c,maxShapeFrequency:a=12}=n,o=n.semantic!==!1,t=M(e,B(e,{scope:s,minLoc:i,scanLimit:c}),{semantic:o,maxShapeFrequency:a}),m=I(t);return r?m.slice(0,r):m}function B(e,n){let s=y(e,{scope:n.scope}).filter(i=>i.isFunctionLike&&!e.isIgnored(i.relativePath)).filter(i=>p(i)>=n.minLoc);return typeof n.scanLimit=="number"&&n.scanLimit>0&&s.sort((i,r)=>p(r)-p(i)||i.relativePath.localeCompare(r.relativePath)),D(s,n.scanLimit)}function M(e,n,s){let i=[];for(let a of n){let o=w(e,a,s);o&&i.push({signature:o,definition:a,fn:v(a)})}let r=new Map;for(let a of i)r.set(a.signature,(r.get(a.signature)??0)+1);let c=new Map;for(let a of i){let o=F(a.fn.loc),t=(r.get(a.signature)??0)>s.maxShapeFrequency,m=t?$(e,a.definition):null;if(t&&!m)continue;let u=t?`${a.signature}\0body\0${m}`:`${a.signature}\0band\0${o}`,l=c.get(u)??{signature:a.signature,locBand:o,exactBody:t,functions:[]};l.functions.push(a.fn),c.set(u,l)}return[...c.values()]}function v(e){return{symbol:e.symbol,shortName:b(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:p(e)}}function I(e){let n=[];for(let s of e)s.functions.length>=2&&n.push(s);return n.sort((s,i)=>{let r=i.functions.length-s.functions.length;if(r!==0)return r;let c=s.functions.reduce((o,t)=>o+t.loc,0);return i.functions.reduce((o,t)=>o+t.loc,0)-c}),n}function F(e){return e<=5?"<=5":e<=20?"6-20":">20"}function w(e,n,s){if(s.semantic){let c=L(e,n);if(c)return c}let i=z(n.documentation),r=i?q(i):null;return r||A(G(e,n.relativePath,n.startLine,n.endLine,n.leaf),n.leaf)}function z(e){return h(x(e))}function G(e,n,s,i,r){let c=d(e,n);if(!c)return null;let a=c.split(/\r?\n/),o=k(a,s,i,r);for(let t of o){let m=Math.min(a.length-1,Math.max(t,t+4)),u="";for(let l=t;l<=m;l+=1){let f=a[l]?.trim();if(f&&(u=u?`${u} ${f}`:f,P(u)))return u}if(u&&u.includes("("))return u}return null}function P(e){let n=e.replace(/\s+/g," ").trim();return!n.includes("(")||S(n)>0?!1:/[;{]$/.test(n)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(n)||/\)\s*As\s+.+$/i.test(n)}function q(e){if(!e||!e.trim())return null;let n=e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=n.indexOf("(");return s===-1||(n=n.slice(s),n=n.replace(/\s+/g,"").toLowerCase(),n.length<3)?null:n}function A(e,n){if(!e||!e.trim())return null;let s=e.replace(/\s+/g," ").trim(),i=s.indexOf("(");if(i===-1)return null;let r=s.slice(0,i),a=new RegExp(`\\b${g(n)}\\b`,"i").exec(r);a&&typeof a.index=="number"&&(r=r.slice(0,a.index)),r=r.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let o=C(s.slice(i)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!o.startsWith("("))return null;let t=`${r?`${r} `:""}${o}`.replace(/\s+/g,"").toLowerCase();return t.length>=3?t:null}function C(e){let n=0,s=0,i=0,r=0,c=null,a=!1;for(let o=0;o<e.length;o+=1){let t=e[o];if(c){if(a){a=!1;continue}if(t==="\\"){a=!0;continue}t===c&&(c=null);continue}if(t==='"'||t==="'"||t==="`"){c=t;continue}if(t==="(")n+=1;else if(t===")")n=Math.max(0,n-1);else if(t==="[")i+=1;else if(t==="]")i=Math.max(0,i-1);else if(t==="<")r+=1;else if(t===">")r=Math.max(0,r-1);else if(t==="{"){if(n===0&&i===0&&r===0)return e.slice(0,o);s+=1}else if(t==="}")s=Math.max(0,s-1);else if(t==="="&&e[o+1]===">"&&n===0&&s===0&&i===0&&r===0)return e.slice(0,o)}return e}function k(e,n,s,i){let r=g(i),c=new RegExp(`\\b${r}\\b\\s*\\(`,"i"),a=new RegExp(`\\bdef\\s+${r}\\b`,"i"),o=[],t=new Set,m=Math.max(0,Math.min(n,e.length-1)),u=Math.max(m,Math.min(e.length-1,Math.max(s,n+4)));for(let l=m;l<=u;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}for(let l=0;l<e.length;l+=1){let f=e[l]??"";(c.test(f)||a.test(f))&&!t.has(l)&&(t.add(l),o.push(l))}return o}export{K as a};
|
|
2
|
-
//# sourceMappingURL=chunk-RLB6SG25.js.map
|
package/dist/chunk-SFDVBARK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as i}from"./chunk-B75HZHUP.js";import{a,c as m}from"./chunk-5VY3RIEI.js";import{a as r}from"./chunk-27HMTUJE.js";import{d as o}from"./chunk-X5C43YVI.js";function S(s,n,c={}){let e=r(s,n);if(!e)return null;let t=c.semantic!==!1,y=m(s,e,{limit:50,semantic:t}),b=i(a(s,e,{limit:50,additive:!0,callableOnly:!0,semantic:t}));return{symbol:e.symbol,shortName:o(e.symbol),callers:y.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file})),callees:b.map(l=>({symbol:l.symbol,shortName:o(l.symbol),file:l.file}))}}export{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-SFDVBARK.js.map
|
package/dist/chunk-TG7QSYCJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as P,b as y}from"./chunk-KJCDEDQW.js";import{a as C,c as b,e as o,f}from"./chunk-6XA4LDHY.js";import{a as g,b as h,c as k}from"./chunk-KMVGRIO2.js";import{F as v}from"./chunk-ISLWJ4PY.js";function L(e,i={}){let{minSimilarity:r=.62,minTokens:n=8,limit:c=20,scope:l,scanLimit:u,filePattern:m,focusFiles:d}=i,s=T(e,{scope:l,minTokens:n,scanLimit:u}),p=P(s,t=>t.tokens);return y({profiles:s,limit:c,filePattern:m,focusFiles:d,candidateIndex:p,profile:{name:"vue-component-duplicates"},compare:(t,a)=>V(t,a,r),sort:(t,a)=>a.similarity-t.similarity||t.fileA.localeCompare(a.fileA)||t.fileB.localeCompare(a.fileB)})}function T(e,i){return v(e).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(r=>({file:r.file,tokens:r.templateTokens,loc:B(r)}))}function B(e){return e.totalLines}function V(e,i,r){let n=g(e.tokens,i.tokens);if(n.size<6||!R(n))return null;let c=k(e.tokens,i.tokens);if(c<r)return null;let l=o(n,"component:"),u=o(n,"prop:"),m=o(n,"event:"),d=o(n,"directive:"),s=o(n,"slot:"),p=o(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,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,r=0;for(let n of e)n.startsWith("component:")&&(i+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("directive:")||n.startsWith("slot:"))&&(r+=1);return b([{name:"component",count:i},{name:"behavior",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{behavior:3},reason:"shared Vue template structure"}]).pass}function S(e){return C({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-TG7QSYCJ.js.map
|
package/dist/chunk-U3VMUDXJ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as ae}from"./chunk-7JZRFDCU.js";import{a as ue}from"./chunk-R5336VHZ.js";import{a as ne}from"./chunk-ZMGBWSFZ.js";import{a as se}from"./chunk-URSSPS5H.js";import{a as ce}from"./chunk-TG7QSYCJ.js";import{a as ie}from"./chunk-5AAAEZ2Z.js";import{a as oe}from"./chunk-J5WVNZ6O.js";import{b as G,e as m}from"./chunk-ZEO4CXQR.js";import{a as te}from"./chunk-27XEGMCT.js";import{a as Z}from"./chunk-6JUAGXR4.js";import{a as ee}from"./chunk-C2QSK7E7.js";import{a as Q}from"./chunk-6KMTPNZL.js";import{a as X}from"./chunk-JJUX2OAP.js";import{a as Y}from"./chunk-X3DTIEMU.js";import{a as K}from"./chunk-2XRXEIRK.js";import{b as W}from"./chunk-HZZQKNVE.js";import{a as U}from"./chunk-3AMWF6V5.js";import{a as A,b as q}from"./chunk-QVGFVRKD.js";import{b as N}from"./chunk-IUSSGHJO.js";import{a as z}from"./chunk-7COVQPQQ.js";import{a as re}from"./chunk-XDESMVOL.js";import{f as J}from"./chunk-KSJ544IV.js";import{a as j}from"./chunk-LY7NMOBW.js";import{f as k,g as M}from"./chunk-BZXE3HO4.js";import{h as _}from"./chunk-WS3Z6W3M.js";function de(e,r){let t=new Map;for(let o of e){let n=t.get(o.check)??[];n.push(o),t.set(o.check,n)}let i=[];for(let[o,n]of t){let c=n.filter(d=>d.outcome==="resolved").length,s=n.filter(d=>d.outcome==="suppressed").length,l=n.filter(d=>d.outcome==="still-open").length,h=n.length,C=n.filter(d=>d.outcome==="still-open").sort((d,b)=>d.firstSeen-b.firstSeen)[0];i.push({check:o,seen:h,resolved:c,suppressed:s,stillOpen:l,resolutionRate:h>0?c/h:0,suppressionRate:h>0?s/h:0,oldestOpenAgeDays:C?Math.floor((r-C.firstSeen)/Ie):null})}return i.sort((o,n)=>o.check.localeCompare(n.check))}var Ie=864e5;function le(e){return _(e).map(r=>({check:r.check,findingId:r.findingId,firstSeen:r.firstSeen,lastSeen:r.lastSeen,timesShown:r.timesShown,outcome:r.outcome}))}function f(e){return e.scoreCount??e.count}function B(e){let r=ze(e),{breakdown:t,pressure:i}=Ne(e),o=me(t,"risk"),n=me(t,"hygiene");return{score:Math.min(o,n),riskScore:o,hygieneScore:n,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,duplicateBodyGroups:e.duplicateBodies.count,duplicateBodyLoc:e.duplicateBodies.loc,twinDriftGroups:e.twinDrift.count,twinDriftLoc:e.twinDrift.loc,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:f(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:f(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:f(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null,coverageContractViolations:e.coverageContracts.count},axes:Oe(e),validation:_e(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0,detectorPrecision:[]}}function Oe(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:Ve(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.duplicateBodies.count+e.twinDrift.count+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function Ve(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:g(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function _e(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],twinDrift:e.twinDrift.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,n=0,c=0;for(let[C,d]of Object.entries(r))i.has(C)?o+=d.fixChanges:(n+=d.fixChanges,c+=1);let s=i.size>0?g(o/i.size):0,l=c>0?g(n/c):0,h={};for(let[C,d]of Object.entries(t)){let b=new Set(d);if(b.size===0)continue;let S=0;for(let R of b)S+=r[R]?.fixChanges??0;let x=g(S/b.size);h[C]={flaggedFiles:b.size,fixDensity:x,lift:l>0?g(x/l):null}}return{flaggedFiles:i.size,flaggedFixDensity:s,baselineFixDensity:l,ratio:i.size>0&&l>0?g(s/l):null,byCategory:h,validationBasis:{method:"subject-regex",commitsScanned:e.gitEvidence?.commitsScanned??0}}}function g(e){return Math.round(e*100)/100}function he(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function y(e,r="existing shared infrastructure discount"){let t=f(e);return Math.abs(t-e.count)<.01?"":` (${he(t)} score-weighted after ${r})`}function w(e,r){let t=f(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${he(t)} score-weighted)`}function ze(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere -- deletion candidates; confirm with cleanup-plan --verify before deleting`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.duplicateBodies.count>0&&r.push({category:"Duplicate function bodies",evidence:"heuristic",description:`${e.duplicateBodies.count} exact small-body group(s) across files \u2014 consolidate only when the domain concept matches`,effort:"low",impact:"medium",count:e.duplicateBodies.count,locRecoverable:e.duplicateBodies.loc}),e.twinDrift.count>0&&r.push({category:"Drifted twin implementations",evidence:"heuristic",description:`${e.twinDrift.count} same-name (or near-name) function group(s) across files with diverged or identical bodies \u2014 the same concept implemented twice; consolidate or verify the drift is intentional`,effort:"medium",impact:"medium",count:e.twinDrift.count,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${y(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${y(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${y(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.coverageContracts.count>0&&r.push({category:"Coverage contract drift",evidence:"graph-fact",description:`${e.coverageContracts.count} configured coverage contract(s) drifted from their ground-truth source (enumeration rot) \u2014 run \`scip-query diff-gate\` or \`scip-query health --json\` for the missing/extra keys`,effort:"low",impact:"medium",count:e.coverageContracts.count,locRecoverable:0}),e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+y({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,n)=>{let c=t[o.impact]*i[o.effort];return t[n.impact]*i[n.effort]-c}),r}var pe={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","duplicate-bodies":"hygiene","twin-drift":"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","duplicate-bodies-pressure":"hygiene","twin-drift-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function me(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Ne(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],n=(p,H,v)=>{H>0&&i.push({axis:p,points:H,detail:v,kind:pe[p]??"hygiene"})},c=(p,H,v,Ae,Be,Te,Fe)=>{let L=Math.max(Ae,1);if(v<=L)return;let P=v/L,E=Math.min(Be,Math.ceil(Math.log2(P)*Te));if(E<=0)return;let $e=pe[p]??"hygiene";o.push({axis:p,category:H,kind:$e,count:v,threshold:g(L),ratio:g(P),extraPenalty:E}),n(p,E,`${v} ${Fe} exceed pressure threshold ${g(L)} (${g(P)}x)`)},s=e.dead.count/t;n("dead-code",Math.min(20,Math.round(s*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let l=e.isolated.count/t;n("isolated",Math.min(10,Math.round(l*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),n("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let h=e.similarCount/t*1e3;n("similar",Math.min(10,Math.round(h)),`${e.similarCount} similar function pair(s)`);let C=e.duplicateBodies.count/t*1e3;n("duplicate-bodies",Math.min(10,Math.round(C*2)),`${e.duplicateBodies.count} exact duplicate small-body group(s) (${e.duplicateBodies.loc} duplicate LOC)`);let d=e.twinDrift.count/t*1e3;n("twin-drift",Math.min(10,Math.round(d*2)),`${e.twinDrift.count} drifted twin implementation group(s) (same or near-same name, diverged or identical bodies)`);let b=e.reactComponentDuplicates.count/r*1e3;n("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let S=f(e.reactHookCandidates),x=S/r*1e3;n("react-hook-candidates",Math.min(10,Math.round(x)),w(e.reactHookCandidates,"duplicated React behavior pair(s)"));let R=e.reactLargeComponentPressure.count/r*1e3;n("react-large-component-pressure",Math.min(5,Math.round(R/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let Pe=e.vueComponentDuplicates.count/r*1e3;n("vue-component-duplicates",Math.min(10,Math.round(Pe)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let I=f(e.vueComposableCandidates),Ee=I/r*1e3;n("vue-composable-candidates",Math.min(10,Math.round(Ee)),w(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let ke=e.vueLargeViewPressure.count/r*1e3;n("vue-large-view-pressure",Math.min(5,Math.round(ke/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let O=f(e.wrappers);n("wrappers",Math.min(3,O),w(e.wrappers,"wrapper candidate(s)"));let V=f(e.passthroughs);n("passthroughs",Math.min(3,V),w(e.passthroughs,"passthrough candidate(s)")),n("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Me=e.drift.direct/r;if(n("drift",Math.min(5,Math.round(Me*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),n("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling",Math.min(5,Math.ceil(p/10)),w({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:p},"co-changing pair(s) without a structural link"))}if(c("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),c("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let p=e.gitEvidence.hiddenCoupling.scoreCount;c("hidden-coupling-pressure","Hidden coupling",p,50,10,4,"score-weighted co-changing pair(s)")}return c("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),c("duplicate-bodies-pressure","Duplicate function bodies",e.duplicateBodies.count,Math.max(20,t*.005),8,4,"exact duplicate small-body group(s)"),c("twin-drift-pressure","Drifted twin implementations",e.twinDrift.count,Math.max(20,t*.005),8,4,"drifted twin implementation group(s)"),c("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),c("react-hook-candidates-pressure","Duplicated React hook behavior",S,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),c("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),c("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),c("vue-composable-candidates-pressure","Duplicated Vue behavior",I,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),c("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),c("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),c("wrappers-pressure","Wrapper functions",O,50,4,2,"wrapper candidate(s)"),c("passthroughs-pressure","Passthrough functions",V,50,4,2,"passthrough candidate(s)"),c("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),c("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Ue}from"v8";var We=64*1024*1024;function T(){let e=globalThis.gc;if(!e)return;let r=Ue();r.heap_size_limit-r.used_heap_size<We||e()}var Ge=50,je=25e3,qe=2500,ge=2500,fe=50,Ye=10,Ke=["overview","dead","isolated","cycles","similar","duplicate-bodies","twin-drift","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions","coverage-contracts"],ve={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Je(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:Ze(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:et(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:tt(e,r,t)}),"duplicate-bodies":(e,r,t)=>({phase:"duplicate-bodies",duplicateBodies:it(e,r,t)}),"twin-drift":(e,r,t)=>({phase:"twin-drift",twinDrift:ot(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:nt(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:ct(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:st(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:at(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:ut(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:dt(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:rt(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:lt(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:pt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:mt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:Ct(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:bt(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:ht(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:gt(e,t)}),"coverage-contracts":(e,r,t)=>({phase:"coverage-contracts",coverageContracts:ft(e,t)})};function dr(e,r={}){return Se(e,r.full!==!1,(t,i)=>{let o=Qe(e,r.scope,t,i),n=B(o);return n.detectorPrecision=de(le(e),Date.now()),n})}function lr(e,r,t={}){return Xe(e,[r],t)[0]}function Xe(e,r,t={}){return Se(e,t.full!==!1,(i,o)=>{let n={...o,releaseCachesBetweenPhases:!1};return r.map(c=>ve[c](e,t.scope,n,i))})}function Se(e,r,t){let i=ee(e),o=vt(i,r);try{return t(i,o)}finally{A(e,{semanticProvider:!0}),T()}}function pr(e){return B(we(e))}function we(e){let r=u(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:u(e,"dead").dead,isolated:u(e,"isolated").isolated,realCycleCount:u(e,"cycles").realCycleCount,similarCount:u(e,"similar").similarCount,duplicateBodies:u(e,"duplicate-bodies").duplicateBodies,twinDrift:u(e,"twin-drift").twinDrift,reactComponentDuplicates:u(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:u(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:u(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:u(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:u(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:u(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:u(e,"extract-candidates").extractCount,wrappers:u(e,"wrapper-candidates").wrappers,passthroughs:u(e,"passthrough-candidates").passthroughs,stale:u(e,"stale-abstractions").stale,drift:u(e,"drift").drift,complexity:u(e,"complexity-hotspots").complexity,gitEvidence:Ce(e,"git-evidence")?.gitEvidence??null,suppressions:Ce(e,"suppressions")?.suppressions??null,coverageContracts:u(e,"coverage-contracts").coverageContracts}}function Ce(e,r){return e.find(t=>t.phase===r)}function u(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Qe(e,r,t,i){return we(Ke.map(o=>ve[o](e,r,i,t)))}function Je(e,r,t){return a(e,t,"dead",()=>{let i=q(e,{scope:r,...m.dead,scanLimit:t.candidateScanLimit});return D(xt(e,i.symbols))})}function Ze(e,r,t){return a(e,t,"isolated",()=>{let i=X(e,{scope:r,...m.isolated,scanLimit:t.candidateScanLimit});return D(Ht(e,i))})}function et(e,r,t){return a(e,t,"cycles",()=>j(e,{scope:r}).filter(o=>o.kind==="real").length)}function tt(e,r,t){let i=a(e,t,"similar",()=>J(e,{scope:r,...m.similar,scanLimit:t.candidateScanLimit}));return Math.min(i,t.candidateResultLimit)}function rt(e,r,t){return a(e,t,"extract-candidates",()=>K(e,{scope:r,...m.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function it(e,r,t){return a(e,t,"duplicate-bodies",()=>{let i=U(e,{scope:r,...m.duplicateBodies,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=new Set,n=0;for(let c of i)for(let s of c.functions.slice(1))o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o]}})}function ot(e,r,t){return a(e,t,"twin-drift",()=>{let i=W(e,{scope:r,...m.twinDrift,scanLimit:t.candidateScanLimit}).filter(c=>c.relationship==="divergent"||c.relationship==="identical"),o=new Set,n=0;for(let c of i)for(let s of c.members)o.add(s.file),n+=s.loc;return{count:i.length,loc:n,files:[...o].sort()}})}function nt(e,r,t){return a(e,t,"react-component-duplicates",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ct(e,r,t){return a(e,t,"react-hook-candidates",()=>{let i=oe(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,yt)})}function st(e,r,t){return a(e,t,"react-large-component-pressure",()=>{let i=ne(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return Lt(i)})}function at(e,r,t){return a(e,t,"vue-component-duplicates",()=>{let i=ce(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return F(i)})}function ut(e,r,t){return a(e,t,"vue-composable-candidates",()=>{let i=se(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return He(i,Dt)})}function dt(e,r,t){return a(e,t,"vue-large-view-pressure",()=>{let i=ae(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return D(i)})}function lt(e,r,t){return a(e,t,"wrapper-candidates",()=>{let i=te(e,{scope:r,...m.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xe(i,Rt)})}function pt(e,r,t){return a(e,t,"passthrough-candidates",()=>{let i=Q(e,{scope:r,...m.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return xe(i,Pt)})}function mt(e,r,t){return a(e,t,"stale-abstractions",()=>{let i=Z(e,{scope:r,...m.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(n=>n.consumers===0).length;return{count:i.length,loc:i.reduce((n,c)=>n+c.loc,0),files:[...new Set(i.map(n=>n.file))],unused:o,singleUse:i.length-o}})}function ht(e,r){return a(e,r,"git-evidence",()=>{let t=z(e),i=t.fileChurn();if(!i)return null;let o=t.commitHistory(),n=N(e,void 0,{limit:r.candidateResultLimit}),c={};for(let[s,l]of i)c[s]={changes:l.changes,fixChanges:l.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:n.findings.length,scoreCount:$(n.findings.reduce((s,l)=>s+be(l),0)),top:n.findings.slice(0,5).map(s=>({fileA:s.fileA,fileB:s.fileB,together:s.together,confidence:s.confidence,focusedTogether:s.focusedTogether,broadTogether:s.broadTogether,broadCommitRatio:s.broadCommitRatio,lastTogetherAt:s.lastTogetherAt,recentTogether:s.recentTogether,commitScope:s.commitScope,recency:s.recency,scoreWeight:be(s),subjectContext:s.subjectContext}))},fileStats:c,commitsScanned:o?.commits.length??0}})}function gt(e,r){return a(e,r,"suppressions",()=>{let t=ue(e);return{total:t.total,byCategory:{...t.byCategory}}})}function ft(e,r){return a(e,r,"coverage-contracts",()=>{let t=e.config.coverageContracts??[],o=G(e,t).filter(n=>n.status!=="ok");return{count:o.length,loc:0,files:[...new Set(o.map(n=>n.file))].sort()}})}function Ct(e,r,t){return a(e,t,"drift",()=>{let i=Y(e,{scope:r,...m.drift,includePatternDeviations:!1,limit:Number.POSITIVE_INFINITY}),o=i.results.filter(s=>s.kind!=="pattern-deviation"),n=o.filter(s=>s.actionTier==="direct").length,c=o.length-n;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:n,signal:c}})}function bt(e,r,t){return a(e,t,"complexity-hotspots",()=>{let i=re(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>Ge).length}})}function vt(e,r){let t=e.symbols>=je||e.documents>=qe,i=r?Number.POSITIVE_INFINITY:fe,o=r?Number.POSITIVE_INFINITY:Ye;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ge,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ge} symbols and reported their top ${fe} findings. Enable full mode for unbounded candidate counts.`]}}function St(e,r){r.releaseCachesBetweenPhases&&(A(e),T())}function a(e,r,t,i){wt(t);try{return i()}finally{St(e,r)}}function wt(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function xt(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function Ht(e,r){return r.filter(t=>!k(e,t.relativePath)&&!M(e,t.symbol,t.relativePath))}function D(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function xe(e,r){return{...D(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function Lt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function F(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function He(e,r){return{...F(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function yt(e){let r=e.sharedHooks.length>0,t=Le({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:ye(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function Dt(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Le({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:ye(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Le(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Re.has(De(r))).length+Math.min(e.functions.length,3)}function ye(e,r,t){let i=[...e,...r,...t].map(De);return i.length>0&&i.every(o=>Re.has(o))}function De(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function Rt(e){return e.actionTier==="signal"?.25:1}function Pt(e){return e.actionTier==="signal"?.25:1}function be(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var Re=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{Ke as a,dr as b,lr as c,Xe as d,pr as e};
|
|
2
|
-
//# sourceMappingURL=chunk-U3VMUDXJ.js.map
|
package/dist/chunk-UHPWZCYQ.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{b as w}from"./chunk-7COVQPQQ.js";import{b as I}from"./chunk-B75HZHUP.js";import{b as y}from"./chunk-BZXE3HO4.js";import{d as A}from"./chunk-JZBGTSAB.js";import{p as b}from"./chunk-WS3Z6W3M.js";import{g as R}from"./chunk-GNG622H3.js";var P=60;function nt(e,s={}){let{scope:n,limit:t=30,scanLimit:i,rotDays:r=P}=s,c=I(R(e,{extensions:[".ts",".tsx",".js",".jsx",".mjs",".cjs"]}).filter(a=>y(a)==="test").filter(a=>!n||a.includes(n)).filter(a=>!e.isIgnored(a)).sort(),i),o=[],l=[],p=[];for(let a of c){let d=b(e,a);if(!d)continue;let m=A(d),x=K(d);for(let u of $(m,x))x.add(u);let O=C(m);for(let u of O){if(u.skip){l.push(H(e,a,u,r));continue}if(u.kind==="describe")continue;let S=F(d,u.argsStart),h=m.slice(u.argsStart,u.callEnd),M=d.slice(u.argsStart,u.callEnd);_(h,x)||o.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,severity:/\bawait\b/.test(h)?"low":"high"});let k=q(h,M);k&&p.push({file:a,startLine:f(d,u.callStart),endLine:f(d,u.callEnd),title:S,echoedValue:k})}}return{assertionFree:t?o.slice(0,t):o,skipped:t?l.slice(0,t):l,mockEcho:t?p.slice(0,t):p}}var E=/(?<!\.)\b(?:x(it|test|describe)|(it|test|describe)(?:\.\s*(skip|only|todo|each\s*\([^)]*\)))?)\s*\(/g;function C(e){let s=[];E.lastIndex=0;let n;for(;n=E.exec(e);){let t=n[1],i=t??n[2];if(!i)continue;let r=n[3]?.split(/\s*\(/)[0],c=n.index,o=n.index+n[0].length-1,l=g(e,o);E.lastIndex=o+1,r!=="each"&&s.push({kind:i,skip:t!==void 0||r==="skip"||r==="todo",skipKind:r==="todo"?"todo":"skip",callStart:c,argsStart:o+1,callEnd:l+1})}return s}function g(e,s){let n=0;for(let t=s;t<e.length;t+=1){let i=e[t];if(i==="(")n+=1;else if(i===")"&&(n-=1,n===0))return t}return e.length-1}function f(e,s){let n=0;for(let t=0;t<s&&t<e.length;t+=1)e[t]===`
|
|
2
|
-
`&&(n+=1);return n}function F(e,s){let n=e.slice(s,s+400),t=/^\s*(['"`])((?:\\.|(?!\1)[\s\S])*)\1/.exec(n);return t?t[2]:"(anonymous)"}var D=new Set(["vitest","chai","jest","@jest/globals","assert","node:assert","node:assert/strict","assert/strict","uvu/assert","expect","chai-as-promised"]),L=/import\s+(?:\*\s+as\s+(\w+)|\{([^}]*)\}|(\w+))\s+from\s+['"]([^'"]+)['"]/g;function K(e){let s=new Set(["expect","assert"]);L.lastIndex=0;let n;for(;n=L.exec(e);){let[,t,i,r,c]=n;if(!(!c||!D.has(c))&&(t&&s.add(t),r&&s.add(r),i))for(let o of i.split(",")){let l=o.trim().replace(/^type\s+/,"");if(!l)continue;let p=/^(\w+)\s+as\s+(\w+)$/.exec(l);s.add(p?p[2]:l)}}return s}function _(e,s){if(/\.should\b/.test(e)||/\bthrow\b/.test(e))return!0;for(let n of s){let t=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");if(new RegExp(`\\b${t}\\s*(?:<[^<>]*>)?\\s*[.(]`).test(e))return!0}return!1}var v=/\bfunction\s+(\w+)\s*\(/g,j=/\b(?:const|let)\s+(\w+)\s*=\s*(?:async\s*)?\(/g,V=60;function $(e,s){let n=new Set;for(let t of[v,j]){t.lastIndex=0;let i;for(;i=t.exec(e);){let r=i[1],c=i.index+i[0].length-1,o=g(e,c),l=e.indexOf("{",o+1);if(l===-1||l-o>V)continue;let p=Q(e,l),a=e.slice(l+1,p);_(a,s)&&n.add(r)}}return n}function Q(e,s){let n=0;for(let t=s;t<e.length;t+=1){let i=e[t];if(i==="{")n+=1;else if(i==="}"&&(n-=1,n===0))return t}return e.length-1}var U=/\bmock(?:ReturnValue|ResolvedValue)(?:Once)?\s*\(/g,T=/\bexpect\s*\(/g,B=/^\s*\.\s*(?:toBe|toEqual|toStrictEqual)\s*\(/,N=/^(?:-?\d+(?:\.\d+)?|(['"`]).+\1)$/;function q(e,s){let n=G(e,s,U);if(n.length===0)return null;let t=Y(e,s);for(let i of t)if(n.includes(i))return i;return null}function G(e,s,n){let t=[];n.lastIndex=0;let i;for(;i=n.exec(e);){let r=i.index+i[0].length-1,c=g(e,r),o=s.slice(r+1,c).trim();N.test(o)&&t.push(o),n.lastIndex=c+1}return t}function Y(e,s){let n=[];T.lastIndex=0;let t;for(;t=T.exec(e);){let i=t.index+t[0].length-1,r=g(e,i),c=e.slice(r+1),o=B.exec(c);if(T.lastIndex=r+1,!o)continue;let l=r+1+o[0].length-1,p=g(e,l),a=s.slice(l+1,p).trim();N.test(a)&&n.push(a)}return n}function H(e,s,n,t){let i=b(e,s),r=F(i,n.argsStart),c=f(i,n.callStart),o=X(e.config.projectRoot,s,c),l=o===null?"unknown":o>=t?"rot":"workflow";return{file:s,startLine:c,title:r,skipKind:n.skipKind,blockKind:n.kind,ageDays:o,rot:l}}function X(e,s,n){let t=n+1;try{let i=w(e,["blame","-L",`${t},${t}`,"--porcelain","--",s]),r=/^author-time (\d+)$/m.exec(i);if(!r)return null;let c=Number(r[1]);return Number.isFinite(c)?Math.max(0,Math.round((Date.now()/1e3-c)/86400)):null}catch{return null}}export{nt as a};
|
|
3
|
-
//# sourceMappingURL=chunk-UHPWZCYQ.js.map
|
package/dist/chunk-URSSPS5H.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,b as F}from"./chunk-KJCDEDQW.js";import{a as k,b as C,c as V,e as a,f as v}from"./chunk-6XA4LDHY.js";import{a as B,b as g}from"./chunk-KMVGRIO2.js";import{F as y}from"./chunk-ISLWJ4PY.js";function j(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:t=6,limit:i=20,scope:l,scanLimit:c,filePattern:d,focusFiles:h}=s,u=y(e).vueProfiles({scope:l,minBehaviorTokens:Math.max(3,t),scanLimit:c}).map(n=>({file:n.file,tokens:n.behaviorTokens,profile:n})),r=R(u,n=>n.tokens);return F({profiles:u,limit:i,filePattern:d,focusFiles:h,candidateIndex:r,profile:{name:"vue-composable-candidates"},compare:(n,o)=>T(n,o,m,t),sort:(n,o)=>o.similarity-n.similarity||n.fileA.localeCompare(o.fileA)||n.fileB.localeCompare(o.fileB)})}function T(e,s,m,t){let i=B(e.tokens,s.tokens);if(i.size<t||!P(i))return null;let l=C(e.tokens,s.tokens);if(l<m)return null;let c=a(i,"composable:"),d=a(i,"store:"),h=a(i,"reactivity:"),u=a(i,"lifecycle:"),r=a(i,"request:"),n=a(i,"function:"),o=a(i,"function-verb:"),b=a(i,"template-binding:"),p=a(i,"template-event:"),f=q({sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:l,sharedTokens:v(i),sharedComposables:c,sharedStores:d,sharedReactivity:h,sharedLifecycle:u,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(g(s.tokens,e.tokens)).slice(0,25),reason:S({sharedComposables:c,sharedStores:d,sharedRequests:r,sharedLifecycle:u,sharedFunctions:n,sharedFunctionVerbs:o,sharedBindings:b}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function q(e){return k({genericWords:E,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function P(e){let s=0,m=0,t=0,i=0,l=0,c=0,d=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?m+=1:r.startsWith("request:")?t+=1:r.startsWith("lifecycle:")?i+=1:r.startsWith("function:")?l+=1:r.startsWith("reactivity:")?c+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(d+=1);let h=s+m,u=h+t+i+l+d;return V([{name:"requests",count:t},{name:"lifecycle",count:i},{name:"functions",count:l},{name:"reusableHooks",count:h},{name:"reactivity",count:c},{name:"namedBehavior",count:u}],[{min:{requests:1,namedBehavior:4},reason:"shared request workflow"},{min:{lifecycle:1,functions:2,namedBehavior:4},reason:"shared lifecycle workflow"},{min:{reusableHooks:2,requests:1,namedBehavior:5},reason:"shared reusable Vue hooks and requests"},{min:{reusableHooks:2,functions:2,namedBehavior:5},reason:"shared reusable Vue hooks and functions"},{min:{functions:2,reactivity:1,namedBehavior:4},reason:"shared reactive functions"}]).pass}function S(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var E=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{j as a};
|
|
2
|
-
//# sourceMappingURL=chunk-URSSPS5H.js.map
|
package/dist/chunk-WIBFXSYB.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{execFileSync as m}from"child_process";import{platform as d}from"os";var h=d()==="win32";function n(e){let r=h?"where":"which";try{return m(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as l}from"child_process";import{createRequire as y}from"module";import{existsSync as S}from"fs";import{platform as o,arch as p}from"os";var u="v0.8.1",c="https://github.com/sourcegraph/scip",g="SCIP_QUERY_SCIP_BIN";function w(e){if(e.isOnPath("scip"))return{source:"path",path:"scip"};let r=e.env[g];if(r&&e.fileExists(r))return{source:"env",path:r};if(e.platform==="win32"){let i=e.resolveSidecar(e.arch);if(i&&e.fileExists(i))return{source:"sidecar",path:i}}return null}function v(e){let r=y(import.meta.url);for(let i of e==="arm64"?["arm64","x64"]:[e])try{return r.resolve(`scip-query-scip-windows/scip-win32-${i}.exe`)}catch{}return null}function f(e=process.env){return w({platform:o(),arch:p(),env:e,isOnPath:n,fileExists:S,resolveSidecar:v})?.path??null}function N(){return f()!==null}function q(){let e=f();if(!e)return null;try{return l(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function x(){let e=o(),r=p(),i,s,t;switch(e){case"darwin":i="darwin",t="tar.gz";break;case"linux":i="linux",t="tar.gz";break;default:return null}switch(r){case"arm64":s="arm64";break;case"x64":s="amd64";break;default:return null}let a=`scip-${i}-${s}.${t}`;return{url:`${c}/releases/download/${u}/${a}`,filename:a}}function L(){let e=x();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),o()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
|
|
2
|
-
`),console.log("Or download manually:")):o()==="win32"?(console.log("On Windows the scip binary ships via the npm sidecar package scip-query-scip-windows,"),console.log("installed automatically with scip-query. If it is missing:"),console.log(" npm install -g scip-query-scip-windows"),console.log(`Or set ${g} to a local scip.exe path.
|
|
3
|
-
`),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
4
|
-
`:` ${c}/releases/tag/${u}
|
|
5
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function O(e){if(o()==="darwin"&&n("brew")){e("Installing scip CLI via Homebrew...");try{if(l("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`Homebrew install failed: ${i}`)}}if(n("go")){e("Installing scip CLI via go install...");try{if(l("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),n("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(r){let i=r instanceof Error?r.message:String(r);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${c}/releases`),!1}export{n as a,f as b,N as c,q as d,L as e,O as f};
|
|
6
|
-
//# sourceMappingURL=chunk-WIBFXSYB.js.map
|