scip-query 0.7.1 → 0.8.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/README.md +171 -1132
- package/dist/augment-vue-worker.js +1 -1
- package/dist/{chunk-NSTZMBAB.js → chunk-2EC4JTHC.js} +2 -2
- package/dist/{chunk-ZXFTC5ET.js → chunk-46ILZVMX.js} +2 -2
- package/dist/chunk-4A4JFNWG.js +2 -0
- package/dist/{chunk-GAQGJ52J.js → chunk-4B7YLRXX.js} +2 -2
- package/dist/chunk-64UY7VTR.js +63 -0
- package/dist/chunk-66ORT3LS.js +2 -0
- package/dist/{chunk-QPRIYXH4.js → chunk-6G76D2YM.js} +2 -2
- package/dist/{chunk-VUBQBW7H.js → chunk-6P5W4U6G.js} +2 -2
- package/dist/chunk-6ZFKI5EP.js +40 -0
- package/dist/{chunk-ZNUPGRPR.js → chunk-7I6KNKE3.js} +2 -2
- package/dist/{chunk-23YIGCYF.js → chunk-7TYJD45F.js} +5 -5
- package/dist/chunk-7UZWNW4E.js +2 -0
- package/dist/{chunk-4STLJYHI.js → chunk-AGW2MVIO.js} +2 -2
- package/dist/chunk-APLCSDXL.js +4 -0
- package/dist/chunk-BCFED24F.js +2 -0
- package/dist/chunk-CVRXOP6M.js +3 -0
- package/dist/chunk-D43L5PQF.js +2 -0
- package/dist/chunk-DJTJ3DLZ.js +7 -0
- package/dist/chunk-EAU4RDFG.js +2 -0
- package/dist/{chunk-BI4F6GXI.js → chunk-EKP7XJ6L.js} +2 -2
- package/dist/{chunk-33SSUPCB.js → chunk-EM2PPDN7.js} +2 -2
- package/dist/{chunk-ROOHENEP.js → chunk-FIPE5AQT.js} +2 -2
- package/dist/chunk-FTBT4RP2.js +7 -0
- package/dist/{chunk-WPLKHAH7.js → chunk-GD7XRHSV.js} +2 -2
- package/dist/{chunk-WJQY2LGT.js → chunk-GMEBYEMU.js} +2 -2
- package/dist/chunk-GTZAU7OL.js +2 -0
- package/dist/chunk-HVGNOUYP.js +2 -0
- package/dist/chunk-HVXIXDLV.js +2 -0
- package/dist/{chunk-KJ3ZJIE5.js → chunk-I7OTKWNY.js} +2 -2
- package/dist/{chunk-2JEFS2YJ.js → chunk-JAMU6FLN.js} +2 -2
- package/dist/chunk-JTCEWV7Q.js +2 -0
- package/dist/chunk-K4Z3FCUJ.js +6 -0
- package/dist/{chunk-FD37DBTD.js → chunk-K6YIGVL7.js} +2 -2
- package/dist/chunk-MKE7SEEX.js +2 -0
- package/dist/chunk-N5D5ZCBW.js +7 -0
- package/dist/{chunk-ROZNBWIF.js → chunk-NGLRXEWN.js} +2 -2
- package/dist/{chunk-J6Z5YKGQ.js → chunk-NK7TQQG4.js} +2 -2
- package/dist/chunk-NOVKLH2F.js +2 -0
- package/dist/chunk-OIMM7KMI.js +2 -0
- package/dist/chunk-OQSV6OS2.js +2 -0
- package/dist/chunk-PBGTMPJ7.js +2 -0
- package/dist/{chunk-ARBZM2NF.js → chunk-PCMVXWDC.js} +4 -4
- package/dist/{chunk-U75WH4XG.js → chunk-PE4EJOLN.js} +2 -2
- package/dist/chunk-PLFYFZX3.js +2 -0
- package/dist/{chunk-A2AVLALL.js → chunk-QYQXPPDI.js} +2 -2
- package/dist/{chunk-3OUC276S.js → chunk-RCRK4E7E.js} +2 -2
- package/dist/chunk-RIXOMSOR.js +20 -0
- package/dist/chunk-SB6I6O3P.js +2 -0
- package/dist/{chunk-KNA6Z7JB.js → chunk-SDGCKEB7.js} +2 -2
- package/dist/chunk-SLOIQKY7.js +2 -0
- package/dist/chunk-SOGLYIJ4.js +62 -0
- package/dist/chunk-SSINY7HL.js +4 -0
- package/dist/{chunk-563HLCDW.js → chunk-TFO4OMJZ.js} +2 -2
- package/dist/chunk-TH4JVC34.js +71 -0
- package/dist/chunk-TQTVM27C.js +6 -0
- package/dist/{chunk-LDV2B7ET.js → chunk-TR5AU6A5.js} +2 -2
- package/dist/{chunk-WODJHE6Z.js → chunk-UQE3DSXY.js} +2 -2
- package/dist/{chunk-72JOIFXL.js → chunk-UUDYI3FF.js} +2 -2
- package/dist/chunk-VDZL45XI.js +2 -0
- package/dist/{chunk-QWJBIBE6.js → chunk-VN6B6HFB.js} +2 -2
- package/dist/{chunk-DFK54IRN.js → chunk-WC43FMAB.js} +2 -2
- package/dist/chunk-WEJYUS5O.js +2 -0
- package/dist/chunk-WQFOZIID.js +4 -0
- package/dist/chunk-XBFLIGWU.js +3 -0
- package/dist/chunk-XSZ5NC4O.js +2 -0
- package/dist/{chunk-2IYEIFPP.js → chunk-Z2AJQ7VA.js} +2 -2
- package/dist/chunk-ZIIQ55VK.js +2 -0
- package/dist/chunk-ZJ737ZMD.js +2 -0
- package/dist/cli.js +171 -174
- package/dist/health-C6r2VgpA.d.ts +234 -0
- package/dist/index.d.ts +16 -30
- package/dist/index.js +1 -1
- package/dist/postinstall.js +4 -4
- package/dist/queries/affected.js +1 -1
- package/dist/queries/bottlenecks.js +1 -1
- package/dist/queries/by-kind.js +1 -1
- package/dist/queries/call-graph.js +1 -1
- package/dist/queries/change-surface.js +1 -1
- package/dist/queries/cleanup-plan.d.ts +66 -0
- package/dist/queries/cleanup-plan.js +2 -0
- package/dist/queries/co-change.d.ts +42 -0
- package/dist/queries/co-change.js +2 -0
- package/dist/queries/code.js +1 -1
- package/dist/queries/complexity-hotspots.d.ts +1 -1
- package/dist/queries/complexity-hotspots.js +1 -1
- package/dist/queries/complexity.js +1 -1
- package/dist/queries/convergence.js +1 -1
- package/dist/queries/coupling.js +1 -1
- package/dist/queries/cycles.js +1 -1
- package/dist/queries/dataflow.js +1 -1
- package/dist/queries/dead.js +1 -1
- package/dist/queries/deep-chains.js +1 -1
- package/dist/queries/deps.js +1 -1
- package/dist/queries/diff-gate.d.ts +52 -0
- package/dist/queries/diff-gate.js +2 -0
- package/dist/queries/diff-impact.js +1 -1
- package/dist/queries/doc-drift.d.ts +69 -0
- package/dist/queries/doc-drift.js +2 -0
- package/dist/queries/drift.js +1 -1
- package/dist/queries/extract-candidates.js +1 -1
- package/dist/queries/fan.js +1 -1
- package/dist/queries/health.d.ts +1 -1
- package/dist/queries/health.js +1 -1
- package/dist/queries/hierarchy.js +1 -1
- package/dist/queries/hotspots.js +1 -1
- package/dist/queries/imports.js +1 -1
- package/dist/queries/index.d.ts +38 -2
- package/dist/queries/index.js +1 -1
- package/dist/queries/isolated.js +1 -1
- package/dist/queries/members.js +1 -1
- package/dist/queries/methods.js +1 -1
- package/dist/queries/outline.d.ts +1 -0
- package/dist/queries/outline.js +1 -1
- package/dist/queries/passthrough-candidates.js +1 -1
- package/dist/queries/plan-context.d.ts +65 -0
- package/dist/queries/plan-context.js +2 -0
- package/dist/queries/recent-duplicates.d.ts +48 -0
- package/dist/queries/recent-duplicates.js +2 -0
- package/dist/queries/redundant-reexports.js +1 -1
- package/dist/queries/refs.js +1 -1
- package/dist/queries/self-audit.d.ts +58 -0
- package/dist/queries/self-audit.js +2 -0
- package/dist/queries/similar-chains.js +1 -1
- package/dist/queries/similar-files.d.ts +6 -0
- package/dist/queries/similar-files.js +1 -1
- package/dist/queries/similar-signatures.js +1 -1
- package/dist/queries/similar.js +1 -1
- package/dist/queries/slice.js +1 -1
- package/dist/queries/stale-abstractions.js +1 -1
- package/dist/queries/surface.js +1 -1
- package/dist/queries/symbols.js +1 -1
- package/dist/queries/system.js +1 -1
- package/dist/queries/trace.js +1 -1
- package/dist/queries/unused-params.d.ts +38 -0
- package/dist/queries/unused-params.js +2 -0
- package/dist/queries/wrapper-candidates.js +1 -1
- package/dist/reindex-worker.js +1 -1
- package/dist/reindex.js +16 -16
- package/dist/runtime.d.ts +3 -2
- package/dist/runtime.js +2 -2
- package/package.json +34 -1
- package/skills/concrete-plan/SKILL.md +37 -7
- package/skills/scip-ai-cleanup/SKILL.md +145 -0
- package/skills/scip-debloat/SKILL.md +37 -7
- package/skills/scip-explore/SKILL.md +22 -9
- package/skills/scip-language-playbook/SKILL.md +4 -4
- package/skills/scip-maintainability/SKILL.md +264 -0
- package/skills/scip-verify/SKILL.md +2 -2
- package/dist/chunk-3GNFUVFA.js +0 -2
- package/dist/chunk-5TT47UMX.js +0 -44
- package/dist/chunk-6H2XIIPY.js +0 -71
- package/dist/chunk-7H4RJ4MC.js +0 -2
- package/dist/chunk-7O4MJYIW.js +0 -63
- package/dist/chunk-7OX2O53H.js +0 -62
- package/dist/chunk-BOVNTAKQ.js +0 -3
- package/dist/chunk-CKIO6SVS.js +0 -2
- package/dist/chunk-D6Z67MZL.js +0 -2
- package/dist/chunk-FOQQDXE7.js +0 -2
- package/dist/chunk-IODTPF5H.js +0 -20
- package/dist/chunk-JB4PUN5S.js +0 -40
- package/dist/chunk-JTXKS5GK.js +0 -3
- package/dist/chunk-KJ6CW6EK.js +0 -2
- package/dist/chunk-MDAYGS6T.js +0 -2
- package/dist/chunk-NHDPYW7O.js +0 -2
- package/dist/chunk-NKJKI6SE.js +0 -2
- package/dist/chunk-NYEMZHUC.js +0 -6
- package/dist/chunk-OHEIZWIA.js +0 -4
- package/dist/chunk-QAEDNTY7.js +0 -2
- package/dist/chunk-QE6MGGUY.js +0 -2
- package/dist/chunk-RCJEFQOK.js +0 -4
- package/dist/chunk-TGK5DFBJ.js +0 -2
- package/dist/chunk-TRNAQABL.js +0 -7
- package/dist/chunk-V53J46BX.js +0 -2
- package/dist/chunk-XO6R3X5J.js +0 -2
- package/dist/chunk-YSZNAG4G.js +0 -2
- package/dist/health-x7B4Xu_6.d.ts +0 -119
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { S as ScipDatabase } from '../db-DdTPetj5.js';
|
|
2
|
+
import 'better-sqlite3';
|
|
3
|
+
import '../config-types-CGIeLEpY.js';
|
|
4
|
+
|
|
5
|
+
interface UnusedParamsFinding {
|
|
6
|
+
symbol: string;
|
|
7
|
+
shortName: string;
|
|
8
|
+
file: string;
|
|
9
|
+
startLine: number;
|
|
10
|
+
endLine: number;
|
|
11
|
+
paramCount: number;
|
|
12
|
+
/** Trailing parameters never referenced in the body, in declaration order. */
|
|
13
|
+
unusedTrailing: string[];
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Speculative generality: trailing parameters nobody uses — a signature AI
|
|
17
|
+
* move (options and hooks added "for later" that never came).
|
|
18
|
+
*
|
|
19
|
+
* Deliberately conservative, TS/JS only:
|
|
20
|
+
* - TRAILING runs only — removing a trailing parameter is type-safe under
|
|
21
|
+
* TypeScript's function variance; removing a mid-list one breaks the
|
|
22
|
+
* positional contract. (Rust is excluded: call sites break, and rustc
|
|
23
|
+
* already warns there.)
|
|
24
|
+
* - `_`-prefixed names are declared-intentional and skipped.
|
|
25
|
+
* - Functions with pattern/rest parameters are skipped entirely.
|
|
26
|
+
* - One-line bodies are skipped (line-granular usage can't tell a use from
|
|
27
|
+
* the declaration itself).
|
|
28
|
+
* - Externally-live (package surface / entryRoots) symbols are skipped —
|
|
29
|
+
* their signatures are API.
|
|
30
|
+
*/
|
|
31
|
+
declare function unusedParams(db: ScipDatabase, opts?: {
|
|
32
|
+
scope?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
scanLimit?: number;
|
|
35
|
+
files?: readonly string[];
|
|
36
|
+
}): UnusedParamsFinding[];
|
|
37
|
+
|
|
38
|
+
export { type UnusedParamsFinding, unusedParams };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{a}from"../chunk-HVGNOUYP.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as unusedParams};
|
|
2
|
+
//# sourceMappingURL=unused-params.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a}from"../chunk-
|
|
1
|
+
import{a}from"../chunk-DJTJ3DLZ.js";import"../chunk-CVRXOP6M.js";import"../chunk-V76FCF5F.js";import"../chunk-MX6F756F.js";import"../chunk-NOVKLH2F.js";import"../chunk-TQTVM27C.js";import"../chunk-RIXOMSOR.js";import"../chunk-EAU4RDFG.js";import"../chunk-PCMVXWDC.js";import"../chunk-6ZFKI5EP.js";import"../chunk-64UY7VTR.js";import"../chunk-7I6KNKE3.js";import"../chunk-APLCSDXL.js";import"../chunk-WEJYUS5O.js";import"../chunk-PBGTMPJ7.js";import"../chunk-SOGLYIJ4.js";import"../chunk-WQFOZIID.js";import"../chunk-NN3O7TPH.js";import"../chunk-VDZL45XI.js";export{a as wrapperCandidates};
|
|
2
2
|
//# sourceMappingURL=wrapper-candidates.js.map
|
package/dist/reindex-worker.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as P,b as N}from"./chunk-
|
|
1
|
+
import{a as P,b as N}from"./chunk-TH4JVC34.js";import{a as m,e as M}from"./chunk-LWYIGRHR.js";import{execFileSync as ln}from"child_process";import{closeSync as pn,existsSync as E,mkdirSync as ie,mkdtempSync as cn,openSync as gn,readFileSync as dn,renameSync as $,rmSync as B,writeFileSync as ae}from"fs";import{basename as S,dirname as d,extname as mn,join as g}from"path";import{execFileSync as ge}from"child_process";import{existsSync as de,readdirSync as A}from"fs";import{extname as _,join as T}from"path";var me=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),fe=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function U(e){let n=[],t=he(e),r=Se(e);for(let i of fe){if(xe(e,i.files)){n.push(i.language);continue}if(ye(t,i.globs)){n.push(i.language);continue}ve(r,i.extensions)&&n.push(i.language)}return n.includes("typescript")&&F(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&F(n,"c"),n}function he(e){try{return A(e)}catch{return[]}}function xe(e,n){return n?.length?n.some(t=>de(T(e,t))):!1}function ye(e,n){return n?.length?e.some(t=>n.some(r=>be(t,r))):!1}function be(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function Se(e){let n=Pe(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let a;try{a=A(i,{withFileTypes:!0})}catch{continue}for(let s of a){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let o=T(i,s.name);if(s.isDirectory()){me.has(s.name)||r.push(o);continue}let c=_(s.name).toLowerCase();c&&t.add(c)}}return t}function Pe(e){try{let n=ge("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
|
|
2
2
|
`)){if(!r)continue;let i=_(r).toLowerCase();i&&t.add(i)}return t}catch{return null}}function ve(e,n){return n?.length?n.some(t=>e.has(t)):!1}function F(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as W,readdirSync as Ie}from"fs";import{join as v}from"path";var ke={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",q(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=v(e,"vendor","bin","scip-php"),r=v(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",W(r)?r:W(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function z(e){return ke[e]}function q(e,n){let t;try{t=Ie(e)}catch{return null}for(let r of t)if(n.some(i=>r.endsWith(i)))return v(e,r);return null}import{readFileSync as Re,writeFileSync as De}from"fs";import{create as I}from"@bufbuild/protobuf";import{deserializeSCIP as Ce,serializeSCIP as je,DocumentSchema as Oe,IndexSchema as Le,SymbolInformationSchema as we}from"@c4312/scip";function Ee(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=$e(e),t=Be(e.flatMap(i=>i.documents??[])),r=G(e.flatMap(i=>i.externalSymbols??[]));return I(Le,{metadata:n,documents:t,externalSymbols:r})}function J(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(i=>Ce(Re(i))),r=Ee(t);return De(n,Buffer.from(je(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function $e(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(t&&i&&i!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${i}`)}return n}function Be(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,I(Oe,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:G([...r.symbols,...t.symbols]),text:Ne(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function G(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,I(we,{symbol:r.symbol,documentation:Fe([...r.documentation,...t.documentation]),relationships:Me([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Me(e){let n=new Set,t=[];for(let r of e){let i=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(i)||(n.add(i),t.push(r))}return t}function Ne(e,n){return e?n?e.length>=n.length?e:n:e:n}function Fe(e){return[...new Set(e)]}import{readFileSync as Ae,writeFileSync as _e}from"fs";import{create as H}from"@bufbuild/protobuf";import{deserializeSCIP as Te,DocumentSchema as Ue,IndexSchema as We,serializeSCIP as qe,SymbolRole as ze}from"@c4312/scip";function X(e){let n;try{n=Te(Ae(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=Je(n);return t.removedDefinitionOccurrences>0&&_e(e,Buffer.from(qe(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function Je(e){let n=new Set;for(let a of e.documents)for(let s of a.symbols)s.symbol&&n.add(s.symbol);for(let a of e.externalSymbols)a.symbol&&n.add(a.symbol);let t=0,r=0,i=[];for(let a of e.documents){let s=a.occurrences.filter(o=>(o.symbolRoles&ze.Definition)===0||n.has(o.symbol)?!0:(t+=1,!1));if(s.length===a.occurrences.length){i.push(a);continue}r+=1,i.push(H(Ue,{language:a.language,relativePath:a.relativePath,occurrences:s,symbols:a.symbols,text:a.text,positionEncoding:a.positionEncoding}))}return{index:t===0?e:H(We,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as Ge}from"child_process";import{existsSync as h,renameSync as R,rmSync as D}from"fs";import{cpus as He}from"os";import{join as Q}from"path";function Xe(e,n,t){if(!e.defaultOutputPath)return;let r=Q(n,e.defaultOutputPath);t!==r&&h(r)&&R(r,t)}function Qe(e,n,t){if(!e.defaultOutputPath)return null;let r=Q(n,e.defaultOutputPath);if(r===t)return null;let i=`${t}.default-output-backup`;return D(i,{force:!0}),h(r)?(R(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Ke(e){e&&(D(e.defaultOutputPath,{force:!0}),e.backupPath&&h(e.backupPath)&&R(e.backupPath,e.defaultOutputPath))}function Ve(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,He().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function K(e,n,t,r){let i=e.filter(u=>u.config.defaultOutputPath),a=e.filter(u=>!u.config.defaultOutputPath),s=[],o=Ve(a.length,r),c=await Ze(a,o,u=>k(u,n,t));if(o>1){let u=new Map;for(let p of c.filter(l=>l.skipped)){let l=a.find(f=>f.language===p.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),u.set(l.language,await k(l,n,t)))}s.push(...c.map(p=>u.get(p.language)??p))}else s.push(...c);for(let u of i)s.push(await k(u,n,t));return s.sort((u,p)=>e.findIndex(l=>l.language===u.language)-e.findIndex(l=>l.language===p.language))}async function k(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),D(e.scipPath,{force:!0});let r=Qe(e.config,n,e.scipPath);try{await Ye(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Xe(e.config,n,e.scipPath)}catch(i){let a=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${a.split(`
|
|
3
3
|
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Ke(r)}if(!h(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${i}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:i}}}return{language:e.language,scipPath:e.scipPath}}function Ye(e,n,t){return new Promise((r,i)=>{Ge(e,[...n],t,a=>{a?i(a):r()})})}async function Ze(e,n,t){if(e.length===0)return[];let r=new Array(e.length),i=0,a=Math.max(1,Math.min(e.length,n)),s=Array.from({length:a},async()=>{for(;i<e.length;){let o=i++;r[o]=await t(e[o])}});return await Promise.all(s),r}import{execFileSync as j}from"child_process";import{existsSync as C,readFileSync as en}from"fs";import{createRequire as nn}from"module";import{platform as tn}from"os";import{dirname as V,join as x}from"path";var rn=nn(import.meta.url);function O(e){return[e.indexerBinary,...e.binaryAliases??[]]}function L(e){let n=O(e);return n.length===1?n[0]:n.join(" or ")}function y(e){for(let n of O(e))if(m(n))return n;return sn(e)}function Y(e){return y(e)!==null||an(e)}function an(e){return Z(e)!==null}function sn(e){let n=Z(e);if(!n)return null;let r=JSON.parse(en(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return x(V(n),r);for(let i of O(e)){let a=r[i];if(a)return x(V(n),a)}return null}function Z(e){if(!e.bundledNpmPackage)return null;try{return rn.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function ee(e,n){for(let t of e.projectLocalBinaries??[]){let r=x(n,t);if(C(r))return r}return null}function ne(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||re(t,n))return n;let r=on(t,n);return r?{...n,DOTNET_ROOT:r}:n}function te(e,n){let t=e.installMethods,r=L(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let i of t)if(m(i.prerequisite)){n(`Installing ${r} via ${i.label}...`);try{j(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let a=y(e);if(a){let s=a===e.indexerBinary?"":` (using ${a})`;return n(`Successfully installed ${r} via ${i.label}${s}`),!0}n(`${i.label} command completed but ${r} was not found on PATH`)}catch(a){let s=a instanceof Error?a.message:String(a);n(`${i.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function on(e,n){for(let t of un(n))if(re(e,{...n,DOTNET_ROOT:t}))return t;return null}function un(e){let n=[],t=e.DOTNET_ROOT;if(t&&C(t)&&n.push(t),tn()==="darwin"&&m("brew"))try{let r=j("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=x(r,"libexec");C(i)&&!n.includes(i)&&n.push(i)}catch{}return n}function re(e,n){try{return j(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}async function se(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,a=fn(e),s=Date.now();ie(d(a.outputScip),{recursive:!0}),ie(d(a.outputDb),{recursive:!0});let o=e.languages??U(n);if(o.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${o.join(", ")}`);let c=wn(n,o,{pnpmWorkspaces:e.pnpmWorkspaces}),u=On(g(d(a.outputDb),"index.lock")),p=null;try{let l=hn({opts:e,paths:a,languages:o,fingerprint:c,start:s,onStatus:r});if(l)return l;Pn(i,r);let f=xn(a);return p=f.runDir,await yn({opts:e,languages:o,projectRoot:n,paths:a,tempPaths:f,fingerprint:c,start:s,maxHeapMb:t,skipAutoInstall:i,onStatus:r})}finally{p&&B(p,{recursive:!0,force:!0}),u()}}function fn(e){let n=e.outputScip??g(e.projectRoot,"index.scip"),t=e.outputDb??g(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:g(d(t),"meta.json")}}function hn(e){if(e.opts.skipIfUnchanged===!1||!E(e.paths.outputScip)||!E(e.paths.outputDb)||!En(e.paths.metaPath,e.fingerprint))return null;P({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function xn(e){let n=cn(g(d(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:g(n,S(e.outputScip)),tempOutputDb:g(n,S(e.outputDb)),tempMetaPath:g(n,S(e.metaPath))}}async function yn(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r}=await bn(e,n);Sn(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(a=>a.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function bn(e,n){let{preparedRuns:t,skippedLanguages:r}=vn({languages:e.languages,tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),i=await K(t,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:a}=kn(i,r);return Rn(a,r,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:a,skippedLanguages:r}}function Sn(e,n,t,r){Dn(t,e.tempPaths.tempOutputScip,e.onStatus),Cn(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),P({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),$n(e.tempPaths.tempMetaPath,{version:2,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,requestedLanguages:e.languages,indexedLanguages:t.map(i=>i.language),skipped:[...r]}),Ln({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function Pn(e,n){if(!m("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
|
|
4
4
|
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!M(n))throw new Error(`The scip CLI is required but could not be installed.
|
package/dist/reindex.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{a as
|
|
1
|
+
import{a as f,e as L}from"./chunk-LWYIGRHR.js";import{a as Z}from"./chunk-TKDJQ2WD.js";import{a as Y,b as Q}from"./chunk-PBGTMPJ7.js";import"./chunk-NN3O7TPH.js";import"./chunk-VDZL45XI.js";import{execFileSync as nr}from"child_process";import{closeSync as tr,existsSync as q,mkdirSync as $e,mkdtempSync as rr,openSync as ir,readFileSync as or,renameSync as K,rmSync as X,writeFileSync as Be}from"fs";import{basename as C,dirname as b,extname as sr,join as m}from"path";import We from"better-sqlite3";import{execFileSync as He}from"child_process";import{existsSync as Je,readdirSync as ze,readFileSync as Ge}from"fs";import{extname as S,join as ee}from"path";function y(e){let n=new Set((e.extensions??Y).map(o=>o.toLowerCase()));if(n.size===0)return{scanned:0,inserted:0,existing:0};if(!Je(e.dbPath))throw new Error(`SCIP SQLite database not found at ${e.dbPath}`);let t=Z(e.projectRoot),r=qe(e.projectRoot,n).filter(o=>!t.isIgnored(o)),i=new We(e.dbPath);try{let o=Xe(i,r),s=i.prepare(`INSERT OR IGNORE INTO documents (language, relative_path, position_encoding, text)
|
|
2
2
|
VALUES (?, ?, NULL, ?)`),u=i.transaction(g=>{let l=0;for(let p of g){if(o.has(p))continue;let d=Ge(ee(e.projectRoot,p),"utf-8"),Ue=s.run(Ye(p),p,d);l+=Number(Ue.changes)}return l})(r),c={scanned:r.length,inserted:u,existing:r.length-u};return e.onStatus?.(`Augmented SQLite documents with ${u} auxiliary source file${u===1?"":"s"} (${c.existing} already present).`),c}finally{i.close()}}function qe(e,n){let t=Ke(e,n);if(t)return t;let r=[],i=o=>{let s=o?ee(e,o):e,a;try{a=ze(s,{withFileTypes:!0})}catch{return}for(let u of a){if(Q.has(u.name))continue;let c=o?`${o}/${u.name}`:u.name;if(u.isDirectory()){i(c);continue}n.has(S(u.name).toLowerCase())&&r.push(c)}};return i(""),r.sort()}function Ke(e,n){try{return He("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}).split(`
|
|
3
|
-
`).filter(r=>r&&n.has(S(r).toLowerCase())).sort()}catch{return null}}function Xe(e,n){let t=new Set,r=500;for(let i=0;i<n.length;i+=r){let o=n.slice(i,i+r),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)t.add(a.relative_path)}return t}function Ye(e){return S(e).toLowerCase()===".vue"?"vue":S(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as Qe}from"child_process";import{existsSync as Ze,readdirSync as te}from"fs";import{extname as re,join as ie}from"path";var en=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),nn=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function
|
|
4
|
-
`)){if(!r)continue;let i=re(r).toLowerCase();i&&t.add(i)}return t}catch{return null}}function cn(e,n){return n?.length?n.some(t=>e.has(t)):!1}function ne(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as oe,readdirSync as ln}from"fs";import{join as O}from"path";var ae={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",se(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",se(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=O(e,"vendor","bin","scip-php"),r=O(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",oe(r)?r:oe(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return ae[e]}function se(e,n){let t;try{t=ln(e)}catch{return null}for(let r of t)if(n.some(i=>r.endsWith(i)))return O(e,r);return null}import{readFileSync as gn,writeFileSync as pn}from"fs";import{create as
|
|
5
|
-
`).filter(Boolean)}catch{return null}}function On(e){let n=[],t=[""];for(;t.length>0;){let r=t.pop(),i=r?le(e,r):e,o;try{o=Pn(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){ge(a)||t.push(a);continue}n.push(a)}}return n}function ge(e){return e.split("/").some(t=>Dn.has(t))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Dn=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);import{readFileSync as
|
|
6
|
-
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Wn(r)}if(!
|
|
3
|
+
`).filter(r=>r&&n.has(S(r).toLowerCase())).sort()}catch{return null}}function Xe(e,n){let t=new Set,r=500;for(let i=0;i<n.length;i+=r){let o=n.slice(i,i+r),s=e.prepare(`SELECT relative_path FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)t.add(a.relative_path)}return t}function Ye(e){return S(e).toLowerCase()===".vue"?"vue":S(e).replace(/^\./,"").toLowerCase()||"source"}import{execFileSync as Qe}from"child_process";import{existsSync as Ze,readdirSync as te}from"fs";import{extname as re,join as ie}from"path";var en=new Set([".git",".hg",".svn",".idea",".vscode","node_modules","vendor","dist","build","target","bin","obj",".dart_tool",".gradle",".next",".venv","venv","__pycache__"]),nn=[{language:"typescript",files:["tsconfig.json","tsconfig.base.json"],extensions:[".ts",".tsx",".mts",".cts"]},{language:"rust",files:["Cargo.toml"],extensions:[".rs"]},{language:"go",files:["go.mod"],extensions:[".go"]},{language:"java",files:["pom.xml","build.gradle","build.gradle.kts"],extensions:[".java"]},{language:"kotlin",files:["build.gradle.kts"],extensions:[".kt",".kts"]},{language:"scala",files:["build.sbt"],extensions:[".scala"]},{language:"python",files:["pyproject.toml","setup.py","setup.cfg","Pipfile"],extensions:[".py",".pyi"]},{language:"ruby",files:["Gemfile"],extensions:[".rb"]},{language:"cpp",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".cc",".cpp",".cxx",".hpp",".hh",".hxx"]},{language:"c",files:["compile_commands.json","CMakeLists.txt","Makefile"],extensions:[".c",".h"]},{language:"csharp",globs:["*.csproj","*.sln"],extensions:[".cs"]},{language:"vb",globs:["*.vbproj"],extensions:[".vb"]},{language:"dart",files:["pubspec.yaml"],extensions:[".dart"]},{language:"php",files:["composer.json"],extensions:[".php"]},{language:"javascript",files:["package.json"],extensions:[".js",".jsx",".mjs",".cjs"]}];function w(e){let n=[],t=tn(e),r=an(e);for(let i of nn){if(rn(e,i.files)){n.push(i.language);continue}if(on(t,i.globs)){n.push(i.language);continue}cn(r,i.extensions)&&n.push(i.language)}return n.includes("typescript")&&ne(n,"javascript"),n.includes("cpp")&&!r.has(".c")&&ne(n,"c"),n}function tn(e){try{return te(e)}catch{return[]}}function rn(e,n){return n?.length?n.some(t=>Ze(ie(e,t))):!1}function on(e,n){return n?.length?e.some(t=>n.some(r=>sn(t,r))):!1}function sn(e,n){if(n==="*")return!0;if(!n.includes("*"))return e===n;let[t,r]=n.split("*");return e.startsWith(t??"")&&e.endsWith(r??"")}function an(e){let n=un(e);if(n)return n;let t=new Set,r=[e];for(;r.length>0;){let i=r.pop();if(!i)continue;let o;try{o=te(i,{withFileTypes:!0})}catch{continue}for(let s of o){if(s.name.startsWith(".")&&!s.name.endsWith("proj")&&!s.name.endsWith("sln")&&s.isDirectory())continue;let a=ie(i,s.name);if(s.isDirectory()){en.has(s.name)||r.push(a);continue}let u=re(s.name).toLowerCase();u&&t.add(u)}}return t}function un(e){try{let n=Qe("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:26214400,stdio:["ignore","pipe","ignore"]}),t=new Set;for(let r of n.split(`
|
|
4
|
+
`)){if(!r)continue;let i=re(r).toLowerCase();i&&t.add(i)}return t}catch{return null}}function cn(e,n){return n?.length?n.some(t=>e.has(t)):!1}function ne(e,n){let t=e.indexOf(n);t!==-1&&e.splice(t,1)}import{existsSync as oe,readdirSync as ln}from"fs";import{join as O}from"path";var ae={typescript:{language:"typescript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,pnpmWorkspaces:n,indexerBinary:t})=>{let r=["index","--infer-tsconfig","--output",e,"--no-progress-bar"];return n&&r.splice(1,0,"--pnpm-workspaces"),{binary:t,args:r}},markerFiles:["tsconfig.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},javascript:{language:"javascript",indexerBinary:"scip-typescript",checkCommand:"npx scip-typescript --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--infer-tsconfig","--output",e,"--no-progress-bar"]}),markerFiles:["package.json"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","@sourcegraph/scip-typescript"]}],installUrl:"https://github.com/sourcegraph/scip-typescript",bundledNpmPackage:"@sourcegraph/scip-typescript"},java:{language:"java",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["pom.xml","build.gradle"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},scala:{language:"scala",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.sbt"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},kotlin:{language:"kotlin",indexerBinary:"scip-java",checkCommand:"scip-java --version",indexArgs:({outputPath:e})=>({binary:"scip-java",args:["index","--output",e]}),markerFiles:["build.gradle.kts"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-java/releases"},rust:{language:"rust",indexerBinary:"rust-analyzer",checkCommand:"rust-analyzer --version",indexArgs:({outputPath:e})=>({binary:"rust-analyzer",args:["scip",".","--output",e]}),markerFiles:["Cargo.toml"],installMethods:[{label:"rustup",prerequisite:"rustup",binary:"rustup",args:["component","add","rust-analyzer"]}],installUrl:"https://github.com/rust-lang/rust-analyzer"},python:{language:"python",indexerBinary:"scip-python-plus",binaryAliases:["scip-python"],checkCommand:"scip-python-plus --version",indexArgs:({outputPath:e,indexerBinary:n})=>({binary:n,args:["index","--output",e,"--project-name","project"]}),markerFiles:["pyproject.toml","setup.py"],installMethods:[{label:"npm",prerequisite:"npm",binary:"npm",args:["install","-g","scip-python-plus"]}],installUrl:"https://github.com/PlunderStruck/scip-python",bundledNpmPackage:"scip-python-plus"},ruby:{language:"ruby",indexerBinary:"scip-ruby",checkCommand:"scip-ruby --version",indexArgs:({indexerBinary:e})=>({binary:e,args:["--dir","."]}),defaultOutputPath:"index.scip",markerFiles:["Gemfile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-ruby/releases"},go:{language:"go",indexerBinary:"scip-go",checkCommand:"scip-go --version",indexArgs:({outputPath:e})=>({binary:"scip-go",args:["--output",e]}),markerFiles:["go.mod"],installMethods:[{label:"go install",prerequisite:"go",binary:"go",args:["install","github.com/sourcegraph/scip-go@latest"]}],installUrl:"https://github.com/sourcegraph/scip-go"},cpp:{language:"cpp",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},c:{language:"c",indexerBinary:"scip-clang",checkCommand:"scip-clang --version",indexArgs:({outputPath:e})=>({binary:"scip-clang",args:["--compdb-path","compile_commands.json","--index-output-path",e]}),markerFiles:["CMakeLists.txt","Makefile"],installMethods:[],installUrl:"https://github.com/sourcegraph/scip-clang/releases"},csharp:{language:"csharp",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",se(e,[".sln",".csproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.csproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},vb:{language:"vb",indexerBinary:"scip-dotnet",checkCommand:"scip-dotnet --version",indexArgs:({projectRoot:e,outputPath:n})=>({binary:"scip-dotnet",args:["index",se(e,[".sln",".vbproj"])??e,"--output",n,"--working-directory",e]}),markerFiles:["*.vbproj","*.sln"],installMethods:[{label:"dotnet",prerequisite:"dotnet",binary:"dotnet",args:["tool","install","--global","scip-dotnet"]}],installUrl:"https://github.com/sourcegraph/scip-dotnet/releases"},dart:{language:"dart",indexerBinary:"scip-dart",checkCommand:"scip-dart --version",indexArgs:({indexerBinary:e,outputPath:n})=>({binary:e,args:["--output",n]}),markerFiles:["pubspec.yaml"],installMethods:[{label:"dart pub",prerequisite:"dart",binary:"dart",args:["pub","global","activate","scip_dart"]}],installUrl:"https://github.com/Workiva/scip-dart/releases"},php:{language:"php",indexerBinary:"scip-php",projectLocalBinaries:["vendor/davidrjenni/scip-php/bin/scip-php","vendor/bin/scip-php"],checkCommand:"scip-php --version",indexArgs:({projectRoot:e,indexerBinary:n})=>{let t=O(e,"vendor","bin","scip-php"),r=O(e,"vendor","davidrjenni","scip-php","bin","scip-php");return{binary:"php",args:["-d","error_reporting=E_ALL & ~E_DEPRECATED & ~E_USER_DEPRECATED",oe(r)?r:oe(t)?t:n]}},defaultOutputPath:"index.scip",markerFiles:["composer.json"],installMethods:[],installUrl:"https://github.com/davidrjenni/scip-php/releases"}};function D(e){return ae[e]}function se(e,n){let t;try{t=ln(e)}catch{return null}for(let r of t)if(n.some(i=>r.endsWith(i)))return O(e,r);return null}import{readFileSync as gn,writeFileSync as pn}from"fs";import{create as V}from"@bufbuild/protobuf";import{deserializeSCIP as dn,serializeSCIP as mn,DocumentSchema as fn,IndexSchema as hn,SymbolInformationSchema as bn}from"@c4312/scip";function ue(e){if(e.length===0)throw new Error("Cannot merge zero SCIP indexes");if(e.length===1)return e[0];let n=yn(e),t=xn(e.flatMap(i=>i.documents??[])),r=ce(e.flatMap(i=>i.externalSymbols??[]));return V(hn,{metadata:n,documents:t,externalSymbols:r})}function T(e,n){if(e.length===0)throw new Error("Cannot merge zero SCIP files");let t=e.map(i=>dn(gn(i))),r=ue(t);return pn(n,Buffer.from(mn(r))),{documentCount:r.documents.length,externalSymbolCount:r.externalSymbols.length,inputCount:e.length}}function yn(e){let n=e[0]?.metadata;if(!n)return;let t=n.projectRoot;for(let r of e.slice(1)){let i=r.metadata?.projectRoot;if(t&&i&&i!==t)throw new Error(`Cannot merge SCIP indexes with different project roots: ${t} vs ${i}`)}return n}function xn(e){let n=new Map;for(let t of e){let r=n.get(t.relativePath);if(!r){n.set(t.relativePath,t);continue}n.set(t.relativePath,V(fn,{language:r.language||t.language,relativePath:r.relativePath||t.relativePath,occurrences:[...r.occurrences,...t.occurrences],symbols:ce([...r.symbols,...t.symbols]),text:Rn(r.text,t.text),positionEncoding:r.positionEncoding||t.positionEncoding}))}return[...n.values()]}function ce(e){let n=new Map;for(let t of e){let r=n.get(t.symbol);if(!r){n.set(t.symbol,t);continue}n.set(t.symbol,V(bn,{symbol:r.symbol,documentation:vn([...r.documentation,...t.documentation]),relationships:Sn([...r.relationships,...t.relationships]),kind:r.kind||t.kind,displayName:r.displayName||t.displayName,enclosingSymbol:r.enclosingSymbol||t.enclosingSymbol,signatureDocumentation:r.signatureDocumentation??t.signatureDocumentation}))}return[...n.values()]}function Sn(e){let n=new Set,t=[];for(let r of e){let i=[r.symbol,r.isReference?"1":"0",r.isImplementation?"1":"0",r.isTypeDefinition?"1":"0",r.isDefinition?"1":"0"].join("|");n.has(i)||(n.add(i),t.push(r))}return t}function Rn(e,n){return e?n?e.length>=n.length?e:n:e:n}function vn(e){return[...new Set(e)]}import{execFileSync as kn}from"child_process";import{createHash as In}from"crypto";import{readdirSync as Pn,readFileSync as Cn}from"fs";import{join as le}from"path";function Ln(e){return(wn(e)??On(e)).filter(n=>n&&!ge(n)).sort()}function R(e){return Ln(e).map(n=>{let t=le(e,n);try{let r=Cn(t);return{path:n,size:r.byteLength,hash:In("sha256").update(r).digest("hex")}}catch{return{path:n,size:-1,hash:"unreadable"}}})}function wn(e){try{return kn("git",["-C",e,"ls-files","-co","--exclude-standard","--","."],{encoding:"utf-8",maxBuffer:50*1024*1024,stdio:["ignore","pipe","ignore"]}).split(`
|
|
5
|
+
`).filter(Boolean)}catch{return null}}function On(e){let n=[],t=[""];for(;t.length>0;){let r=t.pop(),i=r?le(e,r):e,o;try{o=Pn(i,{withFileTypes:!0})}catch{continue}for(let s of o){let a=r?`${r}/${s.name}`:s.name;if(s.isDirectory()){ge(a)||t.push(a);continue}n.push(a)}}return n}function ge(e){return e.split("/").some(t=>Dn.has(t))||e.endsWith(".db")||e.endsWith(".db-wal")||e.endsWith(".db-shm")||e.endsWith(".scip")}var Dn=new Set([".git","node_modules",".scipquery-cache",".stryker-tmp","dist","build","coverage",".next",".nuxt","target"]);import{readFileSync as Vn,writeFileSync as Tn}from"fs";import{create as pe}from"@bufbuild/protobuf";import{deserializeSCIP as Fn,DocumentSchema as En,IndexSchema as jn,serializeSCIP as Mn,SymbolRole as Nn}from"@c4312/scip";function de(e){let n;try{n=Fn(Vn(e))}catch{return{removedDefinitionOccurrences:0,touchedDocuments:0}}let t=An(n);return t.removedDefinitionOccurrences>0&&Tn(e,Buffer.from(Mn(t.index))),{removedDefinitionOccurrences:t.removedDefinitionOccurrences,touchedDocuments:t.touchedDocuments}}function An(e){let n=new Set;for(let o of e.documents)for(let s of o.symbols)s.symbol&&n.add(s.symbol);for(let o of e.externalSymbols)o.symbol&&n.add(o.symbol);let t=0,r=0,i=[];for(let o of e.documents){let s=o.occurrences.filter(a=>(a.symbolRoles&Nn.Definition)===0||n.has(a.symbol)?!0:(t+=1,!1));if(s.length===o.occurrences.length){i.push(o);continue}r+=1,i.push(pe(En,{language:o.language,relativePath:o.relativePath,occurrences:s,symbols:o.symbols,text:o.text,positionEncoding:o.positionEncoding}))}return{index:t===0?e:pe(jn,{metadata:e.metadata,documents:i,externalSymbols:e.externalSymbols}),removedDefinitionOccurrences:t,touchedDocuments:r}}import{execFile as _n}from"child_process";import{existsSync as v,renameSync as E,rmSync as j}from"fs";import{cpus as $n}from"os";import{join as me}from"path";function Bn(e,n,t){if(!e.defaultOutputPath)return;let r=me(n,e.defaultOutputPath);t!==r&&v(r)&&E(r,t)}function Un(e,n,t){if(!e.defaultOutputPath)return null;let r=me(n,e.defaultOutputPath);if(r===t)return null;let i=`${t}.default-output-backup`;return j(i,{force:!0}),v(r)?(E(r,i),{defaultOutputPath:r,backupPath:i}):{defaultOutputPath:r,backupPath:null}}function Wn(e){e&&(j(e.defaultOutputPath,{force:!0}),e.backupPath&&v(e.backupPath)&&E(e.backupPath,e.defaultOutputPath))}function Hn(e,n){if(e<=1)return 1;let t=Number(process.env.SCIP_QUERY_INDEXER_CONCURRENCY??0),r=Number.isFinite(n)&&n&&n>0?n:Number.isFinite(t)&&t>0?t:Math.min(2,Math.max(1,$n().length-1));return Math.max(1,Math.min(e,Math.floor(r)))}async function fe(e,n,t,r){let i=e.filter(c=>c.config.defaultOutputPath),o=e.filter(c=>!c.config.defaultOutputPath),s=[],a=Hn(o.length,r),u=await zn(o,a,c=>F(c,n,t));if(a>1){let c=new Map;for(let g of u.filter(l=>l.skipped)){let l=o.find(p=>p.language===g.language);l&&(t(`Retrying ${l.language} indexer serially after parallel failure...`),c.set(l.language,await F(l,n,t)))}s.push(...u.map(g=>c.get(g.language)??g))}else s.push(...u);for(let c of i)s.push(await F(c,n,t));return s.sort((c,g)=>e.findIndex(l=>l.language===c.language)-e.findIndex(l=>l.language===g.language))}async function F(e,n,t){t(`Indexing ${e.language} with ${e.resolvedBinary}...`),j(e.scipPath,{force:!0});let r=Un(e.config,n,e.scipPath);try{await Jn(e.binary,e.args,{cwd:n,env:e.env,maxBuffer:50*1024*1024}),Bn(e.config,n,e.scipPath)}catch(i){let o=i instanceof Error?i.message:String(i),s=`${e.resolvedBinary} indexer failed: ${o.split(`
|
|
6
|
+
`)[0]}`;return t(`Skipping ${e.language}: ${s}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:s}}}finally{Wn(r)}if(!v(e.scipPath)){let i=`${e.resolvedBinary} indexer completed but did not produce ${e.scipPath}`;return t(`Skipping ${e.language}: ${i}`),{language:e.language,scipPath:e.scipPath,skipped:{language:e.language,reason:i}}}return{language:e.language,scipPath:e.scipPath}}function Jn(e,n,t){return new Promise((r,i)=>{_n(e,[...n],t,o=>{o?i(o):r()})})}async function zn(e,n,t){if(e.length===0)return[];let r=new Array(e.length),i=0,o=Math.max(1,Math.min(e.length,n)),s=Array.from({length:o},async()=>{for(;i<e.length;){let a=i++;r[a]=await t(e[a])}});return await Promise.all(s),r}import{execFileSync as N}from"child_process";import{existsSync as M,readFileSync as Gn}from"fs";import{createRequire as qn}from"module";import{platform as Kn}from"os";import{dirname as he,join as k}from"path";var Xn=qn(import.meta.url);function A(e){return[e.indexerBinary,...e.binaryAliases??[]]}function I(e){let n=A(e);return n.length===1?n[0]:n.join(" or ")}function x(e){for(let n of A(e))if(f(n))return n;return Qn(e)}function _(e){return x(e)!==null||Yn(e)}function Yn(e){return be(e)!==null}function Qn(e){let n=be(e);if(!n)return null;let r=JSON.parse(Gn(n,"utf8")).bin;if(!r)return null;if(typeof r=="string")return k(he(n),r);for(let i of A(e)){let o=r[i];if(o)return k(he(n),o)}return null}function be(e){if(!e.bundledNpmPackage)return null;try{return Xn.resolve(`${e.bundledNpmPackage}/package.json`)}catch{return null}}function $(e,n){for(let t of e.projectLocalBinaries??[]){let r=k(n,t);if(M(r))return r}return null}function B(e,n=process.env,t=e.indexerBinary){if(e.indexerBinary!=="scip-dotnet"||ye(t,n))return n;let r=Zn(t,n);return r?{...n,DOTNET_ROOT:r}:n}function U(e,n){let t=e.installMethods,r=I(e);if(!t?.length)return n(`No auto-install method available for ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1;for(let i of t)if(f(i.prerequisite)){n(`Installing ${r} via ${i.label}...`);try{N(i.binary,i.args,{stdio:"inherit",timeout:3e5,env:process.env});let o=x(e);if(o){let s=o===e.indexerBinary?"":` (using ${o})`;return n(`Successfully installed ${r} via ${i.label}${s}`),!0}n(`${i.label} command completed but ${r} was not found on PATH`)}catch(o){let s=o instanceof Error?o.message:String(o);n(`${i.label} install failed: ${s}`)}}return n(`Could not auto-install ${r}.`),e.installUrl&&n(`Install manually from: ${e.installUrl}`),!1}function Zn(e,n){for(let t of et(n))if(ye(e,{...n,DOTNET_ROOT:t}))return t;return null}function et(e){let n=[],t=e.DOTNET_ROOT;if(t&&M(t)&&n.push(t),Kn()==="darwin"&&f("brew"))try{let r=N("brew",["--prefix","dotnet@9"],{stdio:"pipe",env:e}).toString().trim(),i=k(r,"libexec");M(i)&&!n.includes(i)&&n.push(i)}catch{}return n}function ye(e,n){try{return N(e,["--version"],{stdio:"pipe",env:n}),!0}catch{return!1}}import Et from"better-sqlite3";import{existsSync as jt,readFileSync as Mt,writeFileSync as Nt}from"fs";import{dirname as At,join as _t,resolve as $t}from"path";import{readFileSync as nt,rmSync as tt,statSync as rt,mkdtempSync as it}from"fs";import{cpus as ot,tmpdir as st}from"os";import{join as W}from"path";import{Worker as at}from"worker_threads";function xe(e){return e.length>=8&&Re(e.length)>1}function Se(e){let n=Re(e.vueFiles.length),t=ct(e.vueFiles),r=gt(t,n),i=new URL("./augment-vue-worker.js",import.meta.url),o=it(W(st(),"scip-query-vue-workers-")),s=new SharedArrayBuffer(4),a=new Int32Array(s),u=ut(),c=Date.now();try{for(let l=0;l<r.length;l++)new at(i,{workerData:{projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,tasks:r[l],resultPath:W(o,`${l}.json`),sharedBuffer:s}});for(;Atomics.load(a,0)<r.length;){if(Date.now()-c>u)throw new Error(`Vue reference workers timed out after ${(u/1e3).toFixed(0)}s`);Atomics.wait(a,0,Atomics.load(a,0),100)}let g=r.map((l,p)=>{let d=JSON.parse(nt(W(o,`${p}.json`),"utf-8"));if(!d.ok)throw new Error(`Vue reference worker failed: ${d.error}`);return d.result});return{occurrences:g.flatMap(l=>l.occurrences),skippedReferences:g.reduce((l,p)=>l+p.skippedReferences,0)}}finally{tt(o,{recursive:!0,force:!0})}}function Re(e){let n=Number(process.env.SCIP_QUERY_AUGMENT_VUE_WORKERS??0),t=Number.isFinite(n)&&n>0?n:Math.min(8,Math.max(1,ot().length-1));return Math.max(1,Math.min(e,t))}function ut(){let e=Number(process.env.SCIP_QUERY_AUGMENT_VUE_WORKER_TIMEOUT_MS??0);return Number.isFinite(e)&&e>0?e:3e5}function ct(e){let n=lt(),t=[];for(let r of e){let i=ve(r),o=Math.max(1,Math.ceil(i/n));for(let s=0;s<o;s++)t.push({fileName:r,startOffset:Math.floor(i*s/o),endOffset:s===o-1?Number.POSITIVE_INFINITY:Math.floor(i*(s+1)/o),countFileSkip:s===0})}return t}function lt(){return Number.POSITIVE_INFINITY}function gt(e,n){let t=Array.from({length:n},()=>({tasks:[],weight:0})),r=e.map(i=>({task:i,weight:pt(i)})).sort((i,o)=>o.weight-i.weight);for(let i of r){let o=t.reduce((s,a)=>a.weight<s.weight?a:s);o.tasks.push(i.task),o.weight+=i.weight}return t.map(i=>i.tasks).filter(i=>i.length>0)}function pt(e){return Number.isFinite(e.endOffset)?Math.max(1,e.endOffset-e.startOffset):Math.max(1,ve(e.fileName)-e.startOffset)}function ve(e){try{return rt(e).size}catch{return 1}}import{createRequire as dt}from"module";import{existsSync as mt,readFileSync as J}from"fs";import{dirname as ke,extname as ft,join as Ie,relative as ht,resolve as bt}from"path";import{pathToFileURL as yt}from"url";function xt(e){e.transaction(()=>{e.prepare(`
|
|
7
7
|
DELETE FROM mentions
|
|
8
8
|
WHERE chunk_id IN (
|
|
9
9
|
SELECT c.id
|
|
@@ -23,7 +23,7 @@ import{a as m,e as w}from"./chunk-LWYIGRHR.js";import{a as Z}from"./chunk-TKDJQ2
|
|
|
23
23
|
FROM documents
|
|
24
24
|
WHERE language = 'vue' OR relative_path LIKE '%.vue'
|
|
25
25
|
ORDER BY relative_path
|
|
26
|
-
`).all().map(r=>bt(n,r.relativePath))}function Ce(e,n){let{vueCore:t,ts:r,volarTs:i}=St(e),{parsed:o,vueOptions:s}=
|
|
26
|
+
`).all().map(r=>bt(n,r.relativePath))}function Ce(e,n){let{vueCore:t,ts:r,volarTs:i}=St(e),{parsed:o,vueOptions:s}=Rt(t,r,n),a=ke(n),u=t.createVueLanguagePlugin(r,o.options,s,d=>d),c=vt(t,r,u),g=kt(a,o),{languageServiceHost:l}=i.createLanguageServiceHost(r,r.sys,c,d=>d,g),p=r.createLanguageService(l);return{ts:r,language:c,languageService:p,fileNames:o.fileNames,configDir:a}}function St(e){let n=dt(yt(Ie(e,"package.json")).href);return{vueCore:H(n,"@vue/language-core",e),ts:H(n,"typescript",e),volarTs:H(n,"@volar/typescript",e)}}function Rt(e,n,t){let r=n.readConfigFile(t,n.sys.readFile);if(r.error||!r.config)throw new Error(`Failed to read ${t}`);let o=e.createParsedCommandLine(n,n.sys,t).vueOptions;return typeof e.createGlobalTypesWriter=="function"&&(o.globalTypesPath=e.createGlobalTypesWriter(o,n.sys.writeFile)),{parsed:n.parseJsonConfigFileContent(r.config,n.sys,ke(t),void 0,t,void 0,e.getAllExtensions(o).map(s=>({extension:s.slice(1),isMixedContent:!0,scriptKind:n.ScriptKind.Deferred}))),vueOptions:o}}function vt(e,n,t){let r={},i=e.createLanguage([t],new Map,o=>{if(!mt(o))return;let s=J(o,"utf-8");r.current?.scripts.set(o,n.ScriptSnapshot.fromString(s),t.getLanguageId(o)??Ot(o))});return r.current=i,i}function kt(e,n){return{getCurrentDirectory:()=>e,getCompilationSettings:()=>n.options,getScriptFileNames:()=>n.fileNames,getProjectReferences:()=>n.projectReferences,getProjectVersion:()=>"0"}}function H(e,n,t){try{return e(n)}catch(r){throw(typeof r=="object"&&r!==null&&"code"in r?r.code:null)==="MODULE_NOT_FOUND"?new Error(`Vue augmentation requires ${n} to be installed in ${t}. Install Vue/Volar dependencies for that project, then rerun augment-vue.`,{cause:r}):r}}function Le(e,n,t){let r=It(e);return i=>{let o=h(n,i.fileName),s=t.get(i.fileName);if(!s)return null;let a=t.positionAt(s,i.textSpan.start),u=r.get(o);if(!u)return null;let c=u.containingByLine.get(a.line);return c!==void 0?c:Pt(u.starts,a.line,2)}}function It(e){let n=e.prepare(`
|
|
27
27
|
SELECT
|
|
28
28
|
d.relative_path AS relativePath,
|
|
29
29
|
der.start_line AS startLine,
|
|
@@ -32,22 +32,22 @@ import{a as m,e as w}from"./chunk-LWYIGRHR.js";import{a as Z}from"./chunk-TKDJQ2
|
|
|
32
32
|
FROM defn_enclosing_ranges der
|
|
33
33
|
JOIN documents d ON d.id = der.document_id
|
|
34
34
|
ORDER BY d.relative_path, (der.end_line - der.start_line) DESC
|
|
35
|
-
`).all(),t=new Map;for(let r of n){let i=t.get(r.relativePath);i||(i={containingByLine:new Map,starts:[]},t.set(r.relativePath,i)),i.starts.push({line:r.startLine,symbolId:r.symbolId});for(let o=r.startLine;o<=r.endLine;o++)i.containingByLine.set(o,r.symbolId)}for(let r of t.values())r.starts.sort((i,o)=>i.line-o.line);return t}function Pt(e,n,t){let r=0,i=e.length-1;for(;r<=i;){let s=Math.floor((r+i)/2);e[s].line<n?r=s+1:i=s-1}let o=null;for(let s of[i,r]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>t||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function
|
|
35
|
+
`).all(),t=new Map;for(let r of n){let i=t.get(r.relativePath);i||(i={containingByLine:new Map,starts:[]},t.set(r.relativePath,i)),i.starts.push({line:r.startLine,symbolId:r.symbolId});for(let o=r.startLine;o<=r.endLine;o++)i.containingByLine.set(o,r.symbolId)}for(let r of t.values())r.starts.sort((i,o)=>i.line-o.line);return t}function Pt(e,n,t){let r=0,i=e.length-1;for(;r<=i;){let s=Math.floor((r+i)/2);e[s].line<n?r=s+1:i=s-1}let o=null;for(let s of[i,r]){let a=e[s];if(!a)continue;let u=Math.abs(a.line-n);u>t||(!o||u<o.distance)&&(o={distance:u,symbolId:a.symbolId})}return o?.symbolId??null}function we(e,n,t){let r=Tt(n),i=e.prepare("SELECT id FROM global_symbols WHERE symbol = ?"),o=e.prepare(`
|
|
36
36
|
INSERT OR IGNORE INTO global_symbols (symbol, display_name, kind, documentation)
|
|
37
37
|
VALUES (?, ?, ?, ?)
|
|
38
|
-
`),s=0,a=new Map;return e.transaction(()=>{for(let c of t){let g=h(n,c),l=Ne(r.name,r.version,g);o.run(l,"default",7,`Vue component|${g}`);let p=
|
|
38
|
+
`),s=0,a=new Map;return e.transaction(()=>{for(let c of t){let g=h(n,c),l=Ne(r.name,r.version,g);o.run(l,"default",7,`Vue component|${g}`);let p=Ft(i,r,n,c);p&&(s++,a.set(c,p))}})(),{get(c){return a.get(c)??null},syntheticSymbols:s}}function Oe(e,n,t,r,i){return e.transaction(()=>(xt(e),Ct(e,n,t,r),Lt(e,i)))()}function Ct(e,n,t,r){let i=e.prepare("SELECT id FROM documents WHERE relative_path = ?"),o=e.prepare(`
|
|
39
39
|
INSERT INTO chunks (document_id, chunk_index, start_line, end_line, occurrences)
|
|
40
40
|
VALUES (?, ?, ?, ?, X'00')
|
|
41
41
|
`),s=e.prepare(`
|
|
42
42
|
INSERT OR IGNORE INTO mentions (chunk_id, symbol_id, role)
|
|
43
43
|
VALUES (?, ?, 1)
|
|
44
|
-
`);for(let a of t){let u=r.get(a);if(!u)continue;let c=h(n,a),g=i.get(c);if(!g)continue;let l=o.run(g.id,-1,0,0);s.run(Number(l.lastInsertRowid),u)}}function De(e,n,t,r,i){if(e.fileName.endsWith(".vue")){let o=r.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=r.language.maps.get(s,o);if(z(a,e.textSpan.start)!==null)return t.get(e.fileName)}return e.fileName.startsWith(i)?t.get(e.fileName):null}return n(e)}function
|
|
44
|
+
`);for(let a of t){let u=r.get(a);if(!u)continue;let c=h(n,a),g=i.get(c);if(!g)continue;let l=o.run(g.id,-1,0,0);s.run(Number(l.lastInsertRowid),u)}}function De(e,n,t,r,i){if(e.fileName.endsWith(".vue")){let o=r.language.scripts.get(e.fileName),s=o?.generated?.languagePlugin.typescript?.getServiceScript(o.generated.root)?.code;if(o&&s){let a=r.language.maps.get(s,o);if(z(a,e.textSpan.start)!==null)return t.get(e.fileName)}return e.fileName.startsWith(i)?t.get(e.fileName):null}return n(e)}function Ve(e){let n=new Set,t=[];for(let r of e){let i=Te(r);n.has(i)||(n.add(i),t.push(r))}return t}function Te(e){return[e.sourceFile,e.sourceLine,e.sourceStartChar,e.sourceEndChar,e.symbolId].join(":")}function Lt(e,n){let t=Vt(e,[...new Set(n.map(u=>u.sourceFile))]),r=e.prepare(`
|
|
45
45
|
INSERT INTO chunks (document_id, chunk_index, start_line, end_line, occurrences)
|
|
46
46
|
VALUES (?, ?, ?, ?, X'00')
|
|
47
47
|
`),i=e.prepare(`
|
|
48
48
|
INSERT OR IGNORE INTO mentions (chunk_id, symbol_id, role)
|
|
49
49
|
VALUES (?, ?, 0)
|
|
50
|
-
`),o=new Set,s=0,a=0;for(let u of n){let c=
|
|
50
|
+
`),o=new Set,s=0,a=0;for(let u of n){let c=Te(u);if(o.has(c))continue;o.add(c);let g=t.get(u.sourceFile);if(!g)continue;let l=r.run(g,a++,u.sourceLine,u.sourceLine),p=i.run(Number(l.lastInsertRowid),u.symbolId);s+=Number(p.changes)}return s}function*Fe(e){let n=/\b[A-Za-z_$][A-Za-z0-9_$]*\b/g,t=new Set(["script","setup","template","style","lang","scoped","true","false","null","undefined","const","let","var","import","from","export","return","if","else","for","while","function","class","type","interface","as","await","async"]),r;for(;r=n.exec(e);){let i=r[0];t.has(i)||(yield{text:i,start:r.index,end:r.index+i.length})}}function Ee(e,n){for(let[t]of e.toGeneratedLocation(n,r=>!!r.navigation))return t;return null}function z(e,n){let t=e;for(let[r]of t.toSourceLocation(n,i=>!!i.navigation))return r;return null}function wt(e,n){let t=0,r=e.lineStarts.length-1;for(;t<=r;){let o=Math.floor((t+r)/2);e.lineStarts[o]<=n?t=o+1:r=o-1}let i=Math.max(0,r);return{line:i,character:n-e.lineStarts[i]}}function je(e,n){return h(e,n).startsWith("node_modules/")}function h(e,n){return ht(e,n).replaceAll("\\","/")}function Ot(e){switch(ft(e)){case".vue":return"vue";case".tsx":return"typescriptreact";case".ts":case".mts":case".cts":return"typescript";case".jsx":return"javascriptreact";case".js":case".mjs":case".cjs":return"javascript";case".json":return"json";default:return"typescript"}}function Me(){let e=new Map;return{get(n){if(e.has(n))return e.get(n)??null;try{let t=J(n,"utf-8"),r={text:t,lineStarts:Dt(t)};return e.set(n,r),r}catch{return e.set(n,null),null}},positionAt:wt}}function Dt(e){let n=[0];for(let t=0;t<e.length;t++)e.charCodeAt(t)===10&&n.push(t+1);return n}function Vt(e,n){let t=new Map,r=500;for(let i=0;i<n.length;i+=r){let o=n.slice(i,i+r),s=e.prepare(`SELECT id, relative_path AS relativePath FROM documents WHERE relative_path IN (${o.map(()=>"?").join(",")})`).all(...o);for(let a of s)t.set(a.relativePath,a.id)}return t}function Tt(e){try{let n=JSON.parse(J(Ie(e,"package.json"),"utf-8"));return{name:n.name??"workspace",version:n.version??"0.0.0"}}catch{return{name:"workspace",version:"0.0.0"}}}function Ft(e,n,t,r){let i=h(t,r),o=Ne(n.name,n.version,i);return e.get(o)?.id??null}function Ne(e,n,t){let r=t.split("/").map(i=>`\`${i.replaceAll("`","")}\``).join("/");return`scip-vue npm ${e} ${n} ${r}/default.`}function Bt(e){y({projectRoot:e.projectRoot,dbPath:e.dbPath});let n=$t(e.projectRoot,e.tsconfig);if(!jt(n))throw new Error(`Vue tsconfig not found at ${n}`);let t=new Et(e.dbPath);try{let r=Pe(t,e.projectRoot),i=_t(At(e.dbPath),"augment-vue-meta.json"),o=Ae(t,e.projectRoot,e.tsconfig),s=Ut(i,o,e.onStatus);if(s)return s;let a=Wt({db:t,projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,configPath:n,vueFiles:r,onStatus:e.onStatus});return zt(i,Ae(t,e.projectRoot,e.tsconfig),a),a}finally{t.close()}}function Ut(e,n,t){let r=Jt(e,n);return r&&t?.(`Vue references unchanged; reused ${r.resolvedReferences} cached resolved references.`),r}function Wt(e){let n=we(e.db,e.projectRoot,e.vueFiles),t=Ht(e,n),r=Ve(t.occurrences),i=Oe(e.db,e.projectRoot,e.vueFiles,n,r),o={vueFiles:e.vueFiles.length,resolvedReferences:r.length,insertedMentions:i,skippedReferences:t.skippedReferences,syntheticSymbols:n.syntheticSymbols};return e.onStatus?.(`Resolved ${o.resolvedReferences} Vue references with Volar; inserted ${o.insertedMentions} mentions.`),o}function Ht(e,n){if(xe(e.vueFiles))return Se({projectRoot:e.projectRoot,dbPath:e.dbPath,tsconfig:e.tsconfig,vueFiles:e.vueFiles});let t=Gt({db:e.db,projectRoot:e.projectRoot,configPath:e.configPath,vueSymbolLookup:n});return qt({...t,vueFiles:t.context.fileNames.filter(r=>r.endsWith(".vue"))})}function Jt(e,n){try{let t=JSON.parse(Mt(e,"utf-8"));return JSON.stringify(t.fingerprint)===JSON.stringify(n)?t.result:null}catch{return null}}function zt(e,n,t){Nt(e,JSON.stringify({updatedAt:new Date().toISOString(),fingerprint:n,result:t},null,2)+`
|
|
51
51
|
`)}function Ae(e,n,t){let r=e.prepare(`
|
|
52
52
|
SELECT
|
|
53
53
|
(SELECT COUNT(*) FROM documents) AS documents,
|
|
@@ -57,13 +57,13 @@ import{a as m,e as w}from"./chunk-LWYIGRHR.js";import{a as Z}from"./chunk-TKDJQ2
|
|
|
57
57
|
(SELECT COUNT(*) FROM defn_enclosing_ranges) AS ranges,
|
|
58
58
|
(SELECT MAX(id) FROM chunks) AS maxChunkId,
|
|
59
59
|
(SELECT MAX(id) FROM global_symbols) AS maxSymbolId
|
|
60
|
-
`).get();return{version:2,tsconfig:t,files:
|
|
61
|
-
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!
|
|
62
|
-
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function
|
|
60
|
+
`).get();return{version:2,tsconfig:t,files:R(n),db:r}}function Gt(e){let n=Me();return{projectRoot:e.projectRoot,context:Ce(e.projectRoot,e.configPath),symbolLookup:Le(e.db,e.projectRoot,n),vueSymbolLookup:e.vueSymbolLookup,sourceReader:n}}function qt(e){let n=[],t=0,r=e.tasks??e.vueFiles.map(i=>({fileName:i,startOffset:0,endOffset:Number.POSITIVE_INFINITY,countFileSkip:!0}));for(let i of r){let o=Kt(e,i);n.push(...o.occurrences),t+=o.skippedReferences}return{occurrences:n,skippedReferences:t}}function Kt(e,n){let t=e.context.language.scripts.get(n.fileName),r=t?.generated?.languagePlugin.typescript?.getServiceScript(t.generated.root)?.code;if(!t||!r)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let i=e.sourceReader.get(n.fileName);if(!i)return{occurrences:[],skippedReferences:n.countFileSkip?1:0};let o=e.context.language.maps.get(r,t),s=h(e.projectRoot,n.fileName),a=[...Fe(i.text)],u={tokens:a.filter(c=>c.start>=n.startOffset&&c.start<n.endOffset),tokenByStart:new Map(a.map(c=>[c.start,c])),tokenTextCounts:Qt(a),processedStarts:new Set};return Xt({...e,fileName:n.fileName,sourceInfo:i,sourceFile:s,map:o,tokenContext:u})}function Xt(e){let n=[],t=0;for(let r of e.tokenContext.tokens){if(e.tokenContext.processedStarts.has(r.start))continue;let i=Ee(e.map,r.start);if(i===null)continue;let s=(e.context.languageService.getDefinitionAtPosition(e.fileName,i+1)??[]).find(u=>!je(e.projectRoot,u.fileName));if(!s){t++;continue}let a=De(s,e.symbolLookup,e.vueSymbolLookup,e.context,e.projectRoot);if(a===null){t++;continue}_e(n,e.sourceReader,e.sourceInfo,e.sourceFile,r,a),e.tokenContext.processedStarts.add(r.start),Yt(n,e,r,i,a)}return{occurrences:n,skippedReferences:t}}function Yt(e,n,t,r,i){if(!((n.tokenContext.tokenTextCounts.get(t.text)??0)<=1))for(let o of Zt(n.context.languageService,n.fileName,r+1,n.map,t,n.tokenContext.tokenByStart)){if(n.tokenContext.processedStarts.has(o))continue;let s=n.tokenContext.tokenByStart.get(o);s&&(_e(e,n.sourceReader,n.sourceInfo,n.sourceFile,s,i),n.tokenContext.processedStarts.add(o))}}function _e(e,n,t,r,i,o){let s=n.positionAt(t,i.start);e.push({sourceFile:r,sourceLine:s.line,sourceStartChar:s.character,sourceEndChar:s.character+i.text.length,symbolId:o})}function Qt(e){let n=new Map;for(let t of e)n.set(t.text,(n.get(t.text)??0)+1);return n}function Zt(e,n,t,r,i,o){let s=e.getDocumentHighlights?.(n,t,[n])??[],a=[];for(let u of s)if(u.fileName===n)for(let c of u.highlightSpans){let g=er(r,c.textSpan.start,o,i.text);g!==null&&a.push(g)}return a}function er(e,n,t,r){let i=t.get(n);if(i?.text===r)return i.start;let o=z(e,n);if(o===null)return null;let s=t.get(o);return s?.text===r?s.start:null}async function Ui(e){let{projectRoot:n,maxHeapMb:t=8192,onStatus:r=console.log,skipAutoInstall:i=!1}=e,o=ar(e),s=Date.now();$e(b(o.outputScip),{recursive:!0}),$e(b(o.outputDb),{recursive:!0});let a=e.languages??w(n);if(a.length===0)throw new Error("No supported languages detected in this project. Looked for: tsconfig.json, Cargo.toml, go.mod, pyproject.toml, etc.");r(`Detected languages: ${a.join(", ")}`);let u=kr(n,a,{pnpmWorkspaces:e.pnpmWorkspaces}),c=Rr(m(b(o.outputDb),"index.lock")),g=null;try{let l=ur({opts:e,paths:o,languages:a,fingerprint:u,start:s,onStatus:r});if(l)return l;dr(i,r);let p=cr(o);return g=p.runDir,await lr({opts:e,languages:a,projectRoot:n,paths:o,tempPaths:p,fingerprint:u,start:s,maxHeapMb:t,skipAutoInstall:i,onStatus:r})}finally{g&&X(g,{recursive:!0,force:!0}),c()}}function ar(e){let n=e.outputScip??m(e.projectRoot,"index.scip"),t=e.outputDb??m(e.projectRoot,"index.db");return{outputScip:n,outputDb:t,metaPath:m(b(t),"meta.json")}}function ur(e){if(e.opts.skipIfUnchanged===!1||!q(e.paths.outputScip)||!q(e.paths.outputDb)||!Ir(e.paths.metaPath,e.fingerprint))return null;y({projectRoot:e.opts.projectRoot,dbPath:e.paths.outputDb,onStatus:e.onStatus});let n=Date.now()-e.start;return e.onStatus(`Index unchanged; reused existing SQLite index in ${(n/1e3).toFixed(1)}s`),{languages:e.languages,indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:n,reused:!0,skipped:[]}}function cr(e){let n=rr(m(b(e.outputDb),"reindex-"));return{runDir:n,tempOutputScip:m(n,C(e.outputScip)),tempOutputDb:m(n,C(e.outputDb)),tempMetaPath:m(n,C(e.metaPath))}}async function lr(e){let n={...process.env,NODE_OPTIONS:`--max-old-space-size=${e.maxHeapMb}`},{indexedOutputs:t,skippedLanguages:r}=await gr(e,n);pr(e,n,t,r);let i=Date.now()-e.start;return e.onStatus(`Done in ${(i/1e3).toFixed(1)}s`),{languages:t.map(o=>o.language),indexPath:e.paths.outputScip,dbPath:e.paths.outputDb,durationMs:i,reused:!1,skipped:r}}async function gr(e,n){let{preparedRuns:t,skippedLanguages:r}=mr({languages:e.languages,tempOutputScip:e.tempPaths.tempOutputScip,projectRoot:e.projectRoot,env:n,skipAutoInstall:e.skipAutoInstall,pnpmWorkspaces:e.opts.pnpmWorkspaces,onStatus:e.onStatus}),i=await fe(t,e.projectRoot,e.onStatus,e.opts.indexerConcurrency),{indexedOutputs:o}=hr(i,r);return br(o,r,e.languages,e.opts.allowPartial,e.onStatus),{indexedOutputs:o,skippedLanguages:r}}function pr(e,n,t,r){yr(t,e.tempPaths.tempOutputScip,e.onStatus),xr(e.tempPaths.tempOutputScip,e.tempPaths.tempOutputDb,n,e.onStatus),y({projectRoot:e.projectRoot,dbPath:e.tempPaths.tempOutputDb,onStatus:e.onStatus}),Pr(e.tempPaths.tempMetaPath,{version:2,status:r.length===0?"complete":"partial",updatedAt:new Date().toISOString(),fingerprint:e.fingerprint,requestedLanguages:e.languages,indexedLanguages:t.map(i=>i.language),skipped:[...r]}),vr({tempOutputScip:e.tempPaths.tempOutputScip,tempOutputDb:e.tempPaths.tempOutputDb,tempMetaPath:e.tempPaths.tempMetaPath,outputScip:e.paths.outputScip,outputDb:e.paths.outputDb,metaPath:e.paths.metaPath})}function dr(e,n){if(!f("scip")){if(e)throw new Error(`The scip CLI is required but not found on PATH.
|
|
61
|
+
Install from: https://github.com/sourcegraph/scip/releases`);if(n("scip CLI not found on PATH. Attempting auto-install..."),!L(n))throw new Error(`The scip CLI is required but could not be installed.
|
|
62
|
+
Install manually from: https://github.com/sourcegraph/scip/releases`)}}function mr(e){let n=[],t=[],r=e.languages.map((i,o)=>({language:i,scipPath:e.languages.length>1?Sr(e.tempOutputScip,i,o):e.tempOutputScip}));for(let{language:i,scipPath:o}of r){let s=fr({...e,language:i,scipPath:o});"skipped"in s?t.push(s.skipped):n.push(s.prepared)}return{preparedRuns:n,skippedLanguages:t}}function fr(e){let n=D(e.language),t=I(n),r=$(n,e.projectRoot);if(!r&&!_(n)){if(e.skipAutoInstall){let a=`${t} not found on PATH (auto-install disabled). ${n.installUrl??""}`.trim();return e.onStatus(`Skipping ${e.language}: ${a}`),{skipped:{language:e.language,reason:a}}}if(e.onStatus(`${t} not found. Attempting auto-install...`),!U(n,e.onStatus)){let a=`${t} could not be auto-installed. ${n.installUrl?`Install manually from ${n.installUrl}`:`Install ${t} and put it on PATH.`}`;return e.onStatus(`Skipping ${e.language}: ${a}`),{skipped:{language:e.language,reason:a}}}}let i=r??x(n);if(!i){let a=`${t} was not found after installation checks.`;return e.onStatus(`Skipping ${e.language}: ${a}`),{skipped:{language:e.language,reason:a}}}let{binary:o,args:s}=n.indexArgs({projectRoot:e.projectRoot,outputPath:e.scipPath,pnpmWorkspaces:e.pnpmWorkspaces,indexerBinary:i});return{prepared:{language:e.language,scipPath:e.scipPath,config:n,resolvedBinary:i,binary:o,args:s,env:B(n,e.env,i)}}}function hr(e,n){let t=[];for(let r of e)r.skipped?n.push(r.skipped):t.push({language:r.language,scipPath:r.scipPath});return{indexedOutputs:t}}function br(e,n,t,r,i){if(e.length===0){let o=n.map(s=>` - ${s.language}: ${s.reason}`).join(`
|
|
63
63
|
`);throw new Error(`No language indexers ran successfully. Install at least one indexer for the languages in this project.
|
|
64
64
|
`+o)}if(n.length!==0&&(i(`Indexed ${e.length} of ${t.length} languages; skipped ${n.map(o=>o.language).join(", ")}.`),!r))throw new Error(`Failed to index all required languages; preserving the previous index. Pass --allow-partial to intentionally write an incomplete index.
|
|
65
65
|
`+n.map(o=>` - ${o.language}: ${o.reason}`).join(`
|
|
66
|
-
`))}function
|
|
67
|
-
`),()=>{try{
|
|
68
|
-
`)}function P(e){return JSON.stringify(e)}export{ae as INDEXER_CONFIGS,y as augmentAuxiliaryDocuments,Bt as augmentVueResolvedReferences,I as describeIndexerBinary,
|
|
66
|
+
`))}function yr(e,n,t){e.length>1?(t(`Merging ${e.length} language indexes...`),T(e.map(r=>r.scipPath),n)):e[0].scipPath!==n&&K(e[0].scipPath,n)}function xr(e,n,t,r){if(r("Converting to SQLite..."),!q(e))throw new Error(`SCIP index not found at ${e} after indexing`);try{let i=de(e);i.removedDefinitionOccurrences>0&&r(`Sanitized ${i.removedDefinitionOccurrences} invalid definition occurrences across ${i.touchedDocuments} documents before SQLite conversion.`),nr("scip",["expt-convert","--output",n,e],{env:t,stdio:"pipe",maxBuffer:50*1024*1024})}catch(i){let o=i instanceof Error?i.message:String(i);throw new Error(`Failed to convert SCIP index to SQLite: ${o}`,{cause:i})}}function Sr(e,n,t){let r=sr(e)||".scip",i=C(e,r);return m(b(e),`${i}.${t+1}.${n}${r}`)}function Rr(e){let n;try{n=ir(e,"wx")}catch(t){throw(typeof t=="object"&&t&&"code"in t?t.code:void 0)==="EEXIST"?new Error(`Another scip-query reindex is already running for ${b(e)}.`,{cause:t}):t}return Be(n,JSON.stringify({pid:process.pid,startedAt:new Date().toISOString()})+`
|
|
67
|
+
`),()=>{try{tr(n)}finally{X(e,{force:!0})}}}function vr(e){G(e.tempOutputScip,e.outputScip),G(e.tempOutputDb,e.outputDb),G(e.tempMetaPath,e.metaPath)}function G(e,n){X(`${n}.tmp-replace`,{force:!0}),K(e,`${n}.tmp-replace`),K(`${n}.tmp-replace`,n)}function kr(e,n,t){return{version:1,languages:[...n].sort(),pnpmWorkspaces:t.pnpmWorkspaces===!0,files:R(e)}}function Ir(e,n){try{let t=JSON.parse(or(e,"utf-8"));return t.version===2&&t.status==="complete"&&P(t.fingerprint)===P(n)&&P([...t.indexedLanguages??[]].sort())===P(n.languages)}catch{return!1}}function Pr(e,n){Be(e,`${JSON.stringify(n,null,2)}
|
|
68
|
+
`)}function P(e){return JSON.stringify(e)}export{ae as INDEXER_CONFIGS,y as augmentAuxiliaryDocuments,Bt as augmentVueResolvedReferences,I as describeIndexerBinary,w as detectLanguages,D as getIndexerConfig,B as getIndexerExecutionEnv,f as isBinaryAvailable,_ as isIndexerInstalled,T as mergeScipFiles,ue as mergeScipIndexes,Ui as reindex,x as resolveIndexerBinary,$ as resolveProjectLocalIndexerBinary,U as tryInstallIndexer,L as tryInstallScipCli};
|
|
69
69
|
//# sourceMappingURL=reindex.js.map
|
package/dist/runtime.d.ts
CHANGED
|
@@ -97,8 +97,9 @@ interface InstallSkillsResult {
|
|
|
97
97
|
alreadyLinked: string[];
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
100
|
-
* Install scip-query skills into
|
|
101
|
-
*
|
|
100
|
+
* Install scip-query skills into Claude Code (~/.claude/skills/),
|
|
101
|
+
* Codex (~/.codex/skills/), and the shared agents skill root (~/.agents/skills/).
|
|
102
|
+
* Uses symlinks (junctions on Windows)
|
|
102
103
|
* so skills auto-update when the package updates.
|
|
103
104
|
*/
|
|
104
105
|
declare function installSkills(opts?: {
|
package/dist/runtime.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{b
|
|
2
|
-
`),e}function g(i){return F(i,{recursive:!0}),i}import{watch as q}from"fs";import{existsSync as
|
|
1
|
+
import{b,c as j,d as W}from"./chunk-LWYIGRHR.js";import{a as w}from"./chunk-TKDJQ2WD.js";import{readFileSync as _,writeFileSync as D,existsSync as v,mkdirSync as F}from"fs";import{join as l,resolve as C}from"path";import{createHash as L}from"crypto";import{homedir as $}from"os";var P=".scipquery.json",A={enabled:!1,debounceMs:3e4,cooldownMs:6e4,ignore:[]};function N(i){let t=l(i,P);if(!v(t))return{};try{let e=_(t,"utf-8");return JSON.parse(e)}catch{return{}}}function R(i){return{...A,...i.watch}}function O(i,t){let e=process.env.SCIP_QUERY_CACHE_DIR;if(e)return g(e);if(t?.dbPath)return g(C(i,t.dbPath));let n=process.env.XDG_CACHE_HOME||l($(),".cache"),o=L("sha256").update(C(i)).digest("hex").slice(0,12),r=l(n,"scip-query","projects",o);return g(r)}function f(i,t){let e=O(i,t);return{cacheDir:e,dbPath:l(e,"index.db"),indexPath:l(e,"index.scip"),metaPath:l(e,"meta.json")}}function M(i,t){let e=l(i,P);return v(e)||D(e,JSON.stringify({languages:t,watch:{enabled:!1,debounceMs:3e4,cooldownMs:6e4}},null,2)+`
|
|
2
|
+
`),e}function g(i){return F(i,{recursive:!0}),i}import{watch as q}from"fs";import{existsSync as I,renameSync as T}from"fs";import{join as U,relative as H}from"path";import{fork as G}from"child_process";import X from"ignore";var m=class{projectRoot;watchConfig;indexPaths;languages;pnpmWorkspaces;onStatus;onReindexComplete;onError;status={state:"idle"};debounceTimer=null;cooldownTimer=null;dirty=!1;changedFiles=0;reindexInFlight=!1;lastReindexEnd=0;fsWatchers=[];gitignoreFilter;extraIgnore;stopped=!1;constructor(t){this.projectRoot=t.projectRoot,this.watchConfig=R(t.config),this.indexPaths=f(t.projectRoot,t.config),this.languages=t.languages,this.pnpmWorkspaces=t.config.indexer?.typescript?.pnpmWorkspaces??!1,this.onStatus=t.onStatus??(()=>{}),this.onReindexComplete=t.onReindexComplete??(()=>{}),this.onError=t.onError??(e=>console.error(e.message)),this.gitignoreFilter=w(t.projectRoot),this.extraIgnore=X(),this.watchConfig.ignore.length>0&&this.extraIgnore.add(this.watchConfig.ignore)}start(){this.stopped=!1,this.setStatus({state:"idle"});try{let t=q(this.projectRoot,{recursive:!0},(e,s)=>{s&&!this.stopped&&this.handleFileChange(s)});this.fsWatchers.push(t)}catch{this.onError(new Error("Failed to start file watcher. On Linux, you may need to increase inotify limits: sysctl -w fs.inotify.max_user_watches=524288"))}}stop(){this.stopped=!0;for(let t of this.fsWatchers)t.close();this.fsWatchers=[],this.clearDebounceTimer(),this.clearCooldownTimer(),this.setStatus({state:"idle"})}handleFileChange(t){let e=H(this.projectRoot,U(this.projectRoot,t));if(this.gitignoreFilter.isIgnored(e)||this.extraIgnore.ignores(e)||t.endsWith("index.db")||t.endsWith("index.scip")||t.endsWith("index.db.tmp")||t.endsWith(".scipquery.json"))return;if(this.changedFiles++,this.reindexInFlight){this.dirty=!0,this.setStatus({state:"indexing",startedAt:this.status.startedAt});return}if(this.status.state==="cooldown"){this.dirty=!0,this.setStatus({state:"cooldown",until:this.status.until,dirty:!0});return}this.clearDebounceTimer();let s=Date.now()+this.watchConfig.debounceMs;this.setStatus({state:"waiting",changedFiles:this.changedFiles,reindexAt:s}),this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.triggerReindex()},this.watchConfig.debounceMs)}triggerReindex(){if(this.reindexInFlight||this.stopped)return;let t=Date.now()-this.lastReindexEnd;if(this.lastReindexEnd>0&&t<this.watchConfig.cooldownMs){let s=this.watchConfig.cooldownMs-t;this.dirty=!0;let n=Date.now()+s;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped&&(this.dirty=!1,this.triggerReindex())},s);return}this.reindexInFlight=!0,this.dirty=!1,this.changedFiles=0;let e=Date.now();this.setStatus({state:"indexing",startedAt:e}),this.runReindex().then(s=>{if(this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onReindexComplete(s),this.dirty&&!this.stopped){let n=Date.now()+this.watchConfig.cooldownMs;this.setStatus({state:"cooldown",until:n,dirty:!0}),this.cooldownTimer=setTimeout(()=>{this.cooldownTimer=null,this.dirty&&!this.stopped?(this.dirty=!1,this.triggerReindex()):this.setStatus({state:"idle"})},this.watchConfig.cooldownMs)}else this.setStatus({state:"idle"})}).catch(s=>{this.reindexInFlight=!1,this.lastReindexEnd=Date.now(),this.onError(s instanceof Error?s:new Error(String(s))),this.setStatus({state:"idle"})})}runReindex(){return new Promise((t,e)=>{let s=Date.now(),n=this.indexPaths.dbPath+".tmp",o=B(this.indexPaths.indexPath),r=G(new URL("./reindex-worker.js",import.meta.url).pathname,[],{env:{...process.env,SCIP_REINDEX_PROJECT_ROOT:this.projectRoot,SCIP_REINDEX_OUTPUT_SCIP:o,SCIP_REINDEX_OUTPUT_DB:n,SCIP_REINDEX_LANGUAGES:this.languages?.join(",")??"",SCIP_REINDEX_PNPM_WORKSPACES:this.pnpmWorkspaces?"1":""},stdio:"pipe"});r.on("exit",h=>{if(h===0)try{I(n)&&T(n,this.indexPaths.dbPath),I(o)&&T(o,this.indexPaths.indexPath),t(Date.now()-s)}catch(a){e(new Error(`Atomic swap failed: ${a}`))}else e(new Error(`Reindex worker exited with code ${h}`))}),r.on("error",e)})}setStatus(t){this.status=t,this.onStatus(t)}clearDebounceTimer(){this.debounceTimer&&(clearTimeout(this.debounceTimer),this.debounceTimer=null)}clearCooldownTimer(){this.cooldownTimer&&(clearTimeout(this.cooldownTimer),this.cooldownTimer=null)}};function B(i){return i.endsWith(".scip")?i.slice(0,-5)+".tmp.scip":i+".tmp.scip"}import{existsSync as x,mkdirSync as J,symlinkSync as V,readlinkSync as K,unlinkSync as Q}from"fs";import{join as d,dirname as k,resolve as S}from"path";import{homedir as y,platform as Y}from"os";import{fileURLToPath as z}from"url";var Z=Y()==="win32",tt=["concrete-plan","scip-ai-cleanup","scip-explore","scip-debloat","scip-maintainability","scip-verify","scip-language-playbook"];function et(i={}){let t=i.quiet?()=>{}:console.log,e=z(import.meta.url),s=S(k(e),"..","skills"),n=[d(y(),".claude","skills"),d(y(),".codex","skills"),d(y(),".agents","skills")],o={installed:[],skipped:[],alreadyLinked:[]};for(let r of n){let h=k(r);if(!x(h))continue;J(r,{recursive:!0});let a=it(r);for(let c of tt){let u=d(s,c),p=d(r,c);if(!x(u)){o.skipped.push(`${a}/${c}`);continue}if(x(p)){try{let E=K(p);if(S(E)===S(u)){o.alreadyLinked.push(`${a}/${c}`),t(` ok: ${c} \u2192 ${a} (already linked)`);continue}}catch{o.skipped.push(`${a}/${c}`),t(` skip: ${c} \u2192 ${a} (exists, not a symlink)`);continue}Q(p)}V(u,p,Z?"junction":"dir"),o.installed.push(`${a}/${c}`),t(` done: ${c} \u2192 ${a}`)}}return o}function it(i){return i.includes(".codex")?"Codex":i.includes(".agents")?"Agents":"Claude"}export{m as Watcher,j as getScipVersion,M as initProjectConfig,et as installSkills,b as isScipInstalled,N as loadProjectConfig,W as printScipInstallInstructions,f as resolveIndexPaths};
|
|
3
3
|
//# sourceMappingURL=runtime.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scip-query",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Language-agnostic code intelligence CLI powered by SCIP indexes",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -43,6 +43,14 @@
|
|
|
43
43
|
"import": "./dist/queries/change-surface.js",
|
|
44
44
|
"types": "./dist/queries/change-surface.d.ts"
|
|
45
45
|
},
|
|
46
|
+
"./queries/cleanup-plan": {
|
|
47
|
+
"import": "./dist/queries/cleanup-plan.js",
|
|
48
|
+
"types": "./dist/queries/cleanup-plan.d.ts"
|
|
49
|
+
},
|
|
50
|
+
"./queries/co-change": {
|
|
51
|
+
"import": "./dist/queries/co-change.js",
|
|
52
|
+
"types": "./dist/queries/co-change.d.ts"
|
|
53
|
+
},
|
|
46
54
|
"./queries/code": {
|
|
47
55
|
"import": "./dist/queries/code.js",
|
|
48
56
|
"types": "./dist/queries/code.d.ts"
|
|
@@ -83,10 +91,18 @@
|
|
|
83
91
|
"import": "./dist/queries/deps.js",
|
|
84
92
|
"types": "./dist/queries/deps.d.ts"
|
|
85
93
|
},
|
|
94
|
+
"./queries/diff-gate": {
|
|
95
|
+
"import": "./dist/queries/diff-gate.js",
|
|
96
|
+
"types": "./dist/queries/diff-gate.d.ts"
|
|
97
|
+
},
|
|
86
98
|
"./queries/diff-impact": {
|
|
87
99
|
"import": "./dist/queries/diff-impact.js",
|
|
88
100
|
"types": "./dist/queries/diff-impact.d.ts"
|
|
89
101
|
},
|
|
102
|
+
"./queries/doc-drift": {
|
|
103
|
+
"import": "./dist/queries/doc-drift.js",
|
|
104
|
+
"types": "./dist/queries/doc-drift.d.ts"
|
|
105
|
+
},
|
|
90
106
|
"./queries/drift": {
|
|
91
107
|
"import": "./dist/queries/drift.js",
|
|
92
108
|
"types": "./dist/queries/drift.d.ts"
|
|
@@ -143,6 +159,14 @@
|
|
|
143
159
|
"import": "./dist/queries/passthrough-candidates.js",
|
|
144
160
|
"types": "./dist/queries/passthrough-candidates.d.ts"
|
|
145
161
|
},
|
|
162
|
+
"./queries/plan-context": {
|
|
163
|
+
"import": "./dist/queries/plan-context.js",
|
|
164
|
+
"types": "./dist/queries/plan-context.d.ts"
|
|
165
|
+
},
|
|
166
|
+
"./queries/recent-duplicates": {
|
|
167
|
+
"import": "./dist/queries/recent-duplicates.js",
|
|
168
|
+
"types": "./dist/queries/recent-duplicates.d.ts"
|
|
169
|
+
},
|
|
146
170
|
"./queries/redundant-reexports": {
|
|
147
171
|
"import": "./dist/queries/redundant-reexports.js",
|
|
148
172
|
"types": "./dist/queries/redundant-reexports.d.ts"
|
|
@@ -151,6 +175,10 @@
|
|
|
151
175
|
"import": "./dist/queries/refs.js",
|
|
152
176
|
"types": "./dist/queries/refs.d.ts"
|
|
153
177
|
},
|
|
178
|
+
"./queries/self-audit": {
|
|
179
|
+
"import": "./dist/queries/self-audit.js",
|
|
180
|
+
"types": "./dist/queries/self-audit.d.ts"
|
|
181
|
+
},
|
|
154
182
|
"./queries/similar": {
|
|
155
183
|
"import": "./dist/queries/similar.js",
|
|
156
184
|
"types": "./dist/queries/similar.d.ts"
|
|
@@ -195,6 +223,10 @@
|
|
|
195
223
|
"import": "./dist/queries/trace.js",
|
|
196
224
|
"types": "./dist/queries/trace.d.ts"
|
|
197
225
|
},
|
|
226
|
+
"./queries/unused-params": {
|
|
227
|
+
"import": "./dist/queries/unused-params.js",
|
|
228
|
+
"types": "./dist/queries/unused-params.d.ts"
|
|
229
|
+
},
|
|
198
230
|
"./queries/wrapper-candidates": {
|
|
199
231
|
"import": "./dist/queries/wrapper-candidates.js",
|
|
200
232
|
"types": "./dist/queries/wrapper-candidates.d.ts"
|
|
@@ -216,6 +248,7 @@
|
|
|
216
248
|
"typecheck": "tsc --noEmit",
|
|
217
249
|
"lint": "eslint src tests tsup.config.ts",
|
|
218
250
|
"calibrate": "node scripts/accuracy-calibration.mjs",
|
|
251
|
+
"docs:commands": "vite-node scripts/render-command-reference.ts",
|
|
219
252
|
"prepublishOnly": "npm run build",
|
|
220
253
|
"postinstall": "node dist/postinstall.js || true"
|
|
221
254
|
},
|