scip-query 0.18.0 → 0.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +1 -0
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-2DBY4MO7.js → chunk-24ET4VLC.js} +2 -2
- package/dist/chunk-2NA6TYP4.js +120 -0
- package/dist/{chunk-XKWEMFHP.js → chunk-2WCXKANA.js} +2 -2
- package/dist/{chunk-LL5NQB5V.js → chunk-34MLC6UI.js} +2 -2
- package/dist/chunk-35NLDRZC.js +2 -0
- package/dist/{chunk-MNRKD3WP.js → chunk-3WLRW5TC.js} +2 -2
- package/dist/{chunk-SW7LKHRU.js → chunk-4BU54UJG.js} +2 -2
- package/dist/{chunk-T4P27T6S.js → chunk-4CZJ4YJB.js} +2 -2
- package/dist/{chunk-3CJXFMR5.js → chunk-4FMT4HPC.js} +2 -2
- package/dist/{chunk-J7IMQRCU.js → chunk-53SUJOJA.js} +2 -2
- package/dist/{chunk-27YDE22N.js → chunk-5GOBZI34.js} +2 -2
- package/dist/{chunk-4FLF7BHJ.js → chunk-5OZCNAVM.js} +2 -2
- package/dist/chunk-5TEUKVSM.js +2 -0
- package/dist/{chunk-GTANVH72.js → chunk-5W2VAEVR.js} +2 -2
- package/dist/{chunk-43QUXX3E.js → chunk-63P42UR6.js} +2 -2
- package/dist/{chunk-OQFPCIXO.js → chunk-64QITTX7.js} +2 -2
- package/dist/{chunk-P4L5QQT5.js → chunk-6O5JOS7T.js} +2 -2
- package/dist/chunk-6PKO2TNZ.js +2 -0
- package/dist/{chunk-OSBLECSI.js → chunk-7SGOWD2Y.js} +2 -2
- package/dist/chunk-7TJJY2C3.js +2 -0
- package/dist/{chunk-K3UVTL3J.js → chunk-AEM24WSF.js} +2 -2
- package/dist/{chunk-PV3GKBO5.js → chunk-AGTATREV.js} +2 -2
- package/dist/chunk-AOSFSYEA.js +20 -0
- package/dist/{chunk-VCRMI56V.js → chunk-APLNTJPJ.js} +2 -2
- package/dist/{chunk-7XP7ZRSI.js → chunk-AYRHVJXW.js} +2 -2
- package/dist/chunk-B2WQKQKP.js +3 -0
- package/dist/{chunk-SWJEREML.js → chunk-BBBKPOIT.js} +2 -2
- package/dist/{chunk-OTTHMUMV.js → chunk-BCMOTIB6.js} +2 -2
- package/dist/chunk-BMTBVMA3.js +10 -0
- package/dist/{chunk-J7WYG63U.js → chunk-C3KCSAQ4.js} +2 -2
- package/dist/{chunk-5CJ6AQN7.js → chunk-CAKPEQZB.js} +2 -2
- package/dist/{chunk-UWR52GNZ.js → chunk-CIYUFF24.js} +2 -2
- package/dist/{chunk-ABDXTPCT.js → chunk-CKFMZE77.js} +2 -2
- package/dist/chunk-DCDOGW32.js +2 -0
- package/dist/{chunk-ODH4FT3P.js → chunk-DFQNE73Y.js} +2 -2
- package/dist/chunk-DO775SYA.js +2 -0
- package/dist/chunk-DRH3AD7W.js +4 -0
- package/dist/chunk-DZXFZAZO.js +16 -0
- package/dist/chunk-E3KWOHH7.js +5 -0
- package/dist/chunk-EMIIOOTM.js +38 -0
- package/dist/chunk-ESNRT7QN.js +927 -0
- package/dist/{chunk-AWYKDRYV.js → chunk-FB6IKAKZ.js} +2 -2
- package/dist/{chunk-BGUYAA3Q.js → chunk-FBUNGRKI.js} +2 -2
- package/dist/{chunk-M2TRDR25.js → chunk-FC5K7T35.js} +1 -1
- package/dist/{chunk-GWCW25ON.js → chunk-FHLYJVXF.js} +2 -2
- package/dist/{chunk-IG6X65MG.js → chunk-FRXB74RQ.js} +2 -2
- package/dist/{chunk-IKMOYFUM.js → chunk-FTRNGQGR.js} +2 -2
- package/dist/{chunk-NX2YAXVQ.js → chunk-FUFNRZFJ.js} +2 -2
- package/dist/{chunk-JLZUM476.js → chunk-GAE7WCBK.js} +2 -2
- package/dist/chunk-GIHVWNKQ.js +18 -0
- package/dist/{chunk-MPBN5DO4.js → chunk-HCS5LB6U.js} +2 -2
- package/dist/{chunk-6JSTKSZH.js → chunk-HFBNIIZX.js} +2 -2
- package/dist/{chunk-JHK2DMUQ.js → chunk-HGFDYOVB.js} +1 -1
- package/dist/chunk-IOOCKVUA.js +6 -0
- package/dist/{chunk-4L4X66GE.js → chunk-J4MYRIYT.js} +2 -2
- package/dist/{chunk-TAB7AWKO.js → chunk-J5XJWCB3.js} +2 -2
- package/dist/{chunk-POGZSZPX.js → chunk-JBZXJXIS.js} +2 -2
- package/dist/chunk-JJZRS2OP.js +5 -0
- package/dist/chunk-KC2IFAAU.js +3 -0
- package/dist/{chunk-3M2UCPFS.js → chunk-KHE7J5ZN.js} +1 -1
- package/dist/{chunk-4XTPZ5CR.js → chunk-KMOMNTB4.js} +2 -2
- package/dist/chunk-KMUFGAIK.js +2 -0
- package/dist/chunk-LF5CIKWZ.js +26 -0
- package/dist/chunk-LM72NQ7T.js +3 -0
- package/dist/{chunk-QPF7CS5W.js → chunk-LQUDSHLB.js} +2 -2
- package/dist/chunk-MP43RX4O.js +67 -0
- package/dist/{chunk-D5OXYOJP.js → chunk-MQ2B33LQ.js} +1 -1
- package/dist/{chunk-WA64GKWB.js → chunk-NH7WNNQC.js} +3 -3
- package/dist/{chunk-HOZ3IXZ5.js → chunk-NTOBQK5H.js} +2 -2
- package/dist/{chunk-SUYCF4SX.js → chunk-OLG2YPLS.js} +2 -2
- package/dist/{chunk-O5Y3ISO3.js → chunk-OOUJBAKJ.js} +2 -2
- package/dist/{chunk-U244OVE6.js → chunk-OQ6TCHBB.js} +2 -2
- package/dist/{chunk-5GAUXLOE.js → chunk-PNESKY2Z.js} +2 -2
- package/dist/chunk-PYMZU5EG.js +2 -0
- package/dist/chunk-Q2WEWIKX.js +4 -0
- package/dist/chunk-QHKXGMOI.js +3 -0
- package/dist/{chunk-VXDMXZKC.js → chunk-RPEA7P5Z.js} +2 -2
- package/dist/{chunk-K65T4TJS.js → chunk-SJ6XSCG7.js} +2 -2
- package/dist/{chunk-LADYDOS5.js → chunk-SSXEYWN3.js} +2 -2
- package/dist/chunk-SYGAA54M.js +2 -0
- package/dist/{chunk-H4T2AST4.js → chunk-TYEGFDOP.js} +2 -2
- package/dist/chunk-UJKZQLDB.js +2 -0
- package/dist/{chunk-PZV2PGBR.js → chunk-US44MEVU.js} +2 -2
- package/dist/{chunk-EJ65IVPV.js → chunk-V5WBVF6K.js} +2 -2
- package/dist/{chunk-AV54WZUK.js → chunk-V7J4A3AH.js} +2 -2
- package/dist/{chunk-45QWQSWS.js → chunk-VIKEPD4D.js} +2 -2
- package/dist/{chunk-TLTLJ4SW.js → chunk-WAU7HVDI.js} +2 -2
- package/dist/chunk-WCZAABYF.js +2 -0
- package/dist/{chunk-FMD46HAG.js → chunk-WFRET75Z.js} +2 -2
- package/dist/chunk-WWCZCH7W.js +3 -0
- package/dist/chunk-XBN5VO53.js +2 -0
- package/dist/{chunk-35TZERMO.js → chunk-XCPE3G75.js} +2 -2
- package/dist/chunk-XYBNOILR.js +2 -0
- package/dist/{chunk-BAMVG4WQ.js → chunk-XZXUMGAA.js} +2 -2
- package/dist/{chunk-MN54AGZ3.js → chunk-YCSTKIYU.js} +2 -2
- package/dist/{chunk-CMLHZWRS.js → chunk-YGQBJUS6.js} +2 -2
- package/dist/{chunk-7ROLM67J.js → chunk-YILKXTIY.js} +2 -2
- package/dist/{chunk-YMFHC5J2.js → chunk-ZJGZCBYT.js} +2 -2
- package/dist/{chunk-D5F3IQYP.js → chunk-ZNK6K3LB.js} +2 -2
- package/dist/cli.js +2 -2
- package/dist/{command-descriptors-AQWWJNTT.js → command-descriptors-3EJHQLQZ.js} +173 -167
- package/dist/{config-types-70s7NxKB.d.ts → config-types-BA3xLCfG.d.ts} +28 -1
- package/dist/{db-BBmJ0v3b.d.ts → db-CzA-9_rL.d.ts} +6 -18
- package/dist/direct-navigation-C2A44KFT.js +3 -0
- package/dist/{health-CWpFL_6z.d.ts → health-DYy13GAe.d.ts} +3 -1
- package/dist/index.d.ts +23 -41
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -1
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +83 -0
- package/dist/queries/architecture.js +2 -0
- package/dist/queries/bottlenecks.d.ts +2 -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 +2 -2
- 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 +2 -2
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- 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 -3
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +2 -2
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +2 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +27 -10
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +2 -2
- 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 +2 -2
- 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 +2 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -4
- 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 +2 -2
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +2 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +2 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +2 -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 +2 -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 +2 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +2 -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 +24 -24
- package/dist/reindex.d.ts +12 -10
- package/dist/reindex.js +38 -38
- package/dist/runtime.d.ts +10 -9
- package/dist/runtime.js +2 -1
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/{scip-cli-CoMzb7Zu.d.ts → scip-cli-1bVKJgXi.d.ts} +1 -1
- package/dist/watch-server.js +7 -6
- package/docs/AI_FAILURE_MODES.md +1 -0
- package/docs/COMMAND_REFERENCE.md +3 -2
- package/docs/DETECTOR_GUIDE.md +5 -3
- package/docs/analyzer-inventory.md +16 -6
- package/docs/analyzer-validation-ledger.md +12 -1
- package/docs/architecture-coherence-vision.md +219 -0
- package/package.json +5 -1
- package/skills/_shared/SKILL.md +4 -3
- package/skills/scip-conductor/SKILL.md +1 -1
- package/skills/scip-directory-architecture/SKILL.md +116 -2
- package/skills/scip-maintainability/SKILL.md +3 -3
- package/skills/scip-query/SKILL.md +1 -1
- package/skills/scip-twin-drift/SKILL.md +1 -1
- package/skills/scip-verify/SKILL.md +1 -1
- package/dist/chunk-2GX3TNOW.js +0 -38
- package/dist/chunk-45XOH33S.js +0 -2
- package/dist/chunk-4MFMTEJ4.js +0 -5
- package/dist/chunk-BECOMXAL.js +0 -2
- package/dist/chunk-BJJHBKEC.js +0 -2
- package/dist/chunk-DDGO34I2.js +0 -26
- package/dist/chunk-DUKRAHV2.js +0 -2
- package/dist/chunk-EMEXMHOP.js +0 -7
- package/dist/chunk-GWNE2WJN.js +0 -3
- package/dist/chunk-H4JNB7RT.js +0 -3
- package/dist/chunk-L2RE5P3X.js +0 -2
- package/dist/chunk-L2TSLMPT.js +0 -5
- package/dist/chunk-NQBMGFFD.js +0 -2
- package/dist/chunk-O5A7BTMA.js +0 -3
- package/dist/chunk-OINSINYW.js +0 -2
- package/dist/chunk-OM6JHEW3.js +0 -16
- package/dist/chunk-OUXPJ4H5.js +0 -3
- package/dist/chunk-OWXNDSG3.js +0 -2
- package/dist/chunk-Q4UM4JJP.js +0 -2
- package/dist/chunk-QEIGJJBC.js +0 -20
- package/dist/chunk-R4VPIS4D.js +0 -10
- package/dist/chunk-RDX6WWHN.js +0 -4
- package/dist/chunk-RUQE7DZT.js +0 -2
- package/dist/chunk-S43DIBME.js +0 -18
- package/dist/chunk-SALRDXWM.js +0 -121
- package/dist/chunk-SMBIGBGN.js +0 -67
- package/dist/chunk-VQWDZ34M.js +0 -928
- package/dist/chunk-W3557RPL.js +0 -3
- package/dist/chunk-W3SKYOTF.js +0 -2
- package/dist/chunk-XEEQX5X3.js +0 -3
- package/dist/direct-navigation-K3CTVVBU.js +0 -3
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{a as le}from"./chunk-CIYUFF24.js";import{a as T}from"./chunk-7TJJY2C3.js";import{b as Q,e as ee,f as te,g as ne}from"./chunk-CAKPEQZB.js";import{b as ce}from"./chunk-B75HZHUP.js";import{c as P}from"./chunk-EMIIOOTM.js";import{h as oe,n as N}from"./chunk-DZXFZAZO.js";import{a as ie,b as re,c as se,k as ae}from"./chunk-US44MEVU.js";import{B as E,d as $,e as J,g as K,h as q,i as G,j as V,k as X,w as Y}from"./chunk-AYRHVJXW.js";import{p as Z}from"./chunk-GAE7WCBK.js";import{B as H,E as x,c as w}from"./chunk-WAU7HVDI.js";import{b as L,h as U,s as b,v as j,x as W,y as I,z}from"./chunk-FC5K7T35.js";import{a as S}from"./chunk-64MNV6AB.js";var _=new WeakMap,ue=j({kind:"definition-exclusions",invalidation:W("definition-exclusions"),serialize:e=>JSON.stringify(e),deserialize:Ie});function fe(e,t){let n=H(t);if(!(n==="rust"||n==="typescript"||n==="tsx"||n==="javascript"))return[];let r=I(e,t);if(!r)return[];let o=U(e,t,r),c=ue.read(e,t,o);if(c)return c;let u=n==="rust"?Oe(e,t):ke(e,t);return ue.write(e,t,o,u),u}function Ie(e){try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=t.map(Pe);return n.some(i=>i===null)?null:n}catch{return null}}function Pe(e){if(!e||typeof e!="object")return null;let t=e;if(typeof t.startLine!="number"||!Number.isFinite(t.startLine)||typeof t.endLine!="number"||!Number.isFinite(t.endLine)||typeof t.reason!="string"||t.containerName!==void 0&&typeof t.containerName!="string")return null;let n=t.disposition===void 0?Ge(t.reason):t.disposition;return n!=="exclude"&&n!=="implicit-usage"?null:{startLine:t.startLine,endLine:t.endLine,reason:t.reason,disposition:n,...t.containerName?{containerName:t.containerName}:{}}}var me=new Set(["describe","it","test","fdescribe","fit","xdescribe","xit","beforeEach","afterEach","beforeAll","afterAll","before","after","suite","bench","benchmark"]),Ne=/\b(?:describe|it|test|fdescribe|fit|xdescribe|xit|beforeEach|afterEach|beforeAll|afterAll|before|after|suite|bench|benchmark)\s*\(/,Te=/\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 ke(e,t){let n=I(e,t);if(!n||!Ae(n))return[];let i=x(e,t);if(!i)return[];let r=_.get(i);if(r)return r;let o=!1,c=i.rootNode;for(let l of c.namedChildren){if(l.type!=="expression_statement")continue;let d=l.namedChild(0);if(!d||d.type!=="call_expression")continue;let s=d.namedChild(0);if(!s)continue;let a=s.type==="member_expression"?s.namedChild(s.namedChildCount-1)?.text:s.text;if(a&&me.has(a)){o=!0;break}}let u=[];o&&u.push({startLine:0,endLine:c.endPosition.row,reason:"TS/JS test file (describe/it/test at top level)",disposition:"exclude"});for(let l of c.namedChildren){let d=null,s=null;if(l.type==="function_declaration")d=l.namedChild(0)?.text??null,s=l;else if(l.type==="export_statement"){let a=l.namedChild(0);a?.type==="function_declaration"&&(d=a.namedChild(0)?.text??null,s=a)}else if(l.type==="lexical_declaration"){let a=l.namedChild(0);if(a?.type==="variable_declarator"){let m=a.namedChild(0)?.text,p=a.namedChild(1);m&&(p?.type==="arrow_function"||p?.type==="function_expression")&&(d=m,s=a)}}d&&/^use[A-Z]/.test(d)&&s&&u.push({startLine:s.startPosition.row,endLine:s.endPosition.row,reason:"React custom hook (use*)",disposition:"exclude"})}return u.push(...pe(i,new Set(["function_declaration","method_definition","class_declaration","interface_declaration","type_alias_declaration","enum_declaration","variable_declarator","export_statement"]),new Set(["comment"]))),_.set(i,u),u}function Ae(e){if(e.includes("scip-query"))return!0;let t=!1;for(let n of me)if(e.includes(n)){t=!0;break}return t&&Ne.test(e)?!0:e.includes("use")&&Te.test(e)}var Fe=/scip-query[\s:-]*ignore[\s:-]*(?:dead(?:-code)?|stale)?/i;function Me(e){return Fe.test(e)}function pe(e,t,n){let i=[],r=o=>{if(t.has(o.type)&&o.parent){let u=o.parent.children,l=-1;for(let d=0;d<u.length;d+=1)if(u[d].startIndex===o.startIndex&&u[d].type===o.type){l=d;break}if(l>0)for(let d=l-1;d>=0;d-=1){let s=u[d];if(n.has(s.type)){if(Me(s.text)){i.push({startLine:o.startPosition.row,endLine:o.endPosition.row,reason:"scip-query suppression comment",disposition:"exclude"});break}continue}if(!(s.type==="attribute_item"||s.type==="inner_attribute_item"))break}}for(let c of o.namedChildren)r(c)};return r(e.rootNode),i}function Oe(e,t){let n=x(e,t);if(!n)return[];let i=_.get(n);if(i)return i;let r=[],o=Be(n);return o?(_.set(n,o),o):(ye(n.rootNode,r,!1,!1),r.push(...pe(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(...Ke(n.rootNode)),_.set(n,r),r)}function Be(e){return Ve(e.rootNode)?[{startLine:0,endLine:e.rootNode.endPosition.row,reason:"generated file (@generated header)",disposition:"exclude"}]:null}function ye(e,t,n,i){let r=n,o=i;e.type==="trait_item"&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait declaration body (dynamic dispatch)",disposition:"implicit-usage"}),e.type==="impl_item"&&e.childForFieldName("trait")&&(o=!0,t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl block (dynamic dispatch)",disposition:"implicit-usage"})),e.type==="function_item"||e.type==="function_signature_item"?Ue(e,t,n,i):i&&Je(e)?t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"trait impl associated item (dynamic dispatch)",disposition:"implicit-usage"}):e.type==="struct_item"||e.type==="enum_item"||e.type==="union_item"?je(e,t,n):e.type==="mod_item"&&k(e).some(c=>/#\[\s*cfg\s*\(\s*test\s*\)/.test(c))&&(r=!0);for(let c of e.namedChildren)ye(c,t,r,o)}function Ue(e,t,n,i){let r=k(e),o=null;i?o={reason:"trait impl method (dynamic dispatch)",disposition:"implicit-usage"}:n&&(o={reason:"inside #[cfg(test)] mod",disposition:"exclude"});for(let c of r){if(be(c)){o={reason:"#[allow(dead_code)]",disposition:"exclude"};break}let u=Ze(c);if(u){o=u;break}}o&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:o.reason,disposition:o.disposition})}function je(e,t,n){let i=k(e),r=e.namedChildren.find(o=>o.type==="type_identifier")?.text;i.some($e)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[derive(...)] - generated impl may access fields",disposition:"implicit-usage",containerName:r}),i.some(be)&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"#[allow(dead_code)]",disposition:"exclude",containerName:r}),n&&t.push({startLine:e.startPosition.row,endLine:e.endPosition.row,reason:"inside #[cfg(test)] mod",disposition:"exclude",containerName:r})}function k(e){let t=e.parent;if(!t)return[];let n=t.children,i=-1;for(let o=0;o<n.length;o+=1)if(n[o].startIndex===e.startIndex&&n[o].type===e.type){i=o;break}if(i<=0)return[];let r=[];for(let o=i-1;o>=0;o-=1){let c=n[o];if(c.type==="attribute_item"||c.type==="inner_attribute_item")r.push(c.text);else{if(c.type==="line_comment"||c.type==="block_comment")continue;break}}return r}var We=new Set(["test","bench","tokio::test","async_std::test"]),ze=new Set(["no_mangle","export_name","link_name","used","macro_export","proc_macro","proc_macro_derive","proc_macro_attribute"]),He=new Set(["allow","warn","deny","forbid","cfg","cfg_attr","doc","inline","cold","must_use","deprecated","repr","derive","automatically_derived","non_exhaustive","path","link","link_section","global_allocator","panic_handler"]);function Ze(e){if(/#\[\s*cfg\s*\(\s*test\s*\)/.test(e))return{reason:"#[cfg(test)]",disposition:"exclude"};let t=qe(e);return t?We.has(t)?{reason:`#[${t}]`,disposition:"exclude"}:ze.has(t)?{reason:`Rust ABI/export attribute #[${t}]`,disposition:"implicit-usage"}:He.has(t)?null:{reason:`Rust attribute macro #[${t}]`,disposition:"implicit-usage"}:null}function $e(e){return/#\[\s*derive\s*\(/.test(e)}function be(e){return/#\[\s*allow\s*\(\s*dead_code\s*\)/.test(e)}function Je(e){return e.type==="const_item"||e.type==="type_item"||e.type==="static_item"||e.type==="associated_type"}function Ke(e){let t=Xe(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:'attribute `with = "..."` module - body may be invoked via reflection',disposition:"implicit-usage",containerName:r})}return n}function qe(e){let t=/^#!?\[\s*([A-Za-z_][A-Za-z0-9_]*(?:\s*::\s*[A-Za-z_][A-Za-z0-9_]*)*)/.exec(e);return t?t[1].replace(/\s+/g,""):null}function Ge(e){return e==="#[tauri::command]"||e==="#[command]"||e==="#[wasm_bindgen]"||e==="#[no_mangle]"||e==="#[napi]"||e==="#[pyfunction]"||e==="#[pymethod]"||e==="#[pyo3]"||e==="#[doc(hidden)]"||e.startsWith("trait ")||e.startsWith("#[derive(<reflective>)]")||e.startsWith("#[derive(...)]")||e.startsWith('serde `with = "')||e.startsWith('attribute `with = "')||e.startsWith("Rust attribute macro #[")||e.startsWith("Rust ABI/export attribute #[")?"implicit-usage":"exclude"}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 de=/\bwith\s*=\s*"([^"]+)"/g;function Xe(e){let t=new Set;for(let n of e.descendantsOfType("attribute_item")){de.lastIndex=0;let i;for(;(i=de.exec(n.text))!==null;){let r=i[1],o=r.split("::").pop()??r;o&&t.add(o)}}return t}function ge(e){let t=A(e);return(n,i,r,o)=>t(n,i,r,o)?.disposition==="exclude"}function A(e){let t=new Map,n=i=>{let r=t.get(i);if(r)return r;let o=fe(e,i),c=new Map;for(let u of o){if(!u.containerName)continue;let l=c.get(u.containerName)??[];l.push(u),c.set(u.containerName,l)}return r={ranges:o,containers:c},t.set(i,r),r};return(i,r,o,c)=>{let u=n(i),l=[];for(let s of u.ranges)r>=s.startLine&&r<=s.endLine&&l.push(s);let d=new Set;c&&d.add(c);for(let s of E(o))d.add(s);for(let s of d){let a=u.containers.get(s);a&&l.push(...a)}return Ye(l)}}function Ye(e){if(e.length===0)return null;let n=e.find(i=>i.disposition==="exclude")??e[0];return{disposition:n.disposition,reason:n.reason}}function vt(e,t={}){L(e,{groups:t.semanticProvider===!0?["whole-project","semantic-provider"]:["whole-project"]})}function he(e,t,n={}){L(e,{groups:n.definitions===!0?["source-file","definition-catalog"]:["source-file"],file:t.replace(/\\/g,"/")})}function xe(e,t){if(t.isIgnoredPath(e.relativePath))return y("ignored-file");if(G(e.symbol))return y("module-like-symbol");if(!R(e.symbol))return y("non-value-symbol");if(!e.isFunctionLike&&e.enclosingSymbol&&R(e.enclosingSymbol))return y("nested-non-callable-value");if(!t.includeTests&&!Qe(e.relativePath))return y("test-file");if(!t.includeTests&&t.isExcludedRegion(e.relativePath,e.startLine,e.symbol,e.parentTypeName))return y("excluded-file-region");let n=J(e.symbol);if(n==="<constructor>")return y("implicit-constructor");if(e.symbol.startsWith("scip-python ")){if(n==="__all__")return y("python-runtime-metadata");if(/^__[^_].*__$/.test(n))return y("python-protocol-member")}return t.isDeclarationOnlyCallable()?y("declaration-only-callable"):t.isFrameworkContractCallable()?y("framework-contract-member"):V(e.symbol)?y("rust-trait-impl-member"):X(e.symbol)?y("rust-test-module"):!t.includeMembers&&!et(e)?y("member"):e.endLine-e.startLine+1<t.minLoc?y("below-min-loc"):{accepted:!0}}function Qe(e){return Q(e)!=="test"}function y(e){return{accepted:!1,rejectionReason:e}}function R(e){return q(e)||e.endsWith("().")||e.endsWith(".")}function et(e){return K(e.symbol)||E(e.symbol).length===0}function _e(){return new Map}function Se(e,t,n){let i=new Map;for(let r of ie(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 Ee(e,t,n,i={}){let r=new Set;if(i.conservative||n.size===0){for(let o of se(e,t))r.add(o.symbol_id);return r}for(let o of re(e,t))e.isIgnored(o.relative_path)||n.has(o.relative_path)||r.add(o.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,o]of i)if(r!==n&&o.occurrences>0)return!0;return!1}function Re(e){return e?.occurrences??0}function v(e,t,n,i,r="source-fallback"){if(i<=0)return;let o=ve(e,t,n);o.occurrences+=i,o.sources.add(r)}function Ce(e,t,n,i,r){if(i<=0)return;let o=ve(e,t,n);o.occurrences=Math.max(i,o.occurrences),o.sources.add(r)}function ve(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 tt=1e3,nt=300;function Qt(e,t={}){let{scope:n,minLoc:i=1,includeTests:r=!1,skipBarrels:o=!1,includeMembers:c=!1,deadCodeOnly:u=!1,scanLimit:l,semantic:d=!0}=t,s=0,a=b("dead.candidates",()=>{let f=ce(it(e,{scope:n,minLoc:i,includeTests:r,includeMembers:c}),l);return s=f.length,f},()=>({definitions:s})),m=0,p=o?b("dead.inactive-barrels",()=>{let f=new Set(ee(e));return m=f.size,f},()=>({paths:m})):new Set,M=0,g=u?_e():b("dead.mention-reference-counts",()=>{let f=Se(e,p,a.map(D=>D.symbolId));return M=f.size,f},()=>({definitions:a.length,symbolsWithReferences:M})),O=0,Le=u?b("dead.mentioned-symbol-ids",()=>{let f=Ee(e,a.map(D=>D.symbolId),p,{conservative:p.size===0});return O=f.size,f},()=>({definitions:a.length,referencedSymbols:O})):new Set,h=u?a.filter(f=>!Le.has(f.symbolId)):a.filter(f=>!C(g,f.symbolId,f.relativePath));u?b("dead.source-fallback.dead-code-only",()=>ut(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0})):b("dead.source-fallback.ast",()=>lt(e,h,g,{inactiveBarrelPaths:p}),()=>({definitions:h.length,testReferencesIncluded:!0}));let B=u?h.filter(f=>!F(g,f.symbolId)):h.filter(f=>!C(g,f.symbolId,f.relativePath));b("dead.caller-map-supplement",()=>yt(e,B,g,{inactiveBarrelPaths:p,includeSemantic:!u&&d}),()=>({definitions:B.length,semantic:!u&&d}));let we=u?h.filter(f=>!F(g,f.symbolId)):a;return ct(e,ot(we,g))}function it(e,t){let n=ge(e),i=[];for(let r of Y(e,{scope:t.scope,symbolMatches:R,sqlPrefilter:"function-like"}))xe(r,{minLoc:t.minLoc,includeTests:t.includeTests,includeMembers:t.includeMembers,isIgnoredPath:c=>e.isIgnored(c),isExcludedRegion:n,isDeclarationOnlyCallable:()=>st(e,r),isFrameworkContractCallable:()=>le(e,r)}).accepted&&i.push(r);return i}var rt=["method_signature","abstract_method_signature","call_signature","construct_signature"];function st(e,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let n=x(e,t.relativePath);if(n)return n.rootNode.descendantsOfType([...rt]).some(r=>r.startPosition.row<=t.startLine&&r.endPosition.row>=t.endLine);let i=z(e,t.relativePath).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
+
`).trim();return i.endsWith(";")&&!i.includes("=>")&&!i.includes("{")}function ot(e,t){return e.map(n=>at(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 at(e,t){let n=t.get(e.symbolId)??new Map,i=Re(n.get(e.relativePath)),r=0;for(let[o,c]of n)o!==e.relativePath&&(r+=c.occurrences);return{relative_path:e.relativePath,start_line:e.startLine,end_line:e.endLine,loc:e.endLine-e.startLine+1,symbol:e.symbol,parent_type_name:e.parentTypeName,same_file_refs:i,cross_file_refs:r}}function ct(e,t){let n=A(e),i=[],r=0,o=0,c=0,u=0,l=0,d=0;for(let s of t){if(e.isIgnored(s.relative_path))continue;if(te(e,s.relative_path)){u++;continue}if(ne(e,s.symbol,s.relative_path)){l++;continue}let a=n(s.relative_path,s.start_line,s.symbol,s.parent_type_name),m=a?.disposition==="implicit-usage"?a.reason:void 0,p=m?"implicit-usage":s.same_file_refs===0?"dead-code":"file-internal";p==="dead-code"?r++:p==="file-internal"?o++:c++,d+=s.loc,i.push({relativePath:s.relative_path,startLine:s.start_line,endLine:s.end_line,loc:s.loc,symbol:s.symbol,shortName:$(s.symbol),sameFileRefs:s.same_file_refs,kind:p,...m?{implicitUsageReason:m}:{}})}return{symbols:i,counts:{total:i.length,deadCode:r,fileInternal:o,implicitUsage:c,loc:d},applicability:{entrySurfaceExcluded:u,externalRootExcluded:l,implicitUsageSignals:c},totalCount:i.length,deadCodeCount:r,fileInternalCount:o,implicitUsageCount:c,totalLoc:d}}function lt(e,t,n,i){if(t.length===0)return;let r=new T(e),o=new Set(t.map(l=>l.symbolId)),c=new Set(t.map(l=>l.leaf).filter(Boolean)),u=new Set(r.sourceFiles());for(let l of S(e))u.add(l);r.scanSourceReferences({paths:u,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:c,skipPath:l=>i.inactiveBarrelPaths.has(l)},l=>{o.has(l.target.symbolId)&&(mt(e,l)||v(n,l.target.symbolId,l.sourceFile,pt(l),"source-fallback"))})}function ut(e,t,n,i){if(t.length===0)return;let r=new T(e),o=dt(t),c=new Set(r.sourceFiles());for(let s of S(e))c.add(s);let u=new Set(o.keys()),l=new Map,d=s=>{let a=l.get(s);return a||(a=oe(e,s),l.set(s,a)),a};r.scanSourceReferences({paths:c,includeVueSfc:!0,includeCrossLanguageDispatchNames:!0,includeRustAttributeNames:!0,identifierResolution:"permissive",candidateNames:u,skipPath:s=>i.inactiveBarrelPaths.has(s),resolveTargets:({sourceFile:s,name:a,kind:m})=>{let p=o.get(a);return p?ft(s,a,p,()=>d(s),{permissive:m!=="cross-language-dispatch"}):[]},afterPath:s=>{l.delete(s),he(e,s)}},s=>{let a=s.kind==="identifier"&&s.sourceFile===s.target.relativePath?Math.max(0,s.occurrences-1):s.occurrences;s.kind==="identifier"&&De(e,{sourceFile:s.sourceFile,name:s.name,target:s.target,occurrences:a})||v(n,s.target.symbolId,s.sourceFile,a,"source-fallback")})}function dt(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 ft(e,t,n,i,r){let o=n.filter(d=>d.relativePath===e);if(o.length>0)return o;if(!r.permissive&&n.length===1)return[...n];let c=i(),u=c.get(t);if(u)for(let d of u){let s=n.filter(a=>w(d,a.relativePath));if(s.length>0)return s}let l=new Set;for(let d of c.values())for(let s of d)l.add(s);for(let d of l){let s=n.filter(a=>w(d,a.relativePath));if(s.length>0&&s.length===n.length)return s}return r.permissive?[...n]:[]}function mt(e,t){return t.kind==="cross-language-dispatch"&&t.target.relativePath===t.sourceFile?!0:t.kind==="identifier"&&De(e,t)}function pt(e){return e.kind==="identifier"&&e.target.relativePath===e.sourceFile?Math.max(0,e.occurrences-1):e.occurrences}function De(e,t){return t.occurrences>1?!1:Z(e,t.sourceFile).some(n=>n.used||n.sourcePath!==t.target.relativePath?!1:n.importedName===t.name||n.localName===t.name)}function yt(e,t,n,i){let r=i.includeSemantic!==!1,o=r&&t.length>=tt&&S(e).length>=nt,c=(s,a)=>{a===s.relativePath||e.isIgnored(a)||i.inactiveBarrelPaths.has(a)||Ce(n,s.symbolId,a,1,"caller-map")};if(o?b("dead.caller-map.per-symbol-non-semantic",()=>{for(let s of t){let a=P(e,s,{semantic:!1,semanticEvidence:N});for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:!1})):b("dead.caller-map.per-symbol",()=>{for(let s of t){let a=P(e,s,{semantic:r,semanticEvidence:N});if(a.length!==0)for(let m of a)c(s,m.file)}},()=>({definitions:t.length,semantic:r})),!o)return;let u=0,l=b("dead.caller-map.semantic-candidates",()=>{let s=t.filter(a=>!C(n,a.symbolId,a.relativePath));return u=s.length,s},()=>({definitions:t.length,semanticCandidates:u}));if(l.length===0)return;let d=ae(e,l);for(let s of l){let a=d.get(s.symbolId);if(a)for(let m of a)c(s,m)}}export{vt as a,Qt as b};
|
|
3
|
+
//# sourceMappingURL=chunk-B2WQKQKP.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as R}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as R}from"./chunk-YGQBJUS6.js";import{a as D}from"./chunk-OQ6TCHBB.js";import{a as g}from"./chunk-AEM24WSF.js";import{a as F}from"./chunk-4FMT4HPC.js";import{a as y}from"./chunk-KMOMNTB4.js";import{e as f}from"./chunk-JJZRS2OP.js";import{j as d}from"./chunk-AYRHVJXW.js";import{M as h}from"./chunk-WAU7HVDI.js";var A=.7,S=.62,C=.45;function J(i,t={}){let{windowCommits:e=100,limit:n=30,scope:a,scanLimit:o}=t,s=y(i,{historyMode:t.historyMode}).fileAddRecords();if(!s)return{available:!1,windowCommits:e,findings:[]};if(n<=0)return{available:!0,windowCommits:e,findings:[]};let r=P(s,e);if(r.size===0)return{available:!0,windowCommits:e,findings:[]};let b=B(i,{limit:n,minSimilarity:t.minSimilarity,scanLimit:o,scope:a,semantic:t.semantic,focusFiles:Number.isFinite(n)?void 0:r}).map(l=>O(l,s,e)).filter(l=>l!==null);b.sort((l,c)=>(l.kind===c.kind?0:l.kind==="echo"?-1:1)||c.similarity-l.similarity||l.echoFile.localeCompare(c.echoFile)||l.echoSymbol.localeCompare(c.echoSymbol)||l.domain.localeCompare(c.domain));let p=b.slice(0,n).map(M);return{available:!0,windowCommits:e,findings:p,rootCauseGroups:N(p)}}function B(i,t){let e=K(t.limit),n=[...k(i,{scope:t.scope,minSimilarity:t.minSimilarity??A,limit:e,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles})],a=h(i,{scope:t.scope});return a.react&&n.push(...E(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...L(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),a.vue&&n.push(...x(i,{scope:t.scope,minSimilarity:t.minSimilarity??S,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles}),...T(i,{scope:t.scope,minSimilarity:t.minSimilarity??C,limit:e,scanLimit:t.scanLimit,focusFiles:t.focusFiles})),n}function k(i,t){return f(i,{scope:t.scope,minSimilarity:t.minSimilarity,limit:t.limit,crossFileOnly:!0,scanLimit:t.scanLimit,semantic:t.semantic,focusFiles:t.focusFiles}).filter(e=>!d(e.symbolA)&&!d(e.symbolB)).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 E(i,t){return u(i,t,{query:g,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).filter(n=>e.acceptPair?.(n)??!0).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:G(...e.evidenceBuckets(n)),sharedCallees:[]}))}function L(i,t){return u(i,t,{query:F,domain:"react-hook",basis:"react-behavior",symbolA:e=>e.componentA,symbolB:e=>e.componentB,acceptPair:w,evidenceBuckets:e=>[["hook",e.sharedHooks],["react-hook",e.sharedReactHooks],["effect",e.sharedEffects],["state",e.sharedState],["request",e.sharedRequests],["handler",e.sharedHandlers],["action",e.sharedHandlerVerbs]]})}var I=new Set(["useCallback","useEffect","useLayoutEffect","useMemo","useMutation","useQueries","useQuery","useQueryClient","useReducer","useRef","useState"]);function w(i){return i.sharedHooks.some(t=>!I.has(t))||i.sharedState.length>0||i.sharedHandlers.length>0||i.sharedHandlerVerbs.length>=2}function x(i,t){return u(i,t,{query:D,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 T(i,t){return u(i,t,{query:R,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 P(i,t){let e=new Set;for(let[n,a]of i)a.commitsAgo<=t&&e.add(n);return e}function O(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 r=(n??0)<=(a??0);return{kind:"twin",domain:i.domain,basis:i.basis,echoSymbol:r?i.symbolA:i.symbolB,echoFile:r?i.fileA:i.fileB,echoAgeCommits:(r?n:a)??0,establishedSymbol:r?i.symbolB:i.symbolA,establishedFile:r?i.fileB:i.fileA,establishedAgeCommits:r?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 M(i){let t=v(i);return{...i,rootCauseKey:t,groupKey:`recent-duplicate:${t}`}}function v(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??v(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:H(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 r of n.sharedEvidence)s.sharedEvidence.add(r)}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 H(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 K(i){return Number.isFinite(i)?i*5:Number.POSITIVE_INFINITY}function G(...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{J as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BBBKPOIT.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as A}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{b as A}from"./chunk-7SGOWD2Y.js";import{a as _}from"./chunk-AGTATREV.js";import{f as R,g as L}from"./chunk-WWCZCH7W.js";import{a as E}from"./chunk-7TJJY2C3.js";import{f as x,g as I}from"./chunk-CAKPEQZB.js";import{b as D}from"./chunk-B75HZHUP.js";import{a as w}from"./chunk-BGBBVSH4.js";import{d as N}from"./chunk-AYRHVJXW.js";import{b as T,c as h}from"./chunk-GAE7WCBK.js";import{y as S}from"./chunk-FC5K7T35.js";import{a as g}from"./chunk-64MNV6AB.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=R(e,n);if(!o)return null;let r=L(o),l=r.trim();if(l==="")return!z(o)||!A(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
|
|
2
|
+
//# sourceMappingURL=chunk-BCMOTIB6.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import{d as D}from"./chunk-EMIIOOTM.js";import{n as R}from"./chunk-DZXFZAZO.js";import{a as M,c as N}from"./chunk-HFBNIIZX.js";import{d as b,f as g,s as S,z as I}from"./chunk-AYRHVJXW.js";import{B as p}from"./chunk-WAU7HVDI.js";function O(o,n,l={}){let{maxDepth:u=5,scope:m}=l,i=M(o,n);if(!i)return[];let c=[],d=new Set([i.symbolId]),a=new Set,r=[i];for(let e=1;e<=u&&r.length!==0;e++){let t=[],f=D(o,r,{limit:500,semanticEvidence:R});for(let y of r)for(let s of w(o,y,m,f.get(y.symbolId)??[])){let h=`${s.file}|${s.shortName}`;if(s.symbolId!==null){if(d.has(s.symbolId))continue;d.add(s.symbolId)}else if(a.has(h))continue;a.add(h),c.push({symbol:s.symbol,shortName:s.shortName,file:s.file,depth:e}),s.symbolId!==null&&s.symbolMatch&&t.push(s.symbolMatch)}r=t}return c.sort((e,t)=>e.depth-t.depth||e.file.localeCompare(t.file)),c}function w(o,n,l,u){let m=u.filter(e=>!o.isIgnored(e.file)).filter(e=>!l||e.file.includes(l)),i=new Set(m.map(e=>e.file)),c=[];for(let e of A(o,n,l)){if(i.has(e))continue;let t=S(o,e),f=t.length>0?I(t,t[0].startLine):null;c.push({symbol:f?.symbol??e,file:e})}let d=[...m,...c],a=[],r=new Set;for(let e of d){let t=N(o,e.symbol);if(!t){let y=`${e.file}|${e.symbol}`;if(r.has(y))continue;r.add(y),a.push({symbolId:null,symbol:e.symbol,shortName:b(e.symbol),file:e.file,symbolMatch:null});continue}if(t.symbolId===n.symbolId||o.isIgnored(t.relativePath)||!_(t))continue;let f=`${t.symbolId}|${t.relativePath}`;r.has(f)||(r.add(f),a.push({symbolId:t.symbolId,symbol:t.symbol,shortName:b(t.symbol),file:t.relativePath,symbolMatch:t}))}return a}function A(o,n,l){let u=l?"AND consumer_d.relative_path LIKE ?":"",m=[n.symbolId,n.documentId];return l&&m.push(`%${l}%`),new Set(o.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
+
FROM mentions m
|
|
3
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
+
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
+
WHERE m.symbol_id = ?
|
|
6
|
+
AND m.role != 1
|
|
7
|
+
AND c.document_id != ?
|
|
8
|
+
${o.pathExclusionsFor("consumer_d")}
|
|
9
|
+
${u}`,...m).map(i=>i.relative_path).filter(i=>!o.isIgnored(i)))}function _(o){if(o.symbol.startsWith("scip-clojure ")||p(o.relativePath)==="clojure")return!0;let n=g(o.symbol);return n==="method"||n==="type"||o.symbol.endsWith("().")}export{O as a};
|
|
10
|
+
//# sourceMappingURL=chunk-BMTBVMA3.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{d}from"./chunk-B3X6KU75.js";import{N as p}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{d}from"./chunk-B3X6KU75.js";import{N as p}from"./chunk-WAU7HVDI.js";function y(t,e={}){let{minTotalLines:i=800,minTemplateLines:n=300,minScriptLines:r=300,minStyleLines:u=500,limit:o=20,scope:a,scanLimit:l,filePattern:m}=e;return p(t).vueProfiles({scope:a,scanLimit:l}).filter(s=>!m||s.file.includes(m)).map(s=>L(s,{minTotalLines:i,minTemplateLines:n,minScriptLines:r,minStyleLines:u})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(t,e){let i=d(t,b(e),"total"),{reasons:n}=i;if(n.length===0)return null;let r=i.dominantPressure,u=i.pressureKinds.includes("total")?[...new Set([...i.pressureKinds,r])]:i.pressureKinds,o=g(t.file),a=x(r,o),l=t.totalLines+t.delegatedComposableLines;return{file:t.file,totalLines:l,sfcLines:t.sfcLines,templateLines:t.templateLines,scriptLines:t.scriptLines,styleLines:t.styleLines,externalScriptLines:t.externalScriptLines,externalScriptPaths:t.externalScriptPaths,customBlockLines:t.customBlockLines,delegatedComposableLines:t.delegatedComposableLines,delegatedComposablePaths:t.delegatedComposablePaths,dominantPressure:r,pressureKinds:u,contextKind:o,recommendationKind:a,recommendation:f(a,o),reasons:n,loc:l}}function b(t){return[{axis:"total",value:e=>e.totalLines+e.delegatedComposableLines,qualifies:(e,i)=>i>=t.minTotalLines,reason:(e,i)=>e.delegatedComposableLines>0?`${i} total line(s) (${e.totalLines} component + ${e.delegatedComposableLines} delegated composable line(s) across ${e.delegatedComposablePaths.length} file(s))`:`${i} total component line(s)`,dominantEligible:!1},{axis:"template",value:e=>e.templateLines,qualifies:(e,i)=>i>=t.minTemplateLines,reason:(e,i)=>`${i} template line(s)`},{axis:"script",value:e=>e.scriptLines-e.externalScriptLines,qualifies:e=>e.scriptLines>=t.minScriptLines,reason:e=>`${e.scriptLines} script line(s)`},{axis:"style",value:e=>e.styleLines,qualifies:(e,i)=>i>=t.minStyleLines,reason:(e,i)=>`${i} style line(s)`},{axis:"external-script",value:e=>e.externalScriptLines,qualifies:(e,i)=>i>=t.minScriptLines},{axis:"custom-block",value:e=>e.customBlockLines,qualifies:()=>!1}]}function g(t){return t.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(n=>w.has(n))||/(?:view|page|route)\.vue$/i.test(t)||/(?:^|\/)(views|pages|routes)\//i.test(t)?"route-page":"component"}function x(t,e){return t==="style"?"style-decomposition":t==="template"?"template-decomposition":t==="external-script"?"external-script-boundary":t==="custom-block"?"custom-block-review":e==="route-page"?"route-page-decomposition":t==="script"?"script-behavior-extraction":"total-size-review"}function f(t,e){switch(t){case"template-decomposition":return e==="route-page"?"Split route template sections into named panels before extracting script behavior.":"Split repeated template sections into named presentational components.";case"script-behavior-extraction":return"Extract independent script behavior into composables, controllers, or feature modules.";case"style-decomposition":return"Review UI/style decomposition; move repeated styling to component or style primitives, not composables.";case"external-script-boundary":return"Review the external script boundary and split controller/composable modules by workflow.";case"custom-block-review":return"Review custom block ownership before splitting template or script code.";case"route-page-decomposition":return"Split route/page orchestration from reusable panels and feature controllers.";case"total-size-review":return"Review the largest block first, then split by the dominant reason to change."}}var w=new Set(["landing","page","pages","route","routes","view","views"]);export{y as a};
|
|
2
|
+
//# sourceMappingURL=chunk-C3KCSAQ4.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-AOSFSYEA.js";import{a as T,e as x,s as R}from"./chunk-AYRHVJXW.js";import{o as w}from"./chunk-GAE7WCBK.js";import{b as l}from"./chunk-WAU7HVDI.js";import{d as g,z as _}from"./chunk-FC5K7T35.js";import{a as S}from"./chunk-64MNV6AB.js";import{existsSync as d,readFileSync as B,readdirSync as $}from"fs";import{join as p}from"path";var H={files:new Set,pathPrefixes:[]},y=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,K=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,A=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],Y=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),q=4,J=g("package-surface",{clearGroups:["whole-project"]});function Q(t){return J.get(t,()=>Z(t.config.projectRoot))}function E(t,e){let r=Q(t);return r.files.has(e)?!0:r.pathPrefixes.some(s=>e.startsWith(s))}function Z(t){let e=new Set,r=[];for(let{manifest:s,packageRoot:i}of z(t))for(let n of tt(s))et(t,i,n,e,r);return e.size===0&&r.length===0?H:{files:e,pathPrefixes:r}}function z(t){let e=[],r=O(t,"");return r&&e.push({manifest:r,packageRoot:""}),D(t,"",e,0),e}function D(t,e,r,s){if(s>=q)return;let i=p(t,e);if(d(i))for(let n of $(i,{withFileTypes:!0})){if(!n.isDirectory()||Y.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name,o=O(t,a);o&&r.push({manifest:o,packageRoot:a}),D(t,a,r,s+1)}}function O(t,e){try{let r=B(p(t,e,"package.json"),"utf-8"),s=JSON.parse(r);return s&&typeof s=="object"?s:null}catch{return null}}function tt(t){let e=[];for(let s of["main","module","types","browser"])typeof t[s]=="string"&&e.push(t[s]);let r=t.bin;if(typeof r=="string")e.push(r);else if(r&&typeof r=="object")for(let s of Object.values(r))typeof s=="string"&&e.push(s);return F(t.exports,e),e}function F(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let r of Object.values(t))F(r,e)}function et(t,e,r,s,i){let n=r.replace(/\\/g,"/").replace(/^\.\//,"");if(n===""||n.startsWith(".."))return;let a=n.indexOf("*");if(a>=0){let c=n.slice(0,a);for(let u of j(c))u!==""&&i.push(f(e,u));return}let o=n.replace(K,"");for(let c of j(o)){c===o&&c===n&&s.add(f(e,n));for(let u of A)rt(t,s,e,c+u)}s.add(f(e,n))}function j(t){let e=[t];return y.test(t)&&(e.push(t.replace(y,"src/")),e.push(t.replace(y,""))),e}function rt(t,e,r,s){let i=f(r,s);if(e.add(i),!s.startsWith("src/")||d(p(t,i)))return;let n=A.find(P=>s.endsWith(P));if(!n)return;let a=s.slice(0,-n.length);st(t,e,r,a,n);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),u=a.slice(o+1);for(let P of N(t,r,c,`${u}${n}`))e.add(P)}function st(t,e,r,s,i){let n=f(r,`${s}/index${i}`);d(p(t,n))&&e.add(n)}function N(t,e,r,s){let i=p(t,e,r);if(!d(i))return[];let n=[];for(let a of $(i,{withFileTypes:!0})){let o=`${r}/${a.name}`;a.isDirectory()?n.push(...N(t,e,o,s)):a.isFile()&&a.name===s&&n.push(f(e,o))}return n}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as h,readFileSync as nt,readdirSync as it}from"fs";import{dirname as at,join as b}from"path";var ot={rootFiles:new Set,sourcePrefixes:[]},ct=new Set([".git",".scipquery","node_modules","target"]),ut=6,ft=g("rust-library-surface",{clearGroups:["whole-project"]});function L(t,e,r){if(!r.endsWith(".rs")||!pt(lt(t),r))return!1;let s=R(t,r).find(i=>i.symbol===e);return s?St(_(t,r)[s.startLine]??""):!1}function lt(t){return ft.get(t,()=>gt(t.config.projectRoot))}function gt(t){let e=new Set,r=new Set;for(let s of dt(t)){let i=b(t,s,"Cargo.toml"),n=nt(i,"utf8"),a=ht(n),o=f(s,"src/lib.rs"),c=a?f(s,a):!bt(n)&&h(b(t,o))?o:null;if(!c)continue;e.add(c);let u=at(c).replaceAll("\\","/");r.add(u==="."?"":`${u}/`)}return e.size===0?ot:{rootFiles:e,sourcePrefixes:[...r].sort()}}function pt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:mt(e)?!1:t.sourcePrefixes.some(r=>e.startsWith(r)):!1}function St(t){return/^\s*pub\s+(?!\()/.test(t)}function dt(t){if(!h(t))return[];let e=[];return C(t,"",e,0),e}function C(t,e,r,s){let i=b(t,e);if(h(i)&&(h(b(i,"Cargo.toml"))&&r.push(e),!(s>=ut)))for(let n of it(i,{withFileTypes:!0})){if(!n.isDirectory()||ct.has(n.name))continue;let a=e?`${e}/${n.name}`:n.name;C(t,a,r,s+1)}}function ht(t){let e=!1;for(let r of t.split(`
|
|
2
2
|
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="lib";continue}if(!e)continue;let n=/^path\s*=\s*["']([^"']+)["']/.exec(s)?.[1];if(n)return n.replaceAll("\\","/").replace(/^\.\//,"")}return null}function bt(t){let e=!1;for(let r of t.split(`
|
|
3
3
|
`)){let s=r.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(s);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(s))return!0}return!1}function mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function m(t){let e=l(t);return Mt(e)?"test":It(e)?"worker":vt(e)?"entry":Vt(e)?"barrel":"source"}function Pt(t){return m(t)==="barrel"}function I(t){return xt.get(t,()=>{let r=S(t,{includeIgnored:!1}).filter(a=>{let o=m(a);return o==="entry"||o==="worker"});if(r.length===0)return new Set;let s=k(t),i=new Set,n=new Set;for(;r.length>0;){let a=r.shift();if(!i.has(a)){i.add(a),m(a)==="barrel"&&n.add(a);for(let o of s.get(a)??[])i.has(o)||r.push(o)}}return n})}var xt=g("live-barrels",{clearGroups:["whole-project"]});function yt(t,e){return I(t).has(l(e))}function ce(t){let e=I(t);return S(t,{includeIgnored:!1}).filter(r=>Pt(r)&&!e.has(r)&&!Et(t,r))}function Et(t,e){let r=l(e),s=T(t).forFile(r,{facts:!0}).facts?.callables;return s&&s.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
4
|
FROM defn_enclosing_ranges der
|
|
5
5
|
JOIN documents d ON d.id = der.document_id
|
|
6
6
|
WHERE d.relative_path = ?
|
|
7
7
|
AND der.end_line - der.start_line >= 2`,r)?.n??0)>0}function ue(t,e){let r=l(e),s=m(e);return s==="entry"||s==="worker"||Nt(r)||yt(t,r)}function fe(t,e,r){let s=l(r);if(E(t,s)||wt(t,e,s)||L(t,e,s)||Ft(e,s))return!0;let i=t.config.entryRoots;return i?!!(i.files?.some(n=>l(n)===s)||i.pathPrefixes?.some(n=>s.startsWith(l(n)))||i.qualifiedVars?.some(n=>Xt(e,n))||i.symbolPatterns?.some(n=>{try{return new RegExp(n).test(e)}catch{return!1}})):!1}var _t=g("package-surface-reachability",{clearGroups:["whole-project"]});function wt(t,e,r){let s=kt(t).get(r);return s===void 0?!1:s===null||s.has(x(e))}function kt(t){return _t.get(t,()=>{let e=new Map,r=[];for(let s of S(t,{includeIgnored:!1}))E(t,s)&&(e.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=e.get(s);if(i!==void 0)for(let n of w(t,s)){if(!n.sourcePath||t.isIgnored(n.sourcePath))continue;let a=Tt(i,n);a!==void 0&&Rt(e,n.sourcePath,a)&&r.push(n.sourcePath)}}return e})}function Tt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return;let r=e.names.filter(s=>t.has(s));return r.length>0?new Set(r):void 0}function Rt(t,e,r){if(!t.has(e))return t.set(e,r),!0;let s=t.get(e);if(s===void 0)return!1;if(s===null||r===null)return s===null?!1:(t.set(e,null),!0);let i=!1;for(let n of r)s.has(n)||(s.add(n),i=!0);return i}var v=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),jt=new Set(["default","generateMetadata","generateStaticParams"]),$t=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),At=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Dt=new Set(["load","actions","entries",...v]),Ot=new Set(["default"]);function Ft(t,e){let r=x(t);return r===""?!1:V(e)?v.has(r):X(e)?jt.has(r):W(e)?$t.has(r):G(e)?At.has(r):U(e)?Dt.has(r):Ct(e)?Ot.has(r):!1}function Nt(t){return V(t)||X(t)||W(t)||Lt(t)||G(t)||U(t)}function V(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function X(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function W(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Lt(t){let e="(?:middleware|proxy|instrumentation)\\.(?:ts|js|mts|mjs)";return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function G(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function U(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function Ct(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function Mt(t){return!!(/\.(?:test|spec)\.[a-z0-9]+$/i.test(t)||/(?:^|\/)(?:_)?test_[^/]+$/i.test(t)||/(?:^|\/)spec_[^/]+$/i.test(t)||/(?:^|\/)[^/]+_test\.[a-z0-9]+$/i.test(t)||/(?:^|\/)[^/]+_tests\.rs$/i.test(t)||/(?:^|\/)tests\.rs$/i.test(t)||/(?:^|\/)[^/]+_spec\.[a-z0-9]+$/i.test(t)||/(?:^|\/)__tests__\//i.test(t)||/(?:^|\/)test\//i.test(t)||/(?:^|\/)tests\//i.test(t)||/(?:^|\/)__fixtures__\//i.test(t)||/(?:^|\/)__mocks__\//i.test(t)||/(?:^|\/)test-support\//i.test(t)||/(?:^|\/)test-utils\//i.test(t)||/(?:^|\/)testing\//i.test(t))}function It(t){return/(?:^|\/)[^/]*worker\.(?:ts|tsx|js|mjs|cjs|rs|py|go)$/.test(t)}function vt(t){let e=t.split("/"),r=e[e.length-1]??t;return r==="cli.ts"||r==="cli.js"||r==="postinstall.ts"||r==="postinstall.js"||r==="main.ts"||r==="main.js"||r==="main.rs"||r==="main.go"||r==="main.py"||r==="build.rs"||r==="lib.rs"||/\bsrc\/bin\/[^/]+\.rs$/.test(t)||/(?:^|\/)examples\/[^/]+\.rs$/.test(t)||/(?:^|\/)tests\/[^/]+\.rs$/.test(t)||/(?:^|\/)benches\/[^/]+\.rs$/.test(t)?!0:r==="index.ts"||r==="index.js"?/(?:^|\/)(?:apps|services)\/[^/]+\/src\/index\.(?:ts|js)$/.test(t)?!0:e.length<=2:!1}function Vt(t){return t==="index.ts"||t==="index.js"||t.endsWith("/index.ts")||t.endsWith("/index.js")||t.endsWith("/mod.rs")||t.endsWith("/__init__.py")}function Xt(t,e){let r=e.lastIndexOf("/");if(r<0)return!1;let s=e.slice(0,r),i=e.slice(r+1);return t.includes(M(s)+"/")&&t.includes(M(i)+".")}function M(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{E as a,m as b,Pt as c,yt as d,ce as e,ue as f,fe as g};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-CAKPEQZB.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{E as s}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{E as s}from"./chunk-WAU7HVDI.js";var p=new Set(["componentDidCatch","componentDidMount","componentDidUpdate","componentWillUnmount","getDerivedStateFromError","getDerivedStateFromProps","getSnapshotBeforeUpdate","render","shouldComponentUpdate","UNSAFE_componentWillMount","UNSAFE_componentWillReceiveProps","UNSAFE_componentWillUpdate"]);function l(i,t){if(!t.parentTypeName||!/\.[cm]?[jt]sx?$/.test(t.relativePath))return!1;let r=s(i,t.relativePath);if(!r)return!1;let n=r.rootNode.descendantsOfType("method_definition").find(a=>a.startPosition.row<=t.startLine&&a.endPosition.row>=t.endLine);if(!n)return!1;if(/\boverride\b/.test(n.text.slice(0,Math.max(0,n.text.indexOf("{")))))return!0;let e=n.parent;for(;e&&e.type!=="class_declaration"&&e.type!=="class";)e=e.parent;if(!e)return!1;let o=e.text.slice(0,Math.max(0,e.text.indexOf("{")));return/\bimplements\b/.test(o)||/\bextends\b/.test(o)?!0:p.has(t.leaf)&&/\bextends\s+(?:React\.)?(?:Component|PureComponent)\b/.test(o)}export{l as a};
|
|
2
|
+
//# sourceMappingURL=chunk-CIYUFF24.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{a as T,c as E,g as L,h as D}from"./chunk-
|
|
1
|
+
import{a as T,c as E,g as L,h as D}from"./chunk-3WLRW5TC.js";import{j as O,o as A}from"./chunk-JJZRS2OP.js";import{d as H}from"./chunk-KMVGRIO2.js";import{a as _}from"./chunk-7TJJY2C3.js";import{d as C,e as F}from"./chunk-AYRHVJXW.js";import{a as w}from"./chunk-GAE7WCBK.js";var J=5;function ae(e,t={}){let{base:a="HEAD",minContainment:o=.7,minCallees:r=3,minSiteCoverage:n=.4,maxHelpers:c=Number.POSITIVE_INFINITY,limit:m=20,scanLimit:g}=t,f=t.semantic!==!1,s=t.diffPlan??E(e,{base:a}),l={available:s.note!==T,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new _(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),j=t.baseContentAt??L(e.config.projectRoot,a,D(s)),h=Z(x,k,$,j);if(h.length===0)return l;let R=h.slice(0,c);h.length>c&&(l.note=`helper scoring capped at ${c} of ${h.length} new symbols`);let q=x.calleeMap(R,{semantic:f}),B=R.map(i=>({def:i,callees:A((q.get(i.symbolId)??[]).map(p=>p.symbol))})),V=O(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M);for(let{def:i,callees:p}of B){let d=C(i.symbol);if(p.size<r){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:`fewer than ${r} meaningful callees \u2014 too small to score`});continue}let P=G(),N=Y(p,P);if(N===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let b=Q(e,i.symbolId);if(b.length===0){l.skipped.push({helperShortName:d,helperFile:i.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}l.helpersChecked+=1;let I=K({candidateIndex:P,changed:k,helperCallees:p,helperFile:i.relativePath,helperSymbol:i.symbol,minContainment:o,minSiteCoverage:n,migratedFiles:b});I.length!==0&&(I.sort((u,S)=>z(S.migrationScope)-z(u.migrationScope)||S.containment-u.containment||S.siteCoverage-u.siteCoverage||u.file.localeCompare(S.file)),l.findings.push({helperSymbol:i.symbol,helperShortName:d,helperFile:i.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:N,migratedFiles:b.sort(),leftovers:I.slice(0,J)}))}return l.findings.sort((i,p)=>(p.leftovers[0]?.containment??0)-(i.leftovers[0]?.containment??0)||i.helperFile.localeCompare(p.helperFile)),l.findings=l.findings.slice(0,m),l}function K(e){let t=[],a=U(e.helperSymbol,e.helperFile,e.migratedFiles),o=new Set;for(let r of e.helperCallees)for(let n of e.candidateIndex.candidateIndexesByCallee.get(r)??[])o.add(n);for(let r of o){let n=e.candidateIndex.corpus[r];if(n.symbol===e.helperSymbol||e.changed.has(n.file)||n.callees.has(e.helperSymbol))continue;let c=H(e.helperCallees,n.callees);if(c<e.minContainment)continue;let m=[...e.helperCallees].filter(s=>n.callees.has(s)),g=n.callees.size===0?0:m.length/n.callees.size;if(g<e.minSiteCoverage||!m.some(s=>(e.candidateIndex.docFreq.get(s)??0)<=e.candidateIndex.ubiquityThreshold))continue;let f=W(a,n.symbol,n.file);t.push({symbol:n.symbol,shortName:C(n.symbol),file:n.file,...f,containment:c,siteCoverage:g,uniqueSiteCalleeCount:Math.max(0,n.callees.size-m.length),sharedCallees:m.map(C).sort()})}return t}function z(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,t,a){let o=new Set([...y(t),...v(F(e))]);for(let r of a)for(let n of y(r))o.add(n);return o}function W(e,t,a){let o=new Set([...y(a),...v(F(t))]);if(e.size===0||o.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let r=[...o].filter(n=>e.has(n)).sort();return r.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${r.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function y(e){return v(e.replace(/\.[^.]+$/,""))}function v(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(t=>t.length>1&&!X.has(t))}function Y(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function Z(e,t,a,o){return e.productionCallableDefinitions({files:[...t],requireFunctionLikeSymbol:!0}).filter(r=>{if(!t.has(r.relativePath))return!1;let n=a.get(r.relativePath)??r.relativePath,c=o(n);return c===null||!new RegExp(`\\b${w(r.leaf)}\\b`).test(c)})}function Q(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
2
|
FROM mentions m
|
|
3
3
|
JOIN chunks c ON m.chunk_id = c.id
|
|
4
4
|
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
5
|
WHERE m.symbol_id = ?
|
|
6
6
|
AND m.role != 1
|
|
7
7
|
${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}export{ae as a};
|
|
8
|
-
//# sourceMappingURL=chunk-
|
|
8
|
+
//# sourceMappingURL=chunk-CKFMZE77.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{c}from"./chunk-B75HZHUP.js";import{a,c as n}from"./chunk-EMIIOOTM.js";import{n as t}from"./chunk-DZXFZAZO.js";import{a as m}from"./chunk-HFBNIIZX.js";import{d as o,h as r}from"./chunk-AYRHVJXW.js";function N(s,y,b={}){let l=m(s,y);if(!l)return null;let i=b.semantic!==!1,f=n(s,l,{semantic:i,semanticEvidence:t}).filter(e=>r(e.symbol)).slice(0,50),p=c(a(s,l,{limit:50,additive:!0,callableOnly:!0,semantic:i,semanticEvidence:t}));return{symbol:l.symbol,shortName:o(l.symbol),callers:f.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file})),callees:p.map(e=>({symbol:e.symbol,shortName:o(e.symbol),file:e.file}))}}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DCDOGW32.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as f}from"./chunk-
|
|
2
|
-
//# sourceMappingURL=chunk-
|
|
1
|
+
import{a as f}from"./chunk-7TJJY2C3.js";import{a as h}from"./chunk-HFBNIIZX.js";import{e as s,g as u}from"./chunk-AYRHVJXW.js";import{f as d}from"./chunk-GAE7WCBK.js";import{B as c}from"./chunk-WAU7HVDI.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
|
|
2
|
+
//# sourceMappingURL=chunk-DFQNE73Y.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a as B}from"./chunk-QZ4JVECJ.js";import{a as R}from"./chunk-35NLDRZC.js";import{a as P}from"./chunk-AOSFSYEA.js";import{a as w}from"./chunk-64MNV6AB.js";var h="architecture:";function D(r,o,t){let i=M(r,o);if(!t||t.boundaries.length===0)return{configured:!1,boundaries:[],edges:[],forbiddenEdges:[],reciprocalPairs:[],cycles:[],coverage:{totalFiles:i.length,mappedFiles:0,unmappedFiles:[],ambiguousFiles:[]},policyCoverage:{declaredRows:0,totalBoundaries:0,missingRows:[],requiresCompletePolicy:!1}};let n=new Map,l=new Map(t.boundaries.map(e=>[e.name,new Set])),m=[],a=[];for(let e of i){let s=t.boundaries.filter(c=>c.paths.some(p=>B(p,e))).map(c=>c.name).sort();if(s.length===0)m.push(e);else if(s.length>1)a.push({file:e,boundaries:s});else{let c=s[0];n.set(e,c),l.get(c).add(e)}}let f=new Map;for(let[e,s]of r){let c=n.get(e);if(c)for(let p of s){let g=n.get(p);if(!g||c===g)continue;let F=y(c,g),d=f.get(F);d||(d={from:c,to:g,fileEdges:[],importers:new Set,importedFiles:new Set},f.set(F,d)),d.fileEdges.push({fromFile:e,toFile:p}),d.importers.add(e),d.importedFiles.add(p)}}let u=[...f.values()].map(e=>j(e,t)).sort(q),S=new Map(u.map(e=>[y(e.from,e.to),e])),b=new Map(t.boundaries.map(e=>[e.name,new Set]));for(let e of u)b.get(e.from).add(e.to);let A=[];for(let e of u){if(e.from>=e.to)continue;let s=S.get(y(e.to,e.from));s&&A.push({boundaries:[e.from,e.to],forward:e,reverse:s})}let{components:v}=R(b),x=v.filter(e=>e.length>1).map(e=>$(e,u,t.requireAcyclic===!0)).sort((e,s)=>s.boundaries.length-e.boundaries.length||e.boundaries.join("/").localeCompare(s.boundaries.join("/"))),C=t.allowedDependencies??{},E=t.boundaries.map(e=>e.name).filter(e=>!Object.hasOwn(C,e)).sort();return{configured:!0,boundaries:t.boundaries.map(e=>({name:e.name,paths:[...e.paths],fileCount:l.get(e.name).size,dependencyPolicyDeclared:Object.hasOwn(C,e.name)})).sort((e,s)=>e.name.localeCompare(s.name)),edges:u,forbiddenEdges:u.filter(e=>e.policyStatus==="forbidden"),reciprocalPairs:A,cycles:x,coverage:{totalFiles:i.length,mappedFiles:n.size,unmappedFiles:m,ambiguousFiles:a},policyCoverage:{declaredRows:t.boundaries.length-E.length,totalBoundaries:t.boundaries.length,missingRows:E,requiresCompletePolicy:t.requireCompletePolicy===!0}}}function k(r,o={}){let t=P(r,o.scope,{scipEdges:"imports-only",sourceEdges:"imports-and-reexports"}),i=w(r,{includeIgnored:!1}).filter(n=>!o.scope||n.includes(o.scope));return D(t,i,r.config.architecture)}function K(r){let o=r.forbiddenEdges.map(t=>`${h}forbidden-edge:${encodeURIComponent(t.from)}:${encodeURIComponent(t.to)}`);if(r.policyCoverage.requiresCompletePolicy)for(let t of r.policyCoverage.missingRows)o.push(`${h}missing-policy-row:${encodeURIComponent(t)}`);for(let t of r.cycles)t.violatesPolicy&&o.push(`${h}cycle:${t.boundaries.map(i=>encodeURIComponent(i)).sort().join("|")}`);return[...new Set(o)].sort()}function T(r){return!!r&&(Object.keys(r.allowedDependencies??{}).length>0||r.requireCompletePolicy===!0||r.requireAcyclic===!0)}function M(r,o){let t=new Set(o);for(let[i,n]of r){t.add(i);for(let l of n)t.add(l)}return[...t].sort()}function j(r,o){let t=[...r.fileEdges].sort((i,n)=>i.fromFile.localeCompare(n.fromFile)||i.toFile.localeCompare(n.toFile));return{from:r.from,to:r.to,policyStatus:I(o,r.from,r.to),fileEdgeCount:t.length,importerCount:r.importers.size,importedFileCount:r.importedFiles.size,examples:t.slice(0,5)}}function I(r,o,t){return!r.allowedDependencies||!Object.hasOwn(r.allowedDependencies,o)?"undeclared":r.allowedDependencies[o].includes(t)?"allowed":"forbidden"}function $(r,o,t){let i=[...r].sort(),n=new Set(i),l=o.filter(a=>n.has(a.from)&&n.has(a.to)),m=Math.min(...l.map(a=>a.fileEdgeCount));return{boundaries:i,internalEdges:l,narrowestEdges:l.filter(a=>a.fileEdgeCount===m),violatesPolicy:t}}function y(r,o){return`${r}\0${o}`}function q(r,o){return r.from.localeCompare(o.from)||r.to.localeCompare(o.to)}export{h as a,D as b,k as c,K as d,T as e};
|
|
2
|
+
//# sourceMappingURL=chunk-DO775SYA.js.map
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{Bc as Y,Cc as Q,Pc as X,Qc as Z,V as y,W as k,Wc as ee,b as B,ca as F,da as H,fa as w,ga as T,ha as b,ic as C,ja as _,jc as J,ka as U,kc as K,la as z,oa as L}from"./chunk-ESNRT7QN.js";import{spawn as me}from"child_process";import{closeSync as ke,existsSync as we,mkdirSync as Ie,openSync as We,readFileSync as ie,rmSync as I,writeFileSync as Re}from"fs";import{dirname as be,resolve as E}from"path";import{fileURLToPath as Ce}from"url";var te=5e3,Ae=2e3,oe=10,Pe=new Set(["bench","config-validate","hook-context","hook-stop","init","reindex","setup","setup-agent","setup-ci","setup-hooks","uninstall","watch","work-audit"]);function ze(e){let t=e.classification;if(t.kind!=="live")return;let{state:r}=t;return r.watcher.state==="idle"&&r.lastError===void 0?r.indexGeneration:void 0}function Ee(e,t=process.env){return t.SCIP_QUERY_SKIP_WATCH_SERVICE!=="1"&&!e.startsWith("__")&&!Pe.has(e)}function Je(e){let t=e.env??process.env;if(t.SCIP_QUERY_SKIP_WATCH_SERVICE==="1")return{kind:"skipped",reason:"environment"};if(!Ee(e.commandName,t))return{kind:"skipped",reason:"excluded-command"};if(e.config.watch?.enabled!==!0)return{kind:"skipped",reason:"disabled"};try{let r=xe({projectRoot:e.projectRoot,cacheDir:e.cacheDir,cliVersion:e.cliVersion,gitContext:e.gitContext,runtime:e.runtime});return{kind:r.disposition,state:r.state}}catch(r){return{kind:"failed",message:r instanceof Error?r.message:String(r)}}}function se(e,t,r){let n=L(E(e));if(r&&L(r.projectRoot)===n)return{projectRoot:n,worktreeKind:"git",worktreeId:r.worktreeId,cliVersion:t};let i=U(n);if(i.kind==="error")throw new Error(`Could not establish Git worktree identity for ${n}: ${i.message}`);return i.kind==="non-git"?{projectRoot:n,worktreeKind:"non-git",cliVersion:t}:{projectRoot:n,worktreeKind:"git",worktreeId:i.identity.worktreeId,cliVersion:t}}function Ke(e){return P(e,se(e.projectRoot,e.cliVersion,e.gitContext))}function P(e,t){let r=e.runtime??O,n=w(e.cacheDir),i=T(n.statePath),s=m(n.lockPath);return{identity:t,classification:_e(i,t,r.now(),r.isProcessAlive),lock:s,lockIsLive:s!==null&&r.isProcessAlive(s.pid),paths:n}}function xe(e){let t=e.runtime??O,r=se(e.projectRoot,e.cliVersion,e.gitContext),n=P(e,r),i=G("ensure",n.classification);if(i.kind==="reuse")return A(n.paths.activityPath,t.now()),{disposition:"reused",state:i.state};if(i.kind==="replace")M(i.state.pid,e,t),W(n.paths,i.state.pid,t);else if(i.kind==="start"){if(n.lockIsLive){let o=re(e,r,t,Math.min(e.startupTimeoutMs??1e3,1e3));if(o)return A(n.paths.activityPath,t.now()),{disposition:"reused",state:o};throw new Error(`scip-query watch is already running for ${E(e.projectRoot)} (pid ${n.lock?.pid}; lock: ${n.paths.lockPath}) without compatible daemon state. Stop the foreground watcher before starting the service.`)}n.classification.kind==="stale"&&W(n.paths,n.classification.state.pid,t)}else throw new Error(`Unexpected ensure action: ${i.kind}`);if(n=P(e,r),i=G("ensure",n.classification),i.kind==="reuse")return A(n.paths.activityPath,t.now()),{disposition:"reused",state:i.state};let s=e.serverPath??Ce(new URL("./watch-server.js",import.meta.url));t.spawnServer(s,r.projectRoot,e.cliVersion,e.watchOverrides??{});let a=re(e,r,t,e.startupTimeoutMs??te);if(!a)throw new Error(`scip-query watch service did not become ready within ${e.startupTimeoutMs??te}ms.`);return A(n.paths.activityPath,t.now()),{disposition:"started",state:a}}function ae(e){let t=e.runtime??O,r=w(e.cacheDir),n=T(r.statePath),i=n?t.isProcessAlive(n.pid)?{kind:"live",state:n}:{kind:"stale",state:n,reason:"dead-process"}:{kind:"stopped"},s=G("stop",i);if(s.kind==="signal-stop")return M(s.state.pid,e,t),W(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};if(s.kind==="clean-stale")return W(r,s.state.pid,t),{disposition:"stopped",pid:s.state.pid};let a=m(r.lockPath);return s.kind==="already-stopped"&&a&&t.isProcessAlive(a.pid)?(M(a.pid,e,t),W(r,a.pid,t),{disposition:"stopped",pid:a.pid}):{disposition:"already-stopped"}}function A(e,t=Date.now()){let r=Te(e);k(e,{version:1,at:new Date(t).toISOString(),...r?.refreshRequestedAtMs===void 0?{}:{refreshRequestedAt:new Date(r.refreshRequestedAtMs).toISOString(),...r.refreshDetail?{refreshDetail:r.refreshDetail}:{}}})}function Ye(e,t,r=Date.now()){k(e,{version:1,at:new Date(r).toISOString(),refreshRequestedAt:new Date(r).toISOString(),refreshDetail:t})}function Te(e){try{let t=JSON.parse(ie(e,"utf8"));return t.version!==1||!b(t.at)||t.refreshRequestedAt!==void 0&&!b(t.refreshRequestedAt)||t.refreshDetail!==void 0&&typeof t.refreshDetail!="string"?null:{atMs:Date.parse(t.at),...t.refreshRequestedAt===void 0?{}:{refreshRequestedAtMs:Date.parse(t.refreshRequestedAt)},...t.refreshDetail===void 0?{}:{refreshDetail:t.refreshDetail}}}catch{return null}}function Qe(e,t,r={}){let n=r.pid??process.pid,i=r.isProcessAlive??y,s=()=>{},a=m(e);if(a&&i(a.pid))return{acquired:!1,lockPath:e,message:ne(e,t,a),release:s};a&&I(e,{force:!0}),Ie(be(e),{recursive:!0});let o;try{o=We(e,"wx")}catch(d){if(Le(d)==="EEXIST")return{acquired:!1,lockPath:e,message:ne(e,t,m(e)),release:s};throw d}let l={version:1,pid:n,projectRoot:E(t),startedAt:(r.now??(()=>new Date))().toISOString()};Re(o,`${JSON.stringify(l)}
|
|
3
|
+
`);let c=!1;return{acquired:!0,lockPath:e,message:"",release:()=>{if(c)return;c=!0,ke(o);let d=m(e);d?.pid===l.pid&&d.startedAt===l.startedAt&&I(e,{force:!0})}}}function m(e){try{let t=JSON.parse(ie(e,"utf-8"));return t.version!==1||typeof t.pid!="number"||!Number.isInteger(t.pid)||t.pid<=0||typeof t.projectRoot!="string"||!b(t.startedAt)?null:t}catch{return null}}function _e(e,t,r,n){if(!e)return{kind:"stopped"};if(e.protocolVersion!==F)return{kind:"incompatible",state:e,reason:"protocol"};if(e.projectRoot!==t.projectRoot)return{kind:"incompatible",state:e,reason:"project"};let i=t.worktreeKind==="git"?t.worktreeId:void 0;if(e.worktreeId!==i)return{kind:"incompatible",state:e,reason:"worktree"};if(e.cliVersion!==t.cliVersion)return{kind:"incompatible",state:e,reason:"cli-version"};if(!n(e.pid))return{kind:"stale",state:e,reason:"dead-process"};let s=Date.parse(e.heartbeatAt);return r-s>H?{kind:"stale",state:e,reason:"old-heartbeat"}:{kind:"live",state:e}}function G(e,t){switch(e){case"status":return{kind:"report",classification:t};case"ensure":switch(t.kind){case"stopped":return{kind:"start"};case"stale":return t.reason==="old-heartbeat"?{kind:"replace",state:t.state}:{kind:"start"};case"live":return{kind:"reuse",state:t.state};case"incompatible":return{kind:"replace",state:t.state};default:return D(t)}case"stop":switch(t.kind){case"stopped":return{kind:"already-stopped"};case"stale":return t.reason==="old-heartbeat"?{kind:"signal-stop",state:t.state}:{kind:"clean-stale",state:t.state};case"live":case"incompatible":return{kind:"signal-stop",state:t.state};default:return D(t)}default:return D(e)}}function re(e,t,r,n){let i=r.now()+n;for(;r.now()<=i;){let s=P(e,t).classification;if(s.kind==="live")return s.state;r.sleep(oe)}return null}function M(e,t,r){if(!r.isProcessAlive(e))return;r.signalProcess(e);let n=t.stopTimeoutMs??Ae,i=r.now()+n;for(;r.now()<=i;){if(!r.isProcessAlive(e))return;r.sleep(oe)}throw new Error(`scip-query watch service pid ${e} did not stop within ${n}ms.`)}function W(e,t,r){I(e.statePath,{force:!0}),I(e.activityPath,{force:!0}),m(e.lockPath)?.pid===t&&!r.isProcessAlive(t)&&I(e.lockPath,{force:!0})}function ne(e,t,r){return`error: scip-query watch is already running for ${E(t)}${r?` (pid ${r.pid}, started ${r.startedAt}; lock: ${e})`:` (lock: ${e})`}. Stop that watcher before starting another.`}function Le(e){return typeof e=="object"&&e&&"code"in e?e.code:void 0}var O={now:Date.now,isProcessAlive:y,spawnServer(e,t,r,n){if(!we(e))throw new Error(`Watch service helper was not found at ${e}. Run npm run build first.`);me(process.execPath,[e,t,r,JSON.stringify(n)],{detached:!0,stdio:"ignore",env:{...process.env,SCIP_QUERY_SKIP_WATCH_SERVICE:"1"}}).unref()},signalProcess(e){process.kill(e,"SIGTERM")},sleep(e){let t=new Int32Array(new SharedArrayBuffer(4));Atomics.wait(t,0,0,e)}};function D(e){throw new Error(`Unhandled watch service value: ${JSON.stringify(e)}`)}import{existsSync as ue,lstatSync as x,readFileSync as N,readdirSync as pe,realpathSync as ce,rmSync as R,statSync as he}from"fs";import{join as h,resolve as g,sep as de}from"path";var De=3600*1e3,Ge=2*1024*1024*1024,Me=300*1e3;function Oe(e){let t=e.leases.filter(o=>o.managed&&!o.live&&!o.busy),r=fe(e.leases,e.locks),n={};for(let o of e.generations)r.has(o.generationId)||(n[o.generationId]=o.unreferencedAt??e.nowMs);let i=e.generations.filter(o=>!r.has(o.generationId)).sort((o,l)=>n[o.generationId]-n[l.generationId]||o.generationId.localeCompare(l.generationId)),s=new Set;for(let o of i)e.nowMs-n[o.generationId]>=e.policy.generationTtlMs&&s.add(o.generationId);let a=e.generations.filter(o=>!s.has(o.generationId)).reduce((o,l)=>o+l.size,0);for(let o of i){if(a<=e.policy.budgetBytes)break;s.has(o.generationId)||(s.add(o.generationId),a-=o.size)}for(let o of s)delete n[o];return{deleteWorktrees:t,deleteGenerations:e.generations.filter(o=>s.has(o.generationId)),deleteLocks:e.locks.filter(o=>!o.live),deleteTemporaries:e.temporaries.filter(o=>!o.live),protectedGenerationIds:[...r].sort(),unreferencedSince:n}}function fe(e,t){let r=new Set(e.filter(n=>n.managed&&(n.live||n.busy)).flatMap(n=>[n.lease.baseGenerationId,n.lease.activeGenerationId]).filter(n=>n!==void 0));for(let n of t)n.live&&r.add(n.generationId);return r}function lt(e,t,r={}){if(!K())return{kind:"disabled"};let n=_(e);if(!n)return{kind:"unavailable"};let i=h(C(),"repositories",n.repositoryId);if(!ue(i))return{kind:"unavailable"};let s=(r.now??Date.now)(),a=h(i,"gc-state.json"),o=ge(a);if(!r.force&&o&&s-Date.parse(o.lastSweepAt)<Me)return{kind:"throttled",sweptAt:o.lastSweepAt};let l=Y(i,{now:()=>s});if(!l)return{kind:"busy"};try{let c=Se(e,i,n.repositoryId,o?.unreferencedSince??{}),d=Oe({nowMs:s,...c,policy:{generationTtlMs:r.policy?.generationTtlMs??De,budgetBytes:r.policy?.budgetBytes??Ge}}),u=0,f=0;for(let p of d.deleteWorktrees){if(!ve(p.lease))continue;let q=Q(h(p.lease.localCacheDir,"cache-lifecycle.lock"));if(q)try{if(V(p.lease,!0))continue;try{ae({projectRoot:p.lease.projectRoot,cacheDir:p.lease.localCacheDir,cliVersion:t})}catch{continue}if(V(p.lease,!0))continue;R(p.lease.localCacheDir,{recursive:!0,force:!0}),R(p.leasePath,{force:!0}),f+=1}finally{q.release()}}for(let p of d.deleteLocks)R(p.path,{force:!0});for(let p of d.deleteTemporaries)R(p.path,{recursive:!0,force:!0});for(let p of d.deleteGenerations)R(p.path,{recursive:!0,force:!0}),u+=p.size;B(h(i,"evidence.db"));let v={kind:"swept",sweptAt:new Date(s).toISOString(),deletedWorktrees:f,deletedGenerations:d.deleteGenerations.length,deletedBytes:u,protectedGenerations:d.protectedGenerationIds.length},S={version:1,lastSweepAt:v.sweptAt,unreferencedSince:d.unreferencedSince,lastResult:v};return k(a,S,{spacing:2,trailingNewline:!0}),v}catch(c){return{kind:"failed",error:c instanceof Error?c.message:String(c)}}finally{l.release()}}function ut(e,t,r){let n=X(e,r.dbPath,t);if(n)return{state:"bypassed",reason:n,localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let i=_(e);if(!i)return{state:"unavailable",reason:"Git worktree identity is unavailable",localCacheDir:r.cacheDir,generations:0,generationBytes:0,protectedGenerations:0,unreferencedGenerations:0,unreferencedBytes:0,temporaryGenerations:0,sharedEvidence:{exists:!1,bytes:0}};let s=h(C(),"repositories",i.repositoryId),a=ye(h(s,"worktrees",`${i.worktreeId}.json`)),o=ge(h(s,"gc-state.json")),l=Se(e,s,i.repositoryId,o?.unreferencedSince??{}),c=fe(l.leases,l.locks),d=l.generations.filter(S=>!c.has(S.generationId)),u=l.generations.reduce((S,p)=>S+p.size,0),f=Z(e,t),v=0;return f&&(v=je(f)),{state:"managed",repositoryId:i.repositoryId,worktreeId:i.worktreeId,localCacheDir:r.cacheDir,...a?{baseGenerationId:a.baseGenerationId,activeGenerationId:a.activeGenerationId,lastAction:a.lastAction,reason:a.lastReason,lastSeenAt:a.lastSeenAt}:{},generations:l.generations.length,generationBytes:u,protectedGenerations:l.generations.filter(S=>c.has(S.generationId)).length,unreferencedGenerations:d.length,unreferencedBytes:d.reduce((S,p)=>S+p.size,0),temporaryGenerations:l.temporaries.length,sharedEvidence:{path:f,exists:v>0,bytes:v},cleanup:o?.lastResult}}function je(e){return[e,`${e}-wal`,`${e}-shm`].reduce((t,r)=>{try{return t+he(r).size}catch{return t}},0)}function Se(e,t,r,n){let i=new Set(z(e).map(c=>g(c.path))),s=[];for(let c of j(h(t,"worktrees"))){if(!c.endsWith(".json"))continue;let d=h(t,"worktrees",c),u=ye(d);if(!u)continue;let f=g(u.projectRoot);s.push({leasePath:d,lease:u,managed:u.repositoryId===r&&ve(u),live:i.has(f)||ue(f),busy:V(u)})}let a=[];for(let c of j(h(t,"locks"))){let d=/^([a-f0-9]{64})\.lock$/.exec(c);if(!d)continue;let u=h(t,"locks",c),f=$(u),v=f!==void 0&&y(f),S=d[1];a.push({generationId:S,path:u,live:v})}let o=[],l=[];for(let c of j(h(t,"generations"))){let d=/^\.tmp-(\d+)-/.exec(c);if(d){let v=h(t,"generations",c),S=Number(d[1]);try{l.push({path:v,size:le(v),live:Number.isSafeInteger(S)&&y(S)})}catch{}continue}if(!/^[a-f0-9]{64}$/.test(c))continue;let u=h(t,"generations",c),f;try{f=x(u)}catch{continue}!f.isDirectory()||f.isSymbolicLink()||o.push({generationId:c,path:u,size:le(u),...n[c]===void 0?{}:{unreferencedAt:n[c]}})}return{leases:s,generations:o,locks:a,temporaries:l}}function ve(e){if(e.ownershipChecksum!==ee(e)||g(e.localCacheDir)!==g(J(e.projectRoot)))return!1;let t=g(C()),r=g(h(t,"projects")),n=g(e.localCacheDir);if(!n.startsWith(`${r}${de}`))return!1;try{let i=x(t),s=x(r),a=x(n);if(!i.isDirectory()||i.isSymbolicLink()||!s.isDirectory()||s.isSymbolicLink()||!a.isDirectory()||a.isSymbolicLink())return!1;let o=ce(r);return ce(n).startsWith(`${o}${de}`)}catch{return!1}}function V(e,t=!1){for(let n of t?["index.lock"]:["index.lock","cache-lifecycle.lock"]){let i=$(h(e.localCacheDir,n));if(i!==void 0&&y(i))return!0}let r=$(w(e.localCacheDir).lockPath);return r!==void 0&&y(r)}function ye(e){try{let t=JSON.parse(N(e,"utf8"));return t.version!==1||typeof t.repositoryId!="string"||typeof t.worktreeId!="string"||typeof t.projectRoot!="string"||t.treeOid!==void 0&&typeof t.treeOid!="string"||typeof t.localCacheDir!="string"||t.baseGenerationId!==void 0&&typeof t.baseGenerationId!="string"||t.activeGenerationId!==void 0&&typeof t.activeGenerationId!="string"||typeof t.ownershipChecksum!="string"||!/^[a-f0-9]{64}$/.test(t.ownershipChecksum)||typeof t.lastAction!="string"||t.lastReason!==void 0&&typeof t.lastReason!="string"||typeof t.lastSeenAt!="string"?null:t}catch{return null}}function $(e){try{let t=JSON.parse(N(e,"utf8"));return typeof t.pid=="number"&&Number.isSafeInteger(t.pid)&&t.pid>0?t.pid:void 0}catch{return}}function ge(e){try{let t=JSON.parse(N(e,"utf8"));return t.version!==1||typeof t.lastSweepAt!="string"||!Number.isFinite(Date.parse(t.lastSweepAt))||!t.unreferencedSince||typeof t.unreferencedSince!="object"||!t.lastResult?null:t}catch{return null}}function j(e){try{return pe(e)}catch{return[]}}function le(e){let t=0,r=[e];for(;r.length>0;){let n=r.pop();for(let i of pe(n,{withFileTypes:!0})){let s=h(n,i.name);i.isDirectory()?r.push(s):i.isFile()&&(t+=he(s).size)}}return t}export{ze as a,Ee as b,Je as c,Ke as d,xe as e,ae as f,Ye as g,Qe as h,lt as i,ut as j};
|
|
4
|
+
//# sourceMappingURL=chunk-DRH3AD7W.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import{d as re,e as oe,f as T,g as ce,i as le,l as fe,m as me}from"./chunk-US44MEVU.js";import{d as R}from"./chunk-HFBNIIZX.js";import{l as se,x as M,z as ae}from"./chunk-E3KWOHH7.js";import{a as te}from"./chunk-AOSFSYEA.js";import{e as S,s as ne,z as ie}from"./chunk-AYRHVJXW.js";import{a as K,b as Q,f as L,p as v}from"./chunk-GAE7WCBK.js";import{B as ee,L as A,a as X,c as I}from"./chunk-WAU7HVDI.js";import{c as d,d as W,g as w,h as E,j as V,l as F,q,s as y,y as p}from"./chunk-FC5K7T35.js";function D(e,i,n,t={}){if(!n)return[];let r=p(e,i);return r?r.indexOf(n)===-1?[]:(O(e,i).get(n)??[]).filter(o=>!Le(o,t)):[]}function Le(e,i){return typeof i.excludeStartLine=="number"&&typeof i.excludeEndLine=="number"&&e>=i.excludeStartLine&&e<=i.excludeEndLine}var ve=d("file-identifiers",{clearGroups:["whole-project","source-file"]});function ue(e,i){let n=L(e,i);return n?n.fileIdentifiers:ve.get(e,i,()=>new Set(O(e,i).keys()))}var Re=d("file-ident-lines",{clearGroups:["whole-project","source-file"]});function O(e,i){let n=L(e,i);return n?n.identifierLineMap:Re.get(e,i,()=>De(e,i))}var Me=d("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function qe(e,i){let n=L(e,i);return n?n.identifiersByLine:Me.get(e,i,()=>{let t=O(e,i),r=0;for(let o of t.values()){let c=o[o.length-1];c!==void 0&&c>r&&(r=c)}let s=new Array(r+1);for(let o=0;o<=r;o+=1)s[o]=new Set;for(let[o,c]of t)for(let a of c)s[a].add(o);return s})}function De(e,i){let n=new Map,t=(c,a)=>{let l=n.get(c);if(!l){n.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},r=p(e,i);if(!r)return n;let s=Q(r).split(/\r?\n/),o=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<s.length;c+=1){let a=s[c]??"";for(let l of a.matchAll(o))l[1]&&t(l[1],c)}return n}function rt(e,i){let n=pe(e);return n?i.filter(t=>pe(t.file)===n):i}function ot(e,i,n,t){let r=n.find(s=>s.file===i);if(r)return r;if(t){let s=new Set(v(e,i).map(o=>o.sourcePath).filter(o=>!!o));for(let o of n)for(let c of s)if(I(c,o.file))return o;return null}return n.length===1?n[0]:null}function pe(e){let i=ee(e);return i?i==="typescript"||i==="tsx"||i==="javascript"?"javascript-family":i:null}var _e=W("global-leaf-index",{clearGroups:["whole-project"]});function j(e){return _e.get(e,()=>{let i=e.all(`SELECT gs.id, gs.symbol,
|
|
2
|
+
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
|
+
FROM global_symbols gs
|
|
4
|
+
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
5
|
+
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
6
|
+
LEFT JOIN (
|
|
7
|
+
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
8
|
+
FROM mentions m
|
|
9
|
+
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
+
JOIN documents d ON c.document_id = d.id
|
|
11
|
+
WHERE m.role = 1
|
|
12
|
+
GROUP BY m.symbol_id
|
|
13
|
+
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
|
+
WHERE 1 = 1
|
|
15
|
+
${e.symbolNoiseFor("gs")}`),n=new Map;for(let t of i){if(!t.relative_path||e.isIgnored(t.relative_path))continue;let r=S(t.symbol);if(!r)continue;let s=n.get(r);s||(s=[],n.set(r,s)),s.some(o=>o.symbolId===t.id)||s.push({symbol:t.symbol,symbolId:t.id,file:t.relative_path})}return n})}var xe=d("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function ge(e,i){let n=X(i);return xe.get(e,n,()=>Pe(e,n))}function Pe(e,i){let n=new Map;for(let t of v(e,i)){if(!t.sourcePath)continue;let r=t.localName??t.importedName;if(r&&de(n,r,t.sourcePath),t.kind==="namespace")for(let s of t.usedMembers)de(n,s,t.sourcePath)}return n}function de(e,i,n){let t=e.get(i);t||(t=new Set,e.set(i,t)),t.add(n)}var he=/[A-Za-z_$][A-Za-z0-9_$]*/g,ye=/^[A-Za-z_$][A-Za-z0-9_$]*$/,Ne=512;function H(e){let i=[],n=!1;for(let t of e)t&&(n=!0,ye.test(t)||i.push(t));return{candidateNames:e,hasUsableCandidate:n,nonIdentifierNames:i}}function Se(e,i){let n=ke(i)?i:H(i);if(n.candidateNames.size===0||!n.hasUsableCandidate)return!0;if(n.candidateNames.size<=Ne){for(let r of n.candidateNames)if(r){if(ye.test(r)){if(we(r).test(e))return!0;continue}if(e.includes(r))return!0}return!1}he.lastIndex=0;let t;for(;(t=he.exec(e))!==null;)if(n.candidateNames.has(t[0]))return!0;for(let r of n.nonIdentifierNames)if(e.includes(r))return!0;return!1}function ke(e){return"candidateNames"in e}function we(e){return new RegExp(`(?<![A-Za-z_$0-9])${K(e)}(?![A-Za-z_$0-9])`)}function z(e,i,n){let t=j(e).get(n);if(!t||t.length===0)return[];if(t.length===1)return[C(t[0])];let r=t.filter(a=>a.file===i);if(r.length>0)return r.map(C);let s=ge(e,i),o=s.get(n);if(o)for(let a of o){let l=t.filter(m=>I(a,m.file));if(l.length>0)return l.map(C)}let c=new Set;for(let a of s.values())for(let l of a)c.add(l);for(let a of c){let l=t.filter(m=>I(a,m.file));if(l.length>0&&l.length===t.length)return l.map(C)}return[]}function Lt(e,i,n){let t=z(e,i,n);if(t.length>0)return t;let r=j(e).get(n);return!r||r.length===0?[]:r.map(C)}function be(e,i,n={}){let t=R(e,i);if(!t)return[];let r=S(t.symbol);if(!r)return[];if(n.semantic!==!1&&n.semanticEvidence){let o=n.semanticEvidence.references(e,{...t,leaf:r,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(o.length>0){let c=new Map;for(let a of o){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return _(e,c)}}let s=new Map;for(let o of A(e)){let c=p(e,o);if(!c||c.indexOf(r)===-1||o!==t.relativePath&&!z(e,o,r).some(m=>m.symbolId===t.symbolId))continue;let a=D(e,o,r,o===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{});a.length>0&&s.set(o,a)}return _(e,s)}function vt(e,i,n={}){let t=new Map;for(let a of i){if(!a.leaf)continue;let l=t.get(a.leaf)??[];l.push(a),t.set(a.leaf,l)}if(t.size===0)return new Map;let r=new Set(i.map(a=>a.symbolId)),s=new Set(t.keys()),o=H(s),c=new Map;for(let a of A(e)){if(n.skipPath?.(a)||!Se(p(e,a),o))continue;let l=ue(e,a);if(l.size!==0){for(let m of l)if(t.has(m))for(let g of z(e,a,m)){if(!r.has(g.symbolId)||a===g.relativePath)continue;let h=c.get(g.symbolId);h||(h=new Set,c.set(g.symbolId,h)),h.add(a)}}}return c}function C(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function _(e,i){let n=[],t=new Set;for(let[r,s]of i){let o=ne(e,r);for(let c of s){let a=ie(o,c),l=`${r}|${c}|${a?.symbol??""}`;t.has(l)||(t.add(l),n.push({file:r,line:c,enclosingSymbol:a?.symbol??null}))}}return n}function Fe(e,i){let n=ze(e,i);return n?_(e,Te(e,n.match,n.identifier)):[]}function Nt(e,i,n={}){return Ae(e,i,n).map(t=>({file:t.file,line:t.line,enclosingSymbol:t.enclosingSymbol}))}function Ae(e,i,n={}){let t=be(e,i,{semantic:n.semantic,semanticEvidence:n.semanticEvidence}),r=t.length>0?Ie(t,"source-attribution"):Ie(Fe(e,i),"scip-reference-chunk");return n.includeIgnored===!0?r:r.filter(s=>!e.isIgnored(s.file))}function Ie(e,i){return e.map(n=>({...n,provenance:i}))}function Te(e,i,n){let t=new Map;for(let[r,s]of Oe(e,i.symbolId))t.set(r,je(e,r,s,i,n));return t}function Oe(e,i){let n=new Map;for(let t of re(e,[i])){if(e.isIgnored(t.relative_path))continue;let r=n.get(t.relative_path);r||(r=[],n.set(t.relative_path,r)),r.push({start_line:t.chunk_start,end_line:t.chunk_end})}return n}function je(e,i,n,t,r){let s=i===t.relativePath?{excludeStartLine:t.startLine,excludeEndLine:t.endLine}:{},o=r?D(e,i,r,s):[];return n.flatMap(c=>He(o,c))}function He(e,i){let n=e.filter(t=>t>=i.start_line&&t<=i.end_line);return n.length>0?n:[i.start_line]}function ze(e,i){let n=R(e,i);return n?{match:n,identifier:S(n.symbol)||null}:null}var $t={references:le,referenceMap:fe,callerMap:(e,i)=>T(e).callerMap(i),calleeMap:Be};function Be(e,i){let n=q(),t=new Map,r=ce(e,i),s=[],o=[],c=0,a=0,l=0,m=0,g=0,h=0,B=0;for(let{definition:f,callees:u}of r.hits)g+=1,u.length>0&&(h+=1,B+=u.length,t.set(f.symbolId,u));let b=Ge(e,r.hits);if(b.entries.length>0&&y("semantic.callees.prefetch-cache-write",()=>F(e,b.entries),()=>({entries:b.entries.length,sourceMissing:b.sourceMissing,skippedUnsupportedLanguage:b.skippedUnsupportedLanguage})),y("semantic.callees.cache-scan",()=>{for(let[f,u]of oe(r.misses)){if(!M(f)){n&&(c+=u.length);continue}let J=p(e,f);if(!J){n&&(a+=u.length),o.push(...u);continue}let Z=E(e,f,J),P=Ce(e,f);if(!P){o.push(...u);continue}let Ee=V(e,f,Z,P);for(let N of u){let Y=Ee.get(N.symbol)??null;if(Y!==null){let k=Ue(Y);if(k){n&&(l+=1),k.length>0&&t.set(N.symbolId,k);continue}n&&(m+=1)}s.push({def:N,contentHash:Z,depsDigest:P})}}},()=>({definitions:i.length,skippedUnsupportedLanguage:c,sourceMissing:a,cacheHits:l,parseFailures:m,misses:s.length,unkeyed:o.length,inMemoryHits:g,inMemoryRows:h,inMemoryCalleeCount:B,resultRows:t.size})),s.length===0&&o.length===0)return t;let G=[...o,...s.map(f=>f.def)],$=0,U=y("semantic.callees.compute-misses",()=>{let f=me(e,G);return $=f.size,f},()=>({definitions:G.length,misses:s.length,unkeyed:o.length,rows:$}));for(let[f,u]of U)t.set(f,u);let x=s.filter(f=>T(e).capability("semantic-callees",f.def.relativePath).available).map(f=>({relativePath:f.def.relativePath,symbol:f.def.symbol,contentHash:f.contentHash,depsDigest:f.depsDigest,payload:JSON.stringify(U.get(f.def.symbolId)??[])}));return x.length>0?y("semantic.callees.cache-write",()=>F(e,x),()=>({entries:x.length})):y("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:s.length})),t}function Ge(e,i){let n=[],t=new Map,r=0,s=0;for(let{definition:o,callees:c}of i){if(!M(o.relativePath)){s+=1;continue}if(!t.has(o.relativePath)){let l=p(e,o.relativePath),m=l?Ce(e,o.relativePath):null;t.set(o.relativePath,l&&m?{contentHash:E(e,o.relativePath,l),depsDigest:m}:null)}let a=t.get(o.relativePath);if(!a){r+=1;continue}n.push({relativePath:o.relativePath,symbol:o.symbol,contentHash:a.contentHash,depsDigest:a.depsDigest,payload:JSON.stringify(c)})}return{entries:n,sourceMissing:r,skippedUnsupportedLanguage:s}}var $e="typescript-callees-v1";function Ce(e,i){let n=M(i);if(n==="typescript")return ae(e,i,$e)?.key??null;let t=Ze(e,i);return n==="rust"?w(JSON.stringify({kind:"semantic-callees",language:n,engine:se(e.config.projectRoot),positionMapping:"nearby-leaf-v1",depsDigest:t})):t}function Ue(e){try{return JSON.parse(e)}catch{return null}}var Je=d("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function Ze(e,i){return Je.get(e,i,()=>{let t=[...te(e).get(i)??[]].sort().map(r=>`${r}:${E(e,r,p(e,r))}`);return w(t.join("|"))})}export{O as a,qe as b,rt as c,ot as d,j as e,H as f,Se as g,ge as h,z as i,Lt as j,vt as k,Fe as l,Nt as m,$t as n};
|
|
16
|
+
//# sourceMappingURL=chunk-DZXFZAZO.js.map
|