scip-query 0.14.0 → 0.16.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -2
- package/README.md +158 -62
- package/dist/augment-vue-worker.js +1 -1
- package/dist/chunk-2EU6WVR3.js +3 -0
- package/dist/chunk-2HFXPIBT.js +2 -0
- package/dist/chunk-2LGPMYS2.js +35 -0
- package/dist/chunk-2Y7YX54K.js +16 -0
- package/dist/chunk-363TZ64I.js +2 -0
- package/dist/chunk-3I34FZ6R.js +2 -0
- package/dist/chunk-3LAKH6BV.js +2 -0
- package/dist/chunk-3M2UCPFS.js +3 -0
- package/dist/chunk-3OPIMH42.js +2 -0
- package/dist/{chunk-QZOAOLLZ.js → chunk-3YAZH3JU.js} +2 -2
- package/dist/chunk-5P26M63Y.js +2 -0
- package/dist/{chunk-72FR7KEZ.js → chunk-5TVNLPUM.js} +14 -12
- package/dist/chunk-5UKDCXVC.js +5 -0
- package/dist/{chunk-R7U2I55B.js → chunk-5XDNFOAH.js} +2 -2
- package/dist/chunk-62Y3PC27.js +4 -0
- package/dist/chunk-6DNE65QS.js +40 -0
- package/dist/{chunk-N2OTJWC2.js → chunk-6EVORGCB.js} +2 -2
- package/dist/chunk-6GZ7LM7S.js +2 -0
- package/dist/chunk-753JWTUH.js +3 -0
- package/dist/chunk-7II7NFRV.js +4 -0
- package/dist/{chunk-M7EEHYSU.js → chunk-7RAS466A.js} +2 -2
- package/dist/chunk-A46JTKTM.js +5 -0
- package/dist/{chunk-2XRXEIRK.js → chunk-AAMZRDJT.js} +2 -2
- package/dist/chunk-AMPN2VMF.js +3 -0
- package/dist/{chunk-6XA4LDHY.js → chunk-B3X6KU75.js} +2 -2
- package/dist/chunk-BFWVHD2P.js +16 -0
- package/dist/chunk-BVHP2B4D.js +61 -0
- package/dist/{chunk-BUNDZ6K2.js → chunk-BVUA3GZC.js} +2 -2
- package/dist/{chunk-EDSD3VJK.js → chunk-CKIAEVGM.js} +2 -2
- package/dist/chunk-CM4EZLW4.js +2 -0
- package/dist/chunk-CS3FXTUC.js +2 -0
- package/dist/chunk-CVBS2FD4.js +2 -0
- package/dist/chunk-D5OXYOJP.js +7 -0
- package/dist/chunk-DA34GNNO.js +29 -0
- package/dist/chunk-DKK2H4D7.js +7 -0
- package/dist/chunk-EBSSCVR4.js +5 -0
- package/dist/{chunk-OXTM2RX3.js → chunk-EVCSXWER.js} +2 -2
- package/dist/chunk-FFIYGYQR.js +67 -0
- package/dist/chunk-G4KQ7S74.js +20 -0
- package/dist/{chunk-44P4SJFN.js → chunk-GWWYLYD3.js} +2 -2
- package/dist/chunk-HGUNWXJX.js +2 -0
- package/dist/chunk-HLRWOFXC.js +9 -0
- package/dist/{chunk-YQKECTPV.js → chunk-IRIM3SUR.js} +2 -2
- package/dist/chunk-JHK2DMUQ.js +4 -0
- package/dist/chunk-JQ2PCFZW.js +3 -0
- package/dist/chunk-JRFCWCOD.js +16 -0
- package/dist/chunk-JXAJDINF.js +2 -0
- package/dist/chunk-K32ZOW3P.js +2 -0
- package/dist/{chunk-3H5OSDF7.js → chunk-KI4WPR7Q.js} +2 -2
- package/dist/{chunk-43GKP6LI.js → chunk-KP2DJY7D.js} +2 -2
- package/dist/{chunk-YTVKPJXW.js → chunk-L27UIF3E.js} +2 -2
- package/dist/chunk-LT6AHYVY.js +18 -0
- package/dist/chunk-MCNWCJYL.js +11 -0
- package/dist/{chunk-K6UI6EBZ.js → chunk-MZB3DTHW.js} +2 -2
- package/dist/chunk-NLRWGGPY.js +8 -0
- package/dist/chunk-NLVKD45E.js +13 -0
- package/dist/chunk-OO6S4ECV.js +112 -0
- package/dist/{chunk-QYOPMTZ6.js → chunk-OYGKBDAD.js} +2 -2
- package/dist/chunk-P5QZILZ4.js +2 -0
- package/dist/chunk-P5XHIJHI.js +2 -0
- package/dist/chunk-PCCMMI2M.js +3 -0
- package/dist/{chunk-2TPCIPYA.js → chunk-Q65QYKU7.js} +2 -2
- package/dist/{chunk-K7SPOJHZ.js → chunk-QB7NRST4.js} +2 -2
- package/dist/{chunk-7JZRFDCU.js → chunk-QSNG3NHQ.js} +2 -2
- package/dist/chunk-QVZSWLLZ.js +2 -0
- package/dist/chunk-RLB7FZKR.js +10 -0
- package/dist/{chunk-KYB7FPXT.js → chunk-RPMT6MTX.js} +2 -2
- package/dist/chunk-RQWNF2RM.js +2 -0
- package/dist/chunk-RYFIRFYJ.js +4 -0
- package/dist/{chunk-QARYU7R3.js → chunk-S2FZILCF.js} +2 -2
- package/dist/{chunk-HV27H2V2.js → chunk-S3IXCXW2.js} +2 -2
- package/dist/{chunk-TYCZ7S4I.js → chunk-S5MTSES5.js} +2 -2
- package/dist/chunk-S5RZQA6V.js +2 -0
- package/dist/{chunk-PEHDARNC.js → chunk-SEEJPIWG.js} +2 -2
- package/dist/chunk-SOCS3467.js +2 -0
- package/dist/chunk-U6BJVXWQ.js +2 -0
- package/dist/chunk-UO4IADXJ.js +38 -0
- package/dist/{chunk-ZEO4CXQR.js → chunk-VLSI5MYU.js} +2 -2
- package/dist/chunk-VSQRU3AP.js +2 -0
- package/dist/chunk-VYQY75NA.js +2 -0
- package/dist/{chunk-NOKUZU56.js → chunk-VZCR3VQY.js} +2 -2
- package/dist/chunk-W3ZVRLCH.js +2 -0
- package/dist/chunk-WA64GKWB.js +20 -0
- package/dist/chunk-WFRZGMWJ.js +71 -0
- package/dist/chunk-WN6XEYVX.js +2 -0
- package/dist/chunk-XAEU4ROB.js +101 -0
- package/dist/chunk-XBPAJASV.js +2 -0
- package/dist/{chunk-GY3HAWUA.js → chunk-XC6PUFNN.js} +2 -2
- package/dist/chunk-Y42DMR6F.js +6 -0
- package/dist/chunk-YCVYOV4A.js +7 -0
- package/dist/{chunk-WPZPB42I.js → chunk-YD37KSEK.js} +2 -2
- package/dist/{chunk-V5W7H7V4.js → chunk-YFEJIYWH.js} +2 -2
- package/dist/chunk-YSUD2S7T.js +3 -0
- package/dist/{chunk-KJCDEDQW.js → chunk-ZEKBAMCN.js} +2 -2
- package/dist/chunk-ZHGUZKJL.js +2 -0
- package/dist/cli.js +587 -305
- package/dist/{config-types-BrHl3Bge.d.ts → config-types-SVkUIufk.d.ts} +10 -2
- package/dist/{db-_Bdx0E1W.d.ts → db-CS0TuVH6.d.ts} +1 -1
- package/dist/{git-history-Dao3_Pu9.d.ts → git-history-ChNHbfZQ.d.ts} +2 -1
- package/dist/{health-BEZ1Rt0S.d.ts → health-Btal3mQi.d.ts} +4 -4
- package/dist/index.d.ts +7 -5
- package/dist/index.js +1 -19
- package/dist/queries/affected.d.ts +2 -2
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.d.ts +8 -2
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.d.ts +2 -2
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +2 -2
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +2 -2
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +2 -2
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +4 -3
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +2 -2
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +3 -3
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.d.ts +5 -4
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.d.ts +2 -2
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.d.ts +2 -2
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.d.ts +2 -2
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.d.ts +2 -2
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.d.ts +12 -3
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +2 -2
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/deep-chains.d.ts +8 -3
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.d.ts +2 -2
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +5 -4
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -3
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +4 -2
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +2 -2
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +3 -3
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.d.ts +2 -2
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.d.ts +11 -5
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.d.ts +2 -2
- package/dist/queries/health.d.ts +3 -3
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.d.ts +2 -2
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.d.ts +2 -2
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +2 -2
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.d.ts +3 -3
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +5 -5
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.d.ts +2 -2
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.d.ts +2 -2
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.d.ts +2 -2
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.d.ts +2 -2
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -2
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.d.ts +2 -2
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +3 -3
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +4 -4
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +4 -2
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +4 -2
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +2 -2
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.d.ts +4 -2
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +2 -2
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +2 -2
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +2 -2
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.d.ts +2 -2
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +2 -2
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.d.ts +2 -2
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +2 -2
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.d.ts +2 -2
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.d.ts +2 -2
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/stats.d.ts +2 -2
- package/dist/queries/surface.d.ts +2 -2
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.d.ts +2 -2
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +2 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +2 -2
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/trace.d.ts +2 -2
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.d.ts +2 -2
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +2 -2
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.d.ts +2 -2
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +2 -2
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.d.ts +4 -2
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.d.ts +4 -2
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.d.ts +2 -2
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/queries/wrapper-candidates.d.ts +2 -2
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +256 -12
- package/dist/reindex.d.ts +29 -3
- package/dist/reindex.js +251 -22
- package/dist/runtime.d.ts +8 -4
- package/dist/runtime.js +2 -2
- package/dist/rust-semantic-session-server.js +2 -0
- package/dist/rust-semantic-session-worker.js +2 -0
- package/dist/rust-semantic-worker.js +2 -0
- package/dist/{scip-cli-C7cg4ZHR.d.ts → scip-cli-BKL-26TZ.d.ts} +2 -2
- package/dist/{symbol-types-DaoeXKUt.d.ts → symbol-types-BgWU6lhL.d.ts} +2 -0
- package/dist/watch-server.js +42 -0
- package/docs/AGENT_GUIDE.md +110 -34
- package/docs/AI_FAILURE_MODES.md +8 -3
- package/docs/COMMAND_REFERENCE.md +11 -6
- package/docs/REGEX_POLICY.md +3 -1
- package/docs/accuracy-audit-checklist.md +300 -0
- package/docs/accuracy-hardening-goal.md +493 -54
- package/docs/analyzer-inventory.md +31 -23
- package/docs/analyzer-validation-ledger.md +51 -21
- package/package.json +2 -1
- package/scripts/build-scip-windows.mjs +7 -7
- package/skills/_shared/SKILL.md +21 -18
- package/skills/scip-calibrate/SKILL.md +9 -3
- package/skills/scip-hyper-optimization/SKILL.md +5 -1
- package/skills/scip-query/SKILL.md +1 -1
- package/skills/scip-setup/SKILL.md +104 -4
- package/skills/scip-verify/SKILL.md +24 -13
- package/dist/chunk-27HMTUJE.js +0 -3
- package/dist/chunk-27XEGMCT.js +0 -7
- package/dist/chunk-3AMWF6V5.js +0 -3
- package/dist/chunk-5AAAEZ2Z.js +0 -2
- package/dist/chunk-5JRMZMLM.js +0 -2
- package/dist/chunk-5VY3RIEI.js +0 -38
- package/dist/chunk-6JUAGXR4.js +0 -4
- package/dist/chunk-6KDOYKCB.js +0 -40
- package/dist/chunk-6KMTPNZL.js +0 -3
- package/dist/chunk-7COVQPQQ.js +0 -9
- package/dist/chunk-7S5E7KWT.js +0 -2
- package/dist/chunk-7TVFPOD7.js +0 -102
- package/dist/chunk-A6KSEIRN.js +0 -61
- package/dist/chunk-AAMURYOK.js +0 -4
- package/dist/chunk-BP7S6V3M.js +0 -20
- package/dist/chunk-BRBF3E5X.js +0 -35
- package/dist/chunk-BZXE3HO4.js +0 -6
- package/dist/chunk-CXQQOXSI.js +0 -10
- package/dist/chunk-EVZSAR3S.js +0 -2
- package/dist/chunk-GMOEX7EV.js +0 -2
- package/dist/chunk-GNG622H3.js +0 -3
- package/dist/chunk-GUDKRIGW.js +0 -7
- package/dist/chunk-GULVO6NF.js +0 -43
- package/dist/chunk-HZZQKNVE.js +0 -2
- package/dist/chunk-I4R3SNMR.js +0 -2
- package/dist/chunk-IMQFJ53K.js +0 -2
- package/dist/chunk-ISLWJ4PY.js +0 -10
- package/dist/chunk-IUSSGHJO.js +0 -2
- package/dist/chunk-J5WVNZ6O.js +0 -2
- package/dist/chunk-JJUX2OAP.js +0 -2
- package/dist/chunk-JZBGTSAB.js +0 -13
- package/dist/chunk-K5N5RNGM.js +0 -2
- package/dist/chunk-KSJ544IV.js +0 -5
- package/dist/chunk-LY7NMOBW.js +0 -2
- package/dist/chunk-N23FT4EZ.js +0 -2
- package/dist/chunk-NCVFKOLB.js +0 -2
- package/dist/chunk-PESEPWZO.js +0 -2
- package/dist/chunk-PMY4UFGV.js +0 -2
- package/dist/chunk-Q7PWDXL5.js +0 -5
- package/dist/chunk-QVGFVRKD.js +0 -2
- package/dist/chunk-R5336VHZ.js +0 -2
- package/dist/chunk-RLB6SG25.js +0 -2
- package/dist/chunk-SFDVBARK.js +0 -2
- package/dist/chunk-TG7QSYCJ.js +0 -2
- package/dist/chunk-U3VMUDXJ.js +0 -2
- package/dist/chunk-UHPWZCYQ.js +0 -3
- package/dist/chunk-URSSPS5H.js +0 -2
- package/dist/chunk-WIBFXSYB.js +0 -6
- package/dist/chunk-WMO2VZZK.js +0 -3
- package/dist/chunk-WS3Z6W3M.js +0 -65
- package/dist/chunk-X3DTIEMU.js +0 -18
- package/dist/chunk-X5C43YVI.js +0 -2
- package/dist/chunk-X7CHWTZ2.js +0 -72
- package/dist/chunk-XC2PJOVM.js +0 -3
- package/dist/chunk-XDESMVOL.js +0 -4
- package/dist/chunk-XZBLZHXL.js +0 -16
- package/dist/chunk-ZMGBWSFZ.js +0 -2
|
@@ -27,7 +27,7 @@ Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
|
27
27
|
|
|
28
28
|
| Command | Purpose | When |
|
|
29
29
|
| --- | --- | --- |
|
|
30
|
-
| `scip-query setup --json` | Bootstrap this project: install agent skills, refresh the index, verify capabilities, and report health | Run setup: install skills, refresh the index, report health. |
|
|
30
|
+
| `scip-query setup --json` | Bootstrap this project: enable automatic indexing, install agent skills, refresh the index, verify capabilities, and report health | Run setup: install skills, refresh the index, report health. |
|
|
31
31
|
| `scip-query doctor` | Diagnose config, index freshness, dependency readiness, and project capabilities | Resolve blockers: human diagnostic for config, index, and dependencies. |
|
|
32
32
|
| `scip-query status --json` | Show index status for this project | Resolve blockers: machine surface for freshness and config. |
|
|
33
33
|
| `scip-query capabilities --matrix` | Report which evidence and verification capabilities are available in this project | Resolve blockers: which evidence/verification capabilities are available. |
|
|
@@ -56,6 +56,40 @@ This step is complete only when a clean working tree produces a finding-free `di
|
|
|
56
56
|
2. Do not run `scip-query setup-ci` unless the user explicitly asks for CI setup.
|
|
57
57
|
3. Treat unavailable capabilities as unproven, not clean.
|
|
58
58
|
4. Keep `.scipquery.json` minimal and evidence-backed.
|
|
59
|
+
5. Let setup install detected AST parser packages and supported indexers; do not
|
|
60
|
+
make users reproduce package-manager commands unless setup reports a blocker.
|
|
61
|
+
6. A demand-started service or Rust helper in `stopped` state can still be
|
|
62
|
+
correctly configured. Availability comes from capabilities; lifecycle state
|
|
63
|
+
only says whether work currently keeps the helper awake.
|
|
64
|
+
|
|
65
|
+
## What Setup Owns
|
|
66
|
+
|
|
67
|
+
`scip-query setup` is the bootstrap orchestrator. In a terminal it opens an
|
|
68
|
+
interactive checklist by default. For an agent or script, `scip-query setup
|
|
69
|
+
--json` runs the recommended non-interactive path and returns every result.
|
|
70
|
+
|
|
71
|
+
The command:
|
|
72
|
+
|
|
73
|
+
- detects supported project languages and lets a terminal user select them;
|
|
74
|
+
- installs or repairs supported language indexers when a safe installer exists;
|
|
75
|
+
- installs the Tree-sitter runtime and detected language grammars from the
|
|
76
|
+
versions pinned by the installed scip-query package;
|
|
77
|
+
- installs bundled agent skills and checkout-local Codex/Claude hooks unless
|
|
78
|
+
explicitly skipped;
|
|
79
|
+
- enables demand-started automatic incremental indexing unless the repository
|
|
80
|
+
has or selects an explicit opt-out;
|
|
81
|
+
- builds or reuses language/project shards and publishes one atomic SQLite
|
|
82
|
+
generation with recovery state;
|
|
83
|
+
- starts or reuses the clean-idle project service and verifies its lifecycle;
|
|
84
|
+
- checks TypeScript and Rust semantic readiness, compiler/checker readiness,
|
|
85
|
+
representative commands, and optional health output;
|
|
86
|
+
- reports repository, checkout, user-environment, and rebuildable runtime state
|
|
87
|
+
separately.
|
|
88
|
+
|
|
89
|
+
Do not manually install AST grammar packages before trying setup. If npm uses
|
|
90
|
+
script approval and native packages remain unavailable, report the pending
|
|
91
|
+
packages and ask the user to approve them; a package must not approve its own
|
|
92
|
+
install scripts.
|
|
59
93
|
|
|
60
94
|
## Workflow
|
|
61
95
|
|
|
@@ -75,6 +109,11 @@ This step is complete only when the repository root and runnable `scip-query` co
|
|
|
75
109
|
scip-query setup --json
|
|
76
110
|
```
|
|
77
111
|
|
|
112
|
+
When a human is operating the terminal, prefer plain `scip-query setup` so they
|
|
113
|
+
can review the checklist with arrow keys and Space. Use `scip-query setup --yes`
|
|
114
|
+
to accept recommended defaults without prompting. JSON mode is intentionally
|
|
115
|
+
non-interactive and suitable for agents.
|
|
116
|
+
|
|
78
117
|
Use `scip-query setup --no-hooks --json` when project-local Codex or Claude Code lifecycle hooks should not be written. Use `scip-query setup --git-hook --json` only when the user wants the local pre-commit diff gate.
|
|
79
118
|
|
|
80
119
|
This step is complete only when setup reports ready, partial, or blocked and names every written, skipped, or blocked artifact.
|
|
@@ -92,15 +131,72 @@ scip-query config-validate --json
|
|
|
92
131
|
|
|
93
132
|
This step is complete only when each blocker is fixed, unavailable with reason, or waiting on a named external action.
|
|
94
133
|
|
|
95
|
-
### 4.
|
|
134
|
+
### 4. Verify the language-specific optimal path
|
|
135
|
+
|
|
136
|
+
#### TypeScript, JavaScript, and Vue
|
|
137
|
+
|
|
138
|
+
Require all applicable capability rows to explain their state:
|
|
139
|
+
|
|
140
|
+
- `scip-typescript` is runnable for SCIP indexing;
|
|
141
|
+
- the detected Tree-sitter TypeScript/JavaScript parser is available for source
|
|
142
|
+
facts;
|
|
143
|
+
- ts-morph semantic readiness is available for TypeScript;
|
|
144
|
+
- the demand-started service is enabled and status exposes TypeScript semantic
|
|
145
|
+
and TypeScript index session counters.
|
|
146
|
+
|
|
147
|
+
For a real multi-project TypeScript monorepo, set
|
|
148
|
+
`indexer.typescript.projectMode: "workspace"`. This makes project/tsconfig
|
|
149
|
+
boundaries the sub-shards: a changed project and its project-reference,
|
|
150
|
+
workspace-package, or tsconfig-path dependents rebuild while unrelated project
|
|
151
|
+
shards are reused. Use `indexer.typescript.projects` only when automatic
|
|
152
|
+
discovery is too broad; a non-empty list is authoritative. Do not enable
|
|
153
|
+
workspace mode for a single-project repository merely to seek speed—the normal
|
|
154
|
+
incremental document producer and persistent ts-morph service already reuse
|
|
155
|
+
unchanged work.
|
|
156
|
+
|
|
157
|
+
#### Rust
|
|
158
|
+
|
|
159
|
+
Require these distinct facts:
|
|
160
|
+
|
|
161
|
+
- `rust-analyzer` is runnable and supports `rust-analyzer scip` for indexing;
|
|
162
|
+
- the Tree-sitter Rust grammar is available for source facts;
|
|
163
|
+
- Rust semantic readiness is available for compiler-backed references,
|
|
164
|
+
callees, signatures, and module/use evidence;
|
|
165
|
+
- status reports the durable Rust transport with worker fallback. `stopped` is
|
|
166
|
+
healthy when no semantic request currently needs the clean-idle helper.
|
|
167
|
+
|
|
168
|
+
If rust-analyzer is missing and rustup is available, setup can run `rustup
|
|
169
|
+
component add rust-analyzer`. `SCIP_RUST_SEMANTIC_DURABLE_SESSION=0` is an
|
|
170
|
+
explicit worker-only fallback, not the optimal default.
|
|
171
|
+
|
|
172
|
+
#### Other languages
|
|
173
|
+
|
|
174
|
+
Trust the capability matrix, not a language name. Setup may install supported
|
|
175
|
+
indexers automatically (for example Python or Go), may provide only source
|
|
176
|
+
facts through a detected Tree-sitter grammar, or may report a manual install
|
|
177
|
+
URL. A missing semantic provider must be reported as unsupported, never as a
|
|
178
|
+
clean semantic analysis.
|
|
179
|
+
|
|
180
|
+
Verification:
|
|
181
|
+
|
|
182
|
+
```bash
|
|
183
|
+
scip-query status --capabilities
|
|
184
|
+
scip-query reindex --json
|
|
185
|
+
scip-query watch --status --json
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
This step is complete only when every selected language has an explicit
|
|
189
|
+
indexing/source/semantic/checker verdict and the published generation is fresh.
|
|
190
|
+
|
|
191
|
+
### 5. Calibrate config only when needed
|
|
96
192
|
|
|
97
193
|
Run `scip-query init` only when `.scipquery.json` is absent and the project needs config. Add settings only for observed repo facts: explicit languages, indexer projects, entry roots, declared couplings, locality boundaries, or accepted suppressions.
|
|
98
194
|
|
|
99
|
-
For TypeScript monorepos, prefer `indexer.typescript.projectMode: "workspace"` when multiple project shards are real. Add `indexerConcurrency` only when measured cold-index timing or memory pressure justifies it.
|
|
195
|
+
For TypeScript monorepos, prefer `indexer.typescript.projectMode: "workspace"` when multiple project shards are real. Add `indexerConcurrency` only when measured cold-index timing or memory pressure justifies it. Keep `watch.enabled: true` for the designed demand-started lifecycle unless the user explicitly opts out.
|
|
100
196
|
|
|
101
197
|
This step is complete only when config validates and every setting has a reason.
|
|
102
198
|
|
|
103
|
-
###
|
|
199
|
+
### 6. Hand off cleanup
|
|
104
200
|
|
|
105
201
|
After setup, invoke `scip-cleanup-audit` when the user wants a report or `scip-cleanup-improve` when the user wants autonomous cleanup.
|
|
106
202
|
|
|
@@ -116,6 +212,10 @@ Health:
|
|
|
116
212
|
- dossier:
|
|
117
213
|
Written or changed:
|
|
118
214
|
- files:
|
|
215
|
+
Runtime:
|
|
216
|
+
- automatic indexing:
|
|
217
|
+
- TypeScript project/index sessions:
|
|
218
|
+
- Rust semantic transport/lifecycle:
|
|
119
219
|
Next:
|
|
120
220
|
- cleanup audit/improve, CI setup, or external blocker
|
|
121
221
|
```
|
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
name: scip-verify
|
|
3
3
|
description: Verify finished code, docs, config, refactor, cleanup, setup, React, Vue, or API changes with scip-query. Use before committing or when the user asks whether a change is wired, safe, regression-free, or ready.
|
|
4
4
|
commands:
|
|
5
|
-
- template:
|
|
6
|
-
when:
|
|
7
|
-
- template:
|
|
8
|
-
when:
|
|
9
|
-
- template:
|
|
10
|
-
when:
|
|
11
|
-
- template:
|
|
12
|
-
when:
|
|
13
|
-
- template:
|
|
14
|
-
when:
|
|
15
|
-
- template:
|
|
16
|
-
when:
|
|
5
|
+
- template: 'scip-query doctor'
|
|
6
|
+
when: 'Prove the workspace: index freshness and dependency readiness.'
|
|
7
|
+
- template: 'scip-query status --capabilities'
|
|
8
|
+
when: 'Prove the workspace: which evidence and verification capabilities are available.'
|
|
9
|
+
- template: 'scip-query diff-impact --json'
|
|
10
|
+
when: 'Assess the diff: changed symbols and downstream consumers.'
|
|
11
|
+
- template: 'scip-query diff-gate --json'
|
|
12
|
+
when: 'Run the gate: the primary blocker for diff-specific risk.'
|
|
13
|
+
- template: 'scip-query health --baseline'
|
|
14
|
+
when: 'Check health: compare findings against the committed baseline.'
|
|
15
|
+
- template: 'scip-query doc-drift --json --full'
|
|
16
|
+
when: 'Check docs: run when docs, AGENTS.md, or command surfaces changed.'
|
|
17
17
|
---
|
|
18
18
|
|
|
19
19
|
# scip-verify
|
|
@@ -82,9 +82,14 @@ If it reports findings, fix them or record the acceptance reason. If a suppressi
|
|
|
82
82
|
|
|
83
83
|
```bash
|
|
84
84
|
scip-query suppress <id> --reason "<specific reason>"
|
|
85
|
-
scip-query config-validate
|
|
86
85
|
```
|
|
87
86
|
|
|
87
|
+
`suppress` writes one file per suppression under `.scipquery/suppressions/` —
|
|
88
|
+
commit that file with your change. Suppressing is a real decision, not a
|
|
89
|
+
bypass: every suppression counts against that detector's precision in
|
|
90
|
+
`scip-query effectiveness`, while a same-HEAD clean rerun after fixing the
|
|
91
|
+
finding earns verified credit. Prefer the fix whenever the finding is real.
|
|
92
|
+
|
|
88
93
|
This step is complete only when `diff-gate` passes or every finding has a durable explanation.
|
|
89
94
|
|
|
90
95
|
### 5. Check health, docs, and config when relevant
|
|
@@ -117,23 +122,29 @@ End with:
|
|
|
117
122
|
Verification: PASS/FAIL
|
|
118
123
|
|
|
119
124
|
Environment:
|
|
125
|
+
|
|
120
126
|
- doctor:
|
|
121
127
|
- status:
|
|
122
128
|
|
|
123
129
|
Diff:
|
|
130
|
+
|
|
124
131
|
- changed files/symbols:
|
|
125
132
|
- unexpected blast radius:
|
|
126
133
|
|
|
127
134
|
Postchecks:
|
|
135
|
+
|
|
128
136
|
- <command>: <result>
|
|
129
137
|
|
|
130
138
|
Gate:
|
|
139
|
+
|
|
131
140
|
- `scip-query diff-gate --json`: <result>
|
|
132
141
|
|
|
133
142
|
Health/docs/config:
|
|
143
|
+
|
|
134
144
|
- <commands and results>
|
|
135
145
|
|
|
136
146
|
Remaining risk:
|
|
147
|
+
|
|
137
148
|
- <accepted findings, unavailable capabilities, or checks not run>
|
|
138
149
|
```
|
|
139
150
|
|
package/dist/chunk-27HMTUJE.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as y,b as d,e as b,n as C}from"./chunk-7TVFPOD7.js";import{c as M,d as L,e as Q,g as I,h as E,i as K}from"./chunk-X5C43YVI.js";function se(e,n){return O(e,n).match}function O(e,n){let t=z(e,n.trim()).filter(r=>!e.isIgnored(r.relative_path));if(t.length>0)return S(e,t);let o=G(e,n);if(o&&!e.isIgnored(o.relative_path))return S(e,[o]);let i=W(e,n);return i.length>0?S(e,i):X(e,n)}function W(e,n){let t=N(n),o=x(t);if(!o)return[];let i=`%${o.path}%`,r=o.leaf;return j(e,i,r,t)}function j(e,n,t,o){let i=b([],[...q(e,n,t),...T(e,n,t)]).filter(r=>!e.isIgnored(r.relative_path)).filter(r=>f(r,o)>1);return i.sort((r,a)=>f(a,o)-f(r,o)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.start_line-a.start_line||r.symbol.localeCompare(a.symbol)),i}function q(e,n,t){return y(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function T(e,n,t){return d(e,{where:"d.relative_path LIKE ? AND (gs.display_name = ? OR gs.symbol LIKE ?)",params:[n,t,`%/${t}.%`]})}function X(e,n){let t=N(n),o=P(n),i=V(e,o),r=ee(i,n,t).filter(s=>!e.isIgnored(s.relative_path));if(r.length>0)return S(e,r);let a=[];for(let s of i){if(e.isIgnored(s.relative_path))continue;let c=Y(s,n,t,o);c<=0||a.push({row:s,score:c})}return a.sort((s,c)=>c.score-s.score||s.row.end_line-s.row.start_line-(c.row.end_line-c.row.start_line)||s.row.relative_path.localeCompare(c.row.relative_path)||s.row.symbol.localeCompare(c.row.symbol)),S(e,a.map(s=>s.row))}function S(e,n){let t=n.map(i=>C(e,i)),o=t[0]??null;return{match:o,candidates:o?Z(t,o):[],total:t.length}}function Z(e,n){let t=new Set([`${n.symbolId}:${n.relativePath}:${n.startLine}`]),o=[];for(let i of e){let r=`${i.symbolId}:${i.relativePath}:${i.startLine}`;if(!t.has(r)&&(t.add(r),o.push({symbol:i.symbol,shortName:L(i.symbol),relativePath:i.relativePath,startLine:i.startLine}),o.length>=5))break}return o}function G(e,n){let t=n.match(/^(.+):(\d+)-(\d+)$/);if(!t)return;let[,o,i,r]=t,a=Math.max(0,parseInt(i,10)-1),s=Math.max(a,parseInt(r,10)-1);return H(e,o,a,s)??J(e,o,a,s)}function H(e,n,t,o){return y(e,{where:"d.relative_path LIKE ? AND der.start_line <= ? AND der.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(der.end_line - der.start_line) ASC",limit:1})[0]}function J(e,n,t,o){return d(e,{where:"d.relative_path LIKE ? AND c.start_line <= ? AND c.end_line >= ?",params:[`%${n}%`,t,o],orderBy:"(MAX(c.end_line) - MIN(c.start_line)) ASC",limit:1})[0]}function le(e,n){let t=z(e,n).find(o=>!e.isIgnored(o.relative_path));return t?C(e,t):null}function z(e,n){let t=y(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, der.start_line"}),o=t.length>0?[]:d(e,{where:"gs.symbol = ?",params:[n],orderBy:"d.relative_path, start_line"});return b(t,o)}function ce(e,n){if("symbol"in n&&"relativePath"in n)return n;let t=U(e,n.symbolId)[0];return t?C(e,t):null}function U(e,n){let t=y(e,{where:"gs.id = ?",params:[n],orderBy:"der.start_line, der.end_line"}),o=d(e,{where:"gs.id = ?",params:[n],orderBy:"start_line, end_line"});return b(t,o)}function V(e,n){let t=n.map(()=>"(gs.symbol LIKE ? OR d.relative_path LIKE ? OR COALESCE(gs.display_name, '') LIKE ?)"),o=n.flatMap(s=>{let c=`%${s}%`;return[c,c,c]}),i=t.join(`
|
|
2
|
-
AND `),r=y(e,{where:i,params:o,limit:200}),a=d(e,{where:i,params:o,limit:200});return b(r,a)}function Y(e,n,t,o){let i=n.trim(),r=t,a=r.replace(/\(\)$/,""),s=n.toLowerCase(),c=t.toLowerCase(),h=c.replace(/\(\)$/,""),k=e.symbol,v=L(e.symbol),g=Q(e.symbol),A=e.display_name??"",w=e.symbol.toLowerCase(),m=v.toLowerCase(),u=g.toLowerCase(),D=A.toLowerCase(),p=e.relative_path.toLowerCase(),F=/[/:.]/.test(t),$=x(t),_=$?.leaf.toLowerCase(),l=0;return(k===i||k===r)&&(l+=1150),(v===i||v===r)&&(l+=1100),A===a&&(l+=1180),g===a&&(l+=1160),(`${g}()`===i||`${g}()`===r)&&(l+=955),(w===s||w===c)&&(l+=1e3),(m===s||m===c)&&(l+=950),(p===s||p===c)&&(l+=925),(p.endsWith(`/${c}`)||p.endsWith(`/${s}`))&&(l+=875),D===h&&(l+=850),u===h&&(l+=825),(`${u}()`===s||`${u}()`===c)&&(l+=820),(m.endsWith(`:${c}`)||m.endsWith(`:${h}`)||m.endsWith(`:${h}()`))&&(l+=800),w.includes(c)&&(l+=120),m.includes(c)&&(l+=140),p.includes(c)&&(l+=140),D.includes(c)&&(l+=110),o.every(B=>{let R=B.toLowerCase();return w.includes(R)||m.includes(R)||p.includes(R)||D.includes(R)})&&(l+=100+o.length*15),$&&p.includes($.path.toLowerCase())&&(l+=360,_&&(u===_||`${u}()`===_||`${u}()`==`${_}()`)&&(l+=700),I(e.symbol)&&(l+=180)),E(e.symbol)&&u===h&&(l+=60),!F&&K(e.symbol)&&(l-=160),l-=Math.min(50,Math.max(0,e.end_line-e.start_line)),l}function x(e){let n=e.trim().replace(/\\/g,"/"),t=n.lastIndexOf("/");if(t<=0||t===n.length-1)return null;let o=n.slice(t+1).replace(/\(\)$/,"");return!o||o.includes(".")?null:{path:n.slice(0,t),leaf:o}}function N(e){return e.trim().replace(/\(\)$/,"").replace(/\(.*$/,"")}function P(e){let n=N(e),t=n.split(/[^A-Za-z0-9_]+/).map(o=>o.trim()).filter(o=>o.length>0);return t.length>0?[...new Set(t)]:[n]}function ee(e,n,t){let o=n.trim(),i=e.filter(r=>{let a=L(r.symbol),s=(r.display_name??"").trim();return r.symbol===o||a===o||a===t||s===o||s===t||`${s}()`===o||f(r,t)>1||r.relative_path===o});return i.length===0?[]:(i.sort((r,a)=>f(a,t)-f(r,t)||r.end_line-r.start_line-(a.end_line-a.start_line)||r.relative_path.localeCompare(a.relative_path)||r.symbol.localeCompare(a.symbol)),i)}function f(e,n){let t=x(n);if(!t)return 0;let o=e.relative_path.toLowerCase(),i=Q(e.symbol).toLowerCase(),r=t.path.toLowerCase(),a=t.leaf.toLowerCase();return o.includes(r)?i!==a?1:I(e.symbol)?M(e.symbol)===null?5:4:M(e.symbol)===null?3:2:0}export{se as a,O as b,le as c,ce as d};
|
|
3
|
-
//# sourceMappingURL=chunk-27HMTUJE.js.map
|
package/dist/chunk-27XEGMCT.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{a as j}from"./chunk-QARYU7R3.js";import{a as N,b as g,c as W}from"./chunk-I4R3SNMR.js";import{a as _}from"./chunk-K6UI6EBZ.js";import{a as E}from"./chunk-B75HZHUP.js";import{a as P}from"./chunk-IMQFJ53K.js";import{a as k}from"./chunk-BGBBVSH4.js";import{g as C}from"./chunk-5VY3RIEI.js";import{a as w}from"./chunk-GULVO6NF.js";import{m as L}from"./chunk-7TVFPOD7.js";import{d,e as y,k as v}from"./chunk-X5C43YVI.js";import{i as x}from"./chunk-JZBGTSAB.js";import{l as S}from"./chunk-WS3Z6W3M.js";import{basename as m,extname as b}from"path";function ae(t,n){let{scope:e,maxLoc:i=15,limit:a=30,scanLimit:o}=n??{},r=new P(t),s=z(r.fileDependencyGraph(e));return _({candidates:()=>B(t,r,e,i),orderCandidates:E,scanLimit:o,profile:{name:"wrapper-candidates"},prepare:l=>({callerFileMap:A(t,r,l,{semantic:n?.semantic!==!1}),reverseFanIn:s}),evaluate:(l,u)=>O(t,r,l,u),orderResults:(l,u)=>u.callerFanIn-l.callerFanIn||u.loc-l.loc,limit:a})}function A(t,n,e,i){let a=N(t,n),o=g(a.forDefinitions(e,{semantic:!1,sourceFallback:!1})),r=[];i.semantic&&S("wrapper.semantic-candidates",()=>{r=e.filter(c=>F(t,n,c,o).length<=1)},()=>({symbols:e.length,semanticCandidates:r.length}));let s=r.length===0?new Map:g(a.forDefinitions(r,{semantic:!0,sourceFallback:!1})),l=s.size===0?o:C(o,s),u=new Map(e.map(c=>[c.symbolId,c])),f=new Map;for(let c of e){let I=F(t,n,c,l);if(I.length>1||(f.set(c.symbolId,c),I.length!==1))continue;let D=I[0],M=R(t,c.symbolId,D);if(!M)continue;let p=T(n,t,D,c.symbol,M);p?.isFunctionLike&&u.has(p.symbolId)&&f.set(p.symbolId,u.get(p.symbolId))}let h=[...f.values()];return h.length===0?l:C(l,g(a.forDefinitions(h,{semantic:!1,sourceFallback:!0})))}function O(t,n,e,i){let a=F(t,n,e,i.callerFileMap);if(a.length!==1)return null;let o=a[0],r=R(t,e.symbolId,o);if(!r)return null;let s=T(n,t,o,e.symbol,r);if(s&&v(s.symbol))return null;let{fanIn:l,source:u}=J(i.callerFileMap,i.reverseFanIn,o,s);if(u==="function"?l<=3:l<=5)return null;let f=H(t,e,o,s);return{symbol:e.symbol,shortName:d(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:k(e),singleCaller:s?.symbol??"",singleCallerShort:s?.isFunctionLike?d(s.symbol):m(o),callerFanIn:l,actionTier:f.length>0?"signal":"direct",boundaryEvidence:f}}function B(t,n,e,i){return n.productionCallableDefinitions({scope:e,minLoc:2,maxLoc:i,requireFunctionLikeSymbol:!0,excludeRootedSymbols:!0}).filter(a=>!x(t,a))}function F(t,n,e,i){let a=m(e.relativePath,b(e.relativePath)),o=[...i.get(e.symbolId)??[]].filter(r=>r!==e.relativePath).filter(r=>m(r,b(r))!==a).filter(r=>{let s=n.fileKind(r);return s!=="barrel"&&s!=="entry"&&s!=="test"});return W(t,e,o).realConsumers}function R(t,n,e){return t.get(`SELECT c.start_line, c.end_line
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents d ON c.document_id = d.id
|
|
5
|
-
WHERE m.symbol_id = ? AND m.role != 1 AND d.relative_path = ?
|
|
6
|
-
LIMIT 1`,n,e)}function T(t,n,e,i,a){let o=t.definitionsForFile(e),r=q(n,e,i,a.start_line,a.end_line);return L(o,r)}function J(t,n,e,i){if(i?.isFunctionLike){let a=[...t.get(i.symbolId)??[]].filter(o=>o!==i.relativePath);if(a.length>0)return{fanIn:a.length,source:"function"}}return{fanIn:G(n,e),source:"file"}}function q(t,n,e,i,a){let o=y(e);if(!o)return i;let r=w(t,n).get(o);if(!r||r.length===0)return i;for(let s of r)if(s>=i&&s<=a)return s;return i}function z(t){let n=new Map;for(let[e,i]of t){n.has(e)||n.set(e,n.get(e)??0);for(let a of i)n.set(a,(n.get(a)??0)+1)}return n}function G(t,n){let e=t.get(n)??0;if(e>0)return e;let i=m(n,b(n)),a=0;for(let[o,r]of t)o!==n&&m(o,b(o))===i&&r>a&&(a=r);return a}function H(t,n,e,i){return j(t,n.relativePath,n.startLine,"wrapper","explicit ignore-wrapper comment",[{label:"wrapper name",value:d(n.symbol)},{label:"caller name",value:i?.symbol?d(i.symbol):m(e)},{label:"wrapper path",value:n.relativePath},{label:"caller path",value:e}])}export{ae as a};
|
|
7
|
-
//# sourceMappingURL=chunk-27XEGMCT.js.map
|
package/dist/chunk-3AMWF6V5.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{c as p}from"./chunk-7COVQPQQ.js";import{b as B}from"./chunk-B75HZHUP.js";import{a as m}from"./chunk-BGBBVSH4.js";import{g}from"./chunk-7TVFPOD7.js";import{d as f}from"./chunk-X5C43YVI.js";import{b as y}from"./chunk-JZBGTSAB.js";import{p as d}from"./chunk-WS3Z6W3M.js";import{createHash as C}from"crypto";var b=3;function w(n,t={}){let{scope:e,maxLoc:o=15,minLoc:i=b,limit:r,scanLimit:a}=t,l=p(n),u=L(n,{scope:e,maxLoc:o,scanLimit:a}).map(s=>h(n,s,l,i)).filter(s=>s!==null),c=I(u);return r?c.slice(0,r):c}function H(n,t,e={}){let{scope:o,maxLoc:i=15,minLoc:r=b,scanLimit:a}=e,l=p(n),u=L(n,{scope:o,maxLoc:i,scanLimit:a}).map(s=>h(n,s,l,r)).filter(s=>s!==null),c=u.find(s=>s.symbol===t);return c?u.filter(s=>s.symbol!==c.symbol&&s.normalizedBody===c.normalizedBody&&s.file!==c.file).sort(z).map(({normalizedBody:s,...S})=>S):[]}function A(n){let t=E(n);return y(t).replace(/\s+/g,"")}function I(n){let t=new Map;for(let o of n){if(o.normalizedBody.length<8)continue;let i=W(o.normalizedBody),r=t.get(i)??[];r.push(o),t.set(i,r)}let e=[];for(let[o,i]of t){let r=new Set(i.map(l=>l.file));if(i.length<2||r.size<2)continue;let a=[...i].sort(z).map(({normalizedBody:l,...u})=>u);e.push({hash:o,canonical:a[0],functions:a})}return e.sort((o,i)=>{let r=i.functions.length-o.functions.length;if(r!==0)return r;let a=D(i)-D(o);return a!==0?a:o.canonical.file.localeCompare(i.canonical.file)}),e}function L(n,t){let e=g(n,{scope:t.scope}).filter(o=>o.isFunctionLike&&!n.isIgnored(o.relativePath)).filter(o=>m(o)<=t.maxLoc);return e.sort((o,i)=>m(i)-m(o)||o.relativePath.localeCompare(i.relativePath)),B(e,t.scanLimit)}function h(n,t,e,o){let i=x(n,t);if(!i||P(i)<o)return null;let r=v(n,t);return r?{symbol:t.symbol,shortName:f(t.symbol),file:t.relativePath,startLine:t.startLine,endLine:t.endLine,loc:m(t),ageCommits:e?.get(t.relativePath)?.commitsAgo??null,normalizedBody:r}:null}function v(n,t){let e=x(n,t);return e&&A(e)||null}function x(n,t){let e=d(n,t.relativePath);return e?e.split(/\r?\n/).slice(t.startLine,t.endLine+1).join(`
|
|
2
|
-
`):null}function E(n){let t=n.indexOf("{"),e=n.lastIndexOf("}");if(t>=0&&e>t)return n.slice(t+1,e);let o=n.indexOf("=>");return o>=0?n.slice(o+2).replace(/;+\s*$/,""):n}function P(n){return E(n).split(/\r?\n/).map(e=>e.trim()).filter(e=>e.length>0).length}function W(n){return C("sha256").update(n).digest("hex").slice(0,16)}function z(n,t){let e=n.ageCommits??-1;return(t.ageCommits??-1)-e||n.file.localeCompare(t.file)||n.startLine-t.startLine}function D(n){return n.functions.reduce((t,e)=>t+e.loc,0)}export{w as a,H as b,A as c,I as d,v as e,x as f,E as g};
|
|
3
|
-
//# sourceMappingURL=chunk-3AMWF6V5.js.map
|
package/dist/chunk-5AAAEZ2Z.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as R,b as P}from"./chunk-KJCDEDQW.js";import{a as C,c as B,e as a,f}from"./chunk-6XA4LDHY.js";import{a as v,b as h,c as k}from"./chunk-KMVGRIO2.js";import{F as g}from"./chunk-ISLWJ4PY.js";function D(e,o={}){let{minSimilarity:r=.62,minTokens:n=8,limit:l=20,scope:m,scanLimit:d,filePattern:p,focusFiles:u}=o,c=g(e).reactProfiles({scope:m,minJsxTokens:n,scanLimit:d}).filter(t=>t.kind==="component").map(t=>({file:t.file,component:t.name,tokens:t.jsxTokens,profile:t})),s=R(c,t=>t.tokens);return P({profiles:c,limit:l,filePattern:p,focusFiles:u,candidateIndex:s,profile:{name:"react-component-duplicates"},compare:(t,i)=>y(t,i,r),sort:(t,i)=>i.similarity-t.similarity||t.fileA.localeCompare(i.fileA)||t.componentA.localeCompare(i.componentA)||t.fileB.localeCompare(i.fileB)||t.componentB.localeCompare(i.componentB)})}function y(e,o,r){let n=v(e.tokens,o.tokens);if(n.size<6||!T(n))return null;let l=k(e.tokens,o.tokens);if(l<r)return null;let m=a(n,"component:"),d=a(n,"native:"),p=a(n,"prop:"),u=a(n,"event:"),c=a(n,"binding:"),s=b({sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c});return{fileA:e.file,componentA:e.component,fileB:o.file,componentB:o.component,similarity:l,sharedTokens:f(n),sharedComponents:m,sharedNativeTags:d,sharedProps:p,sharedEvents:u,sharedBindings:c,evidenceClass:s.evidenceClass,actionTier:s.actionTier,evidenceClassReasons:s.reasons,recommendation:s.recommendation,uniqueToA:f(h(e.tokens,o.tokens)).slice(0,25),uniqueToB:f(h(o.tokens,e.tokens)).slice(0,25),locA:e.profile.loc,locB:o.profile.loc}}function T(e){let o=0,r=0;for(let n of e)n.startsWith("component:")&&(o+=1),(n.startsWith("prop:")||n.startsWith("event:")||n.startsWith("native:")||n.startsWith("jsx:"))&&(r+=1);return B([{name:"component",count:o},{name:"shape",count:r}],[{min:{component:1},reason:"shared custom component"},{min:{shape:4},reason:"shared JSX structure"}]).pass}function b(e){return C({genericWords:x,primitiveGroups:[{values:e.sharedNativeTags,reasonPrefix:"shared native tags",bucket:"generic"},{values:e.sharedProps,reasonPrefix:"shared props",bucket:"generic"},{values:e.sharedEvents,reasonPrefix:"shared events",bucket:"generic"}],nameGroups:[{names:e.sharedComponents,label:"shared component",fallbackBucket:"generic"},{names:e.sharedBindings,label:"shared binding",fallbackBucket:"generic"}],recommendation:w})}function w(e){switch(e){case"domain-behavior":case"mixed":return"Review for a shared component or feature-specific UI primitive around the named domain structure.";case"shared-abstraction":return"Review the existing shared component usage first; extract only if duplicated structure remains outside it.";case"generic-workflow-scaffolding":return"Generic structural overlap \u2014 verify intent before consolidating."}}var x=new Set(["actions","app","button","card","children","content","container","dialog","field","form","header","input","item","label","layout","list","modal","page","panel","row","section","shell","table","text","toolbar","ui","value","view","wrapper"]);export{D as a};
|
|
2
|
-
//# sourceMappingURL=chunk-5AAAEZ2Z.js.map
|
package/dist/chunk-5JRMZMLM.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as u}from"./chunk-IMQFJ53K.js";import{a as h}from"./chunk-5VY3RIEI.js";import{q as S}from"./chunk-GULVO6NF.js";import{a as d,c as b}from"./chunk-27HMTUJE.js";import{m as y}from"./chunk-7TVFPOD7.js";import{d as m}from"./chunk-X5C43YVI.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-5JRMZMLM.js.map
|
package/dist/chunk-5VY3RIEI.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import{b as oe,f as ie,g as A,h as N,i as x,o as me,p as de}from"./chunk-GULVO6NF.js";import{a as ae,b as se,d as le,e as re,f as ce}from"./chunk-WMO2VZZK.js";import{a as q}from"./chunk-BP7S6V3M.js";import{d as ue,e as fe}from"./chunk-MTDBHTSF.js";import{f as ee,g as v,l as ne,m as te}from"./chunk-7TVFPOD7.js";import{e as E,g as X}from"./chunk-X5C43YVI.js";import{k as w,m as Y,o as Z}from"./chunk-JZBGTSAB.js";import{x as I}from"./chunk-ISLWJ4PY.js";import{a as J,b as P,d as W,f as V,k as z,l as L,p as T}from"./chunk-WS3Z6W3M.js";import{c as U}from"./chunk-GNG622H3.js";import{a as Q}from"./chunk-64MNV6AB.js";import{c as K,d as B}from"./chunk-7S5E7KWT.js";function un(e,n,t={}){let o=ye(e,[n],{additive:t.additive,semantic:t.semantic}),i=t.callableOnly?(o.get(n.symbolId)??[]).filter(a=>X(a.symbol)||a.source==="ast-callsite"):o.get(n.symbolId)??[];return typeof t.limit=="number"?i.slice(0,t.limit):i}function be(e,n,t={}){let o=Re(e)?Ie(e,n,{semantic:t.semantic!==!1}):_e(e).get(n.symbolId)??[];return typeof t.limit=="number"?o.slice(0,t.limit):o}var Ce=B("caller-rows",{clearGroups:["whole-project"]}),Me=2e4;function Re(e){return(e.get("SELECT COUNT(*) AS count FROM global_symbols")?.count??0)>Me}function _e(e){return Ce.get(e,()=>{let n=v(e),t=ye(e,n),o=new Map;for(let s of n)o.set(s.symbol,s.symbolId);let i=new Map,a=new Map;for(let s of n){let l=t.get(s.symbolId);if(!(!l||l.length===0))for(let c of l){let m=o.get(c.symbol);if(m===void 0||m===s.symbolId)continue;let d=i.get(m);d||(d=[],i.set(m,d),a.set(m,new Set));let f=`${s.symbol}|${s.relativePath}`;a.get(m).has(f)||(a.get(m).add(f),d.push({symbol:s.symbol,file:s.relativePath,source:"caller-map-inversion"}))}}return i})}function Ie(e,n,t){let o=[],i=new Set,a=l=>{if(l.symbol===n.symbol)return;let c=`${l.symbol}|${l.file}`;i.has(c)||(i.add(c),o.push(l))};for(let l of de(e,n))l.file!==n.relativePath&&a({symbol:l.enclosingSymbol??l.file,file:l.file,source:"resolved-reference"});let s=t.semantic?Le(e,n):null;if(s)for(let l of le(e,s)){if(l.file===n.relativePath||e.isIgnored(l.file))continue;let c=te(ee(e,l.file),l.line);a({symbol:c?.symbol??l.file,file:l.file,source:"semantic-reference"})}return o}function Le(e,n){let t=ue().join(", "),o=fe().join(", ");return e.get(`SELECT
|
|
2
|
-
d.id AS documentId,
|
|
3
|
-
gs.id AS symbolId,
|
|
4
|
-
gs.symbol,
|
|
5
|
-
d.relative_path AS relativePath,
|
|
6
|
-
COALESCE(der.start_line, c.start_line) AS startLine,
|
|
7
|
-
COALESCE(der.end_line, c.end_line) AS endLine,
|
|
8
|
-
COALESCE(gs.display_name, '') AS leaf,
|
|
9
|
-
NULL AS parentTypeName,
|
|
10
|
-
CASE WHEN gs.kind IN (${t}) OR gs.symbol LIKE '%().' THEN 1 ELSE 0 END AS isFunctionLike,
|
|
11
|
-
CASE WHEN gs.kind IN (${o}) THEN 1 ELSE 0 END AS isTypeLike,
|
|
12
|
-
gs.kind AS kind,
|
|
13
|
-
gs.documentation AS documentation,
|
|
14
|
-
gs.enclosing_symbol AS enclosingSymbol
|
|
15
|
-
FROM global_symbols gs
|
|
16
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
17
|
-
LEFT JOIN chunks c ON c.document_id = der.document_id
|
|
18
|
-
JOIN documents d ON d.id = COALESCE(der.document_id, c.document_id)
|
|
19
|
-
WHERE gs.id = ?
|
|
20
|
-
LIMIT 1`,n.symbolId)??null}function ye(e,n,t={}){if(n.length===0)return new Map;let o=t.additive??!1,i=[],a=[];for(let d of n)I(d.relativePath)&&w(e,d.relativePath)!==null?i.push(d):a.push(d);let s=new Map,l=new Map,c=d=>{for(let[f,R]of d){let r=s.get(f);r||(r=[],s.set(f,r));let u=l.get(f);u||(u=new Set,l.set(f,u));for(let b of R){let g=`${b.symbol}|${b.chunkId}`;u.has(g)||(u.add(g),r.push(b))}}};i.length>0&&c(ve(e,i)),t.semantic!==!1&&c(Pe(we(e,n)));let m=o?n:a;return m.length>0&&c(Fe(e,m)),s}function we(e,n){let t=z(),o=new Map,i=[],a=[],s=0,l=0,c=0,m=0;if(L("semantic.callees.cache-scan",()=>{for(let u of n){if(!ae(u.relativePath)){t&&(s+=1);continue}let b=T(e,u.relativePath);if(!b){t&&(l+=1),a.push(u);continue}let g=P(e,u.relativePath,b),D=Ee(e,u.relativePath),M=W(e,u.relativePath,u.symbol,g,D);if(M!==null){let S=De(M);if(S){t&&(c+=1),S.length>0&&o.set(u.symbolId,S);continue}t&&(m+=1)}i.push({def:u,contentHash:g,depsDigest:D})}},()=>({definitions:n.length,skippedNonTs:s,sourceMissing:l,cacheHits:c,parseFailures:m,misses:i.length,unkeyed:a.length,resultRows:o.size})),i.length===0&&a.length===0)return o;let d=[...a,...i.map(u=>u.def)],f=0,R=L("semantic.callees.compute-misses",()=>{let u=ce(e,d);return f=u.size,u},()=>({definitions:d.length,misses:i.length,unkeyed:a.length,rows:f}));for(let[u,b]of R)o.set(u,b);if(se(e).capability("semantic-callees").available){let u=i.map(b=>({relativePath:b.def.relativePath,symbol:b.def.symbol,contentHash:b.contentHash,depsDigest:b.depsDigest,payload:JSON.stringify(R.get(b.def.symbolId)??[])}));L("semantic.callees.cache-write",()=>V(e,u),()=>({entries:u.length}))}else L("semantic.callees.cache-write-skip",()=>{},()=>({reason:"provider-unavailable",misses:i.length}));return o}function De(e){try{return JSON.parse(e)}catch{return null}}var ke=K("semantic-deps-digest",{clearGroups:["whole-project","source-file"]});function Ee(e,n){return ke.get(e,n,()=>{let o=[...q(e).get(n)??[]].sort().map(i=>`${i}:${P(e,i,T(e,i))}`);return J(o.join("|"))})}function ve(e,n){let t=new Map,o=Ae(n,t),i=x(e);for(let[a,s]of o){let l=w(e,a);if(!l)continue;let c=ne(s);for(let m of l){let d=c.get(m.line);if(!d)continue;let f=Ne(e,a,i,m);f&&f.symbol!==d.symbol&&t.get(d.symbolId).push({symbol:f.symbol,file:f.file,chunkId:m.line,source:"ast-callsite"})}}return t}function Ae(e,n){let t=new Map;for(let o of e){let i=t.get(o.relativePath);i?i.push(o):t.set(o.relativePath,[o]),n.set(o.symbolId,[])}for(let o of t.values())o.sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine));return t}function Ne(e,n,t,o){let i=A(n,t.get(o.calleeLeaf)??[]);if(i.length===0)return null;let a=xe(e,n,i,o.calleeQualifier);return a||N(e,n,i,o.memberAccess)}function xe(e,n,t,o){if(!o||I(n)!=="clojure")return null;let a=Z(e,n).filter(s=>s.kind==="namespace"&&s.localName===o&&s.sourcePath).map(s=>s.sourcePath);for(let s of a){let l=t.find(c=>U(s,c.file));if(l)return l}return t.find(s=>/`([^`]+)`\//.exec(s.symbol)?.[1]===o)??null}function Fe(e,n){if(n.length===0)return new Map;let o=j(n.map(r=>r.documentId)).flatMap(r=>e.all(`SELECT c.document_id, c.id AS chunk_id, c.start_line, c.end_line, m.symbol_id
|
|
21
|
-
FROM mentions m
|
|
22
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
23
|
-
WHERE m.role != 1
|
|
24
|
-
AND c.document_id IN (${r.map(()=>"?").join(",")})`,...r)),i=new Map;for(let r of o)i.has(r.document_id)||i.set(r.document_id,[]),i.get(r.document_id).push(r);let s=j(o.map(r=>r.symbol_id)).flatMap(r=>e.all(`SELECT gs.id AS symbol_id, gs.symbol,
|
|
25
|
-
COALESCE(der.document_id, def_chunk.document_id) AS document_id
|
|
26
|
-
FROM global_symbols gs
|
|
27
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
28
|
-
LEFT JOIN (
|
|
29
|
-
SELECT m.symbol_id, MIN(c.document_id) AS document_id
|
|
30
|
-
FROM mentions m
|
|
31
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
32
|
-
WHERE m.role = 1
|
|
33
|
-
AND m.symbol_id IN (${r.map(()=>"?").join(",")})
|
|
34
|
-
GROUP BY m.symbol_id
|
|
35
|
-
) def_chunk ON def_chunk.symbol_id = gs.id
|
|
36
|
-
WHERE gs.id IN (${r.map(()=>"?").join(",")})`,...r,...r)),l=j([...n.map(r=>r.documentId),...s.flatMap(r=>r.document_id===null?[]:[r.document_id])]),c=new Map(l.flatMap(r=>e.all(`SELECT id, relative_path FROM documents
|
|
37
|
-
WHERE id IN (${r.map(()=>"?").join(",")})`,...r).map(u=>[u.id,u.relative_path]))),m=new Map;for(let r of s)m.has(r.symbol_id)||m.set(r.symbol_id,{symbol:r.symbol,file:r.document_id!==null?c.get(r.document_id)??"":""});let d=new Map,f=c,R=Oe(n);for(let[r,u]of R){let g=[...i.get(r)??[]].sort((p,h)=>p.start_line-h.start_line||p.end_line-h.end_line),D=[...u].sort((p,h)=>p.startLine-h.startLine||p.endLine-h.endLine),M=new Set,S=0;for(let p of D){for(;S<g.length&&g[S].start_line<=p.endLine;)M.add(g[S]),S+=1;for(let y of M)y.end_line<p.startLine&&M.delete(y);let h=new Set,$=[],F=null,Se=()=>{if(F)return F;let y=f.get(p.documentId)??"",C=new Set;if(y){let O=oe(e,y),k=Math.max(0,p.startLine),G=Math.min(O.length-1,p.endLine);for(let _=k;_<=G;_+=1)for(let he of O[_])C.add(he)}return F=C,C};for(let y of M){if(y.symbol_id===p.symbolId)continue;let C=m.get(y.symbol_id);if(!C)continue;if(!(y.start_line>=p.startLine&&y.end_line<=p.endLine)){if(!(y.start_line<=p.endLine&&y.end_line>=p.startLine))continue;let _=E(C.symbol);if(!_||!Se().has(_))continue}let k=`${C.symbol}|${y.chunk_id}`;h.has(k)||(h.add(k),$.push({...C,chunkId:y.chunk_id,source:"scip-chunk"}))}d.set(p.symbolId,$)}}return d}var pe=500;function j(e){let n=[...new Set(e)],t=[];for(let o=0;o<n.length;o+=pe)t.push(n.slice(o,o+pe));return t}function Oe(e){let n=new Map;for(let t of e){let o=n.get(t.documentId);o?o.push(t):n.set(t.documentId,[t])}return n}function Pe(e){let n=new Map;for(let[t,o]of e){let i=[];for(let a of o)i.push({symbol:a.symbol,file:a.file,chunkId:-1,source:"semantic-callee"});n.set(t,i)}return n}function ge(e,n,t={}){let o=new Map;if(n&&n.length===0)return o;let i=Q(e,{includeIgnored:!1}),a=x(e),s=n??v(e),l=new Set(s.map(m=>m.symbolId)),c=Be(s);return Te(e,o,i,a,l,c),je(e,o,s,l),Ke(e,o,i,a,l,c),t.semantic!==!1&&We(o,re(e,Je(s))),o}function Te(e,n,t,o,i,a){for(let s of t){if(!I(s))continue;let l=w(e,s);if(l)for(let c of l){if(a&&!a.has(c.calleeLeaf))continue;let m=A(s,o.get(c.calleeLeaf)??[]);if(!m||m.length===0)continue;let d=N(e,s,m,c.memberAccess);d&&i.has(d.symbolId)&&d.file!==s&&H(n,d.symbolId,s)}}}function je(e,n,t,o){let i=$e(t);for(let a of He(e,o))e.isIgnored(a.relative_path)||Ge(a,i.get(a.symbol_id))||H(n,a.symbol_id,a.relative_path)}function He(e,n){return ie(e,n?[...n]:void 0)}function $e(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 Ge(e,n){return!!n&&n.docId===e.document_id&&e.chunk_start>=n.startLine&&e.chunk_end<=n.endLine}function Ke(e,n,t,o,i,a){for(let s of t){if(I(s)!=="rust")continue;let l=Y(e,s,{includeRustAttributeNames:!0});if(l.length!==0)for(let{name:c}of l){if(a&&!a.has(c))continue;let m=o.get(c);if(m)for(let d of m)i.has(d.symbolId)&&d.file!==s&&H(n,d.symbolId,s)}}}function H(e,n,t){let o=e.get(n);o||(o=new Set,e.set(n,o)),o.add(t)}function Be(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"?E(t.symbol):"";o&&n.add(o)}return n.size>0?n:null}function Je(e){return e.filter(n=>"relativePath"in n&&"symbol"in n&&"leaf"in n)}function We(e,n){for(let[t,o]of n){let i=e.get(t);i||(i=new Set,e.set(t,i));for(let a of o)i.add(a)}}function Ln(e,n,t={}){return be(e,n,t)}function Ve(e,n,t={}){return ge(e,n,t)}function Qe(e,n,t={}){return me(e,n,t)}function wn(e,n,t={}){let o=Ve(e,n,{semantic:t.semantic});return t.sourceFallback===!1?o:Ue(o,Qe(e,n))}function Ue(e,n){let t=new Map;for(let[o,i]of e)t.set(o,new Set(i));for(let[o,i]of n){let a=t.get(o)??new Set;for(let s of i)a.add(s);t.set(o,a)}return t}export{un as a,ye as b,Ln as c,Ve as d,Qe as e,wn as f,Ue as g};
|
|
38
|
-
//# sourceMappingURL=chunk-5VY3RIEI.js.map
|
package/dist/chunk-6JUAGXR4.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as I,b as D,c as $,d as B}from"./chunk-I4R3SNMR.js";import{a as K}from"./chunk-K6UI6EBZ.js";import{a as A}from"./chunk-IMQFJ53K.js";import{b as M,g as R}from"./chunk-BZXE3HO4.js";import{a as b}from"./chunk-BGBBVSH4.js";import{g as x}from"./chunk-5VY3RIEI.js";import{b as F,d as w,e as p}from"./chunk-X5C43YVI.js";import{l as k}from"./chunk-JZBGTSAB.js";import{p as h}from"./chunk-WS3Z6W3M.js";function me(t,e){let{scope:n,minLoc:s=3,maxLoc:i=80,limit:r=30,includeLowConfidence:o=!1,scanLimit:l}=e??{},d=e?.semantic!==!1,a=new A(t),m=a.scopedDefinitions(n),g=Q(a,n),T={high:0,medium:1,low:2};return K({candidates:()=>O(t,a,m,{minLoc:s,maxLoc:i}),orderCandidates:(u,c)=>b(c)-b(u)||u.relativePath.localeCompare(c.relativePath),scanLimit:l,profile:{name:"stale-abstractions"},prepare:u=>{let c=W(u),f=U(t,a,u,c,{semantic:d}),y=u.filter(P=>{let S=C(t,P,f,c);return S.realConsumers.length<=1&&!S.transitivelyReachable&&j(P,S.realConsumers.length,g)});return{consumerFileMap:f,singletonBackedClassIds:H(t,a,m,y,{semantic:d}),candidateIndex:c}},evaluate:(u,c)=>{if(c.singletonBackedClassIds.has(u.symbolId))return null;let f=C(t,u,c.consumerFileMap,c.candidateIndex);if(f.transitivelyReachable||f.realConsumers.length>1||f.realConsumers.length===0&&f.barrelConsumers>0||!j(f.definition,f.realConsumers.length,g))return null;let y=z(t,f);return!o&&y.confidence==="low"?null:y},orderResults:(u,c)=>T[u.confidence]-T[c.confidence]||c.loc-u.loc||u.file.localeCompare(c.file)||u.startLine-c.startLine,limit:r})}function O(t,e,n,s){return n.filter(i=>i.isTypeLike&&b(i)>=s.minLoc).filter(i=>b(i)<=s.maxLoc).filter(i=>!t.isIgnored(i.relativePath)).filter(i=>M(i.relativePath)!=="test").filter(i=>!R(t,i.symbol,i.relativePath)).filter(i=>!X(i.symbol)).filter(i=>!e.hasSuppressionComment(i))}function v(t,e,n,s){return D(I(t,e).forDefinitions(n,{semantic:s.semantic,sourceFallback:s.sourceFallback}))}function U(t,e,n,s,i){let r=v(t,e,n,{semantic:!1,sourceFallback:!1}),o=n.filter(a=>{let m=C(t,a,r,s);return m.realConsumers.length<=1&&!(m.realConsumers.length>0&&L(a.relativePath))}),l=i.semantic&&o.length>0?x(r,v(t,e,o,{semantic:!0,sourceFallback:!1})):r,d=o.filter(a=>C(t,a,l,s).realConsumers.length<=1);return x(l,v(t,e,d,{semantic:!1,sourceFallback:!0}))}function W(t){let e=new Map;for(let n of t){let s=e.get(n.relativePath);s||(s=new Map,e.set(n.relativePath,s));let i=p(n.symbol);i&&s.set(i,n)}return e}function C(t,e,n,s){let r=[...n.get(e.symbolId)??new Set].filter(m=>m!==e.relativePath&&!t.isIgnored(m)),{realConsumers:o,barrelConsumers:l,importOnlyConsumers:d}=$(t,e,r),a=Y(t,e,n,s);return{definition:e,realConsumers:o,barrelConsumers:l+d,transitivelyReachable:a}}function z(t,e){let n=E(t,e.definition.relativePath,e.definition.startLine),s=L(e.definition.relativePath)?!0:ee(t,e.definition),{confidence:i,reason:r}=ne(e.realConsumers.length,n,s),o=V(e.realConsumers.length,n,s);return{symbol:e.definition.symbol,shortName:w(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,loc:b(e.definition),consumers:e.realConsumers.length,barrelConsumers:e.barrelConsumers,kind:n,definerUsesType:s,confidence:i,reason:r,actionTier:o.actionTier,stalenessKind:o.stalenessKind,recommendation:o.recommendation}}function V(t,e,n){return t===0?{actionTier:"direct",stalenessKind:"unused-abstraction",recommendation:"Delete the abstraction or wire the missing consumer after checking public/package surfaces."}:e==="class"?{actionTier:"signal",stalenessKind:"one-to-one-class-encapsulation",recommendation:"Treat as weak signal: a one-consumer class may be intentional encapsulation, so inline only after reviewing ownership and state boundaries."}:n?{actionTier:"signal",stalenessKind:"single-consumer-abstraction",recommendation:"Review whether this single-consumer abstraction earns its name or should be folded into the owning feature."}:{actionTier:"signal",stalenessKind:"misplaced-single-consumer-type",recommendation:"Review moving or co-locating the type with its only real consumer; keep it here only if this file owns the public contract."}}function H(t,e,n,s,i){let r=_(t,Z(n),s),o=r.map(a=>a.singleton);if(r.length===0)return new Set;let l=D(I(t,e).forDefinitions(o,{semantic:i.semantic,sourceFallback:!0})),d=new Set;for(let{singleton:a,classId:m}of r)G(t,a,l)&&d.add(m);return d}function Z(t){let e=new Map;for(let n of t){let s=p(n.symbol);s&&e.set(N(n.relativePath,s),n)}return e}function _(t,e,n){let s=[];for(let i of n){let r=q(t,e,i);r&&s.push({singleton:r,classId:i.symbolId})}return s}function q(t,e,n){if(E(t,n.relativePath,n.startLine)!=="class")return null;let s=p(n.symbol);if(!s)return null;let i=J(t,n.relativePath,s);return i?e.get(N(n.relativePath,i))??null:null}function G(t,e,n){let s=p(e.symbol),i=n.get(e.symbolId);return!s||!i?!1:[...i].some(r=>r!==e.relativePath&&!t.isIgnored(r)&&!B(t,r,s))}function N(t,e){return`${t}\0${e}`}function J(t,e,n){let s=h(t,e);if(!s)return null;let i=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\bexport\\s+const\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*new\\s+${i}\\s*\\(`);return s.match(r)?.[1]??null}function Q(t,e){return new Set(t.scopedDefinitions(e).filter(n=>n.isFunctionLike).map(n=>n.relativePath))}function X(t){let e=F(t);if("kind"in e)return!1;let n=e.descriptors;if(n.length<2)return!1;let s=n[n.length-1],i=n[n.length-2];return s?.suffix==="type"&&i?.suffix==="type"}function L(t){let n=(t.split("/").pop()??"").replace(/\.[^.]+$/,"");return!!(n==="types"||n.endsWith("-types")||n==="models"||n==="schema"||n==="common"||n==="protocol"||n==="proto"||n==="dto"||n==="mod"||n==="contracts"||/(^|\/)types(\/|\.)/.test(t)||/(^|\/)models?(\/|\.)/.test(t)||/(^|\/)proto(?:col)?(\/|\.)/.test(t)||/(^|\/)schema(\/|\.)/.test(t)||/(^|\/)contracts?(\/|\.)/.test(t))}function j(t,e,n){return!(L(t.relativePath)&&e>0||e===0&&n.has(t.relativePath))}function Y(t,e,n,s){let i=k(t,e.relativePath),r=p(e.symbol);if(!r)return!1;let o=i.get(r);if(!o||o.size===0)return!1;let l=s.get(e.relativePath);if(!l)return!1;for(let d of o){let a=l.get(d);if(!a)continue;let m=n.get(a.symbolId);if(m){for(let g of m)if(g!==e.relativePath&&!t.isIgnored(g))return!0}}return!1}function E(t,e,n){let s=h(t,e);if(!s)return"other";let i=s.split(`
|
|
2
|
-
`),r=Math.max(0,n-2),o=Math.min(i.length-1,n+2);for(let l=r;l<=o;l++){let a=(i[l]??"").replace(/^\s*\/\/.*$/g,"");if(/\b(?:export\s+)?(?:abstract\s+)?class\s+\w/.test(a))return"class";if(/\b(?:export\s+)?interface\s+\w/.test(a))return"interface";if(/\b(?:export\s+)?type\s+\w/.test(a))return"type";if(/\b(?:export\s+)?(?:const\s+)?enum\s+\w/.test(a))return"enum"}return"other"}function ee(t,e){let n=h(t,e.relativePath);if(!n)return!1;let s=p(e.symbol);if(!s)return!1;let i=s.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b${i}\\b`),o=n.split(`
|
|
3
|
-
`);for(let l=0;l<o.length;l++)if(!(l>=e.startLine&&l<=e.endLine)&&r.test(o[l]??""))return!0;return!1}function ne(t,e,n){return t===0?{confidence:"high",reason:"unused \u2014 no consumers and defining file has no real usage"}:t===1&&e==="class"?{confidence:"low",reason:"1 consumer + class kind \u2014 likely 1:1 encapsulation, not over-abstraction"}:t===1&&!n?{confidence:"high",reason:"1 consumer + defining file never uses it \u2014 type belongs with its consumer"}:{confidence:"medium",reason:"1 consumer \u2014 single-use abstraction"}}export{me as a};
|
|
4
|
-
//# sourceMappingURL=chunk-6JUAGXR4.js.map
|
package/dist/chunk-6KDOYKCB.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{b as w}from"./chunk-6KMTPNZL.js";import{b as g}from"./chunk-27HMTUJE.js";import{c as h,d as f}from"./chunk-MTDBHTSF.js";import{c as b,d as p}from"./chunk-7TVFPOD7.js";import{d as u,e as c,h as m}from"./chunk-X5C43YVI.js";import{dirname as $,relative as T,resolve as k}from"path";var A=new Set(f());function O(t,n){return`tests/generated/twin-ab/${y(t)}-vs-${y(n)}.test.ts`}function y(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function I(t,n,a,e){let o=d(t,n);if(!o.ok)return o;let i=d(t,a);if(!i.ok)return i;let r=o.symbol.paramCount===null||i.symbol.paramCount===null?null:o.symbol.paramCount===i.symbol.paramCount,s=v(o.symbol,i.symbol,t.config.projectRoot,e,r);return{ok:!0,a:o.symbol,b:i.symbol,signatureCompatible:r,testSource:s}}function d(t,n){let e=g(t,n).match;if(!e)return{ok:!1,reason:`${n} does not resolve to an indexed symbol.`};let i=t.get("SELECT kind FROM global_symbols WHERE id = ?",e.symbolId)?.kind??null;if(!(i!==null?A.has(i):m(e.symbol)))return{ok:!1,reason:`${n} resolves to ${u(e.symbol)}${i!==null?` with SCIP kind ${h(i)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!w(t,e))return{ok:!1,reason:`${n} (${u(e.symbol)} at ${e.relativePath}:${e.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let s=t.get("SELECT documentation FROM global_symbols WHERE id = ?",e.symbolId),l=b(p(s?.documentation??null));return{ok:!0,symbol:{ref:n,symbol:e.symbol,shortName:c(e.symbol)||u(e.symbol),file:e.relativePath,startLine:e.startLine,signature:l,paramCount:l?x(l):null}}}function x(t){let n=t.indexOf("(");if(n===-1)return null;let a=0,e=-1;for(let s=n;s<t.length;s+=1){let l=t[s];if(l==="(")a+=1;else if(l===")"&&(a-=1,a===0)){e=s;break}}if(e===-1)return null;let o=t.slice(n+1,e).trim();if(!o)return 0;let i=1,r=0;for(let s of o)s==="("||s==="["||s==="{"?r+=1:s===")"||s==="]"||s==="}"?r=Math.max(0,r-1):s===","&&r===0&&(i+=1);return i}function S(t,n,a){let e=$(n),o=k(t,a),r=T(e,o).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function v(t,n,a,e,o){let i=S(a,e,t.file),r=S(a,e,n.file),s=o===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":o?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. scip-integrity-audit drill 5
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${n.shortName} (${n.file}:${n.startLine+1})
|
|
11
|
-
* ${n.signature??"(signature unavailable)"}
|
|
12
|
-
* ${s}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${i}';
|
|
19
|
-
import { ${n.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${n.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{O as a,I as b};
|
|
40
|
-
//# sourceMappingURL=chunk-6KDOYKCB.js.map
|
package/dist/chunk-6KMTPNZL.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-QARYU7R3.js";import{a as y}from"./chunk-K6UI6EBZ.js";import{a as P}from"./chunk-B75HZHUP.js";import{a as x}from"./chunk-IMQFJ53K.js";import{a as h,g as b}from"./chunk-BZXE3HO4.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as u}from"./chunk-X5C43YVI.js";import{a as f,h as m,i as g}from"./chunk-JZBGTSAB.js";import{q as d}from"./chunk-WS3Z6W3M.js";import{basename as L,extname as D}from"path";function H(i,e){let{scope:n,maxLoc:t=15,limit:o=30,scanLimit:s}=e??{},a=new x(i);return y({candidates:()=>A(i,a,n,t),orderCandidates:P,scanLimit:s,profile:{name:"passthrough-candidates"},prepare:r=>a.calleeMap(r,{semantic:e?.semantic!==!1}),evaluate:(r,c)=>I(i,r,c.get(r.symbolId)??[]),orderResults:(r,c)=>r.loc-c.loc||r.file.localeCompare(c.file),limit:o})}function I(i,e,n){let t=j(n);if(t.size!==1||!m(i,e.relativePath,e.startLine,e.endLine))return null;let[,o]=[...t.entries()][0],s=T(i,e,o),a=w(i,e),r=s.length>0||a.length>0?"signal":"direct";return{symbol:e.symbol,shortName:l(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:v(e),forwardsTo:o.symbol,forwardsToShort:l(o.symbol),forwardsToFile:o.file,actionTier:r,boundaryEvidence:s,publicFacadeEvidence:a,recommendation:E(r,s,a)}}function T(i,e,n){return S(i,e.relativePath,e.startLine,"passthrough","explicit ignore-passthrough comment",[{label:"passthrough name",value:l(e.symbol)},{label:"callee name",value:l(n.symbol)},{label:"passthrough module",value:L(e.relativePath,D(e.relativePath))},{label:"callee module",value:L(n.file,D(n.file))}])}function E(i,e,n){if(i==="signal"){if(n.length>0)return`Review the public API before inlining; public-facade evidence: ${n.slice(0,2).join("; ")}.`;let t=e.filter(F);return t.length>0?`Review the public API before inlining; public-surface evidence: ${t.slice(0,2).join("; ")}.`:`Review the boundary before inlining; boundary evidence: ${e.slice(0,2).join("; ")}.`}return"Inline or remove this passthrough unless an external API or runtime registration depends on the forwarding name."}function w(i,e){return C(i,e)?h(i,e.relativePath)?["exported passthrough is declared on the package public surface"]:b(i,e.symbol,e.relativePath)?["exported passthrough matches configured or framework public entry surface"]:[]:[]}function C(i,e){let n=d(i,e.relativePath);if(n.length===0)return!1;let t=n.slice(Math.max(0,e.startLine-2),e.startLine+1).join(`
|
|
2
|
-
`);return M.test(t)?!0:R(n,p(e.symbol))}function R(i,e){if(!e)return!1;let n=new RegExp(`^\\s*export\\s*\\{[^}\\n]*\\b${f(e)}\\b`);return i.some(t=>n.test(t))}function F(i){return i.includes("public surface")}function j(i){let e=i.some(t=>u(t.symbol))?i.filter(t=>u(t.symbol)):i,n=new Map;for(let t of e)n.has(t.symbol)||n.set(t.symbol,t);return n}function A(i,e,n,t){return e.productionCallableDefinitions({scope:n,minLoc:3,maxLoc:t,requireFunctionLikeSymbol:!0,excludeRustTraitImplMembers:!0}).filter(o=>!g(i,o))}var M=/^\s*export\s+(?:default\s+)?(?:(?:async\s+)?function\b|(?:const|let|var)\b)/m;export{H as a,C as b};
|
|
3
|
-
//# sourceMappingURL=chunk-6KMTPNZL.js.map
|
package/dist/chunk-7COVQPQQ.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{m as v,o as D}from"./chunk-WS3Z6W3M.js";import{d as F}from"./chunk-7S5E7KWT.js";import{execFileSync as B}from"child_process";var x=2e3,S=50,I=64,$=8,U=3,K=2160*60*60,J=/\b(?:fix(?:es|ed)?|bug|regression|hotfix)\b/i,V=3,W=/#\d+|\b[A-Z][A-Z0-9]+-\d+\b/g,X=/^([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 M(e){let t=F(e,{clearGroups:["whole-project"]});return(n,i,r)=>{let o=P(n.config.projectRoot);if(!o)return null;let a=t.has(n)?t.get(n,()=>({head:"",values:new Map})):null;(!a||a.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 Y=R("git-commit-history");function Z(e){return{capability:t=>q(e,t),commitHistory:()=>A(e),fileChurn:()=>te(e),changeAmplification:()=>ne(e),trackedFiles:()=>re(e),fileAddRecords:()=>se(e),coChangePairs:(t={})=>de(e,t),coChangePairsForFiles:(t,n={})=>j(e,t,n),directionalCoChangePairsForFiles:(t,n={})=>fe(e,t,n)}}function A(e){return Y(e,Q)}function q(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 B("git",["-C",e,...t],{encoding:"utf-8",maxBuffer:64*1024*1024,stdio:["ignore","pipe","ignore"]})}function Q(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 ee(e){return J.test(e.subject)}function te(e){let t=A(e);if(!t)return null;let n=new Map;for(let i of t.commits){let r=ee(i);for(let o of i.files){let a=n.get(o)??{changes:0,fixChanges:0,lastChangedAt:0};a.changes+=1,r&&(a.fixChanges+=1),i.timestamp>a.lastChangedAt&&(a.lastChangedAt=i.timestamp),n.set(o,a)}}return n}function ne(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:k(n,.5),p90FilesPerCommit:k(n,.9),commitsAnalyzed:n.length}}function k(e,t){let n=Math.min(e.length-1,Math.floor(e.length*t));return e[n]}var ie=R("git-tracked-files");function re(e){return ie(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 oe=R("git-file-adds"),O="__git__/file-adds",_=v({kind:"git-file-adds",invalidation:D("git-file-adds"),serialize:ce,deserialize:le});function we(e){return Z(e).fileAddRecords()}function se(e){return oe(e,(t,n)=>ae(e,t,n))}function ae(e,t,n){let i=_.read(e,O,n);if(i)return i;let r=ue(t);return r&&_.write(e,O,n,r),r}function ce(e){return JSON.stringify([...e.entries()])}function le(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 ue(e){let t;try{t=C(e,["log","--no-merges","--find-renames","--name-status","-n",String(x),"--pretty=format:%x01%H%x00%ct%x00%s"])}catch{return null}let n=new Map,i=new Map,r=-1;for(let o of t.split("")){if(o.trim()==="")continue;r+=1;let a=o.indexOf(`
|
|
3
|
-
`),l=a>=0?o.slice(0,a):o,[,u]=l.split("\0"),f=Number(u)||0;if(!(a<0))for(let h of o.slice(a+1).split(`
|
|
4
|
-
`)){let s=me(h);if(!s)continue;if(s.status==="R"&&s.from&&s.to){let m=i.get(s.to)??new Set([s.to]);i.set(s.from,m);continue}if(s.status!=="A"||!s.to)continue;let c={commitsAgo:r,addedAt:f};n.set(s.to,c);for(let m of i.get(s.to)??[])n.set(m,c)}}return n}function me(e){let t=e.trim().split(" "),n=t[0]??"";if(!n)return null;let i=n[0]??"";if(i==="R"){let o=t[1],a=t[2];return o&&a?{status:i,from:o,to:a}:null}let r=t[1];return r?{status:i,to:r}:null}var G=M("git-co-change-pairs"),ge=M("git-directional-co-change-pairs");function de(e,t){let n=`all\0${T(t)}`,i=G(e,n,()=>{let r=A(e);return r?w(r,t):null});return i&&[...i]}function j(e,t,n){if(t.size===0)return[];let i=`files\0${z(t)}\0${T(n)}`,r=G(e,i,()=>{let o=A(e);return o?w(o,n,t):null});return r&&[...r]}function fe(e,t,n){if(t.size===0)return[];let i=n.maxFilesPerCommit??S;if(t.size>I)return j(e,t,n);let r=`directional\0${z(t)}\0${T({...n,maxFilesPerCommit:i})}`,o=ge(e,r,(a,l)=>{let u=he(a,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 z(e){return[...e].sort().join("\0")}function w(e,t,n){let{minTogether:i=4,minConfidence:r=.6,maxFilesPerCommit:o=S}=t,a=new Map,l=new Map,u=e.newestAnalyzedAt??0;for(let s of e.commits){let c=[...new Set(s.files)].sort();if(c.length>o)continue;e.newestAnalyzedAt===void 0&&s.timestamp>u&&(u=s.timestamp);let m=be(c),y=n===void 0||c.some(g=>n.has(g));for(let g of c)a.set(g,(a.get(g)??0)+1);if(y)for(let g=0;g<c.length;g++)for(let p=g+1;p<c.length;p++){if(n&&!n.has(c[g])&&!n.has(c[p]))continue;let b=`${c[g]}\0${c[p]}`,d=l.get(b)??{together:0,focusedTogether:0,broadTogether:0,lastTogetherAt:0,timestamps:[],subjects:[]};d.together+=1,m?d.broadTogether+=1:d.focusedTogether+=1,s.timestamp>d.lastTogetherAt&&(d.lastTogetherAt=s.timestamp),d.timestamps.push(s.timestamp),d.subjects.push(s.subject),l.set(b,d)}}let f=[],h=u-K;for(let[s,c]of l){let m=c.together;if(m<i)continue;let[y,g]=s.split("\0"),p=a.get(y)??m,b=a.get(g)??m,d=Math.max(m/p,m/b);if(d<r)continue;let L=c.broadTogether/m,H=c.timestamps.filter(N=>N>=h).length;f.push({fileA:y,fileB:g,together:m,confidence:d,changesA:p,changesB:b,focusedTogether:c.focusedTogether,broadTogether:c.broadTogether,broadCommitRatio:L,lastTogetherAt:c.lastTogetherAt,recentTogether:H,commitScope:ye(c.broadTogether,m),recency:H>0?"recent":"stale",subjectContext:xe(c.subjects)})}return f.sort((s,c)=>c.together-s.together||c.confidence-s.confidence||s.fileA.localeCompare(c.fileA)),f}function he(e,t,n,i){let r;try{r=Ce(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 a=new Set(r.map(s=>s.hash)),l=o.split(`
|
|
5
|
-
`).map(s=>s.trim()).filter(s=>s!==""&&a.has(s)),u=pe(e,r,i);if(l.length===0)return{head:t,commits:[],skippedBulkCommits:0,newestAnalyzedAt:u};let f;try{f=C(e,["show","--no-walk=unsorted","--name-only","--pretty=format:%x01%H%x00%ct%x00%s",...l])}catch{return null}let h=E(f,i);return{head:t,...h,newestAnalyzedAt:u}}function Ce(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 pe(e,t,n){for(let r=0;r<t.length;r+=20){let o=t.slice(r,r+20),a;try{a=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(a,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
|
-
`),a=o>=0?r.slice(0,o):r,[l,u,f]=a.split("\0");if(!l||!u)continue;let h=o>=0?r.slice(o+1).split(`
|
|
8
|
-
`).map(s=>s.trim()).filter(s=>s!==""):[];if(h.length>t){i+=1;continue}n.push({hash:l,timestamp:Number(u)||0,subject:f??"",files:h})}return{commits:n,skippedBulkCommits:i}}function be(e){return e.length>=$?!0:Ae(e).size>=U}function Ae(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 ye(e,t){return e===0?"focused":e/t>=.5?"broad-sweep":"mixed"}function xe(e){let t=new Set,n=[],i=[];for(let r of e){!i.includes(r)&&i.length<V&&i.push(r);for(let o of Se(r))t.add(o);for(let o of r.match(W)??[])n.includes(o)||n.push(o)}return{subjectLabels:[...t].sort(),issueRefs:n,sampleSubjects:i,externalIssueLabelStatus:"unavailable"}}function Se(e){let t=new Set,n=X.exec(e)?.[1]?.toLowerCase();return n&&t.add(Fe(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 Fe(e){return e==="feat"?"feature":e}export{Z as a,C as b,we as c};
|
|
9
|
-
//# sourceMappingURL=chunk-7COVQPQQ.js.map
|
package/dist/chunk-7S5E7KWT.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var b=[];function p(t){t.groups.length>0&&b.push(t)}function D(t,c){let a=new Set(c.groups);for(let n of b)n.groups.some(r=>a.has(r))&&(c.file!==void 0&&n.clearFile?n.clearFile(t,c.file):n.clearAll(t))}function g(){let t=new WeakMap;return{cache:t,ensure(c){let a=t.get(c);return a||(a=new Map,t.set(c,a)),a}}}function f(t,c){let{cache:a,ensure:n}=g(),r={get(e,i,o){let s=n(e);if(s.has(i))return s.get(i);let l=o();return s.set(i,l),l},invalidate(e,i){a.get(e)?.delete(i)},invalidateAll(e){a.delete(e)},size(e){return a.get(e)?.size??0}};return p({name:t,groups:c.clearGroups,clearAll:e=>r.invalidateAll(e),clearFile:(e,i)=>r.invalidate(e,i)}),r}function S(t,c){let a=new WeakMap,n={get(r,e){let i=a.get(r);if(i)return i.value;let o=e();return a.set(r,{value:o}),o},invalidate(r){a.delete(r)},has(r){return a.has(r)}};return p({name:t,groups:c.clearGroups,clearAll:r=>n.invalidate(r)}),n}var h={clearGroups:["whole-project","source-file"]};function P(t){return C(t,h)}function C(t,c){let{cache:a,ensure:n}=g(),r={get(e,i,o,s){let l=n(e),u=l.get(i);if(u&&u.source===o)return u.value;let d=s();return l.set(i,{source:o,value:d}),d},invalidate(e,i){a.get(e)?.delete(i)},invalidateAll(e){a.delete(e)}};return p({name:t,groups:c.clearGroups,clearAll:e=>r.invalidateAll(e),clearFile:(e,i)=>r.invalidate(e,i)}),r}export{p as a,D as b,f as c,S as d,P as e,C as f};
|
|
2
|
-
//# sourceMappingURL=chunk-7S5E7KWT.js.map
|
package/dist/chunk-7TVFPOD7.js
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import{a as f,b as N,c as m,d as E,e as M,f as p,h as k}from"./chunk-X5C43YVI.js";import{j as R}from"./chunk-JZBGTSAB.js";import{b as g,c as D,i as x,m as h,o as F}from"./chunk-WS3Z6W3M.js";import{a as S}from"./chunk-64MNV6AB.js";import{c as y}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
|
-
${w(n.orderBy)}
|
|
8
|
-
${C(n.limit)}`,...n.params??[])}function De(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
|
-
${w(n.orderBy)}
|
|
26
|
-
${C(n.limit)}`,...n.params??[])}function w(e){return e?`ORDER BY ${e}`:""}function C(e){return typeof e=="number"?`LIMIT ${e}`:""}function $(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 T(e){if(!e)return null;let n=O(e);if(n)return n.replace(/\n/g," ");let t=e.indexOf("|");if(t===-1)return e.replace(/\n/g," ");let r=e.slice(t+1);return(O(r)??r).replace(/\n/g," ")}function O(e){return/^```(?:\w+)?\s*\n?([\s\S]*?)\n?```/.exec(e.trimStart())?.[1]?.trim()||null}function H(e,n={}){if(m(e.symbol)!==null)return n.includeClassMemberFallbacks===!0;let i=(e.documentation??"").replace(/^```\w*\s*/,"").replace(/\s*```$/,"").trim();return/^(?:var|let|const|function|class|interface|type|enum)\b/.test(i)}function _(e,n,t={}){let r=new Map;for(let o of n)e.length>0&&!H(o,{includeClassMemberFallbacks:t.includeClassMemberFallbacks})||r.set(o.id,o);for(let o of e)r.set(o.id,o);let i=[...r.values()];return t.sort?i.sort((o,s)=>o.start_line-s.start_line||o.end_line-s.end_line||o.symbol.localeCompare(s.symbol)):i}var G=y("file-definitions",{clearGroups:["definition-catalog"]}),W=y("file-function-like-definitions",{clearGroups:["definition-catalog"]}),A=new WeakMap;function L(e,n,t={}){return t.includeClassMemberFallbacks?I(e,n,void 0,{includeClassMemberFallbacks:!0}):G.get(e,n,()=>{let r=B(e,n);if(r)return r;let i=I(e,n),o=D(e),s=f(e).forFile(n,{text:!0}).text;return o&&s&&v.write(e,n,g(e,n,s),{projectFingerprint:o,definitions:i.map(l=>({...l}))}),i})}function Y(e,n){return W.get(e,n,()=>{let t=B(e,n);return t?t.filter(r=>r.isFunctionLike):I(e,n,r=>r.isFunctionLike)})}var v=h({kind:"file-definitions",invalidation:F("file-definitions"),serialize:K,deserialize:U});function B(e,n){let t=D(e);if(!t)return null;let r=f(e).forFile(n,{text:!0}).text;if(!r)return null;let i=v.read(e,n,g(e,n,r));return i?q(i,t,n):null}function K(e){return JSON.stringify(e)}function U(e){try{let n=JSON.parse(e);return!x(n)||typeof n.projectFingerprint!="string"||!Array.isArray(n.definitions)?null:{projectFingerprint:n.projectFingerprint,definitions:n.definitions}}catch{return null}}function q(e,n,t){if(e.projectFingerprint!==n)return null;let r=[];for(let i of e.definitions){let o=X(i,t);if(!o)return null;r.push(o)}return r}function X(e,n){return!x(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 I(e,n,t,r={}){let i=_(Z(e,n),V(e,n),{sort:!0,includeClassMemberFallbacks:r.includeClassMemberFallbacks}).map(J);return t&&(i=i.filter(t)),j(e,n,i)}function Z(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 V(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:M(e.symbol),parentTypeName:m(e.symbol),isFunctionLike:k(e.symbol),isTypeLike:p(e.symbol)==="type",kind:e.kind??null,documentation:e.documentation??null,enclosingSymbol:e.enclosing_symbol??null}}function we(e,n={}){return ee(e,n.scope)}function ee(e,n){return S(e,{scope:n,includeIgnored:!1}).flatMap(t=>L(e,t)).filter(t=>!e.isIgnored(t.relativePath))}function Ce(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=Q(ne(e,n.scope,n.sqlPrefilter)),r=Q(te(e,n.scope,n.sqlPrefilter)),i=new Set([...t.keys(),...r.keys()]),o=[];for(let s of[...i].sort()){if(e.isIgnored(s))continue;let l=_(t.get(s)??[],r.get(s)??[],{sort:!0}).filter(a=>n.symbolMatches(a.symbol));l.length!==0&&o.push(...j(e,s,l.map(J)))}return o}function ne(e,n,t){let r=n?"AND d.relative_path LIKE ?":"",i=t?`AND ${z("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
|
-
${r}
|
|
78
|
-
${i}
|
|
79
|
-
${e.symbolNoiseFor("gs")}
|
|
80
|
-
ORDER BY d.relative_path, der.start_line, der.end_line`,...o)}function te(e,n,t){let r=n?"AND d.relative_path LIKE ?":"",i=t?`AND ${z("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
|
-
${r}
|
|
98
|
-
${i}
|
|
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 ie(e){return`(${e}.symbol LIKE '%().' OR ${e}.symbol LIKE '%()')`}function z(e,n){return n==="callable"?ie(e):re(e)}function re(e){return`(${e}.symbol LIKE '%.' OR ${e}.symbol LIKE '%()')`}function Q(e){let n=new Map;for(let t of e){let r=n.get(t.relative_path);r?r.push(t):n.set(t.relative_path,[t])}return n}function Te(e,n,t={}){if(n.length===0)return[];let r=n.flatMap(i=>L(e,i)).filter(i=>!e.isIgnored(i.relativePath));return t.onlyDocumented&&(r=r.filter(i=>i.documentation!==null&&i.documentation!=="")),t.sort&&(r=r.sort((i,o)=>i.relativePath.localeCompare(o.relativePath)||i.startLine-o.startLine||i.endLine-o.endLine)),r.map(i=>({startLine:i.startLine,endLine:i.endLine,symbol:i.symbol,shortName:E(i.symbol),signature:$(T(i.documentation)),relativePath:i.relativePath,enclosingSymbol:i.enclosingSymbol}))}function oe(e){let n=new Map,t=e.map((r,i)=>({definition:r,index:i,span:r.endLine-r.startLine})).sort((r,i)=>r.span-i.span||r.index-i.index);for(let{definition:r}of t)for(let i=r.startLine;i<=r.endLine;i+=1)n.has(i)||n.set(i,r);return n}function Ae(e,n){let t=A.get(e);return t||(t=oe(e),A.set(e,t)),t.get(n)??null}function Qe(e,n){let t=L(e,n.relative_path).find(r=>r.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 j(e,n,t){let r=f(e).forFile(n,{text:!0}).text,i=R(e,n);return i?me(t,i,r):r?se(t,r):t}function se(e,n){let t=n.split(/\r?\n/),r=le(e,t),i=ae(e,r),o=ce(i,t);return de(e,o)}function le(e,n){let t=e.some(i=>b(i.symbol))?pe(n):null,r=new Map;for(let i of e)r.set(i.symbolId,fe(n,t,i));return r}function ae(e,n){return e.filter(t=>b(t.symbol)).map(t=>({definition:t,startLine:n.get(t.symbolId)??t.startLine})).sort((t,r)=>t.startLine-r.startLine||t.definition.startLine-r.definition.startLine||t.definition.symbol.localeCompare(r.definition.symbol))}function ce(e,n){let t=new Map;for(let r=0;r<e.length;r+=1){let i=e[r],o=e[r+1],s=o?Math.max(i.startLine,o.startLine-1):n.length-1;t.set(i.definition.symbolId,{startLine:i.startLine,endLine:be(n,i.definition,i.startLine,s)})}return t}function de(e,n){return e.map(t=>{let r=n.get(t.symbolId);return r?{...t,startLine:r.startLine,endLine:r.endLine}:t})}function me(e,n,t=null){let r=new Map;for(let i of n){let o=r.get(i.name);o?o.push(i):r.set(i.name,[i])}return e.map(i=>{if(!ue(i)||!i.leaf)return P(i,t);let o=r.get(i.leaf);if(!o||o.length===0)return P(i,t);let s=o[0],l=Math.abs(s.startLine-i.startLine);for(let a=1;a<o.length;a+=1){let c=o[a],d=Math.abs(c.startLine-i.startLine);d<l&&(s=c,l=d)}return{...i,startLine:s.startLine,endLine:s.endLine}})}function ue(e){return b(e.symbol)?!0:p(e.symbol)==="term"&&m(e.symbol)===null}function P(e,n){if(!n||!e.leaf||p(e.symbol)!=="term"||m(e.symbol)!==null)return e;let t=e.leaf.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),r=new RegExp(`\\b(?:export\\s+)?(?:const|let|var)\\s+${t}\\b`),o=n.split(/\r?\n/).findIndex(s=>r.test(s));return o>=0?{...e,startLine:o,endLine:o}:e}function fe(e,n,t){if(!b(t.symbol))return t.startLine;let r=Math.max(0,Math.min(t.startLine,e.length-1));if(!n)return r;let i=n.get(t.leaf);if(!i||i.length===0)return r;let o=null;for(let s of i){let l=Math.abs(s-t.startLine);(!o||l<o.distance)&&(o={line:s,distance:l})}return o?.line??r}function pe(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,r=/^\s*(?:(?:export|public|private|protected|static|readonly|async|abstract|get|set)\s+)*([A-Za-z_$][\w$]*)\s*(?:<[^(]*>)?\s*\(/,i=/\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(r);c?.[1]&&s(c[1],l);for(let d of a.matchAll(i))d[1]&&s(d[1],l)}return o}function be(e,n,t,r){let i=Math.max(t,Math.min(e.length-1,r)),o=Math.max(t,Math.min(i,n.endLine)),s=0,l=0,a=!1;for(let c=t;c<=i;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,r=!1;for(let i=0;i<e.length;i+=1){let o=e[i],s=e[i+1];if(!t&&o==="/"&&s==="/"){n+=" ".repeat(e.length-i);break}if(t){if(r){r=!1,n+=" ";continue}if(o==="\\"){r=!0,n+=" ";continue}o===t&&(t=null),n+=" ";continue}if(o==='"'||o==="'"||o==="`"){t=o,n+=" ";continue}n+=o}return n}function b(e){return e.includes("().")}function Pe(e){let n=N(e);if("kind"in n)return[];let t=[];for(let r=n.descriptors.length-2;r>=0;r-=1){let i=n.descriptors[r];i?.suffix==="type"&&i.name&&t.push(i.name)}return t}export{ge as a,De as b,$ as c,T as d,_ as e,L as f,we as g,ee as h,Ce as i,$e as j,Te as k,oe as l,Ae as m,Qe as n,Pe as o};
|
|
102
|
-
//# sourceMappingURL=chunk-7TVFPOD7.js.map
|