scip-query 0.10.12 → 0.12.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 +164 -49
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-RUV5IY25.js → chunk-2LQWMYG4.js} +2 -2
- package/dist/{chunk-KZ4MG5NY.js → chunk-2QGE5AEP.js} +2 -2
- package/dist/chunk-4D54JIU3.js +2 -0
- package/dist/{chunk-2GLNBCHB.js → chunk-52Q4JFDW.js} +2 -2
- package/dist/chunk-5AAAEZ2Z.js +2 -0
- package/dist/chunk-64PRNLKP.js +2 -0
- package/dist/chunk-6XA4LDHY.js +2 -0
- package/dist/chunk-72MFTCU5.js +38 -0
- package/dist/chunk-75X52JTA.js +2 -0
- package/dist/{chunk-LEHVP4DY.js → chunk-7ITCOJGD.js} +2 -2
- package/dist/chunk-7JZRFDCU.js +2 -0
- package/dist/{chunk-XRUGSM76.js → chunk-AZLKLZ5S.js} +2 -2
- package/dist/chunk-B4VYXRCQ.js +26 -0
- package/dist/chunk-BCNT6ODA.js +5 -0
- package/dist/chunk-BP2NAIAZ.js +2 -0
- package/dist/chunk-BVNO67DB.js +2 -0
- package/dist/{chunk-XHMVZFA6.js → chunk-CW3KZ7UF.js} +2 -2
- package/dist/{chunk-6BN3EHQE.js → chunk-D64L53WX.js} +2 -2
- package/dist/{chunk-T3AEVJBG.js → chunk-D7J6GZAG.js} +2 -2
- package/dist/chunk-ECVXWZ4Q.js +3 -0
- package/dist/chunk-EDB7Y442.js +2 -0
- package/dist/{chunk-4ISHQ7UW.js → chunk-ETU2I5JM.js} +4 -4
- package/dist/chunk-EXKLAEB4.js +18 -0
- package/dist/chunk-EZ5WDZ2Q.js +3 -0
- package/dist/{chunk-S2MRVIJ5.js → chunk-F5BJSNU5.js} +6 -6
- package/dist/chunk-FBCOFKEC.js +2 -0
- package/dist/chunk-FERAXG6Y.js +72 -0
- package/dist/chunk-FXG3PHVW.js +9 -0
- package/dist/{chunk-XUCZ3RQ5.js → chunk-G2UBOONK.js} +4 -4
- package/dist/chunk-GNG622H3.js +3 -0
- package/dist/{chunk-JS6B76AQ.js → chunk-H2NMIZFD.js} +2 -2
- package/dist/chunk-H7NSJ7L2.js +5 -0
- package/dist/chunk-HSU3M25J.js +21 -0
- package/dist/chunk-HXXMPYEF.js +2 -0
- package/dist/chunk-IRJDYTNZ.js +3 -0
- package/dist/chunk-ISLWJ4PY.js +10 -0
- package/dist/chunk-J5WVNZ6O.js +2 -0
- package/dist/{chunk-UVPY3RUZ.js → chunk-K6UI6EBZ.js} +2 -2
- package/dist/{chunk-MNCQPMCH.js → chunk-KJCDEDQW.js} +2 -2
- package/dist/{chunk-ELC77ZDE.js → chunk-KMVGRIO2.js} +2 -2
- package/dist/chunk-KSUZS77X.js +16 -0
- package/dist/{chunk-A4UTLKHU.js → chunk-L2CX5GHZ.js} +2 -2
- package/dist/chunk-LFM3O5KX.js +2 -0
- package/dist/{chunk-ZUUNREKS.js → chunk-M72ZFN6E.js} +5 -5
- package/dist/chunk-MBKJ7GHT.js +102 -0
- package/dist/chunk-MJKJMWIM.js +2 -0
- package/dist/chunk-MKM7NBZK.js +43 -0
- package/dist/chunk-MTDBHTSF.js +2 -0
- package/dist/chunk-NAH5EAZS.js +6 -0
- package/dist/chunk-NJJ7AS4F.js +2 -0
- package/dist/{chunk-EOLGSSDR.js → chunk-NKT5EMEX.js} +2 -2
- package/dist/{chunk-ANUEY5WV.js → chunk-NLMRJ7SI.js} +2 -2
- package/dist/chunk-NQ75OVUU.js +40 -0
- package/dist/{chunk-TBCHRDAC.js → chunk-O3WDE26W.js} +2 -2
- package/dist/{chunk-VB2EZZPA.js → chunk-OPE5YXFE.js} +2 -2
- package/dist/chunk-ORBRX2QJ.js +2 -0
- package/dist/{chunk-OFXN2BCT.js → chunk-OSWF3HSF.js} +2 -2
- package/dist/{chunk-JJ5SAWBT.js → chunk-OVMUVXKQ.js} +2 -2
- package/dist/{chunk-NTSR6SRP.js → chunk-PH7ZFK6L.js} +2 -2
- package/dist/chunk-PXHPCWX5.js +2 -0
- package/dist/chunk-Q3B3FNCU.js +3 -0
- package/dist/{chunk-SQNHOOJ5.js → chunk-Q7S2DADC.js} +2 -2
- package/dist/{chunk-3XSNW5XB.js → chunk-QARYU7R3.js} +2 -2
- package/dist/chunk-QZ4JVECJ.js +2 -0
- package/dist/{chunk-FX6ULETZ.js → chunk-R5336VHZ.js} +2 -2
- package/dist/chunk-RA5MTIOO.js +2 -0
- package/dist/{chunk-RXINFVBN.js → chunk-RIQED5OU.js} +2 -2
- package/dist/chunk-T2FQ4GHD.js +9 -0
- package/dist/chunk-T6NGEV5I.js +2 -0
- package/dist/chunk-T7VQG55Q.js +2 -0
- package/dist/chunk-TFWDJDGO.js +2 -0
- package/dist/chunk-TG7QSYCJ.js +2 -0
- package/dist/{chunk-DQ6433ZG.js → chunk-TTMKELT7.js} +17 -8
- package/dist/{chunk-DDQONX6B.js → chunk-U7I373V4.js} +2 -2
- package/dist/chunk-UAHZ57BR.js +2 -0
- package/dist/chunk-URSSPS5H.js +2 -0
- package/dist/chunk-V3Z3IOWO.js +2 -0
- package/dist/{chunk-7C6JBBE4.js → chunk-V7CVBPWX.js} +2 -2
- package/dist/{chunk-PWAK75BU.js → chunk-VYF5HA76.js} +2 -2
- package/dist/chunk-WIBFXSYB.js +6 -0
- package/dist/chunk-WS3Z6W3M.js +65 -0
- package/dist/chunk-WXVGNFAO.js +2 -0
- package/dist/chunk-XEMQUN3Z.js +20 -0
- package/dist/chunk-YCPASUCX.js +2 -0
- package/dist/chunk-YDDGCJJG.js +3 -0
- package/dist/{chunk-2UVCH7CQ.js → chunk-YPKBZ77R.js} +2 -2
- package/dist/chunk-YZXV3CU3.js +60 -0
- package/dist/chunk-Z3IPJKJP.js +4 -0
- package/dist/chunk-ZMGBWSFZ.js +2 -0
- package/dist/{chunk-GKB4JJDU.js → chunk-ZOIPAYRP.js} +2 -2
- package/dist/chunk-ZRIOGL7F.js +8 -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 +23 -4
- 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 +57 -14
- 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 +39 -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 +150 -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-63CI3IXR.js +0 -102
- 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-63CI3IXR.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import{a as f,b as R,c as m,d as F,e as N,f as p,h as E}from"./chunk-NABVR6B7.js";import{g as h}from"./chunk-THB6AM3V.js";import{b,c as D,h as _,j as L}from"./chunk-SGTKURU6.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as g}from"./chunk-7S5E7KWT.js";function ge(e,n){return e.all(`SELECT gs.id, gs.symbol, der.document_id, der.start_line, der.end_line, d.relative_path, gs.display_name, gs.documentation
|
|
2
|
-
FROM global_symbols gs
|
|
3
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
4
|
-
JOIN documents d ON der.document_id = d.id
|
|
5
|
-
WHERE ${n.where}
|
|
6
|
-
${e.pathExclusionsFor("d")}
|
|
7
|
-
${O(n.orderBy)}
|
|
8
|
-
${k(n.limit)}`,...n.params??[])}function be(e,n){return e.all(`SELECT
|
|
9
|
-
gs.id,
|
|
10
|
-
gs.symbol,
|
|
11
|
-
c.document_id,
|
|
12
|
-
MIN(c.start_line) AS start_line,
|
|
13
|
-
MAX(c.end_line) AS end_line,
|
|
14
|
-
d.relative_path,
|
|
15
|
-
gs.display_name,
|
|
16
|
-
gs.documentation
|
|
17
|
-
FROM global_symbols gs
|
|
18
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
19
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
20
|
-
JOIN documents d ON c.document_id = d.id
|
|
21
|
-
WHERE m.role = 1
|
|
22
|
-
AND ${n.where}
|
|
23
|
-
${e.pathExclusionsFor("d")}
|
|
24
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path, gs.display_name, gs.documentation
|
|
25
|
-
${O(n.orderBy)}
|
|
26
|
-
${k(n.limit)}`,...n.params??[])}function O(e){return e?`ORDER BY ${e}`:""}function k(e){return typeof e=="number"?`LIMIT ${e}`:""}function w(e){return!e||!e.trim()?null:e.replace(/^```\w*\s*/,"").replace(/\s*```$/,"").replace(/^\(method\)\s*/,"").replace(/^\(property\)\s*/,"").replace(/^\(function\)\s*/,"").replace(/^\(class\)\s*/,"").replace(/^\(interface\)\s*/,"").replace(/^\(enum\)\s*/,"").replace(/^\(type alias\)\s*/,"").replace(/^\(const\)\s*/,"").replace(/^\(var\)\s*/,"").trim()||null}function $(e){if(!e)return null;let n=M(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let i=e.slice(t+1);return(M(i)??i).replace(/\n/g," ")}function M(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function j(e){if(m(e.symbol)!==null)return!1;let t=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(t)}function x(e,n,t={}){let i=new Map;for(let o of n)e.length>0&&!j(o)||i.set(o.id,o);for(let o of e)i.set(o.id,o);let r=[...i.values()];return t.sort?r.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):r}var H=g("file-definitions",{clearGroups:["definition-catalog"]}),W=g("file-function-like-definitions",{clearGroups:["definition-catalog"]}),C=new WeakMap;function I(e,n){return H.get(e,n,()=>{let t=P(e,n);if(t)return t;let i=B(e,n),r=D(e),o=f(e).forFile(n,{text:!0}).text;return r&&o&&Q.write(e,n,b(e,n,o),{projectFingerprint:r,definitions:i.map(s=>({...s}))}),i})}function Y(e,n){return W.get(e,n,()=>{let t=P(e,n);return t?t.filter(i=>i.isFunctionLike):B(e,n,i=>i.isFunctionLike)})}var Q=L({kind:"file-definitions",serialize:K,deserialize:G});function P(e,n){let t=D(e);if(!t)return null;let i=f(e).forFile(n,{text:!0}).text;if(!i)return null;let r=Q.read(e,n,b(e,n,i));return r?U(r,t,n):null}function K(e){return JSON.stringify(e)}function G(e){try{let n=JSON.parse(e);return!_(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function U(e,n,t){if(e.projectFingerprint!==n)return null;let i=[];for(let r of e.definitions){let o=q(r,t);if(!o)return null;i.push(o)}return i}function q(e,n){return!_(e)||typeof e.symbolId!="number"||typeof e.symbol!="string"||typeof e.documentId!="number"||typeof e.startLine!="number"||typeof e.endLine!="number"||e.relativePath!==n||typeof e.leaf!="string"||typeof e.parentTypeName!="string"&&e.parentTypeName!==null||typeof e.isFunctionLike!="boolean"||typeof e.isTypeLike!="boolean"||typeof e.kind!="number"&&e.kind!==null||typeof e.documentation!="string"&&e.documentation!==null||typeof e.enclosingSymbol!="string"&&e.enclosingSymbol!==null?null:{symbolId:e.symbolId,symbol:e.symbol,documentId:e.documentId,startLine:e.startLine,endLine:e.endLine,relativePath:e.relativePath,leaf:e.leaf,parentTypeName:e.parentTypeName,isFunctionLike:e.isFunctionLike,isTypeLike:e.isTypeLike,kind:e.kind,documentation:e.documentation,enclosingSymbol:e.enclosingSymbol}}function B(e,n,t){let i=x(X(e,n),Z(e,n),{sort:!0}).map(J);return t&&(i=i.filter(t)),z(e,n,i)}function X(e,n){return e.all(`SELECT
|
|
27
|
-
gs.id,
|
|
28
|
-
gs.symbol,
|
|
29
|
-
der.document_id,
|
|
30
|
-
der.start_line,
|
|
31
|
-
der.end_line,
|
|
32
|
-
d.relative_path,
|
|
33
|
-
gs.display_name,
|
|
34
|
-
gs.kind,
|
|
35
|
-
gs.documentation,
|
|
36
|
-
gs.enclosing_symbol
|
|
37
|
-
FROM global_symbols gs
|
|
38
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
39
|
-
JOIN documents d ON der.document_id = d.id
|
|
40
|
-
WHERE d.relative_path = ?
|
|
41
|
-
${e.symbolNoiseFor("gs")}
|
|
42
|
-
ORDER BY der.start_line, der.end_line`,n)}function Z(e,n){return e.all(`SELECT
|
|
43
|
-
gs.id,
|
|
44
|
-
gs.symbol,
|
|
45
|
-
c.document_id,
|
|
46
|
-
MIN(c.start_line) AS start_line,
|
|
47
|
-
MAX(c.end_line) AS end_line,
|
|
48
|
-
d.relative_path,
|
|
49
|
-
gs.display_name,
|
|
50
|
-
gs.kind,
|
|
51
|
-
gs.documentation,
|
|
52
|
-
gs.enclosing_symbol
|
|
53
|
-
FROM global_symbols gs
|
|
54
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
55
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
56
|
-
JOIN documents d ON c.document_id = d.id
|
|
57
|
-
WHERE d.relative_path = ?
|
|
58
|
-
AND m.role = 1
|
|
59
|
-
${e.symbolNoiseFor("gs")}
|
|
60
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
61
|
-
ORDER BY start_line, end_line`,n)}function J(e){return{symbolId:e.id,symbol:e.symbol,documentId:e.document_id,startLine:e.start_line,endLine:e.end_line,relativePath:e.relative_path,leaf:N(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:E(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function ke(e,n={}){return V(e,n.scope)}function V(e,n){return S(e,{scope:n,includeIgnored:!1}).flatMap(t=>I(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function we(e,n){return S(e,{scope:n,includeIgnored:!1}).flatMap(t=>Y(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function $e(e,n){let t=T(ee(e,n.scope,n.sqlPrefilter)),i=T(ne(e,n.scope,n.sqlPrefilter)),r=new Set([...t.keys(),...i.keys()]),o=[];for(let s of[...r].sort()){if(e.isIgnored(s))continue;let l=x(t.get(s)??[],i.get(s)??[],{sort:!0}).filter(a=>n.symbolMatches(a.symbol));l.length!==0&&o.push(...z(e,s,l.map(J)))}return o}function ee(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${v("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
62
|
-
gs.id,
|
|
63
|
-
gs.symbol,
|
|
64
|
-
der.document_id,
|
|
65
|
-
der.start_line,
|
|
66
|
-
der.end_line,
|
|
67
|
-
d.relative_path,
|
|
68
|
-
gs.display_name,
|
|
69
|
-
gs.kind,
|
|
70
|
-
gs.documentation,
|
|
71
|
-
gs.enclosing_symbol
|
|
72
|
-
FROM global_symbols gs
|
|
73
|
-
JOIN defn_enclosing_ranges der ON gs.id = der.symbol_id
|
|
74
|
-
JOIN documents d ON der.document_id = d.id
|
|
75
|
-
WHERE 1 = 1
|
|
76
|
-
${e.pathExclusionsFor("d")}
|
|
77
|
-
${i}
|
|
78
|
-
${r}
|
|
79
|
-
${e.symbolNoiseFor("gs")}
|
|
80
|
-
ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function ne(e,n,t){let i=n?"AND d.relative_path LIKE ?":"",r=t?`AND ${v("gs",t)}`:"",o=n?[`%${n}%`]:[];return e.all(`SELECT
|
|
81
|
-
gs.id,
|
|
82
|
-
gs.symbol,
|
|
83
|
-
c.document_id,
|
|
84
|
-
MIN(c.start_line) AS start_line,
|
|
85
|
-
MAX(c.end_line) AS end_line,
|
|
86
|
-
d.relative_path,
|
|
87
|
-
gs.display_name,
|
|
88
|
-
gs.kind,
|
|
89
|
-
gs.documentation,
|
|
90
|
-
gs.enclosing_symbol
|
|
91
|
-
FROM global_symbols gs
|
|
92
|
-
JOIN mentions m ON m.symbol_id = gs.id
|
|
93
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
94
|
-
JOIN documents d ON c.document_id = d.id
|
|
95
|
-
WHERE m.role = 1
|
|
96
|
-
${e.pathExclusionsFor("d")}
|
|
97
|
-
${i}
|
|
98
|
-
${r}
|
|
99
|
-
${e.symbolNoiseFor("gs")}
|
|
100
|
-
GROUP BY gs.id, gs.symbol, c.document_id, d.relative_path
|
|
101
|
-
ORDER BY d.relative_path, start_line, end_line`,...o)}function te(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function v(e,n){return n==="callable"?te(e):ie(e)}function ie(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function T(e){let n=new Map;for(let t of e){let i=n.get(t.relative_path);i?i.push(t):n.set(t.relative_path,[t])}return n}function Ce(e,n,t={}){if(n.length===0)return[];let i=n.flatMap(r=>I(e,r)).filter(r=>!e.isIgnored(r.relativePath));return t.onlyDocumented&&(i=i.filter(r=>r.documentation!==null&&r.documentation!=="")),t.sort&&(i=i.sort((r,o)=>r.relativePath.localeCompare(o.relativePath)||r.startLine-o.startLine||r.endLine-o.endLine)),i.map(r=>({startLine:r.startLine,endLine:r.endLine,symbol:r.symbol,shortName:F(r.symbol),signature:w($(r.documentation)),relativePath:r.relativePath,enclosingSymbol:r.enclosingSymbol}))}function re(e){let n=new Map,t=e.map((i,r)=>({definition:i,index:r,span:i.endLine-i.startLine})).sort((i,r)=>i.span-r.span||i.index-r.index);for(let{definition:i}of t)for(let r=i.startLine;r<=i.endLine;r+=1)n.has(r)||n.set(r,i);return n}function Te(e,n){let t=C.get(e);return t||(t=re(e),C.set(e,t)),t.get(n)??null}function Ae(e,n){let t=I(e,n.relative_path).find(i=>i.symbolId===n.id);return t?{symbolId:t.symbolId,symbol:t.symbol,documentId:t.documentId,startLine:t.startLine,endLine:t.endLine,relativePath:t.relativePath}:{symbolId:n.id,symbol:n.symbol,documentId:n.document_id,startLine:n.start_line,endLine:n.end_line,relativePath:n.relative_path}}function z(e,n,t){let i=f(e).forFile(n,{text:!0}).text,r=h(e,n);return r?de(t,r,i):i?oe(t,i):t}function oe(e,n){let t=n.split(/\r?\n/),i=se(e,t),r=le(e,i),o=ae(r,t);return ce(e,o)}function se(e,n){let t=e.some(r=>y(r.symbol))?fe(n):null,i=new Map;for(let r of e)i.set(r.symbolId,ue(n,t,r));return i}function le(e,n){return e.filter(t=>y(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,i)=>t.startLine-i.startLine||t.definition.startLine-i.definition.startLine||t.definition.symbol.localeCompare(i.definition.symbol))}function ae(e,n){let t=new Map;for(let i=0;i<e.length;i+=1){let r=e[i],o=e[i+1],s=o?Math.max(r.startLine,o.startLine-1):n.length-1;t.set(r.definition.symbolId,{startLine:r.startLine,endLine:pe(n,r.definition,r.startLine,s)})}return t}function ce(e,n){return e.map(t=>{let i=n.get(t.symbolId);return i?{...t,startLine:i.startLine,endLine:i.endLine}:t})}function de(e,n,t=null){let i=new Map;for(let r of n){let o=i.get(r.name);o?o.push(r):i.set(r.name,[r])}return e.map(r=>{if(!me(r)||!r.leaf)return A(r,t);let o=i.get(r.leaf);if(!o||o.length===0)return A(r,t);let s=o[0],l=Math.abs(s.startLine-r.startLine);for(let a=1;a<o.length;a+=1){let c=o[a],d=Math.abs(c.startLine-r.startLine);d<l&&(s=c,l=d)}return{...r,startLine:s.startLine,endLine:s.endLine}})}function me(e){return y(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function A(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),i=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>i.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function ue(e,n,t){if(!y(t.symbol))return t.startLine;let i=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return i;let r=n.get(t.leaf);if(!r||r.length===0)return i;let o=null;for(let s of r){let l=Math.abs(s-t.startLine);(!o||l<o.distance)&&(o={line:s,distance:l})}return o?.line??i}function fe(e){let n=/\b(?:function|def|fn)\s+([A-Za-z_$][\w$]*)/g,t=/\b([A-Za-z_$][\w$]*)\s*[:=]\s*(?:async\s*)?(?:function\b|\()/g,i=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,r=/\b([A-Za-z_$][\w$]*)\s*\(/g,o=new Map,s=(l,a)=>{let c=o.get(l);if(!c){o.set(l,[a]);return}c[c.length-1]!==a&&c.push(a)};for(let l=0;l<e.length;l+=1){let a=e[l]??"";for(let d of a.matchAll(n))d[1]&&s(d[1],l);for(let d of a.matchAll(t))d[1]&&s(d[1],l);let c=a.match(i);c?.[1]&&s(c[1],l);for(let d of a.matchAll(r))d[1]&&s(d[1],l)}return o}function pe(e,n,t,i){let r=Math.max(t,Math.min(e.length-1,i)),o=Math.max(t,Math.min(r,n.endLine)),s=0,l=0,a=!1;for(let c=t;c<=r;c+=1){let d=ye(e[c]??"");for(let u of d)u==="{"?(s+=1,a=!0):u==="}"?s=Math.max(0,s-1):u==="("?l+=1:u===")"&&(l=Math.max(0,l-1));if(a&&s===0||!a&&l===0&&c>=o)return c}return o}function ye(e){let n="",t=null,i=!1;for(let r=0;r<e.length;r+=1){let o=e[r],s=e[r+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-r);break}if(t){if(i){i=!1,n+=" ";continue}if(o==="\\"){i=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function y(e){return e.includes("().")}function Qe(e){let n=R(e);if("kind"in n)return[];let t=[];for(let i=n.descriptors.length-2;i>=0;i-=1){let r=n.descriptors[i];r?.suffix==="type"&&r.name&&t.push(r.name)}return t}export{ge as a,be as b,w as c,$ as d,x as e,I as f,ke as g,V as h,we as i,$e as j,Ce as k,re as l,Te as m,Ae as n,Qe as o};
|
|
102
|
-
//# sourceMappingURL=chunk-63CI3IXR.js.map
|
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
|