scip-query 0.23.0 → 0.26.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 +491 -2
- package/README.md +111 -122
- package/dist/augment-vue-worker.js +1 -1
- package/dist/by-kind-PRVFAGTQ.js +2 -0
- package/dist/call-graph-DVPAQV2F.js +2 -0
- package/dist/call-graph-evidence-CUtj8V2I.d.ts +19 -0
- package/dist/chunk-2FSBGL5P.js +2 -0
- package/dist/chunk-2HLAFUCY.js +2 -0
- package/dist/chunk-2IWUT6CJ.js +3 -0
- package/dist/chunk-2KNN7GTQ.js +2 -0
- package/dist/chunk-2LHXRE2B.js +8 -0
- package/dist/{chunk-EG2CPZMJ.js → chunk-2YXE77TJ.js} +2 -2
- package/dist/chunk-36SGVCGX.js +2 -0
- package/dist/chunk-3ABBFPTP.js +2 -0
- package/dist/chunk-3IVFU4FD.js +3 -0
- package/dist/chunk-3JIQS44J.js +7 -0
- package/dist/chunk-3ZRB6DNK.js +7 -0
- package/dist/{chunk-6YTSKJJ3.js → chunk-42EOW5VI.js} +1 -1
- package/dist/{chunk-6I6L7Z62.js → chunk-4BHGBMNO.js} +2 -2
- package/dist/chunk-4BP3UBDG.js +2 -0
- package/dist/chunk-4D6RO7G4.js +2 -0
- package/dist/chunk-4FEWQ6RH.js +2 -0
- package/dist/chunk-4IGEOBG7.js +2 -0
- package/dist/chunk-4QZXBUKC.js +2 -0
- package/dist/chunk-4WBDEVX2.js +4 -0
- package/dist/chunk-4WCUBZU3.js +8 -0
- package/dist/chunk-4WTUBQ36.js +40 -0
- package/dist/chunk-4XQ4O6IM.js +3 -0
- package/dist/chunk-55UQAMZO.js +4 -0
- package/dist/chunk-5D2LVK7O.js +125 -0
- package/dist/chunk-5IYJ56TT.js +2 -0
- package/dist/chunk-5PLMJC7Q.js +2 -0
- package/dist/chunk-5TNQJUR2.js +5 -0
- package/dist/chunk-62BDNPMI.js +2 -0
- package/dist/chunk-64DZ5TXR.js +7 -0
- package/dist/chunk-65245JCM.js +2 -0
- package/dist/chunk-6FFVZZL4.js +2 -0
- package/dist/chunk-6KO5JHAR.js +2 -0
- package/dist/chunk-6LRXOOSX.js +2 -0
- package/dist/chunk-6LSEIIF7.js +2 -0
- package/dist/chunk-6YMNWD3H.js +6 -0
- package/dist/chunk-72AD6ZRR.js +5 -0
- package/dist/chunk-73AAKPUC.js +4 -0
- package/dist/chunk-76CZ77DF.js +2 -0
- package/dist/chunk-7VPEEAAG.js +2 -0
- package/dist/chunk-7WTPQ4NX.js +14 -0
- package/dist/chunk-7Y5T6XDP.js +2 -0
- package/dist/chunk-A2IIGFMJ.js +5 -0
- package/dist/chunk-AB5KCTEV.js +2 -0
- package/dist/chunk-AC566WBP.js +6 -0
- package/dist/chunk-AGWFSTXC.js +3 -0
- package/dist/chunk-AOSIYPTA.js +2 -0
- package/dist/chunk-AUVEWPIF.js +2 -0
- package/dist/chunk-B56T42J3.js +25 -0
- package/dist/chunk-BIQEF5NE.js +2 -0
- package/dist/chunk-BL6XJKTA.js +3 -0
- package/dist/chunk-BMKOQJRI.js +2 -0
- package/dist/chunk-BOZ4EXBB.js +3 -0
- package/dist/chunk-BUTWYEPH.js +2 -0
- package/dist/chunk-BZB4QPIP.js +2 -0
- package/dist/{chunk-ILTDAWEF.js → chunk-CE357GEE.js} +4 -4
- package/dist/chunk-CFN45HFP.js +2 -0
- package/dist/chunk-CFYMZFXT.js +368 -0
- package/dist/chunk-CN5EH7O3.js +2 -0
- package/dist/chunk-D254DNNQ.js +4 -0
- package/dist/chunk-D3FDISIC.js +2 -0
- package/dist/chunk-D3NX5XIE.js +3 -0
- package/dist/chunk-DA7RPPDF.js +3 -0
- package/dist/chunk-DDMC3FON.js +3 -0
- package/dist/chunk-DIO3FUSG.js +2 -0
- package/dist/chunk-DJ2NNSUK.js +3 -0
- package/dist/chunk-DKYQIM3C.js +18 -0
- package/dist/{chunk-JTQVMR42.js → chunk-DOOEL2IV.js} +2 -2
- package/dist/chunk-DVFP6PZI.js +2 -0
- package/dist/chunk-E3FDPXZK.js +2 -0
- package/dist/chunk-E7YNJLCB.js +2 -0
- package/dist/chunk-EFGW5JPH.js +2 -0
- package/dist/chunk-EJVTR244.js +13 -0
- package/dist/chunk-EOV7RTRZ.js +2 -0
- package/dist/chunk-ETOIKRHO.js +2 -0
- package/dist/chunk-EYK3ZAO2.js +3 -0
- package/dist/chunk-F2V2LPET.js +52 -0
- package/dist/chunk-F4LUHJTF.js +2 -0
- package/dist/chunk-F4PUT6IT.js +2 -0
- package/dist/chunk-F56GCXXS.js +5 -0
- package/dist/chunk-FC2EVQRM.js +2 -0
- package/dist/chunk-FL7NBMHP.js +3 -0
- package/dist/chunk-FMRN2TRL.js +3 -0
- package/dist/chunk-FVULPZDF.js +20 -0
- package/dist/chunk-GCKCF5FL.js +43 -0
- package/dist/chunk-GH2PYF46.js +2 -0
- package/dist/chunk-GHJAGXIP.js +2 -0
- package/dist/{chunk-WIWY3CRX.js → chunk-GMVSHUKZ.js} +2 -2
- package/dist/chunk-GS6KDO4R.js +2 -0
- package/dist/chunk-GUUBXNN7.js +2 -0
- package/dist/chunk-GVWX5T43.js +80 -0
- package/dist/chunk-GZKFETP5.js +2 -0
- package/dist/chunk-H4EQHO6J.js +9 -0
- package/dist/chunk-H73WY2RM.js +2 -0
- package/dist/chunk-H75GSPRV.js +60 -0
- package/dist/chunk-HDR3AHSV.js +61 -0
- package/dist/chunk-HQBSL74Y.js +2 -0
- package/dist/chunk-HRRFKWPZ.js +2 -0
- package/dist/chunk-HXENDJC6.js +2 -0
- package/dist/chunk-IIBAZNSW.js +21 -0
- package/dist/chunk-INLMWEUU.js +12 -0
- package/dist/chunk-IWQPAF4F.js +2 -0
- package/dist/chunk-IZJ6YUKP.js +35 -0
- package/dist/chunk-J2TMAIN5.js +60 -0
- package/dist/chunk-J5FJMODQ.js +142 -0
- package/dist/chunk-J7HZPIO3.js +2 -0
- package/dist/chunk-JEVRKFRL.js +2 -0
- package/dist/chunk-JFXSGAEB.js +30 -0
- package/dist/chunk-JVRTHGFS.js +3 -0
- package/dist/chunk-JYWEX7RR.js +360 -0
- package/dist/chunk-K3YL22N6.js +2 -0
- package/dist/chunk-K4CN7GXK.js +12 -0
- package/dist/chunk-K5TBVXU4.js +30 -0
- package/dist/chunk-KDDIE2DP.js +9 -0
- package/dist/chunk-KHWRRPV4.js +2 -0
- package/dist/chunk-KI6NBKDY.js +14 -0
- package/dist/chunk-KU3QRSTH.js +2 -0
- package/dist/chunk-KZBJWZJB.js +2 -0
- package/dist/chunk-L7GFM3NP.js +3 -0
- package/dist/chunk-LMO6PK3V.js +35 -0
- package/dist/chunk-LN4YXJJU.js +2 -0
- package/dist/chunk-LOVIZBJ4.js +43 -0
- package/dist/chunk-LPCRK4A2.js +11 -0
- package/dist/chunk-MMHZKBFA.js +2 -0
- package/dist/{chunk-M2O5NY6W.js → chunk-MOQQBQRD.js} +2 -2
- package/dist/chunk-N2WN6I3L.js +2 -0
- package/dist/chunk-N3ORQT7L.js +2 -0
- package/dist/chunk-NAZ3RAIW.js +2 -0
- package/dist/chunk-NDUNO5JQ.js +2 -0
- package/dist/chunk-NEIWRNAZ.js +4 -0
- package/dist/chunk-NJJMVD65.js +2 -0
- package/dist/chunk-NLOQOBXI.js +20 -0
- package/dist/chunk-NOLZOVCU.js +2 -0
- package/dist/chunk-NOWINRRN.js +2 -0
- package/dist/chunk-NZAXKGRL.js +16 -0
- package/dist/chunk-O2C4UILI.js +2 -0
- package/dist/chunk-O3RHA6ZT.js +3 -0
- package/dist/chunk-O4UZSPPI.js +3 -0
- package/dist/chunk-OGFV2BUX.js +2 -0
- package/dist/chunk-OZCJXZK6.js +499 -0
- package/dist/chunk-P6ODM7BY.js +2 -0
- package/dist/{chunk-XBGWL66K.js → chunk-PAVGPRHJ.js} +2 -2
- package/dist/chunk-PH52RA7D.js +2 -0
- package/dist/chunk-PKN354TH.js +3 -0
- package/dist/chunk-PWOASWEG.js +11 -0
- package/dist/chunk-QIWXRW72.js +2 -0
- package/dist/chunk-QJRMOK5N.js +2 -0
- package/dist/{chunk-YXPUP5G2.js → chunk-QOIXNWQR.js} +2 -2
- package/dist/chunk-QXEUDXBT.js +3 -0
- package/dist/chunk-QYUVVBMR.js +6 -0
- package/dist/chunk-QZ7KQZRN.js +2 -0
- package/dist/chunk-R6LQBUDH.js +2 -0
- package/dist/chunk-RBS42E55.js +20 -0
- package/dist/chunk-RSJKPCFX.js +26 -0
- package/dist/chunk-S6CZA3MV.js +2 -0
- package/dist/chunk-STMVAHJP.js +2 -0
- package/dist/chunk-SYVPTTVW.js +2 -0
- package/dist/chunk-T3I6NHBH.js +2 -0
- package/dist/chunk-T6DK3ZP7.js +2 -0
- package/dist/chunk-TKD34PHN.js +4 -0
- package/dist/chunk-TNNQFH7W.js +2 -0
- package/dist/chunk-TNV7SSUF.js +2 -0
- package/dist/chunk-TO7ZR3EH.js +8 -0
- package/dist/chunk-TOU3CHK4.js +2 -0
- package/dist/chunk-TRBI4UKT.js +2 -0
- package/dist/chunk-TZCVNCAN.js +4 -0
- package/dist/chunk-U4LZA5LL.js +3 -0
- package/dist/chunk-U5RIG3JP.js +3 -0
- package/dist/chunk-UP5KXN2I.js +2 -0
- package/dist/chunk-UQFR3NDH.js +5 -0
- package/dist/chunk-UXYXF7GV.js +2 -0
- package/dist/chunk-VB3GOKOS.js +2 -0
- package/dist/chunk-VF5JZICY.js +2 -0
- package/dist/chunk-VTY3VK6E.js +2 -0
- package/dist/chunk-VX2O4RIS.js +2 -0
- package/dist/chunk-WKPV2TDZ.js +2 -0
- package/dist/chunk-WOFQ5DTB.js +2 -0
- package/dist/chunk-WS4C6TCK.js +2 -0
- package/dist/chunk-WXU3DGPU.js +2 -0
- package/dist/chunk-X6RMKHJQ.js +81 -0
- package/dist/{chunk-4ILJCCXV.js → chunk-XHMN6ZX7.js} +2 -2
- package/dist/chunk-XHTVFLWW.js +2 -0
- package/dist/chunk-XKIDJCIK.js +2 -0
- package/dist/chunk-XTYTYZPT.js +2 -0
- package/dist/chunk-Y2JHHTTA.js +2 -0
- package/dist/chunk-YGVRMGYN.js +4 -0
- package/dist/chunk-YNQCGEQE.js +2 -0
- package/dist/chunk-YOQVEXVE.js +14 -0
- package/dist/chunk-YRT2WLYY.js +2 -0
- package/dist/chunk-YTAP5Y2G.js +2 -0
- package/dist/chunk-YTYWI7VB.js +2 -0
- package/dist/chunk-YULZRALL.js +2 -0
- package/dist/chunk-Z33WQG4Q.js +2 -0
- package/dist/chunk-ZGTYGDMF.js +16 -0
- package/dist/chunk-ZHMRSZFD.js +43 -0
- package/dist/chunk-ZHSP366W.js +10 -0
- package/dist/chunk-ZIBYCYKK.js +7 -0
- package/dist/{chunk-GAS2LJMP.js → chunk-ZLADLUE6.js} +3 -3
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-HYO3NP5Q.js → chunk-ZR4HBC2H.js} +2 -2
- package/dist/cli-main.js +6 -6
- package/dist/cli.js +1 -1
- package/dist/{code-B17qEMbt.d.ts → code-BNyrCF3_.d.ts} +3 -2
- package/dist/code-IL5WH3NZ.js +2 -0
- package/dist/code-result-json-ANTBEDFP.js +4 -0
- package/dist/command-descriptors-HEEMDHTU.js +222 -0
- package/dist/deps-EOWFC6FD.js +2 -0
- package/dist/direct-navigation-Y5B6OSIQ.js +3 -0
- package/dist/{exploration-topology-BG4v30HZ.d.ts → exploration-topology-CSgEyAz-.d.ts} +3 -1
- package/dist/files-K4AI3JUM.js +2 -0
- package/dist/frontend-profile-roles-D7eCum8P.d.ts +10 -0
- package/dist/{health-CPp2Jf1Z.d.ts → health-BtfmNrfa.d.ts} +58 -74
- package/dist/hierarchy-6W5NDIFI.js +2 -0
- package/dist/imports-WH365QY4.js +2 -0
- package/dist/index.d.ts +13 -1
- package/dist/index.js +1 -1
- package/dist/members-K3PHMF5S.js +2 -0
- package/dist/methods-E7KVMBX4.js +2 -0
- package/dist/output-continuation-command-BJSY67SN.js +3 -0
- package/dist/output-pagination-UZJ5ACIX.js +24 -0
- package/dist/postinstall.js +1 -1
- package/dist/project-reindex-EP24WT4X.js +3 -0
- package/dist/queries/affected.js +1 -1
- package/dist/queries/architecture.d.ts +15 -4
- package/dist/queries/architecture.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.d.ts +3 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.d.ts +1 -0
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +3 -3
- package/dist/queries/cleanup-plan.js +1 -1
- package/dist/queries/co-change.d.ts +20 -2
- package/dist/queries/co-change.js +1 -1
- package/dist/queries/code.d.ts +1 -1
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity.d.ts +6 -3
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/context.d.ts +1 -7
- package/dist/queries/context.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dead.d.ts +2 -0
- package/dist/queries/dead.js +1 -1
- package/dist/queries/decorative-checkers.js +1 -1
- package/dist/queries/dependence-slice.d.ts +46 -22
- package/dist/queries/dependence-slice.js +1 -1
- package/dist/queries/dependency-depth.d.ts +1 -7
- package/dist/queries/dependency-depth.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-impact.d.ts +3 -1
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.js +1 -1
- package/dist/queries/drift.d.ts +1 -1
- package/dist/queries/drift.js +1 -1
- package/dist/queries/duplicate-bodies.d.ts +29 -2
- package/dist/queries/duplicate-bodies.js +1 -1
- package/dist/queries/entry-map.d.ts +2 -4
- package/dist/queries/entry-map.js +1 -1
- package/dist/queries/evidence.d.ts +121 -61
- package/dist/queries/evidence.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/files.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- 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 +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.d.ts +1 -0
- 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 +17 -65
- package/dist/queries/index.js +1 -1
- package/dist/queries/locality-candidates.d.ts +4 -4
- 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.js +1 -1
- package/dist/queries/not-implemented.d.ts +2 -6
- package/dist/queries/not-implemented.js +1 -1
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.d.ts +9 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/react-component-duplicates.d.ts +19 -3
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.d.ts +22 -3
- package/dist/queries/react-hook-candidates.js +1 -1
- package/dist/queries/react-large-component-pressure.d.ts +17 -3
- package/dist/queries/react-large-component-pressure.js +1 -1
- package/dist/queries/recent-duplicates.js +1 -1
- package/dist/queries/redundant-reexports.d.ts +4 -14
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.d.ts +4 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/review.d.ts +188 -0
- package/dist/queries/review.js +2 -0
- package/dist/queries/similar-files.d.ts +7 -10
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.d.ts +19 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice-cohesion.d.ts +205 -0
- package/dist/queries/slice-cohesion.js +2 -0
- package/dist/queries/source-inspection.d.ts +6 -202
- package/dist/queries/source-inspection.js +1 -1
- package/dist/queries/source-search.d.ts +2 -3
- package/dist/queries/source-search.js +1 -1
- package/dist/queries/stats.d.ts +1 -0
- package/dist/queries/stats.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.d.ts +4 -2
- package/dist/queries/system.js +1 -1
- package/dist/queries/test-quality.d.ts +1 -1
- package/dist/queries/test-quality.js +1 -1
- package/dist/queries/twin-drift.d.ts +23 -7
- package/dist/queries/twin-drift.js +1 -1
- package/dist/queries/unused-imports.js +1 -1
- package/dist/queries/unused-params.d.ts +3 -15
- package/dist/queries/unused-params.js +1 -1
- package/dist/queries/vue-component-duplicates.js +1 -1
- package/dist/queries/vue-composable-candidates.js +1 -1
- package/dist/queries/vue-large-view-pressure.js +1 -1
- package/dist/query-service-fastpath.js +5 -5
- package/dist/query-service-server.js +4 -4
- package/dist/refs-CCBJG7WK.js +2 -0
- package/dist/refs-pagination-DRNLVU4S.js +2 -0
- package/dist/reindex-worker.js +79 -29
- package/dist/reindex.js +45 -45
- package/dist/repository-cache-worker.js +2 -0
- package/dist/runtime.d.ts +8 -8
- package/dist/runtime.js +3 -4
- package/dist/rust-semantic-session-server.js +1 -1
- package/dist/rust-semantic-session-worker.js +1 -1
- package/dist/rust-semantic-worker.js +1 -1
- package/dist/service-queries-2WAJI7R6.js +6 -0
- package/dist/source-inspection-91U9zdO3.d.ts +341 -0
- package/dist/{source-search-types-Dwz8KeuW.d.ts → source-search-types-DWGYNg8M.d.ts} +15 -2
- package/dist/stats-G7DIV6VU.js +2 -0
- package/dist/surface-IO55UALI.js +2 -0
- package/dist/system-ZBMSHJXU.js +2 -0
- package/dist/{queries/trace.d.ts → trace-BMjw3prn.d.ts} +1 -18
- package/dist/typescript-indexer.js +2 -0
- package/dist/typescript-mailbox-worker.js +1 -1
- package/dist/watch-server.js +3 -3
- package/docs/AGENT_GUIDE.md +19 -128
- package/docs/CLI_JSON_OUTPUT.md +21 -17
- package/docs/COMMAND_REFERENCE.md +34 -49
- package/docs/CURRENT_COMMANDS.md +123 -0
- package/docs/DETECTOR_EVIDENCE_CONTRACTS.md +0 -40
- package/docs/DETECTOR_GUIDE.md +55 -12
- package/docs/PRODUCT_VISION.md +135 -0
- package/docs/PROPERTY_TESTING.md +73 -0
- package/docs/REVIEW.md +76 -0
- package/docs/SKILLS.md +51 -0
- package/docs/WINDOWS_SIDECAR_RELEASE.md +12 -3
- package/docs/accuracy-audit-checklist.md +70 -13
- package/docs/analyzer-inventory.md +2 -2
- package/docs/locality-analyzer-design.md +9 -9
- package/package.json +18 -80
- package/scripts/evidence-product-contract.mjs +7 -3
- package/scripts/record-review-coverage.mjs +118 -0
- package/scripts/scip-windows-provenance.mjs +29 -19
- package/skills/scip-architecture-review/SKILL.md +57 -0
- package/skills/scip-architecture-review/agents/openai.yaml +4 -0
- package/skills/scip-architecture-review/references/design-checks.md +17 -0
- package/skills/scip-explore/SKILL.md +15 -59
- package/skills/scip-explore/agents/openai.yaml +3 -3
- package/skills/scip-explore/references/external-evidence.md +2 -2
- package/skills/scip-explore/references/information-model.md +26 -29
- package/skills/scip-explore/scripts/capture-evidence.mjs +68 -34
- package/skills/scip-integrity-audit/SKILL.md +53 -181
- package/skills/scip-integrity-audit/agents/openai.yaml +3 -3
- package/skills/scip-integrity-audit/references/integrity-probes.md +27 -0
- package/skills/scip-plan/SKILL.md +39 -65
- package/skills/scip-plan/agents/openai.yaml +2 -2
- package/skills/scip-query/SKILL.md +28 -81
- package/skills/scip-query/agents/openai.yaml +2 -2
- package/skills/scip-query/references/command-guide.md +169 -0
- package/skills/scip-setup/SKILL.md +4 -2
- package/skills/scip-setup/agents/openai.yaml +3 -3
- package/dist/by-kind-XI2CSWEY.js +0 -2
- package/dist/call-graph-UONR6JR5.js +0 -2
- package/dist/call-graph-evidence-lZa2dwQA.d.ts +0 -11
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2E7CX53V.js +0 -2
- package/dist/chunk-2GRUZAQF.js +0 -43
- package/dist/chunk-2LDBDR6J.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2R3V3PSD.js +0 -4
- package/dist/chunk-2WC2OEDO.js +0 -4
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D3QG236.js +0 -2
- package/dist/chunk-3FHOF22C.js +0 -21
- package/dist/chunk-3JKSW6LJ.js +0 -2
- package/dist/chunk-3L2ZBPEX.js +0 -133
- package/dist/chunk-3PJABJSU.js +0 -2
- package/dist/chunk-3SVF22I5.js +0 -2
- package/dist/chunk-3WR4E3A3.js +0 -3
- package/dist/chunk-4FTZ4P5G.js +0 -2
- package/dist/chunk-4UX2F3JX.js +0 -2
- package/dist/chunk-4WNW27SX.js +0 -2
- package/dist/chunk-5ENOG4VP.js +0 -61
- package/dist/chunk-64BFSI5I.js +0 -2
- package/dist/chunk-66DVSJQG.js +0 -455
- package/dist/chunk-6HFCYNYE.js +0 -9
- package/dist/chunk-6PQNKL3G.js +0 -3
- package/dist/chunk-6V5CNXL6.js +0 -2
- package/dist/chunk-6VVV4WRR.js +0 -4
- package/dist/chunk-7BWFZPPZ.js +0 -2
- package/dist/chunk-7CYG22FH.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7IWV2EG3.js +0 -3
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-AFHTBORT.js +0 -2
- package/dist/chunk-AVRYW5OZ.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B5D7QPBE.js +0 -4
- package/dist/chunk-BBCIS4DX.js +0 -16
- package/dist/chunk-BDUVI7TO.js +0 -3
- package/dist/chunk-BE7ZZTMC.js +0 -2
- package/dist/chunk-BHVUJOCQ.js +0 -3
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BQGB4HBD.js +0 -2
- package/dist/chunk-BRV7PIFF.js +0 -2
- package/dist/chunk-CEEZJXEF.js +0 -2
- package/dist/chunk-CIYLO6SI.js +0 -7
- package/dist/chunk-CJZXN4NU.js +0 -2
- package/dist/chunk-CNO7TOKL.js +0 -2
- package/dist/chunk-COF23M5F.js +0 -2
- package/dist/chunk-CWFP7GM5.js +0 -2
- package/dist/chunk-D2DHWI3D.js +0 -2
- package/dist/chunk-D4N5SQ2M.js +0 -4
- package/dist/chunk-DBRSYFXR.js +0 -2
- package/dist/chunk-DHUIOLDT.js +0 -2
- package/dist/chunk-DIRJWYBM.js +0 -6
- package/dist/chunk-DIUFNHRJ.js +0 -35
- package/dist/chunk-DRENNWRG.js +0 -2
- package/dist/chunk-DTZCKZEU.js +0 -4
- package/dist/chunk-DULC3QFP.js +0 -5
- package/dist/chunk-DYGHBZ2N.js +0 -16
- package/dist/chunk-E5R6AQ73.js +0 -40
- package/dist/chunk-E73UNJTF.js +0 -38
- package/dist/chunk-EKV5HX33.js +0 -2
- package/dist/chunk-EQHFIL6T.js +0 -3
- package/dist/chunk-ESIQ66Z7.js +0 -2
- package/dist/chunk-EVFUMY4R.js +0 -3
- package/dist/chunk-F7DY272B.js +0 -2
- package/dist/chunk-FBN2FGXG.js +0 -2
- package/dist/chunk-FDLOBR6P.js +0 -4
- package/dist/chunk-FESCRNVV.js +0 -5
- package/dist/chunk-FFRKR4EQ.js +0 -2
- package/dist/chunk-FGA2U4OR.js +0 -8
- package/dist/chunk-FIQRSHVM.js +0 -2
- package/dist/chunk-FPYLNQPT.js +0 -2
- package/dist/chunk-FRUSVINH.js +0 -2
- package/dist/chunk-GSP44ENC.js +0 -2
- package/dist/chunk-GUFSG5TX.js +0 -2
- package/dist/chunk-GYIZ4NXB.js +0 -2
- package/dist/chunk-GZIUDL6G.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HCXEQRFF.js +0 -18
- package/dist/chunk-HEHOQQKH.js +0 -2
- package/dist/chunk-HKGFPJ4T.js +0 -4
- package/dist/chunk-HLZTEXRA.js +0 -2
- package/dist/chunk-HOENASQM.js +0 -3
- package/dist/chunk-HVF5VBG6.js +0 -2
- package/dist/chunk-I55I7XXP.js +0 -2
- package/dist/chunk-IDFEUFKS.js +0 -2
- package/dist/chunk-IHGQTTVW.js +0 -2
- package/dist/chunk-IICPE7B2.js +0 -20
- package/dist/chunk-IL676XCC.js +0 -18
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-IZDPJ2QI.js +0 -2
- package/dist/chunk-J66VOFW6.js +0 -5
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JGKUET5J.js +0 -3
- package/dist/chunk-JS4PGXMV.js +0 -3
- package/dist/chunk-JWTGMPIT.js +0 -80
- package/dist/chunk-JYR66JN5.js +0 -5
- package/dist/chunk-KFOYCQAJ.js +0 -9
- package/dist/chunk-KLFEXGQA.js +0 -2
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KYSDI3GE.js +0 -5
- package/dist/chunk-L6PJPETJ.js +0 -29
- package/dist/chunk-LDVT66YM.js +0 -2
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-LMZ5PRUV.js +0 -2
- package/dist/chunk-LQRQN2XA.js +0 -2
- package/dist/chunk-LXABEJX3.js +0 -2
- package/dist/chunk-MNV5FSBW.js +0 -3
- package/dist/chunk-MPQ4OTBM.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV3CDXPI.js +0 -38
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N2ZSIIGR.js +0 -117
- package/dist/chunk-N5B2NILC.js +0 -5
- package/dist/chunk-NJITK2GP.js +0 -2
- package/dist/chunk-NOGJXYFO.js +0 -2
- package/dist/chunk-NOYBFVJA.js +0 -554
- package/dist/chunk-NWQXSFFU.js +0 -3
- package/dist/chunk-ODDUPDP7.js +0 -13
- package/dist/chunk-OLIWTZI3.js +0 -3
- package/dist/chunk-OLNV6I6U.js +0 -2
- package/dist/chunk-OR2E3AGZ.js +0 -2
- package/dist/chunk-OSR2GEHQ.js +0 -2
- package/dist/chunk-OSSESPDX.js +0 -3
- package/dist/chunk-OWOOWNJ5.js +0 -7
- package/dist/chunk-P42EIXTA.js +0 -2
- package/dist/chunk-PJFGPYTU.js +0 -2
- package/dist/chunk-PP7KNN7L.js +0 -2
- package/dist/chunk-PU7T5QYQ.js +0 -2
- package/dist/chunk-PWWAJSKV.js +0 -74
- package/dist/chunk-PZL5T7SU.js +0 -73
- package/dist/chunk-QBE3YX64.js +0 -23
- package/dist/chunk-QGVTFRY2.js +0 -7
- package/dist/chunk-QOJONDS7.js +0 -2
- package/dist/chunk-QU5XRYB5.js +0 -4
- package/dist/chunk-QUU5OBVK.js +0 -11
- package/dist/chunk-RBLQNW26.js +0 -20
- package/dist/chunk-RTQ7NEKG.js +0 -81
- package/dist/chunk-SQXRS7BG.js +0 -4
- package/dist/chunk-SSK6LDPC.js +0 -2
- package/dist/chunk-SZHGTCPP.js +0 -7
- package/dist/chunk-T4N4P2K5.js +0 -16
- package/dist/chunk-TA3QKLLU.js +0 -2
- package/dist/chunk-TEBQMNVI.js +0 -43
- package/dist/chunk-TPFHAQ2G.js +0 -2
- package/dist/chunk-TQPCBMWT.js +0 -5
- package/dist/chunk-TQZV7KV4.js +0 -2
- package/dist/chunk-TRNAEQ6P.js +0 -3
- package/dist/chunk-TY7CRN3Z.js +0 -2
- package/dist/chunk-UHFYCMZO.js +0 -35
- package/dist/chunk-UICY4GTQ.js +0 -7
- package/dist/chunk-UVGEWT4Y.js +0 -26
- package/dist/chunk-UXW33INU.js +0 -29
- package/dist/chunk-VMPRET3I.js +0 -5
- package/dist/chunk-VNLGKHS6.js +0 -6
- package/dist/chunk-VQILFTEH.js +0 -2
- package/dist/chunk-VUPHCS7Y.js +0 -57
- package/dist/chunk-VVZSBTSU.js +0 -23
- package/dist/chunk-VZRNID6A.js +0 -2
- package/dist/chunk-W5OXRYGE.js +0 -7
- package/dist/chunk-W6STWDQI.js +0 -57
- package/dist/chunk-W7CXK74K.js +0 -2
- package/dist/chunk-WB3WYIRE.js +0 -4
- package/dist/chunk-WDNVY4E7.js +0 -20
- package/dist/chunk-WK46TNUM.js +0 -3
- package/dist/chunk-WNTFFKAX.js +0 -12
- package/dist/chunk-WOIKCX6A.js +0 -2
- package/dist/chunk-WUN6KBHV.js +0 -2
- package/dist/chunk-WYCTJDVR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XDQMU3BT.js +0 -2
- package/dist/chunk-XFA4SSO3.js +0 -3
- package/dist/chunk-XGZEP6GR.js +0 -8
- package/dist/chunk-XPDPNWTQ.js +0 -368
- package/dist/chunk-XRYABF57.js +0 -8
- package/dist/chunk-YBGKCQIS.js +0 -2
- package/dist/chunk-YEN6CYC7.js +0 -16
- package/dist/chunk-YF5IB2LF.js +0 -2
- package/dist/chunk-YI2AWIHC.js +0 -3
- package/dist/chunk-YPWBKGFU.js +0 -2
- package/dist/chunk-YPWHBBIS.js +0 -2
- package/dist/chunk-YSH6U3L4.js +0 -3
- package/dist/chunk-YU5DZUZI.js +0 -10
- package/dist/chunk-YWO5DDRC.js +0 -16
- package/dist/chunk-Z4CDXYNQ.js +0 -2
- package/dist/chunk-ZF5KHH7C.js +0 -2
- package/dist/chunk-ZOHS7AQV.js +0 -21
- package/dist/chunk-ZTI4SBFV.js +0 -3
- package/dist/code-MI6F2TTU.js +0 -2
- package/dist/code-result-json-FXALY4HE.js +0 -2
- package/dist/command-descriptors-P34VABY5.js +0 -343
- package/dist/dataflow-4KEMJPC6.js +0 -2
- package/dist/dependence-slice-R7FPWD5M.js +0 -2
- package/dist/deps-7EMQUYUT.js +0 -2
- package/dist/direct-navigation-6YO234F2.js +0 -3
- package/dist/entry-map-KOOLR26E.js +0 -2
- package/dist/files-OPIPJIGZ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-QPD2CAER.js +0 -2
- package/dist/imports-M6HUXRXC.js +0 -2
- package/dist/members-I5MEFOCT.js +0 -2
- package/dist/methods-5JYGGHXA.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-UPQAAKBP.js +0 -3
- package/dist/output-pagination-3OFL2MJV.js +0 -19
- package/dist/project-reindex-UKKQ5PLS.js +0 -3
- package/dist/queries/anchors.d.ts +0 -123
- package/dist/queries/anchors.js +0 -2
- package/dist/queries/complexity-hotspots.d.ts +0 -40
- package/dist/queries/complexity-hotspots.js +0 -2
- package/dist/queries/convergence.d.ts +0 -33
- package/dist/queries/convergence.js +0 -2
- package/dist/queries/dataflow.d.ts +0 -77
- package/dist/queries/dataflow.js +0 -2
- package/dist/queries/deep-chains.d.ts +0 -5
- package/dist/queries/deep-chains.js +0 -2
- package/dist/queries/extract-candidates.d.ts +0 -52
- package/dist/queries/extract-candidates.js +0 -2
- package/dist/queries/isolated.d.ts +0 -24
- package/dist/queries/isolated.js +0 -2
- package/dist/queries/plan-context.d.ts +0 -33
- package/dist/queries/plan-context.js +0 -2
- package/dist/queries/reference-neighborhood.d.ts +0 -4
- package/dist/queries/reference-neighborhood.js +0 -2
- package/dist/queries/reference-reachability.d.ts +0 -48
- package/dist/queries/reference-reachability.js +0 -2
- package/dist/queries/self-audit.d.ts +0 -63
- package/dist/queries/self-audit.js +0 -2
- package/dist/queries/similar-chains.d.ts +0 -48
- package/dist/queries/similar-chains.js +0 -2
- package/dist/queries/slice.d.ts +0 -4
- package/dist/queries/slice.js +0 -2
- package/dist/queries/stale-abstractions.d.ts +0 -72
- package/dist/queries/stale-abstractions.js +0 -2
- package/dist/queries/system-map.d.ts +0 -449
- package/dist/queries/system-map.js +0 -2
- package/dist/queries/trace.js +0 -2
- package/dist/queries/twin-ab.d.ts +0 -66
- package/dist/queries/twin-ab.js +0 -2
- package/dist/queries/value-flow.d.ts +0 -43
- package/dist/queries/value-flow.js +0 -2
- package/dist/queries/wrapper-candidates.d.ts +0 -34
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-PSU4JZZW.js +0 -2
- package/dist/refs-pagination-JG6CJMRC.js +0 -2
- package/dist/slice-HYRATV64.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-VTGDYWF5.js +0 -2
- package/dist/symbol-resolution-WD5EU5JE.js +0 -2
- package/dist/system-LRQNFOR2.js +0 -2
- package/dist/trace-F4B6OLL4.js +0 -2
- package/dist/value-flow-VRPZY72V.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
package/dist/chunk-XRYABF57.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{b as p}from"./chunk-NJITK2GP.js";import{a as T}from"./chunk-DHEQMPLW.js";import{b as N}from"./chunk-TEBQMNVI.js";import{a as A,e as h,t as D}from"./chunk-N2ZSIIGR.js";import{x as O}from"./chunk-ODDUPDP7.js";import{a as m}from"./chunk-ZOHS7AQV.js";import{k as j}from"./chunk-FESCRNVV.js";import{d as u}from"./chunk-JWTGMPIT.js";import{Aa as S,Ba as w,Ca as _,c as l}from"./chunk-N5B2NILC.js";import{existsSync as b,readdirSync as M}from"fs";import{join as d}from"path";var it={files:new Set,pathPrefixes:[]},at={reasonsByFile:new Map},P=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,ot=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,C=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],ct=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ut=4,ft=u("package-surface",{clearGroups:["whole-project"]}),lt=u("package-operational-surface",{clearGroups:["whole-project"]});function $(t){return ft.get(t,()=>pt(t.config.projectRoot))}function x(t,e){let n=$(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function I(t,e){return $(t).files.has(e)}function gt(t){return lt.get(t,()=>dt(t.config.projectRoot))}function ce(t,e){return gt(t).reasonsByFile.get(e)??[]}function pt(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:s}of L(t))for(let i of St(r))U(t,s,i,e,n);return e.size===0&&n.length===0?it:{files:e,pathPrefixes:n}}function dt(t){let e=new Map;for(let{manifest:n,packageRoot:r}of L(t)){let s=mt(n);for(let a of s)v(t,r,a,"package binary",e);let i=n.scripts;if(!(!i||typeof i!="object")){for(let[a,o]of Object.entries(i))if(typeof o=="string")for(let c of ht(o))v(t,r,c,`package script "${a}"`,e)}}return e.size===0?at:{reasonsByFile:e}}function L(t){let e=[],n=X(t,"");return n&&e.push({manifest:n,packageRoot:""}),V(t,"",e,0),e}function V(t,e,n,r){if(r>=ut)return;let s=d(t,e);if(b(s))for(let i of M(s,{withFileTypes:!0})){if(!i.isDirectory()||ct.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name,o=X(t,a);o&&n.push({manifest:o,packageRoot:a}),V(t,a,n,r+1)}}function X(t,e){let n;try{n=S(t,d(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!w(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function St(t){let e=[];for(let r of["main","module","types","browser"])typeof t[r]=="string"&&e.push(t[r]);let n=t.bin;if(typeof n=="string")e.push(n);else if(n&&typeof n=="object")for(let r of Object.values(n))typeof r=="string"&&e.push(r);return B(t.exports,e),e}function mt(t){let e=t.bin;return typeof e=="string"?[e]:!e||typeof e!="object"?[]:Object.values(e).filter(n=>typeof n=="string")}function ht(t){let e=[],n=/(?:^|&&|\|\||;)\s*(?:(?:cross-env|env)(?:\s+[A-Za-z_][A-Za-z0-9_]*=\S+)*\s+)?(?:node|bun|tsx|ts-node|vite-node|python3?|deno\s+run)\s+(?:(?:--?[A-Za-z0-9-]+(?:=\S+)?)\s+)*["']?([^"'`\s]+\.(?:ts|tsx|mts|cts|js|jsx|mjs|cjs|py))["']?/g;for(let r of t.matchAll(n)){let s=r[1];s&&!s.startsWith("node_modules/")&&!s.startsWith("./node_modules/")&&e.push(s)}return e}function v(t,e,n,r,s){let i=new Set;U(t,e,n,i,[]);for(let a of i){let o=s.get(a)??[];o.includes(r)||o.push(r),s.set(a,o)}}function B(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))B(n,e)}function U(t,e,n,r,s){let i=n.replace(/\\/g,"/").replace(/^\.\//,"");if(i===""||i.startsWith(".."))return;let a=i.indexOf("*");if(a>=0){let c=i.slice(0,a);for(let g of F(c))g!==""&&s.push(f(e,g));return}let o=i.replace(ot,"");for(let c of F(o)){c===o&&c===i&&r.add(f(e,i));for(let g of C)bt(t,r,e,c+g)}r.add(f(e,i))}function F(t){let e=[t];return P.test(t)&&(e.push(t.replace(P,"src/")),e.push(t.replace(P,""))),e}function bt(t,e,n,r){let s=f(n,r);if(e.add(s),!r.startsWith("src/")||b(d(t,s)))return;let i=C.find(y=>r.endsWith(y));if(!i)return;let a=r.slice(0,-i.length);yt(t,e,n,a,i);let o=a.lastIndexOf("/");if(o<=4)return;let c=a.slice(0,o),g=a.slice(o+1);for(let y of G(t,n,c,`${g}${i}`))e.add(y)}function yt(t,e,n,r,s){let i=f(n,`${r}/index${s}`);b(d(t,i))&&e.add(i)}function G(t,e,n,r){let s=d(t,e,n);if(!b(s))return[];let i=[];for(let a of M(s,{withFileTypes:!0})){let o=`${n}/${a.name}`;a.isDirectory()?i.push(...G(t,e,o,r)):a.isFile()&&a.name===r&&i.push(f(e,o))}return i}function f(t,e){return t?`${t}/${e}`:e}import{existsSync as E,readdirSync as Pt}from"fs";import{dirname as xt,join as k}from"path";var Et={rootFiles:new Set,sourcePrefixes:[]},kt=new Set([".git",".scipquery","node_modules","target"]),Rt=6,Tt=u("rust-library-surface",{clearGroups:["whole-project"]});function W(t,e,n){if(!n.endsWith(".rs")||!jt(wt(t),n))return!1;let r=D(t,n).find(s=>s.symbol===e);return r?Ot(j(t,n)[r.startLine]??""):!1}function wt(t){return Tt.get(t,()=>_t(t.config.projectRoot))}function _t(t){let e=new Set,n=new Set;for(let r of Nt(t)){let s=S(t,k(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),i=At(s),a=f(r,"src/lib.rs"),o=i?f(r,i):!Dt(s)&&_(t,a)?a:null;if(!o)continue;e.add(o);let c=xt(o).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?Et:{rootFiles:e,sourcePrefixes:[...n].sort()}}function jt(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:vt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Ot(t){return/^\s*pub\s+(?!\()/.test(t)}function Nt(t){if(!E(t))return[];let e=[];return H(t,"",e,0),e}function H(t,e,n,r){let s=k(t,e);if(E(s)&&(E(k(s,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let i of Pt(s,{withFileTypes:!0})){if(!i.isDirectory()||kt.has(i.name))continue;let a=e?`${e}/${i.name}`:i.name;H(t,a,n,r+1)}}function At(t){let e=!1;for(let n of t.split(`
|
|
2
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="lib";continue}if(!e)continue;let i=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(i)return i.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Dt(t){let e=!1;for(let n of t.split(`
|
|
3
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),s=/^\[([^\]]+)\]$/.exec(r);if(s){e=s[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function vt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}function Ft(t){return p(t)==="barrel"}function q(t){return Mt.get(t,()=>{let n=m(t,{includeIgnored:!1}).filter(a=>{let o=p(a);return o==="entry"||o==="worker"});if(n.length===0)return new Set;let r=N(t),s=new Set,i=new Set;for(;n.length>0;){let a=n.shift();if(!s.has(a)){s.add(a),p(a)==="barrel"&&i.add(a);for(let o of r.get(a)??[])s.has(o)||n.push(o)}}return i})}var Mt=u("live-barrels",{clearGroups:["whole-project"]});function Ct(t,e){return q(t).has(l(e))}function Ne(t){let e=q(t);return m(t,{includeIgnored:!1}).filter(n=>Ft(n)&&!e.has(n)&&!$t(t,n))}function $t(t,e){let n=l(e),r=A(t).forFile(n,{facts:!0}).facts?.callables;return r&&r.length>0?!0:(t.get(`SELECT COUNT(*) AS n
|
|
4
|
-
FROM defn_enclosing_ranges der
|
|
5
|
-
JOIN documents d ON d.id = der.document_id
|
|
6
|
-
WHERE d.relative_path = ?
|
|
7
|
-
AND der.end_line - der.start_line >= 2`,n)?.n??0)>0}function Ae(t,e){let n=l(e),r=p(e);return r==="entry"||r==="worker"||ee(n)||Ct(t,n)}function It(t,e,n){let r=l(n),s=[];x(t,r)&&s.push("package-surface-file"),Xt(t,e,r)&&s.push("transitive-package-surface"),W(t,e,r)&&s.push("rust-public-library"),te(e,r)&&s.push("framework-entrypoint");let i=t.config.entryRoots;return i&&(i.files?.some(a=>l(a)===r)&&s.push("configured-file"),i.pathPrefixes?.some(a=>r.startsWith(l(a)))&&s.push("configured-path-prefix"),i.qualifiedVars?.some(a=>re(e,a))&&s.push("configured-qualified-var"),i.symbolPatterns?.some(a=>{try{return T(a,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&s.push("configured-symbol-pattern")),s}function De(t,e,n){return It(t,e,n).length>0}var Lt=u("package-surface-reachability",{clearGroups:["whole-project"]}),Vt=u("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function Xt(t,e,n){let r=Bt(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function ve(t,e,n){let r=Ut(t).get(n);return r===void 0?!1:r===null||r.has(h(e))}function Bt(t){return Lt.get(t,()=>Y(t,e=>x(t,e)))}function Ut(t){return Vt.get(t,()=>Y(t,e=>I(t,e)))}function Y(t,e){let n=new Map,r=[];for(let s of m(t,{includeIgnored:!1}))e(s)&&(n.set(s,null),r.push(s));for(;r.length>0;){let s=r.shift(),i=n.get(s);if(i!==void 0)for(let a of O(t,s)){if(!a.sourcePath||t.isIgnored(a.sourcePath))continue;let o=Gt(i,a);o!==void 0&&Wt(n,a.sourcePath,o)&&r.push(a.sourcePath)}}return n}function Gt(t,e){if(t===null)return e.kind==="named"?new Set(e.names):null;if(e.kind==="star")return new Set(t);if(e.kind==="star-as")return e.names.some(r=>t.has(r))?null:void 0;let n=e.names.filter(r=>t.has(r));return n.length>0?new Set(n):void 0}function Wt(t,e,n){if(!t.has(e))return t.set(e,n),!0;let r=t.get(e);if(r===void 0)return!1;if(r===null||n===null)return r===null?!1:(t.set(e,null),!0);let s=!1;for(let i of n)r.has(i)||(r.add(i),s=!0);return s}var Z=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),Ht=new Set(["default","generateMetadata","generateStaticParams"]),Kt=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),qt=new Set(["default","middleware","config"]),Yt=new Set(["register","onRequestError"]),Zt=new Set(["onRouterTransitionStart"]),Jt=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),Qt=new Set(["load","actions","entries",...Z]),zt=new Set(["default"]);function te(t,e){let n=h(t);return n===""?!1:J(e)?Z.has(n):Q(e)?Ht.has(n):z(e)?Kt.has(n):tt(e)?qt.has(n):et(e)?Yt.has(n):nt(e)?Zt.has(n):rt(e)?Jt.has(n):st(e)?Qt.has(n):ne(e)?zt.has(n):!1}function ee(t){return J(t)||Q(t)||z(t)||tt(t)||et(t)||nt(t)||rt(t)||st(t)}function J(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Q(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function z(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function tt(t){return R(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function et(t){return R(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function nt(t){return R(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function R(t,e){return new RegExp(`^(?:src/)?${e}$`).test(t)||new RegExp(`(?:^|/)src/${e}$`).test(t)||new RegExp(`(?:^|/)(?:apps|services|packages)/[^/]+/(?:src/)?${e}$`).test(t)}function rt(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function st(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function ne(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function re(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),s=e.slice(n+1);return t.includes(K(r)+"/")&&t.includes(K(s)+".")}function K(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}export{x as a,ce as b,Ft as c,Ct as d,Ne as e,Ae as f,It as g,De as h,ve as i,ee as j};
|
|
8
|
-
//# sourceMappingURL=chunk-XRYABF57.js.map
|
package/dist/chunk-YBGKCQIS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as s}from"./chunk-4FTZ4P5G.js";import{r as o}from"./chunk-KYSDI3GE.js";function g(e,r){return s(e).filter(t=>c({pattern:r,relativePath:t})).map(t=>({relativePath:t}))}function c(e,r){let t=typeof e=="string"?{pattern:e,relativePath:r}:e;if(typeof t.pattern!="string"||typeof t.relativePath!="string")throw new TypeError("pathMatchesGlob requires pattern and relativePath.");let n=o(t.pattern),a=o(t.relativePath);if(!/[*?]/.test(n))return a.includes(n);let l=n.includes("/")?n:`**/${n}`;return i(l.split("/"),a.split("/"))}function i(e,r){if(e.length===0)return r.length===0;let[t,...n]=e;return t==="**"?i(n,r)||r.length>0&&i(e,r.slice(1)):r.length===0||!f(t??"",r[0]??"")?!1:i(n,r.slice(1))}function f(e,r){let t="^";for(let n of e)n==="*"?t+="[^/]*":n==="?"?t+="[^/]":t+=p(n);return t+="$",new RegExp(t).test(r)}function p(e){return/[\\^$.*+?()[\]{}|]/.test(e)?`\\${e}`:e}export{g as a,c as b};
|
|
2
|
-
//# sourceMappingURL=chunk-YBGKCQIS.js.map
|
package/dist/chunk-YEN6CYC7.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{a as z}from"./chunk-WRQXLNYE.js";import{d as y}from"./chunk-HOENASQM.js";import{c as v}from"./chunk-BJT7LSPK.js";import{C as L,K as R,T as O,_ as $,i as p,n as A,o as F,p as T}from"./chunk-3L2ZBPEX.js";import{b as E,d as b}from"./chunk-DRENNWRG.js";import{c as h,d as k}from"./chunk-IW5XQG5G.js";import{n as P,p as g}from"./chunk-KYSDI3GE.js";function _e(e,n){let t=B(e);return t?n.filter(r=>B(r.file)===t):n}function xe(e,n,t,r,i){let o=R(e,n);if(r){let f=i?.match(/^[A-Za-z_$][\w$]*/u)?.[0];if(!f)return null;let d=new Set(o.filter(u=>u.localName===f||u.importedName===f).map(u=>u.sourcePath).filter(u=>!!u));for(let u of t)for(let S of d)if(g(S,u.file))return u;if(f==="this"||f==="self"||f==="cls"){let u=t.filter(S=>S.file===n&&E(S.symbol)!==null);if(u.length===1)return u[0]}let m=X(p(e,n)??"",f);if(m.size===0)return null;let V=new Set(o.filter(u=>m.has(u.localName??u.importedName)).map(u=>u.sourcePath).filter(u=>!!u)),D=t.filter(u=>m.has(E(u.symbol)??"")&&(u.file===n||[...V].some(S=>g(S,u.file))));return D.length===1?D[0]:null}let s=t.filter(f=>E(f.symbol)===null),c=s.find(f=>f.file===n);if(c)return c;let a=b(t[0].symbol),l=o.filter(f=>f.kind!=="namespace"&&f.kind!=="side-effect"&&(f.localName===a||f.localName===null&&f.importedName===a));if(l.length>0){let f=s.filter(d=>l.some(m=>m.sourcePath!==null&&g(m.sourcePath,d.file)));return f.length===1?f[0]:null}return s.length===1?s[0]:null}function X(e,n){let t=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),r=new Set,i=[new RegExp(`\\b${t}\\s*:\\s*([A-Za-z_$][\\w$]*)`,"gu"),new RegExp(`\\b${t}\\s*=\\s*(?:new\\s+)?([A-Za-z_$][\\w$]*)\\s*\\(`,"gu")];for(let o of i)for(let s of e.matchAll(o))r.add(s[1]);return r.size===1?r:new Set}function B(e){let n=T(e);return n?n==="typescript"||n==="tsx"||n==="javascript"?"javascript-family":n:null}var q=k("global-leaf-index",{clearGroups:["whole-project"]});function N(e){return q.get(e,()=>{let n=e.all(`SELECT gs.id, gs.symbol,
|
|
2
|
-
COALESCE(der_doc.relative_path, mention_doc.relative_path) AS relative_path
|
|
3
|
-
FROM global_symbols gs
|
|
4
|
-
LEFT JOIN defn_enclosing_ranges der ON der.symbol_id = gs.id
|
|
5
|
-
LEFT JOIN documents der_doc ON der_doc.id = der.document_id
|
|
6
|
-
LEFT JOIN (
|
|
7
|
-
SELECT m.symbol_id, MIN(d.relative_path) AS relative_path
|
|
8
|
-
FROM mentions m
|
|
9
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
10
|
-
JOIN documents d ON c.document_id = d.id
|
|
11
|
-
WHERE m.role = 1
|
|
12
|
-
GROUP BY m.symbol_id
|
|
13
|
-
) mention_doc ON mention_doc.symbol_id = gs.id
|
|
14
|
-
WHERE 1 = 1
|
|
15
|
-
${e.symbolNoiseFor("gs")}`),t=new Map;for(let r of n){if(!r.relative_path||e.isIgnored(r.relative_path))continue;let i=b(r.symbol);if(!i)continue;let o=t.get(i);o||(o=[],t.set(i,o)),o.some(s=>s.symbolId===r.id)||o.push({symbol:r.symbol,symbolId:r.id,file:r.relative_path})}return t})}function _(e,n,t,r={}){if(!t)return[];let i=p(e,n);return i?i.indexOf(t)===-1?[]:(M(e,n).get(t)??[]).filter(s=>!K(s,r)):[]}function K(e,n){return typeof n.excludeStartLine=="number"&&typeof n.excludeEndLine=="number"&&e>=n.excludeStartLine&&e<=n.excludeEndLine}var Q=h("file-identifiers",{clearGroups:["whole-project","source-file"]});function j(e,n){let t=L(e,n);return t?t.fileIdentifiers:Q.get(e,n,()=>new Set(M(e,n).keys()))}var ee=h("file-ident-lines",{clearGroups:["whole-project","source-file"]});function M(e,n){let t=L(e,n);return t?t.identifierLineMap:ee.get(e,n,()=>ne(e,n))}var te=h("file-idents-by-line",{clearGroups:["whole-project","source-file"]});function De(e,n){let t=L(e,n);return t?t.identifiersByLine:te.get(e,n,()=>{let r=M(e,n),i=0;for(let s of r.values()){let c=s[s.length-1];c!==void 0&&c>i&&(i=c)}let o=new Array(i+1);for(let s=0;s<=i;s+=1)o[s]=new Set;for(let[s,c]of r)for(let a of c)o[a].add(s);return o})}function ne(e,n){let t=new Map,r=(c,a)=>{let l=t.get(c);if(!l){t.set(c,[a]);return}l[l.length-1]!==a&&l.push(a)},i=p(e,n);if(!i)return t;let o=F(i).split(/\r?\n/),s=/\b([A-Za-z_$][\w$]*)\b/g;for(let c=0;c<o.length;c+=1){let a=o[c]??"";for(let l of a.matchAll(s))l[1]&&r(l[1],c)}return t}var G=/[A-Za-z_$][A-Za-z0-9_$]*/g,Z=/^[A-Za-z_$][A-Za-z0-9_$]*$/,re=512;function C(e){let n=[],t=!1;for(let r of e)r&&(t=!0,Z.test(r)||n.push(r));return{candidateNames:e,hasUsableCandidate:t,nonIdentifierNames:n}}function H(e,n){let t=ie(n)?n:C(n);if(t.candidateNames.size===0||!t.hasUsableCandidate)return!0;if(t.candidateNames.size<=re){for(let i of t.candidateNames)if(i){if(Z.test(i)){if(oe(i).test(e))return!0;continue}if(e.includes(i))return!0}return!1}G.lastIndex=0;let r;for(;(r=G.exec(e))!==null;)if(t.candidateNames.has(r[0]))return!0;for(let i of t.nonIdentifierNames)if(e.includes(i))return!0;return!1}function ie(e){return"candidateNames"in e}function oe(e){return new RegExp(`(?<![A-Za-z_$0-9])${A(e)}(?![A-Za-z_$0-9])`)}var se=h("source-import-paths-by-local-name",{clearGroups:["whole-project","source-file"]});function J(e,n){let t=P(n);return se.get(e,t,()=>ae(e,t))}function ae(e,n){let t=new Map;for(let r of R(e,n)){if(!r.sourcePath)continue;let i=r.localName??r.importedName;if(i&&U(t,i,r.sourcePath),r.kind==="namespace")for(let o of r.usedMembers)U(t,o,r.sourcePath)}return t}function U(e,n,t){let r=e.get(n);r||(r=new Set,e.set(n,r)),r.add(t)}function w(e,n,t){let r=N(e).get(t);if(!r||r.length===0)return[];if(r.length===1)return[I(r[0])];let i=r.filter(a=>a.file===n);if(i.length>0)return i.map(I);let o=J(e,n),s=o.get(t);if(s)for(let a of s){let l=r.filter(f=>g(a,f.file));if(l.length>0)return l.map(I)}let c=new Set;for(let a of o.values())for(let l of a)c.add(l);for(let a of c){let l=r.filter(f=>g(a,f.file));if(l.length>0&&l.length===r.length)return l.map(I)}return[]}function Ve(e,n,t){let r=w(e,n,t);if(r.length>0)return r;let i=N(e).get(t);return!i||i.length===0?[]:i.map(I)}function Y(e,n,t={}){let r=ce(e,n);if(!r)return[];let i=y(e,n);if(t.semantic!==!1&&t.semanticEvidence){let s=t.semanticEvidence.references(e,{...i,leaf:r.identifier,parentTypeName:null,isFunctionLike:!1,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null});if(s.length>0){let c=new Map;for(let a of s){let l=c.get(a.file)??[];l.push(a.line),c.set(a.file,l)}return x(e,c)}}let o=new Map;for(let s of v(e)){let c=le(e,r,s);c.length>0&&o.set(s,c)}return x(e,o)}function ce(e,n){let t=y(e,n);if(!t)return null;let r=b(t.symbol);return r?{symbolId:t.symbolId,relativePath:t.relativePath,startLine:t.startLine,endLine:t.endLine,identifier:r}:null}function le(e,n,t){let r=p(e,t);return!r||r.indexOf(n.identifier)===-1?[]:t!==n.relativePath&&!w(e,t,n.identifier).some(o=>o.symbolId===n.symbolId)?[]:_(e,t,n.identifier,t===n.relativePath?{excludeStartLine:n.startLine,excludeEndLine:n.endLine}:{})}function Xe(e,n,t={}){let r=new Map;for(let a of n){if(!a.leaf)continue;let l=r.get(a.leaf)??[];l.push(a),r.set(a.leaf,l)}if(r.size===0)return new Map;let i=new Set(n.map(a=>a.symbolId)),o=new Set(r.keys()),s=C(o),c=new Map;for(let a of v(e)){if(t.skipPath?.(a)||!H(p(e,a),s))continue;let l=j(e,a);if(l.size!==0){for(let f of l)if(r.has(f))for(let d of w(e,a,f)){if(!i.has(d.symbolId)||a===d.relativePath)continue;let m=c.get(d.symbolId);m||(m=new Set,c.set(d.symbolId,m)),m.add(a)}}}return c}function I(e){return{symbolId:e.symbolId,symbol:e.symbol,relativePath:e.file}}function x(e,n){let t=[],r=new Set;for(let[i,o]of n){let s=O(e,i);for(let c of o){let a=$(s,c),l=`${i}|${c}|${a?.symbol??""}`;r.has(l)||(r.add(l),t.push({file:i,line:c,enclosingSymbol:a?.symbol??null}))}}return t}function fe(e,n){return ue(e,[n]).get(n.symbolId)??[]}function ue(e,n){let t=n.map(o=>({symbolId:o.symbolId,prelude:Se(e,o)})).filter(o=>o.prelude!==null),r=pe(e,t.map(o=>o.symbolId)),i=new Map;for(let{symbolId:o,prelude:s}of t){let c=de(e,r.get(o)??new Map,s.match,s.identifier);i.set(o,x(e,c))}return i}function rt(e,n,t={}){return me(e,n,t).map(r=>({file:r.file,line:r.line,enclosingSymbol:r.enclosingSymbol}))}function me(e,n,t={}){let r=Y(e,n,{semantic:t.semantic,semanticEvidence:t.semanticEvidence}),i=r.length>0?W(r,"source-attribution"):W(fe(e,n),"scip-reference-chunk");return t.includeIgnored===!0?i:i.filter(o=>!e.isIgnored(o.file))}function W(e,n){return e.map(t=>({...t,provenance:n}))}function de(e,n,t,r){let i=new Map;for(let[o,s]of n)i.set(o,ge(e,o,s,t,r));return i}function pe(e,n){let t=new Map;for(let r of z(e,n)){if(e.isIgnored(r.relative_path))continue;let i=t.get(r.symbol_id);i||(i=new Map,t.set(r.symbol_id,i));let o=i.get(r.relative_path);o||(o=[],i.set(r.relative_path,o)),o.push({start_line:r.chunk_start,end_line:r.chunk_end})}return t}function ge(e,n,t,r,i){let o=n===r.relativePath?{excludeStartLine:r.startLine,excludeEndLine:r.endLine}:{},s=i?_(e,n,i,o):[];return t.flatMap(c=>be(s,c))}function be(e,n){let t=e.filter(r=>r>=n.start_line&&r<=n.end_line);return t.length>0?t:[n.start_line]}function Se(e,n){let t=y(e,n);return t?{match:t,identifier:b(t.symbol)||null}:null}export{_ as a,M as b,De as c,_e as d,xe as e,N as f,C as g,H as h,w as i,Ve as j,ce as k,le as l,Xe as m,fe as n,ue as o,rt as p,me as q};
|
|
16
|
-
//# sourceMappingURL=chunk-YEN6CYC7.js.map
|
package/dist/chunk-YF5IB2LF.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{c as m}from"./chunk-GZIUDL6G.js";var v=/:\d+(?:-\d+)?$/u;function D(d,t,c={}){let p=c.direction??"backward",n=c.maxDepth??3;if(!Number.isSafeInteger(n)||n<0)throw new RangeError(`Dependence-slice depth must be a non-negative safe integer; received ${n}.`);let r=v.test(t),o=m(d,r?{locations:[t]}:{symbols:[t]},{families:["execution","runtime","dataflow","ownership"],maxDepth:n+1,maxEdges:c.maxEdges??200}),f=new Set(o.targets.flatMap(e=>e.nodeIds)),a=new Set(f),l=new Map;u(o.edges,a,l,0);for(let e=1;e<=n;e+=1){let s=[];for(let i of o.edges)if(p==="backward"?a.has(i.to.id):a.has(i.from.id)){let g=p==="backward"?i.from.id:i.to.id;if(a.has(g))continue;s.push(g),l.set(i.id,e)}if(s.length===0)break;for(let i of s)a.add(i);u(o.edges,a,l,e)}let h=o.edges.filter(e=>a.has(e.from.id)&&a.has(e.to.id)).filter(e=>l.has(e.id)||e.family==="ownership").map(e=>({...e,traversalDepth:l.get(e.id)??0,supporting:e.family!=="dataflow"&&!y(e)})).sort((e,s)=>e.traversalDepth-s.traversalDepth||e.family.localeCompare(s.family)||e.from.label.localeCompare(s.from.label)||e.to.label.localeCompare(s.to.label));return{kind:"dependence-slice",direction:p,criterion:t,targets:o.targets,nodeIds:[...a].sort(),edges:h,coverage:{status:o.coverage.status,criterionKind:r?"source-location-summary":"symbol-summary",basis:"partial-system-dependence-graph",analysisBasis:"typescript-cfg-reaching-definitions-plus-system-edges",providers:["typescript-local-dependence","bounded-static-value-flow"],graph:o.coverage,unsupportedRelations:["general heap alias and cross-instance field points-to flow","exceptional control and value flow","closure invocation order","downstream local definition-use after a call result","unresolved dynamic dispatch"]}}}function u(d,t,c,p){let n=!0;for(;n;){n=!1;for(let r of d)r.family!=="ownership"||!t.has(r.from.id)||t.has(r.to.id)||(t.add(r.to.id),c.set(r.id,p),n=!0)}}function y(d){return d.semanticFamily==="control"&&d.sourceKind==="control-dependence"}export{D as a};
|
|
2
|
-
//# sourceMappingURL=chunk-YF5IB2LF.js.map
|
package/dist/chunk-YI2AWIHC.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-OSSESPDX.js";import{b as d,d as m}from"./chunk-N2ZSIIGR.js";function u(e,r){let c=f(e,r);if(!c)return[];let t=e.get(`SELECT symbol, enclosing_symbol FROM global_symbols
|
|
2
|
-
WHERE id = ? LIMIT 1`,c.symbolId);if(!t)return[];let o=[{symbol:t.symbol,shortName:m(t.symbol),depth:0}],n=t.enclosing_symbol,i=1,y=new Set([t.symbol]);for(;n&&!y.has(n)&&i<20;){y.add(n);let s=e.get("SELECT symbol, enclosing_symbol FROM global_symbols WHERE symbol = ?",n);if(!s)break;o.push({symbol:s.symbol,shortName:m(s.symbol),depth:i}),n=s.enclosing_symbol,i++}if(o.length>1)return o;let b=d(t.symbol);if("kind"in b)return o;let l=b.descriptors;if(l.length<=1)return o;let h=[o[0]];for(let s=l.length-2,p=1;s>=0;s--,p++){let g=l.slice(0,s+1).map(a=>a.suffix==="method"?`${a.name}()`:a.name.replace(/\.(ts|tsx|js|jsx|mjs|cjs|py|pyi|rs|java|scala|kt|kts|rb|go|cs|vb|dart|php|c|cc|cpp|cxx|h|hpp)$/,"")).join(":");h.push({symbol:g,shortName:g,depth:p})}return h}function N(e,r){return u(e,r)}export{u as a,N as b};
|
|
3
|
-
//# sourceMappingURL=chunk-YI2AWIHC.js.map
|
package/dist/chunk-YPWBKGFU.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as v}from"./chunk-BOJ5SVE2.js";import{c as h}from"./chunk-CJZXN4NU.js";import{a as p}from"./chunk-W7CXK74K.js";import{a as g,c as y}from"./chunk-E73UNJTF.js";import{d as b}from"./chunk-N2ZSIIGR.js";function x(i,n={}){let{limit:f=20,scope:l,minFanIn:c=2,minFanOut:m=2,scanLimit:o}=n,a=new h(i),r=v(a.productionCallableDefinitions({scope:l,requireCallableSymbol:!0,includeSuppressed:!0,sortByLocDesc:typeof o=="number"&&o>0}),o),s=n.semantic!==!1,d=y(i,r,{limit:500,semantic:s,semanticEvidence:p});return r.map(e=>S(i,e,s,d.get(e.symbolId)??[])).filter(e=>e.fanIn>=c&&e.fanOut>=m).sort((e,t)=>t.score-e.score||t.fanIn-e.fanIn).slice(0,f)}function B(i,n={}){return x(i,n)}function S(i,n,f,l){let c=[...new Set(l.map(e=>e.file))].sort(),m=[...new Set(l.filter(e=>e.source!=="caller-map-inversion"||e.callEvidence==="scip-chunk").map(e=>e.file))].sort(),o=new Map;for(let e of g(i,n,{limit:500,semantic:f,semanticEvidence:p})){if(e.file===n.relativePath)continue;let t=`${e.symbol}|${e.file}`;o.has(t)||o.set(t,{symbol:e.symbol,shortName:b(e.symbol),file:e.file,evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source})}let a=[...o.values()].sort((e,t)=>e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)),r=c.length,s=a.length,d=r*s,u=a.filter(e=>e.evidenceStrength==="candidate").map(e=>e.symbol);return{symbol:n.symbol,shortName:b(n.symbol),fanIn:r,fanOut:s,callerFiles:c,candidateCallerFiles:m,externalCallees:a.map(({symbol:e,shortName:t,file:C})=>({symbol:e,shortName:t,file:C})),externalCalleeEvidence:a,candidateExternalCallees:u,inputBasis:"mixed-static-call-or-reference-evidence",score:d,definedIn:n.relativePath,actionTier:"signal",riskKind:"coordination-hotspot",evidenceReasons:[`${r} incoming file(s) reference this symbol`,`${s} distinct cross-file callee symbol(s) are reached from it`,`centrality score is ${d} (fan-in * fan-out)`,`${m.length} incoming file(s) and ${u.length} outgoing target(s) rely on candidate rather than exact call evidence`],recommendation:"Review ownership, API stability, and caller groups before changing this central symbol; do not refactor solely from graph centrality."}}export{x as a,B as b};
|
|
2
|
-
//# sourceMappingURL=chunk-YPWBKGFU.js.map
|
package/dist/chunk-YPWHBBIS.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as p}from"./chunk-7KCZELVM.js";import{a as h,b as u}from"./chunk-MV3CDXPI.js";import{a as t}from"./chunk-WYCTJDVR.js";import{a as m}from"./chunk-HOENASQM.js";import{c,g as d}from"./chunk-DRENNWRG.js";function C(a,v,y={}){let l=m(a,v);if(!l)return null;let o=y.semantic!==!1,b=u(a,l,{semantic:o,semanticEvidence:t}).filter(e=>d(e.symbol)).slice(0,50),g=p(h(a,l,{limit:50,additive:!0,callableOnly:!0,semantic:o,semanticEvidence:t})),s=b.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source!=="caller-map-inversion"?"reference-candidate":e.callEvidence==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="caller-map-inversion"&&e.callEvidence!=="scip-chunk"?"exact":"candidate",evidenceSource:e.callEvidence??e.source})),r=g.map(e=>({symbol:e.symbol,shortName:c(e.symbol),file:e.file,relationship:e.source==="scip-chunk"?"chunk-candidate":"resolved-call",evidenceStrength:e.source==="scip-chunk"?"candidate":"exact",evidenceSource:e.source}));return{symbol:l.symbol,shortName:c(l.symbol),callers:s.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callees:r.map(({symbol:e,shortName:i,file:n})=>({symbol:e,shortName:i,file:n})),callerEvidence:s,calleeEvidence:r,coverage:{scope:"indexed-static-call-graph",blindSpots:["unresolved dynamic dispatch and reflection","external or unindexed callees without a resolved symbol identity","SCIP chunk co-occurrence is retained only as candidate call evidence"]}}}export{C as a};
|
|
2
|
-
//# sourceMappingURL=chunk-YPWHBBIS.js.map
|
package/dist/chunk-YSH6U3L4.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as He}from"./chunk-DIRJWYBM.js";import{b as Pe,c as ge}from"./chunk-TPFHAQ2G.js";import{c as je}from"./chunk-OR2E3AGZ.js";import{d as Te}from"./chunk-6VVV4WRR.js";import{i as We}from"./chunk-VUPHCS7Y.js";import{e as E}from"./chunk-BOJ5SVE2.js";import{c as Ue}from"./chunk-CJZXN4NU.js";import{d as Ke,e as Be,f as ze}from"./chunk-DYGHBZ2N.js";import{a as x,b as U}from"./chunk-NJITK2GP.js";import{A as qe,d as te,i as oe,t as be}from"./chunk-N2ZSIIGR.js";import{A as Xe,n as Q}from"./chunk-ODDUPDP7.js";import{J as $e}from"./chunk-ZOHS7AQV.js";import{j as Re,k as we}from"./chunk-FESCRNVV.js";import{d as Ge}from"./chunk-N5B2NILC.js";var Ye=4,bn=3,gn=12,Sn=48,vn=64,J=10,V=6,An=24,Mn=320,Ie=6,Dn=12,Ln=1,Cn=4,Rn=7,wn=12,_e="source-construct:",Tn=96,Pn=32,Qe=4,In=32,xn=8,Ve=new Set(["a","an","and","are","as","at","be","become","becomes","by","can","does","for","from","how","in","into","is","it","its","of","on","or","that","the","their","then","this","through","to","what","when","where","which","with"]);function Bt(n,e,i={}){let a=En(e),r=bt(e);if(a.length===0)throw new Error("Anchor discovery requires at least one non-trivial repository term.");let o=i.limit??Ye,t=i.full===!0;if(!Number.isSafeInteger(o)||o<=0)throw new RangeError(`anchor group limit must be a positive safe integer; received ${o}`);let s=new Ue(n),m=s.scopedDefinitions(i.scope).filter(g=>!oe(g.symbol)),l=[...m],c=new Map(l.map(g=>[g.symbol,g])),d=new Map;for(let g of m)Ze(d,g,a);let u=je(n,{scope:i.scope});for(let g of u.files){let fe=be(n,g.relativePath).filter(O=>!oe(O.symbol));if(fe.length===0)continue;let ne=Re(g.text);for(let O=0;O<ne.length;O+=1){let pe=T(ne[O]??""),ae=a.filter(N=>pe.has(N));if(ae.length===0)continue;let L=qe(fe,O);if(!(!L||oe(L.symbol)))for(let N of ae)le(d,L,N,"source",g.relativePath,O)}}let h=Je(d),y=[...d.values()].map(g=>Se(g,h,r)).sort(R),b=kn(u.files,y,a),v=-1;for(let g of b){let z=be(n,g.relativePath),fe=z.filter(L=>!oe(L.symbol)),ne=Q(n,g.relativePath)?.callables??[],O=new Map,pe=L=>{let N=`${L.startLine}\0${L.endLine}\0${L.name}`,Y=O.get(N);if(Y)return Y;let G=Fn(g.relativePath,z,L,()=>v--);return G?(O.set(N,G),l.push(G),c.set(G.symbol,G),Ze(d,G,a),G):null};for(let L of ne){let N=T(L.name);a.some(Y=>N.has(Y))&&pe(L)}if(ne.length===0)continue;let ae=Re(g.text);for(let L=0;L<ae.length;L+=1){let N=T(ae[L]??""),Y=a.filter(Ce=>N.has(Ce));if(Y.length===0)continue;let G=$e(ne,L),ce=G?pe(G):null;if(!ce)continue;let Ne=en(fe,L);if(en(Ne?[Ne,ce]:[ce],L)?.symbol===ce.symbol)for(let Ce of Y)le(d,ce,Ce,"source",g.relativePath,L)}}let S=Je(d),M=new Map(u.files.map(g=>[g.relativePath,g.text.split(/\r?\n/u)]));for(let g of d.values()){let z=M.get(g.definition.relativePath);z&&(g.sourceCharacters=z.slice(g.definition.startLine,g.definition.endLine+1).join(`
|
|
2
|
-
`).length)}let f=[...d.values()].map(g=>Se(g,S,r)).sort(R),C=Math.min(f.length,Math.max(gn,o*bn)),A=t?f:re([...f.slice(0,C),...[...f].sort(Ee).slice(0,Math.max(Sn,C)),...mt(f,a),...dt(f,a,S)]),P=A.length,I=A.map(g=>c.get(g.symbol)).filter(g=>g?.isFunctionLike===!0),H=_n(l),F=On(n,s,A,I,c,H,new Set(d.keys()),i.semantic!==!1),B=$n(F,A,d,S,c),k=Xn(B,S,a),q=et(n,s,F,d,S,l,c,i.semantic!==!1),D=[...Kn(n,s,B,c,S,i.semantic!==!1),...k,...B,...q].map(g=>({...g,queryPathMatches:ht(g)})).sort((g,z)=>Z(g,z,S)),_=t?D:yt(D,o,S),p=a.filter(g=>S.has(g)),w=a.filter(g=>!S.has(g)),ee=Math.max(0,f.length-P),ye=Math.max(0,D.length-_.length)+ee,pn=t?f.length:Math.min(f.length,o+Ye);return{query:e,queryPathFragments:r,normalizedTerms:a,matchedTerms:p,unmatchedTerms:w,groups:_,candidateRoots:f,candidateRootCount:f.length,analyzedRootCount:P,omittedRootCount:ee,omittedGroupCount:ye,scannedFiles:u.files.length,scannedBytes:u.scannedBytes,recoveryCommand:ye===0?null:`scip-query anchors ${De(e)}${i.scope?` --scope ${De(i.scope)}`:""} --limit ${pn}`}}function En(n){let e=Le(n).filter(i=>!Ve.has(i.toLocaleLowerCase())).map(Oe).filter(i=>i.length>=3&&!Ve.has(i));return[...new Set(e)]}function Ze(n,e,i){let a=T(e.leaf),r=T(e.relativePath),o=T(e.documentation??"");for(let s of i)a.has(s)&&le(n,e,s,"symbol"),r.has(s)&&le(n,e,s,"path"),o.has(s)&&le(n,e,s,"documentation");let t=n.get(e.symbol);t&&(t.symbolPhraseLength=St(e.leaf,i))}function le(n,e,i,a,r,o){let t=n.get(e.symbol)??{definition:e,matches:new Map,symbolPhraseLength:0},s=t.matches.get(i)??{sources:new Set,locations:new Map};s.sources.add(a),r!==void 0&&o!==void 0&&s.locations.set(`${r}\0${o}`,{file:r,line:o}),t.matches.set(i,s),n.set(e.symbol,t)}function Je(n){let e=new Map;for(let i of n.values())for(let a of i.matches.keys())e.set(a,(e.get(a)??0)+1);return e}function Fn(n,e,i,a){let r=e[0]?.documentId;if(r===void 0||e.find(s=>s.isFunctionLike&&s.leaf===i.name&&s.startLine===i.startLine&&s.endLine===i.endLine))return null;let t=a();return{documentId:r,symbolId:t,symbol:`${_e}${n}:${i.startLine}:${i.endLine}:${i.name}`,relativePath:n,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:i.name,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}}function kn(n,e,i){let a=new Set(e.slice(0,Tn).map(t=>t.file)),r=new Set(i),o=n.map(t=>{let s=T(t.relativePath),m=t.relativePath.slice(t.relativePath.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),l=T(m),c=[...s].filter(u=>r.has(u)).length,d=[...l].filter(u=>r.has(u)).length;return{file:t,score:d*4+c}}).filter(t=>t.score>0).sort((t,s)=>s.score-t.score||x(U(t.file.relativePath))-x(U(s.file.relativePath))||t.file.relativePath.localeCompare(s.file.relativePath)).slice(0,Pn);for(let t of o)a.add(t.file.relativePath);return n.filter(t=>a.has(t.relativePath))}function _n(n){let e=new Map;for(let i of n){if(!$(i))continue;let a=`${i.relativePath}\0${E(i.leaf)}`,r=e.get(a)??[];r.push(i),e.set(a,r)}return e}function en(n,e){return n.filter(i=>i.startLine<=e&&i.endLine>=e).sort((i,a)=>i.endLine-i.startLine-(a.endLine-a.startLine)||Number($(a))-Number($(i))||i.startLine-a.startLine||i.symbol.localeCompare(a.symbol))[0]}function $(n){return n.symbol.startsWith(_e)}function W(n){return $(n)?n.leaf:te(n.symbol)}function Se(n,e,i=[]){let a=n.definition,r=[...n.matches.entries()].map(([l,c])=>({term:l,sources:[...c.sources].sort(vt),locations:[...c.locations.values()].sort(fn).slice(0,3)})).sort((l,c)=>l.term.localeCompare(c.term)),o=r.filter(l=>l.sources.some(c=>c!=="source")).map(l=>l.term),t=r.filter(l=>l.sources.includes("symbol")).map(l=>l.term),s=r.reduce((l,c)=>l+1/Math.max(1,e.get(c.term)??1),0),m=r.filter(l=>l.sources.includes("symbol")).reduce((l,c)=>l+1/Math.max(1,e.get(c.term)??1),0);return{symbol:a.symbol,label:W(a),leaf:a.leaf,file:a.relativePath,line:a.startLine,endLine:a.endLine,kind:a.isFunctionLike?"callable":a.isTypeLike?"type":"symbol",fileKind:U(a.relativePath),matches:r,focusLocations:Dt(n,e),matchedTerms:r.map(l=>l.term),symbolMatchedTerms:t,symbolPhraseLength:n.symbolPhraseLength,identityMatchedTerms:o,rarity:s,symbolRarity:m,queryPathMatches:gt(a.relativePath,i),...n.sourceCharacters===void 0?{}:{sourceCharacters:n.sourceCharacters}}}function On(n,e,i,a,r,o,t,s){let m=a.filter(b=>!$(b)),l=e.calleeMap(m,{additive:!1,semantic:s}),c=new Map,d=new Map;for(let b of i){let v=r.get(b.symbol),S=v?$(v)?nn(n,v,r,o,1):ve(n,v,l.get(v.symbolId)??[],r,1,t):[];c.set(b.symbol,S);for(let M of S){let f=r.get(M.toSymbol);f?.isFunctionLike&&(!v||!$(v)||$(f))&&d.set(f.symbol,f)}}let u=[...d.values()],h=e.calleeMap(u.filter(b=>!$(b)),{additive:!1,semantic:s}),y=new Map;for(let b of u)y.set(b.symbol,$(b)?nn(n,b,r,o,2):ve(n,b,h.get(b.symbolId)??[],r,2,t));return i.map(b=>{let v=c.get(b.symbol)??[],S=v.flatMap(f=>y.get(f.toSymbol)??[]),M=K([...v,...S]);return{root:b,relations:M,nodeSymbols:new Set([b.symbol,...M.flatMap(f=>[f.fromSymbol,f.toSymbol])])}})}function ve(n,e,i,a,r,o=new Set){let t=new Map;for(let s of i){let m=a.get(s.symbol);if(!m?.isFunctionLike||m.symbol===e.symbol||s.source==="ast-callsite"&&!Gn(n,e,m,s.callsiteLine))continue;let l=t.get(m.symbol);(!l||pt(s,l)<0)&&t.set(m.symbol,s)}return[...t.entries()].map(([s,m])=>{let l=a.get(s);return{kind:"call",fromSymbol:e.symbol,fromLabel:te(e.symbol),fromFile:e.relativePath,toSymbol:l.symbol,toLabel:te(l.symbol),toFile:l.relativePath,depth:r,strength:ke(m.source),evidence:m.source,callsiteLine:m.callsiteLine??Nn(n,e,l)}}).sort((s,m)=>Number(o.has(m.toSymbol))-Number(o.has(s.toSymbol))||X(s,m)).slice(0,vn)}function nn(n,e,i,a,r){let o=ge(n,e.relativePath,e.startLine,e.endLine).targets.flatMap(t=>{let s=i.get(t.definition.symbol)??t.definition;return!s.isFunctionLike||s.symbol===e.symbol?[]:[{kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:s.symbol,toLabel:W(s),toFile:s.relativePath,depth:r,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:t.sourceLine}]});for(let t of Pe(n,e.relativePath,{ranges:[{startLine:e.startLine,endLine:e.endLine}],excludeIndexedTargets:!1}).targets){let s=[...a.get(`${t.targetFile}\0${E(t.calleeLeaf)}`)??[],...be(n,t.targetFile).filter(m=>m.isFunctionLike&&E(m.leaf)===t.calleeLeaf)].find(m=>m.startLine===t.targetStartLine&&m.endLine===t.targetEndLine);!s||s.symbol===e.symbol||o.push({kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:s.symbol,toLabel:W(s),toFile:s.relativePath,depth:r,strength:t.strength==="exact"?"exact":"derived",evidence:"ast-member-import-candidate",callsiteLine:t.line})}for(let t of Q(n,e.relativePath)?.callSites??[]){if(t.line<e.startLine||t.line>e.endLine||t.memberAccess)continue;let s=(a.get(`${e.relativePath}\0${E(t.calleeLeaf)}`)??[]).filter(l=>l.symbol!==e.symbol);if(s.length!==1)continue;let m=s[0];o.push({kind:"call",fromSymbol:e.symbol,fromLabel:W(e),fromFile:e.relativePath,toSymbol:m.symbol,toLabel:W(m),toFile:m.relativePath,depth:r,strength:"derived",evidence:"ast-callsite",callsiteLine:t.line})}return K(o).sort(X)}function Nn(n,e,i){let a=E(i.leaf);return Q(n,e.relativePath)?.callSites.find(r=>r.line>=e.startLine&&r.line<=e.endLine&&E(r.calleeLeaf)===a)?.line??null}function Gn(n,e,i,a){if(a===void 0)return!1;let r=E(i.leaf);return Q(n,e.relativePath)?.callSites.some(o=>{if(o.line!==a)return!1;if(E(o.calleeLeaf)===r)return!0;let t=Xe(n,e.relativePath,o.calleeLeaf);return t!==null&&E(t.importedName)===r&&Ge(t.sourcePath,i.relativePath)})??!1}function $n(n,e,i,a,r){let o=new Map(e.map((c,d)=>[c.symbol,d])),t=e.map((c,d)=>d),s=c=>{let d=c;for(;t[d]!==d;)d=t[d];for(;t[c]!==c;){let u=t[c];t[c]=d,c=u}return d},m=(c,d)=>{let u=s(c),h=s(d);u!==h&&(t[h]=u)};for(let c of n){let d=o.get(c.root.symbol);if(d!==void 0)for(let u of c.nodeSymbols){let h=o.get(u);h!==void 0&&m(d,h)}}let l=new Map;for(let c=0;c<e.length;c+=1){let d=s(c),u=l.get(d)??[];u.push(e[c]),l.set(d,u)}return[...l.values()].map((c,d)=>{let u=new Set(c.map(f=>f.symbol)),h=K(n.filter(f=>u.has(f.root.symbol)).flatMap(f=>f.relations)).sort(X),y=new Map(c.map(f=>[f.symbol,f]));for(let f of new Set(h.flatMap(C=>[C.fromSymbol,C.toSymbol]))){let C=i.get(f);if(C)y.has(f)||y.set(f,Se(C,a));else{let A=r.get(f);A&&y.set(f,hn(A))}}let b=at(c,h,y),v=c.filter(f=>h.some(C=>C.fromSymbol===f.symbol)).length,S=[...new Set(c.flatMap(f=>f.matchedTerms))].sort(),M=it(h,b,u,y);return{id:`anchor-set:${d+1}:${de(c[0])}`,kind:"connected-flow",roots:[...c].sort(R),keyAnchors:b,candidateOwnerCount:b.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[],matchedTerms:S,relations:M,relationCount:h.length,orchestrationRootCount:v,omittedRelations:Math.max(0,h.length-J),systemMapCommand:he(b,h,S)}})}function Xn(n,e,i){let a=new Map(i.map((o,t)=>[o,t])),r=[];for(let o=0;o<n.length;o+=1){let t=n[o],s=tn(t);if(s.size!==0)for(let m=o+1;m<n.length;m+=1){let l=n[m],c=tn(l),d=[...s].filter(A=>c.has(A));if(d.length===0||![...s].some(A=>!c.has(A))||![...c].some(A=>!s.has(A)))continue;let u=qn(t,l);if(u.length<2)continue;let h=K([...t.relations,...l.relations]).sort(X),y=h.slice(0,J),b=re([...t.roots,...l.roots]).sort(R),v=[...new Set([...t.matchedTerms,...l.matchedTerms])].sort(),S=d.sort((A,P)=>(a.get(A)??Number.MAX_SAFE_INTEGER)-(a.get(P)??Number.MAX_SAFE_INTEGER)||A.localeCompare(P)),M=+(t.relationCount>0)+ +(l.relationCount>0),f=+((t.orchestrationRootCount??0)>0)+ +((l.orchestrationRootCount??0)>0),C=Math.min(...S.map(A=>e.get(A)??Number.MAX_SAFE_INTEGER));r.push({sharedOrder:Math.min(...S.map(A=>a.get(A)??Number.MAX_SAFE_INTEGER)),sharedFrequency:C,connectedSides:M,orchestrationSides:f,group:{id:`parallel-paths:${de(t.roots[0])}:${de(l.roots[0])}`,kind:"parallel-paths",roots:b,keyAnchors:u,candidateOwnerCount:u.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:[...t.upstreamEntries,...l.upstreamEntries],matchedTerms:v,relations:y,relationCount:h.length,parallelConnectedSides:M,parallelOrchestrationSides:f,parallelSharedPathTerms:S,parallelSharedPathFrequency:C,orchestrationRootCount:(t.orchestrationRootCount??0)+(l.orchestrationRootCount??0),omittedRelations:Math.max(0,h.length-y.length),systemMapCommand:he(u,h,v)}})}}return r.sort((o,t)=>o.sharedFrequency-t.sharedFrequency||t.orchestrationSides-o.orchestrationSides||t.connectedSides-o.connectedSides||o.sharedOrder-t.sharedOrder||t.group.matchedTerms.length-o.group.matchedTerms.length||Z(o.group,t.group,e)).slice(0,wn).map(o=>o.group)}function tn(n){return new Set(n.roots.flatMap(e=>e.matches.filter(i=>i.sources.includes("path")).map(i=>i.term)))}function qn(n,e){return re([on(n),on(e)].filter(i=>i!==void 0))}function on(n){let e=new Set(n.keyAnchors.map(a=>a.symbol)),i=new Map;for(let a of n.relations)!e.has(a.fromSymbol)||!e.has(a.toSymbol)||i.set(a.fromSymbol,(i.get(a.fromSymbol)??0)+1);return[...n.keyAnchors].sort((a,r)=>+((i.get(r.symbol)??0)>0)-+((i.get(a.symbol)??0)>0)||rn(r)-rn(a)||r.identityMatchedTerms.length-a.identityMatchedTerms.length||r.symbolMatchedTerms.length-a.symbolMatchedTerms.length||(i.get(r.symbol)??0)-(i.get(a.symbol)??0)||R(a,r))[0]}function rn(n){return n.matchedTerms.length+n.identityMatchedTerms.length*2+(n.queryPathMatches?.length??0)*4}function Kn(n,e,i,a,r,o){let t=We(n);if(!t||t.links.length===0||i.length<2)return[];let s=new Map(t.observations.map(h=>[h.id,h])),m=new Map,l=new Map,c=[...i].sort((h,y)=>Z(h,y,r)).slice(0,Dn),d=t.links.filter(h=>h.strength!=="candidate").sort((h,y)=>j(y.strength)-j(h.strength)||y.matchedKeyParts.length-h.matchedKeyParts.length||h.id.localeCompare(y.id));for(let h of c)for(let y of d){let b=s.get(y.from),v=s.get(y.to);if(!b||!v||!Bn(h,b,a))continue;let S=zn(h,b,a);if(!S)continue;let M=m.get(v.id)??jn(n,e,v,a,o,Cn);if(m.set(v.id,M),M.reachedSymbols.size===0)continue;let f=i.filter(D=>D.id!==h.id&&Un(D).some(_=>M.reachedSymbols.has(_))&&xe(S,D)>=2).sort((D,_)=>xe(S,_)-xe(S,D)||Z(D,_,r)).slice(0,Ln);if(f.length===0)continue;let C=[h.id,b.id,...f.map(D=>D.id).sort()].join("\0");if(l.has(C))continue;let A=new Set(f.flatMap(ue)),P=Zn(me(v),A,M.relations);if(P.length===0)continue;let I=Vn(b,v,y.joinRule,y.matchedKeyParts,y.strength),H=K([I,...M.relations,...h.relations,...f.flatMap(D=>D.relations)]),F=Jn([I,...P],H,h,f),B=re([S,...f.flatMap(D=>D.roots)]).sort(R),k=re([S,...f.flatMap(D=>D.keyAnchors)]).slice(0,Rn),q=[...new Set([...S.matchedTerms,...f.flatMap(D=>D.matchedTerms)])].sort(),ie=Wn(n,e,S,a,o);B.length===0||k.length<2||l.set(C,{id:`cross-boundary-set:${de(S)}:${l.size+1}`,kind:"cross-boundary-flow",roots:B,keyAnchors:k,candidateOwnerCount:k.length,omittedCandidateOwners:[],ownerRecoveryCommands:[],upstreamEntries:ie,matchedTerms:q,relations:F,relationCount:H.length,omittedRelations:Math.max(0,H.length-F.length),systemMapCommand:he(k,H,q)})}let u=new Map;for(let[h,y]of l){let b=h.slice(0,h.indexOf("\0")),v=u.get(b);(!v||Z(y,v,r)<0)&&u.set(b,y)}return[...u.values()]}function Bn(n,e,i){let a=new Set(ue(n));return e.owner.symbol&&a.has(e.owner.symbol)?!0:[...a].map(r=>i.get(r)).some(r=>r?.relativePath===e.source.file&&r.startLine<=e.source.startLine&&r.endLine>=e.source.endLine)}function zn(n,e,i){let a=re([...n.roots,...n.keyAnchors]);if(e.owner.symbol){let r=a.find(o=>o.symbol===e.owner.symbol);if(r)return r}return a.find(r=>{let o=i.get(r.symbol);return o?.relativePath===e.source.file&&o.startLine<=e.source.startLine&&o.endLine>=e.source.endLine})??null}function ue(n){return[...new Set([...n.roots.map(e=>e.symbol),...n.keyAnchors.map(e=>e.symbol),...n.relations.flatMap(e=>[e.fromSymbol,e.toSymbol])])]}function Un(n){return[...new Set([...n.roots,...n.keyAnchors].map(e=>e.symbol))]}function xe(n,e){let i=T(n.leaf),a=[...e.roots,...e.keyAnchors].map(o=>T(o.leaf)),r=0;for(let o of a){let t=0;for(let s of i)o.has(s)&&(t+=1);r=Math.max(r,t)}return r}function Wn(n,e,i,a,r){let o=a.get(i.symbol);if(!o?.isFunctionLike)return[];let t=e.callerFileMap([o],{semantic:r,sourceFallback:!0}).get(o.symbolId);if(!t)return[];let s=T(i.leaf);return[...t].filter(m=>m!==i.file&&U(m)!=="test").flatMap(m=>{let l=Q(n,m);return(l?.callSites??[]).filter(c=>E(c.calleeLeaf)===E(i.leaf)).flatMap(c=>{let d=(l?.callables??[]).filter(h=>h.startLine<=c.line&&h.endLine>=c.line).sort((h,y)=>h.endLine-h.startLine-(y.endLine-y.startLine)||h.startLine-y.startLine)[0];if(!d)return[];let u=[...T(d.name)].filter(h=>s.has(h)).length;return u>=2?[{name:d.name,file:m,line:d.startLine,endLine:d.endLine,callsiteLine:c.line,overlap:u}]:[]})}).sort((m,l)=>l.overlap-m.overlap||m.file.localeCompare(l.file)||m.line-l.line).slice(0,1).map(({name:m,file:l,line:c,endLine:d,callsiteLine:u})=>({name:m,file:l,line:c,endLine:d,callsiteLine:u}))}function jn(n,e,i,a,r,o){let t=Hn(n,i,a),s=t.map(({definition:u,evidence:h,line:y})=>({kind:"call",fromSymbol:me(i),fromLabel:Ae(i),fromFile:i.source.file,toSymbol:u.symbol,toLabel:te(u.symbol),toFile:u.relativePath,depth:1,strength:h==="scip-occurrence-callsite"?"exact":"derived",evidence:h,callsiteLine:y})),m=Yn(n,i);s.push(...m.relations);let l=un([...t.map(u=>u.definition),...m.definitions]),c=l,d=new Set(c.map(u=>u.symbol));for(let u=2;u<=o+1&&c.length>0;u+=1){let h=e.calleeMap(c,{additive:!1,semantic:r}),y=new Map;for(let b of c){let v=ve(n,b,h.get(b.symbolId)??[],a,u);s.push(...v);for(let S of v){let M=a.get(S.toSymbol);M?.isFunctionLike&&!d.has(M.symbol)&&y.set(M.symbol,M)}}c=[...y.values()];for(let b of c)d.add(b.symbol)}return{entryDefinitions:l,relations:K(s),reachedSymbols:new Set([...l.map(u=>u.symbol),...s.flatMap(u=>[u.fromSymbol,u.toSymbol])])}}function Hn(n,e,i){let a=e.owner.symbol?i.get(e.owner.symbol):void 0;if(a?.isFunctionLike&&!oe(a.symbol))return[{definition:a,evidence:"scip-occurrence-callsite",line:e.source.startLine}];let r=we(n,e.source.file),o=Te(n,e.source.file,0,Math.max(0,r.length-1),[e.source.startLine]),t=ge(n,e.source.file,o.startLine,o.endLine).targets.map(c=>({definition:c.definition,evidence:"scip-occurrence-callsite",line:c.sourceLine})),s=Q(n,e.source.file),m=ze(n),l=(s?.callSites??[]).flatMap(c=>{if(c.line<o.startLine||c.line>o.endLine)return[];let d=Ke(e.source.file,m.get(c.calleeLeaf)??[]),u=Be(n,e.source.file,d,c.memberAccess,c.calleeQualifier),h=u?i.get(u.symbol):void 0;return h?.isFunctionLike?[{definition:h,evidence:"ast-callsite",line:c.line}]:[]});return Qn([...t,...l])}function Yn(n,e){let i=we(n,e.source.file),a=Te(n,e.source.file,0,Math.max(0,i.length-1),[e.source.startLine]),r=Pe(n,e.source.file,{ranges:[a],excludeIndexedTargets:!1}).targets,o=[],t=[];for(let s of r){let m=`source-construct:${s.targetFile}:${s.targetStartLine}:${s.targetEndLine}:${s.calleeLeaf}`;t.push({kind:"call",fromSymbol:me(e),fromLabel:Ae(e),fromFile:e.source.file,toSymbol:m,toLabel:s.calleeLeaf,toFile:s.targetFile,depth:1,strength:"derived",evidence:"ast-member-import-candidate",callsiteLine:s.line});let l=ge(n,s.targetFile,s.targetStartLine,s.targetEndLine).targets;for(let c of l)o.push(c.definition),t.push({kind:"call",fromSymbol:m,fromLabel:s.calleeLeaf,fromFile:s.targetFile,toSymbol:c.definition.symbol,toLabel:te(c.definition.symbol),toFile:c.definition.relativePath,depth:2,strength:"exact",evidence:"scip-occurrence-callsite",callsiteLine:c.sourceLine})}return{definitions:un(o),relations:K(t)}}function Qn(n){return[...new Map(n.map(e=>[e.definition.symbol,e])).values()]}function un(n){return[...new Map(n.map(e=>[e.symbol,e])).values()]}function me(n){return n.owner.symbol??n.id}function Ae(n){return n.owner.name??`${n.source.file}:${n.source.startLine+1}`}function Vn(n,e,i,a,r){return{kind:"runtime-boundary",fromSymbol:me(n),fromLabel:Ae(n),fromFile:n.source.file,toSymbol:me(e),toLabel:Ae(e),toFile:e.source.file,depth:1,strength:r,evidence:`runtime-boundary:${i}`,callsiteLine:n.source.startLine,runtimeBoundaryKey:a.map(o=>`${o.name}=${o.value}`).join(" ")}}function Zn(n,e,i){let a=new Map;for(let t of i){let s=a.get(t.fromSymbol)??[];s.push(t),a.set(t.fromSymbol,s)}let r=[{symbol:n,path:[]}],o=new Set([n]);for(;r.length>0;){let t=r.shift();if(t.path.length>0&&e.has(t.symbol))return t.path;for(let s of(a.get(t.symbol)??[]).sort(X))o.has(s.toSymbol)||(o.add(s.toSymbol),r.push({symbol:s.toSymbol,path:[...t.path,s]}))}return[]}function Jn(n,e,i,a){let r=K(n),o=new Set([i,...a].flatMap(t=>[...ue(t),...t.keyAnchors.map(s=>s.symbol)]));for(let t of e){if(r.length>=J)break;!o.has(t.fromSymbol)&&!o.has(t.toSymbol)||r.some(s=>s.fromSymbol===t.fromSymbol&&s.toSymbol===t.toSymbol)||r.push(t)}return r.slice(0,J)}function et(n,e,i,a,r,o,t,s){let m=i.filter(c=>!c.root.symbol.startsWith(_e)).map(c=>({root:c.root,relations:c.relations.filter(d=>d.depth===1&&d.fromSymbol===c.root.symbol)}));return nt(m).flatMap((c,d)=>{let u=new Set(c.map(p=>p.root.symbol)),h=new Map;for(let p of c)for(let w of new Set(p.relations.map(ee=>ee.toSymbol)))h.set(w,(h.get(w)??0)+1);let y=[...h].filter(([,p])=>p>=2).sort(([p,w],[ee,ye])=>ye-w||tt(p,ee,a,r,t)).map(([p])=>t.get(p)).filter(p=>p?.isFunctionLike===!0).slice(0,An);if(y.length===0)return[];let b=e.callerFileMap(y,{semantic:s,sourceFallback:!0}),v=new Set;for(let p of y){v.add(p.relativePath);for(let w of b.get(p.symbolId)??[])v.add(w)}let S=o.filter(p=>p.isFunctionLike&&v.has(p.relativePath)).sort(ot).slice(0,Mn),M=e.calleeMap(S,{additive:!1,semantic:s}),f=new Set(y.map(p=>p.symbol)),C=K(S.flatMap(p=>ve(n,p,M.get(p.symbolId)??[],t,1,f).filter(w=>f.has(w.toSymbol)))),A=new Map;for(let p of C){let w=A.get(p.fromSymbol)??new Set;w.add(p.toSymbol),A.set(p.fromSymbol,w)}let P=new Set([...A].filter(([p,w])=>w.size>=2||u.has(p)).map(([p])=>p)),I=C.filter(p=>P.has(p.fromSymbol));if(P.size<2||I.length===0)return[];let F=[...new Set(I.map(p=>p.toSymbol))].map(p=>Me(p,a,r,t)).filter(p=>p!==null).sort(R),B=[...P].map(p=>Me(p,a,r,t)).filter(p=>p!==null),k=rt(B,I),q=k.slice(0,Ie),ie=k.slice(Ie);if(F.length===0||q.length===0)return[];let D=[...new Set([...F.flatMap(p=>p.matchedTerms),...c.flatMap(p=>p.root.matchedTerms)])].sort(),_=st(I,q);return[{id:`effect-owner-set:${d+1}:${de(F[0])}`,kind:"shared-callee-owners",roots:F,keyAnchors:q,candidateOwnerCount:k.length,omittedCandidateOwners:ie,ownerRecoveryCommands:Lt(ie,Ie),upstreamEntries:[],matchedTerms:D,relations:_,relationCount:I.length,omittedRelations:Math.max(0,I.length-_.length),systemMapCommand:he(q,I,D)}]})}function nt(n){let e=n.map((t,s)=>s),i=t=>{for(;e[t]!==t;)e[t]=e[e[t]],t=e[t];return t},a=(t,s)=>{let m=i(t),l=i(s);m!==l&&(e[l]=m)},r=n.map(t=>new Set(t.relations.map(s=>s.toSymbol)));for(let t=0;t<n.length;t+=1)for(let s=t+1;s<n.length;s+=1){let m=0;for(let l of r[t]??[])if((r[s]??new Set).has(l)&&(m+=1),m>=2)break;m>=2&&a(t,s)}let o=new Map;for(let t=0;t<n.length;t+=1){let s=i(t),m=o.get(s)??[];m.push(n[t]),o.set(s,m)}return[...o.values()].filter(t=>t.length>=2)}function tt(n,e,i,a,r){let o=Me(n,i,a,r),t=Me(e,i,a,r);return o?t?R(o,t):-1:t?1:n.localeCompare(e)}function ot(n,e){return x(U(n.relativePath))-x(U(e.relativePath))||n.relativePath.localeCompare(e.relativePath)||n.startLine-e.startLine}function Me(n,e,i,a){let r=e.get(n);if(r)return Se(r,i);let o=a.get(n);return o?hn(o):null}function rt(n,e){let i=new Map;for(let r of e){let o=i.get(r.toSymbol)??new Set;o.add(r.fromSymbol),i.set(r.toSymbol,o)}let a=new Map;for(let r of e){let o=i.get(r.toSymbol)?.size??1;a.set(r.fromSymbol,(a.get(r.fromSymbol)??0)+o*o)}return[...n].sort((r,o)=>Number(r.leaf.startsWith("#"))-Number(o.leaf.startsWith("#"))||o.identityMatchedTerms.length-r.identityMatchedTerms.length||(a.get(o.symbol)??0)-(a.get(r.symbol)??0)||R(r,o))}function st(n,e){let i=new Map(e.map((t,s)=>[t.symbol,s])),a=e.map(t=>n.filter(s=>s.fromSymbol===t.symbol).sort(X)),r=[],o=0;for(;r.length<J&&a.some(t=>o<t.length);){for(let t of a){let s=t[o];if(s&&r.push(s),r.length>=J)break}o+=1}return r.sort((t,s)=>i.get(t.fromSymbol)-i.get(s.fromSymbol)||X(t,s))}function it(n,e,i,a){let r=new Map(e.map((s,m)=>[s.symbol,m])),o=new Map;for(let s of n)o.set(s.fromSymbol,(o.get(s.fromSymbol)??0)+1);return[...n].sort((s,m)=>{let l=c=>{let d=0;return r.has(c.fromSymbol)&&(d+=100),i.has(c.toSymbol)&&(d+=60),d+=Math.min(40,(o.get(c.toSymbol)??0)*8),(a.get(c.toSymbol)?.matchedTerms.length??0)>0&&(d+=25),c.fromFile!==c.toFile&&(d+=15),c.strength==="exact"&&(d+=5),d};return l(m)-l(s)||X(s,m)}).slice(0,J).sort((s,m)=>(r.get(s.fromSymbol)??V)-(r.get(m.fromSymbol)??V)||s.depth-m.depth||(s.callsiteLine??Number.MAX_SAFE_INTEGER)-(m.callsiteLine??Number.MAX_SAFE_INTEGER)||X(s,m))}function hn(n){return{symbol:n.symbol,label:W(n),leaf:n.leaf,file:n.relativePath,line:n.startLine,endLine:n.endLine,kind:n.isFunctionLike?"callable":n.isTypeLike?"type":"symbol",fileKind:U(n.relativePath),matches:[],focusLocations:[],matchedTerms:[],symbolMatchedTerms:[],symbolPhraseLength:0,identityMatchedTerms:[],rarity:0,symbolRarity:0}}function at(n,e,i){let a=[...n].sort(R),r=[],o=new Map;for(let c of e)o.set(c.fromSymbol,(o.get(c.fromSymbol)??0)+1);let t=new Set,s=new Set,m=c=>{if(!(!c||r.some(d=>d.symbol===c.symbol))){r.push(c);for(let d of c.matchedTerms)t.add(d);for(let d of c.symbolMatchedTerms)s.add(d)}},l=a.filter(c=>c.symbolPhraseLength>=2&&(o.get(c.symbol)??0)>=2);for(;r.length<Math.min(2,V);){let c=l.filter(d=>!r.some(u=>u.symbol===d.symbol)).sort((d,u)=>u.symbolMatchedTerms.filter(h=>!s.has(h)).length-d.symbolMatchedTerms.filter(h=>!s.has(h)).length||u.symbolPhraseLength-d.symbolPhraseLength||(o.get(u.symbol)??0)-(o.get(d.symbol)??0)||Ee(d,u))[0];if(!c||r.length>0&&c.symbolMatchedTerms.every(d=>s.has(d)))break;m(c)}if(m(a[0]),r.length>=2){let c=ct(r[0].symbol,r[1].symbol,e,i);for(let d of c?.slice(1,-1)??[]){if(r.length>=V)break;m(i.get(d))}if(r.length<V){let d=new Set(r.map(y=>y.symbol)),u=new Set(e.filter(y=>y.depth===1&&d.has(y.fromSymbol)&&d.has(y.toSymbol)).map(y=>y.fromSymbol)),h=e.filter(y=>y.depth===1&&u.has(y.fromSymbol)&&!d.has(y.toSymbol)).map(y=>({relation:y,candidate:i.get(y.toSymbol)})).filter(y=>y.candidate!==void 0&&y.candidate.symbolPhraseLength>=2&&y.candidate.symbolMatchedTerms.length>=2).sort((y,b)=>(o.get(y.relation.fromSymbol)??0)-(o.get(b.relation.fromSymbol)??0)||Ee(y.candidate,b.candidate))[0]?.candidate;m(h)}}else for(;r.length<Math.min(3,V);){let c=a.filter(d=>!r.some(u=>u.symbol===d.symbol)).sort((d,u)=>u.matchedTerms.filter(h=>!t.has(h)).length-d.matchedTerms.filter(h=>!t.has(h)).length||R(d,u))[0];if(!c||c.matchedTerms.every(d=>t.has(d)))break;m(c)}for(;r.length>=2&&r.length<V;){let c=new Set(r.map(u=>u.symbol)),d=[...i.values()].filter(u=>!c.has(u.symbol)&&(o.get(u.symbol)??0)>0&&e.some(h=>c.has(h.fromSymbol)&&h.toSymbol===u.symbol)).sort((u,h)=>h.identityMatchedTerms.length-u.identityMatchedTerms.length||h.symbolMatchedTerms.length-u.symbolMatchedTerms.length||h.matchedTerms.length-u.matchedTerms.length||(o.get(h.symbol)??0)-(o.get(u.symbol)??0)||R(u,h))[0];if(!d)break;m(d)}if(r.length<2){let c=r[0],d=c?a.filter(u=>u.symbol!==c.symbol).map(u=>({root:u,path:lt(u.symbol,c.symbol,e)})).filter(u=>u.path!==null).sort((u,h)=>+(h.root.file!==c.file)-+(u.root.file!==c.file)||u.path.length-h.path.length||R(u.root,h.root))[0]?.root:void 0;m(d)}return r}function ct(n,e,i,a){let r=new Map;for(let s of i){let m=r.get(s.fromSymbol)??new Set;m.add(s.toSymbol),r.set(s.fromSymbol,m);let l=r.get(s.toSymbol)??new Set;l.add(s.fromSymbol),r.set(s.toSymbol,l)}let o=[{path:[n],cost:0}],t=new Map([[n,0]]);for(;o.length>0;){o.sort((c,d)=>c.cost-d.cost||c.path.length-d.path.length);let{path:s,cost:m}=o.shift(),l=s.at(-1);if(l===e)return s;for(let c of r.get(l)??[]){let d=a.get(c),u=c===e?1:!d||d.matchedTerms.length===0?9:d.symbolPhraseLength>=2?1:d.identityMatchedTerms.length>=2?2:4,h=m+u;h>=(t.get(c)??Number.POSITIVE_INFINITY)||(t.set(c,h),o.push({path:[...s,c],cost:h}))}}return null}function lt(n,e,i){let a=new Map;for(let t of i){let s=a.get(t.fromSymbol)??[];s.push(t.toSymbol),a.set(t.fromSymbol,s)}let r=[[n]],o=new Set([n]);for(;r.length>0;){let t=r.shift(),s=t.at(-1);if(s===e)return t;for(let m of a.get(s)??[])o.has(m)||(o.add(m),r.push([...t,m]))}return null}function R(n,e){return(e.queryPathMatches?.length??0)-(n.queryPathMatches?.length??0)||e.identityMatchedTerms.length-n.identityMatchedTerms.length||e.matchedTerms.length-n.matchedTerms.length||e.rarity-n.rarity||se(n.kind)-se(e.kind)||x(n.fileKind)-x(e.fileKind)||n.file.localeCompare(e.file)||n.line-e.line}function Ee(n,e){return e.symbolPhraseLength-n.symbolPhraseLength||e.symbolMatchedTerms.length-n.symbolMatchedTerms.length||se(n.kind)-se(e.kind)||e.symbolRarity-n.symbolRarity||R(n,e)}function mt(n,e){return e.flatMap(i=>{let a=n.filter(t=>t.matchedTerms.includes(i)).sort((t,s)=>ut(t,s,i)),r=[],o=new Set;for(let t of a)if(!o.has(t.file)&&(r.push(t),o.add(t.file),r.length>=Qe))return r;for(let t of a)if(!r.some(s=>s.symbol===t.symbol)&&(r.push(t),r.length>=Qe))break;return r})}function dt(n,e,i){let a=new Set(e),r=new Map;for(let o of n){if(o.kind!=="callable")continue;let t=o.file.slice(o.file.lastIndexOf("/")+1).replace(/\.[^.]+$/u,"");if(![...T(t)].some(m=>a.has(m)))continue;let s=r.get(o.file)??[];s.push(o),r.set(o.file,s)}return[...r.entries()].map(([o,t])=>{let s=o.slice(o.lastIndexOf("/")+1).replace(/\.[^.]+$/u,""),m=[...T(s)].filter(l=>a.has(l));return{file:o,fileCandidates:t,sharedFrequency:Math.min(...m.map(l=>i.get(l)??Number.MAX_SAFE_INTEGER))}}).sort((o,t)=>x(o.fileCandidates[0].fileKind)-x(t.fileCandidates[0].fileKind)||o.sharedFrequency-t.sharedFrequency||o.file.localeCompare(t.file)).flatMap(({fileCandidates:o})=>[...o].sort(R).slice(0,xn)).slice(0,In)}function ut(n,e,i){return sn(n,i)-sn(e,i)||x(n.fileKind)-x(e.fileKind)||e.symbolPhraseLength-n.symbolPhraseLength||se(n.kind)-se(e.kind)||R(n,e)}function sn(n,e){let i=n.matches.find(a=>a.term===e)?.sources??[];return Math.min(...i.map(Fe),Number.MAX_SAFE_INTEGER)}function re(n){return[...new Map(n.map(e=>[e.symbol,e])).values()]}function Z(n,e,i){let a=new Set(n.roots.flatMap(o=>o.symbolMatchedTerms)),r=new Set(e.roots.flatMap(o=>o.symbolMatchedTerms));return(e.queryPathMatches?.length??0)-(n.queryPathMatches?.length??0)||mn(n.kind)-mn(e.kind)||cn(n)-cn(e)||ln(n)-ln(e)||(n.kind==="parallel-paths"&&e.kind==="parallel-paths"?(n.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)-(e.parallelSharedPathFrequency??Number.MAX_SAFE_INTEGER)||(e.parallelOrchestrationSides??0)-(n.parallelOrchestrationSides??0)||(e.parallelSharedPathTerms?.length??0)-(n.parallelSharedPathTerms?.length??0):0)||an(e,i)-an(n,i)||e.matchedTerms.length-n.matchedTerms.length||Math.max(...e.roots.map(o=>o.symbolPhraseLength))-Math.max(...n.roots.map(o=>o.symbolPhraseLength))||r.size-a.size||R(n.roots[0],e.roots[0])||e.roots.length-n.roots.length||n.relationCount-e.relationCount||n.id.localeCompare(e.id)}function an(n,e){return n.matchedTerms.reduce((i,a)=>i+1/Math.max(1,e.get(a)??1),0)}function ht(n){return[...new Set(n.roots.flatMap(e=>e.queryPathMatches??[]))].sort()}function cn(n){let e=n.keyAnchors.length>0?n.keyAnchors:n.roots;return Math.max(...e.map(i=>x(i.fileKind)))}function ln(n){return n.kind==="parallel-paths"?2-(n.parallelConnectedSides??0):n.kind!=="connected-flow"||n.relationCount>0?0:1}function yt(n,e,i){let a=n.slice(0,e);if(e<2||a.some(o=>o.kind==="shared-callee-owners"))return a;let r=n.filter(o=>o.kind==="shared-callee-owners");for(let o of a){if(o.kind==="shared-callee-owners"||o.kind==="parallel-paths")continue;let t=new Set(ue(o)),s=r.map(l=>({group:l,overlap:ft(l,t)})).filter(({overlap:l})=>l>0).sort(({group:l,overlap:c},{group:d,overlap:u})=>u-c||Z(l,d,i))[0]?.group;if(!s)continue;let m=a.length-1;for(;m>=0&&a[m]===o;)m-=1;return m<0?a:(a[m]=s,[...a].sort((l,c)=>Z(l,c,i)))}return a}function ft(n,e){return ue(n).filter(i=>e.has(i)).length}function mn(n){switch(n){case"cross-boundary-flow":return 0;case"parallel-paths":case"connected-flow":return 1;case"shared-callee-owners":return 2}}function X(n,e){return n.depth-e.depth||j(e.strength)-j(n.strength)||n.fromLabel.localeCompare(e.fromLabel)||n.toLabel.localeCompare(e.toLabel)||(n.callsiteLine??Number.MAX_SAFE_INTEGER)-(e.callsiteLine??Number.MAX_SAFE_INTEGER)}function pt(n,e){return j(ke(e.source))-j(ke(n.source))||(n.callsiteLine??Number.MAX_SAFE_INTEGER)-(e.callsiteLine??Number.MAX_SAFE_INTEGER)||n.symbol.localeCompare(e.symbol)}function K(n){let e=new Map;for(let i of n){let a=`${i.fromSymbol}\0${i.toSymbol}`,r=e.get(a);(!r||X(i,r)<0)&&e.set(a,i)}return[...e.values()]}function Le(n){return n.replace(/([\p{Ll}\d])([\p{Lu}])/gu,"$1 $2").replace(/([\p{Lu}]+)([\p{Lu}][\p{Ll}])/gu,"$1 $2").match(/[\p{L}\d]+/gu)??[]}function bt(n){let e=n.match(/[\p{L}\d_.-]+(?:\/[\p{L}\d_.-]+)+/gu)??[];return[...new Set(e.map(i=>i.replace(/[.;:!?]+$/gu,"").toLocaleLowerCase()))]}function gt(n,e){let i=n.replace(/\\/gu,"/").toLocaleLowerCase();return e.filter(a=>{let r=i.indexOf(a);if(r<0)return!1;let o=r===0?"/":i[r-1],t=i[r+a.length];return o==="/"&&(t===void 0||t==="/")})}function St(n,e){let i=Le(n).map(Oe),a=0;for(let r=0;r<i.length;r+=1)for(let o=0;o<e.length;o+=1){let t=0;for(;r+t<i.length&&o+t<e.length&&i[r+t]===e[o+t];)t+=1;a=Math.max(a,t)}return a}function T(n){return new Set(Le(n).flatMap(yn).filter(e=>e.length>=3))}function yn(n){let e=Oe(n);return e.length>4&&e.endsWith("e")?[e,e.slice(0,-1)]:[e]}function Oe(n){let e=n.toLocaleLowerCase();return e.length>5&&e.endsWith("ies")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("ied")?`${e.slice(0,-3)}y`:e.length>4&&e.endsWith("ed")?dn(e.slice(0,-2)):e.length>5&&e.endsWith("ing")?dn(e.slice(0,-3)):e.length>4&&e.endsWith("ers")||e.length>3&&e.endsWith("s")&&!e.endsWith("ss")?e.slice(0,-1):e}function dn(n){if(n.length<2)return n;let e=n.at(-1),i=n.at(-2);return e===i&&!"aeiou".includes(e)?n.slice(0,-1):n}function vt(n,e){return Fe(n)-Fe(e)}function Fe(n){switch(n){case"symbol":return 0;case"path":return 1;case"documentation":return 2;case"source":return 3}}function se(n){return n==="callable"?0:n==="type"?1:2}function ke(n){return n==="semantic-callee"||n==="scip-chunk"?"exact":"derived"}function j(n){return n==="exact"?2:1}function fn(n,e){return n.file.localeCompare(e.file)||n.line-e.line}function de(n){return`${n.file}:${n.line+1}`}function he(n,e=[],i=[]){let a=n.map(t=>`--symbol ${De(`${t.file}:${t.line+1}-${t.endLine+1}`)}`),r=new Set(n.map(t=>t.symbol)),o=n.flatMap(t=>(t.sourceCharacters??0)>He?At(t,e,i,r).map(s=>`--focus-at ${De(`${s.file}:${s.line+1}`)}`):[]);return`scip-query system-map ${[...a,...o,"--relation call","--relation runtime-boundary"].join(" ")}`}function At(n,e,i,a){let r=new Set(i),o=e.filter(l=>l.fromSymbol===n.symbol&&l.callsiteLine!==null&&l.callsiteLine>=n.line&&l.callsiteLine<=n.endLine).map(l=>({file:n.file,line:l.callsiteLine,connectsAnchor:a.has(l.toSymbol),overlap:new Set(Le(Mt(l.toLabel)).flatMap(yn).filter(c=>r.has(c))).size,strength:l.strength})).filter(l=>l.overlap>0).sort((l,c)=>Number(c.connectsAnchor)-Number(l.connectsAnchor)||c.overlap-l.overlap||l.line-c.line||j(c.strength)-j(l.strength)),t=o.filter(l=>l.connectsAnchor),s=[...t.length>0?t:o,...t.length>0?[]:n.focusLocations.map(l=>({...l,connectsAnchor:!1,overlap:0,strength:"derived"}))],m=[];for(let l of s)if(!m.some(c=>c.file===l.file&&c.line===l.line)&&(m.push({file:l.file,line:l.line}),m.length>=3))break;return m}function Mt(n){return n.slice(Math.max(n.lastIndexOf(":"),n.lastIndexOf("."))+1)}function Dt(n,e){let i=new Map;for(let[o,t]of n.matches)for(let s of t.locations.values()){if(s.file!==n.definition.relativePath||s.line<n.definition.startLine||s.line>n.definition.endLine)continue;let m=`${s.file}\0${s.line}`,l=i.get(m)??{...s,matchedTerms:new Set};l.matchedTerms.add(o),i.set(m,l)}let a=[...i.values()].sort((o,t)=>t.matchedTerms.size-o.matchedTerms.size||[...t.matchedTerms].reduce((s,m)=>s+1/Math.max(1,e.get(m)??1),0)-[...o.matchedTerms].reduce((s,m)=>s+1/Math.max(1,e.get(m)??1),0)||fn(o,t)),r=[];for(let o of a)if(!r.some(t=>t.file===o.file&&Math.abs(t.line-o.line)<8)&&(r.push(o),r.length>=3))break;return r.map(o=>({file:o.file,line:o.line,matchedTerms:[...o.matchedTerms].sort()}))}function Lt(n,e){let i=[];for(let a=0;a<n.length;a+=e)i.push(he(n.slice(a,a+e)));return i}function De(n){return`'${n.replaceAll("'",`'"'"'`)}'`}export{Bt as a,En as b};
|
|
3
|
-
//# sourceMappingURL=chunk-YSH6U3L4.js.map
|
package/dist/chunk-YU5DZUZI.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import{a as F}from"./chunk-W7CXK74K.js";import{c as E}from"./chunk-E73UNJTF.js";import{a as M,c as x}from"./chunk-OSSESPDX.js";import{A,d as S,f as R,t as N}from"./chunk-N2ZSIIGR.js";import{z as w}from"./chunk-ZOHS7AQV.js";function K(t,o,n={}){return _(t,o,n).rows}function q(t,o,n={}){return _(t,o,n)}function _(t,o,n){let{maxDepth:i=5,scope:a}=n,c=i===Number.MAX_SAFE_INTEGER,r=c?null:500,h=M(t,o);if(!h)return{rows:[],coverage:{status:"incomplete",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:0,perSymbolEvidenceLimit:r,remainingFrontierSymbols:0,reasons:["The requested symbol could not be resolved."]}};let m=[],u=new Set([h.symbolId]),s=new Set,e=[h],f=0,b=!1;for(let d=1;d<=i&&e.length!==0;d++){f=d;let p=[],C=E(t,e,{...c?{}:{limit:r+1},semanticEvidence:F});for(let v of e){let g=C.get(v.symbolId)??[];r!==null&&g.length>r&&(b=!0);let $=r===null?g:g.slice(0,r);for(let l of P(t,v,a,$)){let D=`${l.file}|${l.shortName}`;if(l.symbolId!==null){if(u.has(l.symbolId))continue;u.add(l.symbolId)}else if(s.has(D))continue;s.add(D),m.push({symbol:l.symbol,shortName:l.shortName,file:l.file,depth:d}),l.symbolId!==null&&l.symbolMatch&&p.push(l.symbolMatch)}}e=p}m.sort((d,p)=>d.depth-p.depth||d.file.localeCompare(p.file));let I=e.length>0,y=[];return I&&y.push(`${e.length} symbol(s) remain eligible beyond depth ${i}.`),b&&y.push(`At least one symbol had more than ${r} incoming evidence row(s).`),y.length===0&&y.push("The discovered reverse evidence frontier was exhausted."),{rows:m,coverage:{status:I||b?"bounded":"accounted",edgeBasis:"reverse-static-call-or-reference-evidence",maxDepth:i,reachedDepth:f,perSymbolEvidenceLimit:r,remainingFrontierSymbols:e.length,reasons:y}}}function P(t,o,n,i){let a=i.filter(s=>!t.isIgnored(s.file)).filter(s=>!n||s.file.includes(n)),c=new Set(a.map(s=>s.file)),r=[];for(let s of L(t,o,n)){if(c.has(s))continue;let e=N(t,s),f=e.length>0?A(e,e[0].startLine):null;r.push({symbol:f?.symbol??s,file:s})}let h=[...a,...r],m=[],u=new Set;for(let s of h){let e=x(t,s.symbol);if(!e){let b=`${s.file}|${s.symbol}`;if(u.has(b))continue;u.add(b),m.push({symbolId:null,symbol:s.symbol,shortName:S(s.symbol),file:s.file,symbolMatch:null});continue}if(e.symbolId===o.symbolId||t.isIgnored(e.relativePath)||!T(e))continue;let f=`${e.symbolId}|${e.relativePath}`;u.has(f)||(u.add(f),m.push({symbolId:e.symbolId,symbol:e.symbol,shortName:S(e.symbol),file:e.relativePath,symbolMatch:e}))}return m}function L(t,o,n){let i=n?"AND consumer_d.relative_path LIKE ?":"",a=[o.symbolId,o.documentId];return n&&a.push(`%${n}%`),new Set(t.all(`SELECT DISTINCT consumer_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
AND c.document_id != ?
|
|
8
|
-
${t.pathExclusionsFor("consumer_d")}
|
|
9
|
-
${i}`,...a).map(c=>c.relative_path).filter(c=>!t.isIgnored(c)))}function T(t){if(t.symbol.startsWith("scip-clojure ")||w(t.relativePath)==="clojure")return!0;let o=R(t.symbol);return o==="method"||o==="type"||t.symbol.endsWith("().")}export{K as a,q as b};
|
|
10
|
-
//# sourceMappingURL=chunk-YU5DZUZI.js.map
|
package/dist/chunk-YWO5DDRC.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import{a as un,b as pn}from"./chunk-MNV5FSBW.js";import{a as se}from"./chunk-3TNRNKAT.js";import{a as ht,b as xt}from"./chunk-3SVF22I5.js";import{a as cn}from"./chunk-WIWY3CRX.js";import{b as dn}from"./chunk-DIRJWYBM.js";import{a as sn,b as St,c as an,e as ln}from"./chunk-TPFHAQ2G.js";import{b as nn,c as on,d as rn}from"./chunk-6VVV4WRR.js";import{a as bt,b as Xt,c as Zt,d as en,i as tn}from"./chunk-VUPHCS7Y.js";import{a as Jt}from"./chunk-WOIKCX6A.js";import{d as $e}from"./chunk-BOJ5SVE2.js";import{c as Yt}from"./chunk-CJZXN4NU.js";import{t as Vt,u as Qt}from"./chunk-WB3WYIRE.js";import{a as gt}from"./chunk-DYGHBZ2N.js";import{b as yt}from"./chunk-OSSESPDX.js";import{g as Ht,i as Wt}from"./chunk-XRYABF57.js";import{b as We}from"./chunk-NJITK2GP.js";import{A as Me,d as V,i as Y,t as fe}from"./chunk-N2ZSIIGR.js";import{A as Gt,n as ce,y as ft}from"./chunk-ODDUPDP7.js";import{D as he,J as He,a as qt,b as Ut}from"./chunk-ZOHS7AQV.js";import{h as zt,k as mt}from"./chunk-FESCRNVV.js";import{c as jt}from"./chunk-JWTGMPIT.js";import{d as pt}from"./chunk-N5B2NILC.js";function Ne(e){return e.includes("symbol-anchor")?0:e.includes("literal-owner")?1:e.some(t=>t.startsWith("boundary-import:"))?2:e.includes("reference-owner")?3:4}function mn(e,t){return Ne(e.origins)-Ne(t.origins)||e.depth-t.depth||e.startLine-t.startLine||e.shortName.localeCompare(t.shortName)}var fn=["call","contract-symbol","import","reference","runtime-boundary"],Mo={call:[{family:"control",subtype:"call"}],"contract-symbol":[{family:"contract",subtype:"uses-contract-symbol"}],import:[{family:"identity",subtype:"imports"}],reference:[{family:"identity",subtype:"references"}]},No={"structural-membership":[{family:"identity",subtype:"contains"}],"boundary-observation":[{family:"identity",subtype:"owns-runtime-observation"}],"external-import":[{family:"identity",subtype:"imports-external"}]};function gn(e){if(e.kind!=="runtime-boundary")return yn(Mo[e.kind]);let t=e.fromBoundaryParticipant?.protocol??e.toBoundaryParticipant?.protocol,n={crossesRuntimeBoundary:!0,...t?{protocol:t}:{},...e.runtimeBoundaryKey?{runtimeKey:e.runtimeBoundaryKey}:{}},o=[{family:"control",subtype:"runtime-handoff",context:n}];return e.evidence==="runtime-boundary:carrier.discriminator"&&(o.push({family:"control",subtype:"discriminator-dispatch",context:{...n},attributes:{joinRule:"carrier.discriminator",...e.fromBoundaryParticipant?.action?{producerAction:e.fromBoundaryParticipant.action}:{},...e.toBoundaryParticipant?.action?{consumerAction:e.toBoundaryParticipant.action}:{}}}),o.push({family:"data",subtype:"serialized-discriminator-transfer",context:{...n},attributes:{joinRule:"carrier.discriminator"}})),e.evidence==="runtime-boundary:queue.address"&&e.fromBoundaryParticipant?.action==="queue.send"&&e.toBoundaryParticipant?.action==="queue.consume"&&o.push({family:"temporal",subtype:"enqueue-before-consume",context:{...n},attributes:{producerAction:e.fromBoundaryParticipant.action,consumerAction:e.toBoundaryParticipant.action,retryPolicy:"unknown"}}),o}function Ve(e){return yn(No[e])}function yn(e){return e.map(t=>({...t,...t.context?{context:{...t.context}}:{},...t.attributes?{attributes:{...t.attributes}}:{}}))}import{join as er}from"path";import{createRequire as Ro}from"module";import{resolve as De}from"path";var Fo=Ro(import.meta.url),Ae;function Sn(e,t,n){let o=To();if(!o)return vt("The TypeScript compiler runtime is unavailable.");let i=Po(o,e,t),s=i.getSourceFile(De(t))??i.getSourceFile(t);if(!s)return vt(`The TypeScript compiler did not materialize ${t}.`);let r={ts:o,sourceFile:s,checker:i.getTypeChecker(),points:new Map,edges:new Map,unsupported:new Set,nextCfgId:0},a=$o(o,s,n);if(a.length===0)return vt("No function-like construct intersects the selected source range.");let d=new Map(a.map(u=>[u,Ao(s,u)])),c=a.map(u=>Bo(r,u,Do(o,u,d),d.get(u)));for(let u of c)Oo(r,u),qo(r,u),Go(r,u);Wo(r,c);let l=[...r.unsupported].sort();return{points:[...r.points.values()].map(({node:u,...f})=>f).sort(Zo),edges:[...r.edges.values()].sort((u,f)=>u.id.localeCompare(f.id)),coverage:{status:l.length===0?"complete":"partial",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:l}}}function To(){if(Ae!==void 0)return Ae;try{Ae=Fo("typescript")}catch{Ae=Qt()?.ts??null}return Ae}function Po(e,t,n){let o=De(n),i={target:e.ScriptTarget.ESNext,module:e.ModuleKind.NodeNext,moduleResolution:e.ModuleResolutionKind.NodeNext,skipLibCheck:!0,noResolve:!0},s=e.createSourceFile(o,t,i.target,!0,ko(e,o)),r=e.createCompilerHost(i,!0),a=r.getSourceFile.bind(r),d=r.readFile.bind(r),c=r.fileExists.bind(r);return r.getSourceFile=(l,u,f,m)=>De(l)===o?s:a(l,u,f,m),r.readFile=l=>De(l)===o?t:d(l),r.fileExists=l=>De(l)===o||c(l),e.createProgram([o],i,r)}function ko(e,t){return/\.tsx$/iu.test(t)?e.ScriptKind.TSX:/\.[cm]?js$/iu.test(t)?e.ScriptKind.JS:/\.jsx$/iu.test(t)?e.ScriptKind.JSX:e.ScriptKind.TS}function $o(e,t,n){let o=[],i=s=>{if(hn(e,s)){let r=t.getLineAndCharacterOfPosition(s.getStart(t)).line,a=t.getLineAndCharacterOfPosition(s.getEnd()).line;(!n||r<=n.endLine&&a>=n.startLine)&&o.push(s)}s.forEachChild(i)};return t.forEachChild(i),o.sort((s,r)=>s.getStart(t)-r.getStart(t))}function hn(e,t){return e.isFunctionLike(t)&&"body"in t&&t.body!==void 0}function Ao(e,t){return`callable:${encodeURIComponent(e.fileName)}:${t.getStart(e)}:${t.getEnd()}`}function Do(e,t,n){for(let o=t.parent;o;o=o.parent)if(hn(e,o)&&n.has(o))return n.get(o);return null}function Bo(e,t,n,o){let i=new Map,s=G(e,i,"exit",null),r=t.body,a=s.id;if(r&&e.ts.isBlock(r))a=Et(e,i,[...r.statements],s.id,{breakTarget:null,continueTarget:null});else if(r){let c=G(e,i,"statement",r);j(i,c.id,s.id),a=c.id}let d=G(e,i,"entry",t);return j(i,d.id,a),{id:o,node:t,parentId:n,cfg:i,entryId:d.id,exitId:s.id}}function Et(e,t,n,o,i){let s=o;for(let r=n.length-1;r>=0;r-=1)s=xe(e,t,n[r],s,i);return s}function xe(e,t,n,o,i){let s=e.ts;if(s.isBlock(n))return Et(e,t,[...n.statements],o,i);if(s.isIfStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.thenStatement,o,i),c=n.elseStatement?xe(e,t,n.elseStatement,o,i):o;return j(t,a.id,d),j(t,a.id,c),a.id}if(s.isWhileStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),a.id}if(s.isDoStatement(n)){let a=G(e,t,"predicate",n.expression),d=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d),j(t,a.id,o),d}if(s.isForStatement(n)){let a=G(e,t,"predicate",n.condition??n),d=n.incrementor?G(e,t,"statement",n.incrementor):null;d&&j(t,d.id,a.id);let c=d?.id??a.id,l=xe(e,t,n.statement,c,{breakTarget:o,continueTarget:c});if(j(t,a.id,l),n.condition&&j(t,a.id,o),!n.initializer)return a.id;let u=G(e,t,"statement",n.initializer);return j(t,u.id,a.id),u.id}if(s.isForInStatement(n)||s.isForOfStatement(n)){e.unsupported.add("for-in/for-of iterator assignment is conservatively represented without iterable element flow.");let a=G(e,t,"predicate",n.expression),d=G(e,t,"statement",n.initializer),c=xe(e,t,n.statement,a.id,{breakTarget:o,continueTarget:a.id});return j(t,a.id,d.id),j(t,a.id,o),j(t,d.id,c),a.id}if(s.isSwitchStatement(n)){e.unsupported.add("switch fallthrough is represented conservatively; discriminant-to-case value refinement is unsupported.");let a=G(e,t,"predicate",n.expression),d=o,c=[];for(let l=n.caseBlock.clauses.length-1;l>=0;l-=1){let u=n.caseBlock.clauses[l];d=Et(e,t,[...u.statements],d,{...i,breakTarget:o}),c.push(d)}for(let l of c)j(t,a.id,l);return j(t,a.id,o),a.id}if(s.isReturnStatement(n)||s.isThrowStatement(n)){let a=G(e,t,"statement",n),d=[...t.values()].find(c=>c.kind==="exit");return j(t,a.id,d.id),a.id}if(s.isBreakStatement(n)){let a=G(e,t,"statement",n);return i.breakTarget||e.unsupported.add("A break statement could not be attached to a structured target."),j(t,a.id,i.breakTarget??o),a.id}if(s.isContinueStatement(n)){let a=G(e,t,"statement",n);return i.continueTarget||e.unsupported.add("A continue statement could not be attached to a structured target."),j(t,a.id,i.continueTarget??o),a.id}if(s.isTryStatement(n)){e.unsupported.add("Exceptional control-flow and finally completion are not included in the local compiler CFG.");let a=G(e,t,"statement",n);return a.invalidatesAllDefinitions=!0,j(t,a.id,o),a.id}let r=G(e,t,"statement",n);return j(t,r.id,o),r.id}function G(e,t,n,o){let i={id:`cfg:${e.nextCfgId++}`,kind:n,ast:o,successors:new Set,predecessors:new Set,definitions:[],uses:[],displayPoint:null,invalidatesAllDefinitions:!1};return t.set(i.id,i),i}function j(e,t,n){e.get(t).successors.add(n),e.get(n).predecessors.add(t)}function Oo(e,t){let n=t.cfg.get(t.entryId);for(let o of t.node.parameters){let i=ve(e,o.name);if(!i){e.unsupported.add("Destructured parameter definition-use is not implemented.");continue}n.definitions.push({point:Ee(e,i.node,"parameter-definition",i.symbolKey,i.name,t.id),rhsUseIds:[]})}for(let o of t.cfg.values())!o.ast||o.kind==="entry"||o.kind==="exit"||(o.kind==="predicate"&&(o.displayPoint=Ee(e,o.ast,"predicate",null,"predicate",t.id)),_o(e,t,o,o.ast),!o.displayPoint&&o.definitions.length===0&&o.uses.length===0&&(o.displayPoint=Ee(e,o.ast,"statement",null,Qo(e,o.ast),t.id)))}function _o(e,t,n,o){let i=e.ts;if(i.isTryStatement(o))return;let s=r=>{if(!(r!==o&&i.isFunctionLike(r))){if(i.isVariableDeclaration(r)){let a=r.initializer?Qe(e,t.id,r.initializer,n):[];n.uses.push(...a);let d=ve(e,r.name);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Destructured variable reaching definitions are not implemented."));return}if(i.isBinaryExpression(r)&&En(i,r.operatorToken.kind)){let a=Qe(e,t.id,r.right,n);r.operatorToken.kind!==i.SyntaxKind.EqualsToken&&a.push(...Qe(e,t.id,r.left,n)),n.uses.push(...a);let d=ve(e,r.left);d?n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)}):(n.invalidatesAllDefinitions=!0,e.unsupported.add("Dynamic or destructured assignment targets are not included in reaching definitions."));return}if((i.isPrefixUnaryExpression(r)||i.isPostfixUnaryExpression(r))&&(r.operator===i.SyntaxKind.PlusPlusToken||r.operator===i.SyntaxKind.MinusMinusToken)){let a=Qe(e,t.id,r.operand,n);n.uses.push(...a);let d=ve(e,r.operand);d&&n.definitions.push({point:Ee(e,d.node,"definition",d.symbolKey,d.name,t.id),rhsUseIds:a.map(c=>c.point.id)});return}if(!(i.isFunctionDeclaration(r)||i.isClassDeclaration(r)||i.isInterfaceDeclaration(r))){if(xn(e,r)){let a=vn(e,t.id,r);a&&n.uses.push(a),i.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}}};s(o),n.uses=In(n.uses)}function Qe(e,t,n,o){let i=[],s=r=>{if(!e.ts.isFunctionLike(r)){if(e.ts.isBinaryExpression(r)&&En(e.ts,r.operatorToken.kind)){o.invalidatesAllDefinitions=!0,e.unsupported.add("Nested assignment expressions are not included in ordered local definition-use flow."),r.operatorToken.kind!==e.ts.SyntaxKind.EqualsToken&&s(r.left),s(r.right);return}if(xn(e,r)){let a=vn(e,t,r);a&&i.push(a),e.ts.isPropertyAccessExpression(r)&&s(r.expression);return}r.forEachChild(s)}};return s(n),In(i)}function xn(e,t){if(e.ts.isPropertyAccessExpression(t))return!0;if(!e.ts.isIdentifier(t))return!1;let n=t.parent;return!(e.ts.isPropertyAccessExpression(n)&&n.name===t||"name"in n&&n.name===t&&Ko(e.ts,n)||e.ts.isPropertyAssignment(n)&&n.name===t||e.ts.isBindingElement(n)&&n.propertyName===t||e.ts.isLabeledStatement(n)||e.ts.isBreakOrContinueStatement(n)||jo(e.ts,t))}function Ko(e,t){return e.isVariableDeclaration(t)||e.isParameter(t)||e.isFunctionDeclaration(t)||e.isFunctionExpression(t)||e.isClassDeclaration(t)||e.isMethodDeclaration(t)||e.isPropertyDeclaration(t)||e.isInterfaceDeclaration(t)||e.isTypeAliasDeclaration(t)||e.isImportSpecifier(t)||e.isImportClause(t)||e.isNamespaceImport(t)}function jo(e,t){for(let n=t.parent;n;n=n.parent){if(e.isExpression(n)||e.isStatement(n)||e.isSourceFile(n))return!1;if(e.isTypeNode(n))return!0}return!1}function vn(e,t,n){let o=ve(e,n);return o?{point:Ee(e,o.node,"use",o.symbolKey,o.name,t),property:e.ts.isPropertyAccessExpression(n)}:null}function ve(e,t){let n=e.ts;if(n.isIdentifier(t)){let o=bn(e,t);return o?{node:t,symbolKey:o,name:t.text}:null}if(n.isPropertyAccessExpression(t)){let o=bn(e,t.name);return o?{node:t,symbolKey:o,name:t.getText(e.sourceFile)}:null}return n.isParenthesizedExpression(t)||n.isAsExpression(t)||n.isTypeAssertionExpression(t)||n.isNonNullExpression(t)?ve(e,t.expression):((n.isArrayLiteralExpression(t)||n.isObjectLiteralExpression(t))&&e.unsupported.add("Heap aggregate identity and destructured assignment are not included in local points-to flow."),null)}function bn(e,t){let n=e.checker.getSymbolAtLocation(t);if(!n)return null;if((n.flags&e.ts.SymbolFlags.Alias)!==0)try{n=e.checker.getAliasedSymbol(n)}catch{}let o=n.valueDeclaration??n.declarations?.[0];return o?`symbol:${encodeURIComponent(o.getSourceFile().fileName)}:${o.getStart()}:${n.getName()}`:`symbol:${n.getName()}`}function Ee(e,t,n,o,i,s){let r=t.getStart(e.sourceFile),a=t.getEnd(),d=e.sourceFile.getLineAndCharacterOfPosition(r),c=`flow-point:${encodeURIComponent(e.sourceFile.fileName)}:${r}:${a}:${n}:${encodeURIComponent(o??i)}`,l=e.points.get(c);if(l)return l;let u={id:c,kind:n,name:i,symbolKey:o,callableId:s,start:r,end:a,line:d.line,column:d.character,node:t};return e.points.set(c,u),u}function qo(e,t){let n=[...t.cfg.values()].flatMap(d=>d.definitions),o=new Map(n.map(d=>[d.point.id,d])),i=Uo(n),s=new Map,r=new Map;for(let d of t.cfg.values())s.set(d.id,new Set),r.set(d.id,new Set);let a=!0;for(;a;){a=!1;for(let d of t.cfg.values()){let c=Jo([...d.predecessors].map(f=>r.get(f))),l=new Set(c);d.invalidatesAllDefinitions&&l.clear();let u=zo(d.definitions);for(let f of u){for(let m of i.get(f.point.symbolKey)??[])l.delete(m.point.id);l.add(f.point.id)}It(s.get(d.id),c)||(s.set(d.id,c),a=!0),It(r.get(d.id),l)||(r.set(d.id,l),a=!0)}}for(let d of t.cfg.values()){let c=s.get(d.id);for(let l of d.uses){let u=d.definitions.filter(m=>m.point.symbolKey===l.point.symbolKey&&m.point.start<l.point.start&&!m.rhsUseIds.includes(l.point.id)).sort((m,p)=>p.point.start-m.point.start)[0],f=u?[u.point.id]:c;for(let m of f){let p=o.get(m);p.point.symbolKey===l.point.symbolKey&&Be(e,"reaching-definition",p.point.id,l.point.id,"exact","A CFG path reaches this use without an intervening definition.")}}for(let l of d.definitions)for(let u of l.rhsUseIds)Be(e,"value-source",u,l.point.id,"exact","This right-hand-side use supplies the new definition.")}}function Uo(e){let t=new Map;for(let n of e){if(!n.point.symbolKey)continue;let o=t.get(n.point.symbolKey)??[];o.push(n),t.set(n.point.symbolKey,o)}return t}function zo(e){let t=new Map;for(let n of e)n.point.symbolKey&&t.set(n.point.symbolKey,n);return[...t.values()]}function Go(e,t){let n=Ho(t);for(let o of t.cfg.values()){if(o.successors.size<2||!o.displayPoint)continue;let i=n.get(o.id);for(let s of o.successors)for(let r of n.get(s)??[]){if(i.has(r)||r===t.exitId)continue;let a=t.cfg.get(r),d=[...a.definitions.map(c=>c.point),...a.uses.map(c=>c.point),...a.displayPoint?[a.displayPoint]:[]];for(let c of Yo(d))Be(e,"control-dependence",o.displayPoint.id,c.id,"exact","The target postdominates a branch successor but does not postdominate the predicate.")}}}function Ho(e){let t=[...e.cfg.keys()],n=new Set(t),o=new Map;for(let s of t)o.set(s,s===e.exitId?new Set([s]):new Set(n));let i=!0;for(;i;){i=!1;for(let s of e.cfg.values()){if(s.id===e.exitId)continue;let r=[...s.successors].map(d=>o.get(d)),a=new Set([s.id,...Xo(r)]);It(o.get(s.id),a)||(o.set(s.id,a),i=!0)}}return o}function Wo(e,t){let n=new Map(t.map(r=>[r.id,r.parentId])),o=t.flatMap(r=>[...r.cfg.values()].flatMap(a=>a.definitions.map(d=>d.point))),i=new Map;for(let r of o){if(!r.symbolKey)continue;let a=i.get(r.symbolKey)??[];a.push(r),i.set(r.symbolKey,a)}let s=new Set([...e.edges.values()].filter(r=>r.kind==="reaching-definition").map(r=>r.toPointId));for(let r of t)for(let a of[...r.cfg.values()].flatMap(d=>d.uses)){if(!a.point.symbolKey||s.has(a.point.id))continue;let d=i.get(a.point.symbolKey)??[];for(let c of d)Vo(c.callableId,a.point.callableId,n)?Be(e,"closure-capture",c.id,a.point.id,"candidate","Compiler identity proves the captured binding, but invocation order can select among outer definitions."):a.property&&Be(e,"field-definition-to-use",c.id,a.point.id,"candidate","Compiler identity matches the field; cross-callable receiver and execution order remain unresolved.")}[...e.edges.values()].some(r=>r.kind==="closure-capture")&&e.unsupported.add("Closure capture identity is known, but invocation order and intervening writes remain candidate flow."),[...e.edges.values()].some(r=>r.kind==="field-definition-to-use")&&e.unsupported.add("Cross-callable field flow lacks receiver points-to and invocation-order analysis.")}function Vo(e,t,n){for(let o=n.get(t)??null;o;o=n.get(o)??null)if(o===e)return!0;return!1}function Be(e,t,n,o,i,s){let r=`local-flow-edge:${t}:${encodeURIComponent(n)}:${encodeURIComponent(o)}`;e.edges.set(r,{id:r,kind:t,fromPointId:n,toPointId:o,strength:i,reason:s})}function En(e,t){return t>=e.SyntaxKind.FirstAssignment&&t<=e.SyntaxKind.LastAssignment}function Qo(e,t){let n=t.getText(e.sourceFile).replace(/\s+/gu," ").trim();return n.length>80?`${n.slice(0,77)}...`:n||e.ts.SyntaxKind[t.kind]||"statement"}function In(e){return[...new Map(e.map(t=>[t.point.id,t])).values()]}function Yo(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function Jo(e){return new Set(e.flatMap(t=>[...t]))}function Xo(e){return e.length===0?new Set:new Set([...e[0]].filter(t=>e.slice(1).every(n=>n.has(t))))}function It(e,t){return e.size===t.size&&[...e].every(n=>t.has(n))}function Zo(e,t){return e.start-t.start||e.kind.localeCompare(t.kind)||e.id.localeCompare(t.id)}function vt(e){return{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[e]}}}var tr=jt("typescript-local-flow",{clearGroups:["whole-project","source-file","semantic-provider"]});function Ct(e,t,n,o){if(!Vt(t))return null;let i=`${t}\0${n}\0${o}`;return tr.get(e,i,()=>{let s=zt(e,t);return s?Sn(s,er(e.config.projectRoot,t),{startLine:n,endLine:o}):{points:[],edges:[],coverage:{status:"unsupported",basis:"typescript-compiler-cfg-reaching-definitions",unsupported:[`Current source is unavailable for ${t}.`]}}})}function nr(e,t=new Map){let n=new Map,o=new Map,i=[];for(let s of e.transfers){if(!e.caller)continue;let r=Ye(e.caller,s.callerPosition),a=Ye(e.callee,s.calleePosition);Oe(n,r),Oe(n,a),wt(o,e.caller,r),wt(o,e.callee,a);let d=Q("edge","data-transfer",s.proof.file,String(s.proof.startLine),String(s.callerPosition),String(s.calleePosition));o.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,callerPosition:s.callerPosition,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-direct-parameter-transfer",strength:"exact",identity:`${e.caller.symbol}:${s.callerPosition} -> ${e.callee.symbol}:${s.calleePosition}`,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]})}return e.unknown.forEach((s,r)=>{let a=Ye(e.callee,s.calleePosition);Oe(n,a),wt(o,e.callee,a);let d=t.get(s.calleePosition);if(d&&mr(d)){pr(o,n,e,s.calleePosition,s.argumentText,d);return}let c=cr(e,s.calleePosition,s.argumentText);Oe(n,c);let l=Q("edge","data-transfer-unsupported",s.proof.file,String(s.proof.startLine),String(s.calleePosition),String(r));o.set(l,{id:l,kind:"data-transfer",fromNodeId:c.id,toNodeId:a.id,directed:!0,disposition:"unsupported",semantics:[{family:"data",subtype:"argument-to-parameter",attributes:{argumentText:s.argumentText,calleePosition:s.calleePosition}}],evidence:[{method:"compiler-callsite-argument-expression",strength:"exact",identity:s.argumentText,location:{file:s.proof.file,line:s.proof.startLine,endLine:s.proof.endLine}}]}),i.push({id:Q("frontier","data-transfer",l),kind:"data-transfer",direction:"unresolved",fromNodeIds:[c.id],edgeIds:[l],memberNodeIds:[a.id],memberCount:1,disposition:"unsupported",reason:d?.derivation.rule??s.reason,expansion:null})}),{nodes:[...n.values()],edges:[...o.values()],frontiers:i,blindSpots:[]}}function Ln(e,t,n=[]){let o=wn(),i=new Map,s=new Set;for(let r of t){if(r.kind!=="call"||!r.fromSymbol||!r.toSymbol||r.line===null)continue;let a=dr(i,e,r.toFile,r.toSymbol);if(!a)continue;let d=Zt(e,a),c=d.sites.filter(b=>b.file===r.fromFile&&b.startLine<=r.line&&b.endLine>=r.line&&b.caller?.symbol===r.fromSymbol);if(c.length!==1){let b=d.unresolved.find(S=>S.file===r.fromFile&&S.line===r.line);b&&o.blindSpots.push(`Parameter flow unresolved at ${r.fromFile}:${r.line+1}: ${b.reason}.`);continue}let l=c[0],u=`${l.file}\0${l.callNode.startIndex}\0${l.callNode.endIndex}\0${a.symbol}`;if(s.has(u))continue;s.add(u);let f=en(e,l),m=he(e,l.file)?.rootNode,p=new Map;if(m)for(let b of f.unknown){let S=Xt({db:e,file:l.file,root:m},l.arguments[b.calleePosition]);S&&p.set(b.calleePosition,S)}Cn(o,nr(f,p)),f.caller&&ar(l.callNode)&&lr(o,f,l.callNode)}for(let r of n){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=Ct(e,r.location.file,r.location.line,a);if(d){Cn(o,or(r,d.points,d.edges));for(let c of d.coverage.unsupported)o.blindSpots.push(`TypeScript local flow is partial for ${r.location.file}:${r.location.line+1}-${a+1}: ${c} Recover with: scip-query inspect --at '${r.location.file}:${r.location.line+1}-${a+1}' --view behavior.`)}}return o.blindSpots=[...new Set(o.blindSpots)].sort(),o}function or(e,t,n){let o=wn(),i=new Map,s=new Map,r=new Map,a=e.location.file;for(let d of t){let c=rr(e,a,d);r.set(d.id,c.id),i.set(c.id,c),ir(s,e,c)}for(let d of n){let c=r.get(d.fromPointId),l=r.get(d.toPointId);if(!c||!l)continue;let u=sr(d),f=Q("edge","typescript-local-flow",a,d.id);s.set(f,{id:f,kind:d.kind==="control-dependence"?"control-dependence":"data-transfer",fromNodeId:c,toNodeId:l,directed:!0,disposition:"folded",semantics:[u],evidence:[{method:"typescript-compiler-cfg-reaching-definitions",strength:d.strength,identity:d.reason,location:i.get(c)?.location??e.location}]})}return o.nodes=[...i.values()],o.edges=[...s.values()],o}function rr(e,t,n){return{id:Q("local-flow-point",t,String(n.start),String(n.end),n.kind,n.symbolKey??n.name),kind:n.kind==="parameter-definition"||n.kind==="definition"?"local-definition":n.kind==="use"?"local-use":n.kind==="predicate"?"control-predicate":"local-statement",label:n.name,disposition:"folded",location:{file:t,line:n.line,endLine:n.line},anchorIds:[],attributes:{ownerNodeId:e.id,pointKind:n.kind,callableId:n.callableId,symbolKey:n.symbolKey,column:n.column}}}function ir(e,t,n){let o=Q("edge","local-flow-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"local-flow-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"typescript-compiler-local-flow-owner",strength:"exact",identity:t.id,location:n.location}]})}function sr(e){switch(e.kind){case"reaching-definition":return{family:"data",subtype:"definition-to-use"};case"value-source":return{family:"data",subtype:"value-to-definition"};case"closure-capture":return{family:"data",subtype:"closure-capture"};case"field-definition-to-use":return{family:"data",subtype:"field-definition-to-use"};case"control-dependence":return{family:"control",subtype:"control-dependence"}}}function ar(e){let t=e;for(;t.parent&&["await_expression","yield_expression","parenthesized_expression","as_expression","type_assertion"].includes(t.parent.type);)t=t.parent;return t.parent!==null&&t.parent.type!=="expression_statement"}function lr(e,t,n){if(!t.caller)return;let o={id:Q("call-result",t.call.file,String(n.startIndex),String(n.endIndex),t.callee.symbol),kind:"call-result",label:`result of ${t.callee.leaf}`,disposition:"folded",location:{file:t.call.file,line:t.call.startLine,endLine:t.call.endLine},anchorIds:[],attributes:{calleeSymbol:t.callee.symbol,callerSymbol:t.caller.symbol}},i=Q("edge","return-to-call-result",t.callee.symbol,o.id),s=Q("edge","call-result-owner",t.caller.symbol,o.id);e.nodes.push(o),e.edges.push({id:i,kind:"data-transfer",fromNodeId:Mt(t.callee.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:"return-to-call-result"}],evidence:[{method:"compiler-callsite-used-result",strength:"exact",identity:`${t.callee.symbol} -> ${t.caller.symbol}`,location:o.location}]},{id:s,kind:"call-result-owner",fromNodeId:Mt(t.caller.symbol),toNodeId:o.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-call-result"}],evidence:[{method:"compiler-call-result-owner",strength:"exact",identity:t.caller.symbol,location:o.location}]})}function wn(){return{nodes:[],edges:[],frontiers:[],blindSpots:[]}}function Cn(e,t){Lt(e.nodes,t.nodes),Lt(e.edges,t.edges),Lt(e.frontiers,t.frontiers),e.blindSpots.push(...t.blindSpots)}function Lt(e,t){let n=new Set(e.map(o=>o.id));for(let o of t)n.has(o.id)||(n.add(o.id),e.push(o))}function dr(e,t,n,o){let i=`${n}\0${o}`,s=e.get(i);if(s!==void 0)return s;let r=fe(t,n).find(a=>a.symbol===o)??null;return e.set(i,r),r}function Ye(e,t){return{id:yr(e.symbol,t),kind:"parameter",label:`${e.leaf} parameter ${t}`,disposition:"folded",location:{file:e.relativePath,line:e.startLine,endLine:e.endLine},anchorIds:[],attributes:{ownerSymbol:e.symbol,position:t}}}function cr(e,t,n){return{id:Q("argument-expression",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"argument-expression",label:n,disposition:"unsupported",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{calleeSymbol:e.callee.symbol,position:t}}}function ur(e,t,n){return{id:Q("static-value",e.call.file,String(e.call.startLine),String(e.call.endLine),String(t)),kind:"static-value",label:n.value,disposition:"folded",location:{file:e.call.file,line:e.call.startLine,endLine:e.call.endLine},anchorIds:[],attributes:{value:n.value,precision:n.precision,evidence:n.evidence,termKind:n.term.kind,derivationRule:n.derivation.rule}}}function pr(e,t,n,o,i,s){let r=ur(n,o,s),a=Ye(n.callee,o);Oe(t,r);let d=Q("edge","static-value-transfer",n.call.file,String(n.call.startLine),String(o));e.set(d,{id:d,kind:"data-transfer",fromNodeId:r.id,toNodeId:a.id,directed:!0,disposition:"folded",semantics:[{family:"data",subtype:fr(s),attributes:{argumentText:i,calleePosition:o,value:s.value,precision:s.precision,derivationRule:s.derivation.rule}}],evidence:gr(s,n)})}function mr(e){return e.derivation.kind!=="heuristic"&&e.precision!=="symbolic"&&e.precision!=="unknown"}function fr(e){return e.derivation.rule==="bounded-call-return"?"return-to-parameter":e.derivation.rule==="member-constant"||e.term.kind==="property"?"property-to-parameter":"constant-to-parameter"}function gr(e,t){return(e.derivation.sourceSpans.length>0?e.derivation.sourceSpans:[t.call]).map(o=>({method:`static-value:${e.derivation.rule}`,strength:e.derivation.kind==="direct"?"exact":"derived",identity:e.derivation.inputFactIds.join(",")||e.value,location:{file:o.file,line:o.startLine,endLine:o.endLine}}))}function Oe(e,t){e.has(t.id)||e.set(t.id,t)}function wt(e,t,n){let o=Q("edge","parameter-owner",t.symbol,n.id);e.has(o)||e.set(o,{id:o,kind:"parameter-owner",fromNodeId:Mt(t.symbol),toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains"}],evidence:[{method:"compiler-parameter-owner",strength:"exact",identity:t.symbol,location:{file:t.relativePath,line:t.startLine,endLine:t.endLine}}]})}function yr(e,t){return Q("parameter",e,String(t))}function Mt(e){return Q("symbol",e)}function Q(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function Mn(e,t){let n=new Map,o=new Map,i=new Map,s=new Set;for(let r of t){if(!r.location||!["source-construct","symbol"].includes(r.kind))continue;let a=r.location.endLine??r.location.line,d=on(e,r.location.file,r.location.line,a);if(!d){s.add(`Control dependence unavailable for ${r.location.file}:${r.location.line+1}-${a+1}: no supported syntax tree or covering construct.`);continue}for(let c of d.facts){let l=Nt(r,c.controller),u=Nt(r,c.outcome);n.set(l.id,l),n.set(u.id,u),br(o,r,l);let f=Ie("edge","control-dependence",l.id,u.id,c.subtype);o.set(f,{id:f,kind:"control-dependence",fromNodeId:l.id,toNodeId:u.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:c.subtype,attributes:{...c.attributes}}],evidence:[{method:"parser-control-dependence",strength:"exact",identity:`${r.location.file}:${c.controller.startLine+1}-${c.outcome.startLine+1}`,location:{file:r.location.file,line:c.controller.startLine,endLine:c.controller.endLine}}]})}for(let c of d.terminals){let l=Nt(r,c);n.set(l.id,l);let u=c.label.startsWith("throw")||c.label.startsWith("raise")?"throw":"return",f=Ie("edge","control-terminal",r.id,l.id,u);o.set(f,{id:f,kind:"control-terminal",fromNodeId:r.id,toNodeId:l.id,directed:!0,disposition:"folded",semantics:[{family:"control",subtype:u==="throw"?"throws":"returns"}],evidence:[{method:"parser-terminal-statement",strength:"exact",identity:c.label,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]})}for(let c of d.unsupported){let l=Ie("control-unsupported",r.location.file,String(c.startLine),String(c.endLine),c.reason);n.set(l,{id:l,kind:"control-unsupported",label:c.reason,disposition:"unsupported",location:{file:r.location.file,line:c.startLine,endLine:c.endLine},anchorIds:[],attributes:{ownerNodeId:r.id}});let u=Ie("edge","control-unsupported",r.id,l);o.set(u,{id:u,kind:"control-dependence",fromNodeId:r.id,toNodeId:l,directed:!0,disposition:"unsupported",semantics:[{family:"control",subtype:"unresolved-control-construct"}],evidence:[{method:"parser-control-construct",strength:"exact",identity:c.reason,location:{file:r.location.file,line:c.startLine,endLine:c.endLine}}]});let f=Ie("frontier","control-dependence",l);i.set(f,{id:f,kind:"control-dependence",direction:"unresolved",fromNodeIds:[r.id],edgeIds:[u],memberNodeIds:[l],memberCount:1,disposition:"unsupported",reason:c.reason,expansion:null})}}return{nodes:[...n.values()],edges:[...o.values()],frontiers:[...i.values()],blindSpots:[...s].sort()}}function Nt(e,t){let n=e.location.file;return{id:Ie(`control-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`control-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind,implicit:t.implicit}}}function br(e,t,n){let o=Ie("edge","control-owner",t.id,n.id);e.has(o)||e.set(o,{id:o,kind:"control-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:"contains-control"}],evidence:[{method:"parser-control-owner",strength:"exact",identity:t.id,location:t.location}]})}function Ie(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Je=new Set(["arrow_function","constructor_declaration","function_declaration","function_definition","function_expression","generator_function","generator_function_declaration","function_item","lambda","lambda_expression","method","method_declaration","method_definition"]),Ke=new Set(["block","body","compound_statement","declaration_list","statement_block"]),Sr=new Set(["assignment","assignment_expression","augmented_assignment_expression"]),Ft=new Set(["update_expression"]),Tn=new Set(["array_access","element_access_expression","subscript_expression"]),Pn=new Set(["attribute","field_access","field_expression","member_access_expression","member_expression","selector_expression"]),hr=new Set(["false","null","null_literal","number","number_literal","string","string_literal","template_string","true"]),xr=new Set(["call_expression","method_invocation","object_creation_expression"]),vr=new Set(["comment","else_clause","formal_parameters","parameters","type_parameters"]);function kn(e,t,n,o){let i=he(e,t);if(!i)return null;let s=Rr(i.rootNode,n,o);if(!s)return null;let r=[],a=[],d=[];return Ce(s,c=>{if(Sr.has(c.type)||Ft.has(c.type)||An(c)){let l=Er(c);l?r.push(l):d.push({family:"state",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:`Mutation target ${le(c.text)} could not be resolved to an exact source resource.`})}}),Ce(s,c=>{if(!Ke.has(c.type))return;let l=Mr(c);for(let u=0;u<l.length-1;u+=1)a.push({from:_e(l[u]),to:_e(l[u+1]),subtype:"lexical-successor",synchronizationScope:null,attributes:{sameScope:!0,executionConditional:!0}});for(let u=0;u<l.length;u+=1){let f=l[u],m=Tr(f).filter(p=>p.type==="await_expression");for(let p of m){let b=je("event",`await ${le(p.text.replace(/^await\s+/u,""))}`,p);a.push({from:_e(f),to:b,subtype:"awaits-completion",synchronizationScope:null,attributes:{completionRequired:!0}});let S=l[u+1];S&&a.push({from:b,to:_e(S),subtype:"await-completion-before",synchronizationScope:null,attributes:{continuationOnly:!0}})}}}),Ce(s,c=>{if(c.type!=="synchronized_statement")return;let l=c.childForFieldName("object")??c.childForFieldName("condition")??c.namedChildren.find(b=>!Ke.has(b.type)),u=c.childForFieldName("body")??c.namedChildren.find(b=>Ke.has(b.type));if(!l||!u){d.push({family:"temporal",startLine:c.startPosition.row,endLine:c.endPosition.row,reason:"Synchronized scope has no structurally resolved monitor or body."});return}let f=le(l.text).replace(/^\(|\)$/gu,""),m=je("lock",f,l),p=Fr(u).filter(b=>b.parent!==null&&Dn(b));for(let b of Nr(p))a.push({from:m,to:_e(b),subtype:"inside-lock-scope",synchronizationScope:f,attributes:{syntaxNative:!0}})}),{mutations:r,temporal:a,unsupported:d}}function Er(e){let t=An(e),n=e.childForFieldName("left")??e.childForFieldName("argument")??(t?e.namedChildren.at(-1)??null:e.namedChildren[0]??null);if(!n)return null;let o=Ir(n);if(!o)return null;let i=t?"delete":Ft.has(e.type)||!wr(e,n).startsWith("=")?"update":"assign",s=t||Ft.has(e.type)?null:e.childForFieldName("right");return{event:je("event",le(e.text),e),resource:{kind:"resource",label:o.name,startLine:n.startPosition.row,endLine:n.endPosition.row},operation:i,durabilityClass:"in-memory",recordIdentity:o.recordIdentity,value:s?je("value",le(s.text),s):null,dataSubtype:s?Cr(s,e):null}}function Ir(e){if(Tn.has(e.type)){let t=e.childForFieldName("object")??e.childForFieldName("array")??e.namedChildren[0]??null,n=e.childForFieldName("index")??e.childForFieldName("subscript")??e.namedChildren[1]??null;return!t||!n?null:{name:`${le(t.text)}[]`,recordIdentity:le(n.text)}}return Pn.has(e.type)?{name:le(e.text),recordIdentity:null}:/^(?:identifier|property_identifier|field_identifier)$/u.test(e.type)?{name:le(e.text),recordIdentity:null}:null}function Cr(e,t){return hr.has(e.type)||/(?:integer|float|decimal|boolean|character)_literal$/u.test(e.type)?"constant-to-state":xr.has(e.type)?"return-to-state":Pn.has(e.type)||Tn.has(e.type)?"property-to-state":/identifier$/u.test(e.type)?Lr(e.text,t)?"captured-value-to-state":"value-to-state":"expression-to-state"}function Lr(e,t){let n=Rt(t.parent);if(!n||Nn(n,e))return!1;let o=Rt(n.parent);for(;o;){if(Nn(o,e))return!0;o=Rt(o.parent)}return!1}function Rt(e){let t=e;for(;t;){if(Je.has(t.type))return t;t=t.parent}return null}function Nn(e,t){let n=e.childForFieldName("parameters")??e.namedChildren.find(s=>["formal_parameters","parameters"].includes(s.type));if(n&&Rn(n,t))return!0;let o=e.childForFieldName("body")??e.namedChildren.find(s=>Ke.has(s.type));if(!o)return!1;let i=!1;return $n(o,e,s=>{if(i||!/(?:declarator|declaration|parameter)$/u.test(s.type))return;let r=s.childForFieldName("name")??s.childForFieldName("pattern")??s.namedChildren[0];r&&Rn(r,t)&&(i=!0)}),i}function Rn(e,t){let n=!1;return Ce(e,o=>{/identifier$/u.test(o.type)&&o.text===t&&(n=!0)}),n}function $n(e,t,n){n(e);for(let o of e.namedChildren)o!==t&&Je.has(o.type)||$n(o,t,n)}function wr(e,t){let n=e.childForFieldName("right"),o=Math.max(0,t.endIndex-e.startIndex),i=n?Math.max(o,n.startIndex-e.startIndex):e.text.length;return e.text.slice(o,i).trim()}function An(e){return(e.type==="delete_expression"||e.type==="unary_expression")&&/^delete\b/u.test(e.text.trim())}function Mr(e){return e.namedChildren.filter(t=>Dn(t))}function Dn(e){return vr.has(e.type)||Ke.has(e.type)?!1:/(?:statement|declaration)$/u.test(e.type)||e.type==="expression_statement"||e.type==="local_variable_declaration"}function Nr(e){let t=new Set(e);return e.filter(n=>{let o=n.parent;for(;o;){if(t.has(o))return!1;o=o.parent}return!0})}function _e(e){return je("event",le(e.text),e)}function je(e,t,n){return{kind:e,label:t,startLine:n.startPosition.row,endLine:n.endPosition.row}}function Rr(e,t,n){let o=[];return Ce(e,s=>{s.startPosition.row<=t&&s.endPosition.row>=n&&o.push(s)}),o.filter(s=>Je.has(s.type)).sort(Fn)[0]??o.sort(Fn)[0]??null}function Fn(e,t){return e.endIndex-e.startIndex-(t.endIndex-t.startIndex)||e.startIndex-t.startIndex}function Fr(e){let t=[];return Ce(e,n=>t.push(n)),t}function Tr(e){let t=[],n=o=>{t.push(o);for(let i of o.namedChildren)i!==e&&Je.has(i.type)||n(i)};return n(e),t}function Ce(e,t){t(e);for(let n of e.namedChildren)Ce(n,t)}function le(e){return e.trim().replace(/\s+/gu," ")}function _n(e,t,n=[]){let o=new Map,i=new Map,s=new Map,r=new Set;for(let a of t){if(!a.location||!["source-construct","symbol"].includes(a.kind))continue;let d=a.location.endLine??a.location.line,c=kn(e,a.location.file,a.location.line,d);if(!c){r.add(`State and temporal analysis unavailable for ${a.location.file}:${a.location.line+1}-${d+1}: no supported syntax tree or covering construct.`);continue}for(let l of c.mutations){let u=Ze(a,l.event),f=Br(a,l.resource,l.durabilityClass);if(o.set(u.id,u),o.set(f.id,f),et(i,a,u,"contains-state-effect"),tt(i,{kind:"state-resource",from:u,to:f,semantics:[{family:"state",subtype:l.operation==="delete"?"deletes-resource":"writes-resource",attributes:{operation:l.operation,durabilityClass:l.durabilityClass,resource:l.resource.label,recordIdentity:l.recordIdentity,transactionMembership:"unknown"}}],method:"parser-state-mutation",identity:l.event.label}),l.value&&l.dataSubtype){let m=Ze(a,l.value);o.set(m.id,m),tt(i,{kind:"data-to-state",from:m,to:f,semantics:[{family:"data",subtype:l.dataSubtype,attributes:{operation:l.operation,resource:l.resource.label,recordIdentity:l.recordIdentity,value:l.value.label}}],method:"parser-assignment-value",identity:`${l.value.label} -> ${l.resource.label}`})}}for(let l of c.temporal){let u=Ze(a,l.from),f=Ze(a,l.to);o.set(u.id,u),o.set(f.id,f),et(i,a,u,l.from.kind==="lock"?"contains-lock-scope":"contains-event"),et(i,a,f,"contains-event"),tt(i,{kind:"temporal-order",from:u,to:f,semantics:[{family:"temporal",subtype:l.subtype,context:l.synchronizationScope?{synchronizationScope:l.synchronizationScope}:void 0,attributes:{...l.attributes}}],method:l.subtype==="inside-lock-scope"?"parser-synchronized-scope":"parser-program-order",identity:`${l.from.label} -> ${l.to.label}`})}for(let l of c.unsupported){let u=ue(`${l.family}-unsupported`,a.location.file,String(l.startLine),String(l.endLine),l.reason);o.set(u,{id:u,kind:`${l.family}-unsupported`,label:l.reason,disposition:"unsupported",location:{file:a.location.file,line:l.startLine,endLine:l.endLine},anchorIds:[],attributes:{ownerNodeId:a.id}});let f=ue("edge",`${l.family}-unsupported`,a.id,u);i.set(f,{id:f,kind:`${l.family}-unsupported`,fromNodeId:a.id,toNodeId:u,directed:!0,disposition:"unsupported",semantics:[{family:l.family,subtype:`unresolved-${l.family}-construct`}],evidence:[{method:`parser-${l.family}-construct`,strength:"exact",identity:l.reason,location:{file:a.location.file,line:l.startLine,endLine:l.endLine}}]});let m=ue("frontier",l.family,u);s.set(m,{id:m,kind:l.family,direction:"unresolved",fromNodeIds:[a.id],edgeIds:[f],memberNodeIds:[u],memberCount:1,disposition:"unsupported",reason:l.reason,expansion:null})}}for(let a of t.filter(d=>d.kind==="runtime-boundary-participant")){let d=Xe(a,"protocol"),c=Xe(a,"action"),l=Xe(a,"address")??a.label;!d||!c||!On(d,c)||Bn(o,i,a,{observationId:a.id,action:c,strength:"exact",file:a.location?.file??"",line:a.location?.line??0,address:l,protocol:d,role:Xe(a,"role")??void 0,resolution:"locally-linked"})}for(let a of n){if(!a.protocol||!On(a.protocol,a.action))continue;let d=Ar(t,a.file,a.line,a.ownerShortName??null);if(!d){r.add(`State observation ${a.observationId} at ${a.file}:${a.line+1} has no materialized owner node.`);continue}Bn(o,i,d,a)}return{nodes:[...o.values()],edges:[...i.values()],frontiers:[...s.values()],blindSpots:[...r].sort()}}function Bn(e,t,n,o){let i=kr(o),r={id:ue("runtime-state-event",o.observationId),kind:"runtime-state-event",label:`${o.action} ${i}`,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{action:o.action,protocol:o.protocol??null,modality:o.modality??null,resolution:o.resolution??null}},a=o.protocol==="database"?"external-durable-intent":"external",d={id:ue("runtime-state-resource",o.protocol??"unknown",i),kind:"runtime-state-resource",label:i,disposition:"folded",location:{file:o.file,line:o.line},anchorIds:[],attributes:{protocol:o.protocol??null,durabilityClass:a}};e.set(r.id,r),e.set(d.id,d),et(t,n,r,"contains-runtime-state-effect");let c=Pr(o.action);tt(t,{kind:"runtime-state-resource",from:r,to:d,semantics:[{family:"state",subtype:c,context:{crossesRuntimeBoundary:!0,protocol:o.protocol},attributes:{operation:o.action,durabilityClass:a,resource:i,recordIdentity:$r(o),modality:o.modality??null,resolution:o.resolution??null,transactionMembership:"unknown",commitState:o.protocol==="database"?"unknown":null}}],method:`runtime-boundary-${o.strength}`,identity:o.observationId})}function Pr(e){return e==="database.read"?"reads-resource":e==="queue.send"?"enqueues-resource":e==="queue.consume"?"consumes-resource":"writes-resource"}function kr(e){return(e.keyParts?.find(n=>["address","resource"].includes(n.name))?.value??e.address)||e.observationId}function $r(e){return e.keyParts?.find(n=>/^(?:id|key|record)$/u.test(n.name))?.value??null}function On(e,t){return e==="database"&&["database.read","database.write"].includes(t)||e==="queue"&&["queue.consume","queue.send"].includes(t)}function Xe(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function Ar(e,t,n,o){let i=e.filter(r=>r.location?.file===t&&["source-construct","symbol"].includes(r.kind)),s=i.filter(r=>r.location.line<=n&&(r.location.endLine??r.location.line)>=n).sort(Dr)[0];if(s)return s;if(o){let r=i.find(a=>a.label===o||a.label.endsWith(`.${o}`)||a.label.includes(o));if(r)return r}return i.length===1?i[0]:null}function Dr(e,t){let n=(e.location?.endLine??e.location?.line??0)-(e.location?.line??0),o=(t.location?.endLine??t.location?.line??0)-(t.location?.line??0);return n-o}function Ze(e,t){let n=e.location.file;return{id:ue(`program-${t.kind}`,n,String(t.startLine),String(t.endLine),t.label),kind:`program-${t.kind}`,label:t.label,disposition:"folded",location:{file:n,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,constructKind:t.kind}}}function Br(e,t,n){let o=e.location.file;return{id:ue("program-resource",o,e.id,t.label,n),kind:"program-resource",label:t.label,disposition:"folded",location:{file:o,line:t.startLine,endLine:t.endLine},anchorIds:[],attributes:{ownerNodeId:e.id,durabilityClass:n}}}function et(e,t,n,o){let i=ue("edge","program-owner",t.id,n.id,o);e.has(i)||e.set(i,{id:i,kind:"program-owner",fromNodeId:t.id,toNodeId:n.id,directed:!0,disposition:"folded",semantics:[{family:"identity",subtype:o}],evidence:[{method:"parser-program-owner",strength:"exact",identity:t.id,location:n.location}]})}function tt(e,t){let n=ue("edge",t.kind,t.from.id,t.to.id,t.semantics[0].subtype);e.set(n,{id:n,kind:t.kind,fromNodeId:t.from.id,toNodeId:t.to.id,directed:!0,disposition:"folded",semantics:t.semantics,evidence:[{method:t.method,strength:"exact",identity:t.identity,location:t.from.location}]})}function ue(...e){return e.map(t=>encodeURIComponent(t)).join(":")}var Or=new Set(["control","data","state","temporal"]),nt=new Set(["contains-control","contains-event","contains-lock-scope","contains-state-effect","contains-runtime-state-effect","contains","owns-parameter","owns-runtime-observation"]),Un=new Set(["discriminator-dispatch","result-callback","returns","runtime-handoff","throws"]);function zn(e,t={}){let n=new Map(e.nodes.map(v=>[v.id,v])),o=Gr(e.nodes,t.focusLocations),i=Hr(e.edges,t.focusLocations),s=Wr(e.edges,i),r=new Set(e.paths.flatMap(v=>v.edgeIds)),a=pe(e.anchors.filter(v=>v.status==="matched").flatMap(v=>v.nodeIds)),c=e.edges.filter(qn).filter(v=>_r(v,o,i,r)),l=c.filter(v=>Ur(v,o,i,s,n,r)),u=Kn(a,l,"forward"),f=qr(u,l),m=Kn(f,l,"backward"),p=new Set([...u].filter(v=>m.has(v)));for(let v of a)p.add(v);let b=new Set(l.filter(v=>p.has(v.fromNodeId)&&p.has(v.toNodeId)).map(v=>v.id)),S=new Set(p),w=new Set(b);Kr(c,S,w,o,i);let I=e.frontiers.filter(v=>Qr(v,S)),L=pe(I.filter(v=>v.disposition==="unsupported").map(v=>v.id)),N=pe(e.edges.filter(v=>!qn(v)&&Hn(v)&&Vr(v,S)).map(v=>v.id)),y=pe(I.map(v=>v.id)),E=[];a.length===0&&E.push("No matched anchor node starts the corridor."),f.length===0&&E.push("No proved mechanical outcome is reachable from a matched anchor."),L.length>0&&E.push(`${L.length} unsupported frontier(s) touch the protected corridor.`),N.length>0&&E.push(`${N.length} candidate or unknown edge(s) touch the protected corridor.`);let C=E.length===0?"complete":"incomplete";return{schemaVersion:1,status:C,startNodeIds:a,outcomeNodeIds:f,baseNodeIds:pe([...p]),baseEdgeIds:pe([...b]),nodeIds:pe([...S]),edgeIds:pe([...w]),accountedFrontierIds:y,unresolvedFrontierIds:L,unresolvedEdgeIds:N,coverage:{protectedNodes:S.size,protectedEdges:w.size,baseNodes:p.size,baseEdges:b.size,accountedFrontiers:y.length,unresolvedFrontiers:L.length,unresolvedEdges:N.length},explanation:C==="complete"?"Every proved anchor-to-outcome path is closed over its material causal facts within reported coverage.":E.join(" ")}}function _r(e,t,n,o){return t===null||e.disposition==="emitted"||o.has(e.id)||n?.has(e.id)===!0?!0:(e.semantics??[]).some(i=>{if(i.family==="identity"&&nt.has(i.subtype))return t.has(e.toNodeId);if(i.family==="contract")return t.has(e.fromNodeId)&&t.has(e.toNodeId);if(i.family==="state")return t.has(e.fromNodeId);if(i.family==="data"||i.family==="temporal")return t.has(e.fromNodeId)||t.has(e.toNodeId);if(i.family==="control"){if(Wn(i))return t.has(e.fromNodeId);if(["returns","throws"].includes(i.subtype))return t.has(e.toNodeId);if(i.subtype==="completion-callback")return t.has(e.fromNodeId)||t.has(e.toNodeId)}return!1})}function Kr(e,t,n,o,i){let s=!0;for(;s;){s=!1;for(let r of e)jr(r,t,o,i)&&(n.has(r.id)||(n.add(r.id),s=!0),t.has(r.fromNodeId)||(t.add(r.fromNodeId),s=!0),t.has(r.toNodeId)||(t.add(r.toNodeId),s=!0))}}function jr(e,t,n,o){let i=t.has(e.fromNodeId),s=t.has(e.toNodeId);return!i&&!s?!1:(e.semantics??[]).some(r=>r.family==="identity"?nt.has(r.subtype)&&(s||n===null||n.has(e.toNodeId)):r.family==="contract"?!0:r.family==="state"?i&&(n===null||n.has(e.fromNodeId)):r.family==="temporal"?r.subtype==="lexical-successor"?i&&s:!0:r.family==="data"?s&&(i||n===null||n.has(e.fromNodeId)||o?.has(e.id)===!0):r.family==="control"?Gn(r)||["returns","throws"].includes(r.subtype)&&!s&&n!==null&&!n.has(e.toNodeId)?!1:Un.has(r.subtype)||Wn(r)||r.subtype==="completion-callback":!1)}function qr(e,t){let n=new Set,o=new Map,i=new Map;for(let s of t)!e.has(s.fromNodeId)||!e.has(s.toNodeId)||(o.set(s.fromNodeId,(o.get(s.fromNodeId)??0)+1),i.set(s.toNodeId,(i.get(s.toNodeId)??0)+1),(s.semantics??[]).some(r=>r.family==="state"||r.family==="control"&&Un.has(r.subtype))&&n.add(s.toNodeId));for(let s of e)(i.get(s)??0)>0&&(o.get(s)??0)===0&&n.add(s);return pe([...n])}function Kn(e,t,n){let o=new Map;for(let r of t){let a=n==="forward"?r.fromNodeId:r.toNodeId,d=n==="forward"?r.toNodeId:r.fromNodeId,c=o.get(a)??[];c.push(d),o.set(a,c)}let i=new Set(e),s=[...e];for(;s.length>0;){let r=s.shift();for(let a of o.get(r)??[])i.has(a)||(i.add(a),s.push(a))}return i}function Ur(e,t,n,o,i,s){return(e.semantics??[]).some(r=>e.disposition==="emitted"||s.has(e.id)?!0:r.family==="identity"&&nt.has(r.subtype)?t===null||t.has(e.toNodeId)||o?.has(e.toNodeId)===!0:!Or.has(r.family)||Gn(r)?!1:r.family==="control"&&["returns","throws"].includes(r.subtype)&&t!==null?t.has(e.toNodeId):t===null?!0:r.family==="state"?t.has(e.fromNodeId):r.family==="data"?t.has(e.fromNodeId)||t.has(e.toNodeId)||n?.has(e.id)===!0:r.family==="temporal"?r.subtype==="lexical-successor"?t.has(e.fromNodeId)&&t.has(e.toNodeId):t.has(e.fromNodeId)||t.has(e.toNodeId):r.family==="control"?zr(e,i)&&(t.has(e.fromNodeId)||t.has(e.toNodeId)):!1)}function Gn(e){return e.family==="control"&&["call","discriminator-dispatch","result-callback","runtime-handoff"].includes(e.subtype)}function zr(e,t){let n=t.get(e.fromNodeId),o=t.get(e.toNodeId);if(!n||!o)return!1;let i=jn(n,"ownerNodeId")??(n.kind==="symbol"?n.id:null),s=jn(o,"ownerNodeId")??(o.kind==="symbol"?o.id:null);return i!==null&&i===s}function Gr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>{if(!o.location||o.kind==="parameter")return!1;let i=n.get(o.location.file)??[],s=o.location.endLine??o.location.line;return i.some(r=>r>=o.location.line&&r<=s)}).map(o=>o.id))}function Hr(e,t){if(!t)return null;let n=new Map;for(let o of t){let i=n.get(o.file)??[];i.push(o.line),n.set(o.file,i)}return new Set(e.filter(o=>o.evidence.some(i=>{if(!i.location)return!1;let s=n.get(i.location.file)??[],r=i.location.endLine??i.location.line;return s.some(a=>a>=i.location.line&&a<=r)})).map(o=>o.id))}function Wr(e,t){return t===null?null:new Set(e.filter(n=>t.has(n.id)).flatMap(n=>[n.fromNodeId,n.toNodeId]))}function jn(e,t){let n=e.attributes[t];return typeof n=="string"?n:null}function qn(e){return e.disposition==="excluded"||e.disposition==="unsupported"||!Hn(e)?!1:e.evidence.some(t=>t.strength==="exact"||t.strength==="derived")}function Hn(e){return(e.semantics??[]).some(t=>t.family!=="identity"||nt.has(t.subtype))}function Wn(e){return e.subtype.startsWith("predicate-")||e.subtype.startsWith("loop-")||e.subtype.startsWith("exception-")||e.subtype.startsWith("finally-")||e.subtype.startsWith("handler-")}function Vr(e,t){return t.has(e.fromNodeId)||t.has(e.toNodeId)}function Qr(e,t){return[...e.fromNodeIds,...e.memberNodeIds].some(n=>t.has(n))}function pe(e){return[...new Set(e)].sort()}import{createHash as Yr}from"crypto";var ot=["identity","contract","control","data","state","temporal"],Jr=new Set(ot);function it(e){let t=Fe(e.anchors,"anchor"),n=Fe(e.nodes,"node"),o=Fe(e.edges,"edge"),i=Fe(e.paths??[],"path"),s=Fe(e.frontiers??[],"frontier"),r=new Set(t.map(m=>m.id)),a=new Set(n.map(m=>m.id)),d=new Set(o.map(m=>m.id)),c=e.routeCatalog?{...e.routeCatalog,routes:Fe(e.routeCatalog.routes,"route"),selectedRouteIds:J(e.routeCatalog.selectedRouteIds)}:void 0;for(let m of t)Z(`anchor ${m.id}`,[...m.nodeIds,...m.candidateNodeIds],a,"node");for(let m of n)Z(`node ${m.id}`,m.anchorIds,r,"anchor");for(let m of o){if(Z(`edge ${m.id}`,[m.fromNodeId,m.toNodeId],a,"node"),m.evidence.length===0)throw new Error(`Exploration edge ${m.id} has no evidence source.`);ei(m)}for(let m of i)Z(`path ${m.id}`,[m.fromAnchorId,m.toAnchorId],r,"anchor"),Z(`path ${m.id}`,m.nodeIds,a,"node"),Z(`path ${m.id}`,m.edgeIds,d,"edge");for(let m of s)if(Z(`frontier ${m.id}`,m.fromNodeIds,a,"node"),Z(`frontier ${m.id}`,m.edgeIds,d,"edge"),Z(`frontier ${m.id}`,m.memberNodeIds,a,"node"),m.memberCount!==m.memberNodeIds.length)throw new Error(`Exploration frontier ${m.id} reports ${m.memberCount} member(s) but identifies ${m.memberNodeIds.length}.`);for(let m of c?.routes??[])Z(`route ${m.id}`,m.nodeIds,a,"node"),Z(`route ${m.id}`,m.edgeIds,d,"edge"),Z(`route ${m.id}`,[m.anchorNodeId,m.endpointNodeId],a,"node");c&&Z("route catalog selection",c.selectedRouteIds,new Set(c.routes.map(m=>m.id)),"route");let l=J(e.incompleteReasons??[]),u=l.length===0?"accounted":"incomplete",f=t.reduce((m,p)=>m+p.omittedCandidates,0);return{schemaVersion:1,anchors:t,nodes:n,edges:o,paths:i,frontiers:s,coverage:{status:u,scope:e.scope,nodes:no(n),edges:no(o),matchedAnchors:t.filter(m=>m.status==="matched").length,ambiguousAnchors:t.filter(m=>m.status==="ambiguous").length,missingAnchors:t.filter(m=>m.status==="missing").length,omittedCandidates:f,frontierGroups:s.length,programEdges:Zr(o),blindSpots:J(e.blindSpots??[]),explanation:u==="accounted"?"Every node and edge discovered within the declared query scope is emitted, folded with recoverable identity, explicitly excluded, or reported unsupported.":`The declared query scope is not fully accounted for: ${l.join("; ")}`},completion:oi(u,i,e.scope),...c?{routeCatalog:c}:{}}}function Xr(e){return e.flatMap(t=>ti(t.semantics??[]).map(n=>({id:ni(t.id,n),sourceEdgeId:t.id,sourceKind:t.kind,fromNodeId:t.fromNodeId,toNodeId:t.toNodeId,directed:!0,disposition:t.disposition,evidence:[...t.evidence],family:n.family,subtype:n.subtype,...n.context?{context:{...n.context}}:{},...n.attributes?{attributes:{...n.attributes}}:{}}))).sort((t,n)=>t.id.localeCompare(n.id))}function Zr(e){let t=Xr(e),n=new Set(t.map(r=>r.sourceEdgeId)),o=new Map(ot.map(r=>[r,new Set])),i=new Map(ot.map(r=>[r,new Set])),s=new Map(ot.map(r=>[r,0]));for(let r of t)o.get(r.family).add(r.sourceEdgeId),i.get(r.family).add(r.subtype),s.set(r.family,s.get(r.family)+1);return{sourceEdges:e.length,mappedSourceEdges:n.size,projectedEdges:t.length,unmappedSourceEdges:e.length-n.size,unsupportedSourceEdges:e.filter(r=>r.disposition==="unsupported").length,unmappedKinds:J(e.filter(r=>!n.has(r.id)).map(r=>r.kind)),families:{identity:Re("identity",o,s,i),contract:Re("contract",o,s,i),control:Re("control",o,s,i),data:Re("data",o,s,i),state:Re("state",o,s,i),temporal:Re("temporal",o,s,i)}}}function Re(e,t,n,o){return{sourceEdges:t.get(e)?.size??0,projectedEdges:n.get(e)??0,subtypes:[...o.get(e)??[]].sort()}}function ei(e){let t=new Set;for(let n of e.semantics??[]){if(!Jr.has(n.family))throw new Error(`Exploration edge ${e.id} has unknown program edge family: ${n.family}.`);if(n.subtype.trim().length===0)throw new Error(`Exploration edge ${e.id} has an empty program edge subtype.`);let o=Tt(n);if(t.has(o))throw new Error(`Exploration edge ${e.id} repeats program edge semantic ${o}.`);t.add(o)}}function ti(e){return[...e].sort((t,n)=>Tt(t).localeCompare(Tt(n)))}function Tt(e){return`${e.family}:${e.subtype}`}function ni(e,t){return`program:${encodeURIComponent(e)}:${t.family}:${encodeURIComponent(t.subtype)}`}function oi(e,t,n){return e==="incomplete"||t.some(o=>o.status!=="connected")?{status:"coverage-incomplete",scope:n,explanation:"The declared graph query has an ambiguous, missing, candidate-only, or disconnected anchor relationship."}:t.length>0?{status:"connector-complete",scope:n,explanation:"Every requested anchor pair has a selected path supported by proved repository relationships."}:{status:"frontier-accounted",scope:n,explanation:"Every discovered direction in the declared graph query is emitted or represented by an exact frontier."}}function oo(e,t={}){let n=t.maxSelectedNodes??24;if(!Number.isSafeInteger(n)||n<=0)throw new RangeError(`maxSelectedNodes must be a positive safe integer; received ${n}`);let o=new Set(e.anchors.flatMap(g=>[...g.nodeIds,...g.candidateNodeIds])),i=[],s=e.anchors.filter(g=>g.status!=="missing"&&g.nodeIds.length+g.candidateNodeIds.length>0);for(let g=0;g<s.length;g+=1)for(let R=g+1;R<s.length;R+=1){let $=s[g],B=s[R],A=Xn(e,$,B,!1),h=A??Xn(e,$,B,!0);h?(h.nodeIds.forEach(k=>o.add(k)),i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:!A||$.status==="ambiguous"||B.status==="ambiguous"?"candidate":"connected",nodeIds:h.nodeIds,edgeIds:h.edgeIds})):i.push({id:rt("path",$.id,B.id),fromAnchorId:$.id,toAnchorId:B.id,status:"partial",nodeIds:[],edgeIds:[]})}let r=J(t.routeIds??[]),a=ri(e,r),d=new Set(a.routes.map(g=>g.id)),c=r.filter(g=>!d.has(g));if(c.length>0)throw new Error(`Unknown exploration route id(s): ${c.join(", ")}`);let u=a.routes.filter(g=>r.includes(g.id)).map(g=>({anchorNodeId:g.anchorNodeId,endpointNodeId:g.endpointNodeId,endpointKind:g.endpointKind,endpointPriority:2,nodeIds:[...g.nodeIds].reverse(),edgeIds:[...g.edgeIds].reverse()}));for(let g of u)g.nodeIds.forEach(R=>o.add(R));let f=i.length===0||i.some(g=>g.edgeIds.length>0);f&&eo(e,o,n);let m=to(e,o),p=new Set(t.expandedFrontierIds??[]),b=new Set(m.map(g=>g.id)),S=[...p].filter(g=>!b.has(g)).sort();if(S.length>0)throw new Error(`Unknown exploration frontier id(s): ${S.join(", ")}`);for(let g of m)p.has(g.id)&&g.memberNodeIds.forEach(R=>o.add(R));f&&eo(e,o,n);let w=new Map(u.map(g=>[g.endpointNodeId,g.endpointKind])),I=new Set(u.flatMap(g=>g.nodeIds)),L=new Map;for(let g of u)for(let R=0;R<g.nodeIds.length;R+=1){let $=g.nodeIds[R],B=R;L.set($,Math.max(L.get($)??0,B))}let N=e.nodes.map(g=>{let R=w.get(g.id),$=I.has(g.id)?{upstreamCausalPath:!0,upstreamCausalDistance:L.get(g.id)??0,...R?{upstreamCausalEndpoint:R}:{}}:{};return{...g,attributes:{...g.attributes,...$},disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:o.has(g.id)?"emitted":"folded"}}),y=new Set([...i.flatMap(g=>g.edgeIds),...u.flatMap(g=>g.edgeIds)]),E=e.edges.map(g=>({...g,disposition:g.disposition==="excluded"||g.disposition==="unsupported"?g.disposition:y.has(g.id)||o.has(g.fromNodeId)&&o.has(g.toNodeId)?"emitted":"folded"})),C=it({anchors:e.anchors,nodes:N,edges:E,paths:i,frontiers:[...e.frontiers.filter(g=>g.disposition!=="folded"),...to({...e,nodes:N,edges:E},o)],scope:e.coverage.scope,blindSpots:e.coverage.blindSpots,incompleteReasons:e.coverage.status==="incomplete"?[e.coverage.explanation]:[],routeCatalog:a}),v=new Set(C.frontiers.flatMap(g=>g.edgeIds)),F=C.edges.filter(g=>g.disposition==="folded"&&!v.has(g.id)).map(g=>g.id);if(F.length>0)throw new Error(`Folded exploration edge(s) are not frontier-accounted: ${F.sort().join(", ")}`);return C}var Vn=10;function ri(e,t=[]){let n=new Map(e.nodes.map(S=>[S.id,S])),o=new Map(e.edges.map(S=>[S.id,S])),i=new Map;for(let S of e.edges){if(!ii(S))continue;let w=i.get(S.toNodeId)??[];w.push(S),i.set(S.toNodeId,w)}for(let S of i.values())S.sort((w,I)=>Number(qe(I))-Number(qe(w))||Jn(I)-Jn(w)||w.fromNodeId.localeCompare(I.fromNodeId)||w.id.localeCompare(I.id));let s=J(e.anchors.filter(S=>S.status==="matched").flatMap(S=>S.nodeIds)),r=new Map,a=new Set,d=(S,w,I)=>{let L=w.nodeIds[w.nodeIds.length-1],N=n.get(L),y=n.get(S);if(!N?.location||!y)return;let E=[...w.nodeIds].reverse(),C=[...w.edgeIds].reverse(),v=new Set(E),F=C.flatMap(A=>{let H=o.get(A);return H?[H]:[]}),g=e.edges.filter(A=>A.disposition!=="excluded"&&A.disposition!=="unsupported"&&(v.has(A.fromNodeId)||v.has(A.toNodeId))),R={id:rt("route",S,L,I,...C),status:"proved",anchorNodeId:S,anchorLabel:y.label,endpointNodeId:L,endpointLabel:N.label,endpointLocation:{...N.location},endpointKind:I,nodeIds:E,edgeIds:C,evidenceStrengths:J(F.flatMap(A=>A.evidence.map(H=>H.strength))),spineEdgeFamilies:Qn(F,!0),relatedEdgeFamilies:Qn(g,!1),crossesRuntimeBoundary:F.some(qe)},$=`${S}\0${L}\0${I}`,B=r.get($);(!B||Yn(R,B)<0)&&r.set($,R)};for(let S of s){n.get(S)?.attributes.publicEntry===!0&&d(S,{nodeIds:[S],edgeIds:[]},"public-entry");let w=[{nodeIds:[S],edgeIds:[]}],I=new Map([[S,0]]);for(let L=0;L<w.length;L+=1){let N=w[L],y=N.nodeIds[N.nodeIds.length-1];N.edgeIds.length>0&&n.get(y)?.location&&n.get(y)?.attributes.publicEntry===!0&&d(S,N,"public-entry");let E=i.get(y)??[];if(N.edgeIds.length>=Vn){E.some(C=>!N.nodeIds.includes(C.fromNodeId))&&a.add(S);continue}for(let C of E){if(N.nodeIds.includes(C.fromNodeId))continue;let v=N.edgeIds.length+1,F=I.get(C.fromNodeId);if(F!==void 0&&F<=v)continue;let g={nodeIds:[...N.nodeIds,C.fromNodeId],edgeIds:[...N.edgeIds,C.id]};if(I.set(C.fromNodeId,v),qe(C)&&n.get(C.fromNodeId)?.location){d(S,g,"runtime-boundary");continue}w.push(g)}}}let c=[...r.values()].sort(Yn),l=new Set(c.map(S=>S.id)),u=J(t.filter(S=>l.has(S))),f=J(c.map(S=>S.anchorNodeId)),m=s.filter(S=>!f.includes(S)),p=[...a].sort(),b=e.coverage.status==="accounted"&&p.length===0?"accounted":"incomplete";return{schemaVersion:1,routes:c,selectedRouteIds:u,coverage:{status:b,scope:"Distinct proved public-entry and runtime-boundary endpoints reachable upstream in the supplied topology.",enumeration:"one-shortest-proved-path-per-endpoint",maximumDepth:Vn,anchorNodeIds:s,anchorsWithRoutes:f,anchorsWithoutRoutes:m,depthLimitedAnchorNodeIds:p,routeCount:c.length,explanation:b==="accounted"?"Every distinct proved upstream public/runtime endpoint in the supplied topology has one stable shortest route.":"Route enumeration is incomplete because the supplied topology has incomplete coverage or a traversal reached the route-depth bound."}}}function Qn(e,t){let n=e.flatMap(o=>o.semantics?.map(i=>i.family)??[]);return t&&e.length>0&&n.length===0&&n.push("control"),J(n)}function Yn(e,t){return e.anchorNodeId.localeCompare(t.anchorNodeId)||e.edgeIds.length-t.edgeIds.length||e.endpointKind.localeCompare(t.endpointKind)||e.endpointNodeId.localeCompare(t.endpointNodeId)||e.id.localeCompare(t.id)}function ii(e){return e.disposition!=="excluded"&&e.disposition!=="unsupported"&&si(e)&&e.evidence.some(t=>["exact","derived","mixed"].includes(t.strength))}function si(e){return qe(e)||e.kind==="boundary-observation"||e.kind==="call"||e.kind==="compiler:call"}function qe(e){return e.kind==="runtime-boundary"||e.kind.startsWith("runtime:")}function Jn(e){let t={exact:5,derived:4,mixed:3,candidate:1,unknown:0};return Math.max(0,...e.evidence.map(n=>t[n.strength]))}function Xn(e,t,n,o){return Zn(e,t,n,o)??Zn(e,n,t,o)}function Zn(e,t,n,o){let i=[...t.nodeIds,...t.candidateNodeIds].sort(),s=new Set([...n.nodeIds,...n.candidateNodeIds]);if(i.some(l=>s.has(l)))return{nodeIds:[i.find(u=>s.has(u))],edgeIds:[]};let r=new Set(e.nodes.filter(l=>l.kind==="structural-region").map(l=>l.id)),a=new Map;for(let l of e.edges)l.disposition==="excluded"||l.disposition==="unsupported"||l.kind==="structural-membership"||r.has(l.fromNodeId)||r.has(l.toNodeId)||l.evidence.every(f=>["candidate","unknown"].includes(f.strength))&&!o||ai(a,l.fromNodeId,l.toNodeId,l.id);for(let l of a.values())l.sort((u,f)=>u.nodeId.localeCompare(f.nodeId)||u.edgeId.localeCompare(f.edgeId));let d=i.map(l=>({nodeId:l,nodeIds:[l],edgeIds:[]})),c=new Set(i);for(let l=0;l<d.length;l+=1){let u=d[l];for(let f of a.get(u.nodeId)??[]){if(c.has(f.nodeId))continue;let m={nodeId:f.nodeId,nodeIds:[...u.nodeIds,f.nodeId],edgeIds:[...u.edgeIds,f.edgeId]};if(s.has(f.nodeId))return m;c.add(f.nodeId),d.push(m)}}return null}function ai(e,t,n,o){let i=e.get(t)??[];i.push({nodeId:n,edgeId:o}),e.set(t,i)}function li(e,t,n){let o=new Map;for(let a of e.edges){let d=o.get(a.fromNodeId)??{incoming:0,outgoing:0},c=o.get(a.toNodeId)??{incoming:0,outgoing:0};d.outgoing+=1,c.incoming+=1,o.set(a.fromNodeId,d),o.set(a.toNodeId,c)}let i=new Set,s=new Map;for(let a of e.edges){let d=t.has(a.fromNodeId),c=t.has(a.toNodeId);if(d===c)continue;let l=d?a.toNodeId:a.fromNodeId,u=d?a.fromNodeId:a.toNodeId,f=e.nodes.find(b=>b.id===l);if(f?.kind==="structural-region")continue;let m=s.get(l)??new Set;m.add(u),s.set(l,m),(/(?:runtime-boundary|external)/u.test(a.kind)||f&&/(?:frontier|external)/u.test(f.kind))&&i.add(l)}let r=[...s].filter(([a,d])=>{if(i.has(a))return!0;let c=o.get(a)??{incoming:0,outgoing:0};return(c.incoming>1||c.outgoing>1)&&d.size>1}).sort(([a,d],[c,l])=>Number(i.has(c))-Number(i.has(a))||l.size-d.size||a.localeCompare(c)).map(([a])=>a);for(let a of r){if(t.size>=n)break;t.add(a)}}function eo(e,t,n){let o=-1;for(;t.size!==o&&t.size<n;)o=t.size,li(e,t,n)}function to(e,t){let n=new Set(e.nodes.filter(r=>!t.has(r.id)&&r.disposition!=="excluded"&&r.disposition!=="unsupported").map(r=>r.id)),o=new Map;for(let r of e.edges){if(!n.has(r.fromNodeId)||!n.has(r.toNodeId))continue;let a=o.get(r.fromNodeId)??new Set,d=o.get(r.toNodeId)??new Set;a.add(r.toNodeId),d.add(r.fromNodeId),o.set(r.fromNodeId,a),o.set(r.toNodeId,d)}let i=[],s=new Set;for(let r of[...n].sort()){if(s.has(r))continue;let a=[],d=[r];s.add(r);for(let c=0;c<d.length;c+=1){let l=d[c];a.push(l);for(let u of[...o.get(l)??[]].sort())s.has(u)||(s.add(u),d.push(u))}i.push(a.sort())}return i.map(r=>{let a=new Set(r),d=e.edges.filter(p=>a.has(p.fromNodeId)||a.has(p.toNodeId)),c=d.filter(p=>a.has(p.fromNodeId)!==a.has(p.toNodeId)),l=J(c.map(p=>a.has(p.fromNodeId)?p.toNodeId:p.fromNodeId)),u=new Set(c.map(p=>a.has(p.toNodeId)?"outgoing":"incoming")),f=J(d.map(p=>p.id)),m=J(c.map(p=>p.kind));return{id:rt("frontier",...r,...f),kind:m.join("+")||"disconnected",direction:u.size===1?[...u][0]:"undirected",fromNodeIds:l,edgeIds:f,memberNodeIds:r,memberCount:r.length,disposition:"folded",reason:c.length>0?"Connected evidence is folded beyond the first edge leaving the selected connector graph.":"Discovered evidence is disconnected from every selected anchor connector under the declared relation scope.",expansion:null}})}function rt(e,...t){let n=Yr("sha256").update(t.join("\0")).digest("hex").slice(0,16);return`${e}:${n}`}function Fe(e,t){let n=[...e].sort((o,i)=>o.id.localeCompare(i.id));for(let o=1;o<n.length;o+=1)if(n[o-1].id===n[o].id)throw new Error(`Duplicate exploration ${t} id: ${n[o].id}`);return n}function Z(e,t,n,o){let i=J(t.filter(s=>!n.has(s)));if(i.length>0)throw new Error(`Exploration ${e} references missing ${o}(s): ${i.join(", ")}`)}function no(e){return{total:e.length,emitted:e.filter(t=>t.disposition==="emitted").length,folded:e.filter(t=>t.disposition==="folded").length,excluded:e.filter(t=>t.disposition==="excluded").length,unsupported:e.filter(t=>t.disposition==="unsupported").length}}function J(e){return[...new Set(e)].sort()}var di=5,ci=12,ui=8,pi=3,ro=8,mi=6,fi=12,io=12,gi=12,yi=2,bi=new Set(["branch","loop","call","await","return","throw","mutation","catch","finally"]),Si=9e3,so=fn,ao=new WeakMap;function Ua(e,t){return So(e,t,"full")}function za(e,t){return So(e,t,"topology")}function hi(e,t,n,o,i,s=!1){let r=e.get(t);if(r)return r.depth=Math.min(r.depth,n),r.primary||=i,r.promoteBoundaryImports||=s,r.origins.add(o),r;let a={file:t,depth:n,primary:i,promoteBoundaryImports:s,origins:new Set([o]),processed:!1};return e.set(t,a),a}function xi(e,t,n,o,i,s,r="none",a=!1){let d=e.get(n.symbol);if(d)return d.depth=Math.min(d.depth,o),d.origins.add(i),s&&d.anchorQueries.add(s),d.referenceScope=Ss(d.referenceScope,r),t(n.relativePath,o,i,!0,a),d;let c={definition:n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),referenceScope:r,processed:!1};return e.set(n.symbol,c),t(n.relativePath,o,i,!0,a),c}function vi(e,t,n,o,i,s,r=!1,a=!0){let d=de(n),c=e.get(d);if(c)return c.depth=Math.min(c.depth,o),c.origins.add(i),s&&c.anchorQueries.add(s),c.reverseCallExpansion||=r,c.traversalEligible||=a,t(n.file,o,i,c.traversalEligible,!0),c;let l={...n,depth:o,origins:new Set([i]),anchorQueries:new Set(s?[s]:[]),reverseCallExpansion:r,traversalEligible:a};return e.set(d,l),t(n.file,o,i,a,!0),l}function Ei(e){let{db:t,index:n,pendingRelations:o,addFile:i,addSymbol:s,addSourceConstruct:r,observation:a,depth:d,origin:c}=e;i(a.source.file,d,c,!0,!0),a.owner.file!==a.source.file&&i(a.owner.file,d,`${c}:owner`,!0,!0);let l=fe(t,a.owner.file),u=a.owner.symbol?ye(t,n,a.owner.symbol).matches.find(p=>p.relativePath===a.owner.file):null,f=(u&&!Y(u.symbol)?u:null)??Me(l,a.source.startLine);if(f&&!Y(f.symbol))return s(f,d,c,void 0,"none",!0),f.symbol;a.owner.name&&r({file:a.owner.file,name:a.owner.name,startLine:a.owner.startLine,endLine:a.owner.endLine},d,`${c}:source-owner`,void 0,!0);let m=e.index.definitionsForFile(a.source.file).filter(p=>!!p.leaf&>(t,a.source.file,p.leaf).some(b=>b>=a.source.startLine&&b<=a.source.endLine));if(m.length===1){let p=m[0];s(p,d,`${c}:handler-identifier`,void 0,"none",!0),ne(o,{kind:"runtime-boundary",evidence:"runtime-boundary:handler-identifier",fromFile:a.source.file,fromSymbol:null,toFile:p.relativePath,toSymbol:p.symbol,fromBoundaryParticipant:Pe(a),line:a.source.startLine,strength:"derived"})}return null}function Ii(e){let t=0,n=0,o=0;for(let i of e.searches){let s=ts(e.db,e.index,i,e.boundaryObservationLocations),r=s.filter(l=>ss(l,e.sourceAllowed)),a=!e.opts.fullLiteralTraversal&&(s.length>ci||r.length>ui),d=a?[]:s,c=new Set((a?[]:e.opts.fullLiteralTraversal?r:[...r].sort(ns).slice(0,pi)).map(mo));a&&(n+=1,o+=s.length);for(let l of d){let u=c.has(mo(l)),f=u&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerEndLine!==null;if(e.addFile(l.relativePath,0,`${u?"literal-anchor":"literal-match"}:${i}`,f,f),f&&e.addSourceConstruct({file:l.relativePath,name:l.ownerShortName??`${l.relativePath}:${l.ownerStartLine+1}`,startLine:l.ownerStartLine,endLine:l.ownerEndLine},0,`literal-source-owner:${i}`,i,!0),u&&l.ownerSymbol){let m=ye(e.db,e.index,l.ownerSymbol).matches[0];m&&!Y(m.symbol)&&e.addSymbol(m,0,"literal-owner",i,"all",!0)}e.literalHits.push({query:i,file:l.relativePath,line:l.line,ownerSymbol:l.ownerSymbol,ownerShortName:l.ownerShortName,ownerStartLine:l.ownerStartLine,ownerEndLine:l.ownerEndLine,sourceLine:l.sourceLine.trim(),matchKind:l.matchKind,traversalSeed:u})}e.anchors.push({kind:"literal",query:i,status:s.length>0?"matched":"missing",matchedRegionIds:[],matchingLines:s.length,seedMatchingLines:a?0:c.size,matchOnlyLines:s.length-c.size,eligibleSeedMatchingLines:r.length,materializedMatchingLines:d.length,withheldMatchingLines:a?s.length:0,literalTraversal:a?"withheld-broad":"materialized",representativeMatches:a?as(i,s):void 0,narrowingCommands:a?ds(i,s):void 0,exhaustiveTraversalCommand:a||c.size<r.length?`scip-query system-map --search ${O(i)} --full-literal-traversal`:void 0,seedRegionIds:[],matchOnlyRegionIds:[]})}for(let i of e.symbolQueries){let s=ye(e.db,e.index,i);t+=s.omitted;let r=os(e.db,i),a=s.matches.filter(f=>!Y(f.symbol)),d=r!==null&&a.length===0;d&&e.addSourceConstruct(r,0,"source-construct-anchor",i,!0);let c=d?a:s.matches;for(let f of c)e.addSymbol(f,0,"symbol-anchor",i,"all",!0);let l=d?rs(r):null,u=d?1:s.total;e.anchors.push({kind:"symbol",query:i,status:u===0?"missing":u===1?"matched":"ambiguous",matchedRegionIds:[],symbolCandidates:[...l?[l]:[],...c.map(fs)],totalSymbolCandidates:u,omittedSymbolCandidates:s.omitted})}return{omittedSymbolCandidates:t,broadLiteralAnchors:n,withheldLiteralMatches:o}}function Ci(e){let{db:t,opts:n,mode:o,searches:i,symbolQueries:s,maxDepth:r,maxTopologyCharacters:a,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,workspaces:u,runtimeBoundaries:f,boundaryObservations:m,representedBoundaryLinkIds:p,files:b,symbols:S,sourceConstructs:w,literalHits:I,pendingRelations:L,externalImports:N,anchors:y,omittedSymbolCandidates:E,broadLiteralAnchors:C,withheldLiteralMatches:v,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,sourceAllowed:$}=e,B=new Set(d),A=new Map;for(let x of b.keys())A.set(x,Ue(x,u));let H=[...L.values()].filter(x=>A.has(x.fromFile)&&A.has(x.toFile)).map(x=>({...x,fromRegionId:A.get(x.fromFile).id,toRegionId:A.get(x.toFile).id})).sort(Eo),h=Ms(H),k=new Set(n.expand??[]),M=Is(b,S,I,H,h,A,k),_=new Set([...b.values()].filter(x=>[...x.origins].some(P=>P.startsWith("literal-anchor:")||P==="literal-owner"||P==="symbol-anchor")).map(x=>A.get(x.file).id)),W=Xi(M),q=new Set(M.map(x=>x.id)),U=[...k].filter(x=>!q.has(x)).sort();for(let x of y)if(x.matchedRegionIds=Rs(x,I,S,A),x.kind==="literal"){let P=I.filter(z=>z.query===x.query);x.seedRegionIds=D(P.filter(z=>z.traversalSeed).map(z=>A.get(z.file).id)),x.matchOnlyRegionIds=D(P.filter(z=>!z.traversalSeed).map(z=>A.get(z.file).id))}let K=[...S.values()].filter(x=>!x.processed).length,ae=[...b.values()].filter(x=>x.primary&&!x.processed).length,Le=[...b.values()].filter(x=>!x.primary&&!x.processed).length,ze=[...S.values()].filter(x=>x.processed),we=(f?.frontiers??[]).flatMap(x=>{let P=m.get(x.observationId);return!P&&x.source&&x.action&&x.strength?!B.has("runtime-boundary")||!$(x.source.file)||c==="exact"||!b.has(x.source.file)?[]:[{observationId:x.observationId,action:x.action,strength:x.strength,file:x.source.file,line:x.source.startLine,ownerShortName:x.ownerShortName??null,address:x.address??x.missingKeyParts.join(", "),reason:x.reason}]:!B.has("runtime-boundary")||!P||!$(P.source.file)||c==="exact"&&P.strength!=="exact"||!b.has(P.source.file)?[]:[{observationId:P.id,action:P.action,strength:P.strength,file:P.source.file,line:P.source.startLine,ownerShortName:P.owner.name,address:vo(P),reason:x.reason,protocol:P.protocol,role:P.role,modality:P.modality,resolution:P.resolution,sourceScope:P.sourceScope,keyParts:P.keyParts.map(z=>({name:z.name,value:z.value,evidence:z.evidence}))}]}).sort((x,P)=>x.file.localeCompare(P.file)||x.line-P.line),me=(f?.links??[]).filter(x=>{if(!B.has("runtime-boundary")||c==="exact"&&x.strength!=="exact")return!1;let P=m.get(x.from),z=m.get(x.to);return!!(P&&z&&$(P.source.file)&&$(z.source.file)&&(b.has(P.source.file)||b.has(z.source.file)))}),T=me.filter(x=>x.strength==="exact").length,oe=me.filter(x=>x.strength==="derived").length,re=me.filter(x=>x.strength==="candidate").length,be=f?.links.filter(x=>x.strength==="exact").length??0,Se=f?.links.filter(x=>x.strength==="derived").length??0,ke=f?.links.filter(x=>x.strength==="candidate").length??0,ct=Ns(N,A),ut=E===0?"accounted":"incomplete",Bt=[...C>0?[`${C} broad literal anchor(s) withheld ${v} exact match(es) before graph traversal; representative identities and scoped search commands preserve recovery without treating every textual occurrence as relevant.`]:[],`Literal matches outside the included source scopes (${l.join(", ")}) remain visible as match-only evidence and do not seed traversal.`,f?"Built-in runtime-boundary extractors traverse direct and replayably derived links; heuristic candidates, unsupported frameworks, reflection, generated names, and dependency wiring not recoverable from compiler occurrences or constructor assignments remain disclosed frontiers.":"Runtime-boundary evidence is unavailable for this index; run scip-query reindex with this build to extract supported HTTP, event, registry, and persistence observations.","Reverse references do not recursively expand from discovered callers or callees.","Member calls use compiler occurrences, exact constructor-assigned fields, bounded unique service providers, direct factory-return members, and compiler-resolved object-literal callbacks when available. Ambiguous providers remain candidate frontiers; callback values routed through mutation, reflection, or unsupported dependency containers remain unrepresented.","Literal traversal is bounded to the smallest parser-delimited source construct; parser gaps may reduce an owner to one source line and leave its continuation untraversed.","Schema consumers stay within forward-flow regions; cross-workspace contracts may discover consumers in other workspaces. Add an explicit symbol anchor to widen either scope.",`Traversal stops after depth ${r}; nonzero frontier counts identify evidence that was discovered but not traversed.`,"Region labels are structural path groupings, not inferred runtime or architectural boundaries."],ie=ji({db:t,anchors:y,regions:M,symbolStates:S,sourceConstructStates:w,literalHits:I,relations:H,externalBoundaries:ct,boundaryFrontiers:we,regionForFile:A,closureStatus:ut,omittedSymbolCandidates:E,maxDepth:r,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,blindSpots:Bt,topologyFrontiers:n.topologyFrontiers??[],routeIds:n.routeIds??[],expandedRegionIds:[...k],maxTopologyCharacters:a,fullLiteralTraversal:n.fullLiteralTraversal??!1});if(o==="topology")return ie;let Ot=(n.behaviorFocusLocations?.length??0)>0?new Set([...ie.anchors.flatMap(x=>x.nodeIds),...ie.paths.flatMap(x=>x.nodeIds)]).size:void 0,Ge=dn(t,ie,{focusLocations:n.behaviorFocusLocations,...Ot?{maxSteps:Ot}:{}});pn(t,ie,Ge);let Co=Ri(t,ie,Ge,n.behaviorFocusLocations??[]);ie.corridor=zn(ie,{focusLocations:Co});let _t=un(t,ie,Ge,{sourceAllowed:$,selectionTerms:n.selectionTerms}),Kt=Hi(ie),Lo=Yi(i,s,r,d,c,l,n.fullLiteralTraversal??!1,a,M,h,_,k,Kt),wo=Qi(i,s,r,M.filter(x=>Kt.has(x.id)),_,d,c,l,n.fullLiteralTraversal??!1,a);return{anchors:y,regions:M,regionRelations:h,externalBoundaries:ct,boundaryFrontiers:we,unmatchedExpansions:U,expansion:wo,drilldown:W,presentation:Lo,topology:ie,behavior:Ge,nextAnchors:_t,closure:{status:ut,emitted:{regions:M.length,relations:H.length,runtimeLinks:p.size},withheld:{symbols:K,files:ae+Le,regions:ie.nodes.filter(x=>x.kind==="structural-region"&&x.disposition==="folded").length,drillAnchors:(W?.omittedAnchors??0)+_t.omittedAnchors,literalMatches:v},ambiguous:{anchors:y.filter(x=>x.status==="ambiguous").length,omittedSymbolCandidates:E},external:ct.length,unresolved:we.length,explanation:ut==="accounted"?"Every fact reached under the declared anchors, relations, depth, evidence floor, source scopes, and installed analyzers is accounted for as emitted, withheld, ambiguous, external, or unresolved.":"Some ambiguous symbol candidates were not identified, so the declared query is not fully accounted for."},coverage:{explicitAnchorCount:y.length,requestedRelationKinds:d,evidenceFloor:c,includedSourceScopes:l,matchedAnchorCount:y.filter(x=>x.status!=="missing").length,literalSearchesComplete:!0,broadLiteralAnchors:C,withheldLiteralMatches:v,symbolCandidateSetsComplete:E===0,omittedSymbolCandidates:E,maxTraversalDepth:r,frontierSymbols:K,frontierFiles:ae,supportFilesNotTraversed:Le,filteredUnverifiedCallEdges:F,memberCallCandidateEdges:g,unresolvedMemberCallsites:R,runtimeBoundaryEvidenceAvailable:f!==null,runtimeBoundaryObservations:f?.observations.length??0,runtimeBoundaryExactLinks:T,runtimeBoundaryDerivedLinks:oe,runtimeBoundaryCandidateLinks:re,repositoryRuntimeBoundaryExactLinks:be,repositoryRuntimeBoundaryDerivedLinks:Se,repositoryRuntimeBoundaryCandidateLinks:ke,runtimeBoundaryTraversedLinks:p.size,runtimeBoundaryFrontiers:we.length,referenceExpansionEligibleSymbols:ze.filter(x=>x.referenceScope!=="none").length,referenceExpansionSkippedSymbols:ze.filter(x=>x.referenceScope==="none").length,dynamicDispatchRepresented:f?.links.some(x=>x.joinRule==="carrier.discriminator"&&p.has(x.id))??!1,runtimeGeneratedLinksRepresented:f!==null,regionBoundariesAreStructural:!0,relationFamilies:{"literal-anchor":{evidence:"exact-source",scope:"all indexed documents for each explicit literal",completeWithinScope:!0},reference:{evidence:"compiler-graph",scope:"all cross-file indexed/source-attributed sites for explicit anchors and promoted non-module boundary symbols",completeWithinScope:!0},call:{evidence:"mixed",scope:"static callees plus exact SCIP call occurrences in traversed source ranges, exact constructor-assigned member receivers, and uniquely attributed direct-import member candidates",completeWithinScope:!0},"contract-symbol":{evidence:"compiler-graph",scope:"compiler-resolved symbol identities referenced across inferred workspace boundaries",completeWithinScope:!0},import:{evidence:"compiler-graph",scope:"all indexed or source-resolved imports of traversed primary files",completeWithinScope:!0},"runtime-boundary":{evidence:"exact-source",scope:"direct and mechanically derived links produced by grounded runtime adapters and factorized relation groups",completeWithinScope:!0}},blindSpots:Bt}}}function Li(e,t){let{db:n,relationPolicy:o,sourceConstructs:i,reverseExpandedSourceConstructs:s,pendingRelations:r,reverseFileGraph:a,serviceCallerFilesBySourceConstruct:d,sourceAllowed:c,memberCallTargetsForWholeFile:l,addSymbol:u,addSourceConstruct:f}=e;if(o.has("call")){let m=[...i.values()].filter(p=>p.traversalEligible&&p.reverseCallExpansion&&p.depth<=t&&!s.has(de(p)));for(let p of m){s.add(de(p));let b=ce(n,p.file);if((b?.callables??[]).filter(I=>I.name===p.name&&I.startLine<=p.endLine&&I.endLine>=p.startLine).length===1){let I=(b?.callSites??[]).filter(L=>L.calleeLeaf===p.name&&!L.memberAccess);for(let L of I){let N=t+1,y=Me(fe(n,p.file),L.line),E=null,C=null;if(y&&!Y(y.symbol)){if(y.relativePath===p.file&&y.startLine<=p.endLine&&y.endLine>=p.startLine)continue;u(y,N,"reverse-local-call-owner",void 0,"forward-regions",!0),E=y.symbol}else{let v=Pt(n,p.file,L.line);v&&de(v)!==de(p)&&(C=f(v,N,"reverse-local-call-source-owner",void 0,!0))}!E&&!C||ne(r,{kind:"call",evidence:"ast-callsite",fromFile:p.file,fromSymbol:E,toFile:p.file,toSymbol:null,fromSourceConstruct:C?X(C):void 0,toSourceConstruct:X(p),line:L.line,strength:"derived"})}}let w=new Set([...a.get(p.file)??[],...d.get(de(p))??[],...sn(n,p.file).flatMap(I=>[...a.get(I)??[]])]);for(let I of w){if(!c(I))continue;let N=l(I).targets.filter(y=>y.targetFile===p.file&&y.targetStartLine<=p.endLine&&y.targetEndLine>=p.startLine);for(let y of N){let E=t+1,C=Me(fe(n,I),y.line),v=null,F=null;if(C&&!Y(C.symbol))u(C,E,"reverse-member-call-owner",void 0,"cross-workspace-or-forward",!0),v=C.symbol;else{let g=Pt(n,I,y.line);g&&(F=f(g,E,"reverse-member-call-source-owner",void 0,!0))}!v&&!F||ne(r,{kind:"call",evidence:"ast-service-member-callsite",fromFile:I,fromSymbol:v,toFile:p.file,toSymbol:null,fromSourceConstruct:F?X(F):void 0,toSourceConstruct:X(p),line:y.line,strength:y.strength==="exact"?"exact":"derived"})}}}}}function wi(e,t){let{db:n,index:o,relationPolicy:i,symbols:s,sourceAllowed:r,files:a,workspaces:d,addFile:c,addSymbol:l,addSourceConstruct:u,pendingRelations:f,fileGraph:m,traversalMetrics:p}=e,b=[...s.values()].filter(w=>!w.processed&&w.depth<=t),S=i.has("call")?o.calleeMap(b.map(w=>w.definition),{additive:!1,semantic:!1}):new Map;for(let w of b){w.processed=!0;let I=w.definition;if(w.referenceScope!=="none"&&(i.has("call")||i.has("reference")||i.has("contract-symbol"))){let L=us(n,o,I).filter(y=>r(y.file)&&bs(w,y.file,a,d)),N=new Set(L.flatMap(y=>{if(!(i.has("call")&&ce(n,y.file)?.callSites.some(v=>v.line===y.line&&lo(n,y.file,v,I))===!0)||!y.enclosingSymbol)return[];let C=ye(n,o,y.enclosingSymbol).matches[0];return C&&!Y(C.symbol)?[{owner:C,site:y}]:[]}).sort((y,E)=>{let C=ee(I.relativePath,d).relativeDir,v=ee(y.owner.relativePath,d).relativeDir===C,F=ee(E.owner.relativePath,d).relativeDir===C,g=co(n,y.owner),R=co(n,E.owner),$=y.owner.endLine-y.owner.startLine,B=E.owner.endLine-E.owner.startLine;return Number(F)-Number(v)||R-g||$-B||y.owner.symbol.localeCompare(E.owner.symbol)}).filter((y,E,C)=>C.findIndex(v=>v.owner.symbol===y.owner.symbol)===E).reduce((y,E)=>{if(y.length>=yi)return y;let C=ee(E.owner.relativePath,d).relativeDir;return y.some(v=>v.workspace===C)||y.push({symbol:E.owner.symbol,workspace:C}),y},[]).map(y=>y.symbol));for(let y of L){let E=t+1;c(y.file,E,`reference:${V(I.symbol)}`,!0);let C=i.has("call")&&ce(n,y.file)?.callSites.some(g=>g.line===y.line&&lo(n,y.file,g,I))===!0,v=null,F=null;if(y.enclosingSymbol){let g=ye(n,o,y.enclosingSymbol).matches[0];g&&!Y(g.symbol)&&(l(g,E,"reference-owner",void 0,C&&N.has(g.symbol)?w.referenceScope:"none"),v=g.symbol)}if(!v&&y.line!==null){let g=Pt(n,y.file,y.line);g&&(F=u(g,E,"reference-source-owner",void 0,C))}i.has("reference")&&ne(f,{kind:"reference",evidence:"indexed-or-source-reference",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"mixed"}),C&&ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"derived"}),i.has("contract-symbol")&&ee(y.file,d).relativeDir!==ee(I.relativePath,d).relativeDir&&ne(f,{kind:"contract-symbol",evidence:"compiler-cross-workspace-symbol",fromFile:y.file,fromSymbol:v,toFile:I.relativePath,toSymbol:I.symbol,fromSourceConstruct:F?X(F):void 0,line:y.line,strength:"exact"})}}for(let L of S.get(I.symbolId)??[]){let N=ye(n,o,L.symbol).matches.find(E=>E.relativePath===L.file);if(!N||!r(N.relativePath))continue;if(!(N.relativePath===I.relativePath||(m.get(I.relativePath)??new Set).has(N.relativePath))){p.filteredUnverifiedCallEdges+=1;continue}l(N,t+1,`call:${V(I.symbol)}`,void 0,"none",!0),ne(f,{kind:"call",evidence:L.source,fromFile:I.relativePath,fromSymbol:I.symbol,toFile:N.relativePath,toSymbol:N.symbol,line:null,strength:Vi(L.source)})}}}function Mi(e,t){let{db:n,index:o,relationPolicy:i,files:s,sourceConstructs:r,symbols:a,boundaryObservations:d,boundaryObservationDepths:c,sourceAllowed:l,addSymbol:u,pendingRelations:f,traversalMetrics:m,addSourceConstruct:p,serviceCallerFilesBySourceConstruct:b,reverseFileGraph:S,externalImports:w,addFile:I,workspaces:L}=e,N=[...s.values()].filter(y=>!y.processed&&y.primary&&y.depth<=t);for(let y of N){y.processed=!0;let E=[...r.values()].filter(h=>h.traversalEligible&&h.file===y.file&&h.depth<=t),C=[...a.values()].filter(h=>h.definition.relativePath===y.file&&h.depth<=t).map(h=>{let k=ht(n,y.file,h.definition.startLine);return{startLine:k?.startLine??h.definition.startLine,endLine:k?.endLine??h.definition.endLine}}),v=h=>[...a.values()].filter(k=>k.definition.relativePath===y.file&&k.definition.startLine<=h&&k.definition.endLine>=h).sort((k,M)=>k.definition.endLine-k.definition.startLine-(M.definition.endLine-M.definition.startLine)||k.definition.startLine-M.definition.startLine)[0],F=[...d.values()].filter(h=>h.source.file===y.file&&c.has(h.id)),g=[...E.map(h=>({startLine:h.startLine,endLine:h.endLine})),...F.map(h=>({...st(n,h)}))],R=[...C,...g],$=(ce(n,y.file)?.callSites??[]).filter(h=>R.some(k=>h.line>=k.startLine&&h.line<=k.endLine)),B=new Set;if(i.has("call"))for(let h of R){let k=an(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath))continue;let _=v(M.sourceLine),W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-call:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"call",evidence:"scip-occurrence-callsite",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"}),B.add(`${M.sourceLine}\0${M.calleeLeaf}`)}}if(i.has("reference"))for(let h of R){let k=ln(n,y.file,h.startLine,h.endLine);for(let M of k.targets){if(!l(M.definition.relativePath)||B.has(`${M.sourceLine}\0${M.calleeLeaf}`))continue;let _=v(M.sourceLine);if(_?.definition.symbol===M.definition.symbol)continue;let W=E.find(U=>U.startLine<=M.sourceLine&&U.endLine>=M.sourceLine),q=F.find(U=>{let K=st(n,U);return K.startLine<=M.sourceLine&&K.endLine>=M.sourceLine});u(M.definition,t+1,`scip-occurrence-reference:${y.file}:${M.sourceLine+1}`,void 0,"none",!0),ne(f,{kind:"reference",evidence:"scip-occurrence-reference",fromFile:y.file,fromSymbol:_?.definition.symbol??null,toFile:M.definition.relativePath,toSymbol:M.definition.symbol,fromBoundaryParticipant:q?Pe(q):void 0,fromSourceConstruct:W?X(W):void 0,line:M.sourceLine,strength:"exact"})}}let A=i.has("call")?St(n,y.file,{ranges:R,excludeIndexedTargets:!1}):{targets:[],unresolvedCallsites:0};m.unresolvedMemberCallsites+=A.unresolvedCallsites;let H=A.targets.filter(h=>!B.has(`${h.line}\0${h.calleeLeaf}`));m.memberCallCandidateEdges+=H.filter(h=>h.strength!=="exact"&&(h.resolution!=="imported-service-object-member"||(h.resolutionAlternativeCount??0)>1)).length;for(let h of H){let k=(h.resolutionAlternativeCount??1)===1,M=h.targetSymbol?fe(n,h.targetFile).find(K=>K.symbol===h.targetSymbol):void 0,_=M?null:p({file:h.targetFile,name:h.calleeLeaf,startLine:h.targetStartLine,endLine:h.targetEndLine},t+1,`member-call:${y.file}`,void 0,h.resolution==="imported-service-object-member"&&k,k);if(_&&h.serviceFile){let K=de(_),ae=b.get(K)??new Set;for(let Le of S.get(h.serviceFile)??[])ae.add(Le);b.set(K,ae)}M&&u(M,t+1,`member-call:${y.file}`,void 0,"none",!0);let W=E.find(K=>K.startLine<=h.line&&K.endLine>=h.line),q=v(h.line),U=F.find(K=>{let ae=st(n,K);return ae.startLine<=h.line&&ae.endLine>=h.line});ne(f,{kind:"call",evidence:h.resolution==="constructed-member-receiver"?"ast-constructed-member-callsite":h.resolution==="factory-callback-member"?"ast-factory-callback-callsite":h.resolution==="imported-service-object-member"?"ast-service-member-callsite":"ast-member-import-candidate",fromFile:y.file,fromSymbol:q?.definition.symbol??null,toFile:h.targetFile,toSymbol:M?.symbol??null,fromBoundaryParticipant:U?Pe(U):void 0,fromSourceConstruct:W?X(W):void 0,toSourceConstruct:_?X(_):void 0,line:h.line,strength:h.resolution==="imported-service-object-member"?(h.resolutionAlternativeCount??0)===1?"derived":"candidate":h.strength??"candidate"})}for(let h of i.has("import")||i.has("call")?ps(n,y.file):[]){if(!h.fromFile){if(i.has("import")){let M=w.get(h.shortName)??{name:h.shortName,fromFiles:new Set};M.fromFiles.add(y.file),w.set(h.shortName,M)}continue}if(!l(h.fromFile))continue;if(i.has("import")&&(I(h.fromFile,t+1,`import:${y.file}`,!1),ne(f,{kind:"import",evidence:"indexed-or-source-import",fromFile:y.file,fromSymbol:null,toFile:h.fromFile,toSymbol:h.symbol,line:null,strength:"mixed"})),i.has("call")&&$.length>0){let M=(h.source==="compiler"?ye(n,o,h.symbol).matches:Jt(n,h.fromFile,h.importedName)).filter(_=>!Y(_.symbol));for(let _ of M){let W=$.filter(q=>q.calleeLeaf===h.localName).map(q=>q.line);if(W.length!==0){u(_,t+1,`source-call:${y.file}`,void 0,"none",!0);for(let q of W)ne(f,{kind:"call",evidence:"ast-callsite",fromFile:y.file,fromSymbol:null,toFile:_.relativePath,toSymbol:_.symbol,line:q,strength:"derived"})}}}if(!y.promoteBoundaryImports||!gs(y.file,h.fromFile,L))continue;let k=ye(n,o,h.symbol);for(let M of k.matches)if(ys(M.relativePath,h.fromFile,L)&&!Y(M.symbol)){let _=ee(y.file,L).relativeDir!==ee(M.relativePath,L).relativeDir;u(M,t+1,`boundary-import:${y.file}`,void 0,_?"cross-workspace-or-forward":"forward-regions")}}}}function Ni(e,t){let{relationPolicy:n,runtimeBoundaries:o,evidenceFloor:i,representedBoundaryLinkIds:s,boundaryObservations:r,sourceAllowed:a,boundaryObservationDepths:d,symbols:c,sourceConstructs:l,addBoundaryObservation:u,pendingRelations:f}=e;for(let m of n.has("runtime-boundary")?o?.links??[]:[]){if(m.strength==="candidate"||i==="exact"&&m.strength!=="exact"||s.has(m.id))continue;let p=r.get(m.from),b=r.get(m.to);if(!p||!b||!a(p.source.file)||!a(b.source.file))continue;let S=yo(p,t,d,c,l),w=yo(b,t,d,c,l);if(S===null&&w===null)continue;let I=t+1,L=u(p,S??I,`runtime-boundary:${m.joinRule}`),N=u(b,w??I,`runtime-boundary:${m.joinRule}`),y=L?null:go(l,p),E=N?null:go(l,b);d.set(p.id,S??I),d.set(b.id,w??I),ne(f,{kind:"runtime-boundary",evidence:`runtime-boundary:${m.joinRule}`,fromFile:p.source.file,fromSymbol:L,toFile:b.source.file,toSymbol:N,fromBoundaryParticipant:Pe(p),toBoundaryParticipant:Pe(b),fromSourceConstruct:y?X(y):void 0,toSourceConstruct:E?X(E):void 0,runtimeBoundaryKey:m.matchedKeyParts.map(C=>`${C.name}=${C.value}`).join(" "),line:p.source.startLine,strength:m.strength}),s.add(m.id)}}function So(e,t,n){let o=$e(t.searches??[]),i=$e(t.symbols??[]),s=$e(t.relations&&t.relations.length>0?t.relations:so),r=s.filter(T=>!so.includes(T));if(r.length>0)throw new Error(`Unsupported system-map relation kind(s): ${r.join(", ")}`);let a=new Set(s),d=t.evidenceFloor??"derived";if(d!=="exact"&&d!=="derived")throw new Error(`Unsupported system-map evidence floor: ${d}`);let c=$e(t.sourceScopes&&t.sourceScopes.length>0?t.sourceScopes:["production"]),l=["production","test","fixture","example","generated","script","unknown"],u=c.filter(T=>!l.includes(T));if(u.length>0)throw new Error(`Unsupported system-map source scope(s): ${u.join(", ")}`);let f=new Set(c),m=T=>f.has(bt(T));if(o.length===0&&i.length===0)throw new Error("system-map requires at least one --search or --symbol anchor.");let p=t.maxDepth??di;if(!Number.isSafeInteger(p)||p<0)throw new RangeError(`maxDepth must be a non-negative safe integer; received ${p}`);let b=t.maxTopologyCharacters??Si;if(!Number.isSafeInteger(b)||b<=0)throw new RangeError(`maxTopologyCharacters must be a positive safe integer; received ${b}`);let S=new Yt(e),{fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N}=hs(e,S),y=new Map((N?.observations??[]).map(T=>[T.id,T])),E=new Set((N?.observations??[]).map(T=>`${T.source.file}\0${T.source.startLine}`)),C=new Set,v=new Map,F=new Map,g=new Map,R=new Map,$=[],B=new Map,A=new Map,H=[],h={filteredUnverifiedCallEdges:0,memberCallCandidateEdges:0,unresolvedMemberCallsites:0},k=new Set,M=new Map,_=new Map,W=T=>{let oe=_.get(T);if(oe)return oe;let re=St(e,T,{excludeIndexedTargets:!1});return _.set(T,re),re},q=(T,oe,re,be,Se=!1)=>hi(F,T,oe,re,be,Se),U=(T,oe,re,be,Se="none",ke=!1)=>xi(g,q,T,oe,re,be,Se,ke),K=(T,oe,re,be,Se=!1,ke=!0)=>vi(R,q,T,oe,re,be,Se,ke),ae=(T,oe,re)=>Ei({db:e,index:S,pendingRelations:B,addFile:q,addSymbol:U,addSourceConstruct:K,observation:T,depth:oe,origin:re}),{omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we}=Ii({db:e,index:S,searches:o,symbolQueries:i,opts:t,boundaryObservationLocations:E,sourceAllowed:m,addFile:q,addSymbol:U,addSourceConstruct:K,literalHits:$,anchors:H}),me={db:e,index:S,relationPolicy:a,evidenceFloor:d,sourceAllowed:m,fileGraph:w,reverseFileGraph:I,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,boundaryObservationDepths:v,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,pendingRelations:B,externalImports:A,reverseExpandedSourceConstructs:k,serviceCallerFilesBySourceConstruct:M,traversalMetrics:h,memberCallTargetsForWholeFile:W,addFile:q,addSymbol:U,addSourceConstruct:K,addBoundaryObservation:ae};for(let T=0;T<p;T+=1)Li(me,T),wi(me,T),Mi(me,T),Ni(me,T);return Ci({db:e,opts:t,mode:n,searches:o,symbolQueries:i,maxDepth:p,maxTopologyCharacters:b,requestedRelationKinds:s,evidenceFloor:d,includedSourceScopes:c,workspaces:L,runtimeBoundaries:N,boundaryObservations:y,representedBoundaryLinkIds:C,files:F,symbols:g,sourceConstructs:R,literalHits:$,pendingRelations:B,externalImports:A,anchors:H,omittedSymbolCandidates:Le,broadLiteralAnchors:ze,withheldLiteralMatches:we,filteredUnverifiedCallEdges:h.filteredUnverifiedCallEdges,memberCallCandidateEdges:h.memberCallCandidateEdges,unresolvedMemberCallsites:h.unresolvedMemberCallsites,sourceAllowed:m})}function Ri(e,t,n,o){let i=new Map,s=d=>{i.set(`${d.file}\0${d.line}`,d)};for(let d of o)s(d);let r=new Set(t.anchors.filter(d=>d.status==="matched").flatMap(d=>d.nodeIds));for(let d of n.steps)if(!(!d.location||!r.has(d.nodeId)||(d.behavior?.rawCharacters??1/0)>3e3))for(let c of d.behavior?.lines??[])c.signals.some(l=>bi.has(l))&&s({file:d.location.file,line:c.line,endLine:c.endLine});let a=t.edges.filter(d=>d.disposition==="emitted").flatMap(d=>d.evidence.flatMap(c=>c.location?[c.location]:[]));for(let d of a){s(d);let c=t.nodes.filter(u=>u.location?.file===d.file&&["symbol","source-construct","runtime-boundary-participant"].includes(u.kind)&&u.location.line<=d.line&&(u.location.endLine??u.location.line)>=d.line).sort((u,f)=>(u.location.endLine??u.location.line)-u.location.line-((f.location.endLine??f.location.line)-f.location.line)||u.id.localeCompare(f.id))[0];if(!c?.location)continue;let l=nn(e,d.file,c.location.line,c.location.endLine??c.location.line,[d.line]);for(let u of l)s({file:d.file,line:u.line,endLine:u.endLine})}return[...i.values()].sort((d,c)=>d.file.localeCompare(c.file)||d.line-c.line)}function Fi(e){if(e.ownerStartLine===null||e.ownerStartLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner start line.`);if(e.ownerEndLine===null||e.ownerEndLine===void 0)throw new Error(`Literal hit ${e.file}:${e.line+1} has no source-owner end line.`);return{file:e.file,name:e.ownerShortName??`${e.file}:${e.ownerStartLine+1}`,startLine:e.ownerStartLine,endLine:e.ownerEndLine}}function de(e){return`${e.file}\0${e.startLine}\0${e.endLine}\0${e.name}`}function X(e){return{file:e.file,name:e.name,startLine:e.startLine,endLine:e.endLine}}function lo(e,t,n,o){if(n.calleeLeaf===o.leaf)return!0;let i=Gt(e,t,n.calleeLeaf);return i!==null&&i.importedName===o.leaf&&i.sourcePath!==null&&pt(i.sourcePath,o.relativePath)}function at(e,t){let n=He(ce(e,t.file)?.callables??[],t.startLine);if(n&&n.endLine>=t.endLine)return{file:t.file,name:/^source@\d+$/u.test(n.name)&&!/^source@\d+$/u.test(t.name)?t.name:n.name,startLine:n.startLine,endLine:n.endLine};let o=xo(e,t.file,t.startLine);return o&&o.endLine>=t.endLine?{file:t.file,name:o.name,startLine:o.startLine,endLine:o.endLine}:X(t)}function Te(e){return te("source-construct",e.file,String(e.startLine),String(e.endLine),e.name)}function lt(e,t){let n=Ht(e,t.symbol,t.relativePath),o=new Set(["package-surface-file","transitive-package-surface"]),i=n.filter(r=>!o.has(r)||cn(e,t)),s=i.some(r=>!o.has(r));return{evidence:i,priority:s||Wt(e,t.symbol,t.relativePath)?2:1}}function co(e,t){let n=lt(e,t);return n.evidence.length>0?n.priority:0}function Ti(e,t){let n=fe(e,t.file),o=n.filter(i=>i.startLine<=t.startLine&&i.endLine>=t.startLine).sort((i,s)=>i.endLine-i.startLine-(s.endLine-s.startLine)||i.startLine-s.startLine);for(let i of o){let s=lt(e,i);if(s.evidence.length>0)return s}for(let i of Pi(e,t.file,t.startLine)){let s=n.filter(r=>r.leaf===i.name).sort((r,a)=>Math.abs(r.startLine-i.startLine)-Math.abs(a.startLine-i.startLine)||r.symbol.localeCompare(a.symbol));for(let r of s){let a=lt(e,r);if(a.evidence.length>0)return a}return{evidence:[],priority:0}}return{evidence:[],priority:0}}function Pi(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return[];let i=[],s=At(o,n);for(;s;){if(s.type==="variable_declarator"||s.type==="function_declaration"||s.type==="generator_function_declaration"||s.type==="class_declaration"){let r=s.childForFieldName("name")??s.namedChild(0);(r?.type==="identifier"||r?.type==="type_identifier")&&i.push({name:r.text,startLine:s.startPosition.row})}s=s.parent}return i}function ki(e){return[...new Map([...e.sourceConstructStates.values()].map(t=>at(e.db,t)).map(t=>[de(t),t])).values()].sort((t,n)=>t.file.localeCompare(n.file)||t.startLine-n.startLine||t.endLine-n.endLine)}function $i(e,t){return e.anchors.map((n,o)=>{let i=te("anchor",String(o),n.kind,n.query),s=[...e.symbolStates.values()].filter(l=>l.anchorQueries.has(n.query)).flatMap(l=>{if(!Y(l.definition.symbol))return[ge(l.definition.symbol)];let u=t.filter(f=>f.file===l.definition.relativePath).map(f=>Te(f));return u.length>0?u:[ge(l.definition.symbol)]}),r=[...e.sourceConstructStates.values()].filter(l=>l.anchorQueries.has(n.query)).map(l=>Te(at(e.db,l))),a=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&l.ownerSymbol&&e.symbolStates.has(l.ownerSymbol)).map(l=>ge(l.ownerSymbol)),d=e.literalHits.filter(l=>l.query===n.query&&l.traversalSeed===!0&&!l.ownerSymbol&&l.ownerStartLine!==null&&l.ownerStartLine!==void 0&&l.ownerEndLine!==null&&l.ownerEndLine!==void 0).map(l=>Te(at(e.db,Fi(l)))),c=D(n.kind==="symbol"?[...s,...r]:a.length+d.length>0?[...a,...d]:n.seedRegionIds??[]);return{id:i,kind:n.kind,query:n.query,status:n.status,nodeIds:n.status==="ambiguous"?[]:c,candidateNodeIds:n.status==="ambiguous"?c:[],omittedCandidates:n.omittedSymbolCandidates??0}})}function Ai(e){let t=new Map;for(let n of e)for(let o of[...n.nodeIds,...n.candidateNodeIds]){let i=t.get(o)??[];i.push(n.id),t.set(o,i)}return t}function Di(e,t,n){let o=e.relations.flatMap(r=>[r.fromBoundaryParticipant,r.toBoundaryParticipant].flatMap(a=>a?.ownerName?[a]:[])),i=e.regions.map(r=>({id:r.id,kind:"structural-region",label:r.label,disposition:"folded",location:null,anchorIds:D(n.get(r.id)??[]),attributes:{workspace:r.workspace,structuralPath:r.structuralPath,minimumDepth:r.minDepth,files:r.fileCount,symbols:r.symbolCount,expanded:r.expanded}}));for(let r of e.symbolStates.values()){let a=e.regionForFile.get(r.definition.relativePath)?.id;if(!a)throw new Error(`System-map symbol ${r.definition.symbol} has no structural region.`);let d=ge(r.definition.symbol),c=lt(e.db,r.definition);i.push({id:d,kind:"symbol",label:V(r.definition.symbol),disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.definition.relativePath,line:r.definition.startLine,endLine:r.definition.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,depth:r.depth,leaf:r.definition.leaf??V(r.definition.symbol),referenceScope:r.referenceScope,...c.evidence.length>0?{publicEntry:!0,publicEntryPriority:c.priority,publicEntryEvidence:c.evidence.join(",")}:{}}})}for(let r of t){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Source construct ${r.name} has no structural region.`);let d=Te(r),l=o.find(f=>f.file===r.file&&f.line>=r.startLine&&f.line<=r.endLine)?.ownerName??r.name,u=Ti(e.db,r);i.push({id:d,kind:"source-construct",label:l,disposition:(n.get(d)?.length??0)>0?"emitted":"folded",location:{file:r.file,line:r.startLine,endLine:r.endLine},anchorIds:D(n.get(d)??[]),attributes:{regionId:a,leaf:l,sourceOwned:!0,...u.evidence.length>0?{publicEntry:!0,publicEntryPriority:u.priority,publicEntryEvidence:u.evidence.join(",")}:{}}})}let s=new Map;for(let r of e.relations)r.fromBoundaryParticipant&&s.set(r.fromBoundaryParticipant.observationId,r.fromBoundaryParticipant),r.toBoundaryParticipant&&s.set(r.toBoundaryParticipant.observationId,r.toBoundaryParticipant);for(let r of[...s.values()].sort((a,d)=>a.observationId.localeCompare(d.observationId))){let a=e.regionForFile.get(r.file)?.id;if(!a)throw new Error(`Runtime-boundary participant ${r.observationId} has no structural region.`);i.push({id:Dt(r.observationId),kind:"runtime-boundary-participant",label:r.address||r.ownerName||`${r.role} ${r.action}`,disposition:"folded",location:{file:r.file,line:r.line,endLine:r.endLine},anchorIds:[],attributes:{regionId:a,action:r.action,protocol:r.protocol,role:r.role,...r.address?{address:r.address}:{},ownerSymbol:r.ownerSymbol}})}return i}function Bi(e,t,n,o,i,s,r,a,d,c=!1){let l=o?ge(o):null;if(l&&t.has(l)&&!Y(o))return l;let u=i?Dt(i.observationId):null;if(c&&u&&t.has(u))return u;let f=s?Te(at(e,s)):null;if(f&&t.has(f))return f;if(u&&t.has(u))return u;let m=d===null?null:(n.get(a)??[]).filter(p=>p.startLine<=d&&p.endLine>=d).sort((p,b)=>p.endLine-p.startLine-(b.endLine-b.startLine)||p.startLine-b.startLine)[0]??null;return m?Te(m):l&&t.has(l)?l:r}function Oi(e,t,n){let o=new Set(t.map(c=>c.id)),i=se(n,c=>c.file),s=(c,l,u,f,m,p,b=!1)=>Bi(e.db,o,i,c,l,u,f,m,p,b),r=[];for(let c of e.symbolStates.values()){let l=e.regionForFile.get(c.definition.relativePath)?.id;if(!l)continue;let u=ge(c.definition.symbol);r.push({id:te("edge","structural-membership",l,u),kind:"structural-membership",fromNodeId:l,toNodeId:u,directed:!0,disposition:"folded",semantics:Ve("structural-membership"),evidence:[{method:"indexed-definition-file",strength:"exact",identity:c.definition.symbol,location:{file:c.definition.relativePath,line:c.definition.startLine,endLine:c.definition.endLine}}]})}let a=se(e.relations,c=>`${s(c.fromSymbol,c.fromBoundaryParticipant,c.fromSourceConstruct,c.fromRegionId,c.fromFile,c.line,c.kind==="runtime-boundary")}\0${s(c.toSymbol,c.toBoundaryParticipant,c.toSourceConstruct,c.toRegionId,c.toFile,null)}\0${c.kind}`),d=new Set;for(let c of a.values()){let l=c[0],u=s(l.fromSymbol,l.fromBoundaryParticipant,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line,l.kind==="runtime-boundary"),f=s(l.toSymbol,l.toBoundaryParticipant,l.toSourceConstruct,l.toRegionId,l.toFile,null);if(l.kind==="runtime-boundary"&&l.fromBoundaryParticipant){let p=Dt(l.fromBoundaryParticipant.observationId),b=s(l.fromSymbol,void 0,l.fromSourceConstruct,l.fromRegionId,l.fromFile,l.line);b!==p&&!d.has(p)&&(d.add(p),r.push({id:te("edge","boundary-observation",b,p),kind:"boundary-observation",fromNodeId:b,toNodeId:p,directed:!0,disposition:"folded",semantics:Ve("boundary-observation"),evidence:[{method:"runtime-boundary-observation-owner",strength:l.strength??"unknown",identity:l.fromBoundaryParticipant.observationId,location:{file:l.fromBoundaryParticipant.file,line:l.fromBoundaryParticipant.line,endLine:l.fromBoundaryParticipant.endLine}}]}))}(u===f?t.find(p=>p.id===u):null)?.kind!=="structural-region"&&r.push({id:te("edge",l.kind,u,f),kind:l.kind,fromNodeId:u,toNodeId:f,directed:!0,disposition:"folded",semantics:gn(l),evidence:Wi(c.map(p=>({method:p.evidence,strength:p.strength??"unknown",identity:p.kind==="runtime-boundary"&&p.runtimeBoundaryKey?p.runtimeBoundaryKey:`${p.fromSymbol??p.fromFile} -> ${p.toSymbol??p.toFile}`,location:p.line===null?null:{file:p.fromFile,line:p.line}})))})}return r}function _i(e,t,n){for(let i of e.externalBoundaries){let s=te("external",i.kind,i.name),r=D(i.fromRegionIds);t.push({id:s,kind:i.kind,label:i.name,disposition:"folded",location:null,anchorIds:[],attributes:{}});for(let a of r)n.push({id:te("edge",i.kind,a,s),kind:i.kind,fromNodeId:a,toNodeId:s,directed:!0,disposition:"folded",semantics:Ve("external-import"),evidence:[{method:"indexed-or-source-import",strength:"mixed",identity:`${a} -> ${i.name}`,location:null}]})}let o=[];return e.boundaryFrontiers.forEach((i,s)=>{let r=e.regionForFile.get(i.file)?.id;if(!r)throw new Error(`Runtime-boundary frontier ${i.observationId} has no system-map region.`);let a=te("unsupported","runtime-boundary",i.observationId,String(s)),d=te("edge","runtime-boundary-frontier",r,a);t.push({id:a,kind:"runtime-boundary-frontier",label:i.address,disposition:"unsupported",location:{file:i.file,line:i.line},anchorIds:[],attributes:{action:i.action,strength:i.strength,owner:i.ownerShortName}}),n.push({id:d,kind:"runtime-boundary-frontier",fromNodeId:r,toNodeId:a,directed:!0,disposition:"unsupported",evidence:[{method:"runtime-boundary-extractor",strength:i.strength,identity:i.observationId,location:{file:i.file,line:i.line}}]}),o.push({id:te("frontier","runtime-boundary",i.observationId,String(s)),kind:"runtime-boundary",direction:"unresolved",fromNodeIds:[r],edgeIds:[d],memberNodeIds:[a],memberCount:1,disposition:"unsupported",reason:i.reason,expansion:null})}),o}function Ki(e,t){let n=t.topologyFrontiers.some(p=>p==="frontier:program-facts"),o=oo(e,{expandedFrontierIds:t.topologyFrontiers.filter(p=>p!=="frontier:program-facts"),routeIds:t.routeIds}),i=o.nodes.filter(p=>p.disposition==="emitted"||o.anchors.some(b=>b.status==="matched"&&b.nodeIds.includes(p.id))),s=t.relations.filter(p=>i.some(b=>qi(p,b))),r=t.boundaryFrontiers.filter(p=>i.some(b=>Ui(p,b))),a=Ln(t.db,s,i),d=Mn(t.db,i),c=_n(t.db,i,r),l=[...a.nodes,...d.nodes,...c.nodes].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),u=[...a.edges,...d.edges,...c.edges].map(p=>n&&p.disposition==="folded"?{...p,disposition:"emitted"}:p),f=n?null:zi(i,l,u),m=it({anchors:o.anchors,nodes:[...o.nodes,...l],edges:[...o.edges,...u],paths:o.paths,frontiers:[...o.frontiers,...a.frontiers,...d.frontiers,...c.frontiers,...f?[f]:[]],scope:o.coverage.scope,blindSpots:[...o.coverage.blindSpots,...a.blindSpots,...d.blindSpots,...c.blindSpots],incompleteReasons:o.coverage.status==="incomplete"?[o.coverage.explanation]:[],...o.routeCatalog?{routeCatalog:o.routeCatalog}:{}});m.completion=o.completion;for(let p of m.frontiers)p.disposition==="folded"&&(p.id.startsWith("frontier:program-facts:")||(p.expansion=Gi(t,p.id)));return m}function ji(e){let t=ki(e),n=$i(e,t),o=Di(e,t,Ai(n)),i=Oi(e,o,t),s=_i(e,o,i);return Ki(it({anchors:n,nodes:o,edges:i,paths:[],frontiers:s,scope:`explicit anchors; relations ${e.requestedRelationKinds.join(", ")}; depth ${e.maxDepth}; evidence floor ${e.evidenceFloor}; source scopes ${e.includedSourceScopes.join(", ")}`,blindSpots:[...e.blindSpots],incompleteReasons:e.closureStatus==="incomplete"?[`${e.omittedSymbolCandidates} ambiguous symbol candidate(s) were omitted`]:[]}),e)}function qi(e,t){if(e.fromSymbol&&t.id===ge(e.fromSymbol)||e.toSymbol&&t.id===ge(e.toSymbol))return!0;if(!t.location)return!1;let n=t.location.endLine??t.location.line;return t.location.file===e.fromFile&&e.line!==null&&e.line>=t.location.line&&e.line<=n||t.location.file===e.toFile}function Ui(e,t){if(!t.location||t.location.file!==e.file)return!1;let n=t.location.endLine??t.location.line;return e.line>=t.location.line&&e.line<=n||t.label===e.ownerShortName||typeof e.ownerShortName=="string"&&t.label.includes(e.ownerShortName)}function zi(e,t,n){let o=D(t.filter(s=>s.disposition==="folded").map(s=>s.id)),i=D(n.filter(s=>s.disposition==="folded").map(s=>s.id));return o.length===0&&i.length===0?null:{id:te("frontier","program-facts"),kind:"program-facts",direction:"outgoing",fromNodeIds:D(e.map(s=>s.id)),edgeIds:i,memberNodeIds:o,memberCount:o.length,disposition:"folded",reason:"Control, data, state, and temporal facts are folded beneath the selected high-level owners.",expansion:null}}function Gi(e,t){return`scip-query system-map ${[...e.anchors.flatMap(o=>o.kind==="literal"?[`--search ${O(o.query)}`]:[`--symbol ${O(o.query)}`]),`--depth ${e.maxDepth}`,...e.requestedRelationKinds.map(o=>`--relation ${O(o)}`),`--evidence-floor ${O(e.evidenceFloor)}`,...e.includedSourceScopes.map(o=>`--source-scope ${O(o)}`),...e.fullLiteralTraversal?["--full-literal-traversal"]:[],`--topology-characters ${e.maxTopologyCharacters}`,...e.expandedRegionIds.map(o=>`--expand ${O(o)}`),...e.topologyFrontiers.map(o=>`--frontier ${O(o)}`),...e.routeIds.map(o=>`--route ${O(o)}`),`--frontier ${O(t)}`].join(" ")}`}function Hi(e){let t=new Set;for(let n of e.nodes){if(n.disposition!=="emitted")continue;n.kind==="structural-region"&&t.add(n.id);let o=n.attributes.regionId;typeof o=="string"&&t.add(o)}return t}function Wi(e){let t=new Map;for(let n of e){let o=n.location?`${n.location.file}:${n.location.line}`:"";t.set(`${n.method}\0${n.strength}\0${n.identity??""}\0${o}`,n)}return[...t.values()].sort((n,o)=>n.method.localeCompare(o.method)||(n.identity??"").localeCompare(o.identity??"")||(n.location?.file??"").localeCompare(o.location?.file??"")||(n.location?.line??0)-(o.location?.line??0))}function te(...e){return e.map(t=>encodeURIComponent(t)).join(":")}function ge(e){return te("symbol",e)}function Vi(e){return e==="semantic-callee"||e==="scip-chunk"?"exact":"derived"}function Qi(e,t,n,o,i,s,r,a,d,c){let l=[...o].sort((b,S)=>ho(b,S,i)),f=l.slice(0,io).map(b=>b.id),m=l.slice(io).map(b=>b.id),p=[...e.map(b=>`--search ${O(b)}`),...t.map(b=>`--symbol ${O(b)}`),`--depth ${n}`,...s.map(b=>`--relation ${O(b)}`),`--evidence-floor ${O(r)}`,...a.map(b=>`--source-scope ${O(b)}`),...d?["--full-literal-traversal"]:[],`--topology-characters ${c}`,...f.map(b=>`--expand ${O(b)}`)];return{command:f.length===0?null:`scip-query system-map ${p.join(" ")}`,regionCount:f.length,regionIds:f,candidateRegionCount:o.length,omittedRegionIds:m}}function Yi(e,t,n,o,i,s,r,a,d,c,l,u,f){let m=[...d].sort((g,R)=>ho(g,R,l)).filter(g=>!f||f.has(g.id)||u.has(g.id)),p=c.length>0?Math.floor(a*.4):0,b=a-p,S=new Set,w=0;for(let g of m){let R=uo(g);!u.has(g.id)&&S.size>0&&w+R>b||(S.add(g.id),w+=R)}let I=c.filter(g=>S.has(g.fromRegionId)&&S.has(g.toRegionId)).sort(Ji),L=[];for(let g of I){let R=po(g);L.length>0&&w+R>a||(L.push(dt(g)),w+=R)}let N=d.filter(g=>!S.has(g.id)).map(g=>g.id).sort(),y=new Set(L),E=c.filter(g=>!y.has(dt(g))).length,C=d.reduce((g,R)=>g+uo(R),0)+c.reduce((g,R)=>g+po(R),0),v=m.every(g=>S.has(g.id))&&L.length===I.length,F=[...e.map(g=>`--search ${O(g)}`),...t.map(g=>`--symbol ${O(g)}`),`--depth ${n}`,...o.map(g=>`--relation ${O(g)}`),`--evidence-floor ${O(i)}`,...s.map(g=>`--source-scope ${O(g)}`),...r?["--full-literal-traversal"]:[],`--topology-characters ${Math.max(a,C)}`];return{maxCharacters:a,estimatedCharacters:w,totalEstimatedCharacters:C,regionIds:[...S],omittedRegionIds:N,relationKeys:L,omittedRelations:E,complete:v,expansionCommand:v?null:`scip-query system-map ${F.join(" ")}`}}function uo(e){return 120+e.id.length+e.anchorQueries.join(",").length+e.relationKinds.join(",").length+e.notableSymbols.slice(0,2).reduce((t,n)=>t+n.shortName.length+n.file.length,0)}function po(e){return 70+e.fromRegionId.length+e.toRegionId.length+e.kinds.join(",").length+e.evidence.join(",").length}function Ji(e,t){let n=o=>o.kinds.includes("runtime-boundary")?0:o.kinds.includes("contract-symbol")?1:2;return n(e)-n(t)||t.relationCount-e.relationCount||dt(e).localeCompare(dt(t))}function dt(e){return`${e.fromRegionId}\0${e.toRegionId}`}function ho(e,t,n){let o=a=>n.has(a.id)?0:1,i=a=>a.sourceFileCount===0?1:0,s=a=>a.symbolCount+a.literalHitCount>0?0:1,r=a=>[...a.incomingRegionIds,...a.outgoingRegionIds].filter(d=>n.has(d)).length;return o(e)-o(t)||s(e)-s(t)||i(e)-i(t)||e.minDepth-t.minDepth||r(t)-r(e)||t.literalHitCount-e.literalHitCount||e.testFileCount-t.testFileCount||e.label.localeCompare(t.label)}function Xi(e){let t=[],n=new Set;for(let i of e.filter(s=>s.expanded)){for(let d of i.symbols)d.origins.includes("symbol-anchor")&&n.add(d.file);let s=se(i.symbols,d=>d.file),r=se(i.literalHits,d=>d.file),a=[...i.files].sort((d,c)=>es(d,c,s,r));for(let d of a){let c=(s.get(d.file)??[]).sort(mn)[0];if(c){t.push({kind:"symbol",regionId:i.id,file:c.file,line:c.startLine,endLine:c.endLine,label:c.shortName});continue}let l=(r.get(d.file)??[]).sort(Io)[0];l&&t.push({kind:"literal",regionId:i.id,file:l.file,line:l.line,endLine:null,label:l.ownerShortName??l.query})}}let o=Zi(t,n);return{command:o.length===0?null:`scip-query inspect ${o.map(i=>`--at ${O(`${i.file}:${i.line+1}`)}`).join(" ")} --view behavior`,definitionCommand:null,candidateAnchors:t.length,selectedAnchors:o.length,omittedAnchors:t.length-o.length,anchors:o}}function Zi(e,t){let n=[...se(e,r=>r.regionId).values()],o=[],i=new Set,s=Math.min(gi,24);for(let r of e)if(!(!t.has(r.file)||i.has(r.file))&&(o.push(r),i.add(r.file),o.length===s))return o;for(let r=0;o.length<s;r+=1){let a=!1;for(let d of n){let c=d[r];if(c&&(a=!0,!i.has(c.file)&&(o.push(c),i.add(c.file),o.length===s)))break}if(!a)break}return o}function es(e,t,n,o){let i=a=>a.kind==="test"?2:a.kind==="barrel"?1:0,s=a=>(o.get(a.file)??[]).some(d=>d.traversalSeed)?0:1,r=a=>{let d=n.get(a.file)??[];return Math.min(5,...d.map(c=>Ne(c.origins)))};return i(e)-i(t)||s(e)-s(t)||r(e)-r(t)||e.depth-t.depth||e.file.localeCompare(t.file)}function O(e){return`'${e.replaceAll("'","'\\''")}'`}function ts(e,t,n,o){let i=[];for(let s of qt(e,{includeIgnored:!1})){let r=mt(e,s);if(r.length===0)continue;let a=[];for(let l=0;l<r.length;l+=1){let u=r[l]??"";u.includes(n)&&a.push({line:l,sourceLine:u})}if(a.length===0)continue;let d=t.definitionsForFile(s),c=ce(e,s)?.callables??[];for(let{line:l,sourceLine:u}of a){let f=Me(d,l),m=He(c,l),p=f&&!Y(f.symbol)?f:null,b=p?.startLine??m?.startLine??f?.startLine??l,S=p?.endLine??m?.endLine??f?.endLine??l,w=xt(e,s,l,b,S),I=o.has(`${s}\0${l}`),L=!!(p?.isFunctionLike||m);i.push({relativePath:s,line:l,sourceLine:u,ownerSymbol:p?.symbol??null,ownerShortName:p?V(p.symbol):m?.name??(f?V(f.symbol):null),ownerStartLine:w.startLine,ownerEndLine:w.endLine,matchKind:is(u,n),seedPriority:I?0:L?1:2})}}return i}function ns(e,t){let n={"exact-value":0,boundary:1,embedded:2};return e.seedPriority-t.seedPriority||n[e.matchKind]-n[t.matchKind]||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function mo(e){return`${e.relativePath}\0${e.line}`}function Pt(e,t,n){let i=He(ce(e,t)?.callables??[],n)??xo(e,t,n);if(!i)return null;let s=xt(e,t,n,i.startLine,i.endLine);return{file:t,name:i.name,startLine:s.startLine,endLine:s.endLine}}function xo(e,t,n){let o=he(e,t)?.rootNode;if(!o||o.startPosition.row>n||o.endPosition.row<n)return null;let i=At(o,n);for(;i;){if(i.type==="variable_declarator"){let r=i.childForFieldName("name")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1);if(r?.type==="identifier"&&a&&kt(a,n))return{name:r.text,startLine:i.startPosition.row,endLine:i.endPosition.row}}if(i.type==="pair"){let r=i.childForFieldName("key")??i.namedChild(0),a=i.childForFieldName("value")??i.namedChild(1),d=r?.text.replace(/^(?:['"])(.*)(?:['"])$/u,"$1");if(d&&a&&/^[A-Za-z_$][\w$]*$/u.test(d)&&kt(a,n))return{name:d,startLine:i.startPosition.row,endLine:i.endPosition.row}}i=i.parent}let s=ht(e,t,n);return s?{name:`source@${n+1}`,startLine:s.startLine,endLine:s.endLine}:null}function kt(e,t){return["arrow_function","function_expression","generator_function","generator_function_declaration"].includes(e.type)&&e.startPosition.row<=t&&e.endPosition.row>=t?!0:e.namedChildren.some(n=>n.startPosition.row<=t&&n.endPosition.row>=t&&kt(n,t))}function At(e,t){let n=e.namedChildren.filter(o=>o.startPosition.row<=t&&o.endPosition.row>=t).sort((o,i)=>o.endIndex-o.startIndex-(i.endIndex-i.startIndex)||o.startPosition.row-i.startPosition.row)[0];return n?At(n,t):e}function os(e,t){let n=t.match(/^(.+):(\d+)(?:-(\d+))?$/u);if(!n)return null;let o=Ut(e,n[1],{allowMultiple:!1})[0]?.relativePath;if(!o)return null;let i=Math.max(0,Number.parseInt(n[2],10)-1),s=n[3]?Math.max(i,Number.parseInt(n[3],10)-1):i,r=(ce(e,o)?.callables??[]).filter(a=>a.startLine<=i&&a.endLine>=s).sort((a,d)=>a.endLine-a.startLine-(d.endLine-d.startLine)||a.startLine-d.startLine)[0];return r?{file:o,name:r.name,startLine:r.startLine,endLine:r.endLine}:null}function rs(e){return{symbol:`source-construct:${e.file}:${e.startLine}:${e.endLine}:${e.name}`,shortName:e.name,relativePath:e.file,startLine:e.startLine,endLine:e.endLine}}function is(e,t){let n=/[\p{L}\p{N}_$]/u,o=e.indexOf(t);for(;o>=0;){let i=e[o-1]??"",s=e[o+t.length]??"";if((i==="'"||i==='"'||i==="`")&&s===i)return"exact-value";if(!n.test(i)&&!n.test(s))return"boundary";o=e.indexOf(t,o+Math.max(1,t.length))}return"embedded"}function $t(e){return We(e)==="test"?!1:!/(?:^|[/._-])(?:fixtures?|mocks?|previews?|demos?|examples?|stories)(?:[/._-]|$)/iu.test(e)}function ss(e,t){return e.matchKind!=="embedded"&&t(e.relativePath)&&(bt(e.relativePath)!=="production"||$t(e.relativePath))}function as(e,t){let n=[...t].sort(ls),o=[],i=new Set;for(let s of n)if(!i.has(s.relativePath)&&(o.push(s),i.add(s.relativePath),o.length>=ro))break;for(let s of n){if(o.length>=ro)break;o.includes(s)||o.push(s)}return o.map(s=>({query:e,file:s.relativePath,line:s.line,ownerSymbol:s.ownerSymbol,ownerShortName:s.ownerShortName,ownerStartLine:s.ownerStartLine,ownerEndLine:s.ownerEndLine,sourceLine:s.sourceLine.trim(),matchKind:s.matchKind,traversalSeed:!1}))}function ls(e,t){let n={"exact-value":0,boundary:1,embedded:2};return n[e.matchKind]-n[t.matchKind]||+(t.ownerSymbol!==null)-+(e.ownerSymbol!==null)||+!$t(e.relativePath)-+!$t(t.relativePath)||e.relativePath.localeCompare(t.relativePath)||e.line-t.line}function ds(e,t){let n=new Map;for(let o of t){let i=cs(o.relativePath);n.set(i,(n.get(i)??0)+1)}return[...n].sort(([o,i],[s,r])=>r-i||o.localeCompare(s)).slice(0,mi).map(([o])=>`scip-query search ${O(e)} --scope ${O(o)}`)}function cs(e){let t=e.split("/").filter(Boolean);if(t.length<=1)return e;let n=t.slice(0,-1),o=n.lastIndexOf("src");return o>=0?n.slice(0,Math.min(n.length,o+3)).join("/"):n.slice(0,Math.min(n.length,3)).join("/")}function us(e,t,n){let o=t.callerFileMap([n],{semantic:!1}).get(n.symbolId)??new Set,i=[];for(let s of[...o].sort()){let r=ft(e,s).filter(l=>l.importedName===n.leaf&&l.sourcePath!==null&&pt(l.sourcePath,n.relativePath)),a=new Set;if(r.length>0)for(let l of r)a.add(l.localName??l.importedName);else n.leaf&&a.add(n.leaf);let d=[...new Set([...a].flatMap(l=>gt(e,s,l)))].sort((l,u)=>l-u);if(d.length===0){i.push({file:s,line:null,enclosingSymbol:null});continue}let c=t.definitionsForFile(s);for(let l of d)i.push({file:s,line:l,enclosingSymbol:Me(c,l)?.symbol??null})}return i}function ps(e,t){let n=e.all(`SELECT DISTINCT gs.symbol, def_d.relative_path AS from_file
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents imp_d ON c.document_id = imp_d.id
|
|
5
|
-
JOIN global_symbols gs ON m.symbol_id = gs.id
|
|
6
|
-
LEFT JOIN (
|
|
7
|
-
SELECT m2.symbol_id, c2.document_id
|
|
8
|
-
FROM mentions m2
|
|
9
|
-
JOIN chunks c2 ON m2.chunk_id = c2.id
|
|
10
|
-
WHERE m2.role = 1
|
|
11
|
-
GROUP BY m2.symbol_id
|
|
12
|
-
) sym_def ON sym_def.symbol_id = gs.id
|
|
13
|
-
LEFT JOIN documents def_d ON sym_def.document_id = def_d.id
|
|
14
|
-
WHERE imp_d.relative_path = ? AND m.role = 2
|
|
15
|
-
ORDER BY def_d.relative_path, gs.symbol`,t);return n.length>0?n.map(o=>({symbol:o.symbol,shortName:V(o.symbol),importedName:fo(V(o.symbol)),localName:fo(V(o.symbol)),fromFile:o.from_file,source:"compiler"})):ft(e,t).map(o=>{let i=ms(o.importedName,o.localName,o.kind),s=o.localName??o.importedName,r=o.importedName==="default"?s:o.importedName;return{symbol:i,shortName:i,importedName:r,localName:s,fromFile:o.sourcePath,source:"parsed-source"}})}function fo(e){return e.slice(e.lastIndexOf(":")+1).replace(/\(\)$/u,"")||e}function ms(e,t,n){return n==="namespace"&&e==="*"&&t?`* as ${t}`:n==="default"&&t?`default as ${t}`:n==="side-effect"?"(side effect import)":t&&t!==e?`${e} as ${t}`:e}function ye(e,t,n){let o=yt(e,n);if(!o.match)return{matches:[],total:0,omitted:0};let i=[o.match,...o.candidates.map(r=>yt(e,r.symbol).match)].filter(r=>r!==null),s=new Map;for(let r of i){let a=t.definitionsForFile(r.relativePath).find(d=>d.symbol===r.symbol);a&&s.set(a.symbol,a)}return{matches:[...s.values()],total:o.total,omitted:Math.max(0,o.total-s.size)}}function fs(e){return{symbol:e.symbol,shortName:V(e.symbol),relativePath:e.relativePath,startLine:e.startLine,endLine:e.endLine}}function ne(e,t){let n=[t.kind,t.fromFile,t.fromSymbol??"",t.toFile,t.toSymbol??"",t.fromBoundaryParticipant?.observationId??"",t.toBoundaryParticipant?.observationId??"",t.fromSourceConstruct?de(t.fromSourceConstruct):"",t.toSourceConstruct?de(t.toSourceConstruct):"",t.runtimeBoundaryKey??"",t.line??""].join("\0");e.set(n,t)}function Pe(e){return{observationId:e.id,action:e.action,protocol:e.protocol,role:e.role,address:vo(e),file:e.source.file,line:e.source.startLine,endLine:e.source.endLine,ownerName:e.owner.name,ownerSymbol:e.owner.symbol}}function st(e,t){let n=mt(e,t.source.file);return rn(e,t.source.file,0,Math.max(0,n.length-1),[t.source.startLine])}function go(e,t){let n=[...e.values()];for(let o of[t.owner,t.source]){let i=n.filter(s=>s.file===o.file&&s.startLine<=o.startLine&&s.endLine>=o.startLine).sort((s,r)=>s.endLine-s.startLine-(r.endLine-r.startLine)||s.startLine-r.startLine)[0];if(i)return i}return null}function yo(e,t,n,o,i){let s=[],r=n.get(e.id);r!==void 0&&r<=t&&s.push(r);for(let a of o.values()){if(a.depth>t)continue;let d=a.definition;bo(d,e)&&s.push(a.depth)}for(let a of i.values())a.depth>t||bo(a,e)&&s.push(a.depth);return s.length>0?Math.min(...s):null}function bo(e,t){let n=e.relativePath??e.file;return[t.owner,t.source].some(o=>n===o.file&&e.startLine<=o.startLine&&e.endLine>=o.startLine)}function Dt(e){return te("runtime-boundary-participant",e)}function gs(e,t,n){let o=ee(e,n),i=ee(t,n);return o.relativeDir!==i.relativeDir?!0:/(?:^|\/)(?:contracts?|schemas?|db\/schema)(?:\/|$)/u.test(t)}function ys(e,t,n){return Ue(e,n).id===Ue(t,n).id}function bs(e,t,n,o){if(e.referenceScope==="all")return!0;let i=Ue(t,o).id;return[...n.values()].some(r=>r.promoteBoundaryImports&&Ue(r.file,o).id===i)?!0:e.referenceScope!=="cross-workspace-or-forward"?!1:ee(t,o).relativeDir!==ee(e.definition.relativePath,o).relativeDir}function Ss(e,t){let n={none:0,"forward-regions":1,"cross-workspace-or-forward":2,all:3};return n[e]>=n[t]?e:t}function hs(e,t){let n=ao.get(e);if(n)return n;let o=t.fileDependencyGraph(),i={fileGraph:o,reverseFileGraph:xs(o),workspaces:vs(t.sourceFiles()),runtimeBoundaries:tn(e)};return ao.set(e,i),i}function xs(e){let t=new Map;for(let[n,o]of e)for(let i of o){let s=t.get(i)??new Set;s.add(n),t.set(i,s)}return t}function ee(e,t){return t.find(n=>e===n.relativeDir||e.startsWith(`${n.relativeDir}/`))??{name:"root",relativeDir:""}}function vs(e){let t=new Set(["apps","packages","services","crates","libs","tools"]),n=new Map;for(let o of e){let i=o.split("/").filter(Boolean);if(i.length<3||!t.has(i[0]))continue;let s=`${i[0]}/${i[1]}`;n.set(s,{name:i[1],relativeDir:s})}return[...n.values()].sort((o,i)=>i.relativeDir.length-o.relativeDir.length)}function Ue(e,t){let n=ee(e,t),i=(n.relativeDir?e.slice(n.relativeDir.length+1):e).split("/").filter(Boolean);i[0]==="src"&&i.shift();let s=Es(i);return{id:`region:${n.relativeDir||"root"}:${s}`,label:`${n.name}:${s}`,workspace:n.name,structuralPath:s}}function Es(e){if(e.length<=1)return"root";let t=e[0],n=e[1];return["components","features","modules"].includes(t)?`${t}/${n}`:t==="db"?`${t}/${n}`:["contracts","routes","services"].includes(t)?t:t==="tests"||t==="__tests__"?"tests":t}function Is(e,t,n,o,i,s,r){let a=se([...e.values()],m=>s.get(m.file).id),d=se([...t.values()],m=>s.get(m.definition.relativePath).id),c=se(n,m=>s.get(m.file).id),l=new Map;for(let m of o)for(let p of new Set([m.fromRegionId,m.toRegionId])){let b=l.get(p)??[];b.push(m),l.set(p,b)}let u=se(i,m=>m.toRegionId),f=se(i,m=>m.fromRegionId);return[...a.entries()].map(([m,p])=>{let b=s.get(p[0].file),S=d.get(m)??[],w=c.get(m)??[],I=l.get(m)??[],L=r.has(m),N=S.map(ws).sort(Fs).slice(0,fi),y=p.filter(E=>We(E.file)==="test").length;return{id:m,label:b.label,workspace:b.workspace,structuralPath:b.structuralPath,minDepth:Math.min(...p.map(E=>E.depth)),fileCount:p.length,sourceFileCount:p.length-y,testFileCount:y,symbolCount:S.length,literalHitCount:w.length,anchorQueries:D([...w.map(E=>E.query),...S.flatMap(E=>[...E.anchorQueries])]),relationKinds:D(I.map(E=>E.kind)),incomingRegionIds:D((u.get(m)??[]).map(E=>E.fromRegionId)),outgoingRegionIds:D((f.get(m)??[]).map(E=>E.toRegionId)),memberCallCandidateRelationCount:I.filter(E=>E.evidence==="ast-member-import-candidate").length,notableSymbols:N,omittedNotableSymbols:Math.max(0,S.length-N.length),expanded:L,files:L?p.map(Cs).sort(Ts):[],symbols:L?S.map(Ls).sort(Ps):[],literalHits:L?[...w].sort(Io):[],relations:L?[...I].sort(Eo):[]}}).sort((m,p)=>m.minDepth-p.minDepth||m.label.localeCompare(p.label))}function Cs(e){return{file:e.file,kind:We(e.file),depth:e.depth,origins:D([...e.origins])}}function Ls(e){return{symbol:e.definition.symbol,shortName:V(e.definition.symbol),file:e.definition.relativePath,startLine:e.definition.startLine,endLine:e.definition.endLine,depth:e.depth,origins:D([...e.origins]),anchorQueries:D([...e.anchorQueries]),referenceExpansion:e.referenceScope!=="none",referenceScope:e.referenceScope}}function ws(e){return{shortName:V(e.definition.symbol),file:e.definition.relativePath,origins:D([...e.origins])}}function Ms(e){return[...se(e.filter(n=>n.fromRegionId!==n.toRegionId),n=>`${n.fromRegionId}\0${n.toRegionId}`).values()].map(n=>({fromRegionId:n[0].fromRegionId,toRegionId:n[0].toRegionId,kinds:D(n.map(o=>o.kind)),relationCount:n.length,fromFiles:D(n.map(o=>o.fromFile)),toFiles:D(n.map(o=>o.toFile)),fromSymbols:D(n.flatMap(o=>o.fromSymbol?[V(o.fromSymbol)]:[])),toSymbols:D(n.flatMap(o=>o.toSymbol?[V(o.toSymbol)]:[])),evidence:D(n.map(o=>o.evidence)),strengths:D(n.map(o=>o.strength??"unknown"))})).sort((n,o)=>n.fromRegionId.localeCompare(o.fromRegionId)||n.toRegionId.localeCompare(o.toRegionId))}function Ns(e,t){return[...e.values()].map(n=>({kind:"external-import",name:n.name,fromRegionIds:D([...n.fromFiles].flatMap(o=>{let i=t.get(o);return i?[i.id]:[]})),fromFiles:D([...n.fromFiles])})).sort((n,o)=>n.name.localeCompare(o.name))}function Rs(e,t,n,o){let i=e.kind==="literal"?t.filter(s=>s.query===e.query).map(s=>s.file):[...n.values()].filter(s=>s.anchorQueries.has(e.query)).map(s=>s.definition.relativePath);return D(i.map(s=>o.get(s)?.id).filter(s=>!!s))}function vo(e){return e.keyParts.map(t=>`${t.name}=${t.value}`).join(" ")}function D(e){return[...new Set(e)].sort()}function Eo(e,t){return e.fromRegionId.localeCompare(t.fromRegionId)||e.toRegionId.localeCompare(t.toRegionId)||e.kind.localeCompare(t.kind)||e.fromFile.localeCompare(t.fromFile)||e.toFile.localeCompare(t.toFile)||(e.line??-1)-(t.line??-1)}function Fs(e,t){return Ne(e.origins)-Ne(t.origins)||e.shortName.localeCompare(t.shortName)}function Ts(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)}function Ps(e,t){return e.depth-t.depth||e.file.localeCompare(t.file)||e.symbol.localeCompare(t.symbol)}function Io(e,t){return e.file.localeCompare(t.file)||e.line-t.line||e.query.localeCompare(t.query)}export{Ua as a,za as b,dt as c};
|
|
16
|
-
//# sourceMappingURL=chunk-YWO5DDRC.js.map
|
package/dist/chunk-Z4CDXYNQ.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as _}from"./chunk-HLZTEXRA.js";import{f as L,g as A}from"./chunk-JGKUET5J.js";import{a as R}from"./chunk-WIWY3CRX.js";import{b as D}from"./chunk-BOJ5SVE2.js";import{c as E}from"./chunk-CJZXN4NU.js";import{a as w}from"./chunk-BGBBVSH4.js";import{f as x,h as I}from"./chunk-XRYABF57.js";import{d as N}from"./chunk-N2ZSIIGR.js";import{b as T,c as h}from"./chunk-ODDUPDP7.js";import{a as g}from"./chunk-ZOHS7AQV.js";import{h as S}from"./chunk-FESCRNVV.js";var F={caller:3,"entry-surface":2,rooted:1},O=/not\s*yet\s*implement|not\s*implement|unimplement|\bnyi\b|\btodo\b|\bstub\b|not\s*supported|coming\s*soon/i,P=/^throw\s+new\s+[\w.]*Error\s*\(([\s\S]*)\)\s*;?$/,C=/^return(\s+(null|undefined|false|0|''|""|``|\[\]|\{\}))?\s*;?$/,v=/\/\/\s*TODO\b|\/\*\s*TODO\b/i,K=/(?:=>|\))\s*(?::\s*[^{;=]+)?\s*\{\s*\}\s*;?\s*$/;function et(e,n={}){let{scope:o,limit:r=30,scanLimit:l,semantic:a=!0}=n,s=new E(e),t=D(s.productionCallableDefinitions({scope:o,minLoc:1,requireFunctionLikeSymbol:!0,excludeTypesFiles:!0}),l),c=[];for(let i of t){let m=M(e,i);m&&c.push(m)}if(c.length===0)return[];let d=j(e,c,t),f=c.filter(i=>!d.has(i.def.symbol));if(f.length===0)return[];let p=_(e,s).forDefinitions(f.map(i=>i.def),{semantic:a}),u=[];for(let i of f){let b=p.get(i.def.symbolId)?.realConsumers.length??0,y=B(e,i.def,b);y&&u.push({symbol:i.def.symbol,shortName:N(i.def.symbol),file:i.def.relativePath,startLine:i.def.startLine,endLine:i.def.endLine,loc:w(i.def),stubKind:i.stubKind,reachability:y,callerFanIn:b,stubText:i.stubText})}return u.sort((i,m)=>F[m.reachability]-F[i.reachability]||m.callerFanIn-i.callerFanIn||i.file.localeCompare(m.file)||i.startLine-m.startLine),r?u.slice(0,r):u}function B(e,n,o){return o>0?"caller":I(e,n.symbol,n.relativePath)?"rooted":x(e,n.relativePath)?"entry-surface":null}function M(e,n){let o=L(e,n);if(!o)return null;let r=A(o),l=r.trim();if(l==="")return!z(o)||!R(e,n)?null:{def:n,stubKind:"empty-body",stubText:"(empty body)"};let a=h(r),s=T(r),t=$(a,s);if(t.length!==1)return null;let c=t[0];return U(c)?{def:n,stubKind:"throw-stub",stubText:c.trim()}:v.test(r)&&C.test(c.trim())?{def:n,stubKind:"todo-return-default",stubText:l}:null}function $(e,n){let o=[],r=0,l="";for(let a=0;a<n.length;a+=1){let s=n[a];if(s==="("||s==="["||s==="{"?r+=1:(s===")"||s==="]"||s==="}")&&(r=Math.max(0,r-1)),s===";"&&r===0){o.push(l),l="";continue}l+=e[a]??""}return l.trim()&&o.push(l),o.map(a=>a.trim()).filter(a=>a.length>0)}function U(e){let n=P.exec(e.trim());return n?O.test(n[1]??""):!1}function z(e){return K.test(e.trimEnd())}function j(e,n,o){let r=new Set,l=new Set(n.map(t=>t.def.parentTypeName).filter(t=>t!==null));if(l.size===0)return r;let a=k(e,l),s=new Map;for(let t of o){if(!t.parentTypeName)continue;let c=s.get(t.leaf)??new Set;c.add(t.parentTypeName),s.set(t.leaf,c)}for(let t of n){let c=t.def.parentTypeName;if(!c)continue;let d=a.get(c);if(!d||d.size===0)continue;let f=s.get(t.def.leaf)??new Set;[...d].every(u=>f.has(u))&&r.add(t.def.symbol)}return r}var Y=/\bclass\s+([A-Za-z_$][\w$]*)\s+extends\s+([A-Za-z_$][\w$]*)/g;function k(e,n){let o=new Map;for(let r of g(e,{includeIgnored:!1})){let l=S(e,r);if(l)for(let a of l.matchAll(Y)){let s=a[1],t=a[2];if(!s||!t||!n.has(t))continue;let c=o.get(t)??new Set;c.add(s),o.set(t,c)}}return o}export{et as a};
|
|
2
|
-
//# sourceMappingURL=chunk-Z4CDXYNQ.js.map
|