scip-query 0.10.12 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +45 -0
- package/{vendor/scip/LICENSE.scip → LICENSE} +1 -0
- package/README.md +141 -49
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2VSDXOG5.js +2 -0
- package/dist/chunk-343O6EVV.js +2 -0
- package/dist/{chunk-RUV5IY25.js → chunk-3KDUITBE.js} +2 -2
- package/dist/chunk-3T2FNHIU.js +2 -0
- package/dist/{chunk-EOLGSSDR.js → chunk-3V6JQQM5.js} +2 -2
- package/dist/chunk-5AAAEZ2Z.js +2 -0
- package/dist/chunk-6Q6OFLFQ.js +8 -0
- package/dist/chunk-6XA4LDHY.js +2 -0
- package/dist/chunk-75X52JTA.js +2 -0
- package/dist/{chunk-LEHVP4DY.js → chunk-7HB3CZFD.js} +2 -2
- package/dist/chunk-7JZRFDCU.js +2 -0
- package/dist/{chunk-SQNHOOJ5.js → chunk-7XL7J7PT.js} +2 -2
- package/dist/{chunk-GKB4JJDU.js → chunk-ALHNAPS2.js} +2 -2
- package/dist/{chunk-TBCHRDAC.js → chunk-BDRBPG7Y.js} +2 -2
- package/dist/chunk-BN5SXXQS.js +40 -0
- package/dist/chunk-C4ICAIJ4.js +3 -0
- package/dist/{chunk-2GLNBCHB.js → chunk-CMHYBXJB.js} +2 -2
- package/dist/{chunk-S2MRVIJ5.js → chunk-DRPAQAFM.js} +6 -6
- package/dist/chunk-FERAXG6Y.js +72 -0
- package/dist/chunk-FLJJLSGB.js +2 -0
- package/dist/chunk-FXG3PHVW.js +9 -0
- package/dist/{chunk-JS6B76AQ.js → chunk-GCN2P4EJ.js} +2 -2
- package/dist/chunk-GHXRVCIY.js +21 -0
- package/dist/chunk-GNG622H3.js +3 -0
- package/dist/chunk-H4LUPLEJ.js +2 -0
- package/dist/{chunk-XUCZ3RQ5.js → chunk-H56MGERE.js} +4 -4
- package/dist/chunk-H7NSJ7L2.js +5 -0
- package/dist/chunk-HINMXZ6J.js +2 -0
- package/dist/chunk-HXXMPYEF.js +2 -0
- package/dist/{chunk-A4UTLKHU.js → chunk-HZKMEXA3.js} +2 -2
- package/dist/{chunk-T3AEVJBG.js → chunk-IFSX6YVU.js} +2 -2
- package/dist/chunk-ISLWJ4PY.js +10 -0
- package/dist/chunk-J5WVNZ6O.js +2 -0
- package/dist/chunk-K2HYR5A7.js +3 -0
- package/dist/{chunk-UVPY3RUZ.js → chunk-K6UI6EBZ.js} +2 -2
- package/dist/{chunk-MNCQPMCH.js → chunk-KJCDEDQW.js} +2 -2
- package/dist/{chunk-KZ4MG5NY.js → chunk-KKMOB3OJ.js} +2 -2
- package/dist/{chunk-ELC77ZDE.js → chunk-KMVGRIO2.js} +2 -2
- package/dist/chunk-LWOOTRHC.js +2 -0
- package/dist/{chunk-DQ6433ZG.js → chunk-LZNLRE4X.js} +17 -8
- package/dist/{chunk-7C6JBBE4.js → chunk-M2YXL62V.js} +2 -2
- package/dist/chunk-MNEJYEHW.js +3 -0
- package/dist/chunk-MTDBHTSF.js +2 -0
- package/dist/{chunk-VB2EZZPA.js → chunk-N2Z3CU7X.js} +2 -2
- package/dist/{chunk-2UVCH7CQ.js → chunk-N7PNFLGY.js} +2 -2
- package/dist/chunk-NAH5EAZS.js +6 -0
- package/dist/{chunk-XHMVZFA6.js → chunk-NBXK32I6.js} +2 -2
- package/dist/chunk-NJJ7AS4F.js +2 -0
- package/dist/{chunk-ANUEY5WV.js → chunk-NLMRJ7SI.js} +2 -2
- package/dist/chunk-ODVITBYU.js +26 -0
- package/dist/chunk-ORBRX2QJ.js +2 -0
- package/dist/{chunk-NTSR6SRP.js → chunk-P36UR5II.js} +2 -2
- package/dist/chunk-PYZZBIEU.js +3 -0
- package/dist/chunk-PZS6J5YG.js +16 -0
- package/dist/{chunk-3XSNW5XB.js → chunk-QARYU7R3.js} +2 -2
- package/dist/chunk-QJ3FK4TB.js +38 -0
- package/dist/{chunk-4ISHQ7UW.js → chunk-QXGTGE2C.js} +4 -4
- package/dist/chunk-QZ4JVECJ.js +2 -0
- package/dist/{chunk-63CI3IXR.js → chunk-R3JY4EZ4.js} +10 -10
- package/dist/{chunk-FX6ULETZ.js → chunk-R5336VHZ.js} +2 -2
- package/dist/chunk-RJMXSHKM.js +2 -0
- package/dist/chunk-STBXCPKY.js +5 -0
- package/dist/chunk-T2FQ4GHD.js +9 -0
- package/dist/chunk-TFWDJDGO.js +2 -0
- package/dist/chunk-TG7QSYCJ.js +2 -0
- package/dist/{chunk-ZUUNREKS.js → chunk-TTS75UF2.js} +5 -5
- package/dist/{chunk-DDQONX6B.js → chunk-U7I373V4.js} +2 -2
- package/dist/chunk-UIKLA3F5.js +2 -0
- package/dist/{chunk-6BN3EHQE.js → chunk-UMPNL7T6.js} +2 -2
- package/dist/chunk-URSSPS5H.js +2 -0
- package/dist/chunk-VGMUFW3J.js +2 -0
- package/dist/chunk-VXTNADIW.js +18 -0
- package/dist/{chunk-PWAK75BU.js → chunk-VYF5HA76.js} +2 -2
- package/dist/chunk-WFGOH2UI.js +43 -0
- package/dist/chunk-WGA5BBTA.js +4 -0
- package/dist/chunk-WIBFXSYB.js +6 -0
- package/dist/chunk-WPSS37EW.js +2 -0
- package/dist/chunk-WQHWIVA7.js +3 -0
- package/dist/chunk-WS3Z6W3M.js +65 -0
- package/dist/chunk-WXVGNFAO.js +2 -0
- package/dist/{chunk-RXINFVBN.js → chunk-WZLPXFZU.js} +2 -2
- package/dist/chunk-X4O6K47U.js +2 -0
- package/dist/chunk-X6OGDTQH.js +2 -0
- package/dist/chunk-XEMQUN3Z.js +20 -0
- package/dist/{chunk-OFXN2BCT.js → chunk-XHWLNQVZ.js} +2 -2
- package/dist/chunk-XMR747CP.js +2 -0
- package/dist/{chunk-JJ5SAWBT.js → chunk-Y6L4LXPG.js} +2 -2
- package/dist/chunk-YCPASUCX.js +2 -0
- package/dist/chunk-YZXV3CU3.js +60 -0
- package/dist/{chunk-XRUGSM76.js → chunk-ZEKBR4OK.js} +2 -2
- package/dist/chunk-ZMGBWSFZ.js +2 -0
- package/dist/cli.js +446 -280
- package/dist/{config-types-dvHOz0zU.d.ts → config-types-BrHl3Bge.d.ts} +57 -0
- package/dist/{db-rMZO5JFK.d.ts → db-_Bdx0E1W.d.ts} +1 -1
- package/dist/diff-gate-types-CG2YQ_ei.d.ts +4 -0
- package/dist/{frontend-behavior-evidence-BxKpKWUu.d.ts → frontend-behavior-evidence-EfM4_9bc.d.ts} +1 -1
- package/dist/{health-CtTIGh6H.d.ts → health-BEZ1Rt0S.d.ts} +54 -2
- package/dist/index.d.ts +4 -68
- package/dist/index.js +1 -1
- package/dist/postinstall.js +1 -4
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- 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 +12 -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 +7 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +42 -4
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +12 -3
- 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 +3 -3
- package/dist/queries/dead.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 +65 -8
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +21 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +29 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +15 -3
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +55 -0
- package/dist/queries/duplicate-bodies.js +2 -0
- 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 +4 -3
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -2
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +12 -7
- 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/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +11 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +3 -2
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +7 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +3 -3
- 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 +4 -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 +17 -10
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +42 -3
- 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/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +55 -0
- package/dist/queries/twin-ab.js +2 -0
- package/dist/queries/twin-drift.d.ts +97 -0
- package/dist/queries/twin-drift.js +2 -0
- 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 +7 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +3 -3
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +6 -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 +9 -9
- package/dist/reindex.d.ts +3 -3
- package/dist/reindex.js +19 -19
- package/dist/runtime.d.ts +11 -6
- package/dist/runtime.js +2 -2
- package/dist/{scip-cli-trnNvymv.d.ts → scip-cli-C7cg4ZHR.d.ts} +1 -1
- package/dist/symbol-types-DaoeXKUt.d.ts +66 -0
- package/docs/AGENT_GUIDE.md +20 -18
- package/docs/AI_FAILURE_MODES.md +36 -13
- package/docs/API.md +1 -1
- package/docs/COMMAND_REFERENCE.md +56 -13
- package/docs/DETECTOR_GUIDE.md +20 -3
- package/docs/REGEX_POLICY.md +34 -0
- package/docs/analyzer-inventory.md +40 -3
- package/docs/analyzer-validation-ledger.md +34 -6
- package/package.json +21 -7
- package/scripts/build-scip-windows.mjs +10 -7
- package/skills/_shared/SKILL.md +243 -0
- package/skills/_shared/agents/openai.yaml +4 -0
- package/skills/scip-api-impact/SKILL.md +55 -71
- package/skills/scip-claim-audit/SKILL.md +105 -0
- package/skills/scip-claim-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-audit/SKILL.md +122 -0
- package/skills/scip-cleanup-audit/agents/openai.yaml +4 -0
- package/skills/scip-cleanup-improve/SKILL.md +84 -0
- package/skills/scip-cleanup-improve/agents/openai.yaml +4 -0
- package/skills/scip-concrete-plan/SKILL.md +181 -0
- package/skills/scip-concrete-plan/agents/openai.yaml +4 -0
- package/skills/scip-conductor/SKILL.md +133 -0
- package/skills/scip-conductor/agents/openai.yaml +4 -0
- package/skills/scip-debug/SKILL.md +60 -58
- package/skills/scip-diagram/SKILL.md +64 -94
- package/skills/scip-directory-architecture/SKILL.md +65 -107
- package/skills/scip-doc-reconcile/SKILL.md +56 -67
- package/skills/scip-explore/SKILL.md +78 -210
- package/skills/scip-hyper-optimization/SKILL.md +124 -198
- package/skills/scip-integrity-audit/SKILL.md +103 -0
- package/skills/scip-integrity-audit/agents/openai.yaml +4 -0
- package/skills/scip-language-playbook/SKILL.md +56 -326
- package/skills/scip-maintainability/SKILL.md +80 -219
- package/skills/scip-probe-reachability/SKILL.md +92 -0
- package/skills/scip-probe-reachability/agents/openai.yaml +4 -0
- package/skills/scip-query/SKILL.md +108 -124
- package/skills/scip-react-maintainability/SKILL.md +64 -82
- package/skills/scip-setup/SKILL.md +121 -0
- package/skills/scip-setup/agents/openai.yaml +4 -0
- package/skills/scip-tla-model-system/SKILL.md +138 -0
- package/skills/scip-tla-model-system/agents/openai.yaml +4 -0
- package/skills/scip-triage-issue/SKILL.md +53 -41
- package/skills/scip-twin-drift/SKILL.md +107 -0
- package/skills/scip-twin-drift/agents/openai.yaml +4 -0
- package/skills/scip-verify/SKILL.md +70 -88
- package/skills/scip-vue-maintainability/SKILL.md +67 -94
- package/dist/chunk-2DOW7QCA.js +0 -71
- package/dist/chunk-2FMFF4RI.js +0 -2
- package/dist/chunk-5GXTUANY.js +0 -2
- package/dist/chunk-5JHEN5VN.js +0 -25
- package/dist/chunk-62ULXMQ7.js +0 -18
- package/dist/chunk-7EK7OSWS.js +0 -2
- package/dist/chunk-7IWIMNHI.js +0 -2
- package/dist/chunk-7XTO4YXB.js +0 -8
- package/dist/chunk-AOWFUGDL.js +0 -2
- package/dist/chunk-AREANYIA.js +0 -3
- package/dist/chunk-AZBELWZQ.js +0 -7
- package/dist/chunk-B32FX5KB.js +0 -2
- package/dist/chunk-B6MJ5VQV.js +0 -2
- package/dist/chunk-CXWCLVYL.js +0 -2
- package/dist/chunk-CYHIKTJN.js +0 -3
- package/dist/chunk-DFSEARAU.js +0 -2
- package/dist/chunk-DVFP6PZI.js +0 -2
- package/dist/chunk-E3ADDB43.js +0 -2
- package/dist/chunk-F6IXELII.js +0 -20
- package/dist/chunk-FMGVZBS2.js +0 -2
- package/dist/chunk-GG5LHT27.js +0 -2
- package/dist/chunk-H7JF2CKK.js +0 -2
- package/dist/chunk-HHOMJCP5.js +0 -4
- package/dist/chunk-HRDSU5FN.js +0 -9
- package/dist/chunk-HWVYTJOV.js +0 -2
- package/dist/chunk-JNMLBL36.js +0 -2
- package/dist/chunk-L446VQYQ.js +0 -2
- package/dist/chunk-LDJUB7XW.js +0 -2
- package/dist/chunk-MYTUWXHK.js +0 -4
- package/dist/chunk-N25HPUOK.js +0 -2
- package/dist/chunk-NABVR6B7.js +0 -2
- package/dist/chunk-NBNEVLRC.js +0 -3
- package/dist/chunk-ONPCQ2PM.js +0 -6
- package/dist/chunk-Q5P7NOVM.js +0 -2
- package/dist/chunk-RGKRYO22.js +0 -4
- package/dist/chunk-RM2WQ75T.js +0 -2
- package/dist/chunk-ROGZXWN2.js +0 -2
- package/dist/chunk-RSSXKJ6J.js +0 -38
- package/dist/chunk-RVGEZYMQ.js +0 -2
- package/dist/chunk-SA3DPTHT.js +0 -7
- package/dist/chunk-SGTKURU6.js +0 -52
- package/dist/chunk-T4N2ZRVY.js +0 -21
- package/dist/chunk-THB6AM3V.js +0 -11
- package/dist/chunk-ULHLDOD6.js +0 -4
- package/dist/chunk-UQ73QF5D.js +0 -43
- package/dist/chunk-UUBMFL3F.js +0 -59
- package/dist/chunk-V5FGK3DZ.js +0 -2
- package/dist/chunk-WTY5FERW.js +0 -2
- package/dist/chunk-WUOB4DHH.js +0 -6
- package/dist/chunk-YFQIKYOP.js +0 -2
- package/dist/chunk-Z2LDWIJV.js +0 -5
- package/dist/chunk-ZNWWVYQL.js +0 -3
- package/skills/concrete-plan/SKILL.md +0 -372
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/scip-adoption/SKILL.md +0 -122
- package/skills/scip-adoption/agents/openai.yaml +0 -4
- package/skills/scip-ai-cleanup/SKILL.md +0 -153
- package/skills/scip-ai-cleanup/agents/openai.yaml +0 -4
- package/skills/scip-debloat/SKILL.md +0 -439
- package/skills/scip-debloat/agents/openai.yaml +0 -4
- package/skills/scip-health-audit/SKILL.md +0 -162
- package/skills/scip-health-audit/agents/openai.yaml +0 -4
- package/skills/scip-health-improve/SKILL.md +0 -155
- package/skills/scip-health-improve/agents/openai.yaml +0 -4
- package/skills/scip-query-setup/SKILL.md +0 -170
- package/skills/scip-query-setup/agents/openai.yaml +0 -3
- package/vendor/scip/README.md +0 -6
- package/vendor/scip/win32-arm64/scip.exe +0 -0
- package/vendor/scip/win32-x64/scip.exe +0 -0
package/dist/chunk-7EK7OSWS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as Q}from"./chunk-RM2WQ75T.js";import{q as O}from"./chunk-UQ73QF5D.js";import{b as x,d as T,f as v}from"./chunk-CYHIKTJN.js";import{d as A}from"./chunk-NABVR6B7.js";import{d as b}from"./chunk-THB6AM3V.js";import{e as g}from"./chunk-SA3DPTHT.js";function N(e,n={}){let{samples:o=50,scope:i,maxDisagreements:u=5}=n,a=new Q(e),r=z(a.productionCallableDefinitions({scope:i,minLoc:2,requireFunctionLikeSymbol:!0}),o),l=L(e,r);if(r.length===0||!l)return{available:!1,sampleSize:r.length,oracleCoverage:0,scores:[],topDisagreements:[]};let t={references:C(),callees:C()},c=[],f=0,m=l==="semantic"?v(e,r):new Map,D=l==="source"?K(e,a,r):null;for(let s of r){let p=S(s,l==="semantic"?T(e,s).map(d=>d.file):[...D?.referencesBySymbolId.get(s.symbolId)??[]]),I=S(s,l==="semantic"?(m.get(s.symbolId)??[]).map(d=>d.file):[...D?.calleesBySymbolId.get(s.symbolId)??[]]);if(p.size===0&&I.size===0)continue;f+=1;let R=S(s,O(e,s).map(d=>d.file)),j=S(s,(a.calleeMap([s],{semantic:!1}).get(s.symbolId)??[]).map(d=>d.file));M(t.references,s,"references",R,p,c),M(t.callees,s,"callees",j,I,c)}return c.sort((s,p)=>p.cheapOnly.length+p.oracleOnly.length-(s.cheapOnly.length+s.oracleOnly.length)),{available:!0,sampleSize:r.length,oracleCoverage:r.length>0?h(f/r.length):0,oracleKind:l,scores:["references","callees"].map(s=>B(s,t[s],l)),topDisagreements:c.slice(0,u)}}function C(){return{comparedSymbols:0,agreed:0,cheapTotal:0,oracleTotal:0}}function z(e,n){let o=[...e].sort((a,r)=>a.symbolId-r.symbolId);if(o.length<=n)return o;let i=o.length/n,u=[];for(let a=0;a<n;a++)u.push(o[Math.floor(a*i)]);return u}function L(e,n){let o=n[0];if(!o)return null;if(y(e,o))return"source";try{if(x(e).capability("semantic-references",o.relativePath).available)return"semantic"}catch{}return n.some(i=>y(e,i))?"source":null}function S(e,n){let o=new Set;for(let i of n)i!==e.relativePath&&o.add(i);return o}function M(e,n,o,i,u,a){if(i.size===0&&u.size===0)return;e.comparedSymbols+=1,e.cheapTotal+=i.size,e.oracleTotal+=u.size;let r=[],l=[];for(let t of i)u.has(t)?e.agreed+=1:r.push(t);for(let t of u)i.has(t)||l.push(t);(r.length>0||l.length>0)&&a.push({symbol:A(n.symbol),question:o,cheapOnly:r,oracleOnly:l})}var w={references:!0,callees:!1};function B(e,n,o){let i=n.oracleTotal>0?n.agreed/n.oracleTotal:1,u=n.cheapTotal-n.agreed,a=o==="semantic"?w[e]:!1;return{question:e,comparedSymbols:n.comparedSymbols,precision:a&&n.cheapTotal>0?h(n.agreed/n.cheapTotal):null,recall:h(i),unverified:u}}function y(e,n){return g(n.relativePath)==="clojure"&&b(e,n.relativePath)!==null}function K(e,n,o){let i=new Map,u=new Map,a=o.filter(t=>y(e,t)),r=new Map;for(let t of a){let c=r.get(t.leaf)??[];c.push(t),r.set(t.leaf,c)}for(let t of n.sourceFiles()){if(g(t)!=="clojure")continue;let c=b(e,t);if(c)for(let f of c.fileIdentifiers)for(let m of r.get(f)??[])P(i,m.symbolId,t)}let l=new Map;for(let t of n.scopedDefinitions()){if(g(t.relativePath)!=="clojure")continue;let c=l.get(t.leaf)??[];c.push(t),l.set(t.leaf,c)}for(let t of a){let c=b(e,t.relativePath);if(c){for(let f of c.callSites)if(!(f.line<t.startLine||f.line>t.endLine))for(let m of l.get(f.calleeLeaf)??[])P(u,t.symbolId,m.relativePath)}}return{referencesBySymbolId:i,calleesBySymbolId:u}}function P(e,n,o){let i=e.get(n);if(i){i.add(o);return}e.set(n,new Set([o]))}function h(e){return Math.round(e*1e3)/1e3}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7EK7OSWS.js.map
|
package/dist/chunk-7IWIMNHI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as C,b as k,c as a,d as v}from"./chunk-HWVYTJOV.js";import{a as V,b as R}from"./chunk-MNCQPMCH.js";import{a as B,b}from"./chunk-ELC77ZDE.js";import{m as y}from"./chunk-SA3DPTHT.js";function W(e,s={}){let{minSimilarity:m=.45,minSharedBehaviors:l=6,limit:i=20,scope:o,scanLimit:d,filePattern:h,focusFiles:u}=s,t=y(e).vueProfiles({scope:o,minBehaviorTokens:Math.max(3,l),scanLimit:d}).map(n=>({file:n.file,tokens:n.behaviorTokens,profile:n})),r=V(t,n=>n.tokens);return R({profiles:t,limit:i,filePattern:h,focusFiles:u,candidateIndex:r,profile:{name:"vue-composable-candidates"},compare:(n,c)=>F(n,c,m,l),sort:(n,c)=>c.similarity-n.similarity||n.fileA.localeCompare(c.fileA)||n.fileB.localeCompare(c.fileB)})}function F(e,s,m,l){let i=B(e.tokens,s.tokens);if(i.size<l||!S(i))return null;let o=k(e.tokens,s.tokens);if(o<m)return null;let d=a(i,"composable:"),h=a(i,"store:"),u=a(i,"reactivity:"),t=a(i,"lifecycle:"),r=a(i,"request:"),n=a(i,"function:"),c=a(i,"function-verb:"),g=a(i,"template-binding:"),p=a(i,"template-event:"),f=T({sharedComposables:d,sharedStores:h,sharedReactivity:u,sharedLifecycle:t,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:c,sharedBindings:g,sharedTemplateEvents:p});return{fileA:e.file,fileB:s.file,similarity:o,sharedTokens:v(i),sharedComposables:d,sharedStores:h,sharedReactivity:u,sharedLifecycle:t,sharedRequests:r,sharedFunctions:n,sharedFunctionVerbs:c,sharedBindings:g,sharedTemplateEvents:p,evidenceClass:f.evidenceClass,actionTier:f.actionTier,evidenceClassReasons:f.reasons,recommendation:f.recommendation,uniqueToA:v(b(e.tokens,s.tokens)).slice(0,25),uniqueToB:v(b(s.tokens,e.tokens)).slice(0,25),reason:w({sharedComposables:d,sharedStores:h,sharedRequests:r,sharedLifecycle:t,sharedFunctions:n,sharedFunctionVerbs:c,sharedBindings:g}),locA:e.profile.totalLines,locB:s.profile.totalLines}}function T(e){return C({genericWords:q,primitiveGroups:[{values:e.sharedReactivity,reasonPrefix:"shared reactivity primitive",bucket:"generic"},{values:e.sharedLifecycle,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedComposables,label:"shared composable",fallbackBucket:"shared-abstraction"},{names:e.sharedStores,label:"shared store",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedFunctions,label:"shared function",fallbackBucket:"generic"},{names:e.sharedFunctionVerbs,label:"shared action verb",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"},{names:e.sharedTemplateEvents,label:"shared template event",fallbackBucket:"generic"}],recommendation:P})}function P(e){switch(e){case"domain-behavior":return"Review for a shared composable, store, or feature module around the named domain behavior.";case"mixed":return"Separate generic Vue mechanics from domain-specific behavior before extracting a composable.";case"shared-abstraction":return"Review the existing composable/store usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct composable-extraction evidence."}}function S(e){let s=0,m=0,l=0,i=0,o=0,d=0,h=0;for(let r of e)r.startsWith("composable:")?s+=1:r.startsWith("store:")?m+=1:r.startsWith("request:")?l+=1:r.startsWith("lifecycle:")?i+=1:r.startsWith("function:")?o+=1:r.startsWith("reactivity:")?d+=1:(r.startsWith("function-verb:")||r.startsWith("template-binding:")||r.startsWith("template-event:"))&&(h+=1);let u=s+m,t=u+l+i+o+h;return l>=1&&t>=4||i>=1&&o>=2&&t>=4||u>=2&&(l>=1||o>=2)&&t>=5||o>=2&&d>=1&&t>=4}function w(e){let s=[];return e.sharedComposables.length&&s.push(`shared composables: ${e.sharedComposables.join(", ")}`),e.sharedStores.length&&s.push(`shared stores: ${e.sharedStores.join(", ")}`),e.sharedRequests.length&&s.push(`shared request helpers: ${e.sharedRequests.join(", ")}`),e.sharedLifecycle.length&&s.push(`shared lifecycle: ${e.sharedLifecycle.join(", ")}`),e.sharedFunctions.length&&s.push(`shared functions: ${e.sharedFunctions.slice(0,6).join(", ")}`),e.sharedFunctionVerbs.length&&s.push(`shared action verbs: ${e.sharedFunctionVerbs.slice(0,6).join(", ")}`),e.sharedBindings.length&&s.push(`shared template bindings: ${e.sharedBindings.slice(0,6).join(", ")}`),s.join("; ")||"shared Vue behavior profile"}var q=new Set(["add","apply","cancel","change","clear","close","composable","create","data","delete","draft","edit","error","fetch","filter","form","item","items","load","loading","name","open","reactive","ref","refresh","remove","request","reset","resource","row","rows","save","saving","search","select","selected","store","submit","toggle","update","use","value","watch"]);export{W as a};
|
|
2
|
-
//# sourceMappingURL=chunk-7IWIMNHI.js.map
|
package/dist/chunk-7XTO4YXB.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{h as H,k as O}from"./chunk-Z2LDWIJV.js";import{d as D}from"./chunk-ELC77ZDE.js";import{b as _,d as T,h as E,i as L}from"./chunk-T4N2ZRVY.js";import{a as w}from"./chunk-RM2WQ75T.js";import{d as C,e as F}from"./chunk-NABVR6B7.js";var G=5;function oe(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??T(e,{base:a}),l={available:s.note!==_,base:a,changedFiles:s.changedFiles,helpersChecked:0,skipped:[],findings:[]};if(!l.available||s.changedFiles.length===0)return l;let x=new w(e),k=new Set(s.changedFiles),$=new Map(s.renamedFiles.map(i=>[i.to,i.from])),z=t.baseContentAt??E(e.config.projectRoot,a,L(s)),h=Y(x,k,$,z);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 j=x.calleeMap(R,{semantic:f}),q=R.map(i=>({def:i,callees:O((j.get(i.symbolId)??[]).map(p=>p.symbol))})),B=H(e),M,V=()=>(M??=B.calleeIndex({minCallees:Math.min(3,r),scanLimit:g,semantic:f}),M);for(let{def:i,callees:p}of q){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=V(),N=X(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=Z(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=J({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)=>A(S.migrationScope)-A(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,G)}))}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 J(e){let t=[],a=K(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=D(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=U(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 A(e){return e==="same-scope"?2:e==="unknown"?1:0}function K(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 U(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 W=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&&!W.has(t))}function X(e,t){let a=0;for(let o of e)(t.docFreq.get(o)??0)<=t.ubiquityThreshold&&(a+=1);return a}function Y(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${Q(r.leaf)}\\b`).test(c)})}function Z(e,t){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,t).map(o=>o.relative_path)}function Q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{oe as a};
|
|
8
|
-
//# sourceMappingURL=chunk-7XTO4YXB.js.map
|
package/dist/chunk-AOWFUGDL.js
DELETED
package/dist/chunk-AREANYIA.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as d}from"./chunk-64MNV6AB.js";import{c as S}from"./chunk-7S5E7KWT.js";import{readdirSync as m}from"fs";import{execFileSync as x}from"child_process";import{extname as l,join as y}from"path";var h=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".vue",".rs",".py",".pyi",".java",".kt",".kts",".scala",".sc",".clj",".cljs",".cljc",".rb",".c",".h",".cc",".cpp",".cxx",".hpp",".hh",".hxx",".cs",".vb",".php",".dart"],X=[".vue"],f=[".tsx",".jsx"],g=[".vue"],_=[...f,...g],C=new Set(f),O=new Set(g),p=new Set(h.map(e=>e.toLowerCase())),I=[...p].sort().join(","),E=new Set(["node_modules",".git","target","dist","build",".next",".nuxt",".cache",".turbo",".nbb",".cpcache",".shadow-cljs","out","coverage",".scipquery-cache","__pycache__",".venv","venv",".idea",".vscode"]);function R(e,t={}){let s=t.includeIndexed??!0,i=t.includeAuxiliary??!0,n=t.extensions?.map(c=>c.toLowerCase()),o=n?new Set(n):p,u=n?[...o].sort().join(","):I,r=`${s?"1":"0"}|${i?"1":"0"}|${u}`;return w.get(e,r,()=>{let c=new Set;if(s)for(let a of d(e,{includeIgnored:!1}))o.has(l(a).toLowerCase())&&c.add(a);if(i)for(let a of N(e.config.projectRoot,o))e.isIgnored(a)||s&&c.has(a)||c.add(a);return[...c].sort()})}function D(e,t={}){let s=!1,i=!1;for(let n of R(e,{extensions:_})){if(t.scope&&!n.includes(t.scope))continue;let o=l(n).toLowerCase();if(s||=C.has(o),i||=O.has(o),s&&i)break}return{react:s,vue:i}}var w=S("source-files",{clearGroups:[]});function N(e,t){return T(e,t)??v(e,t)}function T(e,t){try{let s=x("git",["ls-files","--cached","--others","--exclude-standard"],{cwd:e,encoding:"utf-8",timeout:1e4,stdio:["ignore","pipe","ignore"]}),i=new Set;for(let n of s.split(`
|
|
2
|
-
`)){let o=n.trim();o&&(j(o)||t.has(l(o).toLowerCase())&&i.add(o))}return i}catch{return null}}function j(e){return e.split("/").some(t=>E.has(t))}function v(e,t){let s=new Set,i=n=>{let o=n?y(e,n):e,u;try{u=m(o,{withFileTypes:!0})}catch{return}for(let r of u)if(!E.has(r.name)){if(r.isDirectory()){i(n?`${n}/${r.name}`:r.name);continue}t.has(l(r.name).toLowerCase())&&s.add(n?`${n}/${r.name}`:r.name)}};return i(""),s}export{X as a,E as b,R as c,D as d};
|
|
3
|
-
//# sourceMappingURL=chunk-AREANYIA.js.map
|
package/dist/chunk-AZBELWZQ.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-RM2WQ75T.js";import{a as b}from"./chunk-NBNEVLRC.js";import{d as m}from"./chunk-NABVR6B7.js";import{b as l}from"./chunk-THB6AM3V.js";import{readFileSync as p}from"fs";import{join as h}from"path";function O(e,n,r={}){let t=b(e,n);if(!t)return null;let c=new u(e),o=P(d(e,t.relativePath,t.startLine,t.endLine),y(e,t.relativePath)),s=t.endLine-t.startLine+1,a=c.calleeMap([t],{additive:!0,semantic:r.semantic}).get(t.symbolId)??[],f=new Set(a.map(g=>g.symbol));return{symbol:t.symbol,shortName:m(t.symbol),relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:s,branches:o,cyclomaticEstimate:o+1,calleeCount:f.size,fanIn:S(e,t.symbolId),fanOut:L(a,t.relativePath)}}function y(e,n){return e.get("SELECT language FROM documents WHERE relative_path = ?",n)?.language??"unknown"}function d(e,n,r,t){try{return p(h(e.config.projectRoot,n),"utf-8").split(`
|
|
2
|
-
`).slice(r,t+1).join(`
|
|
3
|
-
`)}catch{return""}}function S(e,n){return e.get(`SELECT COUNT(DISTINCT c.document_id) AS c
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
WHERE m.symbol_id = ? AND m.role != 1`,n)?.c??0}function L(e,n){return new Set(e.filter(r=>r.file!==n).map(r=>r.symbol)).size}function P(e,n){let r=l(e),t=0,c=[/\bif\b/g,/\belse\s+if\b/g,/\belse\b/g,/\bfor\b/g,/\bwhile\b/g,/\bswitch\b/g,/\bcase\b/g,/\bcatch\b/g,/\?\s*[^?]/g,/&&/g,/\|\|/g];for(let o of c){let s=r.match(o);s&&(t+=s.length)}if(n==="python"){let o=[/\belif\b/g,/\bexcept\b/g,/\bfinally\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="rust"){let o=[/\bmatch\b/g,/=>/g,/\bloop\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="ruby"){let o=[/\belsif\b/g,/\bunless\b/g,/\brescue\b/g,/\bwhen\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}else if(n==="go"){let o=[/\bselect\b/g,/\bdefer\b/g];for(let s of o){let i=r.match(s);i&&(t+=i.length)}}return t}export{O as a};
|
|
7
|
-
//# sourceMappingURL=chunk-AZBELWZQ.js.map
|
package/dist/chunk-B32FX5KB.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var i={dead:{minLoc:3,skipBarrels:!0,deadCodeOnly:!0,semantic:!1},isolated:{minLoc:3,semantic:!1},similar:{minSimilarity:.6,limit:50,minCallees:4,semantic:!1},extract:{minLoc:15,minCallees:5,limit:50,semantic:!1},wrappers:{maxLoc:15,limit:50,semantic:!1},passthroughs:{maxLoc:15,limit:50,semantic:!1},stale:{minLoc:3,limit:50,semantic:!1},drift:{semantic:!1}};export{i as a};
|
|
2
|
-
//# sourceMappingURL=chunk-B32FX5KB.js.map
|
package/dist/chunk-B6MJ5VQV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as r}from"./chunk-64MNV6AB.js";function a(e){return/[*?]/.test(e)?e.replace(/\*\*/g,"%").replace(/\*/g,"%").replace(/\?/g,"_"):`%${e}%`}function o(e,t){let i=a(t);return r(e,{like:i,includeIgnored:!1}).map(s=>({relativePath:s}))}export{o as a};
|
|
2
|
-
//# sourceMappingURL=chunk-B6MJ5VQV.js.map
|
package/dist/chunk-CXWCLVYL.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-RM2WQ75T.js";import{a as h}from"./chunk-RSSXKJ6J.js";import{r as S}from"./chunk-UQ73QF5D.js";import{a as d,b}from"./chunk-NBNEVLRC.js";import{m as y}from"./chunk-63CI3IXR.js";import{d as m}from"./chunk-NABVR6B7.js";function v(e,o,l={}){let{direction:c="backward",maxDepth:s=3}=l,r=d(e,o);return r?c==="backward"?w(e,r,s,{semantic:l.semantic!==!1}):M(e,r,{semantic:l.semantic!==!1}):null}function w(e,o,l,c){let s=[],r=new Set([o.symbol]),t=[o];for(let n=1;n<=l&&t.length!==0;n++){let i=[];for(let p of t){let g=h(e,p,{semantic:c.semantic});for(let a of g){if(r.has(a.symbol))continue;r.add(a.symbol),s.push({symbol:a.symbol,shortName:m(a.symbol),file:a.file,relationship:n===1?"referenced within definition (callee)":`depth ${n} callee`});let f=b(e,a.symbol);f&&!e.isIgnored(f.relativePath)&&i.push(f)}}t=i}return{symbol:o.symbol,shortName:m(o.symbol),direction:"backward",connectedSymbols:s}}function M(e,o,l){let c=new Set,s=[],r=new u(e);for(let t of S(e,o,{semantic:l.semantic})){if(s.length>=30)break;let n=t.enclosingSymbol??y(r.definitionsForFile(t.file),t.line)?.symbol??null;if(!n||n===o.symbol)continue;let i=b(e,n);!i||e.isIgnored(i.relativePath)||c.has(i.symbol)||(c.add(i.symbol),s.push({symbol:i.symbol,shortName:m(i.symbol),file:i.relativePath,relationship:`references target at ${t.file}:${t.line+1}`}))}return s.sort((t,n)=>t.file.localeCompare(n.file)),{symbol:o.symbol,shortName:m(o.symbol),direction:"forward",connectedSymbols:s}}export{v as a};
|
|
2
|
-
//# sourceMappingURL=chunk-CXWCLVYL.js.map
|
package/dist/chunk-CYHIKTJN.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as k,b as h}from"./chunk-ULHLDOD6.js";import{f as R}from"./chunk-63CI3IXR.js";import{e as C,f as se}from"./chunk-NABVR6B7.js";import{a as _}from"./chunk-THB6AM3V.js";import{c as ie,e as re,g as oe}from"./chunk-SGTKURU6.js";import{a as O}from"./chunk-64MNV6AB.js";import{a as ne,c as te}from"./chunk-7S5E7KWT.js";import{performance as m}from"perf_hooks";function b(i,e,n){if(i.has(e))return i.get(e);let t=n();return i.set(e,t),t}import ae from"path";function Oe(i,e){return i.getReferences().map(n=>{let t=n.getNode();return W(t,e)})}function We(i){let e=i;return typeof e.findReferences=="function"?e.findReferences():[]}function ce(i,e,n,t){let r=[];for(let o of We(i))for(let s of Oe(o,t))s.file===e.relativePath&&s.line>=e.startLine&&s.line<=e.endLine||r.push(s);for(let o of n)r.push(o);return P(r)}function le(i,e,n,t){let r=[],o=n?.getStart();for(let s of i.getReferences()){let a=s.getNode();N(t,a.getSourceFile().getFilePath())===e&&(o!==void 0&&a.getStart()===o||r.push({location:W(a,t),node:a}))}return r}function W(i,e){let n=i.getSourceFile(),t=n.getLineAndColumnAtPos(i.getStart());return{file:N(e,n.getFilePath())??n.getBaseName(),line:t.line-1,column:t.column-1}}function fe(i,e,n){let t=i.getSourceFile(),r=z(t,i),o=i.getText(),s=new RegExp(`\\b${Be(o)}\\b`,"g"),a=t.getFullText().split(`
|
|
2
|
-
`),c=[];for(let l=0;l<a.length;l++){if(l===r)continue;let d=a[l]??"";s.lastIndex=0;let p;for(;(p=s.exec(d))!==null;)c.push({file:e,line:l,column:p.index})}return P(c.filter(l=>N(n,ae.join(n,l.file))===e))}function $(i){for(let e=i;e;e=e.getParent()){let n=e.getKindName();if(n.includes("Type")||n==="InterfaceDeclaration"||n==="TypeAliasDeclaration")return!0;if(n==="CallExpression"||n==="NewExpression"||n==="ExpressionStatement")return!1}return!1}function z(i,e){return i.getLineAndColumnAtPos(e.getStart()).line-1}function P(i){let e=new Set,n=[];for(let t of i){let r=`${t.file}:${t.line}:${t.column}`;e.has(r)||(e.add(r),n.push(t))}return n}function N(i,e){let n=ae.relative(i||process.cwd(),e).replace(/\\/g,"/");return!n||n.startsWith("..")?null:n}function Be(i){return i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pe(i,e,n,t){let r=He(e,t);return r.size===0?new Map:_e(i,n,r)}function He(i,e){let n=new Map;for(let t of R(i,e)){let r=C(t.symbol)??t.leaf;if(!r)continue;let o=n.get(r);o||(o=[],n.set(r,o)),o.push(t)}return n}function _e(i,e,n){let t=new Map,r=new Map;return e.forEachDescendant(o=>{for(let s of $e(i,o)){let a=n.get(s);if(!a)continue;let c=z(e,o);for(let l of a){if(c<l.startLine-1||c>l.endLine+1)continue;let d=Math.abs(c-l.startLine),p=r.get(l.symbolId);p!==void 0&&p<=d||(r.set(l.symbolId,d),t.set(l.symbolId,o))}}}),t}function $e(i,e){let n=[],t=r=>{r&&!n.includes(r)&&n.push(r)};if("getNameNode"in e&&typeof e.getNameNode=="function"){let r=e.getNameNode();t(r?.getText())}if("getName"in e&&typeof e.getName=="function"){let r=e.getName();t(r)}return i.Node.isIdentifier(e)&&t(e.getText()),n}var ze=te("ts-definition-leaf-candidates",{clearGroups:["definition-catalog"]});function ue(i,e,n,t){let r=ge(i,e),o=de(r.get(t)??[],n);if(o)return o;let s=[];for(let a of r.values())for(let c of a)((c.leaf||C(c.symbol)||"").includes(t)||c.symbol.includes(t))&&s.push(c);return de(s,n)}function me(i,e){let n=new Map;for(let[t,r]of ge(i,e)){let o=r[0];o&&n.set(t,o)}return n}function ge(i,e){return ze.get(i,e,()=>{let n=new Map;for(let t of R(i,e)){let r=t.leaf||C(t.symbol);if(!r)continue;let o=n.get(r);o||(o=[],n.set(r,o)),o.push({...t,leaf:r})}for(let t of n.values())t.sort((r,o)=>r.startLine-o.startLine||r.endLine-o.endLine||r.symbolId-o.symbolId);return n})}function de(i,e){let n=null,t=Number.POSITIVE_INFINITY;for(let r of i){let o=Math.abs(r.startLine-e);(o<t||o===t&&n&&r.startLine<n.startLine)&&(n=r,t=o)}return n}import V from"path";var T=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function D(i){let e=i.toLowerCase();return T.some(n=>e.endsWith(n))}function ye(i,e){let n=new Map,t=null,r=null,o=()=>(r??=O(i,{extensions:T}),r),s=()=>(t??=h("typescript.source-file-index",()=>Ve(i.config.projectRoot,e,o()),()=>({projects:e.length,indexedDocuments:o().length})),t),a=c=>D(c)?b(n,c,()=>{let l=w(V.resolve(i.config.projectRoot,c));for(let{project:d,sourceFiles:p}of s()){let f=p.get(l)??null;if(f||(f=d.addSourceFileAtPathIfExists(l)??null,f&&p.set(w(f.getFilePath()),f)),f)return{project:d,sourceFile:f}}return null}):null;return{sourceFile:c=>a(c)?.sourceFile??null,sourceFileMatch:a,indexedTypeScriptLikeDocuments:o}}function Ve(i,e,n){let t=e.map(({project:r})=>({project:r,sourceFiles:new Map(r.getSourceFiles().map(o=>[w(o.getFilePath()),o]))}));for(let r of n){let o=w(V.resolve(i,r));for(let s of t){if(s.sourceFiles.has(o))break;let a=s.project.addSourceFileAtPathIfExists(o)??null;if(a){s.sourceFiles.set(w(a.getFilePath()),a);break}}}return t}function w(i){return V.resolve(i)}import v from"path";import{existsSync as B,readdirSync as qe,readFileSync as Se}from"fs";function he(i){let e=v.join(i,"package.json");if(!B(e))return[];let n;try{n=JSON.parse(Se(e,"utf8"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>Je(i,r)).flatMap(r=>Ke(i,r))}function Je(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=v.join(i,e);return B(v.join(s,"package.json"))?[s]:[]}let n=e.indexOf("*"),t=e.slice(0,n).replace(/\/$/,""),r=e.slice(n+1).replace(/^\//,""),o=v.join(i,t||".");if(!B(o))return[];try{return qe(o).map(s=>v.join(o,s,r)).filter(s=>B(v.join(s,"package.json")))}catch{return[]}}function Ke(i,e){try{let n=JSON.parse(Se(v.join(e,"package.json"),"utf8"));if(!n.name)return[];let t=v.relative(i,e).replace(/\\/g,"/");return[{name:n.name,rootRelative:t,sourceRootRelative:`${t}/src`}]}catch{return[]}}function be(i,e){for(let n of i)if(e===n.name||e.startsWith(`${n.name}/`))return n.name;return null}function Me(i){return[`${i.sourceRootRelative}/index.ts`,`${i.sourceRootRelative}/index.tsx`,`${i.sourceRootRelative}/index.mts`,`${i.sourceRootRelative}/index.cts`]}import{existsSync as L,readFileSync as Ge,readdirSync as Ye,statSync as Xe}from"fs";import S from"path";var J=["tsconfig.json","tsconfig.app.json","tsconfig.node.json","tsconfig.base.json"];function K(i,e){let t=e?S.dirname(S.join(i,e)):i,r=S.resolve(i);for(;t.startsWith(r);){for(let s of J){let a=S.join(t,s);if(L(a))return a}let o=S.dirname(t);if(o===t)break;t=o}for(let o of J){let s=S.join(i,o);if(L(s))return s}return null}function Ie(i){let e=i.config.projectRoot,n=new Set(Qe(e,i.config.semantic?.typescript?.tsconfigs)),t=O(i,{includeIgnored:!1,extensions:T});for(let r of t){let o=K(e,r);o&&n.add(S.resolve(o))}if(n.size===0){let r=K(e);r&&n.add(S.resolve(r))}return[...n].filter(r=>!xe(e,r)).sort((r,o)=>r.localeCompare(o))}function Qe(i,e=[]){let n=new Set;for(let t of e){let r=S.isAbsolute(t)?t:S.join(i,t);L(r)&&n.add(S.resolve(r))}for(let t of Ze(i))for(let r of J){let o=S.join(t,r);L(o)&&n.add(S.resolve(o))}if(n.size===0){let t=K(i);t&&n.add(S.resolve(t))}return[...n].filter(t=>!xe(i,t)).sort((t,r)=>t.localeCompare(r))}function Ze(i){let e=S.join(i,"package.json");if(!L(e))return[];let n;try{n=JSON.parse(Ge(e,"utf8"))}catch{return[]}return(Array.isArray(n.workspaces)?n.workspaces:n.workspaces?.packages??[]).flatMap(r=>en(i,r))}function en(i,e){if(!e||e.startsWith("!")||e.includes("node_modules"))return[];if(!e.includes("*")){let s=S.join(i,e);return q(s)?[s]:[]}let n=e.indexOf("*"),t=e.slice(0,n).replace(/\/$/,""),r=e.slice(n+1).replace(/^\//,""),o=S.join(i,t||".");return q(o)?Ye(o).map(s=>S.join(o,s,r)).filter(q):[]}function q(i){try{return Xe(i).isDirectory()}catch{return!1}}function xe(i,e){let n=S.relative(i,e).replace(/\\/g,"/");return n.startsWith("..")||n.includes("/node_modules/")||n.startsWith("node_modules/")||n.includes("/dist/")||n.startsWith("dist/")}import{createRequire as nn}from"module";var tn=nn(import.meta.url),E;function ke(){if(E!==void 0)return E;try{E=tn("ts-morph")}catch{E=null}return E}function ve(i,e){return e.map(n=>({tsconfigPath:n,project:new i.Project({tsConfigFilePath:n,skipFileDependencyResolution:!0})}))}function H(i,e,n){return{language:"typescript",availability:()=>({available:!1,reason:i,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var rn=32;function Ne(i,e){let n=h("typescript.provider.load",()=>ke());if(!n)return H("ts-morph is not installed");let t=h("typescript.provider.tsconfig-discovery",()=>Ie(i));if(t.length===0)return H("no tsconfig found");try{let r=h("typescript.provider.project-bundles",()=>ve(n,t),()=>({tsconfigs:t.length}));return h("typescript.provider.construct",()=>new G(i,n,r),()=>({tsconfigs:t.length}))}catch(r){return H(r instanceof Error?r.message:String(r),t[0],t)}}var G=class{constructor(e,n,t){this.db=e;this.tsMorph=n;this.projects=t;this.workspacePackages=he(e.config.projectRoot),this.sourceFiles=ye(e,t)}db;tsMorph;projects;language="typescript";importUsageCache=new Map;referencesCache=new Map;calleesCache=new Map;fileCalleesCache=new Map;signatureCache=new Map;definitionNodeCache=new Map;fileDefinitionNodeCache=new Map;indexedDefinitionLeafCache=new Map;compilerCheckerCache=new WeakMap;packageImportReferenceIndex=null;packageExportIndex=null;workspacePackages;sourceFiles;availability(){return{available:!0,tsconfigPath:this.projects[0]?.tsconfigPath,tsconfigPaths:this.projects.map(e=>e.tsconfigPath)}}importUsage(e){return b(this.importUsageCache,e,()=>{let n=this.sourceFiles.sourceFile(e);if(!n)return[];let t=sn();return h("typescript.import-usage.file",()=>this.importUsageForSourceFile(e,n,t),()=>({file:e,...t}))})}referencesFor(e){return b(this.referencesCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);return this.referencesForDefinitionNode(e,n)})}referencesForDefinitions(e){let n=new Map,t=k(),r=[];for(let c of e){let l=this.referencesCache.get(c.symbolId);l?n.set(c.symbolId,l):r.push(c)}if(r.length===0)return n;let o=r,s=r.filter(c=>!Fe(c));if(s.length>=rn){let c=this.referencesForDefinitionsBySymbolScan(s);for(let l of s){let d=c.get(l.symbolId)??[];this.referencesCache.set(l.symbolId,d),n.set(l.symbolId,d)}if(o=r.filter(l=>Fe(l)),o.length===0)return n}let a=new Map;for(let c of o){let l=a.get(c.relativePath);l?l.push(c):a.set(c.relativePath,[c])}for(let[c,l]of a){let d=Re();h("typescript.references-map.file",()=>{let p=this.definitionNodesForFile(c);for(let f of l){t&&(d.cacheMisses+=1);let u=p.get(f.symbolId)??null;t&&(u?d.nodeHits+=1:d.nodeMisses+=1);let g=this.referencesForDefinitionNode(f,u,t?d:void 0);this.referencesCache.set(f.symbolId,g),n.set(f.symbolId,g)}},()=>({relativePath:c,definitions:l.length,...Ce(d)}))}return n}referencesForDefinitionsBySymbolScan(e){let n=k(),t=Re(),r=new Map,o=new Set(e.map(a=>a.symbolId)),s=new Map(e.map(a=>[a.symbolId,a]));for(let a of e)r.set(a.symbolId,[]);return h("typescript.references-map.inverted-scan",()=>{let a=n?m.now():0;for(let p of e){let f=this.packageImportReferencesForDefinition(p);if(f.length>0){let u=r.get(p.symbolId)??[];u.push(...f),r.set(p.symbolId,u)}n&&(t.packageReferenceCount+=f.length)}n&&(t.packageRefsMs+=m.now()-a);let c=new Map,l=new Set(e.map(p=>p.leaf).filter(Boolean)),d=n?m.now():0;for(let p of this.sourceFiles.indexedTypeScriptLikeDocuments()){if(this.db.isIgnored(p))continue;let f=this.sourceFiles.sourceFile(p);f&&(n&&(t.scanFiles+=1),this.addReferencesFromSourceFileScan(f,p,o,s,l,c,r,n?t:void 0))}n&&(t.scanMs+=m.now()-d);for(let[p,f]of r){let u=P(f);r.set(p,u),n&&(t.referenceCount+=u.length)}},()=>({definitions:e.length,...Ce(t)})),r}addReferencesFromSourceFileScan(e,n,t,r,o,s,a,c){let l=this.compilerCheckerForSourceFile(e),d=e.compilerNode,p=ln(e),f=u=>{if(this.tsMorph.ts.isIdentifier(u)){if(c&&(c.identifiers+=1),!o.has(u.text)&&!p.has(u.text)){this.tsMorph.ts.forEachChild(u,f);return}let g=this.compilerReferenceSymbol(l,u,c);if(g){let y;if(s.has(g)?y=s.get(g)??null:(y=this.definitionFromCompilerSymbol(g),s.set(g,y)),c&&(y?c.targetHits+=1:c.targetMisses+=1),y&&t.has(y.symbolId)){c&&(c.requestedHits+=1);let F=r.get(y.symbolId);if(F&&!pn(F,n,De(d,u))){let I=a.get(y.symbolId)??[],U=d.getLineAndCharacterOfPosition(u.getStart(d));I.push({file:n,line:U.line,column:U.character}),a.set(y.symbolId,I)}}}}this.tsMorph.ts.forEachChild(u,f)};f(d)}compilerReferenceSymbol(e,n,t){t&&(t.symbolLookups+=1);let r=e.getSymbolAtLocation(n);if(r){if((r.flags&this.tsMorph.ts.SymbolFlags.Alias)===0)return r;try{return t&&(t.aliasResolutions+=1),e.getAliasedSymbol(r)}catch{return r}}}calleesFor(e){return b(this.calleesCache,e.symbolId,()=>b(this.fileCalleesCache,e.relativePath,()=>this.calleeMapForFile(e.relativePath)).get(e.symbolId)??[])}calleesForDefinitions(e){let n=new Map,t=new Map;for(let r of e){let o=t.get(r.relativePath);o?o.push(r):t.set(r.relativePath,[r])}for(let[r,o]of t){let s=this.fileCalleesCache.get(r),a=new Set(o.map(l=>l.symbolId)),c=s??this.calleeMapForFile(r,a);for(let l of o){let d=c.get(l.symbolId)??[];this.calleesCache.set(l.symbolId,d),n.set(l.symbolId,d)}}return n}referencesForDefinitionNode(e,n,t){let r=t?m.now():0,o=this.packageImportReferencesForDefinition(e);if(t&&(t.packageRefsMs+=m.now()-r,t.packageReferenceCount+=o.length),!n)return o;let s=t?m.now():0,a=ce(n,e,o,this.db.config.projectRoot);return t&&(t.semanticRefsMs+=m.now()-s,t.referenceCount+=a.length),a}signatureFor(e){return b(this.signatureCache,e.symbolId,()=>{let n=this.nodeForDefinition(e);if(!n||!this.tsMorph.Node.isFunctionDeclaration(n)&&!this.tsMorph.Node.isMethodDeclaration(n)&&!this.tsMorph.Node.isArrowFunction(n)&&!this.tsMorph.Node.isFunctionExpression(n)&&!this.tsMorph.Node.isConstructorDeclaration(n))return null;let t=n.getType().getCallSignatures()[0];if(!t)return null;let r=t.getParameters().map(s=>{let a=s.getDeclarations()[0],c=a?s.getTypeAtLocation(a).getText(a):s.getValueDeclaration()?.getType().getText()??"unknown";return Pe(c)}),o=t.getReturnType().getText(n);return`(${r.join(",")})=>${Pe(o)}`})}importUsageForSourceFile(e,n,t){let r=[],o=new Map;for(let s of n.getImportDeclarations()){t.declarations+=1;let a=_(this.db,e,s.getModuleSpecifierValue()),c=s.getImportClause()?.isTypeOnly()??!1;for(let l of Y(s)){t.entries+=1;let d=c?null:l.identifier?.getSymbol()?.compilerSymbol??null;!c&&l.identifier&&(d?t.bindingSymbols+=1:t.missingBindingSymbols+=1);let p={sourcePath:a,entry:l,typeOnlyDeclaration:c,bindingSymbol:d,references:[]};if(r.push(p),c||!l.localName||!d)continue;let f=o.get(l.localName);f?f.push(p):o.set(l.localName,[p])}}return o.size>0&&n.forEachDescendant(s=>{if(s.getKindName()!=="Identifier")return;let a=o.get(s.getText());if(!a||an(s))return;t.scannedIdentifiers+=1;let c=s.getSymbol()?.compilerSymbol;if(t.symbolLookups+=1,!!c){for(let l of a)if(l.bindingSymbol===c){l.references.push({location:W(s,this.db.config.projectRoot),node:s}),t.matchedReferences+=1;break}}}),r.map(s=>s.typeOnlyDeclaration?on(e,s.sourcePath,s.entry):s.entry.identifier&&!s.bindingSymbol?(t.fallbackEntries+=1,this.valueImportUsageForEntry(e,s.sourcePath,s.entry)):this.valueImportUsageFromLocations(e,s.sourcePath,s.entry,s.references))}valueImportUsageForEntry(e,n,t){let r=t.identifier?t.identifier.findReferences():[],o=[];for(let s of r)for(let a of le(s,e,t.identifier,this.db.config.projectRoot))o.push(a);return this.valueImportUsageFromLocations(e,n,t,o)}valueImportUsageFromLocations(e,n,t,r){let o=r.some(c=>!$(c.node)),s=r.some(c=>$(c.node)),a=t.isTypeOnly;return{importer:e,sourcePath:n,importedName:t.importedName,localName:t.localName,kind:t.kind,isTypeOnly:a,isUsed:a||r.length>0,isTypeUsed:a||s,isValueUsed:o,references:r.map(c=>c.location)}}packageImportReferencesForDefinition(e){return this.packageImportReferences().get(e.symbolId)??[]}packageImportReferences(){if(this.packageImportReferenceIndex)return this.packageImportReferenceIndex;let e=new Map,n=this.packageExports();for(let t of this.sourceFiles.indexedTypeScriptLikeDocuments())this.addPackageImportReferencesForDocument(e,n,t);for(let[t,r]of e)e.set(t,P(r));return this.packageImportReferenceIndex=e,e}addPackageImportReferencesForDocument(e,n,t){if(this.db.isIgnored(t))return;let r=this.sourceFiles.sourceFileMatch(t);if(r)for(let o of r.sourceFile.getImportDeclarations())this.addPackageImportReferencesForDeclaration(e,n,t,o)}addPackageImportReferencesForDeclaration(e,n,t,r){let o=be(this.workspacePackages,r.getModuleSpecifierValue());if(!o)return;let s=n.get(o);if(s)for(let a of Y(r)){if(a.kind!=="named"||!a.identifier)continue;let c=s.get(a.importedName);if(!c||c.size===0)continue;let l=fe(a.identifier,t,this.db.config.projectRoot);l.length>0&&mn(e,c,l)}}packageExports(){if(this.packageExportIndex)return this.packageExportIndex;let e=new Map;for(let n of this.workspacePackages){let t=new Map;for(let r of Me(n))this.collectPackageExports(n,r,t,new Set);t.size>0&&e.set(n.name,t)}return this.packageExportIndex=e,e}collectPackageExports(e,n,t,r){if(r.has(n))return;r.add(n);let o=this.sourceFiles.sourceFile(n);if(o)for(let s of o.getExportDeclarations()){let a=s.getModuleSpecifierValue(),c=a?_(this.db,n,a):n;if(!c||!c.startsWith(`${e.sourceRootRelative}/`))continue;let l=s.getNamedExports();if(l.length===0){if(s.isNamespaceExport())continue;this.collectPackageExports(e,c,t,r);continue}for(let d of l){let p=d.getNameNode().getText(),f=d.getAliasNode()?.getText()??p,u=this.indexedDefinitionByLeaf(c,p);if(!u)continue;let g=t.get(f);g||(g=new Set,t.set(f,g)),g.add(u.symbolId)}}}indexedDefinitionByLeaf(e,n){return b(this.indexedDefinitionLeafCache,e,()=>me(this.db,e)).get(n)??null}nodeForDefinition(e){return b(this.definitionNodeCache,e.symbolId,()=>this.definitionNodesForFile(e.relativePath).get(e.symbolId)??null)}definitionNodesForFile(e){return b(this.fileDefinitionNodeCache,e,()=>{let n=this.sourceFiles.sourceFile(e);return n?pe(this.tsMorph,this.db,n,e):new Map})}definitionFromCompilerSymbol(e,n){let t=e.name,r=n?m.now():0,o=e.declarations??[];n&&(n.declarationsMs+=m.now()-r,n.declarationChecks+=o.length);for(let s of o){let a=n?m.now():0,c=s.getSourceFile(),l=N(this.db.config.projectRoot,c.fileName),d=c.getLineAndCharacterOfPosition(s.getStart(c)).line;if(n&&(n.declarationLocationMs+=m.now()-a),!l||this.db.isIgnored(l))continue;let p=n?m.now():0,f=ue(this.db,l,d,t);if(n&&(n.indexedLookupMs+=m.now()-p),f)return{symbolId:f.symbolId,symbol:f.symbol,file:f.relativePath,line:f.startLine}}return null}calleeMapForFile(e,n){let t=k(),r=0,o=0,s=0,a=0,c=0,l=0,d=0,p=0,f=t?dn():void 0;return h("typescript.callee-map.file",()=>{let u=t?m.now():0,g=this.sourceFiles.sourceFile(e);if(t&&(c=Math.round(m.now()-u)),!g)return new Map;let y=t?m.now():0,F=R(this.db,e).sort((M,x)=>M.startLine-x.startLine||x.endLine-M.endLine);if(t&&(l=Math.round(m.now()-y)),r=F.length,F.length===0)return new Map;let I=new Map,U=t?m.now():0,je=this.compilerCheckerForSourceFile(g),Z=g.compilerNode;t&&(d=Math.round(m.now()-U));let Ae=new Map,ee=M=>{if(this.tsMorph.ts.isCallExpression(M)||this.tsMorph.ts.isNewExpression(M)){t&&(o+=1);let x=this.semanticCalleeForCallNode(je,Z,F,M,Ae,n,f);x&&(t&&(s+=1),cn(I,x.callerId,x.target))}this.tsMorph.ts.forEachChild(M,ee)},Ue=t?m.now():0;ee(Z),t&&(p=Math.round(m.now()-Ue));for(let[M,x]of I)I.set(M,gn(x));return a=I.size,I},()=>({relativePath:e,definitions:r,callNodes:o,resolvedCallees:s,outputRows:a,requestedDefinitions:n?.size??r,sourceFileLookupMs:c,definitionsLoadMs:l,checkerLookupMs:d,traversalMs:p,...f?un(f):{}}))}semanticCalleeForCallNode(e,n,t,r,o,s,a){let c=a?m.now():0,l=fn(t,De(n,r));if(a&&(a.callerLookupMs+=m.now()-c),!l)return null;if(s&&!s.has(l.symbolId))return a&&(a.skippedUnrequestedCallers+=1),null;let d=r.expression,p=this.compilerSymbolForExpression(e,d,a),f=null;if(p)if(a&&(a.targetSymbolHits+=1),o.has(p))a&&(a.compilerSymbolCacheHits+=1),f=o.get(p)??null;else{a&&(a.compilerSymbolCacheMisses+=1);let u=a?m.now():0;f=this.definitionFromCompilerSymbol(p,a),a&&(a.targetLookupMs+=m.now()-u),o.set(p,f)}else a&&(a.targetMisses+=1);return f?{callerId:l.symbolId,target:{symbol:f.symbol,file:f.file,line:f.line}}:null}compilerSymbolForExpression(e,n,t){let r=t?m.now():0,o=e.getSymbolAtLocation(n);if(t&&(t.expressionSymbolMs+=m.now()-r),o)return o;t&&(t.typeFallbacks+=1);let s=t?m.now():0,a=e.getTypeAtLocation(n).getSymbol();return t&&(t.typeSymbolMs+=m.now()-s),a}compilerCheckerForSourceFile(e){let n=e.getProject(),t=this.compilerCheckerCache.get(n);return t||(t=n.getTypeChecker().compilerObject,this.compilerCheckerCache.set(n,t)),t}};function Y(i){let e=[],n=i.getDefaultImport();n&&e.push({identifier:n,importedName:"default",localName:n.getText(),kind:"default",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});let t=i.getNamespaceImport();t&&e.push({identifier:t,importedName:"*",localName:t.getText(),kind:"namespace",isTypeOnly:i.getImportClause()?.isTypeOnly()??!1});for(let r of i.getNamedImports()){let o=r.getNameNode(),a=r.getAliasNode()??(o.getKindName()==="Identifier"?o:null);e.push({identifier:a,importedName:o.getText(),localName:a?.getText()??o.getText(),kind:"named",isTypeOnly:r.isTypeOnly()||(i.getImportClause()?.isTypeOnly()??!1)})}return e.length===0&&e.push({identifier:null,importedName:"*",localName:null,kind:"side-effect",isTypeOnly:!1}),e}function on(i,e,n){return{importer:i,sourcePath:e,importedName:n.importedName,localName:n.localName,kind:n.kind,isTypeOnly:!0,isUsed:!0,isTypeUsed:!0,isValueUsed:!1,references:[]}}function sn(){return{declarations:0,entries:0,bindingSymbols:0,missingBindingSymbols:0,scannedIdentifiers:0,symbolLookups:0,matchedReferences:0,fallbackEntries:0}}function an(i){for(let e=i;e;e=e.getParent())if(e.getKindName()==="ImportDeclaration")return!0;return!1}function cn(i,e,n){let t=i.get(e);t||(t=[],i.set(e,t)),t.push(n)}function ln(i){let e=new Set;for(let n of i.getImportDeclarations())for(let t of Y(n))t.localName&&e.add(t.localName);return e}function fn(i,e){let n=null;for(let t of i)e<t.startLine||e>t.endLine||(!n||t.startLine>=n.startLine)&&(n=t);return n}function De(i,e){return i.getLineAndCharacterOfPosition(e.getStart(i)).line}function pn(i,e,n){return e===i.relativePath&&n>=i.startLine&&n<=i.endLine}function Fe(i){return i.symbol.includes("#")?se(i.symbol)==="type"&&i.relativePath.endsWith(".d.ts"):!1}function dn(){return{callerLookupMs:0,expressionSymbolMs:0,typeSymbolMs:0,targetLookupMs:0,declarationsMs:0,declarationLocationMs:0,indexedLookupMs:0,compilerSymbolCacheHits:0,compilerSymbolCacheMisses:0,targetSymbolHits:0,targetMisses:0,typeFallbacks:0,declarationChecks:0,skippedUnrequestedCallers:0}}function un(i){return{...i,callerLookupMs:Math.round(i.callerLookupMs),expressionSymbolMs:Math.round(i.expressionSymbolMs),typeSymbolMs:Math.round(i.typeSymbolMs),targetLookupMs:Math.round(i.targetLookupMs),declarationsMs:Math.round(i.declarationsMs),declarationLocationMs:Math.round(i.declarationLocationMs),indexedLookupMs:Math.round(i.indexedLookupMs)}}function Re(){return{cacheHits:0,cacheMisses:0,nodeHits:0,nodeMisses:0,scanFiles:0,identifiers:0,symbolLookups:0,aliasResolutions:0,targetHits:0,targetMisses:0,requestedHits:0,scanMs:0,packageRefsMs:0,semanticRefsMs:0,packageReferenceCount:0,referenceCount:0}}function Ce(i){return{...i,scanMs:Math.round(i.scanMs),packageRefsMs:Math.round(i.packageRefsMs),semanticRefsMs:Math.round(i.semanticRefsMs)}}function mn(i,e,n){for(let t of e){let r=i.get(t)??[];r.push(...n),i.set(t,r)}}function gn(i){let e=new Set,n=[];for(let t of i){let r=`${t.symbol}|${t.file}|${t.line}`;e.has(r)||(e.add(r),n.push(t))}return n}function Pe(i){return i.replace(/\s+/g," ").replace(/\bimport\("[^"]+"\)\./g,"").trim()}var X=new WeakMap;ne({name:"semantic-provider",groups:["semantic-provider"],clearAll:i=>X.delete(i)});function Q(i,e){let n=`${i.config.projectRoot}:typescript-workspace`,t=X.get(i);t||(t=new Map,X.set(i,t));let r=t.get(n);if(r)return r;let o=Ne(i,e);return t.set(n,o),o}function j(i){return{capability:(e,n)=>Ee(i,e,n),importUsage:e=>yn(i,e),references:e=>Sn(i,e),callerMap:e=>hn(i,e),calleeMap:e=>In(i,e),signature:e=>xn(i,e)}}function bt(i,e){return j(i).importUsage(e)}function yn(i,e){let n=A(i,e);return n?n.importUsage(e):[]}function Mt(i,e){return j(i).references(e)}function Sn(i,e){let n=A(i,e.relativePath);return n?n.referencesFor(e):[]}function It(i,e){return j(i).callerMap(e)}function hn(i,e){let n=k(),t=new Map,r=ie(i),o=[],s=[],a=[],c=0,l=0,d=0,p=0;if(h("semantic.references.cache-scan",()=>{for(let f of e){if(!r||!D(f.relativePath)){n&&!D(f.relativePath)&&(c+=1),a.push(f);continue}let u=re(i,f.relativePath,f.symbol,r);if(u!==null){let g=Mn(u);if(g){n&&(l+=1),p+=we(i,t,f,g);continue}n&&(d+=1)}s.push(f)}},()=>({definitions:e.length,skippedNonTs:c,cacheHits:l,parseFailures:d,misses:s.length,unkeyed:a.length,resultRows:t.size,callerFiles:p})),s.length>0||a.length>0){let f=[...a,...s],u=0,g=h("semantic.references.compute-misses",()=>{let y=bn(i,f);return u=y.size,y},()=>({definitions:f.length,misses:s.length,unkeyed:a.length,rows:u}));for(let y of f)p+=we(i,t,y,g.get(y.symbolId)??[]);if(r)for(let y of s)o.push({relativePath:y.relativePath,symbol:y.symbol,projectFingerprint:r,payload:JSON.stringify(g.get(y.symbolId)??[])})}return o.length>0&&(Ee(i,"semantic-references").available?h("semantic.references.cache-write",()=>oe(i,o),()=>({entries:o.length})):h("semantic.references.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",entries:o.length}))),t}function bn(i,e){let n=k(),t=new Map,r=0,o=0,s=0,a=0;return h("semantic.references.provider-loop",()=>{let c=new Map,l=[];for(let d of e){let p=A(i,d.relativePath);if(!p){n&&(o+=1);continue}if(n&&(r+=1),p.referencesForDefinitions){let f=c.get(p);f?f.push(d):c.set(p,[d])}else l.push({provider:p,definition:d})}for(let[d,p]of c){let f=d.referencesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];Te(t,u.symbolId,g,n,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.referencesFor(p);Te(t,p.symbolId,f,n,u=>{s+=1,a+=u})}return t},()=>({definitions:e.length,providerHits:r,providerMisses:o,definitionsWithReferences:s,referenceCount:a,rows:t.size}))}function Te(i,e,n,t,r){i.set(e,n),t&&n.length>0&&r(n.length)}function we(i,e,n,t){let r=0;for(let o of t){if(o.file===n.relativePath||i.isIgnored(o.file))continue;let s=e.get(n.symbolId);s||(s=new Set,e.set(n.symbolId,s));let a=s.size;s.add(o.file),s.size!==a&&(r+=1)}return r}function Mn(i){try{return JSON.parse(i)}catch{return null}}function xt(i,e){return j(i).calleeMap(e)}function In(i,e){let n=k(),t=new Map,r=0,o=0,s=0,a=0;return h("semantic.callees.provider-loop",()=>{let c=new Map,l=[];for(let d of e){let p=A(i,d.relativePath);if(!p){n&&(o+=1);continue}n&&(r+=1);let f=d;if(p.calleesForDefinitions){let u=c.get(p);u?u.push(f):c.set(p,[f])}else l.push({provider:p,definition:f})}for(let[d,p]of c){let f=d.calleesForDefinitions(p);for(let u of p){let g=f.get(u.symbolId)??[];Le(t,u.symbolId,g,n,y=>{s+=1,a+=y})}}for(let{provider:d,definition:p}of l){let f=d.calleesFor(p);Le(t,p.symbolId,f,n,u=>{s+=1,a+=u})}return t},()=>({definitions:e.length,providerHits:r,providerMisses:o,definitionsWithCallees:s,calleeCount:a,rows:t.size}))}function Le(i,e,n,t,r){n.length>0&&(i.set(e,n),t&&r(n.length))}function kt(i,e){return j(i).signature(e)}function xn(i,e){let n=A(i,e.relativePath);return n?n.signatureFor(e):null}function Ee(i,e,n){if(n!==void 0&&!D(n))return{slot:e,language:"typescript",available:!1,reason:"semantic evidence is only available for TypeScript files"};try{return{slot:e,language:"typescript",...Q(i,n).availability()}}catch(t){return{slot:e,language:"typescript",available:!1,reason:t instanceof Error?t.message:String(t)}}}function A(i,e){if(!D(e))return null;let n=Q(i,e);return n.availability().available?n:null}export{D as a,j as b,bt as c,Mt as d,It as e,xt as f,kt as g};
|
|
3
|
-
//# sourceMappingURL=chunk-CYHIKTJN.js.map
|
package/dist/chunk-DFSEARAU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-B75HZHUP.js";import{a as b}from"./chunk-RM2WQ75T.js";import{a as f}from"./chunk-L446VQYQ.js";import{a as c}from"./chunk-RSSXKJ6J.js";import{d as m}from"./chunk-NABVR6B7.js";function k(o,n={}){let{limit:s=20,scope:i,minFanIn:r=2,minFanOut:a=2,scanLimit:e}=n,u=new b(o);return p(u.productionCallableDefinitions({scope:i,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof e=="number"&&e>0}),e).map(t=>d(o,t,n.semantic!==!1)).filter(t=>t.fanIn>=r&&t.fanOut>=a).sort((t,l)=>l.score-t.score||l.fanIn-t.fanIn).slice(0,s)}function d(o,n,s){let i=new Set(f(o,n,{limit:500,semantic:s}).map(e=>e.file)).size,r=new Set(c(o,n,{limit:500,semantic:s}).filter(e=>e.file!==n.relativePath).map(e=>`${e.symbol}|${e.file}`)).size,a=i*r;return{symbol:n.symbol,shortName:m(n.symbol),fanIn:i,fanOut:r,score:a,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${i} incoming file(s) reference this symbol`,`${r} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${a} (fan-in * fan-out)`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{k as a};
|
|
2
|
-
//# sourceMappingURL=chunk-DFSEARAU.js.map
|
package/dist/chunk-DVFP6PZI.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{SymbolInformation_Kind as t}from"@c4312/scip";var r=new Map(Object.entries(t).filter(([e,n])=>Number.isInteger(Number(e))&&typeof n=="string").map(([e,n])=>[Number(e),n])),i=new Map([...r.entries()].map(([e,n])=>[n.toLowerCase(),e]));function s(e){return r.get(e)??"Unknown"}function u(){return[t.Function,t.Method,t.Macro,t.Constructor,t.Getter,t.Setter,t.StaticMethod,t.SingletonMethod,t.AbstractMethod,t.ProtocolMethod,t.TraitMethod]}function a(){return[t.Class,t.Interface,t.Struct,t.Trait,t.Type,t.TypeAlias,t.Enum,t.Union,t.Protocol]}export{r as a,i as b,s as c,u as d,a as e};
|
|
2
|
-
//# sourceMappingURL=chunk-DVFP6PZI.js.map
|
package/dist/chunk-E3ADDB43.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,b as H,c as h,d as k}from"./chunk-HWVYTJOV.js";import{a as b,b as y}from"./chunk-MNCQPMCH.js";import{a as p,b as g}from"./chunk-ELC77ZDE.js";import{m as v}from"./chunk-SA3DPTHT.js";function j(e,s={}){let{minSimilarity:f=.45,minSharedBehaviors:l=6,limit:t=20,scope:c,scanLimit:n,filePattern:d,focusFiles:m}=s,i=v(e).reactProfiles({scope:c,minBehaviorTokens:Math.max(3,l),scanLimit:n}).map(r=>({file:r.file,component:r.name,tokens:r.behaviorTokens,profile:r})),o=b(i,r=>r.tokens);return y({profiles:i,limit:t,filePattern:d,focusFiles:m,candidateIndex:o,profile:{name:"react-hook-candidates"},compare:(r,a)=>B(r,a,f,l),sort:(r,a)=>a.similarity-r.similarity||r.fileA.localeCompare(a.fileA)||r.componentA.localeCompare(a.componentA)||r.fileB.localeCompare(a.fileB)||r.componentB.localeCompare(a.componentB)})}function B(e,s,f,l){let t=p(e.tokens,s.tokens);if(t.size<l||!E(t))return null;let c=H(e.tokens,s.tokens);if(c<f)return null;let n=h(t,"hook:"),d=h(t,"react-hook:"),m=h(t,"effect:"),i=h(t,"state:"),o=h(t,"request:"),r=h(t,"handler:"),a=h(t,"handler-verb:"),u=C({sharedHooks:n,sharedReactHooks:d,sharedEffects:m,sharedState:i,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:a});return{fileA:e.file,componentA:e.component,fileB:s.file,componentB:s.component,similarity:c,sharedTokens:k(t),sharedHooks:n,sharedReactHooks:d,sharedEffects:m,sharedState:i,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:a,evidenceClass:u.evidenceClass,actionTier:u.actionTier,evidenceClassReasons:u.reasons,recommendation:u.recommendation,uniqueToA:k(g(e.tokens,s.tokens)).slice(0,25),uniqueToB:k(g(s.tokens,e.tokens)).slice(0,25),reason:P({sharedHooks:n,sharedReactHooks:d,sharedEffects:m,sharedState:i,sharedRequests:o,sharedHandlers:r,sharedHandlerVerbs:a}),locA:e.profile.loc,locB:s.profile.loc}}function C(e){return R({genericWords:S,stripPrefixes:T,primitiveGroups:[{values:e.sharedReactHooks,reasonPrefix:"shared React primitives",bucket:"generic"},{values:e.sharedEffects,reasonPrefix:"shared lifecycle primitive",bucket:"generic"}],nameGroups:[{names:e.sharedHooks,label:"shared hook",fallbackBucket:"shared-abstraction"},{names:e.sharedRequests,label:"shared request",fallbackBucket:"generic"},{names:e.sharedState,label:"shared state",fallbackBucket:"generic"},{names:e.sharedHandlers,label:"shared handler",fallbackBucket:"generic"},{names:e.sharedHandlerVerbs,label:"shared action verb",fallbackBucket:"generic"}],recommendation:A})}function A(e){switch(e){case"domain-behavior":return"Review for a shared hook, controller, or feature module around the named domain behavior.";case"mixed":return"Separate generic React mechanics from domain-specific behavior before extracting a shared hook.";case"shared-abstraction":return"Review the existing shared hook usage first; extract only if duplicated behavior remains outside it.";case"generic-workflow-scaffolding":return"Treat as support evidence for a repeated workflow shape, not direct hook-extraction evidence."}}function E(e){let s=0,f=0,l=0,t=0,c=0,n=0,d=0;for(let o of e)o.startsWith("hook:")?s+=1:o.startsWith("react-hook:")?f+=1:o.startsWith("effect:")?l+=1:o.startsWith("request:")?t+=1:o.startsWith("handler:")||o.startsWith("handler-verb:")?c+=1:o.startsWith("state:")?n+=1:o.startsWith("state-hook:")&&(d+=1);let m=n+d,i=s+f+l+t+c+m;return t>=1&&i>=4||s>=1&&(t>=1||n>=1||c>=2)&&i>=5||n>=1&&c>=2&&(l>=1||f>=2)&&i>=5}function P(e){let s=[];return e.sharedHooks.length&&s.push(`shared hooks: ${e.sharedHooks.join(", ")}`),e.sharedReactHooks.length&&s.push(`shared React hooks: ${e.sharedReactHooks.join(", ")}`),e.sharedEffects.length&&s.push(`shared effects: ${e.sharedEffects.join(", ")}`),e.sharedState.length&&s.push(`shared state: ${e.sharedState.join(", ")}`),e.sharedRequests.length&&s.push(`shared requests: ${e.sharedRequests.join(", ")}`),e.sharedHandlers.length&&s.push(`shared handlers: ${e.sharedHandlers.slice(0,6).join(", ")}`),e.sharedHandlerVerbs.length&&s.push(`shared action verbs: ${e.sharedHandlerVerbs.slice(0,6).join(", ")}`),s.join("; ")||"shared React behavior profile"}var S=new Set(["add","apply","async","callback","cancel","change","clear","close","create","data","delete","draft","edit","effect","error","fetch","filter","form","handle","has","is","item","items","load","loader","loading","memo","name","open","reducer","refresh","ref","remove","request","reset","resource","row","rows","save","saving","search","select","selected","state","store","submit","toggle","update","use","value"]),T=[/^use(?=[A-Z])/,/^handle(?=[A-Z])/,/^is(?=[A-Z])/,/^has(?=[A-Z])/];export{j as a};
|
|
2
|
-
//# sourceMappingURL=chunk-E3ADDB43.js.map
|
package/dist/chunk-F6IXELII.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import{b as u}from"./chunk-ULHLDOD6.js";import{l as I}from"./chunk-THB6AM3V.js";import{a as m,c as F,k as _}from"./chunk-SGTKURU6.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as E}from"./chunk-7S5E7KWT.js";var D=_({kind:"file-dependency-graph",serialize:e=>JSON.stringify(e),deserialize:w}),P=E("file-dep-graph",{clearGroups:["whole-project"]});function T(e,r){return P.get(e,r??"",()=>{let t=new Set(S(e,{includeIgnored:!1})),i=0,o=0,n=u("file-dep-graph.source-imports",()=>{let a=C(e,t,r);return i=a.files.length,o=a.edges.length,a},()=>({scope:r??null,files:i,edges:o})),g=F(e),c=g?G(g,n.fingerprint):null,y=!1,p=0,f=0;return u("file-dep-graph.product",()=>{let a=O(r);if(c){let s=D.read(e,a,c);if(s?.sourceImportFingerprint===n.fingerprint){y=!0;let l=b(s);return f=l.size,l}}let d=new Map,h=(s,l)=>M(e,d,t,s,l);u("file-dep-graph.scip-edges",()=>{for(let s of k(e,r))p+=1,h(s.from_file,s.to_file)},()=>({scope:r??null,edges:p}));for(let s of n.edges)h(s.fromFile,s.toFile);return f=d.size,c&&D.write(e,a,c,{sourceImportFingerprint:n.fingerprint,sourceFileCount:n.files.length,sourceEdgeCount:n.edges.length,scipEdgeCount:p,graph:A(d)}),d},()=>({scope:r??null,available:c!==null,hit:y,files:n.files.length,sourceEdges:n.edges.length,scipEdges:p,graphFiles:f,sourceImportFingerprint:n.fingerprint}))})}function C(e,r,t){let i=[],o=[];for(let n of r)if(!(t&&!n.includes(t))){i.push(n);for(let g of I(e,n))g.sourcePath&&o.push({fromFile:n,toFile:g.sourcePath})}return{files:i,edges:o,fingerprint:N(i,o)}}function N(e,r){let t=r.map(i=>`${i.fromFile}\0${i.toFile}`).sort();return m(JSON.stringify({files:e,edges:t}))}function O(e){return e??"<all>"}function G(e,r){return m(JSON.stringify({projectFingerprint:e,sourceImportFingerprint:r}))}function A(e){return[...e].map(([r,t])=>[r,[...t]])}function b(e){return new Map(e.graph.map(([r,t])=>[r,new Set(t)]))}function w(e){let r=JSON.parse(e);return J(r)?r:null}function J(e){if(!e||typeof e!="object")return!1;let r=e;return typeof r.sourceImportFingerprint=="string"&&typeof r.sourceFileCount=="number"&&typeof r.sourceEdgeCount=="number"&&typeof r.scipEdgeCount=="number"&&Array.isArray(r.graph)&&r.graph.every(R)}function R(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="string"&&Array.isArray(e[1])&&e[1].every(r=>typeof r=="string")}function k(e,r){let t=r?`AND d1.relative_path LIKE '%${r}%'`:"";return e.all(`SELECT DISTINCT
|
|
2
|
-
d1.relative_path AS from_file,
|
|
3
|
-
d2.relative_path AS to_file
|
|
4
|
-
FROM mentions m
|
|
5
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
6
|
-
JOIN documents d1 ON c.document_id = d1.id
|
|
7
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
8
|
-
JOIN (
|
|
9
|
-
SELECT m2.symbol_id, c2.document_id
|
|
10
|
-
FROM mentions m2
|
|
11
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
12
|
-
WHERE m2.role = 1
|
|
13
|
-
GROUP BY m2.symbol_id
|
|
14
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
15
|
-
JOIN documents d2 ON sym_def.document_id = d2.id
|
|
16
|
-
WHERE d1.id != d2.id
|
|
17
|
-
AND m.role != 1
|
|
18
|
-
${e.pathExclusionsFor("d1","d2")}
|
|
19
|
-
${t}`)}function M(e,r,t,i,o){if(i===o||e.isIgnored(i)||e.isIgnored(o)||!t.has(o))return;let n=r.get(i);n||(n=new Set,r.set(i,n)),n.add(o)}export{T as a};
|
|
20
|
-
//# sourceMappingURL=chunk-F6IXELII.js.map
|
package/dist/chunk-FMGVZBS2.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as d,c as m}from"./chunk-WUOB4DHH.js";import{a as B}from"./chunk-F6IXELII.js";function F(s,e={}){let{scope:r,maxDepth:c=10}=e,n=B(s,r),i=[],a=new Set,l=new Set,f=[];function y(t,o){if(o>c)return;if(l.has(t)){let h=f.indexOf(t);if(h!==-1){let u=f.slice(h).concat(t),g=u.indexOf(u.reduce((x,$)=>x<$?x:$)),p=[...u.slice(g,-1),...u.slice(0,g),u[g]],S=p.join(" -> ");b.has(S)||(b.add(S),i.push({path:p,kind:R(p)}))}return}if(a.has(t))return;a.add(t),l.add(t),f.push(t);let k=n.get(t);if(k)for(let h of k)y(h,o+1);f.pop(),l.delete(t)}let b=new Set;for(let t of n.keys())a.has(t)||y(t,0);return i.sort((t,o)=>t.kind!==o.kind?t.kind==="real"?-1:1:t.path.length-o.path.length),i}function R(s){for(let c of s){let n=d(c);if(n==="test"||n==="barrel"||n==="entry")return"module-hierarchy"}if(s.length!==3)return"real";let[e,r]=s;return!e||!r?"real":m(e)||m(r)||C(e,r)||C(r,e)||D(e,r)||D(r,e)||d(e)==="entry"||d(r)==="entry"?"module-hierarchy":"real"}function C(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=e.replace(/\.rs$/,"/");return s.startsWith(r)?!s.slice(r.length).includes("/"):!1}function D(s,e){if(!/\.rs$/.test(s)||!/\.rs$/.test(e))return!1;let r=s.replace(/\.rs$/,""),c=e.replace(/\.rs$/,"");if(r===c+"_tests"||r===c+"/tests")return!0;let n=s.split("/"),i=e.split("/");if(n.length===i.length&&n.includes("tests")&&i.includes("src")){let a=n[n.length-1],l=i[i.length-1];if(a&&a===l)return!0}return!1}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-FMGVZBS2.js.map
|
package/dist/chunk-GG5LHT27.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-HRDSU5FN.js";import{b as d}from"./chunk-WUOB4DHH.js";import{a as h}from"./chunk-F6IXELII.js";import{existsSync as R}from"fs";import{join as $}from"path";function U(t){return C.test(t)}var C=/(?:^|\/)(?:package-lock\.json|pnpm-lock\.yaml|yarn\.lock|Cargo\.lock|CHANGELOG(?:\.[a-z]+)?|.*\.map)$|(?:^|\/)(?:dist|build|out|node_modules|docs\/plans)\//i;function X(t,e,n={}){let{minTogether:s=4,minConfidence:o=.6,limit:a=30,maxFilesPerCommit:l=20}=n,g=S(t),r=g.commitHistory(),c=e!==void 0,p=g.coChangePairs({minTogether:c?Math.min(s,2):s,minConfidence:c?0:o,maxFilesPerCommit:l});if(!r||!p)return{available:!1,commitsAnalyzed:0,findings:[]};let A=h(t),E=x(t),k=L(t,A,E),w=n.includeLinked===!0||c,u=[];for(let i of p){if(C.test(i.fileA)||C.test(i.fileB)||!y(t,i.fileA)||!y(t,i.fileB)||c&&!i.fileA.includes(e)&&!i.fileB.includes(e)||!c&&(d(i.fileA)==="test"||d(i.fileB)==="test"||j(i.fileA,i.fileB)))continue;let m=k(i.fileA,i.fileB);if(!w&&m)continue;let f=v(i.fileA,i.fileB),b=F(i,f,m);if(u.push({...i,structurallyLinked:m,partnerClass:f.partnerClass,partnerClassReasons:f.reasons,...b?{declaredCouplingSuggestion:b}:{}}),u.length>=a)break}return{available:!0,commitsAnalyzed:r.commits.length,findings:u}}function y(t,e){return R($(t.config.projectRoot,e))}function v(t,e){let n=P(t),s=P(e),o=[],a=r=>{o.includes(r)||o.push(r)},l=(r,c)=>n.tags.has(r)&&s.tags.has(c)||n.tags.has(c)&&s.tags.has(r);if(l("doc","code"))return a("one side is documentation and the other is executable source"),{partnerClass:"doc-code",reasons:o};if(n.tags.has("test")||s.tags.has("test"))return a("one side is classified as a test file"),{partnerClass:"test-code",reasons:o};if(l("schema","script"))return a("schema or contract file changes with a script or generated-code path"),{partnerClass:"schema-script",reasons:o};if(l("model","view"))return a("model or state path changes with a view or component path"),{partnerClass:"model-view",reasons:o};if(l("config","code"))return a("configuration file changes with executable source"),{partnerClass:"config-code",reasons:o};let g=q(n.tokens,s.tokens).filter(r=>!G.has(r));return T(t,e)||g.length>=2?(a(T(t,e)?"both files live in the same directory":`files share feature tokens: ${g.slice(0,4).join(", ")}`),{partnerClass:"same-feature",reasons:o}):(a("no specific relationship pattern matched"),{partnerClass:"unknown",reasons:o})}function F(t,e,n){if(n||t.together<4||t.confidence<.75||t.commitScope==="broad-sweep"||t.recency==="stale"||!M.has(e.partnerClass))return;let s=[t.fileA,t.fileB].sort();return{name:`co-change ${e.partnerClass}: ${Z(s)}`,files:s,reason:`${e.partnerClass} pair changed together ${t.together}x with ${Math.round(t.confidence*100)}% confidence; declare it if future edits should require both sides.`}}function L(t,e=h(t),n=x(t)){return(s,o)=>_(e,n,s,o)}function j(t,e){let n=t.lastIndexOf("/"),s=e.lastIndexOf("/");if(t.slice(0,n)!==e.slice(0,s))return!1;let o=t.slice(n+1).split(".")[0],a=e.slice(s+1).split(".")[0];return o!==""&&o===a}function x(t){return(t.config.declaredCouplings??[]).filter(e=>Array.isArray(e.files)&&e.files.length>=2).map(e=>new Set(e.files))}function _(t,e,n,s){return t.get(n)?.has(s)===!0||t.get(s)?.has(n)===!0?!0:e.some(o=>o.has(n)&&o.has(s))}var I=/(?:^|\/)(?:readme|docs?|guides?|adr|architecture|design)(?:\/|$)|\.(?:md|mdx|rst|adoc|txt)$/i,N=/(?:^|\/)(?:\.[a-z0-9-]+rc|config|configs|settings|\.github)(?:\/|$)|(?:^|\/)(?:package\.json|tsconfig(?:\.[^.]+)?\.json|vite\.config\.[cm]?[jt]s|rollup\.config\.[cm]?[jt]s|eslint\.config\.[cm]?[jt]s)$|\.(?:json|ya?ml|toml|ini|env)$/i,D=/(?:^|\/)(?:schemas?|contracts?|migrations?|models?|types?)(?:\/|$)|(?:^|\/)[^/]*(?:schema|contract|migration|model|types?)[^/]*|(?:\.schema)?\.(?:graphql|gql|proto|prisma)$/i,O=/(?:^|\/)(?:scripts?|bin|tools?|tasks?|generators?|codegen|migrations?|seeds?)(?:\/|$)|(?:^|\/)[^/]*(?:generate|codegen|migrate|seed|script)[^/]*\.[cm]?[jt]s$/i,B=/(?:^|\/)(?:models?|entities|domain|state|stores?|reducers?)(?:\/|$)|(?:^|\/)[^/]*(?:model|entity|state|store|reducer|viewmodel)[^/]*\.[^.]+$/i,z=/(?:^|\/)(?:views?|pages?|components?|screens?|routes?|templates?)(?:\/|$)|(?:^|\/)[^/]*(?:view|page|component|screen|template)[^/]*\.[^.]+$|\.(?:vue|svelte|tsx|jsx)$/i,M=new Set(["doc-code","config-code","schema-script","model-view","test-code"]),G=new Set(["src","lib","app","test","tests","spec","index","main","utils","util","types","type","config","docs","doc"]);function P(t){let e=t.replace(/\\/g,"/"),n=new Set;return I.test(e)&&n.add("doc"),N.test(e)&&n.add("config"),D.test(e)&&n.add("schema"),O.test(e)&&n.add("script"),B.test(e)&&n.add("model"),z.test(e)&&n.add("view"),d(e)==="test"&&n.add("test"),!n.has("doc")&&!n.has("config")&&n.add("code"),{tags:n,tokens:H(e)}}function T(t,e){let n=t.lastIndexOf("/"),s=e.lastIndexOf("/"),o=n>=0?t.slice(0,n):"",a=s>=0?e.slice(0,s):"";return o!==""&&o===a}function H(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(e=>e.toLowerCase()).filter(e=>e.length>=2)}function q(t,e){let n=new Set(e);return[...new Set(t.filter(s=>n.has(s)))].sort()}function Z(t){return t.map(e=>e.split("/").pop()?.replace(/\.[^.]+$/,"")||e).join(" + ")}export{U as a,X as b,v as c,F as d,L as e};
|
|
2
|
-
//# sourceMappingURL=chunk-GG5LHT27.js.map
|
package/dist/chunk-H7JF2CKK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as ie}from"./chunk-N25HPUOK.js";import{a as oe}from"./chunk-FX6ULETZ.js";import{a as ee}from"./chunk-V5FGK3DZ.js";import{a as re}from"./chunk-7IWIMNHI.js";import{a as te}from"./chunk-JNMLBL36.js";import{a as K}from"./chunk-YFQIKYOP.js";import{a as Z}from"./chunk-E3ADDB43.js";import{a as p}from"./chunk-B32FX5KB.js";import{a as Q}from"./chunk-RUV5IY25.js";import{a as Y}from"./chunk-T3AEVJBG.js";import{a as X}from"./chunk-C2QSK7E7.js";import{d as G}from"./chunk-Z2LDWIJV.js";import{a as q}from"./chunk-JJ5SAWBT.js";import{a as j}from"./chunk-ZNWWVYQL.js";import{a as W}from"./chunk-GKB4JJDU.js";import{a as U}from"./chunk-62ULXMQ7.js";import{a as T,b as O}from"./chunk-ROGZXWN2.js";import{b as z}from"./chunk-GG5LHT27.js";import{a as I}from"./chunk-HRDSU5FN.js";import{a as J}from"./chunk-HHOMJCP5.js";import{a as N}from"./chunk-FMGVZBS2.js";import{f as A,g as k}from"./chunk-WUOB4DHH.js";function m(e){return e.scoreCount??e.count}function M(e){let r=Te(e),{breakdown:t,pressure:i}=Me(e),o=ae(t,"risk"),a=ae(t,"hygiene");return{score:Math.min(o,a),riskScore:o,hygieneScore:a,scoreBreakdown:t,overview:{documents:e.statsResult.documents,symbols:e.statsResult.symbols,indexSizeBytes:e.statsResult.indexSizeBytes},findings:{deadSymbols:e.dead.count,deadLoc:e.dead.loc,isolatedSymbols:e.isolated.count,isolatedLoc:e.isolated.loc,cycles:e.realCycleCount,similarPairs:e.similarCount,reactComponentDuplicatePairs:e.reactComponentDuplicates.count,reactHookCandidatePairs:e.reactHookCandidates.count,reactHookCandidateScoreCount:m(e.reactHookCandidates),reactLargeComponentPressureFiles:e.reactLargeComponentPressure.count,vueComponentDuplicatePairs:e.vueComponentDuplicates.count,vueComposableCandidatePairs:e.vueComposableCandidates.count,vueComposableCandidateScoreCount:m(e.vueComposableCandidates),vueLargeViewPressureFiles:e.vueLargeViewPressure.count,extractionCandidates:e.extractCount,wrappers:e.wrappers.count,wrapperScoreCount:m(e.wrappers),passthroughs:e.passthroughs.count,staleTypes:e.stale.count,driftedFiles:e.drift.count,complexityHotspotCount:e.complexity.extremeCount,hiddenCouplingPairs:e.gitEvidence?.hiddenCoupling.pairCount??null,hiddenCouplingScoreCount:e.gitEvidence?.hiddenCoupling.scoreCount??null},axes:Ee(e),validation:ke(e),suppressions:e.suppressions,actions:r,pressure:i,topComplexity:e.complexity.top,warnings:e.warnings.length>0?e.warnings:void 0}}function Ee(e){return{deletable:{loc:e.dead.loc+e.isolated.loc,symbols:e.dead.count+e.isolated.count},cycles:{count:e.realCycleCount},changeAmplification:e.gitEvidence?.amplification??null,hiddenCoupling:e.gitEvidence?.hiddenCoupling??null,churnWeightedComplexity:Ae(e),evidenceQuality:{graphFindings:e.dead.count+e.isolated.count+e.realCycleCount,heuristicFindings:e.similarCount+e.reactComponentDuplicates.count+e.reactHookCandidates.count+e.reactLargeComponentPressure.count+e.vueComponentDuplicates.count+e.vueComposableCandidates.count+e.vueLargeViewPressure.count+e.extractCount+e.wrappers.count+e.passthroughs.count+e.stale.count+e.drift.count,userSuppressed:e.suppressions?.total??0}}}function Ae(e){let r=e.gitEvidence?.fileStats;return r?e.complexity.top.map(t=>{let i=t.file?r[t.file]?.changes??0:0;return{...t,changes:i,weighted:d(t.score*Math.log2(1+i))}}).sort((t,i)=>i.weighted-t.weighted):null}function ke(e){let r=e.gitEvidence?.fileStats;if(!r)return null;let t={dead:e.dead.files??[],isolated:e.isolated.files??[],wrappers:e.wrappers.files??[],passthroughs:e.passthroughs.files??[],stale:e.stale.files??[],reactComponents:e.reactComponentDuplicates.files??[],reactHooks:e.reactHookCandidates.files??[],reactLargeComponents:e.reactLargeComponentPressure.files??[],vueComponents:e.vueComponentDuplicates.files??[],vueComposables:e.vueComposableCandidates.files??[],vueLargeViews:e.vueLargeViewPressure.files??[]},i=new Set(Object.values(t).flat()),o=0,a=0,n=0;for(let[b,g]of Object.entries(r))i.has(b)?o+=g.fixChanges:(a+=g.fixChanges,n+=1);let u=i.size>0?d(o/i.size):0,h=n>0?d(a/n):0,S={};for(let[b,g]of Object.entries(t)){let f=new Set(g);if(f.size===0)continue;let H=0;for(let L of f)H+=r[L]?.fixChanges??0;let x=d(H/f.size);S[b]={flaggedFiles:f.size,fixDensity:x,lift:h>0?d(x/h):null}}return{flaggedFiles:i.size,flaggedFixDensity:u,baselineFixDensity:h,ratio:i.size>0&&h>0?d(u/h):null,byCategory:S}}function d(e){return Math.round(e*100)/100}function se(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/0+$/,"").replace(/\.$/,"")}function P(e,r="existing shared infrastructure discount"){let t=m(e);return Math.abs(t-e.count)<.01?"":` (${se(t)} score-weighted after ${r})`}function v(e,r){let t=m(e),i=`${e.count} ${r}`;return Math.abs(t-e.count)<.01?i:`${i} (${se(t)} score-weighted)`}function Te(e){let r=[];if(e.dead.count>0&&r.push({category:"Dead code",evidence:"graph-fact",description:`${e.dead.count} symbols with zero references anywhere \u2014 safe to delete`,effort:"low",impact:"high",count:e.dead.count,locRecoverable:e.dead.loc}),e.isolated.count>0&&r.push({category:"Isolated symbols",evidence:"graph-fact",description:`${e.isolated.count} symbols completely disconnected from the codebase graph`,effort:"low",impact:"medium",count:e.isolated.count,locRecoverable:e.isolated.loc}),e.realCycleCount>0&&r.push({category:"Circular dependencies",evidence:"graph-fact",description:`${e.realCycleCount} cycle(s) \u2014 break with dependency inversion or module restructuring`,effort:"medium",impact:"high",count:e.realCycleCount,locRecoverable:0}),e.similarCount>0&&r.push({category:"Similar functions",evidence:"heuristic",description:`${e.similarCount} pairs with real logic overlap (beyond shared imports) \u2014 consolidation candidates`,effort:"medium",impact:"medium",count:e.similarCount,locRecoverable:0}),e.reactComponentDuplicates.count>0&&r.push({category:"Duplicated React components",evidence:"heuristic",description:`${e.reactComponentDuplicates.count} React component pair(s) share JSX structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.reactComponentDuplicates.count,locRecoverable:e.reactComponentDuplicates.loc}),e.reactHookCandidates.count>0&&r.push({category:"Duplicated React hook behavior",evidence:"heuristic",description:`${e.reactHookCandidates.count} React component pair(s) share state/effect/request behavior${P(e.reactHookCandidates)} \u2014 extract or reuse a hook`,effort:"medium",impact:"medium",count:e.reactHookCandidates.count,locRecoverable:e.reactHookCandidates.loc}),e.reactLargeComponentPressure.count>0&&r.push({category:"Large React components",evidence:"heuristic",description:`${e.reactLargeComponentPressure.count} React component(s) concentrate JSX/behavior pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.reactLargeComponentPressure.count,locRecoverable:0}),e.vueComponentDuplicates.count>0&&r.push({category:"Duplicated Vue components",evidence:"heuristic",description:`${e.vueComponentDuplicates.count} Vue component pair(s) share template structure \u2014 extract or reuse the shared UI concept`,effort:"medium",impact:"medium",count:e.vueComponentDuplicates.count,locRecoverable:e.vueComponentDuplicates.loc}),e.vueComposableCandidates.count>0&&r.push({category:"Duplicated Vue behavior",evidence:"heuristic",description:`${e.vueComposableCandidates.count} Vue component pair(s) share state/effect/request behavior${P(e.vueComposableCandidates)} \u2014 extract or reuse a composable`,effort:"medium",impact:"medium",count:e.vueComposableCandidates.count,locRecoverable:e.vueComposableCandidates.loc}),e.vueLargeViewPressure.count>0&&r.push({category:"Large Vue views",evidence:"heuristic",description:`${e.vueLargeViewPressure.count} Vue file(s) concentrate template/script/style pressure \u2014 split by reason to change`,effort:"medium",impact:"medium",count:e.vueLargeViewPressure.count,locRecoverable:0}),e.extractCount>0&&r.push({category:"Extraction candidates",evidence:"heuristic",description:`${e.extractCount} large functions with isolated callee clusters \u2014 review same-file or feature-local extraction seams`,effort:"medium",impact:"medium",count:e.extractCount,locRecoverable:0}),e.wrappers.count>0&&r.push({category:"Wrapper functions",evidence:"heuristic",description:`${e.wrappers.count} single-consumer symbols${P(e.wrappers,"boundary-evidence discount")} \u2014 inline direct wrappers or review boundary signals`,effort:"low",impact:"low",count:e.wrappers.count,locRecoverable:e.wrappers.loc}),e.passthroughs.count>0&&r.push({category:"Passthrough functions",evidence:"heuristic",description:`${e.passthroughs.count} functions that just forward to one callee \u2014 unnecessary indirection`,effort:"low",impact:"low",count:e.passthroughs.count,locRecoverable:e.passthroughs.loc}),e.stale.count>0){let o=[];e.stale.unused>0&&o.push(`${e.stale.unused} unused`),e.stale.singleUse>0&&o.push(`${e.stale.singleUse} single-consumer (not in types file)`),r.push({category:"Stale abstractions",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove unused abstractions; review single-consumer ownership before moving or inlining`,effort:"low",impact:"medium",count:e.stale.count,locRecoverable:e.stale.loc})}if(e.drift.count>0){let o=[];e.drift.unusedImports>0&&o.push(`${e.drift.unusedImports} unused imports`),e.drift.layerViolations>0&&o.push(`${e.drift.layerViolations} layer violations`),r.push({category:"Structural drift",evidence:"heuristic",description:`${o.join(", ")} \u2014 remove direct drift; review signal drift against layer ownership`,effort:e.drift.layerViolations>0?"medium":"low",impact:e.drift.layerViolations>0?"medium":"low",count:e.drift.count,locRecoverable:0})}if(e.gitEvidence&&e.gitEvidence.hiddenCoupling.pairCount>0){let o=e.gitEvidence.hiddenCoupling.top[0];r.push({category:"Hidden coupling",evidence:"change-graph",description:`${e.gitEvidence.hiddenCoupling.pairCount} file pair(s) co-change without a structural link`+P({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:e.gitEvidence.hiddenCoupling.scoreCount},"broad/stale-history discount")+(o?` (e.g. ${o.fileA} \u2194 ${o.fileB})`:"")+" \u2014 name the shared concept or enforce the sync",effort:"medium",impact:"high",count:e.gitEvidence.hiddenCoupling.pairCount,locRecoverable:0})}let t={high:3,medium:2,low:1},i={low:3,medium:2,high:1};return r.sort((o,a)=>{let n=t[o.impact]*i[o.effort];return t[a.impact]*i[a.effort]-n}),r}var ne={"dead-code":"risk",isolated:"risk",cycles:"risk",complexity:"risk","hidden-coupling":"risk","cycles-pressure":"risk","complexity-pressure":"risk","hidden-coupling-pressure":"risk",similar:"hygiene","react-component-duplicates":"hygiene","react-hook-candidates":"hygiene","react-large-component-pressure":"hygiene","vue-component-duplicates":"hygiene","vue-composable-candidates":"hygiene","vue-large-view-pressure":"hygiene",extract:"hygiene",wrappers:"hygiene",passthroughs:"hygiene","stale-abstractions":"hygiene",drift:"hygiene","similar-pressure":"hygiene","react-component-duplicates-pressure":"hygiene","react-hook-candidates-pressure":"hygiene","react-large-component-pressure-pressure":"hygiene","vue-component-duplicates-pressure":"hygiene","vue-composable-candidates-pressure":"hygiene","vue-large-view-pressure-pressure":"hygiene","extract-pressure":"hygiene","wrappers-pressure":"hygiene","passthroughs-pressure":"hygiene","stale-abstractions-pressure":"hygiene","drift-pressure":"hygiene"};function ae(e,r){let t=e.filter(i=>i.kind===r).reduce((i,o)=>i+o.points,0);return Math.max(0,Math.min(100,100-t))}function Me(e){let r=Math.max(e.statsResult.documents,1),t=Math.max(e.statsResult.symbols,1),i=[],o=[],a=(l,y,C)=>{y>0&&i.push({axis:l,points:y,detail:C,kind:ne[l]??"hygiene"})},n=(l,y,C,ye,we,Pe,Re)=>{let w=Math.max(ye,1);if(C<=w)return;let D=C/w,E=Math.min(we,Math.ceil(Math.log2(D)*Pe));if(E<=0)return;let De=ne[l]??"hygiene";o.push({axis:l,category:y,kind:De,count:C,threshold:d(w),ratio:d(D),extraPenalty:E}),a(l,E,`${C} ${Re} exceed pressure threshold ${d(w)} (${d(D)}x)`)},u=e.dead.count/t;a("dead-code",Math.min(20,Math.round(u*200)),`${e.dead.count} dead symbols (${e.dead.loc} LOC deletable)`);let h=e.isolated.count/t;a("isolated",Math.min(10,Math.round(h*200)),`${e.isolated.count} isolated symbols (${e.isolated.loc} LOC deletable)`),a("cycles",Math.min(15,e.realCycleCount*5),`${e.realCycleCount} real dependency cycle(s)`);let S=e.similarCount/t*1e3;a("similar",Math.min(10,Math.round(S)),`${e.similarCount} similar function pair(s)`);let b=e.reactComponentDuplicates.count/r*1e3;a("react-component-duplicates",Math.min(10,Math.round(b)),`${e.reactComponentDuplicates.count} duplicated React component pair(s)`);let g=m(e.reactHookCandidates),f=g/r*1e3;a("react-hook-candidates",Math.min(10,Math.round(f)),v(e.reactHookCandidates,"duplicated React behavior pair(s)"));let H=e.reactLargeComponentPressure.count/r*1e3;a("react-large-component-pressure",Math.min(5,Math.round(H/2)),`${e.reactLargeComponentPressure.count} large React component pressure file(s)`);let x=e.vueComponentDuplicates.count/r*1e3;a("vue-component-duplicates",Math.min(10,Math.round(x)),`${e.vueComponentDuplicates.count} duplicated Vue component pair(s)`);let L=m(e.vueComposableCandidates),He=L/r*1e3;a("vue-composable-candidates",Math.min(10,Math.round(He)),v(e.vueComposableCandidates,"duplicated Vue behavior pair(s)"));let xe=e.vueLargeViewPressure.count/r*1e3;a("vue-large-view-pressure",Math.min(5,Math.round(xe/2)),`${e.vueLargeViewPressure.count} large Vue view pressure file(s)`);let _=m(e.wrappers);a("wrappers",Math.min(3,_),v(e.wrappers,"wrapper candidate(s)"));let F=m(e.passthroughs);a("passthroughs",Math.min(3,F),v(e.passthroughs,"passthrough candidate(s)")),a("stale-abstractions",Math.min(8,e.stale.unused),`${e.stale.unused} unused stale abstraction(s); ${e.stale.singleUse} single-consumer signal(s)`);let Le=e.drift.direct/r;if(a("drift",Math.min(5,Math.round(Le*50)),`${e.drift.direct} direct drift finding(s); ${e.drift.signal} signal drift finding(s)`),a("complexity",Math.min(5,e.complexity.extremeCount*2),`${e.complexity.extremeCount} extreme complexity hotspot(s)`),e.gitEvidence){let l=e.gitEvidence.hiddenCoupling.scoreCount;a("hidden-coupling",Math.min(5,Math.ceil(l/10)),v({count:e.gitEvidence.hiddenCoupling.pairCount,scoreCount:l},"co-changing pair(s) without a structural link"))}if(n("cycles-pressure","Circular dependencies",e.realCycleCount,3,10,3,"cycle(s)"),n("complexity-pressure","Extreme complexity",e.complexity.extremeCount,3,5,2,"extreme complexity hotspot(s)"),e.gitEvidence){let l=e.gitEvidence.hiddenCoupling.scoreCount;n("hidden-coupling-pressure","Hidden coupling",l,50,10,4,"score-weighted co-changing pair(s)")}return n("similar-pressure","Similar functions",e.similarCount,Math.max(50,t*.01),8,4,"similar function pair(s)"),n("react-component-duplicates-pressure","Duplicated React components",e.reactComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated React component pair(s)"),n("react-hook-candidates-pressure","Duplicated React hook behavior",g,Math.max(10,r*.01),8,4,"duplicated React behavior pair(s)"),n("react-large-component-pressure-pressure","Large React components",e.reactLargeComponentPressure.count,Math.max(10,r*.01),4,2,"large React component pressure file(s)"),n("vue-component-duplicates-pressure","Duplicated Vue components",e.vueComponentDuplicates.count,Math.max(10,r*.01),8,4,"duplicated Vue component pair(s)"),n("vue-composable-candidates-pressure","Duplicated Vue behavior",L,Math.max(10,r*.01),8,4,"duplicated Vue behavior pair(s)"),n("vue-large-view-pressure-pressure","Large Vue views",e.vueLargeViewPressure.count,Math.max(10,r*.01),4,2,"large Vue view pressure file(s)"),n("extract-pressure","Extraction candidates",e.extractCount,Math.max(50,t*.01),4,2,"extraction candidate(s)"),n("wrappers-pressure","Wrapper functions",_,50,4,2,"wrapper candidate(s)"),n("passthroughs-pressure","Passthrough functions",F,50,4,2,"passthrough candidate(s)"),n("stale-abstractions-pressure","Single-consumer stale abstraction signals",e.stale.singleUse,Math.max(50,t*.02),4,2,"single-consumer stale abstraction signal(s)"),n("drift-pressure","Structural drift signals",e.drift.signal,Math.max(10,r*.1),4,2,"signal drift finding(s)"),{breakdown:i,pressure:o}}import{getHeapStatistics as Be}from"v8";var Ve=64*1024*1024;function B(){let e=globalThis.gc;if(!e)return;let r=Be();r.heap_size_limit-r.used_heap_size<Ve||e()}var $e=50,_e=25e3,Fe=2500,ce=2500,ue=50,Ie=10,ze=["overview","dead","isolated","cycles","similar","react-component-duplicates","react-hook-candidates","react-large-component-pressure","vue-component-duplicates","vue-composable-candidates","vue-large-view-pressure","extract-candidates","wrapper-candidates","passthrough-candidates","stale-abstractions","drift","complexity-hotspots","git-evidence","suppressions"],pe={overview:(e,r,t,i)=>({phase:"overview",statsResult:i,warnings:t.warnings}),dead:(e,r,t)=>({phase:"dead",dead:Ue(e,r,t)}),isolated:(e,r,t)=>({phase:"isolated",isolated:We(e,r,t)}),cycles:(e,r,t)=>({phase:"cycles",realCycleCount:qe(e,r,t)}),similar:(e,r,t)=>({phase:"similar",similarCount:je(e,r,t)}),"react-component-duplicates":(e,r,t)=>({phase:"react-component-duplicates",reactComponentDuplicates:Ye(e,r,t)}),"react-hook-candidates":(e,r,t)=>({phase:"react-hook-candidates",reactHookCandidates:Xe(e,r,t)}),"react-large-component-pressure":(e,r,t)=>({phase:"react-large-component-pressure",reactLargeComponentPressure:Qe(e,r,t)}),"vue-component-duplicates":(e,r,t)=>({phase:"vue-component-duplicates",vueComponentDuplicates:Je(e,r,t)}),"vue-composable-candidates":(e,r,t)=>({phase:"vue-composable-candidates",vueComposableCandidates:Ke(e,r,t)}),"vue-large-view-pressure":(e,r,t)=>({phase:"vue-large-view-pressure",vueLargeViewPressure:Ze(e,r,t)}),"extract-candidates":(e,r,t)=>({phase:"extract-candidates",extractCount:Ge(e,r,t)}),"wrapper-candidates":(e,r,t)=>({phase:"wrapper-candidates",wrappers:et(e,r,t)}),"passthrough-candidates":(e,r,t)=>({phase:"passthrough-candidates",passthroughs:tt(e,r,t)}),"stale-abstractions":(e,r,t)=>({phase:"stale-abstractions",stale:rt(e,r,t)}),drift:(e,r,t)=>({phase:"drift",drift:nt(e,r,t)}),"complexity-hotspots":(e,r,t)=>({phase:"complexity-hotspots",complexity:at(e,r,t)}),"git-evidence":(e,r,t)=>({phase:"git-evidence",gitEvidence:it(e,t)}),suppressions:(e,r,t)=>({phase:"suppressions",suppressions:ot(e,t)})};function qt(e,r={}){return me(e,r.full!==!1,(t,i)=>{let o=Oe(e,r.scope,t,i);return M(o)})}function jt(e,r,t={}){return Ne(e,[r],t)[0]}function Ne(e,r,t={}){return me(e,t.full!==!1,(i,o)=>{let a={...o,releaseCachesBetweenPhases:!1};return r.map(n=>pe[n](e,t.scope,a,i))})}function me(e,r,t){let i=X(e),o=st(i,r);try{return t(i,o)}finally{T(e,{semanticProvider:!0}),B()}}function Gt(e){return M(he(e))}function he(e){let r=c(e,"overview");return{statsResult:r.statsResult,warnings:r.warnings,dead:c(e,"dead").dead,isolated:c(e,"isolated").isolated,realCycleCount:c(e,"cycles").realCycleCount,similarCount:c(e,"similar").similarCount,reactComponentDuplicates:c(e,"react-component-duplicates").reactComponentDuplicates,reactHookCandidates:c(e,"react-hook-candidates").reactHookCandidates,reactLargeComponentPressure:c(e,"react-large-component-pressure").reactLargeComponentPressure,vueComponentDuplicates:c(e,"vue-component-duplicates").vueComponentDuplicates,vueComposableCandidates:c(e,"vue-composable-candidates").vueComposableCandidates,vueLargeViewPressure:c(e,"vue-large-view-pressure").vueLargeViewPressure,extractCount:c(e,"extract-candidates").extractCount,wrappers:c(e,"wrapper-candidates").wrappers,passthroughs:c(e,"passthrough-candidates").passthroughs,stale:c(e,"stale-abstractions").stale,drift:c(e,"drift").drift,complexity:c(e,"complexity-hotspots").complexity,gitEvidence:le(e,"git-evidence")?.gitEvidence??null,suppressions:le(e,"suppressions")?.suppressions??null}}function le(e,r){return e.find(t=>t.phase===r)}function c(e,r){let t=e.find(i=>i.phase===r);if(!t)throw new Error(`Missing health phase result: ${r}`);return t}function Oe(e,r,t,i){return he(ze.map(o=>pe[o](e,r,i,t)))}function Ue(e,r,t){return s(e,t,"dead",()=>{let i=O(e,{scope:r,...p.dead,scanLimit:t.candidateScanLimit});return R(lt(e,i.symbols))})}function We(e,r,t){return s(e,t,"isolated",()=>{let i=q(e,{scope:r,...p.isolated,scanLimit:t.candidateScanLimit});return R(dt(e,i))})}function qe(e,r,t){return s(e,t,"cycles",()=>N(e,{scope:r}).filter(o=>o.kind==="real").length)}function je(e,r,t){let i=s(e,t,"similar",()=>G(e,{scope:r,...p.similar,scanLimit:t.candidateScanLimit}));return Math.min(i,t.candidateResultLimit)}function Ge(e,r,t){return s(e,t,"extract-candidates",()=>W(e,{scope:r,...p.extract,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}).length)}function Ye(e,r,t){return s(e,t,"react-component-duplicates",()=>{let i=K(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Xe(e,r,t){return s(e,t,"react-hook-candidates",()=>{let i=Z(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,mt)})}function Qe(e,r,t){return s(e,t,"react-large-component-pressure",()=>{let i=ee(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return pt(i)})}function Je(e,r,t){return s(e,t,"vue-component-duplicates",()=>{let i=te(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return V(i)})}function Ke(e,r,t){return s(e,t,"vue-composable-candidates",()=>{let i=re(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return fe(i,ht)})}function Ze(e,r,t){return s(e,t,"vue-large-view-pressure",()=>{let i=ie(e,{scope:r,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return R(i)})}function et(e,r,t){return s(e,t,"wrapper-candidates",()=>{let i=Q(e,{scope:r,...p.wrappers,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return ge(i,gt)})}function tt(e,r,t){return s(e,t,"passthrough-candidates",()=>{let i=j(e,{scope:r,...p.passthroughs,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit});return ge(i,ft)})}function rt(e,r,t){return s(e,t,"stale-abstractions",()=>{let i=Y(e,{scope:r,...p.stale,limit:t.candidateResultLimit,scanLimit:t.candidateScanLimit}),o=i.filter(a=>a.consumers===0).length;return{count:i.length,loc:i.reduce((a,n)=>a+n.loc,0),files:[...new Set(i.map(a=>a.file))],unused:o,singleUse:i.length-o}})}function it(e,r){return s(e,r,"git-evidence",()=>{let t=I(e),i=t.fileChurn();if(!i)return null;let o=z(e,void 0,{limit:r.candidateResultLimit}),a={};for(let[n,u]of i)a[n]={changes:u.changes,fixChanges:u.fixChanges};return{amplification:t.changeAmplification(),hiddenCoupling:{pairCount:o.findings.length,scoreCount:$(o.findings.reduce((n,u)=>n+de(u),0)),top:o.findings.slice(0,5).map(n=>({fileA:n.fileA,fileB:n.fileB,together:n.together,confidence:n.confidence,focusedTogether:n.focusedTogether,broadTogether:n.broadTogether,broadCommitRatio:n.broadCommitRatio,lastTogetherAt:n.lastTogetherAt,recentTogether:n.recentTogether,commitScope:n.commitScope,recency:n.recency,scoreWeight:de(n),subjectContext:n.subjectContext}))},fileStats:a}})}function ot(e,r){return s(e,r,"suppressions",()=>{let t=oe(e);return{total:t.total,byCategory:{...t.byCategory}}})}function nt(e,r,t){return s(e,t,"drift",()=>{let i=U(e,{scope:r,...p.drift,includePatternDeviations:!1}),o=i.results.filter(u=>u.kind!=="pattern-deviation"),a=o.filter(u=>u.actionTier==="direct").length,n=o.length-a;return{count:o.length,unusedImports:i.unusedImports,layerViolations:i.layerViolations,direct:a,signal:n}})}function at(e,r,t){return s(e,t,"complexity-hotspots",()=>{let i=J(e,{scope:r,minLoc:10,limit:t.complexityResultLimit,scanLimit:t.candidateScanLimit,semantic:!1});return{top:i.slice(0,5).map(o=>({symbol:o.shortName,score:o.score,file:o.file})),extremeCount:i.filter(o=>o.score>$e).length}})}function st(e,r){let t=e.symbols>=_e||e.documents>=Fe,i=r?Number.POSITIVE_INFINITY:ue,o=r?Number.POSITIVE_INFINITY:Ie;return!t||r?{candidateScanLimit:void 0,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:r&&t?["Large index detected; running health without candidate scan or result caps because full mode is enabled."]:[]}:{candidateScanLimit:ce,candidateResultLimit:i,complexityResultLimit:o,releaseCachesBetweenPhases:!0,warnings:[`Large index detected; candidate-style health checks scanned their highest-priority ${ce} symbols and reported their top ${ue} findings. Enable full mode for unbounded candidate counts.`]}}function ct(e,r){r.releaseCachesBetweenPhases&&(T(e),B())}function s(e,r,t,i){ut(t);try{return i()}finally{ct(e,r)}}function ut(e){process.env.SCIP_QUERY_HEALTH_TRACE==="1"&&console.error(`[health] ${e}`)}function lt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath)&&t.kind==="dead-code")}function dt(e,r){return r.filter(t=>!A(e,t.relativePath)&&!k(e,t.symbol,t.relativePath))}function R(e){let r=new Set;for(let t of e){let i=t.relativePath??t.file;i&&r.add(i)}return{count:e.length,loc:e.reduce((t,i)=>t+i.loc,0),files:[...r]}}function ge(e,r){return{...R(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function pt(e){let r=new Map;for(let t of e)r.set(t.file,Math.max(r.get(t.file)??0,t.loc));return{count:r.size,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function V(e){let r=new Map;for(let t of e)r.set(t.fileA,Math.max(r.get(t.fileA)??0,t.locA)),r.set(t.fileB,Math.max(r.get(t.fileB)??0,t.locB));return{count:e.length,loc:[...r.values()].reduce((t,i)=>t+i,0),files:[...r.keys()]}}function fe(e,r){return{...V(e),scoreCount:$(e.reduce((i,o)=>i+r(o),0))}}function mt(e){let r=e.sharedHooks.length>0,t=Ce({namedState:e.sharedState,requests:e.sharedRequests,lifecycle:e.sharedEffects,functions:e.sharedHandlers});return r&&t<=2?0:r?.5:be(e.sharedState,e.sharedHandlers,e.sharedHandlerVerbs)?.25:t>=2?1:.5}function ht(e){let r=e.sharedComposables.length+e.sharedStores.length>0,t=Ce({namedState:e.sharedBindings,requests:e.sharedRequests,lifecycle:e.sharedLifecycle,functions:e.sharedFunctions});return r&&t<=2?0:r?.5:be(e.sharedBindings,e.sharedFunctions,e.sharedFunctionVerbs)?.25:t>=2?1:.5}function Ce(e){return e.requests.length*2+e.lifecycle.length+e.namedState.filter(r=>!Se.has(ve(r))).length+Math.min(e.functions.length,3)}function be(e,r,t){let i=[...e,...r,...t].map(ve);return i.length>0&&i.every(o=>Se.has(o))}function ve(e){return e.replace(/^handle/,"").replace(/^is/,"").replace(/^has/,"").toLowerCase()}function gt(e){return e.actionTier==="signal"?.25:1}function ft(e){return e.actionTier==="signal"?.25:1}function de(e){return e.commitScope==="broad-sweep"?e.recency==="recent"?.25:0:e.commitScope==="mixed"?e.recency==="recent"?.5:.25:e.recency==="recent"?1:.5}function $(e){return Math.round(e*100)/100}var Se=new Set(["add","apply","cancel","change","clear","close","create","delete","draft","edit","error","filter","form","load","loading","name","open","refresh","remove","reset","save","saving","search","select","selected","submit","toggle","update","value"]);export{ze as a,qt as b,jt as c,Ne as d,Gt as e};
|
|
2
|
-
//# sourceMappingURL=chunk-H7JF2CKK.js.map
|
package/dist/chunk-HHOMJCP5.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-UVPY3RUZ.js";import{a as g}from"./chunk-RM2WQ75T.js";import{d as p}from"./chunk-NABVR6B7.js";import{d as m}from"./chunk-THB6AM3V.js";function C(e,n){let{scope:o,minLoc:l=10,limit:i=30,scanLimit:t}=n??{},r=new g(e);return y({candidates:()=>r.productionCallableDefinitions({scope:o,minLoc:l,requireFunctionLikeSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof t=="number"&&t>0}),scanLimit:t,profile:{name:"complexity-hotspots"},prepare:a=>{let s=f(e,a);return{callerMap:r.crossFileCallerMap(a,{semantic:n?.semantic!==!1}),calleeMap:r.calleeMap(a,{semantic:n?.semantic!==!1}),languageByFile:s,clojureCallableIds:h(e,a,s)}},evaluate:(a,s)=>d(a,s,l),orderResults:(a,s)=>s.score-a.score||s.loc-a.loc,limit:i})}function d(e,n,o){if(n.languageByFile.get(e.relativePath)==="clojure"&&!n.clojureCallableIds.has(e.symbolId))return null;let l=e.endLine-e.startLine+1;if(l<o)return null;let i=n.callerMap.get(e.symbolId)?.size??0,t=n.calleeMap.get(e.symbolId)??[],r=new Set,a=new Set;for(let c of t){let u=`${c.symbol}|${c.file}`;r.add(u),c.file!==e.relativePath&&a.add(u)}let s=a.size,b=r.size;return{symbol:e.symbol,shortName:p(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:l,fanIn:i,fanOut:s,calleeCount:b,score:Math.round(l/50*(i/5)*Math.max(s/5,1)*100)/100}}function f(e,n){let o=[...new Set(n.map(t=>t.relativePath))];if(o.length===0)return new Map;let l=o.map(()=>"?").join(", "),i=e.all(`SELECT relative_path, language
|
|
2
|
-
FROM documents
|
|
3
|
-
WHERE relative_path IN (${l})`,...o);return new Map(i.map(t=>[t.relative_path,t.language?.toLowerCase()??null]))}function h(e,n,o){let l=new Set,i=new Map;for(let t of n){if(o.get(t.relativePath)!=="clojure")continue;let r=i.get(t.relativePath);r||(r=new Set((m(e,t.relativePath)?.callables??[]).map(a=>`${a.name}:${a.startLine}`)),i.set(t.relativePath,r)),r.has(`${t.leaf}:${t.startLine}`)&&l.add(t.symbolId)}return l}export{C as a};
|
|
4
|
-
//# sourceMappingURL=chunk-HHOMJCP5.js.map
|
package/dist/chunk-HRDSU5FN.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{j as D}from"./chunk-SGTKURU6.js";import{d as F}from"./chunk-7S5E7KWT.js";import{execFileSync as N}from"child_process";var x=2e3,S=50,B=64,I=8,$=3,U=2160*60*60,K=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,J=3,V=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,W=/^([a-z][a-z0-9-]+)(?:\([^)]+\))?!?:/i;function R(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i)=>{let r=P(n.config.projectRoot);if(!r)return null;let o=t.has(n)?t.get(n,()=>({head:"",value:null})):null;return o&&o.head===r?o.value:(t.invalidate(n),t.get(n,()=>({head:r,value:i(n.config.projectRoot,r)})).value)}}function _(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i,r)=>{let o=P(n.config.projectRoot);if(!o)return null;let s=t.has(n)?t.get(n,()=>({head:"",values:new Map})):null;(!s||s.head!==o)&&t.invalidate(n);let l=t.get(n,()=>({head:o,values:new Map}));if(l.values.has(i))return l.values.get(i)??null;let u=r(n.config.projectRoot,o);return l.values.set(i,u),u}}var X=R("git-commit-history");function Re(e){return{capability:t=>Y(e,t),commitHistory:()=>A(e),fileChurn:()=>Q(e),changeAmplification:()=>ee(e),trackedFiles:()=>ne(e),fileAddRecords:()=>re(e),coChangePairs:(t={})=>ue(e,t),coChangePairsForFiles:(t,n={})=>G(e,t,n),directionalCoChangePairsForFiles:(t,n={})=>me(e,t,n)}}function A(e){return X(e,Z)}function Y(e,t){let n=P(e.config.projectRoot);return n?{slot:t,available:!0,head:n}:{slot:t,available:!1,head:null,reason:"git history is unavailable for this project"}}function P(e){try{return C(e,["rev-parse","HEAD"]).trim()||null}catch{return null}}function C(e,t){return N("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function Z(e,t){let n;try{n=C(e,["log","--no-merges","--name-only","-n",String(x),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}return{head:t,...E(n,S)}}function q(e){return K.test(e.subject)}function Q(e){let t=A(e);if(!t)return null;let n=new Map;for(let i of t.commits){let r=q(i);for(let o of i.files){let s=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};s.changes+=1,r&&(s.fixChanges+=1),i.timestamp>s.lastChangedAt&&(s.lastChangedAt=i.timestamp),n.set(o,s)}}return n}function ee(e){let t=A(e);if(!t||t.commits.length===0)return null;let n=t.commits.map(i=>i.files.length).filter(i=>i>0).sort((i,r)=>i-r);return n.length===0?null:{medianFilesPerCommit:v(n,.5),p90FilesPerCommit:v(n,.9),commitsAnalyzed:n.length}}function v(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var te=R("git-tracked-files");function ne(e){return te(e,t=>{try{let n=C(t,["ls-files"]);return new Set(n.split(`
|
|
2
|
-
`).map(i=>i.trim()).filter(i=>i!==""))}catch{return null}})}var ie=R("git-file-adds"),k="__git__/file-adds",O=D({kind:"git-file-adds",serialize:se,deserialize:ae});function re(e){return ie(e,(t,n)=>oe(e,t,n))}function oe(e,t,n){let i=O.read(e,k,n);if(i)return i;let r=ce(t);return r&&O.write(e,k,n,r),r}function se(e){return JSON.stringify([...e.entries()])}function ae(e){if(!e)return null;try{let t=JSON.parse(e);if(!Array.isArray(t))return null;let n=new Map;for(let i of t){if(!Array.isArray(i)||i.length!==2||typeof i[0]!="string")return null;let r=i[1];if(!r||typeof r.commitsAgo!="number"||!Number.isFinite(r.commitsAgo)||typeof r.addedAt!="number"||!Number.isFinite(r.addedAt))return null;n.set(i[0],{commitsAgo:r.commitsAgo,addedAt:r.addedAt})}return n}catch{return null}}function ce(e){let t;try{t=C(e,["log","--no-merges","--diff-filter=A","--name-only","-n",String(x),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,i=-1;for(let r of t.split("")){if(r.trim()==="")continue;i+=1;let o=r.indexOf(`
|
|
3
|
-
`),s=o>=0?r.slice(0,o):r,[,l]=s.split("\0"),u=Number(l)||0;if(!(o<0))for(let d of r.slice(o+1).split(`
|
|
4
|
-
`)){let h=d.trim();h!==""&&n.set(h,{commitsAgo:i,addedAt:u})}}return n}var M=_("git-co-change-pairs"),le=_("git-directional-co-change-pairs");function ue(e,t){let n=`all\0${T(t)}`,i=M(e,n,()=>{let r=A(e);return r?w(r,t):null});return i&&[...i]}function G(e,t,n){if(t.size===0)return[];let i=`files\0${j(t)}\0${T(n)}`,r=M(e,i,()=>{let o=A(e);return o?w(o,n,t):null});return r&&[...r]}function me(e,t,n){if(t.size===0)return[];let i=n.maxFilesPerCommit??S;if(t.size>B)return G(e,t,n);let r=`directional\0${j(t)}\0${T({...n,maxFilesPerCommit:i})}`,o=le(e,r,(s,l)=>{let u=ge(s,l,t,i);return u?w(u,n,t):null});return o&&[...o]}function T(e){let t=e.minTogether??4,n=e.minConfidence??.6,i=e.maxFilesPerCommit??S;return`${t}\0${n}\0${i}`}function j(e){return[...e].sort().join("\0")}function w(e,t,n){let{minTogether:i=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=t,s=new Map,l=new Map,u=e.newestAnalyzedAt??0;for(let a of e.commits){let c=[...new Set(a.files)].sort();if(c.length>o)continue;e.newestAnalyzedAt===void 0&&a.timestamp>u&&(u=a.timestamp);let f=he(c),y=n===void 0||c.some(m=>n.has(m));for(let m of c)s.set(m,(s.get(m)??0)+1);if(y)for(let m=0;m<c.length;m++)for(let p=m+1;p<c.length;p++){if(n&&!n.has(c[m])&&!n.has(c[p]))continue;let b=`${c[m]}\0${c[p]}`,g=l.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};g.together+=1,f?g.broadTogether+=1:g.focusedTogether+=1,a.timestamp>g.lastTogetherAt&&(g.lastTogetherAt=a.timestamp),g.timestamps.push(a.timestamp),g.subjects.push(a.subject),l.set(b,g)}}let d=[],h=u-U;for(let[a,c]of l){let f=c.together;if(f<i)continue;let[y,m]=a.split("\0"),p=s.get(y)??f,b=s.get(m)??f,g=Math.max(f/p,f/b);if(g<r)continue;let z=c.broadTogether/f,H=c.timestamps.filter(L=>L>=h).length;d.push({fileA:y,fileB:m,together:f,confidence:g,changesA:p,changesB:b,focusedTogether:c.focusedTogether,broadTogether:c.broadTogether,broadCommitRatio:z,lastTogetherAt:c.lastTogetherAt,recentTogether:H,commitScope:pe(c.broadTogether,f),recency:H>0?"recent":"stale",subjectContext:be(c.subjects)})}return d.sort((a,c)=>c.together-a.together||c.confidence-a.confidence||a.fileA.localeCompare(c.fileA)),d}function ge(e,t,n,i){let r;try{r=de(e)}catch{return null}if(r.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:0};let o;try{o=C(e,["log","--no-merges","--format=%H","-n",String(x),"--",...[...n].sort()])}catch{return null}let s=new Set(r.map(a=>a.hash)),l=o.split(`
|
|
5
|
-
`).map(a=>a.trim()).filter(a=>a!==""&&s.has(a)),u=fe(e,r,i);if(l.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:u};let d;try{d=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...l])}catch{return null}let h=E(d,i);return{head:t,...h,newestAnalyzedAt:u}}function de(e){return C(e,["log","--no-merges","--format=%H%x00%ct","-n",String(x)]).split(`
|
|
6
|
-
`).map(n=>n.trim()).filter(n=>n!=="").map(n=>{let[i,r]=n.split("\0");return{hash:i??"",timestamp:Number(r)||0}}).filter(n=>n.hash!=="")}function fe(e,t,n){for(let r=0;r<t.length;r+=20){let o=t.slice(r,r+20),s;try{s=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...o.map(u=>u.hash)])}catch{return t[0]?.timestamp??0}let l=E(s,n);if(l.commits.length>0)return l.commits[0].timestamp}return 0}function E(e,t){let n=[],i=0;for(let r of e.split("")){if(r.trim()==="")continue;let o=r.indexOf(`
|
|
7
|
-
`),s=o>=0?r.slice(0,o):r,[l,u,d]=s.split("\0");if(!l||!u)continue;let h=o>=0?r.slice(o+1).split(`
|
|
8
|
-
`).map(a=>a.trim()).filter(a=>a!==""):[];if(h.length>t){i+=1;continue}n.push({hash:l,timestamp:Number(u)||0,subject:d??"",files:h})}return{commits:n,skippedBulkCommits:i}}function he(e){return e.length>=I?!0:Ce(e).size>=$}function Ce(e){let t=new Set;for(let n of e){let i=n.indexOf("/");t.add(i>=0?n.slice(0,i):".")}return t}function pe(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function be(e){let t=new Set,n=[],i=[];for(let r of e){!i.includes(r)&&i.length<J&&i.push(r);for(let o of Ae(r))t.add(o);for(let o of r.match(V)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:i,externalIssueLabelStatus:"unavailable"}}function Ae(e){let t=new Set,n=W.exec(e)?.[1]?.toLowerCase();return n&&t.add(ye(n)),/\b(?:feat|feature)\b/i.test(e)&&t.add("feature"),/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i.test(e)&&t.add("fix"),/\b(?:docs?|documentation|guide|readme)\b/i.test(e)&&t.add("docs"),/\brefactor(?:ing|ed)?\b/i.test(e)&&t.add("refactor"),/\btests?\b/i.test(e)&&t.add("test"),/\b(?:release|version|v\d+\.\d+)\b/i.test(e)&&t.add("release"),/\bchore\b/i.test(e)&&t.add("chore"),/\bbuild\b/i.test(e)&&t.add("build"),/\bci\b/i.test(e)&&t.add("ci"),/\bperf(?:ormance)?\b/i.test(e)&&t.add("perf"),[...t]}function ye(e){return e==="feat"?"feature":e}export{Re as a};
|
|
9
|
-
//# sourceMappingURL=chunk-HRDSU5FN.js.map
|
package/dist/chunk-HWVYTJOV.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as l,c as g}from"./chunk-ELC77ZDE.js";function v(e){let n=[],r=[],i=[];for(let o of e.primitiveGroups)o.values.length!==0&&h(o.bucket,r,i).push(`${o.reasonPrefix}: ${o.values.join(", ")}`);for(let o of e.nameGroups)u(o.names,o.label,e.genericWords,e.stripPrefixes??[],n,h(o.fallbackBucket,r,i));let c=n.length>0,d=r.length>0,s=i.length>0,t=c?d||s?"mixed":"domain-behavior":s?"shared-abstraction":"generic-workflow-scaffolding";return{actionTier:t==="domain-behavior"||t==="mixed"?"signal":"support",evidenceClass:t,reasons:[...n,...i,...r].slice(0,6),recommendation:e.recommendation(t)}}function x(e,n){if(e.size===0||n.size===0)return 0;let i=l(e,n).size/Math.min(e.size,n.size);return Math.max(g(e,n),i)}function y(e,n){return[...e].filter(r=>r.startsWith(n)).map(r=>r.slice(n.length)).sort()}function b(e){return[...e].sort()}function u(e,n,r,i,c,d){let s=[],t=[];for(let a of e)m(a,i).filter(f=>!r.has(f)).length>0?s.push(a):t.push(a);s.length&&c.push(`${n} has domain term(s): ${s.slice(0,6).join(", ")}`),t.length&&d.push(`${n} is generic workflow: ${t.slice(0,6).join(", ")}`)}function m(e,n){let r=e.replace(/([A-Z])([A-Z][a-z])/g,"$1 $2").replace(/([a-z0-9])([A-Z])/g,"$1 $2");for(let i of n)r=r.replace(i,"");return r.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean)}function h(e,n,r){return e==="generic"?n:r}export{v as a,x as b,y as c,b as d};
|
|
2
|
-
//# sourceMappingURL=chunk-HWVYTJOV.js.map
|
package/dist/chunk-JNMLBL36.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as r,d as a}from"./chunk-HWVYTJOV.js";import{a as d,b as h}from"./chunk-MNCQPMCH.js";import{a as f,b as m,c as p}from"./chunk-ELC77ZDE.js";import{m as c}from"./chunk-SA3DPTHT.js";function A(n,i={}){let{minSimilarity:t=.62,minTokens:e=8,limit:l=20,scope:k,scanLimit:P,filePattern:g,focusFiles:v}=i,u=T(n,{scope:k,minTokens:e,scanLimit:P}),C=d(u,o=>o.tokens);return h({profiles:u,limit:l,filePattern:g,focusFiles:v,candidateIndex:C,profile:{name:"vue-component-duplicates"},compare:(o,s)=>y(o,s,t),sort:(o,s)=>s.similarity-o.similarity||o.fileA.localeCompare(s.fileA)||o.fileB.localeCompare(s.fileB)})}function T(n,i){return c(n).vueProfiles({scope:i.scope,minTemplateTokens:i.minTokens,scanLimit:i.scanLimit}).map(t=>({file:t.file,tokens:t.templateTokens,loc:b(t)}))}function b(n){return n.totalLines}function y(n,i,t){let e=f(n.tokens,i.tokens);if(e.size<6||!V(e))return null;let l=p(n.tokens,i.tokens);return l<t?null:{fileA:n.file,fileB:i.file,similarity:l,sharedTokens:a(e),sharedComponents:r(e,"component:"),sharedProps:r(e,"prop:"),sharedEvents:r(e,"event:"),sharedDirectives:r(e,"directive:"),sharedSlots:r(e,"slot:"),sharedIdentifiers:r(e,"id:"),uniqueToA:a(m(n.tokens,i.tokens)).slice(0,25),uniqueToB:a(m(i.tokens,n.tokens)).slice(0,25),locA:n.loc,locB:i.loc}}function V(n){let i=0,t=0;for(let e of n)e.startsWith("component:")&&(i+=1),(e.startsWith("prop:")||e.startsWith("event:")||e.startsWith("directive:")||e.startsWith("slot:"))&&(t+=1);return i>=1||t>=3}export{A as a};
|
|
2
|
-
//# sourceMappingURL=chunk-JNMLBL36.js.map
|
package/dist/chunk-L446VQYQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as k}from"./chunk-RSSXKJ6J.js";import{f as g,h as R,i as M,j as C,p as D}from"./chunk-UQ73QF5D.js";import{e as h}from"./chunk-CYHIKTJN.js";import{g as S}from"./chunk-63CI3IXR.js";import{e as y}from"./chunk-NABVR6B7.js";import{h as p,j as b}from"./chunk-THB6AM3V.js";import{e as d}from"./chunk-SA3DPTHT.js";import{a as m}from"./chunk-64MNV6AB.js";function L(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let r=m(e,{includeIgnored:!1}),a=C(e),i=n??S(e),l=new Set(i.map(c=>c.symbolId)),s=F(i);return I(e,o,r,a,l,s),v(e,o,i,l),_(e,o,r,a,l,s),t.semantic!==!1&&V(o,h(e,j(i))),o}function I(e,n,t,o,r,a){for(let i of t){if(!d(i))continue;let l=p(e,i);if(l)for(let s of l){if(a&&!a.has(s.calleeLeaf))continue;let c=R(i,o.get(s.calleeLeaf)??[]);if(!c||c.length===0)continue;let f=M(e,i,c,s.memberAccess);f&&r.has(f.symbolId)&&f.file!==i&&u(n,f.symbolId,i)}}}function v(e,n,t,o){let r=x(t);for(let a of w(e,o))e.isIgnored(a.relative_path)||A(a,r.get(a.symbol_id))||u(n,a.symbol_id,a.relative_path)}function w(e,n){return g(e,n?[...n]:void 0)}function x(e){let n=new Map;for(let t of e)n.set(t.symbolId,{docId:t.documentId,startLine:t.startLine,endLine:t.endLine});return n}function A(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function _(e,n,t,o,r,a){for(let i of t){if(d(i)!=="rust")continue;let l=b(e,i,{includeRustAttributeNames:!0});if(l.length!==0)for(let{name:s}of l){if(a&&!a.has(s))continue;let c=o.get(s);if(c)for(let f of c)r.has(f.symbolId)&&f.file!==i&&u(n,f.symbolId,i)}}}function u(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function F(e){let n=new Set;for(let t of e){let o="leaf"in t&&typeof t.leaf=="string"?t.leaf:"symbol"in t&&typeof t.symbol=="string"?y(t.symbol):"";o&&n.add(o)}return n.size>0?n:null}function j(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function V(e,n){for(let[t,o]of n){let r=e.get(t);r||(r=new Set,e.set(t,r));for(let a of o)r.add(a)}}function W(e,n,t={}){return k(e,n,t)}function K(e,n,t={}){return L(e,n,t)}function G(e,n,t={}){return D(e,n,t)}function X(e,n,t={}){let o=K(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:P(o,G(e,n))}function P(e,n){let t=new Map;for(let[o,r]of e)t.set(o,new Set(r));for(let[o,r]of n){let a=t.get(o)??new Set;for(let i of r)a.add(i);t.set(o,a)}return t}export{W as a,K as b,G as c,X as d,P as e};
|
|
2
|
-
//# sourceMappingURL=chunk-L446VQYQ.js.map
|
package/dist/chunk-LDJUB7XW.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as y}from"./chunk-B75HZHUP.js";import{a as f}from"./chunk-BGBBVSH4.js";import{g as L}from"./chunk-CYHIKTJN.js";import{c as h,d as S,g as x}from"./chunk-63CI3IXR.js";import{d as b}from"./chunk-NABVR6B7.js";import{c as d}from"./chunk-THB6AM3V.js";import{a as g}from"./chunk-SA3DPTHT.js";function F(n,e={}){let{scope:s,minLoc:t=1,limit:i,scanLimit:a}=e,o=e.semantic!==!1,l=M(n,$(n,{scope:s,minLoc:t,scanLimit:a}),{semantic:o}),r=I(l);return i?r.slice(0,i):r}function $(n,e){let s=x(n,{scope:e.scope}).filter(t=>t.isFunctionLike&&!n.isIgnored(t.relativePath)).filter(t=>f(t)>=e.minLoc);return typeof e.scanLimit=="number"&&e.scanLimit>0&&s.sort((t,i)=>f(i)-f(t)||t.relativePath.localeCompare(i.relativePath)),y(s,e.scanLimit)}function M(n,e,s){let t=new Map;for(let i of e){let a=w(n,i,s);if(!a)continue;let o=t.get(a)??[];o.push(v(i)),t.set(a,o)}return t}function v(n){return{symbol:n.symbol,shortName:b(n.symbol),file:n.relativePath,startLine:n.startLine,endLine:n.endLine,loc:f(n)}}function I(n){let e=[];for(let[s,t]of n)t.length>=2&&e.push({signature:s,functions:t});return e.sort((s,t)=>{let i=t.functions.length-s.functions.length;if(i!==0)return i;let a=s.functions.reduce((l,r)=>l+r.loc,0);return t.functions.reduce((l,r)=>l+r.loc,0)-a}),e}function w(n,e,s){if(s.semantic){let a=L(n,e);if(a)return a}let t=G(e.documentation),i=t?A(t):null;return i||R(P(n,e.relativePath,e.startLine,e.endLine,e.leaf),e.leaf)}function G(n){return h(S(n))}function P(n,e,s,t,i){let a=g(n,e);if(!a)return null;let o=a.split(/\r?\n/),l=E(o,s,t,i);for(let r of l){let p=Math.min(o.length-1,Math.max(r,r+4)),u="";for(let c=r;c<=p;c+=1){let m=o[c]?.trim();if(m&&(u=u?`${u} ${m}`:m,z(u)))return u}if(u&&u.includes("("))return u}return null}function z(n){let e=n.replace(/\s+/g," ").trim();return!e.includes("(")||d(e)>0?!1:/[;{]$/.test(e)||/\)\s*(?::\s*[^={]+)?\s*(?:=>|=|throws\b|where\b|$)/i.test(e)||/\)\s*As\s+.+$/i.test(e)}function A(n){if(!n||!n.trim())return null;let e=n.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim(),s=e.indexOf("(");return s===-1||(e=e.slice(s),e=e.replace(/\s+/g,"").toLowerCase(),e.length<3)?null:e}function R(n,e){if(!n||!n.trim())return null;let s=n.replace(/\s+/g," ").trim(),t=s.indexOf("(");if(t===-1)return null;let i=s.slice(0,t),o=new RegExp(`\\b${D(e)}\\b`,"i").exec(i);o&&typeof o.index=="number"&&(i=i.slice(0,o.index)),i=i.replace(/\b(public|private|protected|internal|final|static|abstract|sealed|virtual|override|async|suspend|inline|constexpr|consteval|constinit|const|pub|fn|function|def|sub|friend|shared|readonly|new|open|partial|export)\b/gi," ").replace(/\s+/g," ").trim();let l=C(s.slice(t)).replace(/\)\s*=\s*[\s\S]*$/,")").replace(/\s+throws\s+[^={]+$/i,"").replace(/\s+where\s+.+$/i,"").replace(/\s+/g," ").trim();if(!l.startsWith("("))return null;let r=`${i?`${i} `:""}${l}`.replace(/\s+/g,"").toLowerCase();return r.length>=3?r:null}function C(n){let e=0,s=0,t=0,i=0,a=null,o=!1;for(let l=0;l<n.length;l+=1){let r=n[l];if(a){if(o){o=!1;continue}if(r==="\\"){o=!0;continue}r===a&&(a=null);continue}if(r==='"'||r==="'"||r==="`"){a=r;continue}if(r==="(")e+=1;else if(r===")")e=Math.max(0,e-1);else if(r==="[")t+=1;else if(r==="]")t=Math.max(0,t-1);else if(r==="<")i+=1;else if(r===">")i=Math.max(0,i-1);else if(r==="{"){if(e===0&&t===0&&i===0)return n.slice(0,l);s+=1}else if(r==="}")s=Math.max(0,s-1);else if(r==="="&&n[l+1]===">"&&e===0&&s===0&&t===0&&i===0)return n.slice(0,l)}return n}function E(n,e,s,t){let i=D(t),a=new RegExp(`\\b${i}\\b\\s*\\(`,"i"),o=new RegExp(`\\bdef\\s+${i}\\b`,"i"),l=[],r=new Set,p=Math.max(0,Math.min(e,n.length-1)),u=Math.max(p,Math.min(n.length-1,Math.max(s,e+4)));for(let c=p;c<=u;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}for(let c=0;c<n.length;c+=1){let m=n[c]??"";(a.test(m)||o.test(m))&&!r.has(c)&&(r.add(c),l.push(c))}return l}function D(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}export{F as a};
|
|
2
|
-
//# sourceMappingURL=chunk-LDJUB7XW.js.map
|
package/dist/chunk-MYTUWXHK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as R}from"./chunk-HRDSU5FN.js";import{a as L,b as B}from"./chunk-ULHLDOD6.js";import{b as O,h as P,i as v,j}from"./chunk-SGTKURU6.js";import{existsSync as $,readFileSync as F}from"fs";import{join as x}from"path";function X(t,n){let e=q(t,n)??V(t,n)??K(t,n)??Q(t,n);return Y(t,e,n)}function q(t,n){let e=-1,i=null;for(let r=0;r<=n;r+=1){let o=w(t[r]??"");o&&(i===null?(i=o,e=r):o===i&&(i=null,e=-1))}if(i===null||e<0)return null;for(let r=n+1;r<t.length;r+=1)if(w(t[r]??"")===i)return{start:e,end:r+1};return{start:e,end:t.length}}function w(t){let n=t.match(/^\s*(```+|~~~+)/);return n?n[1].startsWith("`")?"`":"~":null}function V(t,n){if(!I(t[n]??""))return null;let e=n;for(;e>0&&I(t[e-1]??"");)e-=1;let i=n+1;for(;i<t.length&&I(t[i]??"");)i+=1;return{start:e,end:i}}function I(t){let n=t.trim();return n.startsWith("|")&&n.endsWith("|")&&n.includes("|")}function K(t,n){let e=n;for(;e>=0;){let o=t[e]??"";if(k(o)!==null)break;if(E(o)!==null)return null;e-=1}if(e<0)return null;let i=k(t[e]??"");if(i===null)return null;let r=e+1;for(;r<t.length;){let o=t[r]??"",c=k(o);if(c!==null){if(c<=i)break;r+=1;continue}if(E(o)!==null)break;r+=1}return{start:e,end:r}}function k(t){let n=t.match(/^(\s*)(?:[-*+]\s+|\d+[.)]\s+)/);return n?n[1].length:null}function Q(t,n){let e=t[n]??"";if(H(e)||e.trim().length===0)return{start:n,end:n+1};let i=n;for(;i>0&&z(t[i-1]??"");)i-=1;let r=n+1;for(;r<t.length&&z(t[r]??"");)r+=1;return{start:i,end:r}}function z(t){return E(t)===null}function E(t){return t.trim().length===0?"blank":H(t)?"heading":w(t)?"fence":I(t)?"table":k(t)!==null?"list":null}function H(t){return/^#{1,6}\s+/.test(t.trim())}function Y(t,n,e){let{start:i,end:r}=n;if(r-i>40){let c=Math.floor(20);i=Math.max(i,e-c),r=Math.min(r,i+40),i=Math.max(n.start,r-40)}let o=t.slice(i,r).join(`
|
|
2
|
-
`).trim();return o.length<=2e3?o:`${o.slice(0,2e3).trimEnd()}...`}function _(t,n){return n.filter(e=>t.includes(e))}var U=j({kind:"doc-path-evidence",serialize:ft,deserialize:gt}),b=/\.(?:md|mdx|rst|txt)$/i;function tt(t){return/(?:^|\/)(?:docs\/plans|plans|adrs?|rfcs?|decisions|changelogs?|archive|reports?)\//i.test(t)||/(?:^|\/)CHANGELOG\.(?:md|mdx|rst|txt)$/i.test(t)}var nt=3,et=/[A-Za-z0-9_@-]+(?:\/[A-Za-z0-9_.@-]+)+\.[A-Za-z0-9]{1,6}\b/g;function Mt(t,n={}){let{doc:e,limit:i=20,minCoupling:r=nt}=n,o=ot(t);if(!o)return{available:!1,commitsAnalyzed:0,docsScanned:0,findings:[]};let c=[];for(let s of o.docFiles){if(e!==void 0&&!s.includes(e)||e===void 0&&!G(t,s)||e!==void 0&&!$(x(t.config.projectRoot,s)))continue;let l=Math.max(0,...o.changeTimes.get(s)??[]),f=it(t,s),h=new Map,{resolved:g,broken:a,citations:u}=at(t,s,o.tracked,o.trackedBySuffix,o.everSeenInHistory),p=new Map(u.map(d=>[d.file,d.contexts]));for(let d of g){if(d===s||b.test(d))continue;let m=(o.changeTimes.get(d)??[]).filter(S=>S>l).length;m!==0&&h.set(d,{file:d,evidence:"reference",coChanges:0,changesSinceDocUpdate:m,...N("reference",f),citationContexts:p.get(d)})}for(let[d,m]of o.coupling.get(s)??[]){if(m<r||!o.tracked.has(d))continue;let S=(o.changeTimes.get(d)??[]).filter(T=>T>l).length;if(S===0)continue;let C=h.get(d);C?(C.evidence="both",C.coChanges=m,Object.assign(C,N("both",f))):h.set(d,{file:d,evidence:"co-change",coChanges:m,changesSinceDocUpdate:S,...N("co-change",f)})}if(h.size===0&&a.length===0)continue;let D=[...h.values()].sort((d,m)=>m.changesSinceDocUpdate-d.changesSinceDocUpdate);c.push({doc:s,docLastChangedAt:l,staleness:D.reduce((d,m)=>d+m.changesSinceDocUpdate,0)+a.length*10,subjects:D.slice(0,8),brokenReferences:a})}return c.sort((s,l)=>l.staleness-s.staleness),{available:!0,commitsAnalyzed:o.historyCommitCount,docsScanned:o.docFiles.length,findings:c.slice(0,i)}}function it(t,n){let e;try{e=F(x(t.config.projectRoot,n),"utf8").slice(0,6e3)}catch{return{docIntent:"unknown",reasons:["doc text unavailable"]}}let i=`${n}
|
|
3
|
-
${e}`.toLowerCase(),r=_(i,["historical note","historical record","history note","retrospective","postmortem","post-mortem","archived","archive","previously","legacy","recorded","record of","snapshot","as of","migration note","decision record"]);if(r.length>0)return{docIntent:"historical-note",reasons:[`historical-note terms: ${r.join(", ")}`]};let o=_(i,["current","standard","standards","must","should","policy","guide","guidance","workflow","contract","invariant","source of truth"]);return o.length>0?{docIntent:"current-guidance",reasons:[`current-guidance terms: ${o.join(", ")}`]}:{docIntent:"unknown",reasons:["no current-guidance or historical-note markers found"]}}function N(t,n){return{actionTier:rt(t,n.docIntent),docIntent:n.docIntent,docIntentReasons:n.reasons}}function rt(t,n){return n==="historical-note"?"support":t==="co-change"?"signal":"direct"}function ot(t){let n=R(t),e=n.commitHistory();if(!e)return null;let i=n.trackedFiles()??new Set,r=new Map,o=new Map,c=new Set;for(let s of e.commits){let l=[...new Set(s.files)],f=l.filter(g=>b.test(g)),h=l.filter(g=>!b.test(g));for(let g of l){c.add(g);let a=r.get(g)??[];a.push(s.timestamp),r.set(g,a)}for(let g of f){let a=o.get(g);a||(a=new Map,o.set(g,a));for(let u of h)a.set(u,(a.get(u)??0)+1)}}return{changeTimes:r,coupling:o,docFiles:[...i].filter(s=>b.test(s)),everSeenInHistory:c,historyCommitCount:e.commits.length,tracked:i,trackedBySuffix:W(i)}}function vt(t,n){if(n.size===0)return[];let e=L(),i=0,r=0,o=0,c=0,s=0,l=0;return B("doc-reference.docs-citing-files",()=>{let f=R(t).trackedFiles()??new Set;i=f.size;let h=W(f),g=st(n,h),a=[];for(let u of f){if(!G(t,u))continue;e&&(r+=1);let p;try{p=F(x(t.config.projectRoot,u),"utf-8")}catch{e&&(o+=1);continue}if(!lt(p,g)){e&&(c+=1);continue}let D=Z(t,u,p);if(!D)continue;e&&(s+=1);let d=ct(D.candidates,n,g,f,h);if(d.size===0)continue;let m=[...new Set([...d.values()].flatMap(y=>[...y]))],S=dt(D.contextsByCandidate,m),C=[...d].map(([y,M])=>({file:y,contexts:A([...M].flatMap(J=>S.get(J)??[])).slice(0,3)})).filter(y=>y.contexts.length>0),T=[...d.keys()];if(T.length>0){e&&(l+=1);let y=T.sort();a.push({doc:u,cited:y,citations:C,citedClaims:A(C.flatMap(M=>M.contexts)).slice(0,3)})}}return a},()=>({targets:n.size,trackedFiles:i,livingDocs:r,unreadableDocs:o,candidateMisses:c,evidenceDocs:s,citedDocs:l}))}function G(t,n){return b.test(n)&&!tt(n)&&$(x(t.config.projectRoot,n))}function W(t){let n=new Map;for(let e of t){let i=e.split("/");for(let r of[2,3]){if(i.length<r)continue;let o=i.slice(-r).join("/"),c=n.get(o)??[];c.push(e),n.set(o,c)}}return n}function st(t,n){let e=new Set(t);for(let i of t){let r=i.split("/");for(let o of[2,3]){if(r.length<o)continue;let c=r.slice(-o).join("/"),s=n.get(c);s?.length===1&&s[0]===i&&e.add(c)}}return e}function ct(t,n,e,i,r){let o=new Map;for(let c of t){if(!e.has(c))continue;let s;if(i.has(c))s=c;else{let f=r.get(c);f?.length===1&&(s=f[0])}if(!s||!n.has(s))continue;let l=o.get(s)??new Set;l.add(c),o.set(s,l)}return o}function at(t,n,e,i,r){let o=new Set,c=new Set,s=Z(t,n);if(!s)return{resolved:o,broken:[],citations:[]};let l=s.candidates,f=s.contextsByCandidate,h=new Map,g=(a,u)=>{let p=f.get(u);if(!p||p.length===0)return;let D=h.get(a)??[];D.push(...p),h.set(a,A(D).slice(0,3))};for(let a of l){if(e.has(a)){o.add(a),g(a,a);continue}let u=i.get(a);if(u&&u.length===1){o.add(u[0]),g(u[0],a);continue}u&&u.length>1||r.has(a)&&c.add(a)}return{resolved:o,broken:[...c],citations:[...h].map(([a,u])=>({file:a,contexts:u}))}}function dt(t,n){let e=new Map;for(let i of n){let r=t.get(i);r&&r.length>0&&e.set(i,[...r])}return e}function Z(t,n,e){let i=e;if(i===void 0)try{i=F(x(t.config.projectRoot,n),"utf-8")}catch{return null}let r=O(t,n,i),o=U.read(t,n,r);if(o)return o;let c=ut(i);return U.write(t,n,r,c),c}function lt(t,n){for(let e of n)if(t.includes(e))return!0;return!1}function ut(t){let n=t.split(/\r?\n/),e=new Set,i=new Map;for(let r=0;r<n.length;r+=1){let o=n[r]??"";for(let c of o.matchAll(et)){let s=c[0].replace(/^\.?\//,"");e.add(s);let l=X(n,r);if(l.length===0)continue;let f=i.get(s)??[];f.push(l),i.set(s,A(f).slice(0,3))}}return{candidates:[...e],contextsByCandidate:i}}function ft(t){let n={candidates:t.candidates,contextsByCandidate:[...t.contextsByCandidate.entries()]};return JSON.stringify(n)}function gt(t){try{let n=JSON.parse(t);if(!P(n))return null;let e=v(n.candidates),i=ht(n.contextsByCandidate);return!e||!i?null:{candidates:e,contextsByCandidate:new Map(i)}}catch{return null}}function ht(t){if(!Array.isArray(t))return null;let n=[];for(let e of t){if(!Array.isArray(e)||e.length!==2||typeof e[0]!="string")return null;let i=v(e[1]);if(!i)return null;n.push([e[0],i])}return n}function A(t){let n=[];for(let e of new Set(t))n.some(i=>mt(i,e))||n.push(e);return n}function mt(t,n){if(t===n)return!0;let e=t.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),i=n.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0),r=Math.min(e.length,i.length);if(r===0)return!1;if(r<3)return t.includes(n)||n.includes(t);let o=new Set(i),c=e.filter(s=>o.has(s)).length;return c>=3&&c/r>=.6}export{X as a,_ as b,tt as c,Mt as d,vt as e};
|
|
4
|
-
//# sourceMappingURL=chunk-MYTUWXHK.js.map
|
package/dist/chunk-N25HPUOK.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{m as l}from"./chunk-SA3DPTHT.js";function S(e,t={}){let{minTotalLines:n=800,minTemplateLines:i=300,minScriptLines:a=300,minStyleLines:r=500,limit:o=20,scope:m,scanLimit:p,filePattern:u}=t;return l(e).vueProfiles({scope:m,scanLimit:p}).filter(s=>!u||s.file.includes(u)).map(s=>L(s,{minTotalLines:n,minTemplateLines:i,minScriptLines:a,minStyleLines:r})).filter(s=>s!==null).sort((s,c)=>c.totalLines-s.totalLines||s.file.localeCompare(c.file)).slice(0,o)}function L(e,t){let n=[];if(e.totalLines>=t.minTotalLines&&n.push(`${e.totalLines} total component line(s)`),e.templateLines>=t.minTemplateLines&&n.push(`${e.templateLines} template line(s)`),e.scriptLines>=t.minScriptLines&&n.push(`${e.scriptLines} script line(s)`),e.styleLines>=t.minStyleLines&&n.push(`${e.styleLines} style line(s)`),n.length===0)return null;let i=g(e),a=b(e,t,i),r=x(e.file),o=V(i,r);return{file:e.file,totalLines:e.totalLines,sfcLines:e.sfcLines,templateLines:e.templateLines,scriptLines:e.scriptLines,styleLines:e.styleLines,externalScriptLines:e.externalScriptLines,externalScriptPaths:e.externalScriptPaths,customBlockLines:e.customBlockLines,dominantPressure:i,pressureKinds:a,contextKind:r,recommendationKind:o,recommendation:d(o,r),reasons:n,loc:e.totalLines}}function g(e){let t=[{axis:"template",lines:e.templateLines},{axis:"script",lines:e.scriptLines-e.externalScriptLines},{axis:"style",lines:e.styleLines},{axis:"external-script",lines:e.externalScriptLines},{axis:"custom-block",lines:e.customBlockLines}];return t.sort((n,i)=>i.lines-n.lines),t[0]?.lines?t[0].axis:"total"}function b(e,t,n){let i=[];return e.totalLines>=t.minTotalLines&&(i.push("total"),n!=="total"&&i.push(n)),e.templateLines>=t.minTemplateLines&&i.push("template"),e.scriptLines>=t.minScriptLines&&i.push("script"),e.styleLines>=t.minStyleLines&&i.push("style"),(e.externalScriptLines>=t.minScriptLines||n==="external-script")&&i.push("external-script"),e.customBlockLines>0&&n==="custom-block"&&i.push("custom-block"),[...new Set(i.length>0?i:[n])]}function x(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).some(i=>w.has(i))||/(?:view|page|route)\.vue$/i.test(e)||/(?:^|\/)(views|pages|routes)\//i.test(e)?"route-page":"component"}function V(e,t){return e==="style"?"style-decomposition":e==="template"?"template-decomposition":e==="external-script"?"external-script-boundary":e==="custom-block"?"custom-block-review":t==="route-page"?"route-page-decomposition":e==="script"?"script-behavior-extraction":"total-size-review"}function d(e,t){switch(e){case"template-decomposition":return t==="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{S as a};
|
|
2
|
-
//# sourceMappingURL=chunk-N25HPUOK.js.map
|
package/dist/chunk-NABVR6B7.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{d as g,k as S,l as x}from"./chunk-THB6AM3V.js";import{a as u,b as d,h as m}from"./chunk-SA3DPTHT.js";var b={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function a(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let s=e.split(" ");if(s.length<4)return{scheme:s[0]??"",manager:s[1]??"",packageName:s[2]??"",version:"",descriptors:[],raw:e};let t=s[0],r=s[1],n=e.slice(t.length+1+r.length+1),i;if(n.startsWith("`")){let f=n.indexOf("`",1);f===-1?(i=n.slice(1),n=""):(i=n.slice(1,f),n=n.slice(f+2))}else{let f=n.indexOf(" ");f===-1?(i=n,n=""):(i=n.slice(0,f),n=n.slice(f+1))}let o,c=n.indexOf(" ");c===-1?(o=n,n=""):(o=n.slice(0,c),n=n.slice(c+1));let l=k(n);return{scheme:t,manager:r,packageName:i,version:o,descriptors:l,raw:e}}function M(e){let s=a(e);if("kind"in s)return null;for(let t=s.descriptors.length-2;t>=0;t--){let r=s.descriptors[t];if(r?.suffix==="type")return r.name}return null}function k(e){let s=[],t=0;for(;t<e.length;){if(e[t]==="["){let i=e.indexOf("]",t+1);if(i===-1){s.push({name:e.slice(t+1),suffix:"type-param"});break}s.push({name:e.slice(t+1,i),suffix:"type-param"}),t=i+1;continue}if(e[t]==="("&&(s.length===0||t===0||h(e[t-1]))){let i=e.indexOf(")",t+1);if(i!==-1&&e[i+1]!=="."){s.push({name:e.slice(t+1,i),suffix:"parameter"}),t=i+1;continue}}let r;if(e[t]==="`"){let i=e.indexOf("`",t+1);if(i===-1){r=e.slice(t+1),s.push({name:r,suffix:"term"});break}r=e.slice(t+1,i),t=i+1}else{let i=t;for(;t<e.length&&!h(e[t]);)t++;r=e.slice(i,t)}if(t>=e.length){r&&s.push({name:r,suffix:"term"});break}let n=e[t];if(n==="("){let i=e.indexOf(")",t+1);i!==-1&&e[i+1]==="."?(s.push({name:r,suffix:"method"}),t=i+2):i!==-1?(s.push({name:r,suffix:"method"}),t=i+1):(s.push({name:r,suffix:"term"}),t++)}else{let i=b[n];i&&s.push({name:r,suffix:i}),t+=1}}return s}function h(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function R(e){let s=a(e);if("kind"in s&&s.kind==="local")return`local:${s.id}`;let t=s;if(t.descriptors.length===0)return t.raw;let r=[];for(let n of t.descriptors){let i=D(n);i&&r.push(i)}return r.join(":")}function D(e){let s=e.suffix==="namespace"?v(e.name):e.name;return s?e.suffix==="method"?`${s}()`:s:""}function v(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function T(e){let s=a(e);if("kind"in s&&s.kind==="local")return s.id;let t=s;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let s=a(e);if("kind"in s&&s.kind==="local")return null;let t=s;return t.descriptors[t.descriptors.length-1]?.suffix??null}function $(e){return e.endsWith("().")||p(e)==="method"}function j(e){let s=p(e);return s==="method"||s==="term"}function I(e){return p(e)==="namespace"}var E=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function L(e){return E.test(e)}var F=new Set(["test","tests","_tests"]);function O(e){let s=a(e);if("kind"in s)return!1;for(let t=0;t<s.descriptors.length-1;t+=1){let r=s.descriptors[t];if(r?.suffix==="namespace"&&r.name&&F.has(r.name))return!0}return!1}function P(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length!==n.length+1)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function _(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length<=n.length)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function z(e){return{forFile(s,t){return y(e,s,t)},forFiles(s,t){let r=new Map;for(let n of s)r.set(n,y(e,n,t));return r}}}function y(e,s,t){let r={file:s},n=t.facts||t.identifiers;if(t.text&&(r.text=u(e,s)),t.lines&&(r.lines=d(e,s)),t.ast&&(r.ast=m(e,s)),t.imports&&(r.imports=x(e,s)),t.reexports&&(r.reexports=S(e,s)),n){let i=g(e,s);t.facts&&(r.facts=i),t.identifiers&&i&&(r.identifiers=i.fileIdentifiers,r.identifierLineMap=i.identifierLineMap)}return r}export{z as a,a as b,M as c,R as d,T as e,p as f,$ as g,j as h,I as i,L as j,O as k,P as l,_ as m};
|
|
2
|
-
//# sourceMappingURL=chunk-NABVR6B7.js.map
|
package/dist/chunk-NBNEVLRC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as y,b as d,e as w,n as f}from"./chunk-63CI3IXR.js";import{c as D,d as $,e as Q,g as v,h as A,i as N}from"./chunk-NABVR6B7.js";function re(e,n){let t=Z(e,n.trim());if(t)return t;let i=q(e,n);if(i)return i;let o=F(e,n);return o||j(e,n)}function F(e,n){let t=x(n),i=I(t);if(!i)return null;let o=`%${i.path}%`,r=i.leaf,c=O(e,o,r,t)[0];return c?f(e,c):null}function O(e,n,t,i){let o=w([],[...z(e,n,t),...W(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>h(r,i)>1);return o.sort((r,a)=>h(a,i)-h(r,i)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),o}function z(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function W(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function j(e,n){let t=x(n),i=U(n),o=H(e,i),r=V(o,n,t);if(r&&!e.isIgnored(r.relative_path))return f(e,r);let a=null;for(let c of o){if(e.isIgnored(c.relative_path))continue;let l=J(c,n,t,i);l<=0||(!a||l>a.score)&&(a={row:c,score:l})}return a?f(e,a.row):null}function q(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return null;let[,i,o,r]=t,a=Math.max(0,parseInt(o,10)-1),c=Math.max(a,parseInt(r,10)-1),l=T(e,i,a,c)??X(e,i,a,c);return l&&!e.isIgnored(l.relative_path)?f(e,l):null}function T(e,n,t,i){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function X(e,n,t,i){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,i],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function Z(e,n){let i=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line",limit:1})[0]??d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line",limit:1})[0];return!i||e.isIgnored(i.relative_path)?null:f(e,i)}function ae(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=G(e,n.symbolId)[0];return t?f(e,t):null}function G(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),i=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return w(t,i)}function H(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),i=n.flatMap(c=>{let l=`%${c}%`;return[l,l,l]}),o=t.join(`
|
|
2
|
-
AND `),r=y(e,{where:o,params:i,limit:200}),a=d(e,{where:o,params:i,limit:200});return w(r,a)}function J(e,n,t,i){let o=n.trim(),r=t,a=r.replace(/\(\)$/,""),c=n.toLowerCase(),l=t.toLowerCase(),S=l.replace(/\(\)$/,""),k=e.symbol,C=$(e.symbol),b=Q(e.symbol),E=e.display_name??"",g=e.symbol.toLowerCase(),u=C.toLowerCase(),m=b.toLowerCase(),R=E.toLowerCase(),p=e.relative_path.toLowerCase(),K=/[/:.]/.test(t),M=I(t),_=M?.leaf.toLowerCase(),s=0;return(k===o||k===r)&&(s+=1150),(C===o||C===r)&&(s+=1100),E===a&&(s+=1180),b===a&&(s+=1160),(`${b}()`===o||`${b}()`===r)&&(s+=955),(g===c||g===l)&&(s+=1e3),(u===c||u===l)&&(s+=950),(p===c||p===l)&&(s+=925),(p.endsWith(`/${l}`)||p.endsWith(`/${c}`))&&(s+=875),R===S&&(s+=850),m===S&&(s+=825),(`${m}()`===c||`${m}()`===l)&&(s+=820),(u.endsWith(`:${l}`)||u.endsWith(`:${S}`)||u.endsWith(`:${S}()`))&&(s+=800),g.includes(l)&&(s+=120),u.includes(l)&&(s+=140),p.includes(l)&&(s+=140),R.includes(l)&&(s+=110),i.every(B=>{let L=B.toLowerCase();return g.includes(L)||u.includes(L)||p.includes(L)||R.includes(L)})&&(s+=100+i.length*15),M&&p.includes(M.path.toLowerCase())&&(s+=360,_&&(m===_||`${m}()`===_||`${m}()`==`${_}()`)&&(s+=700),v(e.symbol)&&(s+=180)),A(e.symbol)&&m===S&&(s+=60),!K&&N(e.symbol)&&(s-=160),s-=Math.min(50,Math.max(0,e.end_line-e.start_line)),s}function I(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let i=n.slice(t+1).replace(/\(\)$/,"");return!i||i.includes(".")?null:{path:n.slice(0,t),leaf:i}}function x(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function U(e){let n=x(e),t=n.split(/[^A-Za-z0-9_]+/).map(i=>i.trim()).filter(i=>i.length>0);return t.length>0?[...new Set(t)]:[n]}function V(e,n,t){let i=n.trim(),o=e.filter(r=>{let a=$(r.symbol),c=(r.display_name??"").trim();return r.symbol===i||a===i||a===t||c===i||c===t||`${c}()`===i||h(r,t)>1||r.relative_path===i});return o.length===0?null:(o.sort((r,a)=>h(a,t)-h(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),o[0]??null)}function h(e,n){let t=I(n);if(!t)return 0;let i=e.relative_path.toLowerCase(),o=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return i.includes(r)?o!==a?1:v(e.symbol)?D(e.symbol)===null?5:4:D(e.symbol)===null?3:2:0}export{re as a,Z as b,ae as c};
|
|
3
|
-
//# sourceMappingURL=chunk-NBNEVLRC.js.map
|
package/dist/chunk-ONPCQ2PM.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import{execFileSync as h}from"child_process";import{platform as y}from"os";var b=y()==="win32";function t(e){let r=b?"where":"which";try{return h(r,[e],{stdio:"pipe"}),!0}catch{return!1}}import{execFileSync as c}from"child_process";import{existsSync as g,readFileSync as I}from"fs";import{platform as o,arch as m}from"os";import{dirname as p,join as s}from"path";import{fileURLToPath as v}from"url";var d="v0.8.1",a="https://github.com/scip-code/scip",x={win32:{x64:s("vendor","scip","win32-x64","scip.exe"),arm64:s("vendor","scip","win32-arm64","scip.exe")}};function S(){let e=p(v(import.meta.url));for(;;){let r=s(e,"package.json");if(g(r))try{if(JSON.parse(I(r,"utf-8")).name==="scip-query")return e}catch{}let n=p(e);if(n===e)return null;e=n}}function f(){let e=x[o()]?.[m()];if(!e)return null;let r=S();if(!r)return null;let n=s(r,e);return g(n)?n:null}function w(){return t("scip")?"scip":f()}function H(){return w()!==null}function q(){let e=w();if(!e)return null;try{return c(e,["--version"],{stdio:"pipe"}).toString().trim()}catch{return null}}function $(){let e=o(),r=m(),n,i,l;switch(e){case"darwin":n="darwin",l="tar.gz";break;case"linux":n="linux",l="tar.gz";break;default:return null}switch(r){case"arm64":i="arm64";break;case"x64":i="amd64";break;default:return null}let u=`scip-${n}-${i}.${l}`;return{url:`${a}/releases/download/${d}/${u}`,filename:u}}function U(){let e=$();console.log("\nThe `scip` CLI is required but not found on PATH.\n"),o()==="darwin"?(console.log("Install via Homebrew:"),console.log(` brew install sourcegraph/scip/scip
|
|
2
|
-
`),console.log("Or download manually:")):o()==="win32"?(console.log("Windows installs should include a managed scip.exe in the scip-query package."),console.log("Reinstall scip-query, or build the managed binary from source with:"),console.log(` npm run build:scip-windows
|
|
3
|
-
`),console.log("Upstream release page:")):console.log("Download from:"),console.log(e?` ${e.url}
|
|
4
|
-
`:` ${a}/releases/tag/${d}
|
|
5
|
-
`),console.log("After installing, ensure `scip` is on your PATH and run `scip-query reindex`.")}function D(e){let r=f();if(r)return e(`Using bundled scip CLI at ${r}`),!0;if(o()==="darwin"&&t("brew")){e("Installing scip CLI via Homebrew...");try{if(c("brew",["install","sourcegraph/scip/scip"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via Homebrew"),!0}catch(n){let i=n instanceof Error?n.message:String(n);e(`Homebrew install failed: ${i}`)}}if(t("go")){e("Installing scip CLI via go install...");try{if(c("go",["install","github.com/sourcegraph/scip/cmd/scip@latest"],{stdio:"inherit",timeout:3e5,env:process.env}),t("scip"))return e("Successfully installed scip CLI via go install"),!0}catch(n){let i=n instanceof Error?n.message:String(n);e(`go install failed: ${i}`)}}return e("Could not auto-install scip CLI."),e(`Install manually from: ${a}/releases`),!1}export{t as a,w as b,H as c,q as d,U as e,D as f};
|
|
6
|
-
//# sourceMappingURL=chunk-ONPCQ2PM.js.map
|
package/dist/chunk-Q5P7NOVM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as b}from"./chunk-RSSXKJ6J.js";import{a as f}from"./chunk-NBNEVLRC.js";import{f as v}from"./chunk-63CI3IXR.js";import{d as r}from"./chunk-NABVR6B7.js";import{f as C}from"./chunk-THB6AM3V.js";function N(s,c,m,y={}){let n=f(s,c),o=f(s,m);if(!n||!o)return null;let d=b(s,n,{semantic:y.semantic}),p=b(s,o,{semantic:y.semantic}),A=d.filter(e=>!w(s,e)),B=p.filter(e=>!w(s,e)),S=A.length!==d.length||B.length!==p.length,g=new Set(A.map(e=>e.symbol)),h=new Set(B.map(e=>e.symbol)),a=[];for(let e of g)h.has(e)&&a.push(e);let l=[];for(let e of g)h.has(e)||l.push(e);let i=[];for(let e of h)g.has(e)||i.push(e);let u=new Set([...g,...h]),T=u.size>0?a.length/u.size:0,t;u.size===0?t="Neither function calls other tracked symbols. There is no callee-pattern evidence for consolidation; inspect the source bodies directly.":a.length===0?t="These functions do not share any callees. They are not a callee-based consolidation candidate.":l.length===0&&i.length===0?t="These functions have identical tracked callee sets. They are a strong structural match, but identical callees do not prove interchangeable semantics; inspect signatures, control flow, and return values before consolidating.":l.length===0?t="A's tracked callees are a subset of B's. B may subsume part of A's structure, but verify signatures, guards, and non-call logic before replacing A with B.":i.length===0?t="B's tracked callees are a subset of A's. A may subsume part of B's structure, but verify signatures, guards, and non-call logic before replacing B with A.":l.length<=2&&i.length<=2?t=`Create a shared function with the ${a.length} common callees. Pass the ${l.length+i.length} divergent callees as parameters or strategy callbacks.`:t=`Extract the ${a.length} shared callees into a common helper. Each function calls the helper plus its own unique logic (${l.length} callees in A, ${i.length} in B).`,S&&(t=`Ignored Clojure macro scaffolding while comparing tracked callees. ${t}`);let q=n.endLine-n.startLine+1,D=o.endLine-o.startLine+1;return{symbolA:{symbol:n.symbol,shortName:r(n.symbol),file:n.relativePath,loc:q},symbolB:{symbol:o.symbol,shortName:r(o.symbol),file:o.relativePath,loc:D},similarity:T,sharedCallees:a.map(r),uniqueToA:l.map(r),uniqueToB:i.map(r),consolidationStrategy:t}}function w(s,c){return v(s,c.file).some(m=>m.symbol===c.symbol&&C(s,m))}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-Q5P7NOVM.js.map
|
package/dist/chunk-RGKRYO22.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as ce}from"./chunk-XHMVZFA6.js";import{a as ae}from"./chunk-7XTO4YXB.js";import{a as S}from"./chunk-B32FX5KB.js";import{a as se}from"./chunk-RUV5IY25.js";import{a as oe}from"./chunk-T3AEVJBG.js";import{a as re}from"./chunk-C2QSK7E7.js";import{a as ie,c as ne}from"./chunk-Z2LDWIJV.js";import{a as ee}from"./chunk-JJ5SAWBT.js";import{a as te}from"./chunk-ZNWWVYQL.js";import{a as X}from"./chunk-GKB4JJDU.js";import{a as U,c as V,d as q,h as L,i as K}from"./chunk-T4N2ZRVY.js";import{a as W,b as A,e as Y}from"./chunk-MYTUWXHK.js";import{a as Q}from"./chunk-62ULXMQ7.js";import{b as Z}from"./chunk-ROGZXWN2.js";import{a as B,c as _,d as z,e as O}from"./chunk-GG5LHT27.js";import{a as H}from"./chunk-HRDSU5FN.js";import{a as J}from"./chunk-FMGVZBS2.js";import{a as I}from"./chunk-RM2WQ75T.js";import{f as F,g as v}from"./chunk-WUOB4DHH.js";import{b as N}from"./chunk-ULHLDOD6.js";import{e as T,f as P,g as M}from"./chunk-NABVR6B7.js";import{createHash as Oe}from"crypto";import{existsSync as me}from"fs";function le(e){let[i,t]=G(e,":"),n=i||"unknown",o=(s={})=>{let r=s.actionTier??Se(n);return{sourceAnalyzer:n,actionTier:r,rootCauseKey:s.rootCauseKey??(t||e),label:s.label??`${n} finding`,relatedFiles:s.relatedFiles??[],why:s.why??[],remediation:s.remediation??$e(r,n),file:s.file}};if(!t)return o({rootCauseKey:e,why:["Baseline identity did not include analyzer payload."]});if(["dead","isolated","extract","wrapper","passthrough","stale"].includes(n)){let[s,r]=G(t,":");return o({file:s,relatedFiles:s?[s]:[],rootCauseKey:r?`${s}:${r}`:t,label:`${n} finding`,why:r?[`Baseline subject: ${r}.`]:[]})}if(n==="cycle"){let s=t.split(">").filter(Boolean);return o({relatedFiles:s,rootCauseKey:t,label:"cycle finding",why:s.length>0?[`Cycle path: ${s.join(" > ")}.`]:[]})}if(n==="similar"){let s=t.split("|").filter(Boolean);return o({relatedFiles:[],rootCauseKey:t,label:"similarity finding",why:s.length>0?[`Similar symbols: ${s.join(" | ")}.`]:[]})}if(n==="drift"){let[s,r]=G(t,":"),[l,a]=G(r,":");return o({actionTier:s==="unused-import"?"direct":"signal",file:l,relatedFiles:[...new Set([l,a].filter(Boolean))],rootCauseKey:t,label:`${s||"drift"} finding`,why:[...s?[`Drift kind: ${s}.`]:[],...a?[`Related dependency: ${a}.`]:[]]})}return o({why:["Baseline analyzer prefix is not recognized by this diff-gate version."]})}function Se(e){switch(e){case"dead":case"isolated":case"cycle":case"passthrough":return"direct";case"similar":case"extract":case"wrapper":case"stale":return"signal";default:return"signal"}}function $e(e,i){return e==="direct"?`Fix the new ${i} baseline finding, or knowingly accept it via health --write-baseline.`:`Review the new ${i} baseline signal; fix it if it reflects real debt, or knowingly accept it via health --write-baseline.`}function G(e,i){let t=e.indexOf(i);return t<0?[e,""]:[e.slice(0,t),e.slice(t+i.length)]}import{existsSync as De,readFileSync as fe}from"fs";var w={classifyCitation:we,citationContexts:ke,citationKindLabel:Te,citationRemediation:Fe,referenceTargets:ve};function we(e){let i=e.join(`
|
|
2
|
-
`).toLowerCase(),t=[],n=A(i,[".scipquery","declaredcouplings","suppression","suppressions","config","configuration","json"]);if(n.length>0)return t.push(`configuration/example terms near citation: ${n.join(", ")}`),{citationKind:"configuration-example",actionTier:"support",reasons:t};let o=A(i,["accepted","intentional","intentionally","retained","historical"]);if(o.length>0)return t.push(`intentional-record terms near citation: ${o.join(", ")}`),{citationKind:"intentional-record",actionTier:"support",reasons:t};let s=A(i,["command","cli","usage","example","run","workflow"]);return s.length>0?(t.push(`guide/reference terms near citation: ${s.join(", ")}`),{citationKind:"guide-reference",actionTier:"signal",reasons:t}):(t.push(e.length>0?"citation appears in prose without config or guide markers":"citation context unavailable"),{citationKind:"behavioral-claim",actionTier:"direct",reasons:t})}function ke(e,i,t){let n;try{n=fe(`${e.config.projectRoot}/${i}`,"utf-8").split(/\r?\n/)}catch{return[]}let o=t.flatMap(Re),s=[];for(let r=0;r<n.length;r+=1){let l=n[r]??"";o.some(a=>l.includes(a))&&s.push(W(n,r))}return s}function Re(e){let i=e.split("/");return[e,`./${e}`,i.slice(-3).join("/"),i.slice(-2).join("/")].filter((t,n,o)=>t.length>0&&o.indexOf(t)===n)}function Te(e){switch(e){case"behavioral-claim":return"a behavioral doc claim";case"configuration-example":return"a configuration example";case"guide-reference":return"a guide reference";case"intentional-record":return"an intentional record"}}function Fe(e,i){switch(e){case"behavioral-claim":return`Re-read ${i} and update the behavioral claim or citation.`;case"configuration-example":return`Verify the configuration example in ${i} still points at the intended file; update only if the example target changed.`;case"guide-reference":return`Verify the guide reference in ${i} still sends readers to the right implementation or command surface.`;case"intentional-record":return`Verify the intentional citation in ${i} is still meant to name this file.`}}function ve(e,i,t){let n=U(t),o=new Set;for(let s of i)xe(e,s,n.get(s)??[])&&o.add(s);return o}function xe(e,i,t){if(t.length===0)return!1;if(!Ae.test(i))return!0;let n=`${e.config.projectRoot}/${i}`;if(!De(n))return!0;let o=fe(n,"utf-8").split(/\r?\n/),s=Ge(o);for(let r of t)for(let l=r.startLine;l<=r.endLine;l+=1)if((o[l]??"").trim()!==""&&!s.has(l))return!0;return!1}var Ae=/\.(?:[cm]?[jt]sx?)$/i;function Ge(e){let i=new Set,t=!1;for(let n=0;n<e.length;n+=1){let o=e[n].trim();!t&&je(o)&&(t=!0),t&&(i.add(n),o.endsWith(";")&&(t=!1))}return i}function je(e){return/^import(?:\s|$)/.test(e)||/^export(?:\s+type)?\s+(?:\*|\{)/.test(e)}import{existsSync as Ee,readFileSync as Be,writeFileSync as Le}from"fs";import{isAbsolute as Ke,join as Ne}from"path";var Pe=25e3,Me=2500,Ie=2500;function He(e){let i=re(e);return i.symbols>=Pe||i.documents>=Me?Ie:void 0}var _e=".scipquery-baseline.json";function j(e,i){return i&&Ke(i)?i:Ne(e.config.projectRoot,i??_e)}function de(e,i={}){let{scope:t}=i,n=He(e),o=[],s=Z(e,{scope:t,...S.dead,scanLimit:n});for(let r of s.symbols)F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||r.kind==="dead-code"&&o.push(`dead:${r.relativePath}:${r.shortName}`);for(let r of ee(e,{scope:t,...S.isolated,scanLimit:n}))F(e,r.relativePath)||v(e,r.symbol,r.relativePath)||o.push(`isolated:${r.relativePath}:${r.shortName}`);for(let r of J(e,{scope:t}))r.kind==="real"&&o.push(`cycle:${ze(r.path)}`);for(let r of ne(e,{scope:t,...S.similar,scanLimit:n}))o.push(`similar:${[r.symbolA,r.symbolB].sort().join("|")}`);for(let r of X(e,{scope:t,...S.extract,scanLimit:n}))o.push(`extract:${r.relativePath}:${r.shortName}`);for(let r of se(e,{scope:t,...S.wrappers,scanLimit:n}))o.push(`wrapper:${r.file}:${r.shortName}`);for(let r of te(e,{scope:t,...S.passthroughs,scanLimit:n}))o.push(`passthrough:${r.file}:${r.shortName}`);for(let r of oe(e,{scope:t,...S.stale,scanLimit:n}))o.push(`stale:${r.file}:${r.shortName}`);for(let r of Q(e,{scope:t,...S.drift,includePatternDeviations:!1}).results)o.push(`drift:${r.kind}:${r.file}:${r.dep}`);return[...new Set(o)].sort()}function ze(e){if(e.length===0)return"";let i=0;for(let t=1;t<e.length;t++)e[t]<e[i]&&(i=t);return[...e.slice(i),...e.slice(0,i)].join(">")}function Mt(e,i={}){let t=de(e,{scope:i.scope}),n=j(e,i.path);return Le(n,JSON.stringify({version:1,findings:t},null,2)+`
|
|
3
|
-
`),{path:n,findingCount:t.length}}function ue(e,i={}){let t=j(e,i.path);if(!Ee(t))throw new Error(`No baseline found at ${t}. Create one with: scip-query health --write-baseline`);let n=JSON.parse(Be(t,"utf-8")),o=new Set(n.findings??[]),s=de(e,{scope:i.scope}),r=new Set(s);return{baselinePath:t,baselineCount:o.size,current:s,newFindings:s.filter(l=>!o.has(l)),fixedFindings:[...o].filter(l=>!r.has(l))}}var ni=["echo","incomplete-migration","co-change-partner","doc-reference","unused-params","new-dead","baseline"];function oi(e,i={}){let t=i.base??"HEAD",{minTogether:n=6,minConfidence:o=.6,maxEchoChecks:s=Number.POSITIVE_INFINITY,maxHelpers:r=Number.POSITIVE_INFINITY,minSimilarity:l=.8,includeBaseline:a=!1,scanLimit:c}=i,y=i.semantic!==!1,h=new Set(i.skip??[]),f=q(e,{base:t}),p=V(e,{base:t,plan:f}),m=p.changedFiles,d=new Set(m),u=new Set(f.changedFileLines),b=new Set([...d,...u]),C=L(e.config.projectRoot,t,K(f,m)),R=mt(e.config.projectRoot,t,f,C),g={base:t,changedFiles:m,changedSymbols:p.changedSymbols.length,checksRun:[],skipped:[],suppressed:[],findings:[],rootCauseGroups:[],note:p.summary.note};if(m.length===0)return g;let $=(x,pe)=>{if(h.has(x)){g.skipped.push({check:x,reason:"skipped via --skip"});return}let ye=g.findings.length,be=g.skipped.length,Ce=g.checksRun.length;N(`diff-gate.check.${x}`,pe,()=>({check:x,changedFiles:m.length,changedSymbols:p.changedSymbols.length,findingsAdded:g.findings.length-ye,skippedAdded:g.skipped.length-be,checksRunAdded:g.checksRun.length-Ce}))};return $("echo",()=>Je(e,p.changedSymbols,d,R,s,l,c,y,g)),$("incomplete-migration",()=>rt(e,t,f,r,c,y,C,g)),$("co-change-partner",()=>st(e,b,n,o,g)),$("doc-reference",()=>dt(e,d,u,f.changedRanges,g)),$("unused-params",()=>ut(e,m,g)),$("new-dead",()=>ht(e,p.changedSymbols,R,g)),a&&$("baseline",()=>bt(e,g)),We(g,e.config.suppressions??[]),g.rootCauseGroups=Ue(g.findings),g}function Ue(e){let i=new Map;for(let t of e){let n=t.groupKey??`${t.check}:${t.id}`,o=i.get(n);o||(o={groupKey:n,check:t.check,severity:t.severity,actionTier:t.actionTier,sourceAnalyzer:t.sourceAnalyzer,rootCauseKey:t.rootCauseKey,count:0,findingIds:[],files:new Set,relatedFiles:new Set,message:t.message,remediation:t.remediation},i.set(n,o)),o.count+=1,o.findingIds.push(t.id),o.severity=Ve(o.severity,t.severity),o.actionTier=qe(o.actionTier,t.actionTier),t.file&&o.files.add(t.file);for(let s of t.relatedFiles??[])o.relatedFiles.add(s)}return[...i.values()].map(t=>({...t,files:[...t.files].sort(),relatedFiles:[...t.relatedFiles].sort()})).sort((t,n)=>n.count-t.count||E(n.severity)-E(t.severity)||t.groupKey.localeCompare(n.groupKey))}function Ve(e,i){return E(i)>E(e)?i:e}function E(e){return e==="error"?2:e==="warning"?1:0}function qe(e,i){return e?i&&he(i)>he(e)?i:e:i}function he(e){return e==="direct"?2:e==="signal"?1:0}function We(e,i){if(i.length===0||e.findings.length===0)return;let t=[];for(let n of e.findings){let o=i.find(s=>Ye(s,n));o?e.suppressed.push({finding:n,suppression:o}):t.push(n)}e.findings=t}function Ye(e,i){return!e.reason||e.reason.trim()===""||e.expiresAt&&Date.parse(e.expiresAt)<=Date.now()||e.id&&e.id!==i.id||e.check&&e.check!==i.check||e.file&&e.file!==i.file?!1:!!(e.id||e.check)}function k(e,i){e.findings.push({...i,suppressionHint:`scip-query: ignore ${i.check} ${i.id} -- <reason>`})}function Je(e,i,t,n,o,s,r,l,a){a.checksRun.push("echo");for(let c of i.slice(0,o)){if(!M(c.symbol)||n(c))continue;let y=ie(e,c.symbol,{minSimilarity:s,limit:5,scanLimit:r,semantic:l,sourceCandidateMode:"target-pruned"}),h=[];for(let d of y){let u=d.fileA===c.file?d.fileB:d.fileA,b=d.fileA===c.file?d.shortNameB:d.shortNameA,C=d.fileA===c.file?d.symbolB:d.symbolA;t.has(u)||h.push({otherFile:u,otherShort:b,otherSymbol:C,similarity:d.similarity,similarityBasis:d.similarityBasis??"callees",sharedEvidence:d.sharedCallees})}if(h.length===0)continue;let f=h[0],p=D("echo",c.symbol,c.file,...h.map(d=>`${d.otherSymbol}|${d.otherFile}`).sort()),m=Ze(c,h);k(a,{id:p,groupKey:p,actionTier:m,check:"echo",severity:"warning",evidence:"heuristic",confidence:f.similarity,file:c.file,symbol:c.symbol,relatedFiles:[...new Set(h.map(d=>d.otherFile))].sort(),message:it(c,h),why:nt(c,h),remediation:ot(m,c.shortName,f.otherShort)})}i.length>o&&a.skipped.push({check:"echo",reason:`echo check capped at ${o} of ${i.length} changed symbols`})}function Ze(e,i){return i.some(n=>Qe(e.symbol,n))?"direct":"signal"}function Qe(e,i){if(i.similarityBasis!=="source-tokens"||i.similarity<.98||i.sharedEvidence.length>8)return!1;let t=T(e),n=T(i.otherSymbol);return!t||!n?!1:t===n?!0:tt(i.sharedEvidence)?!1:Xe(t,n)}function Xe(e,i){let t=ge(e),n=ge(i);if(t.length===0||n.length===0)return!1;let o=new Set(n),s=t.filter(r=>o.has(r)).length;return s>=2&&s/Math.min(t.length,n.length)>=.5}function ge(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").split(/[^A-Za-z0-9]+/).map(i=>i.toLowerCase()).filter(i=>i.length>=2)}var et=new Set(["bytes","crypto","hex","num","random","secret","to","token"]);function tt(e){return e.length>=3&&e.every(i=>et.has(i.toLowerCase()))}function it(e,i){let t=i[0],n=Math.round(t.similarity*100);return i.length===1?`${e.shortName} (${e.file}) is ${n}% similar to established ${t.otherShort} (${t.otherFile})`:`${e.shortName} (${e.file}) resembles ${i.length} established symbol(s); strongest is ${n}% similar to ${t.otherShort} (${t.otherFile})`}function nt(e,i){let t=[`${e.shortName} was changed in this diff.`];for(let n of i.slice(0,3))t.push(`${n.otherShort} is outside this diff and scored ${Math.round(n.similarity*100)}% similar by ${n.similarityBasis} evidence.`),t.push(`Shared evidence: ${n.sharedEvidence.slice(0,5).join(", ")||"(none listed)"}.`);return i.length>3&&t.push(`${i.length-3} additional similar match(es) grouped into this finding.`),t}function ot(e,i,t){return e==="direct"?`Extract or reuse the shared behavior with ${t}, or keep the duplicate with a suppression reason.`:`Review whether ${i} is intentionally parallel to the established implementation(s); extract shared behavior only if the product semantics match.`}function rt(e,i,t,n,o,s,r,l){let a=ae(e,{base:i,maxHelpers:n,diffPlan:t,scanLimit:o,semantic:s,baseContentAt:r});if(!a.available){l.skipped.push({check:"incomplete-migration",reason:"no git history"});return}l.checksRun.push("incomplete-migration"),a.note&&l.skipped.push({check:"incomplete-migration",reason:a.note});for(let c of a.findings){let y=c.leftovers.map(u=>`${u.shortName} (${u.file}, ${Math.round(u.containment*100)}% helper / ${Math.round(u.siteCoverage*100)}% site, ${u.migrationScope})`).join(", "),h=c.leftovers.map(u=>`${u.shortName}: ${u.migrationScope} (${u.migrationScopeReasons[0]})`).join("; "),f=[...c.migratedFiles,...c.leftovers.map(u=>u.file)],p=c.leftovers.length===0?void 0:Math.max(...c.leftovers.map(u=>Math.min(u.containment,u.siteCoverage))),m=c.leftovers.some(u=>u.migrationScope==="possible-subtype"),d=D("incomplete-migration",c.helperSymbol,c.helperFile,f.join("|"));k(l,{id:d,check:"incomplete-migration",severity:"warning",evidence:"heuristic",confidence:p,file:c.helperFile,symbol:c.helperSymbol,relatedFiles:f,message:`new helper ${c.helperShortName} (${c.helperFile}) is wired into ${c.migratedFiles.length} file(s), but ${c.leftovers.length} similar un-migrated site(s) remain: ${y}`,why:[`${c.helperShortName} is new in this diff and already referenced by ${c.migratedFiles.join(", ")}.`,`Helper shape: ${c.helperShape}; ${c.specificHelperCalleeCount}/${c.helperCalleeCount} helper callees are specific enough to score.`,`Unchanged site(s) still contain the helper's callee pattern: ${y}.`,`Migration scope hints: ${h}.`],remediation:m?`Migrate same-scope sites to ${c.helperShortName}; review possible subtype/variant sites before applying the helper.`:`Migrate the remaining sites to ${c.helperShortName}, or confirm they are intentionally different.`})}}function st(e,i,t,n,o){let s=H(e).directionalCoChangePairsForFiles(i,{minTogether:t,minConfidence:0,maxFilesPerCommit:20});if(!s){o.skipped.push({check:"co-change-partner",reason:"no git history"});return}o.checksRun.push("co-change-partner");let r=new Set,l;for(let a of s){let c=i.has(a.fileA),y=i.has(a.fileB);if(c===y)continue;let h=c?a.fileA:a.fileB,f=c?a.fileB:a.fileA,p=c?a.changesA:a.changesB,m=p>0?a.together/p:0;if(m<n||B(f)||B(h)||!me(`${e.config.projectRoot}/${f}`))continue;let d=`${h}|${f}`;if(r.has(d))continue;r.add(d);let u=D("co-change-partner",h,f,String(a.together)),b=_(h,f),C=z({fileA:h,fileB:f,together:a.together,confidence:m,commitScope:a.commitScope,recency:a.recency,subjectContext:a.subjectContext},b,(l??=O(e))(h,f)),R=[h,f].sort().join("|");o.findings.push({id:u,check:"co-change-partner",severity:"warning",evidence:"change-graph",actionTier:"signal",groupKey:`co-change-partner:${R}`,confidence:m,file:h,relatedFiles:[f],sourceAnalyzer:"co-change",rootCauseKey:R,partnerClass:b.partnerClass,partnerClassReasons:b.reasons,commitScope:a.commitScope,recency:a.recency,focusedTogether:a.focusedTogether,broadTogether:a.broadTogether,broadCommitRatio:a.broadCommitRatio,lastTogetherAt:a.lastTogetherAt,recentTogether:a.recentTogether,subjectContext:a.subjectContext,...C?{declaredCouplingSuggestion:C}:{},message:`${h} changed, but ${f} did not \u2014 they change together ${a.together}x (${Math.round(m*100)}% of the time)`,why:[`${h} is in this diff and ${f} is not.`,`Git history shows ${a.together} co-change(s), which is ${Math.round(m*100)}% of changes to the edited side.`,`History context: ${at(a)}.`,`Subject context: ${ct(a.subjectContext)}.`,...lt(a),`Partner class: ${b.partnerClass} (${b.reasons.join("; ")}).`],remediation:C?`Update ${f} alongside this change, declare the coupling "${C.name}", or confirm the coupling no longer holds.`:`Update ${f} alongside this change, or confirm the coupling no longer holds.`})}}function at(e){return`${e.commitScope}/${e.recency}; ${e.focusedTogether} focused, ${e.broadTogether} broad-sweep (${Math.round(e.broadCommitRatio*100)}% broad), ${e.recentTogether} recent, last ${ft(e.lastTogetherAt)}`}function ct(e){let i=e.subjectLabels.length>0?e.subjectLabels.slice(0,5).join(", "):"none inferred",t=e.issueRefs.length>0?e.issueRefs.slice(0,5).join(", "):"none",n=e.sampleSubjects.length>0?e.sampleSubjects.slice(0,3).map(o=>`"${o}"`).join("; "):"none";return`labels ${i}; refs ${t}; samples ${n}; external issue/PR labels ${e.externalIssueLabelStatus}`}function lt(e){let i=[];return e.commitScope==="broad-sweep"&&i.push("Broad-sweep history is weaker than focused co-edits; confirm this is a real coordination contract."),e.recency==="stale"&&i.push("The pair has no co-change in the recent history window; confirm the coupling still holds."),i}function ft(e){return e<=0?"unknown":new Date(e*1e3).toISOString().slice(0,10)}function dt(e,i,t,n,o){o.checksRun.push("doc-reference");let s=w.referenceTargets(e,i,n);if(s.size!==0)for(let r of Y(e,s)){if(t.has(r.doc))continue;let l=r.citedClaims.length>0?r.citedClaims:w.citationContexts(e,r.doc,r.cited),a=w.classifyCitation(l),c=D("doc-reference",r.doc,r.cited.join("|"));k(o,{id:c,check:"doc-reference",severity:"warning",evidence:"change-graph",actionTier:a.actionTier,confidence:1,file:r.doc,relatedFiles:r.cited,citationKind:a.citationKind,citationKindReasons:a.reasons,citedClaims:l,message:`${r.doc} cites ${r.cited.join(", ")} as ${w.citationKindLabel(a.citationKind)} \u2014 changed in this diff, doc untouched`,why:[`${r.cited.join(", ")} changed in this diff.`,`${r.doc} cites the changed file(s) but was not updated in the same diff.`,...a.reasons.map(y=>`Citation kind evidence: ${y}`)],remediation:w.citationRemediation(a.citationKind,r.doc)})}}function ut(e,i,t){t.checksRun.push("unused-params");for(let n of ce(e,{files:i,limit:50})){let o=D("unused-params",n.symbol,n.file,n.unusedTrailing.join("|"));k(t,{id:o,check:"unused-params",severity:"warning",evidence:"heuristic",confidence:.85,file:n.file,startLine:n.startLine,endLine:n.endLine,symbol:n.symbol,message:`${n.shortName} (${n.file}) has trailing unused parameter(s): ${n.unusedTrailing.join(", ")}`,why:[`${n.shortName} is in a changed file.`,`The trailing parameter(s) ${n.unusedTrailing.join(", ")} are not referenced in the function body.`],remediation:"Drop the unused trailing parameters and their call-site arguments."})}}function ht(e,i,t,n){n.checksRun.push("new-dead");let o=new I(e);for(let s of i){if(t(s)||s.fanIn>0||o.fileKind(s.file)==="test"||F(e,s.file)||v(e,s.symbol,s.file)||gt(s.symbol))continue;let r=D("new-dead",s.symbol,s.file);k(n,{id:r,check:"new-dead",severity:"warning",evidence:"graph-fact",confidence:.9,file:s.file,symbol:s.symbol,message:`${s.shortName} (${s.file}) was changed but has zero indexed consumers`,why:[`${s.shortName} is a changed production symbol.`,"The index reports zero consumers for this symbol.","The symbol is not in a detected entry surface or configured live root."],remediation:"Wire it up, or remove it before it becomes permanent dead code."})}}function gt(e){if(P(e)!=="type")return!1;let i=T(e);return i.startsWith("_Assert")||i.startsWith("Assert")}function mt(e,i,t,n){let o=new Map(t.renamedFiles.map(r=>[r.to,r.from])),s=n??L(e,i,K(t));return r=>{let l=o.get(r.file)??r.file,a=T(r.symbol);if(!a)return!1;let c=s(l);return c!==null&&pt(c,a)}}function pt(e,i){return new RegExp(`\\b${yt(i)}\\b`).test(e)}function yt(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function bt(e,i){if(!me(j(e))){i.skipped.push({check:"baseline",reason:"no .scipquery-baseline.json \u2014 run health --write-baseline to enable"});return}i.checksRun.push("baseline");let t=ue(e);for(let n of t.newFindings){let o=le(n),s=D("baseline",n);k(i,{id:s,groupKey:`baseline:${o.sourceAnalyzer}:${o.rootCauseKey}`,check:"baseline",severity:"error",evidence:"baseline",actionTier:o.actionTier,confidence:1,file:o.file,relatedFiles:o.relatedFiles.length>0?o.relatedFiles:void 0,sourceAnalyzer:o.sourceAnalyzer,rootCauseKey:o.rootCauseKey,message:`new ${o.label} vs committed baseline: ${n}`,why:["A committed health baseline exists.","The current health result contains a finding not present in that baseline.",`Underlying analyzer: ${o.sourceAnalyzer}.`,`Inherited action tier: ${o.actionTier}.`,`Root cause key: ${o.rootCauseKey}.`,...o.why],remediation:o.remediation})}}function D(e,...i){return`SQ${Oe("sha256").update([e,...i].join("\0")).digest("hex").slice(0,12).toUpperCase()}`}export{de as a,Mt as b,ue as c,ni as d,oi as e,mt as f};
|
|
4
|
-
//# sourceMappingURL=chunk-RGKRYO22.js.map
|