scip-query 0.12.0 → 0.14.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 +10 -0
- package/README.md +2 -1
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-ECVXWZ4Q.js → chunk-27HMTUJE.js} +2 -2
- package/dist/{chunk-2LQWMYG4.js → chunk-27XEGMCT.js} +2 -2
- package/dist/{chunk-NKT5EMEX.js → chunk-2TPCIPYA.js} +2 -2
- package/dist/{chunk-ZOIPAYRP.js → chunk-2XRXEIRK.js} +2 -2
- package/dist/{chunk-Q3B3FNCU.js → chunk-3AMWF6V5.js} +2 -2
- package/dist/{chunk-BVNO67DB.js → chunk-3H5OSDF7.js} +2 -2
- package/dist/{chunk-D64L53WX.js → chunk-43GKP6LI.js} +2 -2
- package/dist/{chunk-F5BJSNU5.js → chunk-44P4SJFN.js} +2 -2
- package/dist/{chunk-T7VQG55Q.js → chunk-5JRMZMLM.js} +2 -2
- package/dist/{chunk-72MFTCU5.js → chunk-5VY3RIEI.js} +2 -2
- package/dist/{chunk-D7J6GZAG.js → chunk-6JUAGXR4.js} +2 -2
- package/dist/{chunk-NQ75OVUU.js → chunk-6KDOYKCB.js} +2 -2
- package/dist/chunk-6KMTPNZL.js +3 -0
- package/dist/{chunk-TTMKELT7.js → chunk-72FR7KEZ.js} +2 -2
- package/dist/{chunk-FXG3PHVW.js → chunk-7COVQPQQ.js} +6 -6
- package/dist/{chunk-MBKJ7GHT.js → chunk-7TVFPOD7.js} +2 -2
- package/dist/{chunk-M72ZFN6E.js → chunk-A6KSEIRN.js} +2 -2
- package/dist/{chunk-52Q4JFDW.js → chunk-AAMURYOK.js} +2 -2
- package/dist/{chunk-XEMQUN3Z.js → chunk-BP7S6V3M.js} +2 -2
- package/dist/{chunk-ETU2I5JM.js → chunk-BRBF3E5X.js} +2 -2
- package/dist/{chunk-V7CVBPWX.js → chunk-BUNDZ6K2.js} +2 -2
- package/dist/{chunk-NAH5EAZS.js → chunk-BZXE3HO4.js} +2 -2
- package/dist/{chunk-AZLKLZ5S.js → chunk-CXQQOXSI.js} +2 -2
- package/dist/{chunk-RIQED5OU.js → chunk-EDSD3VJK.js} +2 -2
- package/dist/chunk-EVZSAR3S.js +2 -0
- package/dist/{chunk-L2CX5GHZ.js → chunk-GMOEX7EV.js} +2 -2
- package/dist/{chunk-O3WDE26W.js → chunk-GUDKRIGW.js} +2 -2
- package/dist/{chunk-MKM7NBZK.js → chunk-GULVO6NF.js} +2 -2
- package/dist/{chunk-V3Z3IOWO.js → chunk-GY3HAWUA.js} +2 -2
- package/dist/{chunk-G2UBOONK.js → chunk-HV27H2V2.js} +2 -2
- package/dist/chunk-HZZQKNVE.js +2 -0
- package/dist/{chunk-T6NGEV5I.js → chunk-I4R3SNMR.js} +2 -2
- package/dist/{chunk-UAHZ57BR.js → chunk-IMQFJ53K.js} +2 -2
- package/dist/{chunk-NJJ7AS4F.js → chunk-IUSSGHJO.js} +2 -2
- package/dist/{chunk-OVMUVXKQ.js → chunk-JJUX2OAP.js} +2 -2
- package/dist/chunk-JZBGTSAB.js +13 -0
- package/dist/{chunk-YPKBZ77R.js → chunk-K5N5RNGM.js} +2 -2
- package/dist/{chunk-OSWF3HSF.js → chunk-K7SPOJHZ.js} +2 -2
- package/dist/{chunk-BCNT6ODA.js → chunk-KSJ544IV.js} +2 -2
- package/dist/{chunk-HSU3M25J.js → chunk-KYB7FPXT.js} +2 -2
- package/dist/{chunk-ORBRX2QJ.js → chunk-LY7NMOBW.js} +2 -2
- package/dist/{chunk-CW3KZ7UF.js → chunk-M7EEHYSU.js} +2 -2
- package/dist/{chunk-U7I373V4.js → chunk-N23FT4EZ.js} +2 -2
- package/dist/{chunk-ZRIOGL7F.js → chunk-N2OTJWC2.js} +2 -2
- package/dist/{chunk-PH7ZFK6L.js → chunk-NCVFKOLB.js} +2 -2
- package/dist/{chunk-2QGE5AEP.js → chunk-NOKUZU56.js} +2 -2
- package/dist/{chunk-BP2NAIAZ.js → chunk-OXTM2RX3.js} +2 -2
- package/dist/{chunk-RA5MTIOO.js → chunk-PEHDARNC.js} +2 -2
- package/dist/chunk-PESEPWZO.js +2 -0
- package/dist/{chunk-LFM3O5KX.js → chunk-PMY4UFGV.js} +2 -2
- package/dist/{chunk-H7NSJ7L2.js → chunk-Q7PWDXL5.js} +2 -2
- package/dist/{chunk-FBCOFKEC.js → chunk-QVGFVRKD.js} +2 -2
- package/dist/{chunk-Q7S2DADC.js → chunk-QYOPMTZ6.js} +2 -2
- package/dist/{chunk-VYF5HA76.js → chunk-QZOAOLLZ.js} +2 -2
- package/dist/{chunk-NLMRJ7SI.js → chunk-R7U2I55B.js} +2 -2
- package/dist/{chunk-64PRNLKP.js → chunk-RLB6SG25.js} +2 -2
- package/dist/{chunk-MJKJMWIM.js → chunk-SFDVBARK.js} +2 -2
- package/dist/{chunk-B4VYXRCQ.js → chunk-TYCZ7S4I.js} +2 -2
- package/dist/{chunk-4D54JIU3.js → chunk-U3VMUDXJ.js} +2 -2
- package/dist/chunk-UHPWZCYQ.js +3 -0
- package/dist/{chunk-OPE5YXFE.js → chunk-V5W7H7V4.js} +2 -2
- package/dist/{chunk-YDDGCJJG.js → chunk-WMO2VZZK.js} +2 -2
- package/dist/chunk-WPZPB42I.js +2 -0
- package/dist/{chunk-EXKLAEB4.js → chunk-X3DTIEMU.js} +2 -2
- package/dist/chunk-X5C43YVI.js +2 -0
- package/dist/{chunk-FERAXG6Y.js → chunk-X7CHWTZ2.js} +1 -1
- package/dist/{chunk-IRJDYTNZ.js → chunk-XC2PJOVM.js} +2 -2
- package/dist/{chunk-Z3IPJKJP.js → chunk-XDESMVOL.js} +2 -2
- package/dist/{chunk-KSUZS77X.js → chunk-XZBLZHXL.js} +2 -2
- package/dist/{chunk-7ITCOJGD.js → chunk-YQKECTPV.js} +2 -2
- package/dist/chunk-YTVKPJXW.js +2 -0
- package/dist/{chunk-75X52JTA.js → chunk-ZEO4CXQR.js} +2 -2
- package/dist/cli.js +259 -246
- package/dist/index.js +1 -1
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.d.ts +34 -0
- package/dist/queries/decorative-checkers.js +2 -0
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.js +1 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/incomplete-migration.js +1 -1
- package/dist/queries/index.d.ts +3 -0
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/locality-candidates.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/not-implemented.d.ts +33 -0
- package/dist/queries/not-implemented.js +2 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.js +1 -1
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +56 -0
- package/dist/queries/test-quality.js +2 -0
- package/dist/queries/trace.js +1 -1
- package/dist/queries/twin-ab.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -1
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +12 -11
- package/dist/reindex.js +20 -19
- package/dist/runtime.js +1 -1
- package/docs/COMMAND_REFERENCE.md +4 -1
- package/docs/analyzer-inventory.md +16 -0
- package/package.json +14 -2
- package/skills/_shared/SKILL.md +4 -1
- package/skills/scip-calibrate/SKILL.md +124 -0
- package/skills/scip-calibrate/agents/openai.yaml +4 -0
- package/skills/scip-integrity-audit/SKILL.md +32 -0
- package/skills/scip-tla-model-system/SKILL.md +7 -9
- package/dist/chunk-EDB7Y442.js +0 -2
- package/dist/chunk-EZ5WDZ2Q.js +0 -3
- package/dist/chunk-H2NMIZFD.js +0 -2
- package/dist/chunk-HXXMPYEF.js +0 -2
- package/dist/chunk-PXHPCWX5.js +0 -2
- package/dist/chunk-T2FQ4GHD.js +0 -9
package/skills/_shared/SKILL.md
CHANGED
|
@@ -120,6 +120,9 @@ scip-query redundant-reexports # Find barrel re-exports that nobody imports thro
|
|
|
120
120
|
scip-query duplicate-bodies # Find exact duplicate small-body candidates across files
|
|
121
121
|
scip-query twin-drift # Twin drift candidates: same-name (or near-name) functions across files with diverged bodies
|
|
122
122
|
scip-query twin-ab <symbolA> <symbolB> # Generate a behavioral A/B scaffold comparing two same-concept twins (scip-integrity-audit drill 5) — a ready-to-fill vitest file, not an auto-executor
|
|
123
|
+
scip-query not-implemented # Reachable placeholder stub candidates (throw-stub, TODO+return-default, empty body) — production callers can actually reach these; an unreachable stub is dead's job, not this one's
|
|
124
|
+
scip-query decorative-checkers # Decorative checker candidates: validate*/verify*/check*/assert*/is*/has* callables with no reachable failure exit anywhere in their body
|
|
125
|
+
scip-query test-quality # Test-quality candidates: assertion-free it/test bodies, a skipped-test ledger with git-blame age, and mock-echo tests that assert the same literal they stubbed into a mock
|
|
123
126
|
scip-query similar-signatures # Find functions with near-identical type signatures (same shape)
|
|
124
127
|
```
|
|
125
128
|
|
|
@@ -171,7 +174,7 @@ scip-query complexity <symbol> # Per-symbol complexity: branches, cyclomatic est
|
|
|
171
174
|
|
|
172
175
|
```bash
|
|
173
176
|
scip-query bench # Benchmark indexing and command runtimes for this repository
|
|
174
|
-
scip-query install-skills # Install skills (_shared, scip-query, scip-setup, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots
|
|
177
|
+
scip-query install-skills # Install skills (_shared, scip-query, scip-setup, scip-calibrate, scip-cleanup-audit, scip-cleanup-improve, scip-integrity-audit, scip-twin-drift, scip-claim-audit, scip-probe-reachability, scip-hyper-optimization, scip-api-impact, scip-concrete-plan, scip-conductor, scip-debug, scip-explore, scip-triage-issue, scip-diagram, scip-doc-reconcile, scip-directory-architecture, scip-maintainability, scip-react-maintainability, scip-vue-maintainability, scip-verify, scip-language-playbook, scip-tla-model-system) into Claude Code, Codex, and shared agent roots
|
|
175
178
|
scip-query setup-hooks # Install or refresh project-local Codex and Claude Code lifecycle hooks
|
|
176
179
|
scip-query check-deps # Check whether scip-query and the detected language indexers are actually runnable
|
|
177
180
|
scip-query capabilities # Report which evidence and verification capabilities are available in this project
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: scip-calibrate
|
|
3
|
+
description: Calibrate scip-query's detectors against a repo before trusting them. Use when adopting scip-query in a new or foreign codebase, after major detector changes, when a health score or gate output seems too noisy or too clean, or before letting diff-gate block anyone's work.
|
|
4
|
+
commands:
|
|
5
|
+
- scip-query health --json
|
|
6
|
+
- scip-query diff-gate --base <commit> --json
|
|
7
|
+
- scip-query twin-drift -s <scope> --json
|
|
8
|
+
- scip-query dead --json
|
|
9
|
+
- scip-query similar <symbol>
|
|
10
|
+
- scip-query config-validate
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# scip-calibrate
|
|
14
|
+
|
|
15
|
+
Use this skill to measure whether scip-query's detectors tell the truth about a
|
|
16
|
+
specific repository before believing anything they say about it. A detector
|
|
17
|
+
tuned on one codebase's conventions can be precise there and noisy elsewhere;
|
|
18
|
+
calibration is how you find out which you have — and it converts every noise
|
|
19
|
+
archetype you find into either a repo-side knob or an upstream detector bug.
|
|
20
|
+
|
|
21
|
+
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
|
+
|
|
23
|
+
## The Stance
|
|
24
|
+
|
|
25
|
+
A health score you have not calibrated is a number, not a fact. Never present
|
|
26
|
+
detector output from an uncalibrated repo as findings — present it as
|
|
27
|
+
candidate findings pending classification. The score must EARN trust the same
|
|
28
|
+
way a checker earns it in `scip-integrity-audit`: by being witnessed telling
|
|
29
|
+
the truth on samples you verified yourself.
|
|
30
|
+
|
|
31
|
+
## Protocol
|
|
32
|
+
|
|
33
|
+
Run all five stages. Each has a checkable exit.
|
|
34
|
+
|
|
35
|
+
### 1. Index and inventory
|
|
36
|
+
|
|
37
|
+
`scip-query reindex`, then `scip-query status --capabilities`. Record which
|
|
38
|
+
languages got which evidence tier (SCIP-indexed vs source-fallback vs regex) —
|
|
39
|
+
a detector's expected precision differs per tier, and a repo that is 80%
|
|
40
|
+
fallback-tier must be judged against fallback expectations. Note monorepo
|
|
41
|
+
shape (workspaces, cross-package imports): historically the single largest
|
|
42
|
+
false-positive source (dead/new-dead on cross-package consumers).
|
|
43
|
+
Complete when: languages, tiers, and workspace shape are written down.
|
|
44
|
+
|
|
45
|
+
### 2. Battery sweep
|
|
46
|
+
|
|
47
|
+
Run the full detector battery and `health --json`. Do not react to anything
|
|
48
|
+
yet — big numbers are not findings, they are sampling frames.
|
|
49
|
+
Complete when: every detector's finding count is recorded.
|
|
50
|
+
|
|
51
|
+
### 3. Retro-gate replay
|
|
52
|
+
|
|
53
|
+
Replay `diff-gate` against the last 15–20 real commits (worktree per commit,
|
|
54
|
+
never the user's live tree). This is the stage that exposes finding WALLS —
|
|
55
|
+
one hub file or one convention mismatch generating dozens of near-identical
|
|
56
|
+
findings per commit. A wall is always either a missing repo knob or a detector
|
|
57
|
+
bug; it is never "the repo is just bad."
|
|
58
|
+
Complete when: per-commit finding counts and every wall are recorded.
|
|
59
|
+
|
|
60
|
+
### 4. Sample and classify — the actual calibration
|
|
61
|
+
|
|
62
|
+
For each detector with findings: sample about 10 (all of them if fewer),
|
|
63
|
+
READ THE CODE at each site, and classify actionable vs noise. Two rules make
|
|
64
|
+
this real calibration instead of theater:
|
|
65
|
+
|
|
66
|
+
- Classify from the code, never from the finding text. A finding that sounds
|
|
67
|
+
plausible and a finding that is true are different things; the difference is
|
|
68
|
+
only visible at the cited file and line.
|
|
69
|
+
- For every noise finding, name the ARCHETYPE (e.g. "type-only import
|
|
70
|
+
invisible to indexer", "delegation chain flagged as twin", "generic shared
|
|
71
|
+
helpers saturating similarity"). Archetypes are the deliverable: a noise
|
|
72
|
+
rate without archetypes cannot be fixed.
|
|
73
|
+
|
|
74
|
+
Then give each detector a verdict: **keep** (precision acceptable), **retune**
|
|
75
|
+
(name the threshold and the value), or **demote to advisory** for this repo.
|
|
76
|
+
Complete when: every detector has sampled precision, named archetypes, and a
|
|
77
|
+
verdict.
|
|
78
|
+
|
|
79
|
+
### 5. Tune the knobs, file the bugs
|
|
80
|
+
|
|
81
|
+
Apply repo-side fixes for what belongs to the repo, and file upstream for what
|
|
82
|
+
belongs to the detector:
|
|
83
|
+
|
|
84
|
+
- `.scipquery.json` suppressions — one per accepted finding, WITH a reason;
|
|
85
|
+
a reasonless suppression is hiding, not tuning.
|
|
86
|
+
- `docs.snapshotPaths` — dated/archival docs that must never generate
|
|
87
|
+
doc-reference findings.
|
|
88
|
+
- Coverage contracts — enumerations the gate should police.
|
|
89
|
+
- `commandAnalysisBudget` — cap analysis honestly on very large indexes.
|
|
90
|
+
- Detector bugs (noise archetypes no knob can express) go to the tool's
|
|
91
|
+
followup ledger with the archetype, a concrete example, and the sampled
|
|
92
|
+
rate. Never tune a threshold to hide an archetype — that trades visible
|
|
93
|
+
noise for invisible blindness.
|
|
94
|
+
|
|
95
|
+
Complete when: the gate replay from stage 3 re-runs materially quieter, and
|
|
96
|
+
every remaining finding class is either actionable, suppressed-with-reason, or
|
|
97
|
+
filed upstream.
|
|
98
|
+
|
|
99
|
+
## Failure Modes (each observed in a real calibration)
|
|
100
|
+
|
|
101
|
+
- **Sampling too few.** One good finding does not make a detector precise;
|
|
102
|
+
one bad finding does not make it noise. Ten per detector is the floor.
|
|
103
|
+
- **Classifying from the finding text.** The finding always sounds right —
|
|
104
|
+
it was generated to. Only the code knows.
|
|
105
|
+
- **Tuning to green.** Raising a threshold until the noise disappears also
|
|
106
|
+
disappears the real findings. If the archetype is a detector bug, file it
|
|
107
|
+
and live with the noise until it is fixed.
|
|
108
|
+
- **Trusting a clean run.** Zero findings on a detector can mean precision or
|
|
109
|
+
can mean the detector cannot see this repo's conventions at all (wrong
|
|
110
|
+
import style, unindexed language). Verify at least one known-true positive
|
|
111
|
+
per major detector — plant one if none exists.
|
|
112
|
+
- **Calibrating the wrong tree.** Clones or worktrees for anything that
|
|
113
|
+
mutates; the target repo is read-only unless its owner said otherwise.
|
|
114
|
+
|
|
115
|
+
## After Calibration
|
|
116
|
+
|
|
117
|
+
The finding-outcome ledger keeps calibrating for you: once the repo uses
|
|
118
|
+
diff-gate, per-detector precision is recomputed from real outcomes
|
|
119
|
+
(`detectorPrecision` in `health --json`). Re-run this protocol only after
|
|
120
|
+
major detector upgrades or when the ledger's precision numbers drift from
|
|
121
|
+
what you measured. Write the calibration report to
|
|
122
|
+
`docs/validation/YYYY-MM-DD-external-calibration-<repo>.md` in the shape of
|
|
123
|
+
the exemplars this skill was distilled from — battery table, retro-gate
|
|
124
|
+
walls, per-detector verdicts, noise archetypes, caps and deviations.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
interface:
|
|
2
|
+
display_name: "scip calibrate"
|
|
3
|
+
short_description: "Measure scip-query's detector precision on a repo before trusting scores or gating anyone."
|
|
4
|
+
default_prompt: "Run the scip-calibrate protocol against this repository: battery sweep, retro-gate replay, sample-and-classify each detector from the code, then tune repo knobs and file detector bugs."
|
|
@@ -9,6 +9,9 @@ commands:
|
|
|
9
9
|
- scip-query twin-drift -s <scope> --json
|
|
10
10
|
- scip-query twin-ab <symbolA> <symbolB>
|
|
11
11
|
- scip-query outline <file> --signatures
|
|
12
|
+
- scip-query decorative-checkers -s <scope> --json
|
|
13
|
+
- scip-query not-implemented -s <scope> --json
|
|
14
|
+
- scip-query test-quality -s <scope> --json
|
|
12
15
|
---
|
|
13
16
|
|
|
14
17
|
# scip-integrity-audit
|
|
@@ -43,6 +46,13 @@ decorative: file it as a defect, not a note.
|
|
|
43
46
|
Complete only when every checker in scope has been witnessed rejecting a
|
|
44
47
|
constructed should-fail input, or is listed with a reason it cannot be.
|
|
45
48
|
|
|
49
|
+
Mechanized by: `scip-query decorative-checkers` finds `validate*`/`verify*`/
|
|
50
|
+
`check*`/`assert*`/`is*`/`has*` callables with no reachable failure exit
|
|
51
|
+
anywhere in their body (calibrated 2026-07-03 against two external repos —
|
|
52
|
+
standalone-only; noise archetypes past one-hop delegation in
|
|
53
|
+
`docs/validation/2026-07-03-integrity-detector-calibration.md`). Run it first
|
|
54
|
+
to shortlist candidates before hand-constructing should-fail inputs.
|
|
55
|
+
|
|
46
56
|
### 2. Diff every adapter against captured reality
|
|
47
57
|
|
|
48
58
|
For each parser/adapter of an external format (tool output, XML/JSON
|
|
@@ -65,6 +75,15 @@ feature above it is dead — date of death: birth.
|
|
|
65
75
|
Complete only when every fallback's primary path has a witness or a filed
|
|
66
76
|
defect.
|
|
67
77
|
|
|
78
|
+
Mechanized by: `scip-query not-implemented` finds reachable placeholder
|
|
79
|
+
stubs (`throw new Error('not implemented')`, TODO-comment + return-default,
|
|
80
|
+
empty bodies) that a real caller, entry surface, or package-surface export
|
|
81
|
+
can actually reach — the graph fact that separates "primary path never
|
|
82
|
+
built" from `dead`'s "primary path built but unreferenced." Standalone-only
|
|
83
|
+
(calibrated 2026-07-03; 0 live findings on two external repos post-fix, see
|
|
84
|
+
the calibration report) — treat a clean run as "nothing this shape found,"
|
|
85
|
+
not as "every fallback's primary path is proven live."
|
|
86
|
+
|
|
68
87
|
### 4. Hand-compute every metric twice
|
|
69
88
|
|
|
70
89
|
For each number the system reports (scores, counts, estimates): pick two
|
|
@@ -101,3 +120,16 @@ the drill that exposed it, the should-fail input or real sample used, and
|
|
|
101
120
|
the fix. The audit is complete only when every drill's exit criterion is
|
|
102
121
|
met for the scope, and every defect found has a regression artifact — a
|
|
103
122
|
test, fixture, or model that fails on the pre-fix behavior.
|
|
123
|
+
|
|
124
|
+
A regression artifact that doesn't actually assert anything, or asserts the
|
|
125
|
+
same literal it stubbed into its own mock, is a fake witness — the same
|
|
126
|
+
"reports success without doing the work" failure mode this skill hunts in
|
|
127
|
+
production code, just relocated to the test suite. Run `scip-query
|
|
128
|
+
test-quality -s <scope>` over the audit's own regression artifacts (and,
|
|
129
|
+
periodically, over the suite at large) to catch this: assertion-free test
|
|
130
|
+
bodies, a skipped-test ledger with git-blame age (a skip with no fix date
|
|
131
|
+
attached is a claim nobody is checking), and mock-echo (a test that only
|
|
132
|
+
proves its own stub). Standalone-only, mixed precision by sub-check
|
|
133
|
+
(calibrated 2026-07-03): assertion-free and skipped are high-precision;
|
|
134
|
+
mock-echo is intentionally low-precision (syntactic same-literal matching,
|
|
135
|
+
not dataflow) — treat its output as a reviewed candidate list, not a verdict.
|
|
@@ -21,19 +21,17 @@ Use this skill when a TypeScript system needs a TLA+ model tied to code evidence
|
|
|
21
21
|
Load shared mechanics from [`../_shared/SKILL.md`](../_shared/SKILL.md).
|
|
22
22
|
|
|
23
23
|
<!-- BEGIN GENERATED SKILL COMMANDS -->
|
|
24
|
-
|
|
25
24
|
## Commands for this skill
|
|
26
25
|
|
|
27
|
-
| Command
|
|
28
|
-
|
|
|
29
|
-
| `scip-query tla scaffold <file>`
|
|
30
|
-
| `scip-query tla verify <spec>`
|
|
31
|
-
| `scip-query tla instrument <spec>`
|
|
32
|
-
| `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation.
|
|
33
|
-
| `scip-query tla fetch-tools`
|
|
26
|
+
| Command | Purpose | When |
|
|
27
|
+
| --- | --- | --- |
|
|
28
|
+
| `scip-query tla scaffold <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Start here for a new model: derive a draft spec, config, and mapping from indexed code. |
|
|
29
|
+
| `scip-query tla verify <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Mechanical conformance: referents, reads/writes, calls, and the model checker. |
|
|
30
|
+
| `scip-query tla instrument <spec>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Generate a trace recorder plus wiring sites for each mapped action. |
|
|
31
|
+
| `scip-query tla trace-check <spec> --trace <file>` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Semantic conformance: check a recorded execution against the model's Next relation. |
|
|
32
|
+
| `scip-query tla fetch-tools` | TLA+ model workflow: verify a model and mapping contract, scaffold a draft model from indexed code, generate a trace recorder, or check a recorded trace against the next-state relation | Download the pinned tla2tools.jar into the cache when the checker is unavailable. |
|
|
34
33
|
|
|
35
34
|
Use this shortlist first. Open [`../_shared/SKILL.md`](../_shared/SKILL.md) only when it is insufficient.
|
|
36
|
-
|
|
37
35
|
<!-- END GENERATED SKILL COMMANDS -->
|
|
38
36
|
|
|
39
37
|
## Choose the Slice
|
package/dist/chunk-EDB7Y442.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as x,f as C,g as w}from"./chunk-Q3B3FNCU.js";import{b as k}from"./chunk-B75HZHUP.js";import{b as A,c as M}from"./chunk-NAH5EAZS.js";import{a as N}from"./chunk-BGBBVSH4.js";import{g as z}from"./chunk-MBKJ7GHT.js";import{d as v}from"./chunk-HXXMPYEF.js";import{b as h,i as S,m as R}from"./chunk-T2FQ4GHD.js";import{c as p}from"./chunk-GNG622H3.js";function fe(t,e={}){let{includeHomonyms:i=!1,limit:s}=e,r=F(t,e).filter(o=>o.relationship==="divergent"||i&&o.relationship==="homonym");return s?r.slice(0,s):r}function F(t,e={}){let{scope:i,minSimilarity:s=.3,scanLimit:r}=e,o=B(t,{scope:i,scanLimit:r});return $(o,{minSimilarity:s,isDelegatePair:Y(t)})}function $(t,e={}){let i=e.minSimilarity??.3,s=e.isDelegatePair,r=t.filter(n=>!ee(n.leaf)),o=[...new Set(r.map(n=>n.leaf))],a=H(o),l=[];for(let n of a){let c=r.filter(f=>n.has(f.leaf));if(c.length<2||new Set(c.map(f=>f.file)).size<2||c.every(f=>A(f.file)==="test"))continue;let m=null,b=!1,y=!1;for(let f=0;f<c.length;f+=1)for(let u=f+1;u<c.length;u+=1){let g=c[f],d=c[u];if(g.file===d.file||s?.(g,d,c)||s?.(d,g,c))continue;if(b=!0,g.normalizedBody===d.normalizedBody){y=!0;continue}let L=E(g.tokens,d.tokens);(!m||L>m.similarity)&&(m={a:g,b:d,similarity:L})}if(!b)continue;let T=[...c].sort((f,u)=>f.file.localeCompare(u.file)||f.startLine-u.startLine).map(O);if(!m){l.push({leaf:P(n),relationship:y?"identical":"homonym",maxDivergence:0,members:T});continue}let D=m.similarity>=i?"divergent":"homonym";l.push({leaf:P(n),relationship:D,maxDivergence:Math.round((1-m.similarity)*1e3)/1e3,members:T,...D==="divergent"?{firstDivergentTokens:Z(m.a.tokens,m.b.tokens)}:{}})}return l.sort((n,c)=>c.members.length-n.members.length||c.maxDivergence-n.maxDivergence||n.leaf.localeCompare(c.leaf))}function B(t,e){let i=z(t,{scope:e.scope}).filter(o=>o.isFunctionLike&&!t.isIgnored(o.relativePath)).filter(o=>!M(o.relativePath));i.sort((o,a)=>o.relativePath.localeCompare(a.relativePath)||o.startLine-a.startLine);let s=k(i,e.scanLimit),r=[];for(let o of s){let a=I(t,o);a&&r.push(a)}return r}function I(t,e){if(!e.leaf)return null;let i=C(t,e);if(!i)return null;let s=x(i);if(!s||s.length<8)return null;let r=G(i);return r.length===0?null:{leaf:e.leaf,symbol:e.symbol,shortName:v(e.symbol),file:e.relativePath,startLine:e.startLine,endLine:e.endLine,loc:N(e),normalizedBody:s,tokens:r,isThinForwarder:X(i)}}var j=/[A-Za-z_$][A-Za-z0-9_$]*|\d+(?:\.\d+)?|[^\sA-Za-z0-9_$]/g;function G(t){let e=w(t);return h(e).match(j)??[]}function O(t){return{symbol:t.symbol,shortName:t.shortName,file:t.file,startLine:t.startLine,endLine:t.endLine,loc:t.loc}}function E(t,e){let i=new Set(t),s=new Set(e);if(i.size===0&&s.size===0)return 1;if(i.size===0||s.size===0)return 0;let r=0;for(let a of i)s.has(a)&&(r+=1);let o=i.size+s.size-r;return o===0?0:r/o}function Z(t,e){let i=Math.min(t.length,e.length),s=0;for(;s<i&&t[s]===e[s];)s+=1;let r=t.slice(s,s+6).join(" "),o=e.slice(s,s+6).join(" ");return!r&&!o?"(bodies differ only in trailing length)":`A: ${r||"(end)"} | B: ${o||"(end)"}`}function H(t){let e=new Map;for(let a of t)e.set(a,a);let i=a=>{let l=a;for(;e.get(l)!==l;)l=e.get(l);let n=a;for(;e.get(n)!==l;){let c=e.get(n);e.set(n,l),n=c}return l},s=(a,l)=>{let n=i(a),c=i(l);n!==c&&e.set(n,c)},r=new Map;for(let a of t){let l=a.slice(0,1).toLowerCase(),n=r.get(l)??[];n.push(a),r.set(l,n)}for(let a of r.values())for(let l=0;l<a.length;l+=1)for(let n=l+1;n<a.length;n+=1)W(a[l],a[n])&&s(a[l],a[n]);let o=new Map;for(let a of t){let l=i(a),n=o.get(l)??new Set;n.add(a),o.set(l,n)}return[...o.values()]}function W(t,e){return t===e||t.toLowerCase()===e.toLowerCase()?!0:t.length<8||e.length<8||Math.abs(t.length-e.length)>2?!1:K(t.toLowerCase(),e.toLowerCase(),2)}function K(t,e,i){if(Math.abs(t.length-e.length)>i)return!1;let s=Array.from({length:e.length+1},(r,o)=>o);for(let r=1;r<=t.length;r+=1){let o=[r],a=o[0];for(let l=1;l<=e.length;l+=1){let n=t[r-1]===e[l-1]?0:1,c=Math.min(s[l]+1,o[l-1]+1,s[l-1]+n);o.push(c),a=Math.min(a,c)}if(a>i)return!1;s=o}return s[e.length]<=i}function X(t){let e=h(w(t)).trim();if(!e||q.test(e))return!1;let i=U(e);return i.length===0||i.length>2?!1:Q(i[i.length-1])}var q=/\b(?:if|else|for|while|switch|try|catch|do)\b/,J=/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\[[^[\]]*\])*\((?:[^()]|\([^()]*\))*\)$/;function Q(t){let e=t.trim().replace(/^return\s+/,"").replace(/^await\s+/,"").replace(/;\s*$/,"").trim();return J.test(e)}function U(t){let e=[],i=0,s="";for(let r of t){if(r==="("||r==="["||r==="{"?i+=1:(r===")"||r==="]"||r==="}")&&(i=Math.max(0,i-1)),r===";"&&i===0){e.push(s),s="";continue}s+=r}return s.trim()&&e.push(s),e.map(r=>r.trim()).filter(r=>r.length>0)}var V=3;function Y(t){let e=new Map;return(i,s,r)=>{if(!i.isThinForwarder)return!1;let o=`${i.symbol}\0${s.symbol}`,a=e.get(o);if(a!==void 0)return a;let l=_(t,i,s,r,V,new Set);return e.set(o,l),l}}function _(t,e,i,s,r,o){if(r<=0||o.has(e.symbol)||(o.add(e.symbol),(S(t,e.file)??[]).filter(n=>n.line>=e.startLine&&n.line<=e.endLine&&n.calleeLeaf===i.leaf).length===0))return!1;let l=new Set(R(t,e.file).filter(n=>n.sourcePath&&(n.kind!=="namespace"||n.usedMembers.includes(i.leaf))).map(n=>n.sourcePath));if([...l].some(n=>p(n,i.file)))return!0;for(let n of s)if(!(n.symbol===e.symbol||n.symbol===i.symbol||!n.isThinForwarder)&&[...l].some(c=>p(c,n.file))&&_(t,n,i,s,r-1,o))return!0;return!1}function ee(t){return t.startsWith("<")&&t.endsWith(">")}function P(t){return[...t].sort()[0]}export{fe as a,F as b,$ as c};
|
|
2
|
-
//# sourceMappingURL=chunk-EDB7Y442.js.map
|
package/dist/chunk-EZ5WDZ2Q.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-UAHZ57BR.js";import{a as h,g as b}from"./chunk-NAH5EAZS.js";import{a as v}from"./chunk-BGBBVSH4.js";import{d as l,e as p,h as u}from"./chunk-HXXMPYEF.js";import{a as f,f as m,g}from"./chunk-T2FQ4GHD.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-EZ5WDZ2Q.js.map
|
package/dist/chunk-H2NMIZFD.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-UAHZ57BR.js";import{a as h}from"./chunk-ECVXWZ4Q.js";import{e as s,g as u}from"./chunk-HXXMPYEF.js";import{d}from"./chunk-T2FQ4GHD.js";import{x as c}from"./chunk-ISLWJ4PY.js";import{basename as p}from"path";function N(r,o){let t=h(r,o);if(!t)return[];let e=s(t.symbol),a=new f(r).definitionsForFile(t.relativePath).filter(n=>u(n.symbol)),l=a.filter(n=>n.parentTypeName===e||n.symbol.includes(e)),m=(l.length>0?l:L(p(t.relativePath))===e?a.filter(n=>n.symbol.includes("<invalid-global-code>")):[]).map(n=>({startLine:n.startLine,endLine:n.endLine,name:s(n.symbol)}));return c(t.relativePath)!=="clojure"?m:b(m,M(r,t))}function L(r){return r.replace(/\.[^.]+$/,"")}function M(r,o){let t=s(o.symbol);return t?(d(r,o.relativePath)?.clojureMembers??[]).filter(e=>e.ownerName===t).map(e=>({startLine:e.startLine,endLine:e.endLine,name:e.memberName})):[]}function b(r,o){let t=new Map;for(let e of[...r,...o])t.set(`${e.name}:${e.startLine}:${e.endLine}`,e);return[...t.values()].sort((e,i)=>e.startLine-i.startLine||e.endLine-i.endLine)}export{N as a};
|
|
2
|
-
//# sourceMappingURL=chunk-H2NMIZFD.js.map
|
package/dist/chunk-HXXMPYEF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as g,l as S,m as x}from"./chunk-T2FQ4GHD.js";import{A as m}from"./chunk-ISLWJ4PY.js";import{p as u,q as d}from"./chunk-WS3Z6W3M.js";var y={"/":"namespace","#":"type",".":"term","[":"type-param",":":"meta","!":"macro"};function a(e){if(e.startsWith("local "))return{kind:"local",id:e.slice(6),raw:e};let s=e.split(" ");if(s.length<4)return{scheme:s[0]??"",manager:s[1]??"",packageName:s[2]??"",version:"",descriptors:[],raw:e};let t=s[0],r=s[1],n=e.slice(t.length+1+r.length+1),i;if(n.startsWith("`")){let f=n.indexOf("`",1);f===-1?(i=n.slice(1),n=""):(i=n.slice(1,f),n=n.slice(f+2))}else{let f=n.indexOf(" ");f===-1?(i=n,n=""):(i=n.slice(0,f),n=n.slice(f+1))}let o,c=n.indexOf(" ");c===-1?(o=n,n=""):(o=n.slice(0,c),n=n.slice(c+1));let l=v(n);return{scheme:t,manager:r,packageName:i,version:o,descriptors:l,raw:e}}function M(e){let s=a(e);if("kind"in s)return null;for(let t=s.descriptors.length-2;t>=0;t--){let r=s.descriptors[t];if(r?.suffix==="type")return r.name}return null}function v(e){let s=[],t=0;for(;t<e.length;){if(e[t]==="["){let i=e.indexOf("]",t+1);if(i===-1){s.push({name:e.slice(t+1),suffix:"type-param"});break}s.push({name:e.slice(t+1,i),suffix:"type-param"}),t=i+1;continue}if(e[t]==="("&&(s.length===0||t===0||h(e[t-1]))){let i=e.indexOf(")",t+1);if(i!==-1&&e[i+1]!=="."){s.push({name:e.slice(t+1,i),suffix:"parameter"}),t=i+1;continue}}let r;if(e[t]==="`"){let i=e.indexOf("`",t+1);if(i===-1){r=e.slice(t+1),s.push({name:r,suffix:"term"});break}r=e.slice(t+1,i),t=i+1}else{let i=t;for(;t<e.length&&!h(e[t]);)t++;r=e.slice(i,t)}if(t>=e.length){r&&s.push({name:r,suffix:"term"});break}let n=e[t];if(n==="("){let i=e.indexOf(")",t+1);i!==-1&&e[i+1]==="."?(s.push({name:r,suffix:"method"}),t=i+2):i!==-1?(s.push({name:r,suffix:"method"}),t=i+1):(s.push({name:r,suffix:"term"}),t++)}else{let i=y[n];i&&s.push({name:r,suffix:i}),t+=1}}return s}function h(e){return e==="/"||e==="#"||e==="."||e==="("||e==="["||e===":"||e==="!"}function R(e){let s=a(e);if("kind"in s&&s.kind==="local")return`local:${s.id}`;let t=s;if(t.descriptors.length===0)return t.raw;let r=[];for(let n of t.descriptors){let i=k(n);i&&r.push(i)}return r.join(":")}function k(e){let s=e.suffix==="namespace"?F(e.name):e.name;return s?e.suffix==="method"?`${s}()`:s:""}function F(e){return e.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/,"").replace(/\.(py|pyi)$/,"").replace(/\.(rs)$/,"").replace(/\.(java|scala|kt|kts)$/,"").replace(/\.(rb)$/,"").replace(/\.(go)$/,"").replace(/\.(cs|vb)$/,"").replace(/\.(dart)$/,"").replace(/\.(php)$/,"").replace(/\.(c|cc|cpp|cxx|h|hpp)$/,"")}function $(e){let s=a(e);if("kind"in s&&s.kind==="local")return s.id;let t=s;return t.descriptors.length===0?"":t.descriptors[t.descriptors.length-1].name}function p(e){let s=a(e);if("kind"in s&&s.kind==="local")return null;let t=s;return t.descriptors[t.descriptors.length-1]?.suffix??null}function T(e){return e.endsWith("().")||p(e)==="method"}function j(e){let s=p(e);return s==="method"?!0:s!=="term"?!1:e.endsWith("().")||!e.startsWith("scip-typescript ")?!0:!/#[A-Za-z0-9_$]+\.$/.test(e)}function I(e){return p(e)==="namespace"}var D=/^rust-analyzer\b.*[\s/]impl#\[[^\]]+\]\[[^\]]+\]/;function L(e){return D.test(e)}var E=new Set(["test","tests","_tests"]);function O(e){let s=a(e);if("kind"in s)return!1;for(let t=0;t<s.descriptors.length-1;t+=1){let r=s.descriptors[t];if(r?.suffix==="namespace"&&r.name&&E.has(r.name))return!0}return!1}function P(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length!==n.length+1)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function _(e,s){let t=a(e),r=a(s);if("kind"in t||"kind"in r)return!1;let n=t.descriptors,i=r.descriptors;if(i.length<=n.length)return!1;for(let o=0;o<n.length;o++){let c=n[o],l=i[o];if(c.name!==l.name||c.suffix!==l.suffix)return!1}return!0}function z(e){return{forFile(s,t){return b(e,s,t)},forFiles(s,t){let r=new Map;for(let n of s)r.set(n,b(e,n,t));return r}}}function b(e,s,t){let r={file:s},n=t.facts||t.identifiers;if(t.text&&(r.text=u(e,s)),t.lines&&(r.lines=d(e,s)),t.ast&&(r.ast=m(e,s)),t.imports&&(r.imports=x(e,s)),t.reexports&&(r.reexports=S(e,s)),n){let i=g(e,s),o=i.facts;t.facts&&(r.facts=o),i.unavailable&&(r.sourceFactsUnavailable=i.unavailable),t.identifiers&&o&&(r.identifiers=o.fileIdentifiers,r.identifierLineMap=o.identifierLineMap)}return r}export{z as a,a as b,M as c,R as d,$ as e,p as f,T as g,j as h,I as i,L as j,O as k,P as l,_ as m};
|
|
2
|
-
//# sourceMappingURL=chunk-HXXMPYEF.js.map
|
package/dist/chunk-PXHPCWX5.js
DELETED
package/dist/chunk-T2FQ4GHD.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import{A as R,B as We,C as he,D as He,E as Je,c as je,d as De,e as _,f as Oe,g as Me,h as ve,i as B,j as $e,k as H,l as Ue,m as qe,n as Be,o as L,p as J,q as A,r as me,s as de,t as S,u as fe,v as ze,w as ge,x as Q,y as G,z as Ve}from"./chunk-ISLWJ4PY.js";import{b as W,i as Se,m as K,o as X,p as k}from"./chunk-WS3Z6W3M.js";import{b as ne}from"./chunk-GNG622H3.js";import{a as we,c as q,f as re}from"./chunk-7S5E7KWT.js";function O(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _t(e){return e.replace(/'''[\s\S]*?'''/g,w).replace(/"""[\s\S]*?"""/g,w).replace(/#.*$/gm,w).replace(/\/\/.*$/gm,w).replace(/\/\*[\s\S]*?\*\//g,w).replace(/`(?:\\[\s\S]|[^`])*`/g,w).replace(/'(?:\\.|[^'\\\r\n])*'/g,w).replace(/"(?:\\.|[^"\\\r\n])*"/g,w)}function w(e){return e.replace(/[^\r\n]/g," ")}var $n=re("stripped-lines",{clearGroups:["whole-project","source-file"]});we({name:"stripped-source-singleton",groups:["whole-project","source-file"],clearAll:()=>{se=null,Y=""},clearFile:()=>{se=null,Y=""}});var se=null,Y="";function Rt(e){return se===e||(se=e,Y=_t(e)),Y}function j(e,r,t){let n=Rt(e);return`${n.slice(0,r)}${" ".repeat(t-r)}${n.slice(t)}`}function x(e,r){return new RegExp(`\\b${O(r)}\\b`,"m").test(e)}function z(e,r){let t=new Set,n=new RegExp(`\\b${O(r)}\\s*\\.\\s*([A-Za-z_$][\\w$]*)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xe(e){let r=0;for(let t of e)t==="("&&(r+=1),t===")"&&(r-=1);return r}var Et=new Set(["identifier","type_identifier","field_identifier"]),Tt=new Set(["identifier"]),Ft=new Set(["identifier","property_identifier","type_identifier","shorthand_property_identifier","shorthand_property_identifier_pattern"]),Lt=new Set(["rust","python"]),At=/\{([^{}]*)\}/g,kt=/\b([A-Za-z_][\w]*)\b/g;function Ke(e,r){return wt(r).has(e.type)}function Xe(e,r){return Lt.has(r)&&e.type==="string_content"}function ye(e){let r=0;for(let n of e.values()){let s=n[n.length-1];s!==void 0&&s>r&&(r=s)}let t=new Array(r+1);for(let n=0;n<=r;n+=1)t[n]=new Set;for(let[n,s]of e)for(let o of s)t[o].add(n);return t}function wt(e){return e==="rust"?Et:e==="python"?Tt:Ft}function Qe(e,r){let t=e.startPosition.row;for(let n of e.text.matchAll(At)){let s=n[1]??"";for(let o of s.matchAll(kt))o[1]&&r(o[1],t)}}var jt=[/\bdefault\s*=\s*"([^"]+)"/g,/\bwith\s*=\s*"([^"]+)"/g,/\bserialize_with\s*=\s*"([^"]+)"/g,/\bdeserialize_with\s*=\s*"([^"]+)"/g,/\bskip_serializing_if\s*=\s*"([^"]+)"/g,/\bgetter\s*=\s*"([^"]+)"/g,/\brename_all_with\s*=\s*"([^"]+)"/g,/\bschema_with\s*=\s*"([^"]+)"/g],Dt=/^#!?\[\s*serde\s*\(/,Ot=/^#!?\[\s*schemars\s*\(/,Mt=/^#!?\[\s*validate\s*\(/,vt=new Set(["invoke","invokeTauriCommand","listen","once","emit","subscribe","dispatch","sendCommand","callRust"]);function Ge(e,r,t){if(r!=="typescript"&&r!=="tsx"&&r!=="javascript"||e.type!=="call_expression")return;let n=e.childForFieldName("function")??e.namedChild(0);if(!n)return;let s=he(n);if(!s||!vt.has(s))return;let o=e.namedChildren.find(c=>c.type==="arguments");if(!o)return;let i=o.namedChild(0);if(!i||i.type!=="string")return;let a=i.namedChildren.find(c=>c.type==="string_fragment");a&&t.add(a.text)}function Ye(e,r){let t=Dt.test(e),n=Ot.test(e),s=Mt.test(e);if(!(!t&&!n&&!s))for(let o of jt){o.lastIndex=0;let i;for(;(i=o.exec(e))!==null;){let a=i[1],c=a.split("::").pop()??a;c==="is_none"&&/\bOption\b/.test(a)||c==="is_empty"&&/\b(String|Vec|HashMap|BTreeMap|HashSet|BTreeSet)\b/.test(a)||c&&r.add(c)}}}function Ze(e,r){let t=new Map,n=(i,a)=>{if(i===a)return;let c=t.get(i);c||(c=new Set,t.set(i,c)),c.add(a)},s=r==="python"?new Set(["identifier"]):new Set(["type_identifier"]),o=(i,a)=>{let c=l=>{s.has(l.type)&&l.text!==a&&n(l.text,a);for(let p of l.children)c(p)};for(let l of i.children)c(l)};if(r==="rust")for(let i of e.rootNode.descendantsOfType(["struct_item","enum_item","union_item","type_item"])){let a=i.namedChildren.find(l=>l.type==="type_identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="field_declaration_list"||l.type==="enum_variant_list"||l.type==="ordered_field_declaration_list");c&&o(c,a),i.type==="type_item"&&o(i,a)}else if(r==="python")for(let i of e.rootNode.descendantsOfType("class_definition")){let a=i.namedChildren.find(l=>l.type==="identifier")?.text;if(!a)continue;let c=i.namedChildren.find(l=>l.type==="block");if(c)for(let l of c.descendantsOfType("type"))for(let p of l.descendantsOfType("identifier"))p.text!==a&&n(p.text,a)}else for(let i of e.rootNode.descendantsOfType(["interface_declaration","type_alias_declaration","class_declaration"])){let a=i.namedChildren.find(c=>c.type==="type_identifier")?.text;a&&o(i,a)}return t}var $t=new Map([["defn","function"],["defn-","function"],["defmacro","macro"],["defmacro-","macro"],["defmethod","method"]]),be=new Set(["catch","comment","def","defprotocol","defrecord","deftype","defmethod","defmacro","defmacro-","defn","defn-","do","doseq","dotimes","fn","for","if","let","loop","ns","quote","recur","throw","try","extend-protocol","extend-type","when","when-let","when-not"]);function et(e){let r=[],t=[],n=[],s=new Map,o=[],i=0,a=0,c=(l,p)=>{let u=s.get(l);if(!u){s.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)};for(;a<e.length;){let l=e[a];if(l===`
|
|
2
|
-
`){i+=1,a+=1;continue}if(/\s|,/.test(l)){a+=1;continue}if(l===";"){a=ie(e,a);continue}if(l==='"'){let h=ee(e,a,i);i=h.line,a=h.index;continue}if(l==="("||l==="["||l==="{"){o.push({kind:l,startLine:i,endLine:i,headTokens:[],tokens:[],children:[]}),a+=1;continue}if(l===")"||l==="]"||l==="}"){let h=o.pop();h&&(h.endLine=i,Ut(h,{callables:r,callSites:t,clojureMembers:n,recordIdentifier:c}),o[o.length-1]?.children.push(h)),a+=1;continue}if(Ne(l)){a+=1;continue}let p=i,u=a;for(;a<e.length&&!Ie(e[a]);)a+=1;let m=e.slice(u,a);if(!m)continue;let d={text:m,line:p};qt(o[o.length-1],d),c(N(m),p)}return{language:"clojure",callables:r,callSites:t,clojureMembers:n,typeContainerMap:new Map,identifierLineMap:s,identifiersByLine:Ht(s),fileIdentifiers:new Set(s.keys()),rustAttrReferencedNames:new Set,crossLanguageDispatchNames:new Set}}function Ut(e,r){if(e.kind!=="("||e.headTokens.length===0)return;let t=e.headTokens[0],n=N(t.text),s=$t.get(t.text);if(s){let i=e.headTokens[1];if(i){let a=N(i.text);r.recordIdentifier(a,i.line),r.callables.push({name:a,startLine:e.startLine,endLine:e.endLine,paramCount:0,params:[],paramsEndLine:i.line,isLiteralPassthrough:!1,clojureKind:s})}}if(Bt(e,r),!n||be.has(t.text)||be.has(n)||n.startsWith(":"))return;let o=Wt(t.text);r.callSites.push({calleeLeaf:o.leaf,calleeQualifier:o.qualifier,calleeText:o.text,memberAccess:!1,line:t.line})}function qt(e,r){e&&(e.headTokens.length<2&&e.headTokens.push(r),e.tokens.length<200&&e.tokens.push(r))}function Bt(e,r){let t=N(e.tokens[0]?.text??"");if(t==="defprotocol"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"protocol",s,"protocol-method");return}if(t==="defrecord"||t==="deftype"){let n=N(e.tokens[1]?.text??"");if(!n)return;let s=t==="defrecord"?"record":"type",o=t==="defrecord"?"record-method":"type-method";for(let i of oe(e))Z(r,n,s,i,o);return}if(t==="extend-type"){let n=N(e.tokens[1]?.text??"");if(!n)return;for(let s of oe(e))Z(r,n,"extension",s,"extension-method");return}if(t==="extend-protocol"){let n=N(e.tokens[1]?.text??"");for(let s of oe(e)){n&&Z(r,n,"extension",s,"extension-method");let o=Vt(e,s.startLine);o&&o!==n&&Z(r,o,"extension",s,"extension-method")}}}function oe(e){return e.children.filter(zt)}function zt(e){if(e.kind!=="(")return!1;let r=N(e.tokens[0]?.text??"");return!!(r&&!be.has(r)&&!r.startsWith(":"))}function Z(e,r,t,n,s){let o=n.tokens[0],i=N(o?.text??"");!o||!i||(e.recordIdentifier(i,o.line),e.clojureMembers.push({ownerName:r,ownerKind:t,memberName:i,memberKind:s,startLine:n.startLine,endLine:n.endLine}))}function Vt(e,r){let t=null;for(let n=2;n<e.tokens.length;n+=1){let s=e.tokens[n];if(s.line>r)break;let o=N(s.text);o&&!o.startsWith(":")&&(t=o)}return t}function N(e){return e.replace(/^#?['`~@]+/,"").split("/").pop()?.replace(/^\./,"")??""}function Wt(e){let r=e.replace(/^#?['`~@]+/,""),t=r.lastIndexOf("/"),n=N(r);if(t<=0)return{leaf:n,text:r};let s=r.slice(0,t);return{leaf:n,qualifier:s,text:r}}function ie(e,r){let t=r;for(;t<e.length&&e[t]!==`
|
|
3
|
-
`;)t+=1;return t}function ee(e,r,t){let n=r+1,s=t;for(;n<e.length;){let o=e[n];if(o==="\\"){n+=2;continue}if(o===`
|
|
4
|
-
`&&(s+=1),n+=1,o==='"')break}return{index:n,line:s}}function Ne(e){return e==="'"||e==="`"||e==="~"||e==="@"||e==="^"||e==="#"}function Ie(e){return/\s|,/.test(e)||e==="("||e===")"||e==="["||e==="]"||e==="{"||e==="}"||e==='"'||e===";"}function Ht(e){let r=[];for(let[t,n]of e)for(let s of n)r[s]??=new Set,r[s].add(t);return r}var Jt=re("source-facts",{clearGroups:["whole-project","source-file"]}),Ce=K({kind:"source-facts",invalidation:X("source-facts"),serialize:Gt,deserialize:Yt});function T(e,r){return Kt(e,r).facts}function Kt(e,r){let t=k(e,r);if(!t)return{facts:null};let n=Xt(e,r,t);return n?Jt.get(e,r,t,()=>Qt(e,r,n,t)):{facts:null}}function Xt(e,r,t){return G(r)?Ve(e,r,t)?.language??null:Q(r)}function Qt(e,r,t,n){let s=W(e,r,n),o=Ce.read(e,r,s);if(o&&o.language===t)return{facts:o};if(t==="clojure"){let c=et(n);return Ce.write(e,r,s,c),{facts:c}}let i=R(e,r);if(!i)return{facts:null,unavailable:{language:t,reason:"parser-unavailable"}};let a=rr(i,t);return Ce.write(e,r,s,a),{facts:a}}function Gt(e){let r={language:e.language,callables:e.callables,callSites:e.callSites,clojureMembers:e.clojureMembers,typeContainerMap:[...e.typeContainerMap.entries()].map(([t,n])=>[t,[...n]]),identifierLineMap:[...e.identifierLineMap.entries()],rustAttrReferencedNames:[...e.rustAttrReferencedNames],crossLanguageDispatchNames:[...e.crossLanguageDispatchNames]};return JSON.stringify(r)}function Yt(e){try{let r=JSON.parse(e);if(r.language==="clojure"&&(r.clojureMembers===void 0||r.callSites.some(n=>n.calleeText===void 0)))return null;let t=new Map(r.identifierLineMap);return{language:r.language,callables:r.callables,callSites:r.callSites,clojureMembers:r.clojureMembers??[],typeContainerMap:new Map(r.typeContainerMap.map(([n,s])=>[n,new Set(s)])),identifierLineMap:t,identifiersByLine:ye(t),fileIdentifiers:new Set(t.keys()),rustAttrReferencedNames:new Set(r.rustAttrReferencedNames),crossLanguageDispatchNames:new Set(r.crossLanguageDispatchNames)}}catch{return null}}function Zt(e,r,t,n){let s=T(e,r);return s?tr(s,t,n)?.isLiteralPassthrough??!0:!0}function er(e,r){return r.relativePath.includes(".clj-kondo/hooks/")?!0:T(e,r.relativePath)?.callables.find(n=>n.startLine===r.startLine&&n.endLine===r.endLine)?.clojureKind==="macro"}function tr(e,r,t){return e.callables.find(n=>n.startLine===r&&n.endLine===t)??null}function rr(e,r){let t=[],n=[],s=new Set,o=new Set,i=new Map,a=(l,p)=>{let u=i.get(l);if(!u){i.set(l,[p]);return}u[u.length-1]!==p&&u.push(p)},c=l=>{let p=He(l,r);p&&t.push(p);let u=We(l,r);u&&n.push(u),Ge(l,r,o),r==="rust"&&(l.type==="attribute_item"||l.type==="inner_attribute_item")&&Ye(l.text,s),Ke(l,r)&&a(l.text,l.startPosition.row),Xe(l,r)&&Qe(l,a);for(let m of l.children)c(m)};return c(e.rootNode),{language:r,callables:t,callSites:n,clojureMembers:[],typeContainerMap:Ze(e,r),identifierLineMap:i,identifiersByLine:ye(i),fileIdentifiers:new Set(i.keys()),rustAttrReferencedNames:s,crossLanguageDispatchNames:o}}var tt=new Set(["rust","typescript","tsx","javascript","python","clojure"]);function nr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callables.map(n=>({name:n.name,startLine:n.startLine,endLine:n.endLine}))}function sr(e,r){let t=T(e,r);return!t||!tt.has(t.language)?null:t.callSites}function or(e,r){return T(e,r)?.typeContainerMap??new Map}function ir(e,r,t={}){let n=T(e,r);if(!n)return[];let s=[];if(t.includeCrossLanguageDispatchNames)for(let o of n.crossLanguageDispatchNames)s.push({name:o,kind:"cross-language-dispatch",occurrences:1});if(t.includeRustAttributeNames&&n.language==="rust")for(let o of n.rustAttrReferencedNames)s.push({name:o,kind:"rust-attribute",occurrences:1});return s}import{basename as rt}from"path";var ar=new Set(["identifier","type_identifier","property_identifier","shorthand_property_identifier","field_identifier"]);function y(e){let r=[],t=0,n=0;for(let s=0;s<e.length;s++){let o=e[s];(o==="{"||o==="["||o==="(")&&t++,(o==="}"||o==="]"||o===")")&&t--,o===","&&t===0&&(r.push(e.slice(n,s)),n=s+1)}return r.push(e.slice(n)),r}function b(e,r){for(let t of e.namedChildren)if(t.type===r)return t;return null}function g(e,r){let t=new Set,n=(s,o)=>{let i=o||r.has(s.type);!i&&ar.has(s.type)&&t.add(s.text);for(let a of s.children)n(a,i)};return n(e.rootNode,!1),t}function E(e,r,t,n,s,o,i){return{importedName:s,localName:o,sourcePath:i??S(e,n,Be(r)),kind:"named",used:x(t,o),usedMembers:[]}}function f(e,r,t,n,s="named",o={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n.has(r),usedMembers:[],isTypeOnly:o.isTypeOnly}}function F(e,r,t,n,s="named",o=[],i={}){return{importedName:e,localName:r,sourcePath:t,kind:s,used:n,usedMembers:o,isTypeOnly:i.isTypeOnly}}function M(e,r){return{importedName:e,localName:null,sourcePath:r,kind:"side-effect",used:!0,usedMembers:[]}}function v(e,r,t={}){return{importedName:e,localName:t.localName??null,sourcePath:r,kind:"namespace",used:t.used??!0,usedMembers:t.usedMembers??[],isTypeOnly:t.isTypeOnly}}function I(e,r,t){let n=[];for(let s of e.matchAll(r)){let o=s[0];if(!o||typeof s.index!="number")continue;let i=j(e,s.index,s.index+o.length);for(let a of t(s,i))n.push(a)}return n}function C(e,r,t,n){let s=R(e,r);if(s){let o=t(s);if(o)return o}return n()}function ae(e,r,t,n){let s=R(e,r),o=Q(r),i=o?t[o]:void 0;return s&&i?i(s):n()}function nt(e,r,t){return C(e,r,n=>lr(e,r,n),()=>cr(e,r,t))}function cr(e,r,t){return I(t,/^[ \t]*#include\s+[<"]([^">]+)[">]\s*$/gm,(n,s)=>{let o=n[1]?.trim();if(!o)return[];let i=rt(o).replace(/\.[^.]+$/,"");return[F(o,i,de(e,r,o),x(s,i))]})}function lr(e,r,t){let n=g(t,new Set(["preproc_include"])),s=[];for(let o of t.rootNode.descendantsOfType("preproc_include")){let i=null;for(let c of o.namedChildren){if(c.type==="system_lib_string"){i=c.text.replace(/^<|>$/g,"");break}if(c.type==="string_literal"){i=c.namedChildren.find(p=>p.type==="string_content")?.text??c.text.replace(/^"|"$/g,"");break}}if(!i)continue;let a=rt(i).replace(/\.[^.]+$/,"");s.push(f(i,a,de(e,r,i),n))}return s}var pr=new Set([":require",":require-macros",":use"]),Re=String.raw`A-Za-z0-9_$*+!?.<>=-`;function ot(e,r,t){let n=Nr(t);if(!n)return[];let s=br(t,n.start,n.end),o=[];for(let i of n.children.slice(2)){if(i.type!=="list"||i.children.length===0)continue;let a=P(i.children[0]);if(a){if(pr.has(a)){for(let c of dr(i.children.slice(1)))o.push(...mr(e,c,s));continue}if(a===":import")for(let c of gr(i.children.slice(1)))o.push(c)}}return o}function ur(e){return e.type==="list"&&P(e.children[0])==="ns"}function mr(e,r,t){let n=ze(e,r.namespace),s=r.alias??r.namespace,o=hr(t,s),i=[{importedName:r.namespace,localName:s,sourcePath:n,kind:"namespace",used:r.refers.length>0||r.referAll||o.length>0||xr(t,r.namespace),usedMembers:o}];r.referAll&&i.push({importedName:"*",localName:null,sourcePath:n,kind:"side-effect",used:!0,usedMembers:[]});for(let a of r.refers)i.push({importedName:a,localName:a,sourcePath:n,kind:"named",used:yr(t,a),usedMembers:[]});return i}function dr(e){return e.flatMap(r=>ce(r,null))}function ce(e,r){if(e.type==="atom")return e.text.startsWith(":")?[]:[{namespace:_e(r,e.text),alias:null,refers:[],referAll:!1}];if(e.type==="vector")return e.children.length>0&&P(e.children[0])===null?e.children.flatMap(t=>ce(t,r)):fr(e,r);if(e.type==="list"&&e.children.length>0){let t=P(e.children[0]);return t?!t||t.startsWith(":")?[]:e.children.slice(1).flatMap(n=>ce(n,_e(r,t))):e.children.flatMap(n=>ce(n,r))}return[]}function fr(e,r){let t=P(e.children[0]);if(!t||t.startsWith(":"))return[];let n={namespace:_e(r,t),alias:null,refers:[],referAll:!1};for(let s=1;s<e.children.length;s+=1){let o=P(e.children[s]);if(!o?.startsWith(":"))continue;let i=e.children[s+1];if((o===":as"||o===":as-alias")&&i){n.alias=P(i),s+=1;continue}o===":refer"&&i&&(P(i)===":all"?n.referAll=!0:(i.type==="vector"||i.type==="list")&&n.refers.push(...i.children.map(P).filter(Sr)),s+=1)}return[n]}function gr(e){let r=[];for(let t of e){if(t.type==="atom"){let s=t.text.split(".").pop()??t.text;r.push(F(s,s,null,!0));continue}if(t.type!=="vector")continue;let n=P(t.children[0]);if(n)for(let s of t.children.slice(1)){let o=P(s);o&&r.push(F(`${n}.${o}`,o,null,!0))}}return r}function _e(e,r){return e?`${e}.${r}`:r}function P(e){return e?.type==="atom"?e.text:null}function Sr(e){return!!(e&&!e.startsWith(":"))}function hr(e,r){let t=new Set,n=new RegExp(`${Ee()}${O(r)}\\s*/\\s*([${Re}]+)`,"g");for(let s of e.matchAll(n)){let o=s[1];o&&t.add(o)}return[...t]}function xr(e,r){return new RegExp(`${Ee()}${O(r)}\\s*/`,"m").test(e)}function yr(e,r){return new RegExp(`${Ee()}${O(r)}(?![${Re}])`,"m").test(e)}function Ee(){return`(?<![${Re}])`}function br(e,r,t){let n="",s=0;for(;s<e.length;){if(s>=r&&s<t){n+=e[s]===`
|
|
5
|
-
`?`
|
|
6
|
-
`:" ",s+=1;continue}let o=e[s];if(o===";"){let i=ie(e,s);n+=st(e.slice(s,i)),s=i;continue}if(o==='"'){let i=ee(e,s,0).index;n+=st(e.slice(s,i)),s=i;continue}n+=o,s+=1}return n}function Nr(e){let r=0;for(;r<e.length&&(r=Te(e,r),!(r>=e.length));){let t=le(e,r);if(!t){r+=1;continue}if(ur(t.form))return t.form;r=t.index}return null}function le(e,r){let t=Te(e,r);if(e.startsWith("#?@",t)||e.startsWith("#?",t))return Ir(e,t);if(e.startsWith("#_",t)){let s=le(e,t+2);return s?{form:{type:"atom",text:"",start:t,end:s.index},index:s.index}:null}for(;Ne(e[t]);)t+=1;let n=e[t];return n?n==="("?Pe(e,t,"list",")"):n==="["?Pe(e,t,"vector","]"):n==="{"?Pe(e,t,"map","}"):n==='"'?{form:{type:"atom",text:"",start:t,end:ee(e,t,0).index},index:ee(e,t,0).index}:Pr(e,t):null}function Ir(e,r){let t=e.startsWith("#?@",r)?3:2,n=le(e,r+t);return n?{form:{type:"list",children:n.form.type==="list"||n.form.type==="vector"||n.form.type==="map"?Cr(n.form.children):[],start:r,end:n.index},index:n.index}:null}function Cr(e){let r=[];for(let t=0;t<e.length;t+=2){let n=P(e[t]),s=e[t+1];n?.startsWith(":")&&s&&r.push(s)}return r}function Pe(e,r,t,n){let s=[],o=r+1;for(;o<e.length;){if(o=Te(e,o),e[o]===n)return{form:{type:t,children:s,start:r,end:o+1},index:o+1};let i=le(e,o);if(!i){o+=1;continue}i.form.type==="atom"&&i.form.text===""||s.push(i.form),o=i.index}return{form:{type:t,children:s,start:r,end:e.length},index:e.length}}function Pr(e,r){let t=r;for(;t<e.length&&!Ie(e[t]);)t+=1;return{form:{type:"atom",text:e.slice(r,t),start:r,end:t},index:t}}function Te(e,r){let t=r;for(;t<e.length;){let n=e[t];if(/\s|,/.test(n)){t+=1;continue}if(n===";"){t=ie(e,t);continue}break}return t}function st(e){return e.replace(/[^\r\n]/g," ")}function it(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*import\s+['"]([^'"]+)['"](?:\s+as\s+([A-Za-z_]\w*))?[\s\S]*?;$/gm)){let o=s[1]?.trim(),i=s[2]?.trim()??null,a=s[0];if(!o||!a||typeof s.index!="number")continue;let c=j(t,s.index,s.index+a.length);n.push({importedName:o,localName:i,sourcePath:fe(e,r,o),kind:i?"namespace":"side-effect",used:i?x(c,i):!0,usedMembers:i?z(c,i):[]})}return n}function at(e,r,t){let n=[];for(let s of t.matchAll(/^[ \t]*export\s+['"]([^'"]+)['"][\s\S]*?;$/gm)){let o=s[1]?.trim();o&&n.push({specifier:o,sourcePath:fe(e,r,o)})}return n}function ct(e,r,t){return ae(e,r,{csharp:n=>Rr(e,r,n),vb:n=>_r(e,r,n)},()=>{let n=qe(r)?/^[ \t]*Imports\s+(.+?)\s*$/gm:/^[ \t]*using\s+(.+?)\s*;$/gm;return I(t,n,(s,o)=>{let i=s[1]?.trim();if(!i)return[];let[a,c]=i.split(/\s*=\s*/),l=!!c,p=(l?c:a)?.trim()??i,u=p.split(".").pop()??p,m=l?a?.trim()??u:u;return[E(e,r,o,p,u,m,S(e,p,B))]})})}function _r(e,r,t){let n=g(t,new Set(["imports_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("imports_statement")){let i=o.namedChildren.filter(m=>m.type==="namespace_name");if(i.length===0)continue;let a=i[i.length-1],c=i.length>1?i[0]:null,l=a.text,p=l.split(".").pop()??l,u=c?.text??p;s.push(f(p,u,S(e,l,B),n,c?"namespace":"named"))}return s}function Rr(e,r,t){let n=g(t,new Set(["using_directive"])),s=[];for(let o of t.rootNode.descendantsOfType("using_directive")){let i=o.namedChildren;if(i.length===0)continue;let a=null,c;i.length>=2&&i[0].type==="identifier"&&(i[1].type==="qualified_name"||i[1].type==="identifier")?(a=i[0],c=i[1]):c=i[i.length-1];let l=c.text,p=l.split(".").pop()??l,u=a?.text??p;s.push(f(p,u,S(e,l,B),n,a?"namespace":"named"))}return s}var Er=q("vue-non-script-identifiers",{clearGroups:["whole-project","source-file"]});function lt(e,r){return Er.get(e,r,()=>{let t=new Set,n=k(e,r);if(!n)return t;let o=n.replace(/<script\b[^>]*>[\s\S]*?<\/script>/g,i=>i.replace(/[^\r\n]/g," ")).replace(/<!--[\s\S]*?-->/g,i=>i.replace(/[^\r\n]/g," ")).replace(/\/\*[\s\S]*?\*\//g,i=>i.replace(/[^\r\n]/g," "));for(let i of o.matchAll(/[A-Za-z_$][\w$]*/g))t.add(i[0]);return t})}function Fe(e,r,t){return C(e,r,n=>Fr(e,r,n),()=>Tr(e,r,t))}function Tr(e,r,t){return Ur(t).flatMap(n=>qr(e,r,n.clause,n.specifier,n.start,n.end,t))}function Fr(e,r,t){let n=Lr(e,r,t),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))s.push(...Ar(e,r,t,o,n));return s}function Lr(e,r,t){let n=g(t,new Set(["import_statement"]));if(G(r))for(let s of lt(e,r))n.add(s);return n}function Ar(e,r,t,n,s){let o=Or(n);if(!o)return[];let i=L(e,r,o),a=b(n,"import_clause");return a?kr(t,a,i,s,Mr(n.text)):[M("*",i)]}function kr(e,r,t,n,s){let o=[];for(let i of r.namedChildren)if(i.type==="identifier")o.push(wr(i.text,t,n,s));else if(i.type==="namespace_import"){let a=jr(e,i,t,n,s);a&&o.push(a)}else i.type==="named_imports"&&o.push(...Dr(i,t,n,s));return o}function wr(e,r,t,n){return f("default",e,r,t,"default",{isTypeOnly:n})}function jr(e,r,t,n,s){let i=b(r,"identifier")?.text??"";if(!i)return null;let a=$r(e,i);return v("*",t,{localName:i,usedMembers:a,isTypeOnly:s,used:a.length>0||n.has(i)})}function Dr(e,r,t,n){let s=[];for(let o of e.namedChildren){if(o.type!=="import_specifier")continue;let i=o.namedChild(0),a=o.namedChild(1);if(!i)continue;let c=i.text,l=a?.text??c;s.push(f(c,l,r,t,"named",{isTypeOnly:n||vr(o.text)}))}return s}function Or(e){let r=b(e,"string");if(!r)return null;let t=b(r,"string_fragment");return t?t.text:null}function Mr(e){return/^\s*import\s+type\b/.test(e)}function vr(e){return/^\s*type\b/.test(e.trim())}function $r(e,r){let t=new Set;for(let n of e.rootNode.descendantsOfType("member_expression")){let s=n.namedChild(0),o=n.namedChild(1);!s||!o||s.type!=="identifier"||s.text!==r||(o.type==="property_identifier"||o.type==="identifier")&&t.add(o.text)}return[...t]}function Ur(e){let r=[],t=/^[ \t]*import\s+([\s\S]*?)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(t)){let o=s[0],i=s[1],a=s[2];!o||!a||typeof s.index!="number"||r.push({clause:i,specifier:a,start:s.index,end:s.index+o.length})}let n=/^[ \t]*import\s+['"]([^'"]+)['"]\s*;?/gm;for(let s of e.matchAll(n)){let o=s[0],i=s[1];!o||!i||typeof s.index!="number"||r.push({clause:null,specifier:i,start:s.index,end:s.index+o.length})}return r.sort((s,o)=>s.start-o.start)}function qr(e,r,t,n,s,o,i){let a=L(e,r,n),c=j(i,s,o);return t?Br(t).map(p=>({...p,sourcePath:a})).map(p=>{if(p.kind==="namespace"){let u=z(c,p.localName);return v(p.importedName,p.sourcePath,{localName:p.localName,usedMembers:u,used:u.length>0||x(c,p.localName),isTypeOnly:p.isTypeOnly})}return p.kind==="side-effect"?M(p.importedName,p.sourcePath):F(p.importedName,p.localName??"",p.sourcePath,p.localName?x(c,p.localName):!1,p.kind,[],{isTypeOnly:p.isTypeOnly})}):[M("*",a)]}function Br(e){let r=e.trim(),t=/^type\b/.test(r),n=r.replace(/^type\s+/,""),[s,o]=zr(n),i=[];return s&&i.push(...pt(s,t)),o&&i.push(...pt(o,t)),i}function pt(e,r){let t=e.trim();if(!t)return[];if(t.startsWith("{")){let n=t.slice(1,-1).trim();return n?y(n).map(s=>{let o=s.trim(),i=r||/^type\b/.test(o),a=o.replace(/^type\s+/,""),[c,l]=a.split(/\s+as\s+/);return{importedName:c.trim(),localName:(l??c).trim(),kind:"named",isTypeOnly:i}}):[]}return t.startsWith("* as ")?[{importedName:"*",localName:t.slice(5).trim(),kind:"namespace",isTypeOnly:r}]:[{importedName:"default",localName:t,kind:"default",isTypeOnly:r}]}function zr(e){let r=0;for(let t=0;t<e.length;t++){let n=e[t];if(n==="{"&&r++,n==="}"&&r--,n===","&&r===0)return[e.slice(0,t).trim(),e.slice(t+1).trim()]}return[e.trim(),null]}function Le(e,r,t){let n=R(e,r);return n?Xr(e,r,n):Vr(e,r,t)}function Vr(e,r,t){return[...Wr(e,r,t),...Hr(e,r,t),...Jr(e,r,t)]}function Wr(e,r,t){let n=[],s=/^[ \t]*export\s+(?:type\s+)?\{([\s\S]*?)\}\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=o[2]??"",c=y(i).map(u=>Kr(u.trim())).filter(u=>!!u),l=V(t,o.index),p=V(t,o.index+o[0].length-1);n.push({kind:"named",sourcePath:L(e,r,a),names:c,startLine:l,endLine:p})}return n}function Hr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+as\s+(\w+)\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[2]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star-as",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Jr(e,r,t){let n=[],s=/^[ \t]*export\s+\*\s+from\s+['"]([^'"]+)['"]\s*;?/gm;for(let o of t.matchAll(s)){if(typeof o.index!="number")continue;let i=o[1]??"",a=V(t,o.index),c=V(t,o.index+o[0].length-1);n.push({kind:"star",sourcePath:L(e,r,i),names:[],startLine:a,endLine:c})}return n}function Kr(e){if(!e)return null;let r=e.replace(/^type\s+/,"").trim();if(!r)return null;let t=r.match(/^(\w+)\s+as\s+(\w+)$/);if(t)return t[2]??null;let n=r.match(/^(\w+)$/);return n?n[1]??null:null}function V(e,r){let t=0;for(let n=0;n<r&&n<e.length;n++)e.charCodeAt(n)===10&&t++;return t}function Xr(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("export_statement")){let o=Qr(e,r,s);if(o===void 0)continue;let i=s.startPosition.row,a=s.endPosition.row,c=Gr(s,o,i,a);n.push(c)}return n}function Qr(e,r,t){let n=b(t,"string");if(!n)return;let s=b(n,"string_fragment");if(s)return L(e,r,s.text)}function Gr(e,r,t,n){let s=b(e,"export_clause");if(s){let i=[];for(let a of s.namedChildren){if(a.type!=="export_specifier")continue;let c=a.namedChild(0),l=a.namedChild(1);c&&i.push((l??c).text)}return{kind:"named",sourcePath:r,names:i,startLine:t,endLine:n}}return b(e,"namespace_export")?{kind:"star-as",sourcePath:r,names:[],startLine:t,endLine:n}:{kind:"star",sourcePath:r,names:[],startLine:t,endLine:n}}function ut(e,r,t){return ae(e,r,{java:n=>Yr(e,r,n),kotlin:n=>Zr(e,r,n),scala:n=>en(e,r,n)},()=>I(t,/^[ \t]*import\s+(?:static\s+)?(.+?)\s*;?$/gm,(n,s)=>{let o=n[1]?.trim();return o?tn(e,r,o,s):[]}))}function Yr(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.children.some(u=>u.type==="asterisk"),c=o.namedChildren.find(u=>u.type==="scoped_identifier")??o.namedChildren.find(u=>u.type==="identifier");if(!c)continue;let l=c.text;if(i){s.push(v("*",S(e,l,_)));continue}let p=l.split(".").pop()??l;s.push(f(p,p,S(e,l,_),n))}return s}function Zr(e,r,t){let n=g(t,new Set(["import_header","import_list"])),s=[];for(let o of t.rootNode.descendantsOfType("import_header")){let i=o.namedChildren.find(d=>d.type==="identifier");if(!i)continue;let a=o.namedChildren.some(d=>d.type==="wildcard_import"),c=o.namedChildren.find(d=>d.type==="import_alias");if(a){s.push(v("*",S(e,i.text,_)));continue}let l=i.text,p=l.split(".").pop()??l,m=c?.namedChild(0)?.text??p;s.push(f(p,m,S(e,l,_),n))}return s}function en(e,r,t){let n=g(t,new Set(["import_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("import_declaration")){let i=o.namedChildren.find(u=>u.type==="namespace_selectors"||u.type==="namespace_wildcard"),a=o.namedChildren.filter(u=>u!==i&&(u.type==="identifier"||u.type==="stable_identifier")),c=a.map(u=>u.text).join(".");if(!c)continue;if(i?.type==="namespace_wildcard"){s.push(v("*",S(e,c,_)));continue}if(i?.type==="namespace_selectors"){for(let u of i.namedChildren)if(u.type==="arrow_renamed_identifier"){let[m,d]=u.namedChildren;if(!m)continue;let h=m.text,$=d?.text??h;if(h==="_")continue;s.push(f(h,$,S(e,`${c}.${h}`,_),n))}else if(u.type==="identifier"){let m=u.text;s.push(f(m,m,S(e,`${c}.${m}`,_),n))}continue}let l=a[a.length-1]?.text??c,p=a.slice(0,-1).map(u=>u.text).join(".")||c;s.push(f(l,l,S(e,p&&a.length>1?`${p}.${l}`:c,_),n))}return s}function tn(e,r,t,n){if(t.includes("{")&&t.includes("}")){let s=t.slice(0,t.indexOf("{")).replace(/\.$/,"").trim(),o=t.slice(t.indexOf("{")+1,t.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.includes("=>")?a.split(/\s*=>\s*/):a.split(/\s+as\s+/),p=c?.trim();if(!p||p==="_")return[];let u=(l??p.split(".").pop()??p).trim(),m=p==="_"?s:`${s}.${p}`.replace(/\.\./g,".");return[E(e,r,n,m,p,u)]})}return[E(e,r,n,t,t.split(".").pop()??t,t.split(".").pop()??t)]}function dt(e,r,t){return C(e,r,n=>rn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?y(o).flatMap(i=>{let a=i.trim();if(!a)return[];let[c,l]=a.split(/\s+as\s+/i),p=c?.trim()??a,u=p.split("\\").pop()??p,m=(l??u).trim();return[E(e,r,s,p,u,m,S(e,p.replace(/\\/g,"."),H))]}):[]}))}function rn(e,r,t){let n=g(t,new Set(["namespace_use_declaration"])),s=[],o=(i,a,c)=>{s.push(f(a,c,S(e,i.replace(/\\/g,"."),H),n))};for(let i of t.rootNode.descendantsOfType("namespace_use_declaration")){let a=i.namedChildren.find(c=>c.type==="namespace_use_group");if(a){let c=i.namedChildren.find(l=>l.type==="namespace_name")?.text??"";for(let l of a.namedChildren){if(l.type!=="namespace_use_clause")continue;let{importedName:p,localName:u,qualified:m}=mt(l,c);p&&o(m,p,u)}continue}for(let c of i.namedChildren){if(c.type!=="namespace_use_clause")continue;let{importedName:l,localName:p,qualified:u}=mt(c,"");l&&o(u,l,p)}}return s}function mt(e,r){let t=e.namedChildren.find(l=>l.type==="qualified_name"),n=e.namedChildren.filter(l=>l.type==="name"),s="";t?s=t.text:n.length>=1&&(s=n[0].text);let o=t&&n.length>0?n[n.length-1]:null,i=s.split("\\").pop()??s,a=o?.text??i,c=r?`${r}\\${s}`:s;return{importedName:i,localName:a,qualified:c}}function gt(e,r,t){return C(e,r,n=>nn(e,r,n),()=>on(t).flatMap(n=>cn(e,r,n,t)))}function nn(e,r,t){let n=g(t,new Set(["import_statement","import_from_statement"])),s=[];for(let o of t.rootNode.descendantsOfType("import_statement"))for(let i of o.namedChildren){let a=ft(i);if(!a)continue;let c=J(e,r,a.qualifiedName);s.push({importedName:a.qualifiedName,localName:a.localName,sourcePath:c,kind:"namespace",used:n.has(a.localName),usedMembers:[]})}for(let o of t.rootNode.descendantsOfType("import_from_statement")){let i=o.namedChild(0);if(!i)continue;let a=sn(i);if(a===null)continue;let c=J(e,r,a);for(let l=1;l<o.namedChildCount;l+=1){let p=o.namedChild(l);if(p.type==="wildcard_import"){s.push({importedName:"*",localName:null,sourcePath:c,kind:"side-effect",used:!0,usedMembers:[]});continue}let u=ft(p);u&&s.push({importedName:u.qualifiedName,localName:u.localName,sourcePath:c,kind:"named",used:n.has(u.localName),usedMembers:[]})}}return s}function ft(e){if(e.type==="aliased_import"){let r=e.namedChild(0),t=e.namedChild(1);return!r||!t?null:{qualifiedName:r.text,localName:t.text}}if(e.type==="dotted_name"){let r=e.text;return{qualifiedName:r,localName:r.split(".")[0]??r}}return e.type==="identifier"?{qualifiedName:e.text,localName:e.text}:null}function sn(e){if(e.type==="dotted_name")return e.text;if(e.type==="relative_import"){let r=b(e,"import_prefix")?.text??"",t=b(e,"dotted_name")?.text??"";return`${r}${t}`}return null}function on(e){let r=e.split(`
|
|
7
|
-
`),t=[],n=0;for(let s=0;s<r.length;s++){let o=r[s],i=o.trimStart(),a=n;if(n+=o.length+1,!i.startsWith("import ")&&!i.startsWith("from "))continue;let c=o,l=a+o.length,p=xe(o);for(;s+1<r.length&&(p>0||c.trimEnd().endsWith("\\"));){s++;let m=r[s];c+=`
|
|
8
|
-
${m}`,l+=1+m.length,p+=xe(m),n+=m.length+1}let u=an(c);u&&t.push({...u,start:a,end:l})}return t}function an(e){let r=e.replace(/\\\s*\n/g," ").trim();if(r.startsWith("import "))return{kind:"import",module:null,clause:r.slice(7).trim()};let t=r.match(/^from\s+([.\w]+)\s+import\s+([\s\S]+)$/);if(!t)return null;let n=t[2].trim();return n.startsWith("(")&&n.endsWith(")")&&(n=n.slice(1,-1).trim()),{kind:"from",module:t[1],clause:n}}function cn(e,r,t,n){let s=j(n,t.start,t.end),o=t.clause.replace(/\n/g," ").trim();if(t.kind==="import")return y(o).flatMap(c=>{let l=c.trim().replace(/,$/,"");if(!l)return[];let[p,u]=l.split(/\s+as\s+/),m=p.trim(),d=(u??m.split(".")[0]??m).trim(),h=J(e,r,m),$=z(s,d);return[{importedName:m,localName:d,sourcePath:h,kind:"namespace",used:x(s,d)||$.length>0,usedMembers:$}]});let i=t.module?J(e,r,t.module):null,a=[];for(let c of y(o)){let l=c.trim().replace(/,$/,"");if(!l)continue;if(l==="*"){a.push({importedName:"*",localName:null,sourcePath:i,kind:"side-effect",used:!0,usedMembers:[]});continue}let[p,u]=l.split(/\s+as\s+/),m=(u??p).trim();a.push({importedName:p.trim(),localName:m,sourcePath:i,kind:"named",used:x(s,m),usedMembers:[]})}return a}import{basename as ln}from"path";function St(e,r,t){return C(e,r,n=>un(e,r,n),()=>pn(e,r,t))}function pn(e,r,t){return I(t,/^[ \t]*(require_relative|require)\s+["']([^"']+)["']\s*$/gm,(n,s)=>{let o=n[1],i=n[2];if(!o||!i)return[];let a=o==="require_relative"?me(e,r,i):null;if(a){let c=ht(i);return[F(c,c,a,x(s,c))]}return[M(i,a)]})}function un(e,r,t){let n=g(t,new Set([])),s=[],o=new Set(["require","require_relative","load"]);for(let i of t.rootNode.descendantsOfType("call")){let a=i.namedChild(0);if(!a||a.type!=="identifier"||!o.has(a.text))continue;let l=i.namedChildren.find(d=>d.type==="argument_list")?.namedChild(0);if(!l||l.type!=="string")continue;let u=l.namedChildren.find(d=>d.type==="string_content")?.text;if(!u)continue;let m=a.text==="require_relative"?me(e,r,u):null;if(m){let d=ht(u);s.push(f(d,d,m,n))}else s.push(M(u,m))}return s}function ht(e){return Je(ln(e).replace(/\.[^.]+$/,""),/_/)}function xt(e,r,t){return C(e,r,n=>mn(e,r,n),()=>I(t,/^[ \t]*use\s+(.+?)\s*;$/gm,(n,s)=>{let o=n[1]?.trim();return o?dn(e,r,o,s):[]}))}function mn(e,r,t){let n=g(t,new Set(["use_declaration"])),s=[];for(let o of t.rootNode.descendantsOfType("use_declaration")){let i=o.namedChild(0);if(i)for(let a of te(i,"")){if(!a.importedName||a.importedName==="*")continue;let c=A(e,r,a.qualifiedName)??A(e,r,a.qualifiedName.split("::").slice(0,-1).join("::"));s.push(f(a.importedName,a.localName,c,n))}}return s}function te(e,r){switch(e.type){case"identifier":case"super":case"self":case"crate":{let t=e.text;return[{qualifiedName:pe(r,t),importedName:t,localName:t}]}case"scoped_identifier":{let t=e.text,n=t.split("::").pop()??t;return[{qualifiedName:pe(r,t),importedName:n,localName:n}]}case"scoped_use_list":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=pe(r,t.text),o=[];for(let i of n.namedChildren)o.push(...te(i,s));return o}case"use_list":{let t=[];for(let n of e.namedChildren)t.push(...te(n,r));return t}case"use_as_clause":{let t=e.namedChild(0),n=e.namedChild(1);if(!t||!n)return[];let s=te(t,r),o=n.text;return s.map(i=>({...i,localName:o}))}case"use_wildcard":{let t=e.namedChild(0),n=t?t.text:"";return[{qualifiedName:pe(r,`${n}::*`),importedName:"*",localName:"*"}]}default:return[]}}function pe(e,r){return e?r?`${e}::${r}`:e:r}function dn(e,r,t,n){let s=t.trim();if(s.includes("{")&&s.includes("}")){let p=s.slice(0,s.indexOf("{")).replace(/::$/,"").trim(),u=s.slice(s.indexOf("{")+1,s.lastIndexOf("}")).trim();return y(u).flatMap(m=>{let d=m.trim();if(!d||d==="self")return[];let[h,$]=d.split(/\s+as\s+/),U=h?.trim();if(!U)return[];let Ct=($??U.split("::").pop()??U).trim(),Pt=`${p}::${U}`.replace(/::::/g,"::");return[E(e,r,n,Pt,U.split("::").pop()??U,Ct,A(e,r,p))]})}let[o,i]=s.split(/\s+as\s+/),a=o?.trim()??s,c=(i??a.split("::").pop()??a).trim(),l=A(e,r,a)??A(e,r,a.split("::").slice(0,-1).join("::"));return[E(e,r,n,a,a.split("::").pop()??a,c,l)]}function yt(e,r,t){let n=R(e,r);if(n)return fn(e,r,n);let s=[];for(let o of t.matchAll(/^[ \t]*pub\s+use\s+(.+?)\s*;$/gm)){let i=o[1]?.trim();i&&s.push(...Sn(e,r,i))}return s}function fn(e,r,t){let n=[];for(let s of t.rootNode.descendantsOfType("use_declaration")){if(!gn(s))continue;let o=s.namedChildren.find(i=>i.type!=="visibility_modifier");if(o)for(let i of te(o,""))i.importedName&&n.push(Ae(e,r,i.qualifiedName))}return n}function gn(e){for(let r of e.children)if(r.type==="visibility_modifier"&&r.text.startsWith("pub"))return!0;return!1}function Sn(e,r,t){let n=t.trim();if(n.includes("{")&&n.includes("}")){let s=n.slice(0,n.indexOf("{")).replace(/::$/,"").trim(),o=n.slice(n.indexOf("{")+1,n.lastIndexOf("}")).trim();return y(o).flatMap(i=>{let a=i.trim();if(!a||a==="self")return[];let[c]=a.split(/\s+as\s+/),l=`${s}::${c?.trim()??a}`.replace(/::::/g,"::");return[Ae(e,r,l)]})}return[Ae(e,r,n)]}function Ae(e,r,t){return{specifier:t,sourcePath:A(e,r,t)??A(e,r,t.split("::").slice(0,-1).join("::"))}}function D({language:e,extensions:r,imports:t,parseImports:n}){return{language:e,extensions:r,capabilities:{imports:t},parseImports:n}}function bt(e,r){let t=r.toLowerCase();for(let n of e)for(let s of n.extensions)if(t.endsWith(s))return n;return null}var hn={language:"javascript",extensions:je,capabilities:{imports:"ast-with-regex-fallback",reExports:"ast-with-regex-fallback"},parseImports:Fe,parseReExports:Le},xn=D({language:"python",extensions:De,imports:"ast-with-regex-fallback",parseImports:gt}),yn=D({language:"jvm",extensions:_,imports:"ast-dispatch-with-regex-fallback",parseImports:ut}),bn={language:"rust",extensions:Oe,capabilities:{imports:"ast-with-regex-fallback",exports:"ast-with-regex-fallback"},parseImports:xt,parseExports:yt},Nn=D({language:"ruby",extensions:Me,imports:"ast-with-regex-fallback",parseImports:St}),In=D({language:"c/cpp",extensions:ve,imports:"ast-with-regex-fallback",parseImports:nt}),Cn=D({language:"dotnet",extensions:B,imports:"ast-dispatch-with-regex-fallback",parseImports:ct}),Pn={language:"dart",extensions:$e,capabilities:{imports:"regex-only",exports:"regex-only"},parseImports:it,parseExports:at},_n=D({language:"php",extensions:H,imports:"ast-with-regex-fallback",parseImports:dt}),Rn=D({language:"clojure",extensions:Ue,imports:"regex-only",parseImports:ot}),En=[hn,xn,yn,bn,Nn,In,Cn,Pn,_n,Rn];function ue(e){return bt(En,e)}var ke={clearGroups:["whole-project","source-file"]},Tn=q("source-imports",ke),Fn=q("source-exports",ke),Ln=q("source-reexports",ke),Nt=K({kind:"source-imports",invalidation:X("source-imports"),serialize:An,deserialize:kn}),It=K({kind:"source-reexports",invalidation:X("source-reexports"),serialize:wn,deserialize:jn});function zo(e,r){let t=ne(r);return Ln.get(e,t,()=>{let n=ue(t);if(!n?.parseReExports)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=It.read(e,t,o);if(a?.resolutionFingerprint===i)return a.reExports;let c=n.parseReExports(e,t,s);return It.write(e,t,o,{resolutionFingerprint:i,reExports:c}),c})}function Vo(e,r){let t=ne(r);return Tn.get(e,t,()=>{let n=ue(t);if(!n)return[];let s=k(e,t);if(!s)return[];let o=W(e,t,s),i=ge(e),a=Nt.read(e,t,o);if(a?.resolutionFingerprint===i)return a.imports;let c=n.parseImports(e,t,s);return Nt.write(e,t,o,{resolutionFingerprint:i,imports:c}),c})}function Wo(e,r){let t=ne(r);return Fn.get(e,t,()=>{let n=ue(t);if(!n?.parseExports)return[];let s=k(e,t);return s?n.parseExports(e,t,s):[]})}function An(e){return JSON.stringify(e)}function kn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.imports)?null:{resolutionFingerprint:r.resolutionFingerprint,imports:r.imports}}catch{return null}}function wn(e){return JSON.stringify(e)}function jn(e){try{let r=JSON.parse(e);return!Se(r)||typeof r.resolutionFingerprint!="string"||!Array.isArray(r.reExports)?null:{resolutionFingerprint:r.resolutionFingerprint,reExports:r.reExports}}catch{return null}}export{O as a,_t as b,xe as c,T as d,Kt as e,Zt as f,er as g,nr as h,sr as i,or as j,ir as k,zo as l,Vo as m,Wo as n};
|
|
9
|
-
//# sourceMappingURL=chunk-T2FQ4GHD.js.map
|