scip-query 0.24.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 +247 -1
- package/README.md +111 -124
- 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-BociKRpF.d.ts → call-graph-evidence-CUtj8V2I.d.ts} +1 -1
- 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-E65ELFKU.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-BHKK5RJY.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-6ILKOOGH.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-OHIV323X.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-2GJSD5GY.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-A4WEAK35.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-GHNPACNP.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-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-4FR6GQIT.js → chunk-VF5JZICY.js} +2 -2
- 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-ATXPTSEI.js → chunk-X6RMKHJQ.js} +7 -7
- package/dist/{chunk-44IETFOU.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-ZLADLUE6.js +3 -0
- package/dist/chunk-ZO4YXUT6.js +4 -0
- package/dist/{chunk-MZPXPSUJ.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/{health-BI2a9WPy.d.ts → health-BtfmNrfa.d.ts} +5 -79
- 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 +1 -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.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.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 +1 -1
- 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 +15 -64
- 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.js +1 -1
- package/dist/queries/react-component-duplicates.js +1 -1
- package/dist/queries/react-hook-candidates.js +1 -1
- 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 +1 -1
- 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 +27 -23
- 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 +34 -0
- package/docs/analyzer-inventory.md +2 -2
- 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-H3P6BR5G.js +0 -2
- package/dist/call-graph-VTG2CUOQ.js +0 -2
- package/dist/chunk-26CT72HM.js +0 -2
- package/dist/chunk-2BMSSRBH.js +0 -2
- package/dist/chunk-2M2LSIMY.js +0 -7
- package/dist/chunk-2N6WBNDC.js +0 -29
- package/dist/chunk-2OOY75BW.js +0 -2
- package/dist/chunk-2USA3S3P.js +0 -3
- package/dist/chunk-2VAHDDLM.js +0 -133
- package/dist/chunk-2XWIUW5Z.js +0 -455
- package/dist/chunk-35NLDRZC.js +0 -2
- package/dist/chunk-3AF4TUFK.js +0 -3
- package/dist/chunk-3D4BOXW6.js +0 -20
- package/dist/chunk-3LO4FST5.js +0 -16
- package/dist/chunk-3WTY4LP2.js +0 -3
- package/dist/chunk-3Z5AMSK6.js +0 -29
- package/dist/chunk-4KBTHJLP.js +0 -2
- package/dist/chunk-5BIKR67W.js +0 -2
- package/dist/chunk-5PROPLHI.js +0 -2
- package/dist/chunk-5V7EPTII.js +0 -2
- package/dist/chunk-62LPZCBQ.js +0 -3
- package/dist/chunk-64O2JHQA.js +0 -2
- package/dist/chunk-6D4F5VWG.js +0 -10
- package/dist/chunk-6ERFBC3X.js +0 -3
- package/dist/chunk-6MFXCMZC.js +0 -2
- package/dist/chunk-6O7FACKB.js +0 -2
- package/dist/chunk-6TS3KOXR.js +0 -2
- package/dist/chunk-76QOU4PK.js +0 -3
- package/dist/chunk-7DUI77BN.js +0 -2
- package/dist/chunk-7F45LJKI.js +0 -2
- package/dist/chunk-7F7T6DCR.js +0 -2
- package/dist/chunk-7H6VHWWJ.js +0 -2
- package/dist/chunk-7HXT6YLU.js +0 -5
- package/dist/chunk-7KCZELVM.js +0 -2
- package/dist/chunk-7R4V5ES6.js +0 -6
- package/dist/chunk-7RIRIADH.js +0 -7
- package/dist/chunk-7ZLWLOGT.js +0 -2
- package/dist/chunk-AADQLOQ4.js +0 -38
- package/dist/chunk-AN76MGUE.js +0 -2
- package/dist/chunk-ANLNLY66.js +0 -2
- package/dist/chunk-AX7IDVFT.js +0 -2
- package/dist/chunk-B3X6KU75.js +0 -2
- package/dist/chunk-B7MPDEAK.js +0 -3
- package/dist/chunk-BBB5FBX4.js +0 -2
- package/dist/chunk-BJT7LSPK.js +0 -3
- package/dist/chunk-BJWFVAA5.js +0 -2
- package/dist/chunk-BKVWUP7Y.js +0 -2
- package/dist/chunk-BKZYTLGE.js +0 -35
- package/dist/chunk-BL6DCHQP.js +0 -2
- package/dist/chunk-BOW7SSQH.js +0 -43
- package/dist/chunk-C4RHHCKL.js +0 -7
- package/dist/chunk-C7C6AKAT.js +0 -117
- package/dist/chunk-CD6M6LS2.js +0 -16
- package/dist/chunk-CFE6PSG6.js +0 -2
- package/dist/chunk-CFNIGQMT.js +0 -2
- package/dist/chunk-CKBUBRYD.js +0 -2
- package/dist/chunk-CZW5MZ5B.js +0 -2
- package/dist/chunk-DBBZ63ZX.js +0 -2
- package/dist/chunk-DBN7DMJB.js +0 -18
- package/dist/chunk-DUULLZHZ.js +0 -3
- package/dist/chunk-DV5Y5NOS.js +0 -2
- package/dist/chunk-DZOIKCTM.js +0 -3
- package/dist/chunk-E4PKTOL3.js +0 -2
- package/dist/chunk-E7QR35ST.js +0 -2
- package/dist/chunk-EFSXAINW.js +0 -2
- package/dist/chunk-EHVEIEQN.js +0 -18
- package/dist/chunk-EHYDXE3Z.js +0 -2
- package/dist/chunk-EP63Y6LD.js +0 -2
- package/dist/chunk-EPX6NQN6.js +0 -4
- package/dist/chunk-ETC674NS.js +0 -5
- package/dist/chunk-F5GSBHC6.js +0 -3
- package/dist/chunk-FH3DGXC6.js +0 -2
- package/dist/chunk-FI7VGOR4.js +0 -16
- package/dist/chunk-FJF6VO2P.js +0 -2
- package/dist/chunk-FLMTCX5R.js +0 -2
- package/dist/chunk-FVFDOIM3.js +0 -2
- package/dist/chunk-G2HU5WRN.js +0 -2
- package/dist/chunk-G4ALYS4J.js +0 -2
- package/dist/chunk-G56I7K4W.js +0 -26
- package/dist/chunk-GC4DG2V5.js +0 -2
- package/dist/chunk-GG45PK4S.js +0 -4
- package/dist/chunk-GINH3YQU.js +0 -20
- package/dist/chunk-GTZZVLKJ.js +0 -2
- package/dist/chunk-GXXW5ZHH.js +0 -2
- package/dist/chunk-H5EXS3HM.js +0 -2
- package/dist/chunk-HAXXKRTD.js +0 -4
- package/dist/chunk-HEZWBAZY.js +0 -2
- package/dist/chunk-HMEWLMML.js +0 -2
- package/dist/chunk-HOBOVYPO.js +0 -11
- package/dist/chunk-HRFQ6GW5.js +0 -8
- package/dist/chunk-HX4X7KG3.js +0 -2
- package/dist/chunk-HYT2R7LX.js +0 -4
- package/dist/chunk-IKQVBVQL.js +0 -40
- package/dist/chunk-IW5XQG5G.js +0 -2
- package/dist/chunk-J6GLBBRK.js +0 -4
- package/dist/chunk-J7A4PWFX.js +0 -3
- package/dist/chunk-JCSAZ35V.js +0 -2
- package/dist/chunk-JDU2IV3A.js +0 -2
- package/dist/chunk-JFMEXGFE.js +0 -2
- package/dist/chunk-JFMI5SGB.js +0 -4
- package/dist/chunk-JJP37RGX.js +0 -57
- package/dist/chunk-JZ2A7LDM.js +0 -5
- package/dist/chunk-KMVGRIO2.js +0 -2
- package/dist/chunk-KNLQGXVH.js +0 -80
- package/dist/chunk-KVQCECPR.js +0 -2
- package/dist/chunk-KXXORBZ2.js +0 -4
- package/dist/chunk-L5KYH6U3.js +0 -35
- package/dist/chunk-L6XHYJPZ.js +0 -21
- package/dist/chunk-L7KTFEAV.js +0 -43
- package/dist/chunk-LDXHR5EL.js +0 -23
- package/dist/chunk-LEECKFCJ.js +0 -2
- package/dist/chunk-MHGDSBFX.js +0 -2
- package/dist/chunk-MLQVVDG3.js +0 -74
- package/dist/chunk-MOKUWRHO.js +0 -3
- package/dist/chunk-MPYAPMNE.js +0 -2
- package/dist/chunk-MTDBHTSF.js +0 -2
- package/dist/chunk-MV6SPXCR.js +0 -7
- package/dist/chunk-MWN53KRN.js +0 -60
- package/dist/chunk-MXNGIEPU.js +0 -3
- package/dist/chunk-N55KIE46.js +0 -2
- package/dist/chunk-NB4D3BNM.js +0 -2
- package/dist/chunk-NGKBOT6G.js +0 -23
- package/dist/chunk-NJGKXKQF.js +0 -2
- package/dist/chunk-NJQISBL4.js +0 -8
- package/dist/chunk-NJT3ZEKY.js +0 -16
- package/dist/chunk-NKMKZP6A.js +0 -2
- package/dist/chunk-NODFZ6ED.js +0 -2
- package/dist/chunk-NSM5IEVW.js +0 -2
- package/dist/chunk-NTGUVNR2.js +0 -3
- package/dist/chunk-NU3KFF2O.js +0 -57
- package/dist/chunk-NWLVNU66.js +0 -557
- package/dist/chunk-NYKZMCRC.js +0 -4
- package/dist/chunk-O6BUXZEH.js +0 -6
- package/dist/chunk-ODPDP7A4.js +0 -3
- package/dist/chunk-OIAPEKMT.js +0 -3
- package/dist/chunk-OIOC5EHF.js +0 -3
- package/dist/chunk-ONPPQM4G.js +0 -2
- package/dist/chunk-OUHEZBYI.js +0 -2
- package/dist/chunk-OVGYW7UD.js +0 -29
- package/dist/chunk-OYKU4B3Y.js +0 -2
- package/dist/chunk-POBJ6FR2.js +0 -5
- package/dist/chunk-PSZPMMWN.js +0 -2
- package/dist/chunk-PXTRBKRK.js +0 -3
- package/dist/chunk-Q5JRIHT3.js +0 -4
- package/dist/chunk-Q7ATHARX.js +0 -2
- package/dist/chunk-Q7CSKIDM.js +0 -5
- package/dist/chunk-QBQE7ZJ5.js +0 -3
- package/dist/chunk-QH22UIXP.js +0 -5
- package/dist/chunk-QXCKQTKR.js +0 -60
- package/dist/chunk-RBAD4GJ2.js +0 -13
- package/dist/chunk-RMDPFPNW.js +0 -2
- package/dist/chunk-ROPJDEJZ.js +0 -4
- package/dist/chunk-RVZC6TJE.js +0 -2
- package/dist/chunk-S4QZBKSR.js +0 -3
- package/dist/chunk-SCPMZ73U.js +0 -2
- package/dist/chunk-SIAP5RGI.js +0 -73
- package/dist/chunk-SIX4RFR3.js +0 -3
- package/dist/chunk-SKKXTABJ.js +0 -16
- package/dist/chunk-SSRFUQBD.js +0 -2
- package/dist/chunk-SYVJEEUJ.js +0 -3
- package/dist/chunk-T3CZAZSI.js +0 -8
- package/dist/chunk-T6DWDI5E.js +0 -3
- package/dist/chunk-T6HRIROJ.js +0 -7
- package/dist/chunk-TAA7HXHE.js +0 -2
- package/dist/chunk-TJ2JQYT3.js +0 -2
- package/dist/chunk-TULNMD5T.js +0 -368
- package/dist/chunk-U2FPY5XA.js +0 -3
- package/dist/chunk-U3SXIMII.js +0 -38
- package/dist/chunk-U6KCHXJ4.js +0 -2
- package/dist/chunk-UH3XSKS5.js +0 -9
- package/dist/chunk-UIFUZVCC.js +0 -2
- package/dist/chunk-UXKURIVI.js +0 -2
- package/dist/chunk-V2RBODHL.js +0 -2
- package/dist/chunk-VBKUWB6N.js +0 -2
- package/dist/chunk-VBV6ALJE.js +0 -2
- package/dist/chunk-VDGFWCQV.js +0 -2
- package/dist/chunk-VDSDOEWF.js +0 -2
- package/dist/chunk-VZPWVCLN.js +0 -20
- package/dist/chunk-WDSFQDPN.js +0 -2
- package/dist/chunk-WFA35BGR.js +0 -7
- package/dist/chunk-WLMP3OCW.js +0 -2
- package/dist/chunk-WSA52GOR.js +0 -2
- package/dist/chunk-WYPL7GF7.js +0 -2
- package/dist/chunk-X3YVZAKZ.js +0 -5
- package/dist/chunk-X6OGVFIT.js +0 -2
- package/dist/chunk-XDAUYDFT.js +0 -2
- package/dist/chunk-XKXTR6ZI.js +0 -9
- package/dist/chunk-Y5DFAW5W.js +0 -4
- package/dist/chunk-YSYPDRD5.js +0 -3
- package/dist/chunk-ZFVPWH62.js +0 -5
- package/dist/chunk-ZGIHTH27.js +0 -2
- package/dist/chunk-ZGIQN2SX.js +0 -2
- package/dist/chunk-ZHG4WAHR.js +0 -12
- package/dist/chunk-ZKB2XUEN.js +0 -4
- package/dist/chunk-ZLMXIQLC.js +0 -21
- package/dist/chunk-ZMCQIHI4.js +0 -2
- package/dist/code-TAVIKWJI.js +0 -2
- package/dist/code-result-json-5FEFQCAQ.js +0 -2
- package/dist/command-descriptors-7BKH53Y3.js +0 -343
- package/dist/dataflow-GFBTVDH3.js +0 -2
- package/dist/dependence-slice-GWGQCODG.js +0 -2
- package/dist/deps-4QHVDPYA.js +0 -2
- package/dist/direct-navigation-4UBC6HNW.js +0 -3
- package/dist/entry-map-QCTF4RVY.js +0 -2
- package/dist/files-M2UBF5HJ.js +0 -2
- package/dist/graph-evidence-Bjyky2V4.d.ts +0 -126
- package/dist/hierarchy-2UIHRLW4.js +0 -2
- package/dist/imports-WIE3YZOB.js +0 -2
- package/dist/members-YKD636DA.js +0 -2
- package/dist/methods-VDF4IMYG.js +0 -2
- package/dist/next-anchor-candidates-BwMczMvX.d.ts +0 -90
- package/dist/output-continuation-command-4UMDOOLO.js +0 -3
- package/dist/output-pagination-2GME6OPY.js +0 -19
- package/dist/project-reindex-XEQTRCV5.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 -79
- 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 -69
- 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 -49
- package/dist/queries/wrapper-candidates.js +0 -2
- package/dist/refs-JNK5CLM7.js +0 -2
- package/dist/refs-pagination-6BLRYGMV.js +0 -2
- package/dist/slice-PHPVNCWX.js +0 -2
- package/dist/source-snippet-_wrcgmZc.d.ts +0 -15
- package/dist/stats-OOJ74B32.js +0 -2
- package/dist/surface-MQX5MPIV.js +0 -2
- package/dist/symbol-resolution-DBLVXLBC.js +0 -2
- package/dist/system-JOPKV4OG.js +0 -2
- package/dist/trace-I2P2YFH4.js +0 -2
- package/dist/value-flow-JJVMF7NP.js +0 -2
- package/skills/concrete-plan/SKILL.md +0 -8
- package/skills/concrete-plan/agents/openai.yaml +0 -4
- package/skills/conductor/SKILL.md +0 -110
- package/skills/conductor/agents/openai.yaml +0 -4
- package/skills/principal-maintainability-review/SKILL.md +0 -273
- package/skills/principal-maintainability-review/agents/openai.yaml +0 -4
- package/skills/scip-calibrate/SKILL.md +0 -102
- package/skills/scip-calibrate/agents/openai.yaml +0 -4
- package/skills/scip-claim-audit/SKILL.md +0 -113
- package/skills/scip-claim-audit/agents/openai.yaml +0 -4
- package/skills/scip-probe-reachability/SKILL.md +0 -93
- package/skills/scip-probe-reachability/agents/openai.yaml +0 -4
- package/skills/scip-root-cause/SKILL.md +0 -160
- package/skills/scip-root-cause/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/SKILL.md +0 -252
- package/skills/scip-system-compression/agents/openai.yaml +0 -4
- package/skills/scip-system-compression/references/compression-atlas.md +0 -116
- package/skills/scip-system-compression/references/compression-patterns.md +0 -87
- package/skills/scip-twin-drift/SKILL.md +0 -109
- package/skills/scip-twin-drift/agents/openai.yaml +0 -4
package/dist/chunk-HMEWLMML.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{e as Q,m as X,v as P,x as I}from"./chunk-RMDPFPNW.js";import{a as L,b as G,d as R}from"./chunk-CKBUBRYD.js";import{a as d,f as w,g as B,h as p}from"./chunk-H5EXS3HM.js";import{H,I as W,U as Y,c as O,ca as J,e as q,ea as K,ha as z,r as U}from"./chunk-7HXT6YLU.js";import{a as V,g as F,h as S}from"./chunk-7F45LJKI.js";import{existsSync as Re}from"fs";import{randomUUID as ze}from"crypto";import{isAbsolute as Xe,join as Pe,relative as Ze,resolve as et}from"path";var f=1,m=2,ue="./node_modules/scip-query/docs/schemas/project-config.schema.json";function Z(e){let t=e;if(typeof e=="string")try{t=JSON.parse(e)}catch(c){return{kind:"malformed",reason:`invalid JSON: ${c instanceof Error?c.message:String(c)}`}}if(!d(t))return{kind:"malformed",reason:"project config must be a JSON object"};let n=t.schemaVersion;if(n!==void 0&&!Number.isInteger(n))return{kind:"malformed",reason:"schemaVersion must be an integer"};let r=n===void 0?f:n;if(r!==f&&r!==m)return{kind:"unsupported",schemaVersion:r,direction:r<f?"older":"future"};let s=t.$schema;if(s!==void 0&&(typeof s!="string"||s.trim()===""))return{kind:"malformed",reason:"$schema must be a non-empty string when present"};let i=ee(t),a=r!==m||typeof t.$schema!="string";return r===f?{kind:"legacy",sourceVersion:f,config:i,needsMigration:a}:{kind:"supported",sourceVersion:m,config:i,needsMigration:a}}function ee(e){let t=e,{$schema:n,schemaVersion:r,...s}=t;return{$schema:typeof n=="string"&&n.trim()!==""?n:ue,schemaVersion:m,...s}}import{createHash as pe}from"crypto";var k=1,te=2,ne=1,_=1,E="sha256";function Be(e,t,n){if(!p(e)||!w(t))throw new Error("Observation identity requires a bounded projection name and positive projection version.");return{schemaVersion:ne,canonicalizationVersion:_,hashAlgorithm:E,projection:{name:e,version:t},digest:pe(E).update(le(e,t,n)).digest("hex")}}function le(e,t,n){return`{"canonicalizationVersion":${_},"projection":${JSON.stringify(e)},"projectionVersion":${t},"value":${JSON.stringify(n)}}`}function fe(e){if(!d(e))return{kind:"malformed",reason:"observation receipt must be an object"};let t=e.schemaVersion;if(!Number.isInteger(t))return{kind:"malformed",reason:"observation receipt schemaVersion must be an integer"};if(t===k)return ge(e)?{kind:"legacy",schemaVersion:k,receipt:e}:{kind:"malformed",reason:"observation receipt v1 fields are malformed or contradictory"};if(t===te)return he(e)?{kind:"supported",schemaVersion:te,receipt:e}:{kind:"malformed",reason:"observation receipt v2 facts are malformed or contradictory"};let n=t;return{kind:"unsupported",schemaVersion:n,direction:n<k?"older":"future"}}function re(e){let t=fe(e);return t.kind==="legacy"||t.kind==="supported"}function me(e,t){return e.schemaVersion===t.schemaVersion&&e.canonicalizationVersion===t.canonicalizationVersion&&e.hashAlgorithm===t.hashAlgorithm&&e.projection.name===t.projection.name&&e.projection.version===t.projection.version}function ge(e){if(!d(e))return!1;let t=e.index,n=e.worktree;return oe(e.observedAt)&&p(e.projectIdentity)&&Oe(e.authorityKind)&&(t===void 0||d(t)&&p(t.generationIdentity)&&(t.source==="immutable"||t.source==="legacy")&&(t.alignment==="not-certified"||t.alignment==="leased"))&&(n===void 0||d(n)&&p(n.identity)&&typeof n.clean=="boolean"&&(n.headCommit===void 0||p(n.headCommit))&&(n.treeOid===void 0||p(n.treeOid)))&&Se(e.authorityKind,t,n)}function he(e){if(!d(e))return!1;let t=e.facts,n=e.observedSources,r=e.stabilityProofs;if(!oe(e.observedAt)||!d(t)||!Array.isArray(n)||n.length===0||!n.every(be)||!A(n,o=>o.kind)||!Array.isArray(r)||!r.every(ve)||!A(r,o=>o.source)||r.some(o=>!n.some(u=>u.kind===o.source))||!r.every(o=>xe(o,t))||["collaborationDomain","repositoryLineage","workspaceInstance","wholeContent"].some(o=>t[o]!==void 0&&!l(t[o])))return!1;let i=t.relevantInputs;if(i!==void 0&&(!Array.isArray(i)||!i.every(ye)||!A(i,o=>`${o.subject}\0${o.identity.projection.name}`)))return!1;let a=t.index;if(a!==void 0&&(!d(a)||!l(a.generation)||a.inputs!==void 0&&!l(a.inputs)||a.source!=="immutable"&&a.source!=="legacy"))return!1;let c=e.diagnostics;return(c===void 0||d(c)&&(c.clean===void 0||typeof c.clean=="boolean")&&(c.headCommit===void 0||p(c.headCommit))&&(c.treeOid===void 0||p(c.treeOid)))&&Ce(t,n)}function l(e){return!d(e)||!d(e.projection)?!1:e.schemaVersion===ne&&e.canonicalizationVersion===_&&e.hashAlgorithm===E&&p(e.projection.name)&&w(e.projection.version)&&B(e.digest)}function ye(e){return d(e)&&p(e.subject)&&l(e.identity)}function be(e){return d(e)&&ie(e.kind)&&(e.identity===void 0||l(e.identity))}function ve(e){return d(e)&&ie(e.source)&&(e.kind==="immutable"||e.kind==="fixed-snapshot"||e.kind==="bracketed"||e.kind==="not-established"||e.kind==="invalidated")}function Ce(e,t){let n=e.index,r=t.find(o=>o.kind==="index-generation");if(r){if(!d(n)||!l(n.generation)||r.identity&&!j(r.identity,n.generation))return!1}else if(n!==void 0)return!1;let s=e.workspaceInstance,i=t.find(o=>o.kind==="live-workspace");if(i?.identity&&(!l(s)||!j(i.identity,s)))return!1;let a=e.wholeContent,c=t.find(o=>o.kind==="repository-snapshot");return!(c?.identity&&(!l(a)||!j(c.identity,a)))}function xe(e,t){return e.kind==="not-established"||e.kind==="invalidated"?!0:e.source==="index-generation"?e.kind==="immutable"&&d(t.index)&&t.index.source==="immutable":e.source==="repository-snapshot"?e.kind==="fixed-snapshot":e.source==="live-workspace"?e.kind==="bracketed":!1}function j(e,t){return me(e,t)&&e.digest===t.digest}function Se(e,t,n){return e==="index-worktree"?t!==void 0&&n!==void 0:e==="index-only"?t!==void 0&&n===void 0:e==="worktree-only"?t===void 0&&n!==void 0:e==="process-local"&&t===void 0&&n===void 0}function Oe(e){return e==="index-worktree"||e==="index-only"||e==="worktree-only"||e==="process-local"}function ie(e){return e==="index-generation"||e==="repository-snapshot"||e==="live-workspace"||e==="process"}function oe(e){return typeof e=="string"&&!Number.isNaN(Date.parse(e))}function A(e,t){return new Set(e.map(t)).size===e.length}function He(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return t.kind==="automated-adjudication"&&t.policyVersion===1&&(t.decidedBy==="agent"||t.decidedBy==="human")&&G.includes(t.reasonCode)&&Array.isArray(t.evidence)&&t.evidence.length>0&&t.evidence.every(we)&&(t.observation===void 0||re(t.observation))&&!!t.invalidateOn&&typeof t.invalidateOn=="object"&&typeof t.invalidateOn.targetContentChange=="boolean"&&typeof t.invalidateOn.detectorMajorChange=="boolean"}function we(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let t=e;return(t.kind==="source"||t.kind==="config"||t.kind==="test"||t.kind==="graph")&&typeof t.referent=="string"&&t.referent.trim()!==""&&typeof t.claim=="string"&&t.claim.trim()!==""&&(t.contentHash===void 0||/^[a-f0-9]{64}$/u.test(t.contentHash))&&(t.generation===void 0||typeof t.generation=="string"&&t.generation.length>0)}var h=".scipquery.json",Ie=2e3,se=5e3,ae=se,ke=15*6e4,ce={enabled:!0,windowMs:15*6e4,maxRebuilds:2,maxEstimatedWriteBytes:1024*1024*1024},je={enabled:!1,autoStart:!1,allowExpensiveRebuild:!1,debounceMs:Ie,cooldownMs:ae,gitPollMs:2e3,idleTimeoutMs:ke,autoRefresh:!0,ignore:[],resourceBudget:ce};var it=new Set(L);function ot(e){let t=Pe(e,h);if(!Re(t))return{};let n;try{n=F(t,{maxBytes:V,inputKind:"scip-query project config"})}catch(r){let s=r instanceof Error?r.message:String(r);throw new Error(`unable to read ${h} at ${t}: ${s}`,{cause:r})}return Ae(Z(n),t,"read").config}function st(e){return{...je,...e.watch,cooldownMs:Math.max(se,e.watch?.cooldownMs??ae),resourceBudget:{...ce,...e.watch?.resourceBudget}}}function Ae(e,t,n){if(e.kind==="legacy"||e.kind==="supported")return e;if(e.kind==="malformed"){let s=n==="read"?`invalid ${h} at ${t}: ${e.reason}`:`Cannot update ${t}: the latest project config is ${e.reason}.`;throw new Error(`${s} The file was left untouched.`)}let r=n==="read"?`invalid ${h} at ${t}`:`Cannot update ${t}: the latest project config is invalid`;throw new Error(`${r} (unsupported ${e.direction} schemaVersion ${e.schemaVersion}; this scip-query reads legacy v${f} and current v${m}). Upgrade scip-query before retrying; the file was left untouched.`)}import{existsSync as y,lstatSync as Ee}from"fs";import{resolve as _e}from"path";function xt(e,t,n,r={}){let s=new Date().toISOString();if(!y(n.dbPath))return{state:"missing",checkedAt:s,metaPath:n.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(n.metaPath))return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let i=R(S(n.metaPath,"reindex metadata"));if(i.kind==="unsupported")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Reindex metadata version ${i.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(i.kind==="malformed")return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not decode reindex metadata: ${i.reason}`,remedy:"Run: scip-query reindex"};let a=i.metadata,c=t.languages??Q(e),o=a.fingerprint,u=n.cacheDir&&r.gitContext&&I(r.gitContext,n.cacheDir,o)?o:void 0,g=n.cacheDir&&r.gitContext&&u&&Ne(u,c,t)&&Te(e,u,t)?r.gitObservation?.context===r.gitContext?r.gitContext:H(r.gitContext):void 0,de=r.gitObservation&&r.gitObservation.context===r.gitContext?r.gitObservation.projectFileInventorySequence:void 0,M=g?.clean&&W(e,void 0,{cachedInventoryAfterSequence:de})?g:void 0,b=n.cacheDir&&M&&u&&I(M,n.cacheDir,u)?u:Me(e,c,t),N=[...a.indexedLanguages??[]].sort(),v=i.capabilities.publishableGeneration&&q(O(a.fingerprint),b)&&JSON.stringify(N)===JSON.stringify(b.languages),C=P(n.dbPath,n.metaPath),T=C.state==="invalid"||C.state==="drifted",x=v?X(n.dbPath,b,N):void 0,$=x?.state==="incomplete",D=v&&!T&&!$;return{state:D?"fresh":"stale",checkedAt:s,metaPath:n.metaPath,updatedAt:a.updatedAt,lastRefresh:a.lastRefresh,reason:T?`SQLite generation requires repair: ${C.reason}`:$?`SQLite generation is missing ${x.missingDocumentCount} indexed source document(s): ${x.missingPaths.join(", ")}`:v?"Index metadata fingerprint matches current source files.":"Index metadata fingerprint differs from current source files.",remedy:D?void 0:"Run: scip-query reindex"}}catch(i){return{state:"unknown",checkedAt:s,metaPath:n.metaPath,reason:`Could not read reindex metadata: ${i instanceof Error?i.message:String(i)}`,remedy:"Run: scip-query reindex"}}}function St(e){let t=new Date().toISOString();if(!y(e.dbPath))return{state:"missing",checkedAt:t,metaPath:e.metaPath,reason:"No SQLite index database exists.",remedy:"Run: scip-query reindex"};if(!y(e.metaPath))return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:"No reindex metadata file exists next to the SQLite index.",remedy:"Run: scip-query reindex"};try{let n=R(S(e.metaPath,"reindex metadata"));if(n.kind==="unsupported")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Reindex metadata version ${n.version} is unsupported by this scip-query build.`,remedy:"Upgrade scip-query or run: scip-query reindex"};if(n.kind==="malformed")return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not decode reindex metadata: ${n.reason}`,remedy:"Run: scip-query reindex"};let r=n.metadata,s=[...r.indexedLanguages??[]].sort(),i=O(r.fingerprint),a=[...i?.languages??[]].sort(),c=n.capabilities.publishableGeneration&&i!==null&&JSON.stringify(s)===JSON.stringify(a),o=P(e.dbPath,e.metaPath),u=o.state==="invalid"||o.state==="drifted",g=c&&!u;return{state:g?"fresh":"stale",checkedAt:t,metaPath:e.metaPath,updatedAt:r.updatedAt,lastRefresh:r.lastRefresh,reason:u?`SQLite generation requires repair: ${o.reason}`:c?"Watcher accepted the newly published index generation with no later changes pending.":"Published index metadata is not a complete queryable generation.",remedy:g?void 0:"Run: scip-query reindex"}}catch(n){return{state:"unknown",checkedAt:t,metaPath:e.metaPath,reason:`Could not read reindex metadata: ${n instanceof Error?n.message:String(n)}`,remedy:"Run: scip-query reindex"}}}function Me(e,t,n){return K(e,t,{pnpmWorkspaces:n.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:n.indexer?.typescript?.projectMode,typescriptProjects:n.indexer?.typescript?.projects,clojureConfigPath:n.indexer?.clojure?.configPath})}function Ne(e,t,n){let r=$e(t,n);return e.version===r.version&&JSON.stringify([...e.languages].sort())===JSON.stringify(r.languages)&&e.pnpmWorkspaces===r.pnpmWorkspaces&&e.typescriptProjectMode===r.typescriptProjectMode&&JSON.stringify([...e.typescriptProjects].sort())===JSON.stringify(r.typescriptProjects)&&e.clojureConfigPath===r.clojureConfigPath}function Te(e,t,n){if(!(t.languages.includes("typescript")||!!t.clojureConfigPath))return!0;let s=J(e);if(t.clojureConfigPath){let i=U(t.clojureConfigPath);if(!s.includes(i))return!1;try{if(!Ee(_e(e,i)).isFile())return!1}catch{return!1}}return!t.languages.includes("typescript")||Y(e,n.indexer?.typescript?.projectMode,n.indexer?.typescript?.projects??[],s)}function $e(e,t){return z(e,{pnpmWorkspaces:t.indexer?.typescript?.pnpmWorkspaces,typescriptProjectMode:t.indexer?.typescript?.projectMode,typescriptProjects:t.indexer?.typescript?.projects,clojureConfigPath:t.indexer?.clojure?.configPath})}export{te as a,Be as b,He as c,ot as d,st as e,xt as f,St as g};
|
|
2
|
-
//# sourceMappingURL=chunk-HMEWLMML.js.map
|
package/dist/chunk-HOBOVYPO.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{a as S}from"./chunk-NSM5IEVW.js";import{c as y}from"./chunk-2BMSSRBH.js";import{i as v}from"./chunk-YSYPDRD5.js";import{a as R,b as k,j as b}from"./chunk-NJQISBL4.js";import{b as C}from"./chunk-FLMTCX5R.js";import{d as h}from"./chunk-C7C6AKAT.js";import{Ba as f,Ca as g,c as m}from"./chunk-JZ2A7LDM.js";function _(e,a){let n=m(a),t=[],r="complete",o=C(n);o==="entry"&&s(t,"operational-root","structural entrypoint path"),o==="worker"&&s(t,"operational-root","worker launch convention"),b(n)&&s(t,"operational-root","framework-discovered entrypoint"),L(e,n)&&s(t,"operational-root","configured entry root");let l=!1;try{l=R(e,n),l&&s(t,"published-api","package manifest export");for(let i of k(e,n))s(t,"operational-root",i)}catch(i){r="partial",s(t,"metadata-unavailable",`package metadata unavailable: ${x(i)}`)}try{let i=f(e.config.projectRoot,n,{maxBytes:8388608,inputKind:"change-surface source"});w(i)&&s(t,"operational-root","module contains a direct-execution process guard")}catch(i){r="partial",s(t,"metadata-unavailable",g(i)?"indexed source file is unavailable on disk":`source metadata unavailable: ${x(i)}`)}return{operationalRoot:t.some(i=>i.kind==="operational-root"),publishedApi:l,coverage:r,reasons:t}}function L(e,a){let n=e.config.entryRoots;return n?n.files?.some(t=>m(t)===a)?!0:n.pathPrefixes?.some(t=>a.startsWith(m(t)))??!1:!1}function w(e){return e.includes("import.meta.url")&&/process\.argv\s*\[\s*1\s*\]/.test(e)||/require\.main\s*===\s*module/.test(e)||/__name__\s*==\s*['"]__main__['"]/.test(e)}function s(e,a,n){e.some(t=>t.kind===a&&t.detail===n)||e.push({kind:a,detail:n})}function x(e){return e instanceof Error?e.message:String(e)}function q(e,a,n={}){let t=S(e,a);if(!t)return null;let r=D(e,t);if(!r||e.isIgnored(r.relative_path))return null;let o=[],l=0,i=M(e,r.relative_path),p=_(e,r.relative_path),F=n.semantic===!1?new Map:v(e,i);for(let u of i){let c=I(e,r,u,F.get(u.symbolId)??new Set);l+=c;let d=N(c),E=[...p.reasons,...c>0?[{kind:"external-consumers",detail:`${c} external consumer${c===1?"":"s"}`}]:[]];o.push({symbol:u.symbol,shortName:h(u.symbol),startLine:u.startLine,endLine:u.endLine,externalConsumers:c,externalConsumerRiskLevel:d,riskLevel:P(d,p),riskReasons:E})}return{file:r.relative_path,symbols:o,totalExternalConsumers:l,fileRisk:p}}function D(e,a){return e.get(`SELECT id, relative_path FROM documents
|
|
2
|
-
WHERE relative_path = ?
|
|
3
|
-
${e.pathExclusionsFor("documents")}
|
|
4
|
-
LIMIT 1`,a)??null}function M(e,a){return new y(e).definitionsForFile(a).sort((n,t)=>n.startLine-t.startLine||n.endLine-t.endLine)}function I(e,a,n,t){let r=e.all(`SELECT DISTINCT consumer_d.relative_path
|
|
5
|
-
FROM mentions m
|
|
6
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
7
|
-
JOIN documents consumer_d ON consumer_d.id = c.document_id
|
|
8
|
-
WHERE m.symbol_id = ?
|
|
9
|
-
AND m.role != 1
|
|
10
|
-
AND c.document_id != ?`,n.symbolId,a.id);return new Set([...r.map(o=>o.relative_path),...[...t].filter(o=>o!==a.relative_path)]).size}function N(e){return e>10?"high":e>0?"medium":"low"}function P(e,a){return e==="high"?"high":e==="medium"||a.operationalRoot||a.publishedApi||a.coverage==="partial"?"medium":"low"}export{q as a};
|
|
11
|
-
//# sourceMappingURL=chunk-HOBOVYPO.js.map
|
package/dist/chunk-HRFQ6GW5.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import{a as B,c as D,i as L,k as H}from"./chunk-DBN7DMJB.js";import{j as E,o as T}from"./chunk-ZFVPWH62.js";import{d as A}from"./chunk-KMVGRIO2.js";import{c as _}from"./chunk-2BMSSRBH.js";import{d as C,e as y}from"./chunk-C7C6AKAT.js";import{a as N}from"./chunk-RBAD4GJ2.js";var J=5;function se(e,n={}){let{base:i="HEAD",minContainment:r=.7,minCallees:s=3,minSiteCoverage:t=.4,maxHelpers:m=Number.POSITIVE_INFINITY,limit:c=20,scanLimit:d}=n,g=n.semantic!==!1,l=n.diffPlan??D(e,{base:i}),a={available:l.note!==B,base:i,changedFiles:l.changedFiles,helpersChecked:0,skipped:[],findings:[],...l.note?{note:l.note}:{}};if(!a.available||l.changedFiles.length===0)return a;let v=new _(e),x=new Set(l.changedFiles),j=new Map(l.renamedFiles.map(o=>[o.to,o.from]));if(n.baseContentAt&&n.baseContentResultAt)throw new Error("Specify only one of baseContentAt or baseContentResultAt.");let $=n.baseContentResultAt?n.baseContentResultAt:n.baseContentAt?Q(n.baseContentAt):L({projectRoot:e.config.projectRoot,base:i,preloadPaths:H(l)}),f=Z(v,x,j,$);if(f.unavailable)return a.available=!1,a.note=`Base content unavailable: ${f.unavailable.reason}`,a;if(f.definitions.length===0)return a;let k=f.definitions.slice(0,m);f.definitions.length>m&&(a.note=`helper scoring capped at ${m} of ${f.definitions.length} new symbols`);let z=v.calleeMap(k,{semantic:g}),q=k.map(o=>({def:o,callees:T((z.get(o.symbolId)??[]).map(p=>p.symbol))})),V=E(e),M,G=()=>(M??=V.calleeIndex({minCallees:Math.min(3,s),scanLimit:d,semantic:g}),M);for(let{def:o,callees:p}of q){let u=C(o.symbol);if(p.size<s){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:`fewer than ${s} meaningful callees \u2014 too small to score`});continue}let P=G(),w=Y(p,P);if(w===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"helper callee pattern is all project-wide infrastructure \u2014 too generic to score"});continue}let S=ee(e,o.symbolId);if(S.length===0){a.skipped.push({helperShortName:u,helperFile:o.relativePath,reason:"no references yet \u2014 covered by the new-dead check"});continue}a.helpersChecked+=1;let I=K({candidateIndex:P,changed:x,helperCallees:p,helperFile:o.relativePath,helperSymbol:o.symbol,minContainment:r,minSiteCoverage:t,migratedFiles:S});I.length!==0&&(I.sort((h,b)=>O(b.migrationScope)-O(h.migrationScope)||b.containment-h.containment||b.siteCoverage-h.siteCoverage||h.file.localeCompare(b.file)),a.findings.push({helperSymbol:o.symbol,helperShortName:u,helperFile:o.relativePath,helperShape:"specific-callee-cluster",helperCalleeCount:p.size,specificHelperCalleeCount:w,migratedFiles:S.sort(),leftovers:I.slice(0,J)}))}return a.findings.sort((o,p)=>(p.leftovers[0]?.containment??0)-(o.leftovers[0]?.containment??0)||o.helperFile.localeCompare(p.helperFile)),a.findings=a.findings.slice(0,c),a}function K(e){let n=[],i=U(e.helperSymbol,e.helperFile,e.migratedFiles),r=new Set;for(let s of e.helperCallees)for(let t of e.candidateIndex.candidateIndexesByCallee.get(s)??[])r.add(t);for(let s of r){let t=e.candidateIndex.corpus[s];if(t.symbol===e.helperSymbol||e.changed.has(t.file)||t.callees.has(e.helperSymbol))continue;let m=A(e.helperCallees,t.callees);if(m<e.minContainment)continue;let c=[...e.helperCallees].filter(l=>t.callees.has(l)),d=t.callees.size===0?0:c.length/t.callees.size;if(d<e.minSiteCoverage||!c.some(l=>(e.candidateIndex.docFreq.get(l)??0)<=e.candidateIndex.ubiquityThreshold))continue;let g=W(i,t.symbol,t.file);n.push({symbol:t.symbol,shortName:C(t.symbol),file:t.file,...g,containment:m,siteCoverage:d,uniqueSiteCalleeCount:Math.max(0,t.callees.size-c.length),sharedCallees:c.map(C).sort()})}return n}function O(e){return e==="same-scope"?2:e==="unknown"?1:0}function U(e,n,i){let r=new Set([...F(n),...R(y(e))]);for(let s of i)for(let t of F(s))r.add(t);return r}function W(e,n,i){let r=new Set([...F(i),...R(y(n))]);if(e.size===0||r.size===0)return{migrationScope:"unknown",migrationScopeReasons:["insufficient path/name tokens to infer migration scope"]};let s=[...r].filter(t=>e.has(t)).sort();return s.length>0?{migrationScope:"same-scope",migrationScopeReasons:[`shares migration-scope token(s): ${s.slice(0,5).join(", ")}`]}:{migrationScope:"possible-subtype",migrationScopeReasons:["no path/name tokens shared with the helper or already migrated files"]}}var X=new Set(["app","apps","common","component","components","helper","helpers","index","lib","package","packages","page","pages","route","routes","service","services","shared","spec","src","test","tests","util","utils"]);function F(e){return R(e.replace(/\.[^.]+$/,""))}function R(e){return e.replace(/([a-z0-9])([A-Z])/g,"$1 $2").toLowerCase().split(/[^a-z0-9]+/).filter(n=>n.length>1&&!X.has(n))}function Y(e,n){let i=0;for(let r of e)(n.docFreq.get(r)??0)<=n.ubiquityThreshold&&(i+=1);return i}function Z(e,n,i,r){let s=[];for(let t of e.productionCallableDefinitions({files:[...n],requireFunctionLikeSymbol:!0})){if(!n.has(t.relativePath))continue;let m=i.get(t.relativePath)??t.relativePath,c=r(m);if(c.state==="unavailable")return{definitions:[],unavailable:c};(c.state==="absent"||!new RegExp(`\\b${N(t.leaf)}\\b`).test(c.content))&&s.push(t)}return{definitions:s}}function Q(e){return n=>{let i=e(n);return i===null?{state:"absent"}:{state:"present",content:i}}}function ee(e,n){return e.all(`SELECT DISTINCT ref_d.relative_path
|
|
2
|
-
FROM mentions m
|
|
3
|
-
JOIN chunks c ON m.chunk_id = c.id
|
|
4
|
-
JOIN documents ref_d ON c.document_id = ref_d.id
|
|
5
|
-
WHERE m.symbol_id = ?
|
|
6
|
-
AND m.role != 1
|
|
7
|
-
${e.pathExclusionsFor("ref_d")}`,n).map(r=>r.relative_path)}export{se as a};
|
|
8
|
-
//# sourceMappingURL=chunk-HRFQ6GW5.js.map
|
package/dist/chunk-HX4X7KG3.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{J as a,T as c}from"./chunk-2VAHDDLM.js";var D=4;function m(e,i,t,r={}){return p(e,i,t,r.maxReexportDepth??D,0,new Set)}function p(e,i,t,r,s,o){let f=`${i}\0${t}`;if(o.has(f)||s>r)return[];o.add(f);let u=c(e,i).filter(n=>n.leaf===t);return u.length>0?u:a(e,i).flatMap(n=>n.sourcePath?n.kind==="named"&&!n.names.includes(t)?[]:p(e,n.sourcePath,t,r,s+1,new Set(o)):[])}export{m as a};
|
|
2
|
-
//# sourceMappingURL=chunk-HX4X7KG3.js.map
|
package/dist/chunk-HYT2R7LX.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{b as i}from"./chunk-RVZC6TJE.js";import{a as o}from"./chunk-L7KTFEAV.js";import{Y as l}from"./chunk-2VAHDDLM.js";function y(e,r){let s=i(e,r);if(s.length===0)return{files:[],symbols:[],dependsOn:[],dependedOnBy:[]};let a=s.map(()=>"?").join(", "),n=e.all(`SELECT relative_path FROM documents
|
|
2
|
-
WHERE relative_path IN (${a})
|
|
3
|
-
ORDER BY relative_path`,...s).map(t=>t.relative_path).filter(t=>!e.isIgnored(t)),p=l(e,n,{onlyDocumented:!0,sort:!0}).map(({relativePath:t,...f})=>f),m=o(e,"forward",s).filter(t=>!e.isIgnored(t)),d=o(e,"reverse",s).filter(t=>!e.isIgnored(t));return{files:n,symbols:p,dependsOn:m,dependedOnBy:d}}function g(e,r){return y(e,r)}export{y as a,g as b};
|
|
4
|
-
//# sourceMappingURL=chunk-HYT2R7LX.js.map
|
package/dist/chunk-IKQVBVQL.js
DELETED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import{a as y}from"./chunk-2GJSD5GY.js";import{b as f}from"./chunk-F5GSBHC6.js";import{c as h,d as w}from"./chunk-MTDBHTSF.js";import{d as u,e as m,j as b,r as p,s as g}from"./chunk-C7C6AKAT.js";import{dirname as $,isAbsolute as k,relative as x,resolve as v}from"path";var C=new Set(w());function R(t,e){return`tests/generated/twin-ab/${d(t)}-vs-${d(e)}.test.ts`}function d(t){return(t.split(/[/#]/).pop()||t).replace(/[^A-Za-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"symbol"}function P(t,e,a,n){let{refA:l,refB:s,outFile:r}=typeof e=="string"?{refA:e,refB:a,outFile:n}:e;if(typeof l!="string"||typeof s!="string"||typeof r!="string")throw new TypeError("twinAb requires refA, refB, and outFile.");if(!k(r))throw new TypeError("twinAb outFile must be an absolute path.");let i=A(t,l);if(!i.ok)return i;let o=A(t,s);if(!o.ok)return o;let c=i.symbol.paramCount===null||o.symbol.paramCount===null?null:i.symbol.paramCount===o.symbol.paramCount,S=N(i.symbol,o.symbol,t.config.projectRoot,r,c);return{ok:!0,a:i.symbol,b:o.symbol,signatureCompatible:c,testSource:S}}function A(t,e){let n=f(t,e).match;if(!n)return{ok:!1,reason:`${e} does not resolve to an indexed symbol.`};let s=t.get("SELECT kind FROM global_symbols WHERE id = ?",n.symbolId)?.kind??null;if(!(s!==null?C.has(s):b(n.symbol)))return{ok:!1,reason:`${e} resolves to ${u(n.symbol)}${s!==null?` with SCIP kind ${h(s)}`:""} \u2014 twin-ab compares call outputs, so both referents must be functions or methods.`};if(!y(t,n))return{ok:!1,reason:`${e} (${u(n.symbol)} at ${n.relativePath}:${n.startLine+1}) is not exported \u2014 twin-ab needs an importable named binding for both twins.`};let i=t.get("SELECT documentation FROM global_symbols WHERE id = ?",n.symbolId),o=p(g(i?.documentation??null));return{ok:!0,symbol:{ref:e,symbol:n.symbol,shortName:m(n.symbol)||u(n.symbol),file:n.relativePath,startLine:n.startLine,signature:o,paramCount:o?E(o):null}}}function E(t){let e=t.indexOf("(");if(e===-1)return null;let a=0,n=-1;for(let i=e;i<t.length;i+=1){let o=t[i];if(o==="(")a+=1;else if(o===")"&&(a-=1,a===0)){n=i;break}}if(n===-1)return null;let l=t.slice(e+1,n).trim();if(!l)return 0;let s=1,r=0;for(let i of l)i==="("||i==="["||i==="{"?r+=1:i===")"||i==="]"||i==="}"?r=Math.max(0,r-1):i===","&&r===0&&(s+=1);return s}function T(t,e,a){let n=$(e),l=v(t,a),r=x(n,l).replace(/\\/g,"/").replace(/\.tsx?$/,".js");return r.startsWith(".")?r:`./${r}`}function N(t,e,a,n,l){let s=T(a,n,t.file),r=T(a,n,e.file),i=l===null?"Signature comparison: unknown (one or both signatures unavailable in the index) \u2014 check by hand.":l?"Signature comparison: param counts match.":"Signature comparison: param counts DIFFER \u2014 twins may not be directly comparable; check by hand.";return`/**
|
|
2
|
-
* Generated by 'scip-query twin-ab'. Cleanup integrity scenario.
|
|
3
|
-
* ("cross-examine same-concept twins"): where one concept is computed in
|
|
4
|
-
* more than one place, feed both the same input and require the same
|
|
5
|
-
* answer. Disagreement between twins means at least one is wrong \u2014
|
|
6
|
-
* determine which before consolidating.
|
|
7
|
-
*
|
|
8
|
-
* Twin A: ${t.shortName} (${t.file}:${t.startLine+1})
|
|
9
|
-
* ${t.signature??"(signature unavailable)"}
|
|
10
|
-
* Twin B: ${e.shortName} (${e.file}:${e.startLine+1})
|
|
11
|
-
* ${e.signature??"(signature unavailable)"}
|
|
12
|
-
* ${i}
|
|
13
|
-
*
|
|
14
|
-
* Fill in the TODO input table below with inputs both twins should agree
|
|
15
|
-
* on, then run this file with vitest.
|
|
16
|
-
*/
|
|
17
|
-
import { describe, expect, it } from 'vitest';
|
|
18
|
-
import { ${t.shortName} as twinA } from '${s}';
|
|
19
|
-
import { ${e.shortName} as twinB } from '${r}';
|
|
20
|
-
|
|
21
|
-
// TODO: fill in shared inputs both twins should agree on \u2014 one arg array per call.
|
|
22
|
-
const inputs: any[][] = [
|
|
23
|
-
// [/* arg1, arg2, ... */],
|
|
24
|
-
];
|
|
25
|
-
|
|
26
|
-
// Cast to a variadic signature so the input table can hold any arg shape \u2014
|
|
27
|
-
// the real twins have fixed, non-rest parameter lists, and TS rejects
|
|
28
|
-
// spreading a generic args array into those (TS2556) even when the array
|
|
29
|
-
// itself is 'any'; casting the callee's signature, not the args, satisfies
|
|
30
|
-
// the checker without weakening the twins' real exported types elsewhere.
|
|
31
|
-
const callA = twinA as (...callArgs: any[]) => any;
|
|
32
|
-
const callB = twinB as (...callArgs: any[]) => any;
|
|
33
|
-
|
|
34
|
-
describe.skipIf(inputs.length === 0)('twin-ab: ${t.shortName} vs ${e.shortName}', () => {
|
|
35
|
-
it.each(inputs)('agrees on input %#', (...args) => {
|
|
36
|
-
expect(callA(...args)).toEqual(callB(...args));
|
|
37
|
-
});
|
|
38
|
-
});
|
|
39
|
-
`}export{R as a,P as b};
|
|
40
|
-
//# sourceMappingURL=chunk-IKQVBVQL.js.map
|
package/dist/chunk-IW5XQG5G.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
var f=[];function d(e){e.groups.length>0&&f.push(e)}function m(e,a){let t=new Set(a.groups);for(let c of f)c.groups.some(n=>t.has(n))&&(a.file!==void 0&&c.clearFile?c.clearFile(e,a.file):c.clearAll(e))}var h=256;function g(e){let a=e.maxEntries;if(a!==void 0){if(!Number.isSafeInteger(a)||a<1)throw new Error(`Per-database cache maxEntries must be a positive safe integer; received ${a}.`);return a}return e.clearGroups.includes("source-file")?h:void 0}function C(e,a,t){e.delete(a),e.set(a,t)}function v(e,a){if(a!==void 0)for(;e.size>a;){let t=e.keys().next().value;if(t===void 0)return;e.delete(t)}}function D(){let e=new WeakMap;return{cache:e,ensure(a){let t=e.get(a);return t||(t=new Map,e.set(a,t)),t}}}function x(e,a){let{cache:t,ensure:c}=D(),n=g(a),s={get(r,i,p){let o=c(r);if(o.has(i)){let u=o.get(i);return C(o,i,u),u}let l=p();return o.set(i,l),v(o,n),l},has(r,i){return t.get(r)?.has(i)??!1},invalidate(r,i){t.get(r)?.delete(i)},invalidateAll(r){t.delete(r)},size(r){return t.get(r)?.size??0}};return d({name:e,groups:a.clearGroups,clearAll:r=>s.invalidateAll(r),clearFile:(r,i)=>s.invalidate(r,i)}),s}function E(e,a){let t=new WeakMap,c={get(n,s){let r=t.get(n);if(r)return r.value;let i=s();return t.set(n,{value:i}),i},invalidate(n){t.delete(n)},has(n){return t.has(n)}};return d({name:e,groups:a.clearGroups,clearAll:n=>c.invalidate(n)}),c}var V={clearGroups:["whole-project","source-file"],maxEntries:h};function A(e){return S(e,V)}function S(e,a){let{cache:t,ensure:c}=D(),n=g(a),s={get(r,i,p,o){let l=c(r),u=l.get(i);if(u&&u.source===p)return C(l,i,u),u.value;let b=o();return l.set(i,{source:p,value:b}),v(l,n),b},invalidate(r,i){t.get(r)?.delete(i)},invalidateAll(r){t.delete(r)}};return d({name:e,groups:a.clearGroups,clearAll:r=>s.invalidateAll(r),clearFile:(r,i)=>s.invalidate(r,i)}),s}export{d as a,m as b,x as c,E as d,A as e,S as f};
|
|
2
|
-
//# sourceMappingURL=chunk-IW5XQG5G.js.map
|
package/dist/chunk-J6GLBBRK.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as N,b as fe,e as ye,h as X,k as we,m as ve}from"./chunk-QBQE7ZJ5.js";import{b as L}from"./chunk-BOW7SSQH.js";import{C as Fe,a as Me}from"./chunk-ZLMXIQLC.js";import{c as Re,e as Ie}from"./chunk-ETC674NS.js";import{b as Se,d as xe,h as Y,y as Z}from"./chunk-KNLQGXVH.js";import{G as me,J as x,S as ge,T,U as G,g as ae,i as ce,o as de,q as c,u as le,v as ue,x as pe,xa as be,ya as he}from"./chunk-JZ2A7LDM.js";import{execFileSync as Te}from"child_process";import{createHash as it}from"crypto";import{existsSync as C,statSync as ot}from"fs";import{createRequire as st}from"module";import{platform as at}from"os";import{dirname as Pe,join as A}from"path";var ct=st(import.meta.url),jn={language:"rust",indexerBinary:"rust-analyzer",installUrl:"https://github.com/rust-lang/rust-analyzer"};function Q(t){return[t.indexerBinary,...t.binaryAliases??[]]}function dt(t){let e=Q(t);return e.length===1?e[0]:e.join(" or ")}function ee(t){for(let e of Q(t)){let n=ve(e);if(n)return n}return ut(t)}function kn(t){return ee(t)!==null||lt(t)}function lt(t){return Ae(t)!==null}function ut(t){let e=Ae(t);if(!e)return null;let r=JSON.parse(x(e,"indexer package manifest")).bin;if(!r)return null;if(typeof r=="string")return A(Pe(e),r);for(let i of Q(t)){let o=r[i];if(o)return A(Pe(e),o)}return null}function Ae(t){if(!t.bundledNpmPackage)return null;try{return ct.resolve(`${t.bundledNpmPackage}/package.json`)}catch{return null}}function pt(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return r}return null}function ft(t,e){for(let n of t.projectLocalBinaries??[]){let r=A(e,n);if(C(r))return Be(e,n,r)}return null}function Nn(t,e){let n=mt(t,e);if(!n||n.canonicalPath!==e.canonicalPath||n.sha256!==e.sha256||n.size!==e.size||n.mtimeMs!==e.mtimeMs||n.device!==e.device||n.inode!==e.inode||n.executable!==e.executable)throw new Error(`refusing changed project-local indexer ${e.relativePath}; review the current file and rerun with --trust-project-tools`)}function mt(t,e){try{return Be(t,e.relativePath,e.configuredPath)}catch{return null}}function Be(t,e,n){let r={maxBytes:268435456,inputKind:"project-local indexer"},i=be(t,e,r),o=he(t,e,r),s=ot(i.absolutePath);return{configuredPath:n,canonicalPath:i.absolutePath,relativePath:e,sha256:it("sha256").update(o).digest("hex"),size:i.size,mtimeMs:i.mtimeMs,device:i.device,inode:i.inode,executable:(s.mode&73)!==0}}function yt(t,e,n={}){return(n.trustProjectTools?ft(t,e)?.canonicalPath:null)??ee(t)}function Ln(t,e=process.env,n=t.indexerBinary){if(t.indexerBinary!=="scip-dotnet"||te(n,e))return e;let r=Ee(n,e);return r?{...e,DOTNET_ROOT:r}:e}function Cn(t,e,n={}){let r=dt(t),i=e?yt(t,e,n):ee(t);if(!i)return{language:t.language,binaryLabel:r,installed:!1,runnable:!1,resolvedBinary:null,installUrl:t.installUrl,...e&&pt(t,e)?{note:"project-local indexer available only with --trust-project-tools"}:{}};if(t.indexerBinary!=="scip-dotnet")return{language:t.language,binaryLabel:r,installed:!0,runnable:!0,resolvedBinary:i};let o=gt(i);return{language:t.language,binaryLabel:r,installed:!0,runnable:o.runnable,resolvedBinary:i,installUrl:t.installUrl,note:o.note}}function gt(t){if(te(t,process.env))return{runnable:!0};let e=Ee(t,process.env);if(e)return{runnable:!0,note:`using .NET 9 runtime from ${e}`};let n=De(process.env);return{runnable:!1,note:n.length>0?`.NET 9 runtime still unavailable after checking ${n.join(", ")}`:"binary is present, but scip-dotnet still needs a .NET 9 runtime"}}function Ee(t,e){for(let n of De(e))if(te(t,{...e,DOTNET_ROOT:n}))return n;return null}function De(t){let e=[],n=t.DOTNET_ROOT;if(n&&C(n)&&e.push(n),at()==="darwin"&&we("brew"))try{let r=Te("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:t,timeout:1e4,killSignal:"SIGKILL"}).toString().trim(),i=A(r,"libexec");C(i)&&!e.includes(i)&&e.push(i)}catch{}return e}function te(t,e){try{return Te(t,["--version"],{stdio:"pipe",env:e,timeout:1e4,killSignal:"SIGKILL"}),!0}catch{return!1}}import{getHeapStatistics as Nt}from"v8";var bt=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"];function O(t){let e=t.toLowerCase();return bt.some(n=>e.endsWith(n))}function q(t){let e=_(t.projectFiles),n=new Set(e),r=new Map(t.snapshot.files.map(l=>[l.path,l])),i=t.snapshot.files.filter(l=>{let m=ae(l.path,["typescript"]);return m==="config"||m==="ambient"}).map(l=>l.path),o=_([...e,...i]),s=o.find(l=>!r.has(l)),a=new Set(t.snapshot.files.map(l=>l.path)).size!==t.snapshot.files.length,d=!s&&o.some(l=>je(r.get(l))),u=Y(JSON.stringify({pnpmWorkspaces:t.snapshot.pnpmWorkspaces,typescriptProjectMode:t.snapshot.typescriptProjectMode,typescriptProjects:_(t.snapshot.typescriptProjects),membership:e})),p,f;return{identityFor(l,m){if(!n.has(l))return R("target-outside-project");if(a)return R("duplicate-input-path");if(s)return R("missing-input-fingerprint");if(d)return R("unreadable-input");let h=[],S,K;if(t.graph===null)h.push("dependency-graph-unavailable"),K="whole-project",S=o;else{let P=l===p&&f?f:ht(l,t.graph);if(p=l,f=P,P.find(V=>!r.has(V)))return R("missing-input-fingerprint");if(S=_([...P,...i]),S.some(V=>je(r.get(V))))return R("unreadable-input");K="dependency-closure"}let rt=S.map(P=>St(r.get(P)));return{version:1,key:Y(JSON.stringify({version:1,engineIdentity:t.engineIdentity,schemaVersion:m,projectIdentity:u,inputs:rt})),mode:K,inputFiles:S,reasons:h}}}}function ht(t,e){let n=new Set,r=[t];for(let i=0;i<r.length;i+=1){let o=r[i];if(!(o===void 0||n.has(o))){n.add(o);for(let s of[...e.get(o)??[]].sort())n.has(s)||r.push(s)}}return[...n].sort()}function St(t){return t.semanticHash===void 0?{path:t.path,size:t.size,hash:t.hash}:{path:t.path,semanticHash:t.semanticHash}}function je(t){return t.size<0||t.hash==="unreadable"}function R(t){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[t]}}function _(t){return[...new Set(t)].sort()}import{realpathSync as Ft}from"fs";import{createRequire as wt}from"module";import{dirname as vt,resolve as Pt}from"path";import{getHeapStatistics as xt}from"v8";var Mt=2560,Rt=1.25;function It(t){let e=t/1048576;return Math.max(0,Math.floor((e-Mt)/Rt))}function ke(){return It(xt().heap_size_limit)}var Ne=wt(import.meta.url),B,$;function Tt(){if(B!==void 0)return B;try{B=Ne("ts-morph")}catch{B=null}return B}function W(){if($)return $;let t=Tt();if(!t)return"ts-morph:unavailable";let e="unknown";try{e=Ne("ts-morph/package.json").version??"unknown"}catch{}return $=`ts-morph:${e}:typescript:${t.ts.version}`,$}function Gn(t,e,n={}){return e.map(r=>At(t,r,n))}function At(t,e,n){let r=null,i,o,s=()=>(i===void 0&&(i=Le(t,e)),i),a=()=>{if(o===void 0){let d=n.fileBudget??ke(),u=s();o=(u===null?0:Math.ceil(u.size/2))>d*Bt?"file-closure":"project"}return o};return{tsconfigPath:e,get project(){return r??=new t.Project({tsConfigFilePath:e,skipFileDependencyResolution:!0,...a()==="file-closure"?{skipAddingFilesFromTsConfig:!0}:{}}),r},get loaded(){return r!==null},get fileNames(){return s()},get scope(){return a()}}}var Bt=1.35,Xn="TypeScript project-wide semantics are unavailable: a compiler project is file-scoped because its tsconfig lists more files than the worker heap can hold.";function Yn(t){return t.some(e=>e.scope==="file-closure")}function Zn(t,e){let n=new Set;for(let r of e)for(let i of Le(t,r)??[])n.add(i);return n}function Le(t,e){try{let n=t.ts,r=n.readConfigFile(e,n.sys.readFile);if(r.error||!r.config)return null;let i=n.parseJsonConfigFileContent(r.config,n.sys,vt(e),void 0,e),o=new Set;for(let s of i.fileNames){let a=Pt(s);o.add(a);try{o.add(Ft(a))}catch{}}return o}catch{return null}}function Qn(t,e,n){return{language:"typescript",availability:()=>({available:!1,reason:t,tsconfigPath:e,tsconfigPaths:n}),importUsage:()=>[],referencesFor:()=>[],calleesFor:()=>[],signatureFor:()=>null}}var Et=xe("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function H(t,e,n){let r=Et.get(t,()=>Dt(t));if(!r)return null;let i=`${n}\0${e}`,o=r.identities.get(i);if(o)return o;let s=r.builder.identityFor(e,n);return r.identities.set(i,s),s}function I(t){return Me(t,{includeIgnored:!1}).filter(O).sort()}function Dt(t){try{if(!t.generation.metadataRaw)return null;let e=pe(t.generation.metadataRaw);if(e.kind!=="legacy"&&e.kind!=="supported"||!e.capabilities.usableForEvidenceCache)return null;let n=ce(e.metadata.fingerprint);return n?{builder:q({projectFiles:I(t),snapshot:n,graph:L(t),engineIdentity:W()}),identities:new Map}:null}catch{return null}}function _e(t,e){let n=ne(t);for(let r of e.values())n.add(r);return n.finish()}function ne(t){let e=new Map(t.map(r=>[r.symbol,r])),n=new Map(t.map(r=>[r.symbolId,[]]));return{add(r){for(let i of r){let o=e.get(i.targetSymbol);o&&n.get(o.symbolId).push(i.location)}},finish(){for(let[r,i]of n)n.set(r,jt(i));return n}}}function qe(t,e,n){let r=Oe(t,e),i=Oe(t,n),o=[...r].filter(f=>!i.has(f)).sort(),s=[...i].filter(f=>!r.has(f)).sort(),a=Ce(t,e),d=Ce(t,n),u=[...a].filter(f=>!d.has(f)).sort(),p=[...d].filter(f=>!a.has(f)).sort();return{passed:o.length===0&&s.length===0,expectedCount:r.size,actualCount:i.size,missing:o,extra:s,callerFiles:{passed:u.length===0&&p.length===0,expectedCount:a.size,actualCount:d.size,missing:u,extra:p}}}function Ce(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])i.file!==r.relativePath&&n.add(`${r.symbol}\0${i.file}`);return n}function lr(t,e,n){let r=new Set(n),i=new Map(n.map(o=>[o,[]]));for(let o of t)for(let s of e.get(o.symbolId)??[])r.has(s.file)&&i.get(s.file).push({targetSymbol:o.symbol,location:s});for(let[o,s]of i)i.set(o,kt(s));return i}function Oe(t,e){let n=new Set;for(let r of t)for(let i of e.get(r.symbolId)??[])n.add(`${r.symbol}\0${i.file}\0${i.line}\0${i.column}`);return n}function jt(t){let e=new Map;for(let n of t)e.set(`${n.file}\0${n.line}\0${n.column}`,n);return[...e.values()].sort($e)}function kt(t){let e=new Map;for(let n of t){let{location:r}=n;e.set(`${n.targetSymbol}\0${r.file}\0${r.line}\0${r.column}`,n)}return[...e.values()].sort((n,r)=>n.targetSymbol.localeCompare(r.targetSymbol)||$e(n.location,r.location))}function $e(t,e){return t.file.localeCompare(e.file)||t.line-e.line||t.column-e.column}var J="typescript-reference-fragment-v2",We=128,D=Re({kind:"typescript-reference-fragments",invalidation:Ie("typescript-reference-fragments"),serialize:t=>JSON.stringify(t),deserialize:Wt});function Fr(t,e,n,r=t,i,o=new Set(n.keys())){let s=I(t),a=q({projectFiles:s,snapshot:e,graph:i??L(t),engineIdentity:W()}),d=[],u=0;for(let[f,l]of n){let m=a.identityFor(f,J).key;if(!m){u+=1;continue}d.push({relativePath:f,contentHash:m,value:[...l]})}let p=s.filter(f=>!o.has(f)&&!n.has(f)).length;return D.writeBatch(r,d),{affectedFiles:d.length,carriedFiles:p,skippedAffectedFiles:u}}function wr(t,e,n,r){let i=e.filter(s=>O(s.relativePath));if(i.length===0)return E("no TypeScript definitions");let o=E("shadow did not run");return Z("typescript.reference-fragments.shadow",()=>{try{let s=r(i[0].relativePath);if(!s.availability().available||!s.referenceFragmentsForFiles)return o=E("TypeScript reference fragment provider is unavailable"),o;let a=I(t),d=new Set(a),u=new Map;for(let m of He(a)){let h=s.referenceFragmentsForFiles(m);if(m.some(S=>!h.has(S)))return o=E("TypeScript reference fragment provider returned an incomplete batch"),o;for(let S of m)u.set(S,h.get(S)??[])}let p=_e(i,u),f=qe(i,Lt(n,d),p);if(!f.passed)return o={state:"failing",files:a.length,keyedFiles:0,writtenFiles:0,...f},o;let l=[];for(let m of a){let h=H(t,m,J);h?.key&&l.push({relativePath:m,contentHash:h.key,value:u.get(m)??[]})}return D.writeBatch(t,l),o={state:"passing",files:a.length,keyedFiles:l.length,writtenFiles:l.length,...f},o}catch(s){return o=E(s instanceof Error?s.message:String(s)),o}},()=>({...o}))}function Lt(t,e){return new Map([...t].map(([n,r])=>[n,r.filter(i=>e.has(i.file))]))}function vr(t,e,n){if(e.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let r="fallback",i=0,o=0,s=0,a=0;return Z("typescript.reference-fragments.materialize",()=>{try{let d=I(t);i=d.length;let u=ne(e),p=[];for(let l of d){let m=H(t,l,J);if(!m?.key)return null;let h=D.read(t,l,m.key);h===null?(s+=1,p.push({file:l,contentHash:m.key})):(o+=1,u.add(h))}return s===0?(r="hit",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):qt(t,p,n,l=>{for(let{fragments:m}of l)u.add(m);a+=l.length})?(r="computed",{references:u.finish(),files:i,cacheHits:o,cacheMisses:s,computedFiles:a}):null}catch{return null}},()=>({state:r,files:i,cacheHits:o,cacheMisses:s,computedFiles:a}))}function He(t){let e=[];for(let n=0;n<t.length;n+=We)e.push(t.slice(n,n+We));return e}var Ct=.75;function Ot(t){return{heapUsedFraction:()=>{let e=Nt();return e.heap_size_limit>0?e.used_heap_size/e.heap_size_limit:0},collect:Fe,release:()=>Se(t,{groups:["semantic-provider"]})}}function _t(t,e=Ct){return t.heapUsedFraction()<e||t.collect()&&t.heapUsedFraction()<e?!1:(t.release(),!0)}function qt(t,e,n,r,i=Ot(t)){for(let o of He(e)){let s=$t(t,o,n);if(!s)return!1;r(s),_t(i)}return!0}function $t(t,e,n){let r=e.map(({file:s})=>s),i=n(r[0]);if(!i.availability().available||!i.referenceFragmentsForFiles)return null;let o=i.referenceFragmentsForFiles(r);return r.some(s=>!o.has(s))?null:(D.writeBatch(t,e.map(({file:s,contentHash:a})=>({relativePath:s,contentHash:a,value:o.get(s)??[]}))),r.map(s=>({file:s,fragments:o.get(s)??[]})))}function Pr(t){let e=I(t),n=0;for(let r of e){let i=H(t,r,J);if(!i?.key)return null;D.has(t,r,i.key)||(n+=1)}return{files:e.length,missing:n}}function E(t){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:t}}function Wt(t){try{let e=JSON.parse(t);return!Array.isArray(e)||!e.every(Ht)?null:e}catch{return null}}function Ht(t){if(!t||typeof t!="object")return!1;let e=t,n=e.location;return typeof e.targetSymbol=="string"&&!!n&&typeof n.file=="string"&&typeof n.line=="number"&&typeof n.column=="number"}import{createHash as Ut,randomUUID as Ge}from"crypto";import{closeSync as jr,existsSync as v,fstatSync as kr,lstatSync as k,mkdirSync as Nr,openSync as Lr,readdirSync as w,readSync as Cr,renameSync as Xe,rmSync as M}from"fs";import{basename as U,dirname as zt,join as y}from"path";function Je(t){return re(t,Jt)}function re(t,e){return Array.isArray(t)?`[${t.map(n=>re(n,e)).join(",")}]`:t&&typeof t=="object"?`{${Object.entries(t).sort(([n],[r])=>e(n,r)).map(([n,r])=>`${JSON.stringify(n)}:${re(r,e)}`).join(",")}}`:JSON.stringify(t)}function Jt(t,e){return t.localeCompare(e)}var Kt=1,Vt=Object.freeze({maxItems:1024,maxBytes:512*1024*1024,maxItemBytes:64*1024*1024,maxBatch:16,claimLeaseMs:5*6e4,responseRetentionMs:10*6e4,deadLetterRetentionMs:1440*6e4,temporaryRetentionMs:6e4,cleanupBatch:64}),F=class extends Error{constructor(n,r,i,o){let s=n==="item-too-large"?`request is ${o} bytes; per-item limit is ${i.maxItemBytes}`:n==="item-capacity"?`mailbox has ${r.totalItems} retained items; limit is ${i.maxItems}`:n==="byte-capacity"?`mailbox retains ${r.totalBytes} bytes and the request adds ${o}; limit is ${i.maxBytes}`:"another writer held the admission coordinator through the bounded wait";super(`Mailbox backpressure: ${s}. Retry after the service drains or expires retained work.`);this.code=n;this.status=r;this.limits=i;this.attemptedBytes=o;this.name="MailboxBackpressureError"}code;status;limits;attemptedBytes},Gt=".owner.json",Xt={isProcessAlive:()=>!0,readProcessIdentity:()=>null};function Jr(t){return{rootDir:t,pendingDir:y(t,"pending"),inflightDir:y(t,"inflight"),responseDir:y(t,"responses"),deadLetterDir:y(t,"dead-letter"),legacyRequestDir:y(t,"requests")}}function Yt(t={}){let e={...Vt,...t};for(let[n,r]of Object.entries(e))if(!Number.isFinite(r)||r<=0||!Number.isInteger(r))throw new Error(`Mailbox limit ${n} must be a positive integer.`);return e}function Ye(t){let e=[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir].map(n=>ge(n));return G(...e)}function Ur(t,e){return Ut("sha256").update(Je({namespace:t,payload:e})).digest("hex")}function Ze(t){if(!/^[a-f0-9]{64}$/.test(t))throw new Error("Mailbox operation keys must be lowercase SHA-256 identities.");return`op-${t}`}function zr(t,e,n={}){let r=Yt(n.limits),i=n.nowMs??Date.now(),o=Ye(t);return sn(e),Qt(t,r,n.admissionLockTimeoutMs??2e3,n.monotonicNow??ye,n.durability??"durable",()=>{Zt(t,i,r);let s=y(t.pendingDir,`${e.id}.json`),a=y(t.responseDir,`${e.id}.json`),d=Ue(t,e.id);if(d){let l=ze(d,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:l.deadlineAtMs??e.deadlineAtMs}}let u=`${JSON.stringify(e)}
|
|
2
|
-
`,p=Buffer.byteLength(u),f=Qe(t);if(p>r.maxItemBytes)throw new F("item-too-large",f,r,p);if(f.totalItems+1>r.maxItems)throw new F("item-capacity",f,r,p);if(f.totalBytes+p>r.maxBytes)throw new F("byte-capacity",f,r,p);n.onBeforePublish?.();try{let l=n.durability??"durable",m=X(s,u,{durability:l}),h=l==="durable"?G(o,m.directorySync):"not-requested";return{disposition:"accepted",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:e.deadlineAtMs,achievedDurability:m.achievedDurability,directorySync:h}}catch(l){if(l.code!=="EEXIST")throw l;let m=Ue(t,e.id);if(!m)throw l;let h=ze(m,e.operationKey,e.id);return{disposition:"duplicate",requestId:e.id,responsePath:a,authoritativeDeadlineAtMs:h.deadlineAtMs??e.deadlineAtMs}}})}function Zt(t,e,n,r=Xt){let i={reclaimed:0,completedClaimsRemoved:0,responsesRemoved:0,deadLettersRemoved:0,temporaryFilesRemoved:0},o=n.cleanupBatch;for(let s of oe(t.inflightDir)){if(o<=0)break;let a=y(t.responseDir,`${s.requestId}.json`);if(v(a)){M(s.path,{force:!0}),i.completedClaimsRemoved++,o--;continue}if(s.claimExpiresAtMs>e||rn(t,s.ownerId,r)!=="dead")continue;let d=y(t.pendingDir,s.originalFile);try{Xe(s.path,d),i.reclaimed++}catch(u){if(u.code!=="EEXIST")throw u;M(s.path,{force:!0})}T(zt(s.path)),T(t.pendingDir),o--}o=Ke(t.responseDir,o,(s,a)=>a+n.responseRetentionMs,e,()=>{i.responsesRemoved++}),o=Ke(t.deadLetterDir,o,(s,a)=>a+n.deadLetterRetentionMs,e,()=>{i.deadLettersRemoved++});for(let s of[t.pendingDir,t.inflightDir,t.responseDir,t.deadLetterDir,t.legacyRequestDir]){if(o<=0)break;for(let a of et(s)){if(o<=0)break;if(!U(a).includes(".tmp-"))continue;let d;try{d=k(a).mtimeMs}catch(u){if(u.code==="ENOENT")continue;throw u}d+n.temporaryRetentionMs>e||(M(a,{force:!0}),i.temporaryFilesRemoved++,o--)}}return an(t.inflightDir),i}function Qe(t){Ye(t);let e=[...j(t.pendingDir).map(d=>({path:d,pending:!0})),...j(t.legacyRequestDir).map(d=>({path:d,pending:!0}))],n=oe(t.inflightDir).map(d=>({path:d.path,pending:!1})),r=j(t.responseDir).map(d=>({path:d,pending:!1})),i=j(t.deadLetterDir).map(d=>({path:d,pending:!1})),o=[...e,...n,...r,...i],s=0,a;for(let d of e){let u=se(d.path);if(!u){s++;continue}let p=u.enqueuedAtMs;if(p===void 0)try{p=k(d.path).mtimeMs}catch(f){if(f.code==="ENOENT")continue;throw f}a=a===void 0?p:Math.min(a,p)}return{pending:e.length,inflight:n.length,responses:r.length,deadLetters:i.length,invalid:s,totalItems:o.length,totalBytes:o.reduce((d,u)=>d+cn(u.path),0),...a===void 0?{}:{oldestPendingAt:new Date(a).toISOString()}}}function Qt(t,e,n,r,i,o){let s=y(t.rootDir,".admission.lock"),a=`${process.pid}-${Ge()}`,d=r()+Math.max(0,n);for(;!en(t.rootDir,s,a,i);){if(tn(s),r()>=d)throw new F("admission-busy",Qe(t),e,0);Atomics.wait(new Int32Array(new SharedArrayBuffer(4)),0,0,5)}try{return o()}finally{try{ie(s).ownerToken===a&&(M(s,{recursive:!0,force:!0}),i==="durable"&&T(t.rootDir))}catch{}}}function en(t,e,n,r){let i=`${JSON.stringify({ownerToken:n,pid:process.pid,acquiredAtMs:Date.now()})}
|
|
3
|
-
`;try{return X(e,i,{durability:r}),!0}catch(o){if(o.code==="EEXIST")return!1;try{ie(e).ownerToken===n&&(M(e,{force:!0}),r==="durable"&&T(t))}catch{}throw o}}function tn(t){let e=null;try{let r=ie(t);typeof r.ownerToken=="string"&&Number.isSafeInteger(r.pid)&&Number(r.pid)>0&&(e=Number(r.pid))}catch{}if(e===null||nn(e))return;let n=`${t}.stale-${Ge()}`;try{Xe(t,n)}catch(r){let i=r.code;if(i==="ENOENT"||i==="EEXIST")return;throw r}M(n,{recursive:!0,force:!0})}function ie(t){try{return JSON.parse(x(t,"mailbox lock record"))}catch(e){if(e.code!=="EISDIR"&&!(e instanceof me&&e.reason==="not-regular"))throw e;return JSON.parse(x(y(t,"owner.json"),"mailbox lock owner record"))}}function nn(t){try{return process.kill(t,0),!0}catch(e){let n=e.code;return n==="EPERM"||n!=="ESRCH"}}function rn(t,e,n){let r=on(y(t.inflightDir,tt(e),Gt));if(!r)return"unknown";if(!n.isProcessAlive(r.pid))return"dead";if(!r.processIdentity)return"live";let i=n.readProcessIdentity(r.pid);return i?fe(r.processIdentity,i)?"live":"dead":"unknown"}function on(t){try{let e=JSON.parse(x(t,"mailbox owner record"));if(e.version!==1||typeof e.ownerId!="string"||!e.ownerId||typeof e.pid!="number"||!Number.isSafeInteger(e.pid)||e.pid<=0)return null;let n=e.processIdentity===void 0?null:N(e.processIdentity);return e.processIdentity!==void 0&&(!n||n.pid!==e.pid)?null:{version:1,ownerId:e.ownerId,pid:e.pid,...n?{processIdentity:n}:{}}}catch{return null}}function Ue(t,e){for(let n of[y(t.pendingDir,`${e}.json`),y(t.legacyRequestDir,`${e}.json`),y(t.responseDir,`${e}.json`)])if(v(n))return n;for(let n of oe(t.inflightDir))if(n.requestId===e)return n.path;return null}function ze(t,e,n){let r=se(t);if(r?.operationKey===e)return r;if(U(t)===`${Ze(e)}.json`)return{id:n,operationKey:e};throw new Error(`Mailbox operation ${n} conflicts with an existing retained record.`)}function sn(t){if(t.mailboxVersion!==Kt||t.id!==Ze(t.operationKey)||!t.clientId.trim()||!Number.isFinite(t.enqueuedAtMs)||!Number.isFinite(t.deadlineAtMs)||t.deadlineAtMs<t.enqueuedAtMs)throw new Error("Mailbox request has an invalid lifecycle identity.")}function oe(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){if(!n.isDirectory())continue;let r=Ve(n.name);if(r===null)continue;let i=y(t,n.name);for(let o of w(i,{withFileTypes:!0})){if(!o.isFile()||!o.name.endsWith(".claim"))continue;let s=/^(.*)\.(\d+)\.claim$/.exec(o.name);if(!s)continue;let a=Ve(s[1]),d=Number(s[2]);if(a===null||U(a)!==a||!a.endsWith(".json")||!Number.isSafeInteger(d))continue;let u=y(i,o.name),p=se(u)??{id:U(a,".json")},f;try{f=k(u)}catch(l){if(l.code==="ENOENT")continue;throw l}e.push({requestId:p.id,ownerId:r,path:u,originalFile:a,claimedAtMs:f.mtimeMs,claimExpiresAtMs:d,byteLength:f.size,...p.operationKey?{operationKey:p.operationKey}:{},...p.clientId?{clientId:p.clientId}:{},...p.enqueuedAtMs===void 0?{}:{enqueuedAtMs:p.enqueuedAtMs},...p.deadlineAtMs===void 0?{}:{deadlineAtMs:p.deadlineAtMs},legacy:p.operationKey===void 0})}}return e.sort((n,r)=>n.claimedAtMs-r.claimedAtMs||n.path.localeCompare(r.path))}function se(t){try{let e=JSON.parse(x(t,"mailbox record"));return typeof e.id!="string"||!e.id?null:{id:e.id,...typeof e.operationKey=="string"?{operationKey:e.operationKey}:{},...typeof e.clientId=="string"?{clientId:e.clientId}:{},...typeof e.enqueuedAtMs=="number"?{enqueuedAtMs:e.enqueuedAtMs}:{},...typeof e.deadlineAtMs=="number"?{deadlineAtMs:e.deadlineAtMs}:{}}}catch{return null}}function Ke(t,e,n,r,i){for(let o of j(t)){if(e<=0)break;let s;try{s=k(o)}catch(a){if(a.code==="ENOENT")continue;throw a}n(o,s.mtimeMs)>r||(M(o,{force:!0}),i(),e--)}return e}function j(t){return v(t)?w(t,{withFileTypes:!0}).filter(e=>e.isFile()).map(e=>y(t,e.name)).sort():[]}function et(t){if(!v(t))return[];let e=[];for(let n of w(t,{withFileTypes:!0})){let r=y(t,n.name);n.isFile()?e.push(r):n.isDirectory()&&e.push(...et(r))}return e.sort()}function an(t){if(v(t))for(let e of w(t,{withFileTypes:!0})){if(!e.isDirectory())continue;let n=y(t,e.name);w(n).some(r=>r.endsWith(".claim"))||M(n,{recursive:!0,force:!0})}}function cn(t){try{return k(t).size}catch{return 0}}function tt(t){return Buffer.from(t,"utf8").toString("base64url")}function Ve(t){try{let e=Buffer.from(t,"base64url").toString("utf8");return tt(e)===t?e:null}catch{return null}}import{join as z}from"path";var Qr=1e4,dn="watch.lock",ln="watch-state.json",un="watch-activity.json",pn="watch-refresh-requests";function ei(t){return{lockPath:z(t,dn),statePath:z(t,ln),activityPath:z(t,un),refreshRequestsPath:z(t,pn)}}function ti(t){try{return fn(JSON.parse(x(t,"watch service state")))}catch{return null}}function fn(t){if(!t||typeof t!="object")return null;let e=t;if(e.version!==1||typeof e.protocolVersion!="number"||typeof e.pid!="number"||!Number.isInteger(e.pid)||e.pid<=0||typeof e.projectRoot!="string"||e.worktreeId!==void 0&&(typeof e.worktreeId!="string"||e.worktreeId.length===0)||typeof e.cliVersion!="string"||!g(e.startedAt)||!g(e.heartbeatAt)||!g(e.lastActivityAt)||!mn(e.watcher)||e.idleDeadlineAt!==void 0&&!g(e.idleDeadlineAt))return null;if(e.processIdentity!==void 0){let n=N(e.processIdentity);if(!n||n.pid!==e.pid)return null;e.processIdentity=n}return e.indexGeneration!==void 0&&!/^[a-f0-9]{64}$/.test(e.indexGeneration)||e.lastError!==void 0&&!yn(e.lastError)||e.lastRefresh!==void 0&&!gn(e.lastRefresh)||e.reindexActivity!==void 0&&!bn(e.reindexActivity)||e.refreshRequests!==void 0&&!Sn(e.refreshRequests)||e.typescriptSemantic!==void 0&&!xn(e.typescriptSemantic)||e.typescriptIndex!==void 0&&!Mn(e.typescriptIndex)?null:e}function g(t){return de(t)}function mn(t){if(!t||typeof t!="object"||!("state"in t))return!1;let e=t;switch(e.state){case"idle":return!0;case"waiting":return b(e.changedFiles)&&b(e.reindexAt);case"indexing":return b(e.startedAt);case"cooldown":return b(e.until)&&typeof e.dirty=="boolean";case"budget-paused":return b(e.until)&&typeof e.dirty=="boolean"&&typeof e.reason=="string"&&c(e.rebuilt)&&c(e.estimatedWriteBytes);case"draining":return b(e.startedAt)&&typeof e.reason=="string";default:return!1}}function yn(t){if(!t||typeof t!="object")return!1;let e=t;return g(e.at)&&typeof e.message=="string"}function gn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.trigger?.kind=="string"&&typeof e.result=="string"&&g(e.startedAt)&&g(e.completedAt)&&b(e.durationMs)}function bn(t){if(!t||typeof t!="object")return!1;let e=t;return e.confidence!==void 0&&e.confidence!=="complete"&&e.confidence!=="partial"&&e.confidence!=="unavailable"||e.recordsRead!==void 0&&!c(e.recordsRead)||e.invalidRecords!==void 0&&!c(e.invalidRecords)||e.skippedRecords!==void 0&&!c(e.skippedRecords)||e.readErrors!==void 0&&!c(e.readErrors)||e.ignoredPartialTailBytes!==void 0&&!c(e.ignoredPartialTailBytes)||!g(e.windowStartedAt)||!g(e.windowEndedAt)||!c(e.runs)||!c(e.rebuilt)||e.fullRebuilds!==void 0&&!c(e.fullRebuilds)||!c(e.reused)||!c(e.failed)||!c(e.suppressed)||!b(e.estimatedLogicalOutputBytes)||e.estimatedWriteBytes!==void 0&&!c(e.estimatedWriteBytes)||e.reflinkedBytes!==void 0&&!c(e.reflinkedBytes)||e.fallbackCopiedBytes!==void 0&&!c(e.fallbackCopiedBytes)||e.oldestRebuildAt!==void 0&&!g(e.oldestRebuildAt)||e.oldestWriteAt!==void 0&&!g(e.oldestWriteAt)||e.languageAttribution!==void 0&&e.languageAttribution!=="complete"&&e.languageAttribution!=="partial"&&e.languageAttribution!=="unavailable"||e.attributedRuns!==void 0&&!c(e.attributedRuns)||e.unattributedRuns!==void 0&&!c(e.unattributedRuns)||e.invalidLanguageDetails!==void 0&&!c(e.invalidLanguageDetails)||e.estimatedLogicalOutputBytes<0||!e.byTrigger||typeof e.byTrigger!="object"||Array.isArray(e.byTrigger)||e.byLanguage!==void 0&&!hn(e.byLanguage)?!1:Object.values(e.byTrigger).every(n=>n===void 0||c(n))}function hn(t){if(!t||typeof t!="object"||Array.isArray(t))return!1;for(let[e,n]of Object.entries(t)){if(!ue.includes(e)||!n||typeof n!="object")return!1;let r=n;if(!c(r.runs)||!c(r.rebuilt)||!c(r.reused)||!c(r.producedOutputBytes)||!le(r.durationMs)||r.rebuilt+r.reused!==r.runs)return!1}return!0}function Sn(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.claimed)&&c(e.completed)&&c(e.expired)&&c(e.invalid)&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function xn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&b(e.requests)&&b(e.sessionsCreated)&&b(e.sessionsReused)&&b(e.sessionsRefreshed)&&b(e.sessionsReplaced)&&b(e.projectsCreated)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||nt(e.mailbox))}function Mn(t){if(!t||typeof t!="object")return!1;let e=t;return typeof e.protocolVersion=="number"&&(e.state==="idle"||e.state==="ready"||e.state==="unavailable"||e.state==="error")&&c(e.requests)&&c(e.sessionsCreated)&&c(e.sessionsReplaced)&&(e.sessionsEvicted===void 0||c(e.sessionsEvicted))&&(e.activeSessions===void 0||c(e.activeSessions))&&(e.maxActiveSessions===void 0||c(e.maxActiveSessions))&&(e.heapUsedBytes===void 0||c(e.heapUsedBytes))&&(e.heapLimitBytes===void 0||c(e.heapLimitBytes))&&(e.softMemoryLimitBytes===void 0||c(e.softMemoryLimitBytes))&&(e.retireRequested===void 0||typeof e.retireRequested=="boolean")&&c(e.initializations)&&c(e.programUpdates)&&c(e.documentsEmitted)&&c(e.documentsRemoved)&&(e.lastRequestAt===void 0||g(e.lastRequestAt))&&(e.lastDurationMs===void 0||b(e.lastDurationMs)&&e.lastDurationMs>=0)&&(e.lastError===void 0||typeof e.lastError=="string")&&(e.busyUntil===void 0||g(e.busyUntil))&&(e.mailbox===void 0||nt(e.mailbox))}function nt(t){if(!t||typeof t!="object")return!1;let e=t;return c(e.pending)&&c(e.inflight)&&c(e.responses)&&c(e.deadLetters)&&c(e.invalid)&&c(e.totalItems)&&b(e.totalBytes)&&e.totalBytes>=0&&e.totalItems===e.pending+e.inflight+e.responses+e.deadLetters&&(e.oldestPendingAt===void 0||g(e.oldestPendingAt))}function b(t){return typeof t=="number"&&Number.isFinite(t)}export{jn as a,dt as b,ee as c,kn as d,pt as e,ft as f,Nn as g,Ln as h,Cn as i,Je as j,Kt as k,Jr as l,Ur as m,Ze as n,zr as o,Qr as p,ei as q,ti as r,bt as s,O as t,Tt as u,Gn as v,Xn as w,Yn as x,Zn as y,Qn as z,lr as A,H as B,Fr as C,wr as D,vr as E,Pr as F};
|
|
4
|
-
//# sourceMappingURL=chunk-J6GLBBRK.js.map
|
package/dist/chunk-J7A4PWFX.js
DELETED
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{a as f}from"./chunk-2USA3S3P.js";import{a as d,c as m}from"./chunk-BL6DCHQP.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-J7A4PWFX.js.map
|
package/dist/chunk-JCSAZ35V.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{b as T}from"./chunk-L7KTFEAV.js";import{b,d as I,i as U,j as L,k as J}from"./chunk-FVFDOIM3.js";import{a as G,b as z,d as O}from"./chunk-2VAHDDLM.js";import{a as W}from"./chunk-YXPUP5G2.js";import{b as E}from"./chunk-ATXPTSEI.js";import{d as _}from"./chunk-CKBUBRYD.js";import{b as B,d as N}from"./chunk-IW5XQG5G.js";import{e as M,f as A}from"./chunk-HGFDYOVB.js";import{a as H,c as C}from"./chunk-7HXT6YLU.js";function v(e){let t=P(e.projectFiles),r=new Set(t),s=new Map(e.snapshot.files.map(a=>[a.path,a])),c=e.snapshot.files.filter(a=>{let o=H(a.path,["typescript"]);return o==="config"||o==="ambient"}).map(a=>a.path),i=P([...t,...c]),n=i.find(a=>!s.has(a)),p=new Set(e.snapshot.files.map(a=>a.path)).size!==e.snapshot.files.length,d=!n&&i.some(a=>V(s.get(a))),l=E(JSON.stringify({pnpmWorkspaces:e.snapshot.pnpmWorkspaces,typescriptProjectMode:e.snapshot.typescriptProjectMode,typescriptProjects:P(e.snapshot.typescriptProjects),membership:t})),y,f;return{identityFor(a,o){if(!r.has(a))return g("target-outside-project");if(p)return g("duplicate-input-path");if(n)return g("missing-input-fingerprint");if(d)return g("unreadable-input");let m=[],u,w;if(e.graph===null)m.push("dependency-graph-unavailable"),w="whole-project",u=i;else{let h=a===y&&f?f:Z(a,e.graph);if(y=a,f=h,h.find(k=>!s.has(k)))return g("missing-input-fingerprint");if(u=P([...h,...c]),u.some(k=>V(s.get(k))))return g("unreadable-input");w="dependency-closure"}let X=u.map(h=>Q(s.get(h)));return{version:1,key:E(JSON.stringify({version:1,engineIdentity:e.engineIdentity,schemaVersion:o,projectIdentity:l,inputs:X})),mode:w,inputFiles:u,reasons:m}}}}function Z(e,t){let r=new Set,s=[e];for(let c=0;c<s.length;c+=1){let i=s[c];if(!(i===void 0||r.has(i))){r.add(i);for(let n of[...t.get(i)??[]].sort())r.has(n)||s.push(n)}}return[...r].sort()}function Q(e){return e.semanticHash===void 0?{path:e.path,size:e.size,hash:e.hash}:{path:e.path,semanticHash:e.semanticHash}}function V(e){return e.size<0||e.hash==="unreadable"}function g(e){return{version:1,key:null,mode:"unkeyed",inputFiles:[],reasons:[e]}}function P(e){return[...new Set(e)].sort()}var ee=N("typescript-semantic-identity-context",{clearGroups:["whole-project"]});function x(e,t,r){let s=ee.get(e,()=>te(e));if(!s)return null;let c=`${r}\0${t}`,i=s.identities.get(c);if(i)return i;let n=s.builder.identityFor(t,r);return s.identities.set(c,n),n}function S(e){return W(e,{includeIgnored:!1}).filter(b).sort()}function te(e){try{if(!e.generation.metadataRaw)return null;let t=_(e.generation.metadataRaw);if(t.kind!=="legacy"&&t.kind!=="supported"||!t.capabilities.usableForEvidenceCache)return null;let r=C(t.metadata.fingerprint);return r?{builder:v({projectFiles:S(e),snapshot:r,graph:T(e),engineIdentity:I()}),identities:new Map}:null}catch{return null}}import{getHeapStatistics as ne}from"v8";var j="typescript-reference-fragment-v2",Y=128,R=z({kind:"typescript-reference-fragments",invalidation:O("typescript-reference-fragments"),serialize:e=>JSON.stringify(e),deserialize:ce});function Ce(e,t,r,s=e,c,i=new Set(r.keys())){let n=S(e),p=v({projectFiles:n,snapshot:t,graph:c??T(e),engineIdentity:I()}),d=[],l=0;for(let[f,a]of r){let o=p.identityFor(f,j).key;if(!o){l+=1;continue}d.push({relativePath:f,contentHash:o,value:[...a]})}let y=n.filter(f=>!i.has(f)&&!r.has(f)).length;return R.writeBatch(s,d),{affectedFiles:d.length,carriedFiles:y,skippedAffectedFiles:l}}function _e(e,t,r,s){let c=t.filter(n=>b(n.relativePath));if(c.length===0)return F("no TypeScript definitions");let i=F("shadow did not run");return M("typescript.reference-fragments.shadow",()=>{try{let n=s(c[0].relativePath);if(!n.availability().available||!n.referenceFragmentsForFiles)return i=F("TypeScript reference fragment provider is unavailable"),i;let p=S(e),d=new Set(p),l=new Map;for(let o of D(p)){let m=n.referenceFragmentsForFiles(o);if(o.some(u=>!m.has(u)))return i=F("TypeScript reference fragment provider returned an incomplete batch"),i;for(let u of o)l.set(u,m.get(u)??[])}let y=U(c,l),f=J(c,re(r,d),y);if(!f.passed)return i={state:"failing",files:p.length,keyedFiles:0,writtenFiles:0,...f},i;let a=[];for(let o of p){let m=x(e,o,j);m?.key&&a.push({relativePath:o,contentHash:m.key,value:l.get(o)??[]})}return R.writeBatch(e,a),i={state:"passing",files:p.length,keyedFiles:a.length,writtenFiles:a.length,...f},i}catch(n){return i=F(n instanceof Error?n.message:String(n)),i}},()=>({...i}))}function re(e,t){return new Map([...e].map(([r,s])=>[r,s.filter(c=>t.has(c.file))]))}function Ae(e,t,r){if(t.length===0)return{references:new Map,files:0,cacheHits:0,cacheMisses:0,computedFiles:0};let s="fallback",c=0,i=0,n=0,p=0;return M("typescript.reference-fragments.materialize",()=>{try{let d=S(e);c=d.length;let l=L(t),y=[];for(let a of d){let o=x(e,a,j);if(!o?.key)return null;let m=R.read(e,a,o.key);m===null?(n+=1,y.push({file:a,contentHash:o.key})):(i+=1,l.add(m))}return n===0?(s="hit",{references:l.finish(),files:c,cacheHits:i,cacheMisses:n,computedFiles:p}):ae(e,y,r,a=>{for(let{fragments:o}of a)l.add(o);p+=a.length})?(s="computed",{references:l.finish(),files:c,cacheHits:i,cacheMisses:n,computedFiles:p}):null}catch{return null}},()=>({state:s,files:c,cacheHits:i,cacheMisses:n,computedFiles:p}))}function D(e){let t=[];for(let r=0;r<e.length;r+=Y)t.push(e.slice(r,r+Y));return t}var ie=.75;function q(e){return{heapUsedFraction:()=>{let t=ne();return t.heap_size_limit>0?t.used_heap_size/t.heap_size_limit:0},collect:G,release:()=>B(e,{groups:["semantic-provider"]})}}function $(e,t=ie){return e.heapUsedFraction()<t||e.collect()&&e.heapUsedFraction()<t?!1:(e.release(),!0)}function ae(e,t,r,s,c=q(e)){for(let i of D(t)){let n=K(e,i,r);if(!n)return!1;s(n),$(c)}return!0}function K(e,t,r){let s=t.map(({file:n})=>n),c=r(s[0]);if(!c.availability().available||!c.referenceFragmentsForFiles)return null;let i=c.referenceFragmentsForFiles(s);return s.some(n=>!i.has(n))?null:(R.writeBatch(e,t.map(({file:n,contentHash:p})=>({relativePath:n,contentHash:p,value:i.get(n)??[]}))),s.map(n=>({file:n,fragments:i.get(n)??[]})))}var se=()=>new Promise(e=>setImmediate(e));async function Be(e,t,r={}){let s=r.yieldToEventLoop??se,c=r.probe??q(e),i="fallback",n=0,p=0,d=0,l=0;return A("typescript.reference-fragments.warm",async()=>{try{let y=S(e),f=r.files?new Set(r.files):null,a=f?y.filter(m=>f.has(m)):y;n=a.length;let o=[];for(let m of a){let u=x(e,m,j);if(!u?.key)return null;R.has(e,m,u.key)?p+=1:(d+=1,o.push({file:m,contentHash:u.key}))}if(o.length===0)return i="hit",{files:n,cacheHits:p,cacheMisses:d,computedFiles:l};for(let m of D(o)){let u=K(e,m,t);if(!u)return null;l+=u.length,$(c),r.onBatch?.({computedFiles:l,missingFiles:o.length}),await s()}return i="computed",{files:n,cacheHits:p,cacheMisses:d,computedFiles:l}}catch{return null}},()=>({state:i,files:n,cacheHits:p,cacheMisses:d,computedFiles:l}))}function F(e){return{state:"unavailable",files:0,keyedFiles:0,writtenFiles:0,expectedCount:0,actualCount:0,missing:[],extra:[],reason:e}}function ce(e){try{let t=JSON.parse(e);return!Array.isArray(t)||!t.every(oe)?null:t}catch{return null}}function oe(e){if(!e||typeof e!="object")return!1;let t=e,r=t.location;return typeof t.targetSymbol=="string"&&!!r&&typeof r.file=="string"&&typeof r.line=="number"&&typeof r.column=="number"}export{x as a,Ce as b,_e as c,Ae as d,Be as e};
|
|
2
|
-
//# sourceMappingURL=chunk-JCSAZ35V.js.map
|
package/dist/chunk-JDU2IV3A.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{a as m}from"./chunk-7KCZELVM.js";import{e as b,f as S}from"./chunk-AADQLOQ4.js";import{a}from"./chunk-WDSFQDPN.js";import{p as y}from"./chunk-FI7VGOR4.js";import{a as f}from"./chunk-2USA3S3P.js";import{c as r}from"./chunk-BL6DCHQP.js";function u(o,l,t={}){let i=f(o,l);if(!i)return null;let g=[{file:i.relativePath,line:i.startLine}],s=y(o,i,{semantic:t.semantic,semanticEvidence:a}).map(e=>({file:e.file,line:e.line,enclosingSymbol:e.enclosingSymbol??"(top-level)",enclosingShort:e.enclosingSymbol?r(e.enclosingSymbol):"(top-level)"})),{outgoingCalls:c,incomingCalls:n}=h(o,i,s,{semantic:t.semantic!==!1});return{symbol:i.symbol,shortName:r(i.symbol),relativePath:i.relativePath,definitionSites:g.filter(e=>!o.isIgnored(e.file)),referenceSites:s,outgoingCalls:c.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:r(e.symbol),file:e.file})),incomingCalls:n.filter(e=>!o.isIgnored(e.file)).map(e=>({symbol:e.symbol,shortName:e.symbol===e.file?"(top-level)":r(e.symbol),file:e.file}))}}function A(o,l,t={}){let i=u(o,l,t);return i?{symbol:i.symbol,shortName:i.shortName,relativePath:i.relativePath,definitionSites:i.definitionSites,usageSites:i.referenceSites,producers:i.outgoingCalls,consumers:i.incomingCalls}:null}function h(o,l,t,i){let g=m(b(o,l,{limit:30,semantic:i.semantic,semanticEvidence:a}).map(n=>({symbol:n.symbol,file:n.file}))),s=m(S(o,l,{limit:30,semantic:i.semantic,semanticEvidence:a})),c=s.length>0?s:m(t.map(n=>({symbol:n.enclosingSymbol==="(top-level)"?n.file:n.enclosingSymbol,file:n.file})));return{outgoingCalls:g,incomingCalls:c}}export{u as a,A as b};
|
|
2
|
-
//# sourceMappingURL=chunk-JDU2IV3A.js.map
|
package/dist/chunk-JFMEXGFE.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{j as i}from"./chunk-7F45LJKI.js";var c=new Set(["aix","android","darwin","freebsd","haiku","linux","openbsd","sunos","win32","cygwin","netbsd"]);function d(n){if(!n||typeof n!="object"||Array.isArray(n))return null;let t=n;return t.version!==1||typeof t.pid!="number"||!Number.isSafeInteger(t.pid)||t.pid<=0||typeof t.platform!="string"||!c.has(t.platform)||typeof t.startToken!="string"||t.startToken.trim()===""?null:{version:1,pid:t.pid,platform:t.platform,startToken:t.startToken}}function p(n,t){return n.version===t.version&&n.pid===t.pid&&n.platform===t.platform&&n.startToken===t.startToken}import{execFileSync as y}from"child_process";import{platform as P}from"os";var I=1e3,a=16*1024,s;function N(n,t=u){if(!Number.isSafeInteger(n)||n<=0)return null;let e=n===process.pid&&t===u;if(e&&s)return{...s};try{let r=b(n,t);if(!r)return null;let o={version:1,pid:n,platform:t.platform,startToken:r};return e&&(s=o),{...o}}catch{return null}}function b(n,t){if(t.platform==="linux"||t.platform==="android")return T(t.readFile(`/proc/${n}/stat`));if(t.platform==="win32"){let e=`([DateTimeOffset](Get-Process -Id ${n} -ErrorAction Stop).StartTime).ToUnixTimeMilliseconds()`;return m(t.run("powershell.exe",["-NoProfile","-NonInteractive","-Command",e]))}return t.platform==="darwin"||t.platform==="freebsd"||t.platform==="openbsd"||t.platform==="netbsd"?m(t.run("ps",["-p",String(n),"-o","lstart="])):null}function T(n){let t=n.lastIndexOf(")");if(t<0)return null;let r=n.slice(t+1).trim().split(/\s+/)[19];return r&&/^\d+$/.test(r)?r:null}function m(n){let t=n.trim();return t===""?null:t}var u={platform:P(),readFile(n){return i(n,{maxBytes:a,inputKind:"process identity pseudo-file"})},run(n,t){return y(n,[...t],{encoding:"utf8",timeout:I,maxBuffer:a,env:{...process.env,LC_ALL:"C",LANG:"C"},stdio:["ignore","pipe","ignore"]})}};function h(){return performance.now()}function _(n,t,e,r,o,l){if(n>0)return e;let f=Math.max(0,Math.min(l,t-1));return Math.min(o,r*2**f)}export{d as a,p as b,N as c,h as d,_ as e};
|
|
2
|
-
//# sourceMappingURL=chunk-JFMEXGFE.js.map
|
package/dist/chunk-JFMI5SGB.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{a as L}from"./chunk-BGBBVSH4.js";import{h as De}from"./chunk-AADQLOQ4.js";import{a as _}from"./chunk-WDSFQDPN.js";import{b as y}from"./chunk-NJGKXKQF.js";import{b as be,d as ye,e as he,f as Re,g as xe,h as ke,i as X,j as Pe,m as q}from"./chunk-FI7VGOR4.js";import{a as Se}from"./chunk-WRQXLNYE.js";import{b as I}from"./chunk-L7KTFEAV.js";import{c as ce}from"./chunk-BJT7LSPK.js";import{G as ae,H as E,J as le,N as fe,T,U as me,V as pe,W as ge,X as B,i as ie,l as oe,m as C,p as k,q as se}from"./chunk-2VAHDDLM.js";import{a as b}from"./chunk-YXPUP5G2.js";import{d as D,f as G,g as K,i as ue,j as de}from"./chunk-BL6DCHQP.js";import{a as Ee}from"./chunk-DHEQMPLW.js";import{d}from"./chunk-IW5XQG5G.js";import{e as ne}from"./chunk-HGFDYOVB.js";import{$ as x,aa as P,ba as re,o as g}from"./chunk-7HXT6YLU.js";import{existsSync as j,readdirSync as we}from"fs";import{join as F}from"path";var ot={files:new Set,pathPrefixes:[]};var U=/^(?:dist|build|lib|out|output|esm|cjs|umd)\//,st=/\.(?:d\.ts|d\.mts|d\.cts|ts|tsx|mts|cts|js|jsx|mjs|cjs)$/,Fe=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],at=new Set([".git",".next",".turbo","build","coverage","dist","node_modules","out"]),ct=4,lt=d("package-surface",{clearGroups:["whole-project"]}),Nn=d("package-operational-surface",{clearGroups:["whole-project"]});function Me(t){return lt.get(t,()=>ft(t.config.projectRoot))}function W(t,e){let n=Me(t);return n.files.has(e)?!0:n.pathPrefixes.some(r=>e.startsWith(r))}function ve(t,e){return Me(t).files.has(e)}function ft(t){let e=new Set,n=[];for(let{manifest:r,packageRoot:i}of ut(t))for(let o of dt(r))mt(t,i,o,e,n);return e.size===0&&n.length===0?ot:{files:e,pathPrefixes:n}}function ut(t){let e=[],n=Ie(t,"");return n&&e.push({manifest:n,packageRoot:""}),Ce(t,"",e,0),e}function Ce(t,e,n,r){if(r>=ct)return;let i=F(t,e);if(j(i))for(let o of we(i,{withFileTypes:!0})){if(!o.isDirectory()||at.has(o.name))continue;let s=e?`${e}/${o.name}`:o.name,a=Ie(t,s);a&&n.push({manifest:a,packageRoot:s}),Ce(t,s,n,r+1)}}function Ie(t,e){let n;try{n=x(t,F(e,"package.json"),{maxBytes:8*1024*1024,inputKind:"package manifest"})}catch(r){if(!P(r))throw r;return null}try{let r=JSON.parse(n);return r&&typeof r=="object"?r:null}catch{return null}}function dt(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 Le(t.exports,e),e}function Le(t,e){if(typeof t=="string"){e.push(t);return}if(!(!t||typeof t!="object"))for(let n of Object.values(t))Le(n,e)}function mt(t,e,n,r,i){let o=n.replace(/\\/g,"/").replace(/^\.\//,"");if(o===""||o.startsWith(".."))return;let s=o.indexOf("*");if(s>=0){let c=o.slice(0,s);for(let f of Te(c))f!==""&&i.push(h(e,f));return}let a=o.replace(st,"");for(let c of Te(a)){c===a&&c===o&&r.add(h(e,o));for(let f of Fe)pt(t,r,e,c+f)}r.add(h(e,o))}function Te(t){let e=[t];return U.test(t)&&(e.push(t.replace(U,"src/")),e.push(t.replace(U,""))),e}function pt(t,e,n,r){let i=h(n,r);if(e.add(i),!r.startsWith("src/")||j(F(t,i)))return;let o=Fe.find(l=>r.endsWith(l));if(!o)return;let s=r.slice(0,-o.length);gt(t,e,n,s,o);let a=s.lastIndexOf("/");if(a<=4)return;let c=s.slice(0,a),f=s.slice(a+1);for(let l of _e(t,n,c,`${f}${o}`))e.add(l)}function gt(t,e,n,r,i){let o=h(n,`${r}/index${i}`);j(F(t,o))&&e.add(o)}function _e(t,e,n,r){let i=F(t,e,n);if(!j(i))return[];let o=[];for(let s of we(i,{withFileTypes:!0})){let a=`${n}/${s.name}`;s.isDirectory()?o.push(..._e(t,e,a,r)):s.isFile()&&s.name===r&&o.push(h(e,a))}return o}function h(t,e){return t?`${t}/${e}`:e}import{existsSync as H,readdirSync as St}from"fs";import{dirname as bt,join as Y}from"path";var yt={rootFiles:new Set,sourcePrefixes:[]},ht=new Set([".git",".scipquery","node_modules","target"]),Rt=6,xt=d("rust-library-surface",{clearGroups:["whole-project"]});function je(t,e,n){if(!n.endsWith(".rs")||!Et(kt(t),n))return!1;let r=T(t,n).find(i=>i.symbol===e);return r?Dt(oe(t,n)[r.startLine]??""):!1}function kt(t){return xt.get(t,()=>Pt(t.config.projectRoot))}function Pt(t){let e=new Set,n=new Set;for(let r of Tt(t)){let i=x(t,Y(r,"Cargo.toml"),{maxBytes:8388608,inputKind:"Cargo manifest"}),o=wt(i),s=h(r,"src/lib.rs"),a=o?h(r,o):!Ft(i)&&re(t,s)?s:null;if(!a)continue;e.add(a);let c=bt(a).replaceAll("\\","/");n.add(c==="."?"":`${c}/`)}return e.size===0?yt:{rootFiles:e,sourcePrefixes:[...n].sort()}}function Et(t,e){return e.endsWith(".rs")?t.rootFiles.has(e)?!0:Mt(e)?!1:t.sourcePrefixes.some(n=>e.startsWith(n)):!1}function Dt(t){return/^\s*pub\s+(?!\()/.test(t)}function Tt(t){if(!H(t))return[];let e=[];return Ae(t,"",e,0),e}function Ae(t,e,n,r){let i=Y(t,e);if(H(i)&&(H(Y(i,"Cargo.toml"))&&n.push(e),!(r>=Rt)))for(let o of St(i,{withFileTypes:!0})){if(!o.isDirectory()||ht.has(o.name))continue;let s=e?`${e}/${o.name}`:o.name;Ae(t,s,n,r+1)}}function wt(t){let e=!1;for(let n of t.split(`
|
|
2
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(r);if(i){e=i[1]==="lib";continue}if(!e)continue;let o=/^path\s*=\s*["']([^"']+)["']/.exec(r)?.[1];if(o)return o.replaceAll("\\","/").replace(/^\.\//,"")}return null}function Ft(t){let e=!1;for(let n of t.split(`
|
|
3
|
-
`)){let r=n.replace(/\s+#.*$/,"").trim(),i=/^\[([^\]]+)\]$/.exec(r);if(i){e=i[1]==="package";continue}if(e&&/^autolib\s*=\s*false\b/.test(r))return!0}return!1}function Mt(t){return/(?:^|\/)src\/main\.rs$/.test(t)||/(?:^|\/)src\/bin\//.test(t)||/(?:^|\/)(?:examples|tests|benches)\//.test(t)}import{existsSync as vt,readdirSync as Ct}from"fs";import{join as It}from"path";var Lt=/^(?:[\w.-]+\.config\.[cm]?[jt]s|package\.json)$/,_t=/(?:\.{1,2}\/)?[\w@./-]+\.(?:[cm]?[jt]sx?)\b/g,jt=d("config-referenced-files",{clearGroups:["whole-project"]});function At(t){return jt.get(t,()=>Nt(t))}function Ne(t,e){return At(t).has(g(e))}function Nt(t){let e=new Set,n=t.config.projectRoot,r;try{r=Ct(n)}catch{return e}let i=r.filter(s=>Lt.test(s)&&vt(It(n,s)));if(i.length===0)return e;let o=new Set(b(t,{includeIgnored:!1}).map(s=>g(s)));for(let s of i){let a;try{a=x(n,s,{inputKind:"root configuration file"})}catch(c){if(P(c))continue;continue}for(let c of a.matchAll(_t)){let f=g(c[0]).replace(/^\.\//,"");f.startsWith("..")||f.startsWith("/")||o.has(f)&&e.add(f)}}return e}import{existsSync as Z,readdirSync as Ot}from"fs";import{join as A}from"path";var $t=["trigger.config.ts","trigger.config.mts","trigger.config.js","trigger.config.mjs"],Vt=["./src/trigger","./trigger"],Gt=/\bdirs\s*:\s*\[([^\]]*)\]/,Kt=/["'`]([^"'`]+)["'`]/g,Bt=["","apps","packages","services"],Xt=d("framework-task-surface",{clearGroups:["whole-project"]});function qt(t){return Xt.get(t,()=>Ut(t))}function Oe(t,e){let n=g(e);return qt(t).directories.some(r=>n===r.directory||n.startsWith(`${r.directory}/`))}function Ut(t){let e=new Map;for(let n of Wt(t.config.projectRoot))for(let r of Ht(t,n))e.has(r)||e.set(r,{directory:r,framework:"trigger.dev",config:n});return{directories:[...e.values()].sort((n,r)=>n.directory.localeCompare(r.directory))}}function Wt(t){let e=[],n=r=>{for(let i of $t){let o=r?`${r}/${i}`:i;Z(A(t,o))&&e.push(o)}};n("");for(let r of Bt.slice(1)){let i=A(t,r);if(!Z(i))continue;let o;try{o=Ot(i)}catch{continue}for(let s of o)n(`${r}/${s}`)}return e}function Ht(t,e){let n;try{n=x(t.config.projectRoot,e,{inputKind:"framework task config"})}catch(a){return P(a)?[]:[]}let r=e.includes("/")?e.slice(0,e.lastIndexOf("/")):"",i=Gt.exec(n)?.[1],o=i?[...i.matchAll(Kt)].map(a=>a[1]):Vt,s=[];for(let a of o){let c=g(A(r,a)).replace(/\/+$/,"");c===""||c.startsWith("..")||Z(A(t.config.projectRoot,c))&&s.push(c)}return s}function Yt(t){return Zt.get(t,()=>{let n=b(t,{includeIgnored:!1}).filter(s=>{let a=y(s);return a==="entry"||a==="worker"});if(n.length===0)return new Set;let r=I(t),i=new Set,o=new Set;for(;n.length>0;){let s=n.shift();if(!i.has(s)){i.add(s),y(s)==="barrel"&&o.add(s);for(let a of r.get(s)??[])i.has(a)||n.push(a)}}return o})}var Zt=d("live-barrels",{clearGroups:["whole-project"]});function zt(t,e){return Yt(t).has(g(e))}function Ve(t,e){let n=g(e),r=y(e);return r==="entry"||r==="worker"||Sn(n)||Oe(t,n)||Ne(t,n)||zt(t,n)}function Jt(t,e,n){let r=g(n),i=[];W(t,r)&&i.push("package-surface-file"),tn(t,e,r)&&i.push("transitive-package-surface"),je(t,e,r)&&i.push("rust-public-library"),gn(e,r)&&i.push("framework-entrypoint");let o=t.config.entryRoots;return o&&(o.files?.some(s=>g(s)===r)&&i.push("configured-file"),o.pathPrefixes?.some(s=>r.startsWith(g(s)))&&i.push("configured-path-prefix"),o.qualifiedVars?.some(s=>yn(e,s))&&i.push("configured-qualified-var"),o.symbolPatterns?.some(s=>{try{return Ee(s,"entryRoots.symbolPatterns entry").test(e)}catch{return!1}})&&i.push("configured-symbol-pattern")),i}function Ge(t,e,n){return Jt(t,e,n).length>0}var Qt=d("package-surface-reachability",{clearGroups:["whole-project"]}),en=d("explicit-package-surface-reachability",{clearGroups:["whole-project"]});function tn(t,e,n){let r=nn(t).get(n);return r===void 0?!1:r===null||r.has(D(e))}function hr(t,e,n){let r=rn(t).get(n);return r===void 0?!1:r===null||r.has(D(e))}function nn(t){return Qt.get(t,()=>Ke(t,e=>W(t,e)))}function rn(t){return en.get(t,()=>Ke(t,e=>ve(t,e)))}function Ke(t,e){let n=new Map,r=[];for(let i of b(t,{includeIgnored:!1}))e(i)&&(n.set(i,null),r.push(i));for(;r.length>0;){let i=r.shift(),o=n.get(i);if(o!==void 0)for(let s of le(t,i)){if(!s.sourcePath||t.isIgnored(s.sourcePath))continue;let a=on(o,s);a!==void 0&&sn(n,s.sourcePath,a)&&r.push(s.sourcePath)}}return n}function on(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 sn(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 i=!1;for(let o of n)r.has(o)||(r.add(o),i=!0);return i}var Be=new Set(["GET","POST","PUT","PATCH","DELETE","HEAD","OPTIONS"]),an=new Set(["default","generateMetadata","generateStaticParams"]),cn=new Set(["default","getStaticProps","getServerSideProps","getStaticPaths","config"]),ln=new Set(["default","middleware","config"]),fn=new Set(["register","onRequestError"]),un=new Set(["onRouterTransitionStart"]),dn=new Set(["default","loader","action","clientLoader","clientAction","headers","links","meta","shouldRevalidate","ErrorBoundary","HydrateFallback"]),mn=new Set(["load","actions","entries",...Be]),pn=new Set(["default"]);function gn(t,e){let n=D(t);return n===""?!1:Xe(e)?Be.has(n):qe(e)?an.has(n):Ue(e)?cn.has(n):We(e)?ln.has(n):He(e)?fn.has(n):Ye(e)?un.has(n):Ze(e)?dn.has(n):ze(e)?mn.has(n):bn(e)?pn.has(n):!1}function Sn(t){return Xe(t)||qe(t)||Ue(t)||We(t)||He(t)||Ye(t)||Ze(t)||ze(t)}function Xe(t){return/(?:^|\/)app(?:\/[^/]+)*\/route\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function qe(t){return/(?:^|\/)app(?:\/[^/]+)*\/(?:page|layout|template|loading|error|not-found|global-error|head|default)\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function Ue(t){return/(?:^|\/)pages\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function We(t){return z(t,"(?:middleware|proxy)\\.(?:ts|js|mts|mjs)")}function He(t){return z(t,"instrumentation\\.(?:ts|js|mts|mjs)")}function Ye(t){return z(t,"instrumentation-client\\.(?:ts|js|mts|mjs)")}function z(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 Ze(t){return/(?:^|\/)app\/routes\/.+\.(?:ts|tsx|js|jsx|mjs|cjs)$/.test(t)}function ze(t){return/(?:^|\/)src\/routes\/(?:.*\/)?\+(?:page|page\.server|layout|layout\.server|server)\.(?:ts|js)$/.test(t)}function bn(t){return/(?:^|\/)src\/(?:pages|views|routes)\/.+\.(?:ts|tsx|js|jsx|vue)$/.test(t)}function yn(t,e){let n=e.lastIndexOf("/");if(n<0)return!1;let r=e.slice(0,n),i=e.slice(n+1);return t.includes($e(r)+"/")&&t.includes($e(i)+".")}function $e(t){return/^[A-Za-z0-9_$+-]+$/.test(t)?t:"`"+t.replace(/`/g,"``")+"`"}function J(t,e,n={}){let r=new Map;if(e&&e.length===0)return r;let i=b(t,{includeIgnored:!1}),o=Re(t),s=e??me(t),a=new Set(s.map(f=>f.symbolId)),c=Dn(s);return hn(t,r,i,o,a,c),Rn(t,r,s,a),En(t,r,i,o,a,c),n.semantic!==!1&&n.semanticEvidence&&wn(r,n.semanticEvidence.callerMap(t,Tn(s))),r}function hn(t,e,n,r,i,o){for(let s of n){if(!k(s))continue;let a=ae(t,s);if(a)for(let c of a){if(o&&!o.has(c.calleeLeaf))continue;let f=ye(s,r.get(c.calleeLeaf)??[]);if(!f||f.length===0)continue;let l=he(t,s,f,c.memberAccess,c.calleeQualifier);l&&i.has(l.symbolId)&&l.file!==s&&Q(e,l.symbolId,s)}}}function Rn(t,e,n,r){let i=kn(n);for(let o of xn(t,r))t.isIgnored(o.relative_path)||Pn(o,i.get(o.symbol_id))||Q(e,o.symbol_id,o.relative_path)}function xn(t,e){return Se(t,e?[...e]:void 0)}function kn(t){let e=new Map;for(let n of t)e.set(n.symbolId,{docId:n.documentId,startLine:n.startLine,endLine:n.endLine});return e}function Pn(t,e){return!!e&&e.docId===t.document_id&&t.chunk_start>=e.startLine&&t.chunk_end<=e.endLine}function En(t,e,n,r,i,o){for(let s of n){if(k(s)!=="rust")continue;let a=E(t,s,{includeRustAttributeNames:!0});if(a.length!==0)for(let{name:c}of a){if(o&&!o.has(c))continue;let f=r.get(c);if(f)for(let l of f)i.has(l.symbolId)&&l.file!==s&&Q(e,l.symbolId,s)}}}function Q(t,e,n){let r=t.get(e);r||(r=new Set,t.set(e,r)),r.add(n)}function Dn(t){let e=new Set;for(let n of t){let r="leaf"in n&&typeof n.leaf=="string"?n.leaf:"symbol"in n&&typeof n.symbol=="string"?D(n.symbol):"";r&&e.add(r)}return e.size>0?e:null}function Tn(t){return t.filter(e=>"relativePath"in e&&"symbol"in e&&"leaf"in e)}function wn(t,e){for(let[n,r]of e){let i=t.get(n);i||(i=new Set,t.set(n,i));for(let o of r)i.add(o)}}var Fn=d("cross-file-caller-files",{clearGroups:["whole-project","source-file"]}),Mn=d("source-fallback-caller-files",{clearGroups:["whole-project","source-file"]});function Je(t,e,n){let r=e.filter(o=>!t.has(o.symbolId));if(r.length>0){let o=n(r);for(let s of r)t.set(s.symbolId,o.get(s.symbolId)??new Set)}let i=new Map;for(let o of e){let s=t.get(o.symbolId);s&&s.size>0&&i.set(o.symbolId,new Set(s))}return i}function ee(t,e,n={}){if(e===void 0)return J(t,e,n);let r=Je(Fn.get(t,()=>new Map),e,i=>J(t,i,{semantic:!1}));return n.semantic===!1||!n.semanticEvidence?r:et(r,n.semanticEvidence.callerMap(t,e.filter(i=>"relativePath"in i&&"symbol"in i&&"leaf"in i)))}function te(t,e,n={}){return n.skipPath?q(t,e,n):Je(Mn.get(t,()=>new Map),e,r=>q(t,r))}function Qe(t,e,n={}){let r=ee(t,e,{semantic:n.semantic,semanticEvidence:n.semanticEvidence});return n.sourceFallback===!1?r:et(r,te(t,e))}function et(t,e){let n=new Map;for(let[r,i]of t)n.set(r,new Set(i));for(let[r,i]of e){let o=n.get(r)??new Set;for(let s of i)o.add(s);n.set(r,o)}return n}function tt(t,e,n){let r=e.identifierResolution==="strict"?X:Pe,i=e.candidateNames?xe(e.candidateNames):null,o=0,s=0,a=0,c=0,f="";for(let l of e.paths)if(o+=1,f=l,!(!k(l)&&!(e.includeVueSfc&&se(l)))&&!t.isIgnored(l)&&!e.skipPath?.(l))try{if(i&&!ke(ie(t,l),i))continue;s+=1;let M=(m,S,$,w)=>{if(e.candidateNames&&!e.candidateNames.has(m))return;a+=1;let v=e.resolveTargets?e.resolveTargets({sourceFile:l,name:m,kind:S,defaultTargets:w}):w();for(let V of v)c+=1,n({sourceFile:l,name:m,target:V,occurrences:$,kind:S})},O=be(t,l);for(let[m,S]of O)M(m,"identifier",S.length,()=>r(t,l,m));for(let m of E(t,l,{includeCrossLanguageDispatchNames:e.includeCrossLanguageDispatchNames,includeRustAttributeNames:e.includeRustAttributeNames})){let S=m.kind==="cross-language-dispatch"?()=>X(t,l,m.name):()=>r(t,l,m.name);M(m.name,m.kind,m.occurrences,S)}}finally{e.afterPath?.(l),o%10===0&&ne("source-reference-scan.progress",()=>{},()=>({scannedPaths:o,currentPath:f,candidateMatchedPaths:s,visitedNames:a,visitedHits:c}))}}function nt(t,e={}){let{scope:n,files:r,minLoc:i=1,maxLoc:o=Number.POSITIVE_INFINITY,excludeSymbol:s,excludeEntrySurfaces:a=!1,excludeTypesFiles:c=!1,excludeRootedSymbols:f=!1,requireFunctionLikeSymbol:l=!1,requireCallableSymbol:N=!1,excludeRustTraitImplMembers:M=!1,includeSuppressed:O=!1,sortByLocDesc:m=!1}=e,S=[],$=vn(t,{scope:n,files:r,requireFunctionLikeSymbol:l,requireCallableSymbol:N}),w=new Map,v=new Map,V=u=>{let p=w.get(u);if(p!==void 0)return p;let R=Ve(t,u);return w.set(u,R),R},it=u=>{let p=v.get(u);if(p!==void 0)return p;let R=y(u);return v.set(u,R),R};for(let u of $){let p=u.relativePath;if(t.isIgnored(p)||a&&V(p)||!Cn(u,{requireFunctionLikeSymbol:l,requireCallableSymbol:N})||s!==void 0&&u.symbol===s)continue;let R=L(u);R<i||R>o||c&&In(p)||f&&Ge(t,u.symbol,p)||M&&ue(u.symbol)||it(p)!=="test"&&(de(u.symbol)||!O&&C(t,p,u.startLine)||S.push(u))}return m?S.sort((u,p)=>L(p)-L(u)):S}function vn(t,e){return e.files!==void 0?[...new Set(e.files.map(r=>r.replace(/\\/g,"/")))].sort().filter(r=>!e.scope||r.includes(e.scope)).flatMap(r=>T(t,r)):e.requireCallableSymbol?B(t,{scope:e.scope,symbolMatches:G,sqlPrefilter:"callable"}):e.requireFunctionLikeSymbol?B(t,{scope:e.scope,symbolMatches:K,sqlPrefilter:"function-like"}):ge(t,e.scope)}function Cn(t,e){return e.requireCallableSymbol?G(t.symbol):e.requireFunctionLikeSymbol?K(t.symbol):t.isFunctionLike}function In(t){return(t.split("/").pop()??"").includes("types")}var rt=class{constructor(e){this.db=e}db;scopedDefinitions(e){return pe(this.db,e)}definitionsForFile(e){return T(this.db,e)}productionCallableDefinitions(e={}){return nt(this.db,e)}calleeMap(e,n={}){return De(this.db,e,{...n,semanticEvidence:_})}crossFileCallerMap(e,n={}){return ee(this.db,e,{...n,semanticEvidence:_})}sourceFallbackCallerFiles(e,n={}){return te(this.db,e,n)}callerFileMap(e,n={}){return Qe(this.db,e,{...n,semanticEvidence:_})}frameworkReferencedSymbolIds(e){let n=new Map;for(let i of e){if(!i.leaf)continue;let o=n.get(i.leaf)??[];o.push(i.symbolId),n.set(i.leaf,o)}let r=new Set;for(let i of b(this.db,{includeIgnored:!1}))if(k(i)==="rust")for(let{name:o}of E(this.db,i,{includeRustAttributeNames:!0}))for(let s of n.get(o)??[])r.add(s);return r}symbolsWithNonSelfCallees(e,n={}){if(e.length===0)return new Set;let r=new Map(e.map(o=>[o.symbolId,o.symbol])),i=this.calleeMap(e,n);return new Set([...i.entries()].filter(([o,s])=>{let a=r.get(o);return s.some(c=>c.symbol!==a)}).map(([o])=>o))}fileDependencyGraph(e){return I(this.db,e)}fileKind(e){return y(e)}hasSuppressionComment(e){return C(this.db,e.relativePath,e.startLine)}sourceFiles(){return ce(this.db)}scanSourceReferences(e,n){tt(this.db,e,n)}callableSignature(e){let n=fe(this.db).forFile(e.relativePath,{facts:!0}).facts?.callables.find(r=>r.startLine===e.startLine&&r.endLine===e.endLine);return n?{paramCount:n.paramCount}:null}};export{Ve as a,Jt as b,hr as c,nt as d,rt as e};
|
|
4
|
-
//# sourceMappingURL=chunk-JFMI5SGB.js.map
|
package/dist/chunk-JJP37RGX.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
import{a as Z}from"./chunk-HX4X7KG3.js";import{b as ht}from"./chunk-NJGKXKQF.js";import{q as vt}from"./chunk-FI7VGOR4.js";import{a as gt}from"./chunk-WRQXLNYE.js";import{c as Se}from"./chunk-BJT7LSPK.js";import{A as dt,C as pt,E as mt,F as ft,J as yt,K as G,T as _,_ as xe,a as ot,b as ie,d as ae,h as st,i as he,j as Me,n as ge,p as ve,q as lt,r as be,s as k,t as D,v as M,w as ut,x as X,y as O,z as ct}from"./chunk-2VAHDDLM.js";import{c as re}from"./chunk-ATXPTSEI.js";import{c as Q}from"./chunk-IW5XQG5G.js";function Re(e){let t=e.replaceAll("\\","/");return ht(t)==="test"?/(?:^|\/)__fixtures__\//iu.test(t)?"fixture":"test":/(?:^|\/)(?:fixtures?|testdata)\//iu.test(t)?"fixture":/(?:^|\/)(?:examples?|demos?|previews?)\//iu.test(t)?"example":/(?:^|\/)(?:generated|dist|build|coverage)\//iu.test(t)||/\.generated\./iu.test(t)?"generated":/^(?:scripts?|tools?)\//iu.test(t)?"script":"production"}import{createHash as fe}from"crypto";import{setImmediate as jr}from"timers/promises";import{createRequire as qr}from"module";import{createHash as _n}from"crypto";var Ce=8;function ee(e,t,n){return Ge(bt(e,t,Ue(n),0,new Set))}function ze(e,t,n){return He(e,t,n,0,new Set)}function bt(e,t,n,r,i){if(r>Ce)return[];let a=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(n);return a?St(e,t,a[1],a[2],r,i):/^[A-Za-z_$][\w$]*$/u.test(n)?xt(e,t,n,r,i):[]}function St(e,t,n,r,i,a){let s=[];for(let o of He(e,t,n,i+1,new Set(a))){let l=M(o.initializer);for(let u of l.namedChildren){if(u.type==="pair"){let d=u.childForFieldName("key")??u.namedChild(0);if(bn(d)!==r)continue;let c=u.childForFieldName("value")??u.namedChild(1);c&&s.push(...bt(e,o.definition.relativePath,Ue(c.text),i+1,new Set(a)));continue}if(/(?:method|function)/u.test(u.type)){if((u.childForFieldName("name")??u.namedChild(0))?.text!==r)continue;let c=gn(e,o.definition.relativePath,r,u);s.push(...c.length>0?c:[yn(o.definition,r,u)]);continue}if(u.type==="spread_element"){let d=u.namedChild(0);if(!d)continue;for(let c of He(e,o.definition.relativePath,Ue(d.text),i+1,new Set(a)))s.push(...St(e,c.definition.relativePath,c.definition.leaf,r,i+1,new Set(a)))}}}return Ge(s)}function yn(e,t,n){return{documentId:e.documentId,symbolId:-1,symbol:`source-callable:${e.relativePath}:${n.startPosition.row}:${t}`,relativePath:e.relativePath,startLine:n.startPosition.row,startChar:n.startPosition.column,endLine:n.endPosition.row,endChar:n.endPosition.column,leaf:t,parentTypeName:e.leaf,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:e.symbol}}function He(e,t,n,r,i){return r>Ce||!/^[A-Za-z_$][\w$]*$/u.test(n)?[]:xt(e,t,n,r,i).flatMap(a=>{let s=O(e,a.relativePath)?.rootNode,o=s?vn(s,a.leaf):null;return o?[{definition:a,initializer:o}]:[]})}function xt(e,t,n,r,i){if(r>Ce)return[];let a=`${t}\0${n}`;if(i.has(a))return[];i.add(a);let s=_(e,t).filter(u=>u.leaf===n);if(s.length>0)return s;let o=hn(e,t,n);if(o.length>0)return o;let l=G(e,t).find(u=>u.localName===n&&u.sourcePath);if(l?.sourcePath){let u=l.kind==="namespace"||l.importedName==="default"?n:l.importedName;return Ve(e,l.sourcePath,u,r+1,new Set(i))}return Ve(e,t,n,r+1,new Set(i))}function hn(e,t,n){let r=e.get("SELECT id FROM documents WHERE relative_path = ?",t)?.id;return r===void 0?[]:(pt(e,t)?.callables??[]).filter(i=>i.name===n).map(i=>({documentId:r,symbolId:-1,symbol:`source-callable:${t}:${i.startLine}:${n}`,relativePath:t,startLine:i.startLine,startChar:0,endLine:i.endLine,endChar:0,leaf:n,parentTypeName:null,isFunctionLike:!0,isTypeLike:!1,kind:null,documentation:null,enclosingSymbol:null}))}function Ve(e,t,n,r,i){if(r>Ce)return[];let a=_(e,t).filter(s=>s.leaf===n);return a.length>0?a:Ge(yt(e,t).flatMap(s=>s.sourcePath?s.kind==="named"&&!s.names.includes(n)?[]:Ve(e,s.sourcePath,n,r+1,new Set(i)):[]))}function gn(e,t,n,r){return _(e,t).filter(i=>i.leaf===n&&i.startLine<=r.startPosition.row&&i.endLine>=r.endPosition.row)}function vn(e,t){let n=null;return k(e,r=>{n||r.type!=="variable_declarator"||(r.childForFieldName("name")??r.namedChild(0))?.text.trim()!==t||(n=r.childForFieldName("value")??r.namedChild(1))}),n}function bn(e){return e?.text.replace(/^['"`]|['"`]$/gu,"")??null}function Ue(e){return e.replace(/\s+/gu,"").replace(/^\.\.\./u,"")}function Ge(e){return[...new Map(e.map(t=>[t.symbol,t])).values()]}var Sn=8;function V(e,t){return t?te(e,t,0,new Set):null}function te(e,t,n,r){if(n>Sn)return U(t,"value-evaluation-depth");let i=M(t),a=In(i);if(a)return Pn(e.file,i,a.term,a.value,a.precision);if(i.type==="binary_expression"&&/\+/u.test(i.text)){let l=i.namedChildren.map(u=>te(e,u,n+1,new Set(r)));if(l.length>=2&&l.every(u=>u!==null)){let u={kind:"concat",parts:l.map(c=>c.term)},d=l.map(c=>c.value).join("");return wn(e.file,i,u,d,l.some(c=>c.precision!=="literal")?"constrained-pattern":"literal",l)}}let s=i.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(s))return Nn(e,s,i,n,r);let o=En(i);return o?Bn(e,o.base,o.properties,i,n,r):i.type==="call_expression"||i.type==="call"?xn(e,i,n,r):U(i,`unsupported-expression:${i.type}`)}function xn(e,t,n,r){let a=(t.childForFieldName("function")??t.namedChild(0))?.text.replace(/\s+/gu,"").replace(/<.*>$/u,"")??"",s=Rn(e,a);if(s.length!==1)return U(t,s.length===0?"call-target-unresolved":"call-target-ambiguous");let o=s[0],l=`${o.relativePath}\0${o.symbol}`;if(r.has(l))return U(t,"call-return-cycle");let u=O(e.db,o.relativePath)?.rootNode;if(!u)return U(t,"call-target-unparsed");let d=D(u,o.startLine,o.endLine);if(!d)return U(t,"call-target-syntax-unavailable");let c=Cn(d);if(!c)return U(t,"call-return-not-single-expression");let p=new Set(r);p.add(l);let m=te({db:e.db,file:o.relativePath,root:u},c,n+1,p);return m?Ne(t,"bounded-call-return",m,o.symbol):U(t,"call-return-unresolved")}function Rn(e,t){if(/^[A-Za-z_$][\w$]*$/u.test(t)){let i=_(e.db,e.file).filter(s=>s.isFunctionLike&&s.leaf===t);if(i.length>0)return i;let a=G(e.db,e.file).find(s=>s.localName===t&&s.sourcePath&&s.kind!=="namespace");return a?.sourcePath?Z(e.db,a.sourcePath,a.importedName==="default"?t:a.importedName).filter(s=>s.isFunctionLike):[]}let n=/^([A-Za-z_$][\w$]*)\.([A-Za-z_$][\w$]*)$/u.exec(t);if(!n)return[];let r=G(e.db,e.file).find(i=>i.kind==="namespace"&&i.localName===n[1]&&i.sourcePath);return r?.sourcePath?Z(e.db,r.sourcePath,n[2]).filter(i=>i.isFunctionLike):[]}function Cn(e){let t=e.childForFieldName("body");if(e.type==="arrow_function"&&t&&t.type!=="statement_block")return t;let n=[];return Ct(t??e,t??e,n),n.length!==1?null:n[0].childForFieldName("argument")??n[0].namedChild(0)}function Ct(e,t,n){if(!(t!==e&&(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function"))){if(t.type==="return_statement"){n.push(t);return}for(let r of t.namedChildren)Ct(e,r,n)}}function Nn(e,t,n,r,i){let a=`${e.file}\0${t}`;if(i.has(a))return U(n,"value-cycle");i.add(a);let s=je(e.root,t);if(s){let g=te(e,s,r+1,i);return g?Ne(n,"local-constant",g):U(n,"non-foldable-local")}let o=G(e.db,e.file).find(g=>g.localName===t&&g.sourcePath);if(!o?.sourcePath)return H(n,t,"unresolved-identifier");if(o.kind==="namespace")return H(n,t,"namespace-import-requires-property");let l=o.importedName==="default"?t:o.importedName,u=Z(e.db,o.sourcePath,l);if(u.length!==1)return H(n,t,u.length===0?"import-definition-missing":"import-definition-ambiguous");let d=u[0],c=O(e.db,d.relativePath)?.rootNode;if(!c)return H(n,d.symbol,"import-definition-unparsed");let p=je(c,d.leaf);if(!p)return H(n,d.symbol,"import-definition-non-value");let m=te({db:e.db,file:d.relativePath,root:c},p,r+1,i);return m?Ne(n,"imported-constant",m,d.symbol):H(n,d.symbol,"import-value-unresolved")}function Bn(e,t,n,r,i,a){let s=G(e.db,e.file).find(m=>m.localName===t&&m.sourcePath),o=e.file,l=t,u;if(s?.sourcePath){s.kind==="namespace"?(l=n[0]??"",n=n.slice(1)):l=s.importedName==="default"?t:s.importedName;let m=Z(e.db,s.sourcePath,l);if(m.length!==1)return H(r,`${t}.${n.join(".")}`,m.length===0?"member-definition-missing":"member-definition-ambiguous");o=m[0].relativePath,l=m[0].leaf,u=m[0].symbol}let d=o===e.file?e.root:O(e.db,o)?.rootNode;if(!d)return H(r,u??t,"member-definition-unparsed");let c=je(d,l);if(!c)return H(r,u??t,"member-base-non-value");for(let m of n){let g=M(c);if(c=Tn(g,m),!c)return H(r,u??`${t}.${n.join(".")}`,`member-property-missing:${m}`)}let p=te({db:e.db,file:o,root:d},c,i+1,a);return p?Ne(r,"member-constant",p,u):H(r,u??t,"member-value-unresolved")}function In(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);if(n!=="`"||!r.includes("${"))return{term:{kind:"literal",value:r},value:r,precision:"literal"};let i=[],a=0,s=/\$\{([^}]*)\}/gu;for(let o of r.matchAll(s)){let l=o.index??0;l>a&&i.push({kind:"literal",value:r.slice(a,l)}),i.push({kind:"unknown",reason:`template-hole:${o[1]?.trim()||"expression"}`}),a=l+o[0].length}return a<r.length&&i.push({kind:"literal",value:r.slice(a)}),{term:{kind:"pattern",language:"template",value:r.replace(s,"{}")},value:r.replace(s,"{}"),precision:"constrained-pattern"}}function Pn(e,t,n,r,i){return{value:r,evidence:"literal",term:n,precision:i,derivation:Be("direct-literal","direct",e,t)}}function wn(e,t,n,r,i,a){return{value:r,evidence:"constant",term:n,precision:i,derivation:{...Be("constant-concatenation","mechanically-derived",e,t),inputFactIds:a.flatMap(s=>s.derivation.inputFactIds),sourceSpans:a.flatMap(s=>s.derivation.sourceSpans)}}}function Ne(e,t,n,r){return n.evidence==="expression"?{...n,derivation:{kind:"heuristic",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}:{...n,evidence:"constant",derivation:{kind:"mechanically-derived",rule:t,ruleVersion:"1",inputFactIds:[...n.derivation.inputFactIds,...r?[r]:[]],sourceSpans:n.derivation.sourceSpans}}}function H(e,t,n){return{value:e.text.trim(),evidence:"expression",term:{kind:"symbol",symbol:t},precision:"symbolic",derivation:Be(n,"heuristic","",e)}}function U(e,t){return{value:e.text.trim(),evidence:"expression",term:{kind:"unknown",reason:t},precision:"unknown",derivation:Be(t,"heuristic","",e)}}function Be(e,t,n,r){return{kind:t,rule:e,ruleVersion:"1",inputFactIds:[],sourceSpans:n?[{file:n,startLine:r.startPosition.row,endLine:r.endPosition.row}]:[]}}function En(e){let t=e.text.replace(/\s+/gu,"");if(!/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)+$/u.test(t))return null;let[n,...r]=t.split(".");return n?{base:n,properties:r}:null}var Rt=new WeakMap;function Fn(e){let t=Rt.get(e);if(t)return t;let n=new Map;return k(e,r=>{if(r.type!=="variable_declarator")return;let a=(r.childForFieldName("name")??r.namedChild(0))?.text.trim();if(!a||n.has(a))return;let s=r.parent;if(!s||s.type!=="lexical_declaration"||!/^\s*(?:export\s+)?const\b/u.test(s.text))return;let o=r.childForFieldName("value")??r.namedChild(1);o&&n.set(a,o)}),Rt.set(e,n),n}function je(e,t){return Fn(e).get(t)??null}function Tn(e,t){for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")!==t))return n.childForFieldName("value")??n.namedChild(1);return null}var $n=new WeakMap,Tt=new Set(["delete","get","head","options","patch","post","put"]),Ln=/(?:^|\.)(?:app|router|server)$/u,kn=new Set(["findFirst","findMany","findUnique","from","get","select"]),On=new Set(["create","delete","insert","remove","update","upsert"]),An=new Set(["execute","query","raw"]),Nt=/(?:\b(?:name|id)|['"`](?:name|id)['"`])\s*:/u,Bt=/(?:^\s*|[,{]\s*)(?:async\s+)?['"`]?(?:execute|handler|invoke|run)['"`]?\s*(?::|\([^)]*\)\s*\{)/mu,It=/\b[A-Za-z_$][\w$-]*[_-][\w$-]*\s*\(/u,Pt=/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s+[A-Za-z_$][\w$-]*\s*\(/iu,Xe=[Vn(),Hn(),Dn(),Un(),Gn(),jn(),Kn()],Ke=new Set(["exec","execFile","execFileSync","execSync","fork","spawn","spawnSync"]);function Dn(){return{id:"builtin.node-child-process",supports:e=>/(?:from\s*|require\s*\(\s*)['"](?:node:)?child_process['"]/u.test(e)&&/\b(?:exec|execFile|execFileSync|execSync|fork|spawn|spawnSync)\s*\(/u.test(e),extract:e=>{let t=Mn(e.source),n=[];return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=t.direct.get(i),s=/^(.*?)\.([A-Za-z_$][\w$]*)$/u.exec(i),o=s&&t.namespaces.has(s[1])?s[2]:null,l=a??o;if(!l||!Ke.has(l))return;let u=W(r),d=A(u[0],e)??{value:u[0]?.text.trim()||"<missing>",evidence:"expression"},c=["exec","execFile","execFileSync","execSync"].includes(l)?"process.exec":"process.spawn";n.push(T(e,r,"builtin.node-child-process",c,[{name:"operation",value:l,evidence:"literal"},{name:"executable",...d}],"exact","node-child-process-import"))}),n}}}function Mn(e){let t=new Map,n=new Set,r=String.raw`['"](?:node:)?child_process['"]`,i=new RegExp(String.raw`\bimport\s*\{([^}]*)\}\s*from\s*${r}`,"gu");for(let l of e.matchAll(i))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let a=new RegExp(String.raw`\b(?:const|let)\s*\{([^}]*)\}\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(a))for(let u of(l[1]??"").split(",")){let d=/^\s*([A-Za-z_$][\w$]*)(?:\s*:\s*([A-Za-z_$][\w$]*))?\s*$/u.exec(u);d&&Ke.has(d[1])&&t.set(d[2]??d[1],d[1])}let s=new RegExp(String.raw`\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*${r}`,"gu");for(let l of e.matchAll(s))n.add(l[1]);let o=new RegExp(String.raw`\b(?:const|let)\s+([A-Za-z_$][\w$]*)\s*=\s*require\s*\(\s*${r}\s*\)`,"gu");for(let l of e.matchAll(o))n.add(l[1]);return{direct:t,namespaces:n}}function L(e,t,n,r){let i=oe(r,"runtime-boundaries.context.ast",t,()=>n===void 0?O(e,t):ct(e,t,n));if(!i)return null;let a=i.rootNode;n!==void 0&&$n.set(a,i);let s=n??he(e,t),o,l,u,d=()=>(l!==void 0||(l=oe(r,"runtime-boundaries.context.callable-sites",t,()=>{let c=ve(t);return(c?ft(a,c):null)??mt(e,t)})),l);return{db:e,file:t,source:s,root:a,get constants(){return u??=oe(r,"runtime-boundaries.context.constants",t,()=>Qn(a)),u},ownerAt:c=>{let m=(o??=oe(r,"runtime-boundaries.context.definitions",t,()=>_(e,t,{rangeCorrectionEvidence:{source:s,callables:d()}},(f,y)=>oe(r,`runtime-boundaries.context.definitions.${f}`,t,y)))).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,y)=>f.endLine-f.startLine-(y.endLine-y.startLine)||f.startLine-y.startLine)[0];if(m)return{file:t,symbol:m.symbol,name:m.leaf,startLine:m.startLine,endLine:m.endLine};let b=(d()??[]).filter(f=>f.startLine<=c&&f.endLine>=c).sort((f,y)=>f.endLine-f.startLine-(y.endLine-y.startLine)||f.startLine-y.startLine)[0];return{file:t,symbol:null,name:b?.name??null,startLine:b?.startLine??c,endLine:b?.endLine??c}}}}function oe(e,t,n,r){return e?e(t,r,{file:n}):r()}function Hn(){return{id:"builtin.effect-httpapi",supports:e=>se(e,"HttpApiEndpoint").size>0||se(e,"HttpApiBuilder").size>0,extract:e=>{let t=[],n=se(e.source,"HttpApiEndpoint"),r=se(e.source,"HttpApiGroup"),i=se(e.source,"HttpApiBuilder");return q(e.root,"call_expression",a=>{let s=_t(a);if(!s)return;let o=W(a);if(n.has(s.receiver)&&Tt.has(s.member)){let b=A(o[0],e),f=A(o[1],e),y=Et(a,r,"make",0,e);if(!b||!f||!y)return;let v=s.member.toUpperCase();t.push(T(e,a,"builtin.effect-httpapi","http.handle",[{name:"method",value:v,evidence:"literal"},{name:"path",...f}],z([{name:"path",...f}]),"effect-httpapi-endpoint-declaration")),t.push(T(e,a,"builtin.effect-httpapi","framework.declare",qe(y,b),z(qe(y,b)),"effect-httpapi-operation-declaration"));return}if(!["handle","handleRaw"].includes(s.member))return;let l=Et(a,i,"group",1,e),u=A(o[0],e),d=o[1];if(!l||!u||!d)return;let c=qe(l,u),p=ee(e.db,e.file,d.text),m=T(e,a,"builtin.effect-httpapi","framework.handle",c,p.length===1?z(c):"candidate","effect-httpapi-handler-registration"),g=p[0];p.length===1&&g&&(m.owner={file:g.relativePath,symbol:g.symbol,name:g.leaf,startLine:g.startLine,endLine:g.endLine}),t.push(m)}),t}}}function qe(e,t){return[{name:"adapter",value:"effect-httpapi",evidence:"literal"},{name:"group",...e},{name:"operation",...t}]}function se(e,t){let n=new Set,r=/\bimport\s*\{([\s\S]*?)\}\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(r)){let s=a[2]??"";if(wt(s))for(let o of(a[1]??"").split(",")){let l=o.trim().replace(/^type\s+/u,""),u=/^([A-Za-z_$][\w$]*)(?:\s+as\s+([A-Za-z_$][\w$]*))?$/u.exec(l);u?.[1]===t&&n.add(u[2]??u[1])}}let i=/\bimport\s*\*\s*as\s*([A-Za-z_$][\w$]*)\s*from\s*['"]([^'"]+)['"]/gu;for(let a of e.matchAll(i)){let s=a[2]??"";s.endsWith(`/${t}`)&&wt(s)&&n.add(a[1])}return n}function wt(e){return e==="effect/unstable/httpapi"||e==="@effect/platform"||e.startsWith("@effect/platform/HttpApi")}function Et(e,t,n,r,i){let a=e.parent;for(;a;){if(a.type==="call_expression"){let s=Ft(a,t,n,r,i);if(s)return s;let o=a.childForFieldName("function")??a.namedChild(0),l=null;if(o&&We(o,u=>{!l&&u.type==="call_expression"&&(l=Ft(u,t,n,r,i))}),l)return l}a=a.parent}return null}function Ft(e,t,n,r,i){let a=_t(e);return!a||a.member!==n||!t.has(a.receiver)?null:A(W(e)[r],i)}function _t(e){let t=e.childForFieldName("function")??e.namedChild(0);if(!t||!["member_expression","subscript_expression"].includes(t.type))return null;let n=t.childForFieldName("object")??t.namedChild(0),r=t.childForFieldName("property")??t.childForFieldName("index")??t.namedChild(1);return!n||!r?null:{receiver:n.text.replace(/\s+/gu,""),member:r.text.replace(/^['"`]|['"`]$/gu,"")}}function Vn(){return{id:"builtin.http",supports:e=>/\bfetch\s*\(|\baxios\b|\b(?:app|router|server)\s*\.\s*(?:get|post|put|patch|delete|options|head)\s*\(/u.test(e)||le(e,["axios"])||/\b(?:FastAPI|Flask|APIRouter|axum|Router::new)\b/u.test(e),extract:e=>{let t=[];return q(e.root,["decorator","call_expression"],n=>{if(n.type==="decorator"){let p=/^@[^\s(]+\.(get|post|put|patch|delete|options|head)\s*\(\s*(['"`])([^'"`]+)\2/iu.exec(n.text.trim());if(!p||!le(e.source,["fastapi","flask"]))return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:p[1].toUpperCase(),evidence:"literal"},{name:"path",value:p[3],evidence:"literal"}],"exact","framework-decorator"));return}if(n.type!=="call_expression")return;let r=ue(n);if(!r)return;let i=r.split(".").at(-1)?.toLowerCase()??"",a=r.includes(".")?r.slice(0,r.lastIndexOf(".")):"",s=W(n);if(i==="route"&&le(e.source,["axum"])){let p=A(s[0],e),m=/^\s*(get|post|put|patch|delete|options|head)\s*\(/iu.exec(s[1]?.text??"")?.[1];if(!p||!m)return;t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:m.toUpperCase(),evidence:"literal"},{name:"path",...p}],z([{name:"path",...p}]),"framework-adapter"));return}if(r==="fetch"||r.endsWith(".fetch")){let p=A(s[0],e);if(!p)return;let g=/\bmethod\s*:\s*['"`]([A-Za-z]+)['"`]/u.exec(s[1]?.text??"")?.[1]?.toUpperCase()??(s[1]?null:"GET"),b=[...g?[{name:"method",value:g,evidence:"literal"}]:[],{name:"path",...p}];t.push(T(e,n,"builtin.http","http.request",b,g?z(b):"candidate","call-expression"));return}if(!Tt.has(i))return;let o=A(s[0],e);if(!o)return;let l=i.toUpperCase();if(Ln.test(a)&&le(e.source,["express","fastify","hono","koa-router","@koa/router"])){t.push(T(e,n,"builtin.http","http.handle",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"framework-adapter"));return}let d=Wn(e.source,["axios"]),c=a.split(".")[0]??"";d.has(c)&&t.push(T(e,n,"builtin.http","http.request",[{name:"method",value:l,evidence:"literal"},{name:"path",...o}],z([{name:"path",...o}]),"client-adapter"))}),t}}}function Un(){return{id:"builtin.capability-registry",supports:e=>Nt.test(e)&&Bt.test(e)||It.test(e)||Pt.test(e),extract:e=>{let t=[],n=new Set,r=[];return Nt.test(e.source)&&Bt.test(e.source)&&r.push("pair"),(It.test(e.source)||Pt.test(e.source))&&r.push("string","string_literal","template_string"),q(e.root,r,i=>{if(i.type==="pair"){let s=i.childForFieldName("key")??i.namedChild(0),o=i.childForFieldName("value")??i.namedChild(1),l=s?.text.replace(/^['"`]|['"`]$/gu,"");if(l!=="name"&&l!=="id")return;let u=$t(o,e),d=tr(i);if(!u||u.evidence!=="literal"||!d)return;let c=`handle\0${u.value}\0${d.startPosition.row}`;if(n.has(c))return;n.add(c),t.push(T(e,d,"builtin.capability-registry","registry.handle",[{name:"key",...u}],"exact","capability-descriptor"));return}if(!["string","string_literal","template_string"].includes(i.type))return;let a=i.text.replace(/^['"`]|['"`]$/gu,"");for(let s of a.matchAll(/\b([A-Za-z_$][\w$-]*)\s*\(/gu)){let o=s[1];if(!zn(a,o,s.index))continue;let l=`reference\0${o}\0${i.startPosition.row}`;n.has(l)||(n.add(l),t.push(T(e,i,"builtin.capability-registry","registry.reference",[{name:"key",value:o,evidence:"literal"}],"exact","capability-instruction-reference")))}}),t}}}function zn(e,t,n){if(t.includes("_")||t.includes("-"))return!0;let r=e.slice(Math.max(0,n-64),n);return/\b(?:use|call|invoke|run|via|with|read|stop)(?:\s+the)?(?:\s+(?:tool|capability|command))?\s*$/iu.test(r)}function Gn(){return{id:"builtin.registry",supports:e=>/(?:Handlers?|Registry|Routes?)\b/iu.test(e),extract:e=>{let t=[];return q(e.root,["pair","call_expression"],n=>{if(n.type==="pair"){let a=er(n);if(!a)return;let s=n.childForFieldName("key")??n.namedChild(0),o=n.childForFieldName("value")??n.namedChild(1),l=$t(s,e);if(!l||!o||!Lt(o))return;let u=Ze(o)?"exact":"candidate";t.push(T(e,n,"builtin.registry","registry.handle",[{name:"registry",value:a,evidence:"identifier"},{name:"key",...l}],z([{name:"key",...l}],u),"object-member"));return}if(n.type!=="call_expression")return;let r=n.childForFieldName("function")??n.namedChild(0);if(!r)return;let i=/^([A-Za-z_$][\w$]*)\s*\[\s*(['"`])([^'"`]+)\2\s*\]$/u.exec(r.text.trim());i&&t.push(T(e,n,"builtin.registry","registry.dispatch",[{name:"registry",value:i[1],evidence:"identifier"},{name:"key",value:i[3],evidence:"literal"}],"exact","indexed-access-call"))}),t}}}function jn(){return{id:"builtin.persistence",supports:e=>/\b(?:db|database|prisma|drizzle|[A-Za-z_$][\w$]*(?:Repository|Repo))\b[^;]{0,1024}?\.\s*(?:findFirst|findMany|findUnique|from|get|select|create|delete|insert|remove|update|upsert|execute|query|raw|transaction)(?:\s*<[^()]{1,512}>)?\s*\(/iu.test(e),extract:e=>{let t=[],n=rr(e.root);return q(e.root,"call_expression",r=>{let i=ue(r);if(!i)return;let a=i.split("."),s=a.at(-1)??"",o=W(r),l=o[0]?.text??"",u=nr(s,l);if(!u)return;let d=kt(a,n);if(!d)return;let c=qn(o[0],e)??ir(l),p=ar(d,a,s,c);if(!p)return;let m=s==="insert"?"persistence-insert":u==="database.read"&&/\bFOR\s+UPDATE\s+SKIP\s+LOCKED\b/iu.test(l)?"persistence-skip-locked-claim":"persistence-adapter";t.push(T(e,r,"builtin.persistence",u,[{name:"resource",...p}],z([{name:"resource",...p}]),m))}),t}}}function qn(e,t){if(!e)return null;let n=e.text.replace(/\s+/gu,"");return/^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*)*$/u.test(n)?{value:n.split(".").at(-1),evidence:"identifier",term:{kind:"symbol",symbol:n}}:A(e,t)}function Kn(){return{id:"builtin.queue",supports:e=>le(e,["amqplib","bullmq","kafkajs","@aws-sdk/client-sqs","rabbitmq"])&&/\.(?:sendToQueue|consume|send|subscribe)\s*\(/u.test(e),extract:e=>{let t=[];return q(e.root,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".").at(-1)??"",a=W(n),s=i==="sendToQueue"||i==="send"?"queue.send":i==="consume"||i==="subscribe"?"queue.consume":null;if(!s)return;let o=i==="send"||i==="subscribe"?Yn(a[0],"topic",e):A(a[0],e);o&&t.push(T(e,n,"builtin.queue",s,[{name:"address",...o}],z([{name:"address",...o}]),"framework-adapter"))}),t}}}function T(e,t,n,r,i,a,s){let o=e.ownerAt(t.startPosition.row),l=JSON.stringify({extractor:n,action:r,file:e.file,line:t.startPosition.row,keyParts:i});return{id:`boundary:${_n("sha256").update(l).digest("hex").slice(0,16)}`,extractor:n,action:r,owner:o,source:{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},keyParts:i,evidence:s,strength:a,protocol:r.split(".")[0]??r,role:Xn(r),executionDomain:Zn(e.file),derivation:{kind:a==="candidate"?"heuristic":a==="derived"?"mechanically-derived":"direct",rule:s,ruleVersion:"1",inputFactIds:i.flatMap(u=>u.derivation?.inputFactIds??[]),sourceSpans:[{file:e.file,startLine:t.startPosition.row,endLine:t.endPosition.row},...i.flatMap(u=>u.derivation?.sourceSpans??[])]},valuePrecision:i.some(u=>u.evidence==="expression")?"unknown":i.some(u=>u.evidence==="identifier")?"symbolic":"literal",modality:"may",resolution:"unresolved",sourceScope:Re(e.file)}}function Xn(e){let t=e.split(".").at(-1)??e;return["handle","subscribe","consume","read"].includes(t)?"consumer":["request","publish","send","write","dispatch","reference","invoke","spawn","exec"].includes(t)?"producer":"observe"}function Zn(e){let t=e.replaceAll("\\","/"),n=/^(apps|services|packages)\/([^/]+)/u.exec(t);return n?`${n[1]}/${n[2]}`:null}function le(e,t){return t.some(n=>{let r=n.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&");return new RegExp(`(?:\\bfrom\\s+${r}\\b|\\buse\\s+${r}\\b|(?:\\bfrom\\s*|\\brequire\\s*\\(\\s*)['"]${r}(?:[/']|"))`,"u").test(e)})}function Wn(e,t){let n=new Set;for(let r of t){let i=r.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&"),a=new RegExp(`(?:import\\s+([A-Za-z_$][\\w$]*)[^;]*?\\sfrom\\s*|(?:const|let)\\s+([A-Za-z_$][\\w$]*)\\s*=\\s*require\\s*\\(\\s*)['"]${i}(?:[/']|")`,"gu");for(let s of e.matchAll(a)){let o=s[1]??s[2];o&&n.add(o)}}return n}function Ie(e,t,n,r,i,a,s){return T(e,t,n,r,i,a,s)}function ue(e){return(e.childForFieldName("function")??e.namedChild(0))?.text.replace(/\s+/gu,"")??null}function W(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function A(e,t){let n=V(t,e);return n?{value:n.value,evidence:n.evidence,term:n.term,derivation:n.derivation}:null}function Yn(e,t,n){if(!e)return null;let r=e.namedChildren.find(a=>a.type!=="pair"?!1:(a.childForFieldName("key")??a.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")===t),i=r?.childForFieldName("value")??r?.namedChild(1);return A(i,n)}function $t(e,t){if(!e)return null;let n=A(e,t);if(n?.evidence==="literal"||n?.evidence==="constant")return n;let r=e.text.trim();return/^[A-Za-z_$][\w$]*$/u.test(r)?{value:r,evidence:"identifier",term:{kind:"symbol",symbol:r}}:n}function z(e,t="exact"){return t==="candidate"||e.some(n=>n.evidence==="expression")?"candidate":t==="derived"||e.some(n=>n.evidence==="constant")?"derived":"exact"}function Jn(e){let t=e.text.trim(),n=t[0];if(n!=="'"&&n!=='"'&&n!=="`"||t.at(-1)!==n)return null;let r=t.slice(1,-1);return n==="`"&&r.includes("${")?null:r}function Qn(e){let t=new Map;return We(e,n=>{if(n.type!=="variable_declarator")return;let r=n.childForFieldName("name")??n.namedChild(0),i=n.childForFieldName("value")??n.namedChild(1);if(!r||!i||!/^[A-Za-z_$][\w$]*$/u.test(r.text))return;let a=Jn(i);a!==null&&t.set(r.text,a)}),t}function er(e){let t=e.parent,n=t?.parent??null;for(;n&&["as_expression","satisfies_expression","type_assertion","parenthesized_expression"].includes(n.type);)n=n.parent;if(!t||!n||n.type!=="variable_declarator")return null;let i=(n.childForFieldName("name")??n.namedChild(0))?.text??"";return/(?:handlers?|registry|routes?)$/iu.test(i)?i:null}function Ze(e){return/(?:function|lambda|method)/u.test(e.type)||e.type==="arrow_function"}function Lt(e){return Ze(e)||e.type==="member_expression"?!0:e.type==="identifier"&&/(?:command|controller|dispatch|handle|handler)/iu.test(e.text)}function tr(e){let t=e.parent;for(;t&&t.type!=="variable_declarator";){if(["object","object_literal","dictionary"].includes(t.type))for(let n of t.namedChildren){if(n.type==="pair"){let i=n.childForFieldName("key")??n.namedChild(0),a=n.childForFieldName("value")??n.namedChild(1),s=i?.text.replace(/^['"`]|['"`]$/gu,"");if(s&&["execute","handler","invoke","run"].includes(s)&&a&&Lt(a))return t}let r=n.childForFieldName("name")??n.namedChild(0);if(r&&["execute","handler","invoke","run"].includes(r.text.replace(/^['"`]|['"`]$/gu,""))&&/(?:function|method)/u.test(n.type))return t}t=t.parent}return null}function kt(e,t=new Set){let n=e.slice(0,-1).map(r=>r.replace(/\([^)]*\)/gu,""));return n.some(r=>/^(?:prisma|drizzle)$/iu.test(r))?"orm":n.some(r=>/(?:Repository|Repo)$/u.test(r))?"repository":n.some(r=>/^(?:db|database)$/iu.test(r)||t.has(r))?"database":null}function nr(e,t){if(kn.has(e))return"database.read";if(On.has(e))return"database.write";if(!An.has(e))return null;let n=/\b(SELECT|INSERT|UPDATE|DELETE)\b/iu.exec(t)?.[1]?.toUpperCase();return n==="SELECT"?"database.read":n?"database.write":null}function rr(e){let t=new Set;return q(e,"call_expression",n=>{let r=ue(n);if(!r)return;let i=r.split(".");if(!(i.at(-1)!=="transaction"||!kt(i)))for(let a of W(n)){if(!Ze(a))continue;let o=(a.childForFieldName("parameters")??a.namedChildren.find(u=>/parameters/u.test(u.type)))?.namedChildren[0],l=o?ut(o):null;l&&t.add(l)}}),t}function ir(e){let t=Ot(e);return t?{value:t,evidence:"identifier",term:{kind:"symbol",symbol:t}}:null}function ar(e,t,n,r){if(e==="orm"&&t.length>=3)return{value:t.at(-2).replace(/\([^)]*\)/gu,""),evidence:"identifier"};if(e==="repository"){let a=t.at(-2)?.replace(/(?:Repository|Repo)$/u,"");return a?{value:a,evidence:"identifier"}:null}if(!r)return null;if(n==="from"||n==="insert")return r;let i=Ot(r.value);return i?{value:i,evidence:r.evidence}:null}function Ot(e){return/\b(?:from|into|update|table)\s+(?:\$\{\s*)?['"`]?([A-Za-z_$][\w$.-]*)/iu.exec(e)?.[1]??null}function We(e,t){t(e);for(let n of e.namedChildren)We(n,t)}function q(e,t,n){for(let r of be(e,t))n(r)}var or=Q("resolved-call-syntax",{clearGroups:[]}),Ye=Q("resolved-call-sites",{clearGroups:[]}),sr=Q("resolved-call-sites-reference-evidence",{clearGroups:[]});function Je(e,t){return Ye.get(e,t.symbolId,()=>Dt(e,t,lr(e,t)))}function At(e,t){let n=[...new Map(t.map(a=>[a.symbolId,a])).values()],r=n.filter(a=>!Ye.has(e,a.symbolId)),i=Mt(e,r);return new Map(n.map(a=>[a.symbolId,Ye.get(e,a.symbolId,()=>Dt(e,a,i.get(a.symbolId)??[]))]))}function Dt(e,t,n){let r=[],i=[],a=new Set,s=new Set;for(let o of n){a.add(o.file);let l=or.get(e,o.file,()=>cr(e,o.file));if(!l){i.push({callee:t,file:o.file,line:o.startLine,reason:"ast-unavailable",candidates:0,referenceProvenance:o.provenance});continue}let u=(l.byLeaf.get(t.leaf)??[]).filter(({callNode:p})=>p.startPosition.row<=o.endLine&&p.endPosition.row>=o.startLine);if(u.length!==1){i.push({callee:t,file:o.file,line:o.startLine,reason:u.length===0?"call-not-found":"ambiguous-call",candidates:u.length,referenceProvenance:o.provenance});continue}let d=u[0],c=`${o.file}\0${d.callNode.startIndex}\0${d.callNode.endIndex}`;s.has(c)||(s.add(c),r.push({callee:t,caller:xe(_(e,o.file),d.callNode.startPosition.row),file:o.file,line:d.callNode.startPosition.row,startLine:d.callNode.startPosition.row,endLine:d.callNode.endPosition.row,targetText:d.targetNode.text,callNode:d.callNode,targetNode:d.targetNode,arguments:d.arguments,referenceProvenance:o.provenance}))}return{sites:r,unresolved:i,filesVisited:a.size}}function lr(e,t){return Mt(e,[t]).get(t.symbolId)??[]}function Mt(e,t){if(!ur(e))return new Map(t.map(r=>[r.symbolId,vt(e,r,{semantic:!1}).map(i=>({file:i.file,startLine:i.line,endLine:i.line,provenance:i.provenance}))]));let n=new Map;for(let r of gt(e,t.map(i=>i.symbolId))){let i=n.get(r.symbol_id)??[];i.push({file:r.relative_path,startLine:r.chunk_start,endLine:r.chunk_end,provenance:"scip-reference-chunk"}),n.set(r.symbol_id,i)}return new Map(t.map(r=>[r.symbolId,n.get(r.symbolId)??[]]))}function ur(e){return sr.get(e,"project",()=>!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))}function cr(e,t){let n=O(e,t)?.rootNode;if(!n)return null;let r=new Map;for(let i of be(n,["call_expression","call"])){let a=i.childForFieldName("function")??i.namedChild(0);if(!a)continue;let s=dt(a);if(!s)continue;let o=i.childForFieldName("arguments")??i.namedChildren.find(d=>d.type==="arguments"),l={callNode:i,targetNode:a,arguments:o?.namedChildren??[]},u=r.get(s);u?u.push(l):r.set(s,[l])}return{byLeaf:r}}var dr=Q("call-parameter-value-flow",{clearGroups:[]});function ce(e,t){let n=`${t.callee.symbolId}\0${t.file}\0${t.callNode.startIndex}\0${t.callNode.endIndex}`;return dr.get(e,n,()=>pr(e,t))}function de(e,t){let n=new Set(t);return[...new Set(e.transfers.flatMap(r=>n.has(r.calleePosition)?[r.callerPosition]:[]))].sort((r,i)=>r-i)}function pr(e,t){let n={file:t.file,startLine:t.startLine,endLine:t.endLine};if(!t.caller)return{callee:t.callee,caller:null,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-unavailable",proof:n}))};let r=O(e,t.caller.relativePath)?.rootNode,i=r?D(r,t.caller.startLine,t.caller.endLine):null;if(!i)return{callee:t.callee,caller:t.caller,call:n,transfers:[],unknown:t.arguments.map((l,u)=>({calleePosition:u,argumentText:l.text.trim(),reason:"caller-syntax-unavailable",proof:n}))};let a=X(i),s=[],o=[];return t.arguments.forEach((l,u)=>{let d=l.text.trim(),c=a.indexOf(d);c>=0?s.push({calleePosition:u,callerPosition:c,argumentText:d,proof:n}):o.push({calleePosition:u,argumentText:d,reason:"argument-not-direct-parameter",proof:n})}),{callee:t.callee,caller:t.caller,call:n,transfers:s,unknown:o}}var mr=8,fr=8;function Vt(e,t,n=[]){let r=[],i=yr(e,n,r),a=i.summaries,s=hr(e,t,a,r),o=gr(e,t,r);return{observations:Pr([...s.observations,...o]),bodySummaries:a.size,discriminatorSummaries:s.summaries,filesInspected:i.filesInspected,errors:r}}function yr(e,t,n){let r=new Map,i=[],a=new Map,s=o=>{if(a.has(o))return a.get(o)??null;let l=L(e,o);return a.set(o,l),l};for(let o of t){let l={...o,depth:0,proofSpans:[{file:o.definition.relativePath,startLine:o.definition.startLine,endLine:o.definition.endLine}]};r.set(o.definition.symbol,l),i.push(l)}for(;i.length>0;){let o=i.shift();if(!(o.depth>=mr))try{for(let l of Je(e,o.definition).sites){if(!s(l.file))continue;let d=l.caller;if(!d)continue;let c=de(ce(e,l),o.parameterIndexes);if(c.length===0)continue;let p={definition:d,parameterIndexes:Kt(c),depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]};xr(r,p)&&i.push(r.get(d.symbol))}}catch(l){n.push(`builtin.carrier body summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{summaries:r,filesInspected:new Set(t.map(o=>o.definition.relativePath)).size}}function hr(e,t,n,r){let i=new Map,a=[],s=[];for(let o of t){if(o.action!=="http.request"||o.strength==="candidate"||o.sourceScope!=="production")continue;let l=zt(o);if(!l)continue;let u=L(e,o.source.file);if(!u)continue;let d=Gt(u.root,o.source.startLine),c=d.find(v=>v.startPosition.row===o.source.startLine)??d[0];if(!c)continue;let p=et(c);if(!p)continue;let m=ee(e,o.source.file,p.text);if(m.length!==1)continue;let g=n.get(m[0].symbol);if(!g)continue;let b=o.owner.symbol?_(e,o.owner.file).find(v=>v.symbol===o.owner.symbol):null;if(!b)continue;let f=Rr(u,b),y=Pe(c);for(let v of g.parameterIndexes){let R=Nr(u,y[v]);if(R)for(let x of Br(R)){let h=jt(x),S=qt(x);if(!h||!S)continue;let B=f.indexOf(S.text.trim());if(B>=0){let N={definition:b,carrier:l,field:h,parameterIndex:B,depth:0,proofObservationIds:[o.id],proofSpans:[o.source,{file:o.source.file,startLine:x.startPosition.row,endLine:x.endPosition.row}]},F=Ht(N);i.has(F)||(i.set(F,N),a.push(N));continue}let I=V(u,S);!I||I.evidence==="expression"||s.push(Qe(u,x,"carrier.publish",l,h,I.value,[o.id]))}}}for(;a.length>0;){let o=a.shift();if(!(o.depth>=fr))try{for(let l of Je(e,o.definition).sites){let u=L(e,l.file);if(!u)continue;let d=l.callNode,c=Pe(d)[o.parameterIndex];if(!c)continue;let p=V(u,c);p&&p.evidence!=="expression"&&s.push(Qe(u,d,"carrier.publish",o.carrier,o.field,p.value,o.proofObservationIds));let m=l.caller;if(!m)continue;let g=ce(e,l).transfers.find(y=>y.calleePosition===o.parameterIndex)?.callerPosition;if(g===void 0)continue;let b={...o,definition:m,parameterIndex:g,depth:o.depth+1,proofSpans:[...o.proofSpans,{file:l.file,startLine:l.startLine,endLine:l.endLine}]},f=Ht(b);i.has(f)||(i.set(f,b),a.push(b))}}catch(l){r.push(`builtin.carrier discriminator summary failed for ${o.definition.relativePath}: ${tt(l)}`)}}return{observations:s,summaries:i.size}}function gr(e,t,n){let r=[],i=t.filter(a=>a.action==="registry.handle"&&a.strength!=="candidate"&&a.sourceScope==="production");for(let a of t){if(a.action!=="http.handle"||a.strength==="candidate"||a.sourceScope!=="production")continue;let s=zt(a);if(!s)continue;let o=L(e,a.source.file);if(!o)continue;let l=Gt(o.root,a.source.startLine)[0];if(l)for(let u of Pe(l).slice(1)){let d=ee(e,a.source.file,u.text);for(let c of d)try{let p=L(e,c.relativePath);if(!p)continue;let m=D(p.root,c.startLine,c.endLine);if(!m)continue;k(m,g=>{if(g.type!=="call_expression")return;let b=et(g);if(!b)return;let f=/^([A-Za-z_$][\w$]*)\s*\[\s*([A-Za-z_$][\w$]*)\s*\]$/u.exec(b.text.trim());if(!f)return;let y=f[1],v=f[2],R=br(e,p,c,v);if(!R)return;let x=Sr(e,c.relativePath,y);for(let h of i){let S=h.keyParts.find(F=>F.name==="registry")?.value,B=h.keyParts.find(F=>F.name==="key")?.value;if(!S||!B||!x.some(F=>F.file===h.source.file&&F.binding===S))continue;let I=L(e,h.source.file),N=I?Cr(I.root,h.source.startLine):null;!I||!N||r.push(Qe(I,N,"carrier.consume",s,R,B,[a.id,h.id]))}})}catch(p){n.push(`builtin.carrier consumer analysis failed for ${c.relativePath}: ${tt(p)}`)}}}return r}function Ut(e){let t=_(e.db,e.file),n=new Map;return k(e.root,r=>{if(r.type!=="pair"||jt(r)?.toLowerCase()!=="body")return;let i=qt(r);if(!i||!/\bJSON\.stringify\s*\(/u.test(i.text))return;let a=xe(t,r.startPosition.row),s=vr(r);if(!a||!s)return;let o=X(s),l=new Set;Ir(i,o,l);let u=n.get(a.symbol)??new Set;o.forEach((d,c)=>{d&&l.has(d)&&u.add(c)}),u.size>0&&n.set(a.symbol,u)}),t.flatMap(r=>{let i=n.get(r.symbol);return i?[{definition:r,parameterIndexes:[...i].sort((a,s)=>a-s)}]:[]})}function vr(e){let t=e.parent;for(;t;){if(/(?:function|method|lambda)/u.test(t.type)||t.type==="arrow_function")return t;t=t.parent}return null}function br(e,t,n,r){let i=D(t.root,n.startLine,n.endLine);if(!i)return null;let a=new RegExp(`\\.body\\??\\.${ge(r)}\\b`,"u");if(a.test(i.text))return r;let s=null;if(k(i,d=>{if(s||d.type!=="variable_declarator")return;let c=d.childForFieldName("name")??d.namedChild(0),p=d.childForFieldName("value")??d.namedChild(1);!c||!p||!new RegExp(`(?:^|[,{}])\\s*${ge(r)}\\s*(?:[,}]|$)`,"u").test(c.text)||p.type==="call_expression"&&(s=et(p)?.text??null)}),!s)return null;let o=ee(e,n.relativePath,s);if(o.length!==1)return null;let l=L(e,o[0].relativePath),u=l?D(l.root,o[0].startLine,o[0].endLine):null;return u&&a.test(u.text)&&new RegExp(`\\b${ge(r)}\\s*[,}]`,"u").test(u.text)?r:null}function Sr(e,t,n){let r=[];for(let i of ze(e,t,n)){let a=M(i.initializer);if(a.type==="call_expression")for(let s of Pe(a)){let o=s.text.trim();if(/^[A-Za-z_$][\w$]*$/u.test(o))for(let l of ze(e,i.definition.relativePath,o))r.push({file:l.definition.relativePath,binding:l.definition.leaf})}}return[...new Map(r.map(i=>[`${i.file}\0${i.binding}`,i])).values()]}function Qe(e,t,n,r,i,a,s){let l=Ie(e,t,"builtin.carrier",n,[{name:"carrier",value:r,evidence:"constant",term:{kind:"literal",value:r}},{name:"field",value:i,evidence:"literal",term:{kind:"literal",value:i}},{name:"value",value:a,evidence:"constant",term:{kind:"literal",value:a}}],"derived","http-body-registry-discriminator");return l.derivation={kind:"mechanically-derived",rule:"http-body-registry-discriminator",ruleVersion:"1",inputFactIds:[...s],sourceSpans:[l.source]},l}function zt(e){let t=e.keyParts.find(r=>r.name==="method"&&r.evidence!=="expression")?.value,n=e.keyParts.find(r=>r.name==="path"&&r.evidence!=="expression")?.value;return t&&n?`${t.toUpperCase()} ${n}`:null}function xr(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Kt([...n.parameterIndexes,...t.parameterIndexes]);return r.length===n.parameterIndexes.length&&t.depth>=n.depth?!1:(e.set(t.definition.symbol,{...n,parameterIndexes:r,depth:Math.min(n.depth,t.depth),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0)}function Ht(e){return`${e.definition.symbol}\0${e.carrier}\0${e.field}\0${e.parameterIndex}`}function Rr(e,t){let n=D(e.root,t.startLine,t.endLine);return n?X(n):[]}function Cr(e,t){let n=null;return k(e,r=>{r.startPosition.row>t||r.endPosition.row<t||(!n||r.endIndex-r.startIndex<n.endIndex-n.startIndex)&&(n=r)}),n}function Gt(e,t){let n=[];return k(e,r=>{r.type==="call_expression"&&r.startPosition.row<=t&&r.endPosition.row>=t&&n.push(r)}),n.sort((r,i)=>r.endIndex-r.startIndex-(i.endIndex-i.startIndex))}function et(e){return e.childForFieldName("function")??e.namedChild(0)}function Pe(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Nr(e,t){if(!t)return null;let n=t.text.trim();if(!/^[A-Za-z_$][\w$]*$/u.test(n))return M(t);let r=null;return k(e.root,i=>{r||i.type!=="variable_declarator"||(i.childForFieldName("name")??i.namedChild(0))?.text.trim()!==n||(r=i.childForFieldName("value")??i.namedChild(1))}),r?M(r):M(t)}function Br(e){let t=M(e);return t.type==="object"?t.namedChildren.filter(n=>n.type==="pair"||n.type==="shorthand_property_identifier"):[]}function jt(e){return e.type==="shorthand_property_identifier"?e.text:(e.childForFieldName("key")??e.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"")??null}function qt(e){return e.type==="shorthand_property_identifier"?e:e.childForFieldName("value")??e.namedChild(1)}function Ir(e,t,n){let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function Kt(e){return[...new Set(e)].sort((t,n)=>t-n)}function Pr(e){return[...new Map(e.map(t=>[t.id,t])).values()]}function tt(e){return e instanceof Error?e.message:String(e)}import{createHash as wr}from"crypto";function Xt(e,t){let n=new Map;for(let a of t){if(a.action!=="http.handle"||a.sourceScope!=="production")continue;let s=n.get(a.source.file)??[];s.push(a),n.set(a.source.file,s)}let r=[],i=Er(e);for(let a of i.mounts)for(let s of a.targetFiles)for(let o of n.get(s)??[]){let l=o.keyParts.find(p=>p.name==="path");if(!l||l.evidence==="expression")continue;let u=Tr(a.prefix.value,l.value),d=o.keyParts.map(p=>p.name==="path"?{name:"path",value:u,evidence:"constant",term:{kind:"concat",parts:[a.prefix.term??{kind:"literal",value:a.prefix.value},l.term??{kind:"literal",value:l.value}]},derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line},...a.prefix.derivation?.sourceSpans??[],...l.derivation?.sourceSpans??[]]}}:p),c=`${o.id}\0${a.file}\0${a.line}\0${u}`;r.push({...o,id:`boundary:${wr("sha256").update(c).digest("hex").slice(0,16)}`,keyParts:d,strength:"derived",evidence:"framework-mount-composition",derivation:{kind:"mechanically-derived",rule:"http.mount-prefix",ruleVersion:"1",inputFactIds:[o.id],sourceSpans:[o.source,{file:a.file,startLine:a.line,endLine:a.line}]},resolution:"unresolved"}),o.strength="candidate",o.resolution="unresolved"}return{observations:r,filesInspected:i.filesInspected,mounts:i.mounts.length}}function Er(e){let t=[],n=Se(e);for(let r of n){let i=he(e,r);if(!_r(i))continue;let a=L(e,r);a&&Zt(a.root,s=>{if(s.type!=="call_expression")return;let o=s.childForFieldName("function")??s.namedChild(0);if(!o||!o.text.replace(/\s+/gu,"").endsWith(".use"))return;let l=$r(s);if(l.length<2)return;let u=V(a,l[0]);if(!u||u.evidence==="expression")return;let d=Fr(e,r,l[1]);d.length!==0&&t.push({file:r,line:s.startPosition.row,prefix:{value:u.value,evidence:u.evidence,term:u.term,derivation:u.derivation},targetFiles:d})})}return{mounts:t,filesInspected:n.length}}function Fr(e,t,n){let r=n.text.replace(/\s+/gu,""),i=/^([A-Za-z_$][\w$]*)/u.exec(r)?.[1];if(!i)return[];let a=G(e,t).find(l=>l.localName===i&&l.sourcePath);if(!a?.sourcePath)return[t];if(a.kind==="namespace")return[a.sourcePath];let s=a.importedName==="default"?i:a.importedName,o=Z(e,a.sourcePath,s);return[...new Set(o.map(l=>l.relativePath))]}function Tr(e,t){let n=e==="/"?"":e.replace(/\/+$/u,""),r=t.startsWith("/")?t:`/${t}`;return`${n}${r}`||"/"}function _r(e){return/(?:\bfrom\s*|\brequire\s*\(\s*)['"](?:express|fastify|hono|koa-router|@koa\/router)(?:[/']|")/u.test(e)}function $r(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function Zt(e,t){t(e);for(let n of e.namedChildren)Zt(n,t)}import{createHash as Lr}from"crypto";function we(e){return[...new Map(e.map(t=>[t.observationId,t])).values()].sort((t,n)=>t.observationId.localeCompare(n.observationId))}var Fe=new Set(["DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT"]),kr=8,Wt=ie({kind:"runtime-boundary-http-roles",invalidation:ae("runtime-boundary-http-roles"),serialize:Mr,deserialize:Hr});function Qt(e,t,n){let r=n??((f,y)=>y()),i=new Map,a=[],s=[],o=new Set,l=[],u=[],d=new Map,c=new Map,p=new Map,m=f=>{if(d.has(f))return d.get(f)??null;let y=L(e,f);return d.set(f,y),y},g=f=>{let y=c.get(f);if(y)return y;let v=_(e,f);return c.set(f,v),v},b=(f,y)=>{let v=p.get(f.file);if(!v){let h=re(e,f.file,f.source),S=Wt.read(e,f.file,h)??[];v={contentHash:h,roles:new Map(S.map(B=>[B.symbol,B])),dirty:!1},p.set(f.file,v)}let R=v.roles.get(y.symbol);if(R)return R;let x=Dr(f,y);return v.roles.set(y.symbol,{symbol:y.symbol,...x}),v.dirty=!0,x};for(r("runtime-boundaries.http-summary.seed",()=>{for(let f of t){if(f.action!=="http.request"||!f.owner.symbol||f.evidence!=="call-expression"&&f.evidence!=="client-adapter")continue;let y=g(f.owner.file).find(h=>h.symbol===f.owner.symbol);if(!y)continue;let v=m(y.relativePath);if(!v)continue;let R=b(v,y),x={definition:y,...R,constantMethods:f.keyParts.flatMap(h=>h.name==="method"&&h.evidence!=="expression"&&Fe.has(h.value.toUpperCase())?[h.value.toUpperCase()]:[]),depth:0,proofObservationIds:[f.id],proofSpans:[f.source]};Jt(i,x)&&a.push(i.get(y.symbol))}});a.length>0;){let f=a.splice(0,a.length),y=r("runtime-boundaries.http-summary.resolve-call-sites",()=>At(e,f.map(v=>v.definition)),{batchSize:f.length});r("runtime-boundaries.http-summary.process-call-sites",()=>{for(let v of f)if(!(v.depth>=kr))try{let R=y.get(v.definition.symbolId);if(!R)continue;u.push(...R.unresolved.map(x=>Or(v,x)));for(let x of R.sites){let h=m(x.file);if(!h)continue;o.add(x.file);let S=x.callNode,B=Ar(v,S,h);B&&s.push(B);let I=x.caller;if(!I)continue;let N=b(h,I),F=Vr(e,v,x),$={definition:I,pathParameterIndexes:Ee([...N.pathParameterIndexes,...F.pathParameterIndexes]),methodParameterIndexes:Ee([...N.methodParameterIndexes,...F.methodParameterIndexes]),constantMethods:ne([...v.constantMethods,...N.constantMethods]),depth:v.depth+1,proofObservationIds:ne([...v.proofObservationIds,...B?[B.id]:[]]),proofSpans:[...v.proofSpans,{file:x.file,startLine:x.startLine,endLine:x.endLine}]};Jt(i,$)&&a.push(i.get(I.symbol))}}catch(R){l.push(`builtin.http-summary failed for ${v.definition.relativePath}:${v.definition.startLine+1}: ${R instanceof Error?R.message:String(R)}`)}},{batchSize:f.length})}return Wt.writeBatch(e,[...p.entries()].flatMap(([f,y])=>y.dirty?[{relativePath:f,contentHash:y.contentHash,value:[...y.roles.values()].sort((v,R)=>v.symbol.localeCompare(R.symbol))}]:[])),{observations:s,frontiers:we(u),summaries:i.size,filesInspected:o.size,errors:l}}function Or(e,t){let n=ne([...e.pathParameterIndexes.length>0?["path"]:[],...e.methodParameterIndexes.length>0&&e.constantMethods.length!==1?["method"]:[]]),r=e.constantMethods.length===1?e.constantMethods[0]:"?",i=`${e.definition.symbol}\0${t.file}\0${t.line}\0${t.reason}`;return{observationId:`frontier:${Lr("sha256").update(i).digest("hex").slice(0,16)}`,kind:"call-resolution",action:"http.request",strength:"candidate",source:{file:t.file,startLine:t.line,endLine:t.line},ownerShortName:null,address:`method=${r??"?"} path=?`,reason:`Compiler identity found a reference to ${e.definition.leaf}, but exact call recovery stopped with ${t.reason} (${t.candidates} syntax candidate(s)); HTTP value propagation did not cross this site.`,missingKeyParts:n.length>0?n:["call"],sourceScope:Re(t.file)}}function Ar(e,t,n){let r=en(t),i=e.pathParameterIndexes.flatMap(c=>{let p=V(n,r[c]);return p&&p.evidence!=="expression"&&zr(p.value)?[{index:c,value:p}]:[]}),a=e.methodParameterIndexes.flatMap(c=>{let p=V(n,r[c]),m=p?.value.toUpperCase();return p&&m&&p.evidence!=="expression"&&Fe.has(m)?[{index:c,value:{...p,value:m}}]:[]}),s=ne([...e.constantMethods,...a.map(c=>c.value.value)]);if(i.length!==1||s.length!==1)return null;let o=i[0].value,l=a.find(c=>c.value.value===s[0])?.value,u=[{name:"method",value:s[0],evidence:l?"constant":"literal",term:l?.term??{kind:"literal",value:s[0]},derivation:l?.derivation},{name:"path",value:o.value,evidence:"constant",term:o.term,derivation:o.derivation}],d=Ie(n,t,"builtin.http-summary","http.request",u,"derived","compiler-resolved-http-summary");return d.derivation={kind:"mechanically-derived",rule:"compiler-resolved-http-summary",ruleVersion:"1",inputFactIds:e.proofObservationIds,sourceSpans:[...e.proofSpans,d.source]},d}function Dr(e,t){let n=D(e.root,t.startLine,t.endLine);if(!n)return{pathParameterIndexes:[],methodParameterIndexes:[],constantMethods:[]};let r=X(n),i=new Set,a=new Set,s=new Set;return k(n,o=>{if(o.type==="call_expression"&&((o.childForFieldName("function")??o.namedChild(0))?.text.replace(/\s+/gu,"").split(".").at(-1)??"")==="fetch"){let m=en(o);pe(m[0],r,i);let g=Ur(m[1],"method");if(g){pe(g,r,a);let b=V(e,g),f=b?.value.toUpperCase();f&&b?.evidence!=="expression"&&Fe.has(f)&&s.add(f)}else pe(m[1],r,a)}if(o.type!=="pair")return;let l=o.childForFieldName("key")??o.namedChild(0),u=o.childForFieldName("value")??o.namedChild(1),d=l?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase();(d==="url"||d==="path"||d==="endpoint")&&pe(u,r,i),(d==="init"||d==="requestinit"||d==="options")&&pe(u,r,a)}),{pathParameterIndexes:r.flatMap((o,l)=>o&&i.has(o)?[l]:[]),methodParameterIndexes:r.flatMap((o,l)=>o&&a.has(o)?[l]:[]),constantMethods:[...s].sort()}}function Mr(e){return e.map(t=>[encodeURIComponent(t.symbol),t.pathParameterIndexes.join(","),t.methodParameterIndexes.join(","),t.constantMethods.join(",")].join(" ")).join(`
|
|
2
|
-
`)}function Hr(e){if(!e)return[];let t=[];for(let n of e.split(`
|
|
3
|
-
`)){let r=n.split(" ");if(r.length!==4)return null;let i=Yt(r[1]),a=Yt(r[2]),s=r[3]?r[3].split(","):[];if(i===null||a===null||s.some(o=>!Fe.has(o)))return null;t.push({symbol:decodeURIComponent(r[0]),pathParameterIndexes:i,methodParameterIndexes:a,constantMethods:s})}return t}function Yt(e){if(!e)return[];let t=e.split(",").map(Number);return t.every(n=>Number.isSafeInteger(n)&&n>=0)?t:null}function Vr(e,t,n){let r=ce(e,n);return{pathParameterIndexes:de(r,t.pathParameterIndexes),methodParameterIndexes:de(r,t.methodParameterIndexes)}}function Jt(e,t){let n=e.get(t.definition.symbol);if(!n)return e.set(t.definition.symbol,t),!0;let r=Ee([...n.pathParameterIndexes,...t.pathParameterIndexes]),i=Ee([...n.methodParameterIndexes,...t.methodParameterIndexes]),a=ne([...n.constantMethods,...t.constantMethods]);return r.length!==n.pathParameterIndexes.length||i.length!==n.methodParameterIndexes.length||a.length!==n.constantMethods.length||t.depth<n.depth?(e.set(t.definition.symbol,{...n,pathParameterIndexes:r,methodParameterIndexes:i,constantMethods:a,depth:Math.min(n.depth,t.depth),proofObservationIds:ne([...n.proofObservationIds,...t.proofObservationIds]),proofSpans:[...n.proofSpans,...t.proofSpans]}),!0):!1}function Ur(e,t){if(!e)return null;for(let n of e.namedChildren)if(!(n.type!=="pair"||(n.childForFieldName("key")??n.namedChild(0))?.text.replace(/^['"`]|['"`]$/gu,"").toLowerCase()!==t))return n.childForFieldName("value")??n.namedChild(1);return null}function pe(e,t,n){if(!e)return;let r=new Set(e.text.match(/[A-Za-z_$][\w$]*/gu)??[]);for(let i of t)i&&r.has(i)&&n.add(i)}function en(e){return(e.childForFieldName("arguments")??e.namedChildren.find(n=>n.type==="arguments"))?.namedChildren??[]}function zr(e){return e.startsWith("/")||/^https?:\/\//iu.test(e)}function Ee(e){return[...new Set(e)].sort((t,n)=>t-n)}function ne(e){return[...new Set(e)].sort()}import{createHash as Gr}from"crypto";function rn(e){let t=tn(e.filter(r=>r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim")),n=tn(e.filter(r=>r.action==="database.write"&&r.evidence==="persistence-insert"));return e.flatMap(r=>r.action==="database.write"&&r.evidence==="persistence-insert"?nt(r).flatMap(i=>{let a=t.get(i)?.[0];return a?[nn(r,a,i,"queue.send")]:[]}):r.action==="database.read"&&r.evidence==="persistence-skip-locked-claim"?nt(r).flatMap(i=>{let a=n.get(i)?.[0];return a?[nn(r,a,i,"queue.consume")]:[]}):[])}function tn(e){let t=new Map;for(let n of e)for(let r of nt(n)){let i=t.get(r);i?i.push(n):t.set(r,[n])}for(let n of t.values())n.sort((r,i)=>r.id.localeCompare(i.id));return t}function nt(e){return e.keyParts.filter(t=>t.name==="resource").map(t=>t.value)}function nn(e,t,n,r){let i=`database:${n}`,a=r==="queue.send"?"database-queue-insert":"database-queue-skip-locked-claim",s=[e.id,r,i,a].join("\0");return{...e,id:`boundary:${Gr("sha256").update(s).digest("hex").slice(0,16)}`,extractor:"builtin.database-queue",action:r,keyParts:[{name:"address",value:i,evidence:"identifier",term:{kind:"symbol",symbol:n},derivation:{kind:"mechanically-derived",rule:"database-work-queue.resource",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]}}],evidence:a,strength:"derived",protocol:"queue",role:r==="queue.send"?"producer":"consumer",derivation:{kind:"mechanically-derived",rule:"database-work-queue.insert-skip-locked",ruleVersion:"1",inputFactIds:[e.id,t.id],sourceSpans:[e.source,t.source]},valuePrecision:"symbolic",resolution:"unresolved"}}var ye="runtime-boundaries-v19",Kr=qr(import.meta.url),w=Kr("typescript"),Xr=new Set([w.SyntaxKind.WhitespaceTrivia,w.SyntaxKind.NewLineTrivia,w.SyntaxKind.SingleLineCommentTrivia,w.SyntaxKind.MultiLineCommentTrivia]),Zr=new Set([w.SyntaxKind.NoSubstitutionTemplateLiteral,w.SyntaxKind.TemplateHead,w.SyntaxKind.TemplateMiddle,w.SyntaxKind.TemplateTail]),$e=[{id:"http.method-path",protocol:"http",producerActions:["http.request"],consumerActions:["http.handle"],keyNames:["method","path"],traversable:!0},{id:"registry.identity-key",protocol:"registry",producerActions:["registry.dispatch"],consumerActions:["registry.handle"],keyNames:["registry","key"],traversable:!0},{id:"registry.capability-key",protocol:"registry",producerActions:["registry.reference"],consumerActions:["registry.handle"],keyNames:["key"],traversable:!0,requireUniqueConsumer:!0},{id:"queue.address",protocol:"queue",producerActions:["queue.send"],consumerActions:["queue.consume"],keyNames:["address"],traversable:!0},{id:"carrier.discriminator",protocol:"carrier",producerActions:["carrier.publish"],consumerActions:["carrier.consume"],keyNames:["carrier","field","value"],traversable:!0},{id:"resource.identity",protocol:"database",producerActions:["database.write"],consumerActions:["database.read"],keyNames:["resource"],traversable:!1},{id:"framework.effect-httpapi-operation",protocol:"framework",producerActions:[],consumerActions:["framework.handle"],declarationActions:["framework.declare"],keyNames:["adapter","group","operation"],traversable:!0,linkFrom:"declaration",requireUniquePair:!0}],Wr=64,cn="builtin.http-summary",Le={HTTP_HANDLE:"http.handle",HTTP_REQUEST:"http.request",REGISTRY_HANDLE:"registry.handle"},rt=new Set(Object.values(Le));async function Yr(e,t={}){let n=Se(e),r=new Set(n),i=new Set((t.affectedFiles??[]).map(vi)),a=t.previousGraph?.fileCoverage,s=i.size>0&&t.previousGraph?.extractorVersion===ye&&a!==void 0&&a.length===t.previousGraph.coverage.filesScanned,o=s?a.filter(C=>r.has(C.file)&&!i.has(C.file)):[],l=new Set(o.flatMap(C=>C.observationIds)),u=s?t.previousGraph.observations.filter(C=>l.has(C.id)&&r.has(C.source.file)):[],d=s?n.filter(C=>i.has(C)):n,c=[],p=a?.reduce((C,P)=>C+P.observationIds.length,0)??0,m=performance.now(),g=await pi(e,d,t.profileSpan);j(c,"direct-extraction",m,d.length,g.observations.length,{filesVisited:d.length,filesReused:o.length,factsReused:u.length,factsInvalidated:Math.max(0,p-u.length)});let b=[...o,...g.fileCoverage].sort((C,P)=>C.file.localeCompare(P.file)),f=gi(b),y=b.flatMap(C=>C.extractionErrors),v=me([...u,...g.observations]);if(s&&!t.forceDerivedRebuild&&t.previousGraph&&Jr(a,g.fileCoverage,i)&&(!ii(e,t.previousGraph,i)||si(a,g.fileCoverage,i)&&!li(t.previousGraph,i))){for(let P of t.previousGraph.coverage.extractors)f.has(P.id)||f.set(P.id,P);let C=ci(t.previousGraph.coverage.phases);return c.push(...C),{...t.previousGraph,observations:t.previousGraph.observations,relationGroups:t.previousGraph.relationGroups,links:t.previousGraph.links,frontiers:t.previousGraph.frontiers,coverage:{filesScanned:n.length,filesWithAst:b.filter(P=>P.hasAst).length,filesWithoutAst:b.filter(P=>!P.hasAst).length,filesReused:o.length,extractors:[...f.values()],extractionErrors:t.previousGraph.coverage.extractionErrors,phases:c},fileCoverage:b}}let R=me([...v,...rn(v)]),x=s&&t.previousGraph!==void 0?Qr(t.previousGraph,a,g.fileCoverage,i,v):{reuse:!1,shapeUnchanged:!1,proofFilesUnchanged:!1,seedUnchanged:!1},h=x.reuse;t.profileSpan?.("runtime-boundaries.http-summary.reuse-decision",()=>{},x),m=performance.now();let S;if(h){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="http-summary"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.wrapper");S={observations:t.previousGraph.observations.filter(E=>E.extractor===cn),frontiers:t.previousGraph.frontiers.filter(E=>E.kind==="call-resolution"&&E.action===Le.HTTP_REQUEST),summaries:0,filesInspected:C?.filesVisited??P?.applicableFiles??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.http-summary failed"))},j(c,"http-summary",m,R.length,S.observations.length,{filesVisited:0,filesReused:S.filesInspected,factsReused:S.observations.length+S.frontiers.length,factsInvalidated:0}),P&&f.set(P.id,P)}else S=Qt(e,R,t.profileSpan),j(c,"http-summary",m,R.length,S.observations.length,{filesVisited:S.filesInspected}),f.set("builtin.wrapper",{id:"builtin.wrapper",applicableFiles:S.filesInspected,observations:S.observations.length,errors:S.errors.length});y.push(...S.errors);let B=me([...R,...S.observations]);m=performance.now();let I=Xt(e,B);j(c,"http-mount",m,B.length,I.observations.length,{filesVisited:I.filesInspected});let N=me([...B,...I.observations]);m=performance.now();let F=h&&t.previousGraph!==void 0&&ei(t.previousGraph,a,g.fileCoverage,i),$;if(F){let C=t.previousGraph.coverage.phases?.find(E=>E.id==="carrier"),P=t.previousGraph.coverage.extractors.find(E=>E.id==="builtin.carrier");$={observations:t.previousGraph.observations.filter(E=>E.extractor==="builtin.carrier"),bodySummaries:P?.applicableFiles??0,discriminatorSummaries:0,filesInspected:C?.filesVisited??0,errors:t.previousGraph.coverage.extractionErrors.filter(E=>E.startsWith("builtin.carrier"))},j(c,"carrier",m,N.length,$.observations.length,{filesVisited:0,filesReused:$.filesInspected,factsReused:$.observations.length,factsInvalidated:0}),P&&f.set(P.id,P)}else $=Vt(e,N,b.flatMap(C=>C.bodySummaries??[])),j(c,"carrier",m,N.length,$.observations.length,{filesVisited:$.filesInspected}),f.set("builtin.carrier",{id:"builtin.carrier",applicableFiles:$.bodySummaries,observations:$.observations.length,errors:$.errors.length});y.push(...$.errors);let K=me([...N,...$.observations]);m=performance.now();let J=bi(K);j(c,"relations",m,K.length,J.length),m=performance.now();let it=xi(K,J);j(c,"links",m,J.length,it.length),Ri(K,J),m=performance.now();let at=we([...Ci(K,J),...S.frontiers]);return j(c,"frontiers",m,K.length,at.length),{schemaVersion:2,extractorVersion:ye,observations:K,relationGroups:J,links:it,frontiers:at,coverage:{filesScanned:n.length,filesWithAst:b.filter(C=>C.hasAst).length,filesWithoutAst:b.filter(C=>!C.hasAst).length,...s?{filesReused:o.length}:{},extractors:[...f.values()],extractionErrors:y,phases:c},fileCoverage:b}}function Jr(e,t,n){if(!e)return!1;let r=e.filter(a=>n.has(a.file)).filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file)),i=t.filter(an).map(on).sort((a,s)=>a.file.localeCompare(s.file));return JSON.stringify(r)===JSON.stringify(i)}function an(e){return e.observationIds.length>0||e.extractionErrors.length>0}function on(e){let{syntaxHash:t,shapeHash:n,bodySummaries:r,...i}=e;return i}function Qr(e,t,n,r,i){let a=ni(t,n,r),s=ri(e),l=![...dn(t,n)].some(p=>s.has(p)),u=new Set((t??[]).filter(p=>r.has(p.file)).flatMap(p=>p.observationIds)),d=new Set(n.flatMap(p=>p.observationIds)),c=sn(e.observations,u)===sn(i,d);return{reuse:a&&l&&c,shapeUnchanged:a,proofFilesUnchanged:l,seedUnchanged:c}}function dn(e,t){let n=new Map(e?.map(r=>[r.file,r.syntaxHash])??[]);return new Set(t.filter(r=>r.syntaxHash===void 0||n.get(r.file)!==r.syntaxHash).map(r=>r.file))}function ei(e,t,n,r){if(!t)return!1;let i=t.filter(l=>r.has(l.file)).map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file)),a=n.map(({file:l,bodySummaries:u})=>({file:l,bodySummaries:u??[]})).sort((l,u)=>l.file.localeCompare(u.file));if(JSON.stringify(i)!==JSON.stringify(a))return!1;let s=dn(t,n),o=ti(e,"builtin.carrier");return![...s].some(l=>o.has(l))}function ti(e,t){let n=new Set;for(let r of e.observations)if(r.extractor===t){n.add(r.source.file);for(let i of r.derivation.sourceSpans)n.add(i.file)}return n}function ni(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.shapeHash]));return t.length===n.size&&t.every(i=>i.shapeHash!==void 0&&r.get(i.file)===i.shapeHash)}function ri(e){let t=new Set;for(let n of e.observations)if(n.extractor===cn){t.add(n.source.file);for(let r of n.derivation.sourceSpans)t.add(r.file)}for(let n of e.frontiers)n.kind==="call-resolution"&&n.action===Le.HTTP_REQUEST&&n.source&&t.add(n.source.file);return t}function sn(e,t){return JSON.stringify(e.filter(n=>t.has(n.id)&&n.action===Le.HTTP_REQUEST&&n.owner.symbol!==null&&(n.evidence==="call-expression"||n.evidence==="client-adapter")).map(n=>({ownerSymbol:n.owner.symbol,evidence:n.evidence,methods:n.keyParts.filter(r=>r.name==="method"&&r.evidence!=="expression").map(r=>r.value.toUpperCase()).sort()})).sort((n,r)=>`${n.ownerSymbol}\0${n.evidence}\0${n.methods.join(",")}`.localeCompare(`${r.ownerSymbol}\0${r.evidence}\0${r.methods.join(",")}`)))}function ii(e,t,n){let r=ai(t),i=oi(t);if([...n].some(o=>r.has(o)))return!0;if(i.size===0||n.size===0)return!1;if(!!!e.get("SELECT 1 AS present FROM mentions WHERE role != 1 LIMIT 1"))return!0;let s=[...n];for(let o=0;o<s.length;o+=750){let l=s.slice(o,o+750),u=l.map(()=>"?").join(",");if(e.all(`SELECT DISTINCT global_symbol.symbol
|
|
4
|
-
FROM mentions mention
|
|
5
|
-
JOIN chunks reference_chunk ON reference_chunk.id = mention.chunk_id
|
|
6
|
-
JOIN documents reference_document ON reference_document.id = reference_chunk.document_id
|
|
7
|
-
JOIN global_symbols global_symbol ON global_symbol.id = mention.symbol_id
|
|
8
|
-
WHERE mention.role != 1
|
|
9
|
-
AND reference_document.relative_path IN (${u})`,...l).some(c=>i.has(c.symbol)))return!0}return!1}function ai(e){let t=new Set;for(let n of e.observations)if(rt.has(n.action)){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)!n.action||!rt.has(n.action)||!n.source||t.add(n.source.file);return t}function oi(e){return new Set(e.observations.flatMap(t=>rt.has(t.action)&&t.owner.symbol?[t.owner.symbol]:[]))}function si(e,t,n){if(!e)return!1;let r=new Map(e.filter(i=>n.has(i.file)).map(i=>[i.file,i.syntaxHash]));return t.length===n.size&&t.every(i=>i.syntaxHash!==void 0&&r.get(i.file)===i.syntaxHash)}function li(e,t){let n=ui(e);return[...t].some(r=>n.has(r))}function ui(e){let t=new Set;for(let n of e.observations){t.add(n.source.file);for(let r of n.derivation?.sourceSpans??[])t.add(r.file)}for(let n of e.frontiers)n.source&&t.add(n.source.file);return t}function ci(e){return(e??[]).filter(t=>t.id!=="direct-extraction").map(t=>({...t,durationMs:0,filesVisited:0,filesReused:t.filesVisited??0,factsReused:t.outputFacts,factsInvalidated:0}))}function j(e,t,n,r,i,a={}){e.push({id:t,durationMs:Math.max(0,performance.now()-n),inputFacts:r,outputFacts:i,...a})}var di=256;async function pi(e,t,n){let r=[],i=[],a=n??((c,p)=>p()),s=[],o=[],l=new Map,u=c=>{let p=l.get(c);if(p!==void 0)return p;let m=re(e,c,Me(e,c));return l.set(c,m),m},d=0;for(let c of t){d+=1,d>=di&&(d=0,ot(),await jr());let p=a("runtime-boundaries.file.read",()=>Me(e,c)),m=re(e,c,p);l.set(c,m);let g=a("runtime-boundaries.file.direct-product",()=>{let h=un.read(e,c,m);if(!h||h.extractorVersion!==ye)return null;for(let S of h.deps)if(u(S.path)!==S.contentHash)return null;return h});if(g){r.push(...g.observations),i.push(g.coverage);continue}let b=a("runtime-boundaries.file.supports",()=>Xe.filter(h=>h.supports(p))),f=/\bJSON\.stringify\s*\(/u.test(p)&&/\bbody\s*:/u.test(p),y=a("runtime-boundaries.file.hashes",()=>{let h=ln.read(e,c,m);if(h)return h;let S=mi(c,p);return s.push({relativePath:c,contentHash:m,value:S}),S}),v=new Set,R=[],x=st(h=>v.add(h),()=>{let h=b.length>0||f?L(e,c,p,n):null,S={file:c,hasAst:h!==null||hi(c,p),syntaxHash:y.syntaxHash,shapeHash:y.shapeHash,bodySummaries:h&&f?Ut(h):[],observationIds:[],extractors:[],extractionErrors:[]};if(h)for(let B of b){let I={id:B.id,applicableFiles:1,observations:0,errors:0};try{let N=yi(n,`runtime-boundaries.extractor.${B.id}`,c,()=>B.extract(h));I.observations=N.length,R.push(...N),S.observationIds.push(...N.map(F=>F.id))}catch(N){I.errors=1,S.extractionErrors.push(`${B.id} failed for ${c}: ${N instanceof Error?N.message:String(N)}`)}S.extractors.push(I)}return S});r.push(...R),i.push(x),x.extractionErrors.length===0&&(v.delete(c),o.push({relativePath:c,contentHash:m,value:{extractorVersion:ye,deps:[...v].sort().map(h=>({path:h,contentHash:u(h)})),observations:R,coverage:x}}))}return s.length>0&&ln.writeBatch(e,s),o.length>0&&un.writeBatch(e,o),{observations:r,fileCoverage:i}}var ln=ie({kind:"runtime-boundary-source-hashes",invalidation:ae("runtime-boundary-source-hashes"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.syntaxHash=="string"&&typeof t.shapeHash=="string"?{syntaxHash:t.syntaxHash,shapeHash:t.shapeHash}:null}catch{return null}}}),un=ie({kind:"runtime-boundary-direct-extraction",invalidation:ae("runtime-boundary-direct-extraction"),serialize:e=>JSON.stringify(e),deserialize:e=>{try{let t=JSON.parse(e);return typeof t.extractorVersion!="string"||!Array.isArray(t.deps)||!Array.isArray(t.observations)||typeof t.coverage!="object"||t.coverage===null||!t.deps.every(n=>typeof n=="object"&&n!==null&&typeof n.path=="string"&&typeof n.contentHash=="string")?null:t}catch{return null}}});function mi(e,t){if(!/\.(?:[cm]?[jt]sx?)$/iu.test(e)){let u=fe("sha256").update(t).digest("hex");return{syntaxHash:u,shapeHash:u}}let n=/\.[jt]sx$/iu.test(e)?w.LanguageVariant.JSX:w.LanguageVariant.Standard,r=w.createScanner(w.ScriptTarget.Latest,!1,n,t),i=fe("sha256"),a=fe("sha256"),s=[],o=[0];for(let u=0;u<t.length;u+=1)t.charCodeAt(u)===10&&o.push(u+1);let l=0;for(let u=r.scan();u!==w.SyntaxKind.EndOfFileToken;u=r.scan()){if(u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)===0&&(u=r.reScanTemplateToken(!1)),Xr.has(u))continue;let d=r.getTokenText();for(;o[l+1]!==void 0&&o[l+1]<=r.getTokenPos();)l+=1;i.update(String(u)),i.update("\0"),i.update(d),i.update("\0"),i.update(String(l)),i.update("\0"),a.update(String(u)),a.update("\0"),!Zr.has(u)&&!fi(u,d)&&a.update(d),a.update("\0"),a.update(String(l)),a.update("\0"),u===w.SyntaxKind.TemplateHead?s.push(0):u===w.SyntaxKind.TemplateTail?s.pop():u===w.SyntaxKind.OpenBraceToken&&s.length>0?s[s.length-1]+=1:u===w.SyntaxKind.CloseBraceToken&&s.length>0&&s.at(-1)>0&&(s[s.length-1]-=1)}return{syntaxHash:i.digest("hex"),shapeHash:a.digest("hex")}}function fi(e,t){if(e!==w.SyntaxKind.StringLiteral||t.length<2)return!1;let n=t.slice(1,-1);return n.startsWith("/")||n.includes("://")}function yi(e,t,n,r){return e?e(t,r,{file:n}):r()}function hi(e,t){return t?lt(e)?/<script\b/iu.test(t):ve(e)!==null:!1}function gi(e){let t=new Map(Xe.map(n=>[n.id,{id:n.id,applicableFiles:0,observations:0,errors:0}]));for(let n of e)for(let r of n.extractors){let i=t.get(r.id);i&&(i.applicableFiles+=r.applicableFiles,i.observations+=r.observations,i.errors+=r.errors)}return t}function vi(e){return e.replaceAll("\\","/").replace(/^\.\//u,"")}function bi(e){let t=new Map;for(let n of $e){let r=new Set([...n.producerActions,...n.consumerActions,...n.declarationActions??[]]);for(let i of e){if(!r.has(i.action)||i.strength==="candidate")continue;let a=Bi(i,n.keyNames);if(!a)continue;let s=a.map(c=>`${c.name}=${mn(c.name,c.value)}`).join("\0"),o=i.sourceScope==="production"?"production":i.sourceScope,l=`${n.id}\0${o}\0${s}`,u=`boundary-group:${fe("sha256").update(l).digest("hex").slice(0,16)}`,d=t.get(u)??{id:u,protocol:n.protocol,joinRule:n.id,normalizedKey:s,keyParts:a,producerIds:[],consumerIds:[],declarationIds:[],derivation:{kind:"mechanically-derived",rule:n.id,ruleVersion:"2",inputFactIds:[],sourceSpans:[]}};n.producerActions.includes(i.action)&&d.producerIds.push(i.id),n.consumerActions.includes(i.action)&&d.consumerIds.push(i.id),n.declarationActions?.includes(i.action)&&d.declarationIds.push(i.id),d.derivation.inputFactIds.push(i.id),d.derivation.sourceSpans.push(i.source),t.set(u,d)}}return[...t.values()].map(Si).sort(Pi)}function Si(e){return{...e,producerIds:Te(e.producerIds),consumerIds:Te(e.consumerIds),declarationIds:Te(e.declarationIds),derivation:{...e.derivation,inputFactIds:Te(e.derivation.inputFactIds),sourceSpans:[...new Map(e.derivation.sourceSpans.map(t=>[`${t.file}:${t.startLine}:${t.endLine}`,t])).values()]}}}function xi(e,t){let n=new Map(e.map(i=>[i.id,i])),r=new Map;for(let i of t){let a=$e.find(o=>o.id===i.joinRule);if(!a?.traversable)continue;let s=a.linkFrom==="declaration"?i.declarationIds:i.producerIds;if(!(s.length===0||i.consumerIds.length===0)&&!(a.requireUniquePair&&(s.length!==1||i.consumerIds.length!==1))&&!(a.requireUniqueConsumer&&i.consumerIds.length!==1)&&!(s.length*i.consumerIds.length>Wr))for(let o of s)for(let l of i.consumerIds){let u=n.get(o),d=n.get(l);if(!u||!d||Ii(u,d))continue;let c=u.strength==="derived"||d.strength==="derived"?"derived":"exact",p=`${i.joinRule}\0${o}\0${l}`,m={id:`boundary-link:${fe("sha256").update(p).digest("hex").slice(0,16)}`,from:o,to:l,joinRule:i.joinRule,matchedKeyParts:i.keyParts,strength:c,derivation:{kind:"mechanically-derived",rule:i.joinRule,ruleVersion:"2",inputFactIds:[o,l],sourceSpans:[u.source,d.source]}};r.set(m.id,m)}}return[...r.values()].sort(wi)}function Ri(e,t){let n=new Set(t.filter(pn).flatMap(_e)),r=new Set(t.filter(Ni).flatMap(_e));for(let i of e)i.resolution=n.has(i.id)?"locally-linked":r.has(i.id)?"ambiguous":"unresolved"}function Ci(e,t){let n=new Set(e.filter(a=>a.strength!=="candidate").map(a=>`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)),r=new Set(t.flatMap(_e)),i=new Set(t.filter(pn).flatMap(_e));return e.filter(a=>a.sourceScope==="production").filter(a=>a.strength!=="candidate"||!n.has(`${a.action}\0${a.source.file}\0${a.source.startLine}\0${a.source.endLine}`)).filter(a=>!i.has(a.id)).map(a=>{let s=a.keyParts.filter(l=>l.evidence==="expression"||l.value.length===0).map(l=>l.name),o=s.length>0?`${a.extractor} observed ${a.action}, but ${s.join(", ")} remained symbolic or unknown.`:a.resolution==="ambiguous"?`${a.extractor} established the address for ${a.action}, but more than one indexed peer has the same runtime key.`:r.has(a.id)?`${a.extractor} established the address for ${a.action}, but the indexed production scope contains no counterpart role in that relation group.`:`${a.extractor} observed ${a.action}, but no supported factorization rule could establish its addressed relation.`;return{observationId:a.id,reason:o,missingKeyParts:s,sourceScope:a.sourceScope}}).sort((a,s)=>a.observationId.localeCompare(s.observationId))}function _e(e){return[...e.producerIds,...e.consumerIds,...e.declarationIds]}function pn(e){let t=$e.find(r=>r.id===e.joinRule);if(!t)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length===0||e.consumerIds.length===0?!1:!t.requireUniquePair||n.length===1&&e.consumerIds.length===1}function Ni(e){let t=$e.find(r=>r.id===e.joinRule);if(!t?.requireUniquePair)return!1;let n=t.linkFrom==="declaration"?e.declarationIds:e.producerIds;return n.length>0&&e.consumerIds.length>0&&(n.length!==1||e.consumerIds.length!==1)}function Bi(e,t){let n=[];for(let r of t){let i=e.keyParts.find(a=>a.name===r);if(!i||i.evidence==="expression"||i.value.length===0)return null;n.push({...i,value:mn(r,i.value)})}return n}function mn(e,t){if(e==="method")return t.toUpperCase();if(e!=="path")return t;let n=t.startsWith("/")?t:`/${t}`;return n.length>1?n.replace(/\/+$/u,""):n}function Ii(e,t){return e.source.file===t.source.file&&e.source.startLine===t.source.startLine}function me(e){return[...new Map(e.map(t=>[t.id,t])).values()].sort((t,n)=>t.source.file.localeCompare(n.source.file)||t.source.startLine-n.source.startLine||t.action.localeCompare(n.action))}function Te(e){return[...new Set(e)].sort()}function Pi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.normalizedKey.localeCompare(t.normalizedKey)}function wi(e,t){return e.joinRule.localeCompare(t.joinRule)||e.from.localeCompare(t.from)||e.to.localeCompare(t.to)}import Ei from"better-sqlite3";var Oe="scip_query_runtime_boundaries",Y="scip_query_runtime_observations",Ae="scip_query_runtime_relation_groups",De="scip_query_runtime_relation_participants";function Fi(e,t){let n=new Ei(e);try{n.exec(`
|
|
10
|
-
CREATE TABLE IF NOT EXISTS ${Oe} (
|
|
11
|
-
singleton INTEGER PRIMARY KEY CHECK (singleton = 1),
|
|
12
|
-
schema_version INTEGER NOT NULL,
|
|
13
|
-
extractor_version TEXT NOT NULL,
|
|
14
|
-
payload TEXT NOT NULL
|
|
15
|
-
)
|
|
16
|
-
`),_i(n),n.transaction(()=>{n.prepare(`INSERT OR REPLACE INTO ${Oe} (singleton, schema_version, extractor_version, payload) VALUES (1, ?, ?, ?)`).run(t.schemaVersion,t.extractorVersion,JSON.stringify(t)),n.prepare(`DELETE FROM ${Y}`).run(),n.prepare(`DELETE FROM ${De}`).run(),n.prepare(`DELETE FROM ${Ae}`).run();let r=n.prepare(`INSERT INTO ${Y}
|
|
17
|
-
(id, protocol, action, role, strength, source_scope, resolution, file, start_line, end_line, owner_symbol, payload)
|
|
18
|
-
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)`);for(let s of t.observations)r.run(s.id,s.protocol,s.action,s.role,s.strength,s.sourceScope,s.resolution,s.source.file,s.source.startLine,s.source.endLine,s.owner.symbol,JSON.stringify(s));let i=n.prepare(`INSERT INTO ${Ae} (id, protocol, join_rule, normalized_key, payload) VALUES (?, ?, ?, ?, ?)`),a=n.prepare(`INSERT INTO ${De} (group_id, observation_id, participant_role) VALUES (?, ?, ?)`);for(let s of t.relationGroups){i.run(s.id,s.protocol,s.joinRule,s.normalizedKey,JSON.stringify(s));for(let o of s.producerIds)a.run(s.id,o,"producer");for(let o of s.consumerIds)a.run(s.id,o,"consumer");for(let o of s.declarationIds)a.run(s.id,o,"declaration")}})()}finally{n.close()}}function Ti(e,t={}){if(!$i(e,Y))return fn(e)?.observations??[];let n=[],r=[];return ke(n,r,"protocol",t.protocols),ke(n,r,"action",t.actions),ke(n,r,"source_scope",t.sourceScopes),ke(n,r,"file",t.files),e.all(`SELECT payload FROM ${Y}${n.length>0?` WHERE ${n.join(" AND ")}`:""} ORDER BY file, start_line, id`,...r).flatMap(a=>Li(a.payload))}function _i(e){e.exec(`
|
|
19
|
-
CREATE TABLE IF NOT EXISTS ${Y} (
|
|
20
|
-
id TEXT PRIMARY KEY,
|
|
21
|
-
protocol TEXT NOT NULL,
|
|
22
|
-
action TEXT NOT NULL,
|
|
23
|
-
role TEXT NOT NULL,
|
|
24
|
-
strength TEXT NOT NULL,
|
|
25
|
-
source_scope TEXT NOT NULL,
|
|
26
|
-
resolution TEXT NOT NULL,
|
|
27
|
-
file TEXT NOT NULL,
|
|
28
|
-
start_line INTEGER NOT NULL,
|
|
29
|
-
end_line INTEGER NOT NULL,
|
|
30
|
-
owner_symbol TEXT,
|
|
31
|
-
payload TEXT NOT NULL
|
|
32
|
-
);
|
|
33
|
-
CREATE INDEX IF NOT EXISTS idx_runtime_observations_protocol_action_scope
|
|
34
|
-
ON ${Y}(protocol, action, source_scope);
|
|
35
|
-
CREATE INDEX IF NOT EXISTS idx_runtime_observations_file_line
|
|
36
|
-
ON ${Y}(file, start_line);
|
|
37
|
-
|
|
38
|
-
CREATE TABLE IF NOT EXISTS ${Ae} (
|
|
39
|
-
id TEXT PRIMARY KEY,
|
|
40
|
-
protocol TEXT NOT NULL,
|
|
41
|
-
join_rule TEXT NOT NULL,
|
|
42
|
-
normalized_key TEXT NOT NULL,
|
|
43
|
-
payload TEXT NOT NULL
|
|
44
|
-
);
|
|
45
|
-
CREATE INDEX IF NOT EXISTS idx_runtime_groups_protocol_key
|
|
46
|
-
ON ${Ae}(protocol, join_rule, normalized_key);
|
|
47
|
-
|
|
48
|
-
CREATE TABLE IF NOT EXISTS ${De} (
|
|
49
|
-
group_id TEXT NOT NULL,
|
|
50
|
-
observation_id TEXT NOT NULL,
|
|
51
|
-
participant_role TEXT NOT NULL,
|
|
52
|
-
PRIMARY KEY (group_id, observation_id, participant_role)
|
|
53
|
-
);
|
|
54
|
-
CREATE INDEX IF NOT EXISTS idx_runtime_participants_observation
|
|
55
|
-
ON ${De}(observation_id, participant_role);
|
|
56
|
-
`)}function $i(e,t){return!!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",t)}function ke(e,t,n,r){!r||r.length===0||(e.push(`${n} IN (${r.map(()=>"?").join(", ")})`),t.push(...r))}function Li(e){try{return[JSON.parse(e)]}catch{return[]}}function fn(e){if(!e.get("SELECT name FROM sqlite_master WHERE type = 'table' AND name = ?",Oe))return null;let n=e.get(`SELECT schema_version, payload FROM ${Oe} WHERE singleton = 1`);if(!n||n.schema_version!==2)return null;try{let r=JSON.parse(n.payload);return r.schemaVersion===2&&Array.isArray(r.observations)&&Array.isArray(r.relationGroups)&&Array.isArray(r.links)?r:null}catch{return null}}export{Re as a,V as b,Je as c,ce as d,ye as e,Yr as f,Fi as g,Ti as h,fn as i};
|
|
57
|
-
//# sourceMappingURL=chunk-JJP37RGX.js.map
|