@backbencher/brain 0.0.0-stage → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +298 -0
- package/EMBEDDINGS.md +355 -0
- package/LICENSE +21 -0
- package/README.md +415 -2
- package/bin/bb +13 -0
- package/dist/analysis-exclusions-7ZJDXOVZ.js +35 -0
- package/dist/brain-index-health-Q5APTJQL.js +17 -0
- package/dist/brain-relationship-enrichment-MYR2AM4F.js +558 -0
- package/dist/brain.sql-EIM4WS4D.js +29 -0
- package/dist/chunk-22V37YTK.js +1758 -0
- package/dist/chunk-2BSKD7O3.js +40 -0
- package/dist/chunk-2DE27DVC.js +1314 -0
- package/dist/chunk-2RRBMNBQ.js +322 -0
- package/dist/chunk-2WXYNLBA.js +29 -0
- package/dist/chunk-3CTFIJJB.js +17 -0
- package/dist/chunk-3ZTOHHSW.js +2104 -0
- package/dist/chunk-4H22TLOT.js +543 -0
- package/dist/chunk-5BVAH26D.js +340 -0
- package/dist/chunk-62DHLYW6.js +3427 -0
- package/dist/chunk-7AN7U5IZ.js +371 -0
- package/dist/chunk-7DRPNVIN.js +782 -0
- package/dist/chunk-7MBYT777.js +174 -0
- package/dist/chunk-AHDWGM7Q.js +236 -0
- package/dist/chunk-B5GEAAYF.js +818 -0
- package/dist/chunk-BEIZZ73B.js +1479 -0
- package/dist/chunk-BQ3OVQ3P.js +125 -0
- package/dist/chunk-D2Q4Y47A.js +53 -0
- package/dist/chunk-DIYAGQJL.js +34 -0
- package/dist/chunk-DWKXZ6IF.js +336 -0
- package/dist/chunk-DYM4FQEE.js +90 -0
- package/dist/chunk-ENW4BTBA.js +930 -0
- package/dist/chunk-EWMWK7WN.js +75 -0
- package/dist/chunk-EY5ZZUUA.js +626 -0
- package/dist/chunk-GBI7V7KY.js +69 -0
- package/dist/chunk-GEFFO6O2.js +152 -0
- package/dist/chunk-HJEWO5EV.js +247 -0
- package/dist/chunk-HQSPJDHI.js +613 -0
- package/dist/chunk-KAET47ZL.js +125 -0
- package/dist/chunk-KCDECRJY.js +440 -0
- package/dist/chunk-L5TDYKYK.js +76 -0
- package/dist/chunk-MLKGABMK.js +9 -0
- package/dist/chunk-NO3U3FJQ.js +201 -0
- package/dist/chunk-OWISBAOF.js +61 -0
- package/dist/chunk-QKTRECYS.js +1119 -0
- package/dist/chunk-QLK6ED4Q.js +235 -0
- package/dist/chunk-R2GW4F6R.js +19 -0
- package/dist/chunk-RCMTFSEF.js +87 -0
- package/dist/chunk-RM3PY6TG.js +376 -0
- package/dist/chunk-ROMM6KMC.js +433 -0
- package/dist/chunk-SGGCSHAX.js +12050 -0
- package/dist/chunk-SK6YVHFZ.js +211 -0
- package/dist/chunk-SM7RFQRO.js +214 -0
- package/dist/chunk-UGR4QIGS.js +67 -0
- package/dist/chunk-UQNQZXHY.js +711 -0
- package/dist/chunk-UUNHHX4M.js +13 -0
- package/dist/chunk-VL52PL2T.js +71 -0
- package/dist/chunk-WIG36E67.js +196 -0
- package/dist/chunk-XHK3WWGB.js +7436 -0
- package/dist/chunk-XTQM2IP3.js +2863 -0
- package/dist/chunk-ZE2LG76D.js +1296 -0
- package/dist/chunk-ZETTGPAW.js +6950 -0
- package/dist/cli/index.js +37 -0
- package/dist/config-HZAAYDP3.js +10 -0
- package/dist/content-search-7XIP555Q.js +593 -0
- package/dist/database-76RP44JG.js +9 -0
- package/dist/doctor-ANGETYMN.js +395 -0
- package/dist/edit-engine-CG72LDZD.js +51 -0
- package/dist/engine-BKEOGN7N.js +11 -0
- package/dist/engine-VIW6NSKO.js +18 -0
- package/dist/fingerprint-OBLIMZLP.js +33 -0
- package/dist/framework-intelligence-3LORTPOX.js +860 -0
- package/dist/freshness-3K6VU5OT.js +174 -0
- package/dist/graph-engine-HBSQNPTB.js +21 -0
- package/dist/graph_request-Q6NKB6N2.js +350 -0
- package/dist/impact_request-LYP672WE.js +68 -0
- package/dist/index-space-IUUN5WYV.js +15 -0
- package/dist/index-status-7OVGYSGW.js +34 -0
- package/dist/index.js +159 -0
- package/dist/instance-FO6QZRLH.js +19 -0
- package/dist/language-detection-DFCAU5DZ.js +11 -0
- package/dist/lsp/server.js +4301 -0
- package/dist/mcp/server.js +132 -0
- package/dist/onboard-DIQZV2NW.js +161 -0
- package/dist/override-companion-pass-XR7MHTP7.js +117 -0
- package/dist/parallel-indexer-FK2XKZXY.js +88 -0
- package/dist/pool-worker.js +1153 -0
- package/dist/project-health-6XPENVAA.js +94 -0
- package/dist/project-index-5SDPHITE.js +57 -0
- package/dist/project-registry-ZJ3DVUGO.js +355 -0
- package/dist/real-bash-analyzer-EJAU5LW5.js +2201 -0
- package/dist/real-c-analyzer-HBD3FNNH.js +5942 -0
- package/dist/real-clean-analyzer-4EEZLPV5.js +3470 -0
- package/dist/real-clojure-analyzer-Q55EBOO2.js +2818 -0
- package/dist/real-cpp-analyzer-IVVOD25R.js +4101 -0
- package/dist/real-csharp-analyzer-ZBNLNJZJ.js +3298 -0
- package/dist/real-css-analyzer-6XRQLUN7.js +15 -0
- package/dist/real-dart-analyzer-OLR72EFW.js +3944 -0
- package/dist/real-elixir-analyzer-MQWGAH2I.js +2192 -0
- package/dist/real-erlang-analyzer-7BVPQEHO.js +1731 -0
- package/dist/real-fsharp-analyzer-C2UPFNOA.js +2390 -0
- package/dist/real-go-analyzer-UKGI43YS.js +4126 -0
- package/dist/real-graphql-analyzer-VE2EEFII.js +1442 -0
- package/dist/real-groovy-analyzer-W26VACFW.js +2285 -0
- package/dist/real-haskell-analyzer-5CVVAJRX.js +2533 -0
- package/dist/real-hcl-analyzer-5ZT4U43N.js +725 -0
- package/dist/real-html-analyzer-JWNX3C6I.js +1759 -0
- package/dist/real-java-analyzer-GU42VBGQ.js +4677 -0
- package/dist/real-javascript-analyzer-QA4QOJ6W.js +14 -0
- package/dist/real-json-analyzer-MPA6PRXL.js +1640 -0
- package/dist/real-julia-analyzer-22CWYQMN.js +2085 -0
- package/dist/real-kotlin-analyzer-QDZJLXXU.js +3956 -0
- package/dist/real-lua-analyzer-G7NHLYKS.js +1957 -0
- package/dist/real-makefile-analyzer-OCY3GT5N.js +920 -0
- package/dist/real-markdown-analyzer-TEJK2JXJ.js +1215 -0
- package/dist/real-matlab-analyzer-Q5SWLN7Z.js +480 -0
- package/dist/real-nim-analyzer-YLXSK563.js +3603 -0
- package/dist/real-objective-c-analyzer-D23ACC2R.js +1518 -0
- package/dist/real-perl-analyzer-WWTRHYDT.js +1865 -0
- package/dist/real-php-analyzer-JNKJHTCL.js +9368 -0
- package/dist/real-powershell-analyzer-XRSNQERV.js +2915 -0
- package/dist/real-protobuf-analyzer-3OKUCZ7T.js +867 -0
- package/dist/real-python-analyzer-VXAFWI72.js +4880 -0
- package/dist/real-r-analyzer-ZGAIDVI4.js +2596 -0
- package/dist/real-ruby-analyzer-X2KTLVBH.js +2429 -0
- package/dist/real-rust-analyzer-OFFHPL2A.js +3359 -0
- package/dist/real-scala-analyzer-TSTW27J6.js +3293 -0
- package/dist/real-scss-analyzer-AVWYPSOQ.js +1515 -0
- package/dist/real-solidity-analyzer-UCI2KWUB.js +2608 -0
- package/dist/real-sql-analyzer-F77ZMQXR.js +3840 -0
- package/dist/real-svelte-analyzer-SF7NRUO5.js +2532 -0
- package/dist/real-swift-analyzer-MN5QT3QN.js +2311 -0
- package/dist/real-toml-analyzer-66L7BDCQ.js +929 -0
- package/dist/real-typescript-analyzer-6KEMVDWQ.js +14 -0
- package/dist/real-vb-analyzer-VICVPOP7.js +3145 -0
- package/dist/real-vba-analyzer-HXLTTHKM.js +466 -0
- package/dist/real-vue-analyzer-QXR56CFV.js +2680 -0
- package/dist/real-xml-analyzer-YL465ZJW.js +2405 -0
- package/dist/real-yaml-analyzer-SUBCBNSI.js +3528 -0
- package/dist/real-zig-analyzer-HIQLZMGY.js +2430 -0
- package/dist/regex-search-NJKHMZNO.js +239 -0
- package/dist/rules-ACHPB7QU.js +152 -0
- package/dist/scoped-path-MJYWJZQX.js +11 -0
- package/dist/setup-show-NT5ZHYNE.js +15 -0
- package/dist/setup-wizard-G5YYR5T6.js +24 -0
- package/dist/symbol-search-GZJIM2J2.js +16 -0
- package/dist/taint-KXUHHPIE.js +202 -0
- package/dist/taint-analyzer-N7YLZU3N.js +163 -0
- package/dist/tool-handlers-OJDC35DI.js +72 -0
- package/dist/tool-registry-BPEJNSZG.js +17 -0
- package/dist/tool-validation-Q57YMMBX.js +32 -0
- package/dist/type-inference-QMT2RMLV.js +13 -0
- package/dist/vector-binary-LMY4QGAN.js +19 -0
- package/dist/version-ABP2TUL2.js +9 -0
- package/dist/wasm-NMWO3WXY.js +16 -0
- package/docs/EMBEDDINGS.md +132 -0
- package/docs/README.md +178 -0
- package/docs/data/m10-baseline.json +602 -0
- package/docs/data/m10-benchmark-baseline.json +57 -0
- package/docs/data/m10-benchmark-last-run.json +127 -0
- package/docs/data/m10-final-audit.json +215 -0
- package/docs/data/m12-final-audit.json +138 -0
- package/docs/data/m12-surface-matrix.json +50 -0
- package/docs/data/public-tools.json +1902 -0
- package/docs/indexing/DEAD-ASSETS.md +88 -0
- package/docs/indexing/INDEXER-REVIEW.md +634 -0
- package/docs/indexing/PERFORMANCE-FINDINGS.md +106 -0
- package/docs/indexing/README.md +427 -0
- package/docs/indexing/discovery-matrix.md +41 -0
- package/docs/indexing/embeddings.md +325 -0
- package/docs/indexing/environment-variables.md +77 -0
- package/docs/indexing/performance.md +323 -0
- package/docs/indexing/resume.md +345 -0
- package/docs/indexing/troubleshooting.md +391 -0
- package/docs/man/bb.1 +190 -0
- package/docs/tools/bb_analyze.md +147 -0
- package/docs/tools/bb_annotate.md +110 -0
- package/docs/tools/bb_annotations.md +106 -0
- package/docs/tools/bb_ask.md +101 -0
- package/docs/tools/bb_cross_language.md +103 -0
- package/docs/tools/bb_doc.md +169 -0
- package/docs/tools/bb_edit.md +185 -0
- package/docs/tools/bb_graph.md +169 -0
- package/docs/tools/bb_health.md +156 -0
- package/docs/tools/bb_impact.md +117 -0
- package/docs/tools/bb_index.md +108 -0
- package/docs/tools/bb_migrate.md +135 -0
- package/docs/tools/bb_patterns.md +140 -0
- package/docs/tools/bb_search.md +150 -0
- package/docs/tools/bb_security.md +100 -0
- package/docs/tools/bb_visualize.md +184 -0
- package/grammars/README.md +57 -0
- package/grammars/THIRD-PARTY-NOTICES.md +50 -0
- package/grammars/tree-sitter-c/LICENSE +21 -0
- package/grammars/tree-sitter-clojure/LICENSE.md +21 -0
- package/grammars/tree-sitter-cpp/LICENSE +21 -0
- package/grammars/tree-sitter-csharp/LICENSE +21 -0
- package/grammars/tree-sitter-css/LICENSE +21 -0
- package/grammars/tree-sitter-css/README.md +21 -0
- package/grammars/tree-sitter-dart/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/LICENSE +20 -0
- package/grammars/tree-sitter-dart-upstream/README.md +18 -0
- package/grammars/tree-sitter-elixir/LICENSE +176 -0
- package/grammars/tree-sitter-elixir/README.md +11 -0
- package/grammars/tree-sitter-fsharp/LICENSE +21 -0
- package/grammars/tree-sitter-fsharp/README.md +45 -0
- package/grammars/tree-sitter-graphql/LICENSE +21 -0
- package/grammars/tree-sitter-graphql/README.md +106 -0
- package/grammars/tree-sitter-groovy/LICENSE +21 -0
- package/grammars/tree-sitter-groovy/README.md +4 -0
- package/grammars/tree-sitter-haskell/LICENSE +21 -0
- package/grammars/tree-sitter-haskell/README.md +394 -0
- package/grammars/tree-sitter-hcl/CHANGELOG.md +102 -0
- package/grammars/tree-sitter-hcl/LICENSE +201 -0
- package/grammars/tree-sitter-hcl/README.md +39 -0
- package/grammars/tree-sitter-html/LICENSE +21 -0
- package/grammars/tree-sitter-html/README.md +21 -0
- package/grammars/tree-sitter-julia/LICENSE +21 -0
- package/grammars/tree-sitter-julia/README.md +24 -0
- package/grammars/tree-sitter-kotlin/LICENSE +9 -0
- package/grammars/tree-sitter-lua/LICENSE.md +21 -0
- package/grammars/tree-sitter-lua/README.md +29 -0
- package/grammars/tree-sitter-make/LICENSE +21 -0
- package/grammars/tree-sitter-matlab/LICENSE +19 -0
- package/grammars/tree-sitter-matlab/README.md +99 -0
- package/grammars/tree-sitter-nim/LICENSE +373 -0
- package/grammars/tree-sitter-nim/README.md +46 -0
- package/grammars/tree-sitter-objc/LICENSE +21 -0
- package/grammars/tree-sitter-objc/README.md +20 -0
- package/grammars/tree-sitter-perl/LICENSE +7 -0
- package/grammars/tree-sitter-perl/README.md +100 -0
- package/grammars/tree-sitter-powershell/LICENSE +21 -0
- package/grammars/tree-sitter-powershell/README.md +7 -0
- package/grammars/tree-sitter-proto/LICENSE +21 -0
- package/grammars/tree-sitter-proto/README.md +105 -0
- package/grammars/tree-sitter-r/LICENSE +9 -0
- package/grammars/tree-sitter-r/README.md +66 -0
- package/grammars/tree-sitter-ruby/LICENSE +22 -0
- package/grammars/tree-sitter-scss/LICENSE +21 -0
- package/grammars/tree-sitter-scss/README.md +17 -0
- package/grammars/tree-sitter-solidity/LICENSE +7 -0
- package/grammars/tree-sitter-sql/LICENSE +21 -0
- package/grammars/tree-sitter-typescript/LICENSE +21 -0
- package/grammars/tree-sitter-vba/LICENSE +21 -0
- package/grammars/tree-sitter-vba/README.md +738 -0
- package/grammars/tree-sitter-vbnet/LICENSE +21 -0
- package/grammars/tree-sitter-vbnet/README.md +322 -0
- package/grammars/tree-sitter-xml/LICENSE +19 -0
- package/grammars/tree-sitter-yaml/LICENSE +20 -0
- package/grammars/tree-sitter-yaml/README.md +21 -0
- package/package.json +184 -4
- package/wasm/dart.wasm +0 -0
- package/wasm/tree-sitter-bash.wasm +0 -0
- package/wasm/tree-sitter-c.wasm +0 -0
- package/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/wasm/tree-sitter-clean.wasm +0 -0
- package/wasm/tree-sitter-clojure.wasm +0 -0
- package/wasm/tree-sitter-core_schema.wasm +0 -0
- package/wasm/tree-sitter-cpp.wasm +0 -0
- package/wasm/tree-sitter-css.wasm +0 -0
- package/wasm/tree-sitter-dart.wasm +0 -0
- package/wasm/tree-sitter-elisp.wasm +0 -0
- package/wasm/tree-sitter-elixir.wasm +0 -0
- package/wasm/tree-sitter-elm.wasm +0 -0
- package/wasm/tree-sitter-embedded_template.wasm +0 -0
- package/wasm/tree-sitter-erlang.wasm +0 -0
- package/wasm/tree-sitter-fsharp.wasm +0 -0
- package/wasm/tree-sitter-fsharp_signature.wasm +0 -0
- package/wasm/tree-sitter-go.wasm +0 -0
- package/wasm/tree-sitter-graphql.wasm +0 -0
- package/wasm/tree-sitter-groovy.wasm +0 -0
- package/wasm/tree-sitter-haskell.wasm +0 -0
- package/wasm/tree-sitter-hcl.wasm +0 -0
- package/wasm/tree-sitter-html.wasm +0 -0
- package/wasm/tree-sitter-java.wasm +0 -0
- package/wasm/tree-sitter-javascript.wasm +0 -0
- package/wasm/tree-sitter-json.wasm +0 -0
- package/wasm/tree-sitter-json_schema.wasm +0 -0
- package/wasm/tree-sitter-julia.wasm +0 -0
- package/wasm/tree-sitter-kotlin.wasm +0 -0
- package/wasm/tree-sitter-lua.wasm +0 -0
- package/wasm/tree-sitter-make.wasm +0 -0
- package/wasm/tree-sitter-markdown.wasm +0 -0
- package/wasm/tree-sitter-markdown_inline.wasm +0 -0
- package/wasm/tree-sitter-matlab.wasm +0 -0
- package/wasm/tree-sitter-nim.wasm +0 -0
- package/wasm/tree-sitter-objc.wasm +0 -0
- package/wasm/tree-sitter-ocaml.wasm +0 -0
- package/wasm/tree-sitter-perl.wasm +0 -0
- package/wasm/tree-sitter-php.wasm +0 -0
- package/wasm/tree-sitter-php_only.wasm +0 -0
- package/wasm/tree-sitter-powershell.wasm +0 -0
- package/wasm/tree-sitter-protobuf.wasm +0 -0
- package/wasm/tree-sitter-python.wasm +0 -0
- package/wasm/tree-sitter-ql.wasm +0 -0
- package/wasm/tree-sitter-r.wasm +0 -0
- package/wasm/tree-sitter-rescript.wasm +0 -0
- package/wasm/tree-sitter-ruby.wasm +0 -0
- package/wasm/tree-sitter-rust.wasm +0 -0
- package/wasm/tree-sitter-scala.wasm +0 -0
- package/wasm/tree-sitter-scss.wasm +0 -0
- package/wasm/tree-sitter-solidity.wasm +0 -0
- package/wasm/tree-sitter-sql.wasm +0 -0
- package/wasm/tree-sitter-svelte.wasm +0 -0
- package/wasm/tree-sitter-swift.wasm +0 -0
- package/wasm/tree-sitter-systemrdl.wasm +0 -0
- package/wasm/tree-sitter-terraform.wasm +0 -0
- package/wasm/tree-sitter-tlaplus.wasm +0 -0
- package/wasm/tree-sitter-toml.wasm +0 -0
- package/wasm/tree-sitter-tsx.wasm +0 -0
- package/wasm/tree-sitter-typescript.wasm +0 -0
- package/wasm/tree-sitter-vba.wasm +0 -0
- package/wasm/tree-sitter-vbnet.wasm +0 -0
- package/wasm/tree-sitter-vue.wasm +0 -0
- package/wasm/tree-sitter-xml.wasm +0 -0
- package/wasm/tree-sitter-yaml.wasm +0 -0
- package/wasm/tree-sitter-zig.wasm +0 -0
- package/wasm/tree-sitter.wasm +0 -0
- package/wasm/tsx.wasm +0 -0
- package/wasm/typescript.wasm +0 -0
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bbWasmCandidates,
|
|
3
|
+
bbWasmDirs
|
|
4
|
+
} from "./chunk-2BSKD7O3.js";
|
|
5
|
+
|
|
6
|
+
// src/util/wasm.ts
|
|
7
|
+
import { createRequire } from "module";
|
|
8
|
+
import { existsSync, readFileSync, readdirSync } from "fs";
|
|
9
|
+
import { join, dirname } from "path";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
var require2 = createRequire(import.meta.url);
|
|
12
|
+
var __filename = fileURLToPath(import.meta.url);
|
|
13
|
+
var __dirname = dirname(__filename);
|
|
14
|
+
var _wtsModule = null;
|
|
15
|
+
var _wasmRegistry = {};
|
|
16
|
+
var _wasiShimInstalled = false;
|
|
17
|
+
function installWasiShim() {
|
|
18
|
+
if (_wasiShimInstalled) return;
|
|
19
|
+
_wasiShimInstalled = true;
|
|
20
|
+
let currentImports = null;
|
|
21
|
+
const memOf = () => currentImports?.env?.memory;
|
|
22
|
+
const view = () => {
|
|
23
|
+
const mem = memOf();
|
|
24
|
+
return mem ? new DataView(mem.buffer) : null;
|
|
25
|
+
};
|
|
26
|
+
const writeInt32 = (ptr, value) => {
|
|
27
|
+
const v = view();
|
|
28
|
+
if (v && Number.isFinite(ptr)) v.setInt32(ptr, value, true);
|
|
29
|
+
};
|
|
30
|
+
const writeBigInt = (ptr, value) => {
|
|
31
|
+
const v = view();
|
|
32
|
+
if (v && Number.isFinite(ptr)) v.setBigUint64(ptr, value, true);
|
|
33
|
+
};
|
|
34
|
+
const wasi = {
|
|
35
|
+
clock_time_get: (_clockId, _precisionPtr, timePtr) => {
|
|
36
|
+
writeBigInt(timePtr, BigInt(Date.now()) * 1000000n);
|
|
37
|
+
return 0;
|
|
38
|
+
},
|
|
39
|
+
proc_exit: () => {
|
|
40
|
+
},
|
|
41
|
+
fd_write: (_fd, _iov, _iovcnt, pnum) => {
|
|
42
|
+
writeInt32(pnum, 0);
|
|
43
|
+
return 0;
|
|
44
|
+
},
|
|
45
|
+
fd_read: () => -1,
|
|
46
|
+
fd_close: () => 0,
|
|
47
|
+
fd_seek: () => -1,
|
|
48
|
+
fd_fdstat_get: () => -1,
|
|
49
|
+
fd_fdstat_set_flags: () => -1,
|
|
50
|
+
fd_prestat_get: () => -1,
|
|
51
|
+
fd_prestat_dir_name: () => -1,
|
|
52
|
+
fd_sync: () => -1,
|
|
53
|
+
random_get: (buf, len) => {
|
|
54
|
+
const v = view();
|
|
55
|
+
if (v) for (let i = 0; i < len; i++) v.setUint8(buf + i, Math.floor(Math.random() * 256));
|
|
56
|
+
return 0;
|
|
57
|
+
},
|
|
58
|
+
environ_get: () => 0,
|
|
59
|
+
environ_sizes_get: (countPtr, sizePtr) => {
|
|
60
|
+
writeInt32(countPtr, 0);
|
|
61
|
+
writeInt32(sizePtr, 0);
|
|
62
|
+
return 0;
|
|
63
|
+
},
|
|
64
|
+
args_get: () => 0,
|
|
65
|
+
args_sizes_get: (countPtr, sizePtr) => {
|
|
66
|
+
writeInt32(countPtr, 0);
|
|
67
|
+
writeInt32(sizePtr, 0);
|
|
68
|
+
return 0;
|
|
69
|
+
},
|
|
70
|
+
sched_yield: () => 0,
|
|
71
|
+
poll_oneoff: () => 0,
|
|
72
|
+
path_open: () => -1,
|
|
73
|
+
path_filestat_get: () => -1,
|
|
74
|
+
path_filestat_set_times: () => -1,
|
|
75
|
+
path_create_directory: () => -1,
|
|
76
|
+
path_remove_directory: () => -1,
|
|
77
|
+
path_unlink_file: () => -1,
|
|
78
|
+
path_rename: () => -1,
|
|
79
|
+
path_link: () => -1,
|
|
80
|
+
path_symlink: () => -1,
|
|
81
|
+
path_readlink: () => -1,
|
|
82
|
+
path_filestat_set_size: () => -1,
|
|
83
|
+
clock_res_get: (_clockId, resPtr) => {
|
|
84
|
+
writeBigInt(resPtr, 1000000n);
|
|
85
|
+
return 0;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const patchImports = (imports) => {
|
|
89
|
+
if (!imports || typeof imports !== "object") return imports;
|
|
90
|
+
currentImports = imports;
|
|
91
|
+
if (imports.wasi_snapshot_preview1) {
|
|
92
|
+
imports.wasi_snapshot_preview1 = { ...imports.wasi_snapshot_preview1, ...wasi };
|
|
93
|
+
}
|
|
94
|
+
return imports;
|
|
95
|
+
};
|
|
96
|
+
const origInstantiate = WebAssembly.instantiate;
|
|
97
|
+
const origInstantiateStreaming = WebAssembly.instantiateStreaming;
|
|
98
|
+
WebAssembly.instantiate = async (bytes, imports) => {
|
|
99
|
+
if (imports) imports = patchImports(imports);
|
|
100
|
+
return origInstantiate.call(WebAssembly, bytes, imports);
|
|
101
|
+
};
|
|
102
|
+
WebAssembly.instantiateStreaming = async (resp, imports) => {
|
|
103
|
+
if (imports) imports = patchImports(imports);
|
|
104
|
+
return origInstantiateStreaming.call(WebAssembly, resp, imports);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
function tryLoadWasm(name) {
|
|
108
|
+
if (_wasmRegistry[name]) return;
|
|
109
|
+
const paths = bbWasmCandidates(dirname(fileURLToPath(import.meta.url)), name);
|
|
110
|
+
for (const p of paths) {
|
|
111
|
+
if (existsSync(p)) {
|
|
112
|
+
try {
|
|
113
|
+
_wasmRegistry[name] = new Uint8Array(readFileSync(p));
|
|
114
|
+
return;
|
|
115
|
+
} catch {
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function ensureWasmRegistry() {
|
|
121
|
+
const dirs = bbWasmDirs(__dirname);
|
|
122
|
+
for (const wasmDir of dirs) {
|
|
123
|
+
if (existsSync(wasmDir)) {
|
|
124
|
+
try {
|
|
125
|
+
const files = (await import("fs")).readdirSync(wasmDir);
|
|
126
|
+
for (const f of files) {
|
|
127
|
+
if (f.endsWith(".wasm") && !_wasmRegistry[f]) {
|
|
128
|
+
try {
|
|
129
|
+
_wasmRegistry[f] = new Uint8Array(readFileSync(join(wasmDir, f)));
|
|
130
|
+
} catch {
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
} catch {
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
async function loadWebTreeSitter() {
|
|
140
|
+
if (!_wtsModule) {
|
|
141
|
+
installWasiShim();
|
|
142
|
+
_wtsModule = await import("web-tree-sitter");
|
|
143
|
+
const initFn = _wtsModule.default?.init || _wtsModule.init;
|
|
144
|
+
if (initFn) {
|
|
145
|
+
const coreName = "tree-sitter.wasm";
|
|
146
|
+
const coreBytes = hasWasmInRegistry(coreName);
|
|
147
|
+
const coreAbs = resolveWasmAsset(coreName);
|
|
148
|
+
const initOptions = {};
|
|
149
|
+
if (coreBytes) initOptions.wasmBinary = coreBytes;
|
|
150
|
+
if (coreAbs !== coreName) initOptions.locateFile = () => coreAbs;
|
|
151
|
+
await initFn(initOptions);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
return _wtsModule;
|
|
155
|
+
}
|
|
156
|
+
function resolveWasmAsset(name) {
|
|
157
|
+
const wasmName = name.split("/").pop() || name;
|
|
158
|
+
const paths = bbWasmCandidates(dirname(fileURLToPath(import.meta.url)), wasmName);
|
|
159
|
+
for (const p of paths) {
|
|
160
|
+
if (existsSync(p)) return p;
|
|
161
|
+
}
|
|
162
|
+
return name;
|
|
163
|
+
}
|
|
164
|
+
function hasWasmInRegistry(name) {
|
|
165
|
+
const wasmName = name.split("/").pop() || name;
|
|
166
|
+
tryLoadWasm(wasmName);
|
|
167
|
+
if (_wasmRegistry[wasmName]) return _wasmRegistry[wasmName];
|
|
168
|
+
if (_wasmRegistry[name]) return _wasmRegistry[name];
|
|
169
|
+
const paths = bbWasmCandidates(dirname(fileURLToPath(import.meta.url)), wasmName);
|
|
170
|
+
for (const p of paths) {
|
|
171
|
+
if (existsSync(p)) {
|
|
172
|
+
try {
|
|
173
|
+
const data = new Uint8Array(readFileSync(p));
|
|
174
|
+
_wasmRegistry[wasmName] = data;
|
|
175
|
+
return data;
|
|
176
|
+
} catch {
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return void 0;
|
|
181
|
+
}
|
|
182
|
+
function isWasmRegistryLoaded() {
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
(function _autoLoadWasm() {
|
|
186
|
+
const dirs = bbWasmDirs(__dirname);
|
|
187
|
+
for (const wasmDir of dirs) {
|
|
188
|
+
if (existsSync(wasmDir)) {
|
|
189
|
+
try {
|
|
190
|
+
const files = readdirSync(wasmDir);
|
|
191
|
+
for (const f of files) {
|
|
192
|
+
if (f.endsWith(".wasm") && !_wasmRegistry[f]) {
|
|
193
|
+
try {
|
|
194
|
+
_wasmRegistry[f] = new Uint8Array(readFileSync(join(wasmDir, f)));
|
|
195
|
+
} catch {
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
} catch {
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
})();
|
|
204
|
+
|
|
205
|
+
export {
|
|
206
|
+
ensureWasmRegistry,
|
|
207
|
+
loadWebTreeSitter,
|
|
208
|
+
resolveWasmAsset,
|
|
209
|
+
hasWasmInRegistry,
|
|
210
|
+
isWasmRegistryLoaded
|
|
211
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isTestFileCandidate
|
|
3
|
+
} from "./chunk-L5TDYKYK.js";
|
|
4
|
+
import {
|
|
5
|
+
BrainFileTable,
|
|
6
|
+
BrainSymbolTable
|
|
7
|
+
} from "./chunk-ROMM6KMC.js";
|
|
8
|
+
import {
|
|
9
|
+
__export
|
|
10
|
+
} from "./chunk-MLKGABMK.js";
|
|
11
|
+
|
|
12
|
+
// src/ast/analysis-exclusions.ts
|
|
13
|
+
var analysis_exclusions_exports = {};
|
|
14
|
+
__export(analysis_exclusions_exports, {
|
|
15
|
+
AnalysisExclusions: () => analysis_exclusions_exports,
|
|
16
|
+
NON_CODE_LANGUAGES: () => NON_CODE_LANGUAGES,
|
|
17
|
+
analysisPathScopeSQL: () => analysisPathScopeSQL,
|
|
18
|
+
analysisScopeConditions: () => analysisScopeConditions,
|
|
19
|
+
analysisSymbolNameConditions: () => analysisSymbolNameConditions,
|
|
20
|
+
analysisSymbolNameScopeSQL: () => analysisSymbolNameScopeSQL,
|
|
21
|
+
isAnalysisExcluded: () => isAnalysisExcluded,
|
|
22
|
+
isHardNoisePath: () => isHardNoisePath,
|
|
23
|
+
isIndexArtifactName: () => isIndexArtifactName,
|
|
24
|
+
isIndexArtifactNameStrict: () => isIndexArtifactNameStrict,
|
|
25
|
+
isNoiseSymbolName: () => isNoiseSymbolName,
|
|
26
|
+
isNonCodeLanguage: () => isNonCodeLanguage,
|
|
27
|
+
isTestPath: () => isTestPath,
|
|
28
|
+
nonCodeLanguageSQL: () => nonCodeLanguageSQL
|
|
29
|
+
});
|
|
30
|
+
import { notLike, sql } from "drizzle-orm";
|
|
31
|
+
var NOISE_DIR_SEGMENTS = /* @__PURE__ */ new Set([
|
|
32
|
+
"baselines",
|
|
33
|
+
"snapshots",
|
|
34
|
+
"__snapshots__",
|
|
35
|
+
"__generated__",
|
|
36
|
+
"generated",
|
|
37
|
+
"gen",
|
|
38
|
+
"fixtures",
|
|
39
|
+
"node_modules",
|
|
40
|
+
"vendor",
|
|
41
|
+
"dist",
|
|
42
|
+
"build",
|
|
43
|
+
"coverage",
|
|
44
|
+
"__pycache__"
|
|
45
|
+
]);
|
|
46
|
+
var TEST_DIR_SEGMENTS = /* @__PURE__ */ new Set(["test", "tests", "__tests__", "spec", "specs", "e2e"]);
|
|
47
|
+
var NOISE_FILE_PATTERNS = [
|
|
48
|
+
/\.d\.[a-z]+$/,
|
|
49
|
+
/\.(min|-min)\.[a-z]+$/,
|
|
50
|
+
/\.(bundle|chunk)\.[a-z]+$/,
|
|
51
|
+
/\.map$/,
|
|
52
|
+
/\.(generated|gen)\.[a-z]+$/i,
|
|
53
|
+
/\.g\.(cs|ts|js|fs)$/i
|
|
54
|
+
// NOTE: .json is deliberately absent — the JSON analyzer is a verified
|
|
55
|
+
// contract (M12.34, P/R 1.000) whose module/class/property symbols must
|
|
56
|
+
// reach the read surface. Genuinely noisy JSON (package-lock.json,
|
|
57
|
+
// openapi.json, schema.json, *.min.json, Az.*.json, ...) is already
|
|
58
|
+
// excluded at INDEX time by ParallelIndexerConfig.skipPatterns.
|
|
59
|
+
];
|
|
60
|
+
var EXCLUDED_FILE_LIKES = [
|
|
61
|
+
"%.d.ts",
|
|
62
|
+
"%.d.mts",
|
|
63
|
+
"%.d.cts",
|
|
64
|
+
"%.min.%",
|
|
65
|
+
"%-min.%",
|
|
66
|
+
"%.bundle.%",
|
|
67
|
+
"%.chunk.%",
|
|
68
|
+
"%.generated.%",
|
|
69
|
+
"%.map"
|
|
70
|
+
];
|
|
71
|
+
function allExcludedSegments() {
|
|
72
|
+
return Array.from(/* @__PURE__ */ new Set([...NOISE_DIR_SEGMENTS, ...TEST_DIR_SEGMENTS]));
|
|
73
|
+
}
|
|
74
|
+
function isHardNoisePath(relativePath) {
|
|
75
|
+
const lower = relativePath.toLowerCase();
|
|
76
|
+
if (NOISE_FILE_PATTERNS.some((pattern) => pattern.test(lower))) return true;
|
|
77
|
+
return lower.split("/").some((segment) => NOISE_DIR_SEGMENTS.has(segment));
|
|
78
|
+
}
|
|
79
|
+
function isTestPath(relativePath) {
|
|
80
|
+
return isTestFileCandidate(relativePath);
|
|
81
|
+
}
|
|
82
|
+
var NON_CODE_LANGUAGES = /* @__PURE__ */ new Set([
|
|
83
|
+
"markdown",
|
|
84
|
+
"yaml",
|
|
85
|
+
"toml",
|
|
86
|
+
"json",
|
|
87
|
+
"xml",
|
|
88
|
+
"css",
|
|
89
|
+
"scss",
|
|
90
|
+
"less",
|
|
91
|
+
"html",
|
|
92
|
+
"htm",
|
|
93
|
+
"vue",
|
|
94
|
+
"svelte",
|
|
95
|
+
"ini",
|
|
96
|
+
"cfg",
|
|
97
|
+
"conf",
|
|
98
|
+
"properties",
|
|
99
|
+
"env",
|
|
100
|
+
"csv",
|
|
101
|
+
"tsv",
|
|
102
|
+
"text",
|
|
103
|
+
"plaintext",
|
|
104
|
+
"rst",
|
|
105
|
+
"tex",
|
|
106
|
+
"bib",
|
|
107
|
+
"org",
|
|
108
|
+
"adoc",
|
|
109
|
+
"asciidoc"
|
|
110
|
+
]);
|
|
111
|
+
function isNonCodeLanguage(language) {
|
|
112
|
+
return NON_CODE_LANGUAGES.has((language ?? "").toLowerCase());
|
|
113
|
+
}
|
|
114
|
+
function nonCodeLanguageSQL(fileAlias) {
|
|
115
|
+
const params = [...NON_CODE_LANGUAGES];
|
|
116
|
+
const placeholders = params.map(() => "?").join(",");
|
|
117
|
+
return { sql: `LOWER(COALESCE(${fileAlias}.language, '')) NOT IN (${placeholders})`, params };
|
|
118
|
+
}
|
|
119
|
+
function isAnalysisExcluded(relativePath) {
|
|
120
|
+
return isHardNoisePath(relativePath) || isTestPath(relativePath);
|
|
121
|
+
}
|
|
122
|
+
function isNoiseSymbolName(name) {
|
|
123
|
+
if (!name) return true;
|
|
124
|
+
if (name.length > 500) return true;
|
|
125
|
+
if (/^(anonymous|anon|unnamed)[_-]/i.test(name)) return true;
|
|
126
|
+
if (/^(block|lambda)[_-]\d+/i.test(name)) return true;
|
|
127
|
+
if (/^object_\d+$/.test(name)) return true;
|
|
128
|
+
if (/^(this|global|window|super|arguments|undefined|null)$/.test(name)) return true;
|
|
129
|
+
if (name.startsWith("/") && name.includes("/")) return true;
|
|
130
|
+
return false;
|
|
131
|
+
}
|
|
132
|
+
function isIndexArtifactName(name) {
|
|
133
|
+
if (!name) return true;
|
|
134
|
+
if (name.length > 500) return true;
|
|
135
|
+
if (/^(anonymous|anon|unnamed)[_-]/i.test(name)) return true;
|
|
136
|
+
if (/^(block|lambda)[_-]\d+/i.test(name)) return true;
|
|
137
|
+
if (/^object_\d+$/.test(name)) return true;
|
|
138
|
+
if (/^(this|global|window|super|arguments|undefined|null)$/.test(name)) return true;
|
|
139
|
+
if (name.startsWith("/") && name.includes("/")) return true;
|
|
140
|
+
return false;
|
|
141
|
+
}
|
|
142
|
+
function isIndexArtifactNameStrict(name) {
|
|
143
|
+
if (isIndexArtifactName(name)) return true;
|
|
144
|
+
if (name.includes('"') || name.includes("'")) return true;
|
|
145
|
+
if (name.startsWith("(")) return true;
|
|
146
|
+
if (/^[+-]?[.\d]/.test(name)) return true;
|
|
147
|
+
if (name.includes(" ") && !name.startsWith("operator")) return true;
|
|
148
|
+
return !/[\p{L}]/u.test(name);
|
|
149
|
+
}
|
|
150
|
+
function analysisScopeConditions() {
|
|
151
|
+
return [
|
|
152
|
+
sql`COALESCE(${BrainFileTable.is_test_file}, 0) = 0`,
|
|
153
|
+
...allExcludedSegments().flatMap((segment) => [
|
|
154
|
+
notLike(BrainFileTable.relative_path, `${segment}/%`),
|
|
155
|
+
notLike(BrainFileTable.relative_path, `%/${segment}/%`)
|
|
156
|
+
]),
|
|
157
|
+
...EXCLUDED_FILE_LIKES.map((pattern) => notLike(BrainFileTable.relative_path, pattern))
|
|
158
|
+
];
|
|
159
|
+
}
|
|
160
|
+
function analysisPathScopeSQL(...fileAliases) {
|
|
161
|
+
const clauses = [];
|
|
162
|
+
for (const alias of fileAliases) {
|
|
163
|
+
clauses.push(`COALESCE(${alias}.is_test_file, 0) = 0`);
|
|
164
|
+
for (const segment of allExcludedSegments()) {
|
|
165
|
+
clauses.push(`${alias}.relative_path NOT LIKE '${segment}/%'`);
|
|
166
|
+
clauses.push(`${alias}.relative_path NOT LIKE '%/${segment}/%'`);
|
|
167
|
+
}
|
|
168
|
+
for (const pattern of EXCLUDED_FILE_LIKES) {
|
|
169
|
+
clauses.push(`${alias}.relative_path NOT LIKE '${pattern}'`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return clauses.join(" AND ");
|
|
173
|
+
}
|
|
174
|
+
var NOISE_NAME_LIKES = ["anonymous%", "anon_%", "unnamed_%", "block_%", "lambda_%", "/%"];
|
|
175
|
+
var NOISE_NAME_GLOBS = ["object_[0-9]*"];
|
|
176
|
+
var NOISE_KEYWORD_NAMES = ["this", "global", "window", "super", "arguments", "undefined", "null"];
|
|
177
|
+
function analysisSymbolNameConditions() {
|
|
178
|
+
return [
|
|
179
|
+
...NOISE_NAME_LIKES.map((pattern) => notLike(BrainSymbolTable.name, pattern)),
|
|
180
|
+
...NOISE_NAME_GLOBS.map((pattern) => sql`${BrainSymbolTable.name} NOT GLOB ${pattern}`),
|
|
181
|
+
sql`${BrainSymbolTable.name} NOT IN (${sql.join(NOISE_KEYWORD_NAMES.map((k) => sql`${k}`), sql`, `)})`,
|
|
182
|
+
sql`LENGTH(${BrainSymbolTable.name}) < 200`,
|
|
183
|
+
// Symbols without a real location can't be jumped to — indexer artifacts.
|
|
184
|
+
sql`COALESCE(${BrainSymbolTable.line_start}, 0) > 0`,
|
|
185
|
+
// Absolute paths indexed as names (indexer artifact).
|
|
186
|
+
notLike(BrainSymbolTable.name, "/%/%")
|
|
187
|
+
];
|
|
188
|
+
}
|
|
189
|
+
function analysisSymbolNameScopeSQL(symbolAlias) {
|
|
190
|
+
const clauses = NOISE_NAME_LIKES.map((pattern) => `${symbolAlias}.name NOT LIKE '${pattern}'`);
|
|
191
|
+
clauses.push(...NOISE_NAME_GLOBS.map((pattern) => `${symbolAlias}.name NOT GLOB '${pattern}'`));
|
|
192
|
+
clauses.push(`${symbolAlias}.name NOT IN (${NOISE_KEYWORD_NAMES.map((k) => `'${k}'`).join(",")})`);
|
|
193
|
+
clauses.push(`LENGTH(${symbolAlias}.name) < 200`);
|
|
194
|
+
clauses.push(`COALESCE(${symbolAlias}.line_start, 0) > 0`);
|
|
195
|
+
clauses.push(`${symbolAlias}.name NOT LIKE '/%/%'`);
|
|
196
|
+
return clauses.join(" AND ");
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export {
|
|
200
|
+
isHardNoisePath,
|
|
201
|
+
isTestPath,
|
|
202
|
+
NON_CODE_LANGUAGES,
|
|
203
|
+
isNonCodeLanguage,
|
|
204
|
+
nonCodeLanguageSQL,
|
|
205
|
+
isAnalysisExcluded,
|
|
206
|
+
isNoiseSymbolName,
|
|
207
|
+
isIndexArtifactName,
|
|
208
|
+
isIndexArtifactNameStrict,
|
|
209
|
+
analysisScopeConditions,
|
|
210
|
+
analysisPathScopeSQL,
|
|
211
|
+
analysisSymbolNameConditions,
|
|
212
|
+
analysisSymbolNameScopeSQL,
|
|
213
|
+
analysis_exclusions_exports
|
|
214
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import {
|
|
2
|
+
bbDataDir
|
|
3
|
+
} from "./chunk-2BSKD7O3.js";
|
|
4
|
+
|
|
5
|
+
// src/config/config.ts
|
|
6
|
+
import path from "path";
|
|
7
|
+
import { existsSync, readFileSync } from "fs";
|
|
8
|
+
var cached = null;
|
|
9
|
+
function readJson(p) {
|
|
10
|
+
try {
|
|
11
|
+
if (existsSync(p)) return JSON.parse(readFileSync(p, "utf8"));
|
|
12
|
+
} catch {
|
|
13
|
+
}
|
|
14
|
+
return null;
|
|
15
|
+
}
|
|
16
|
+
function resolveEmbeddingConfig(fileConfig) {
|
|
17
|
+
const pick = (envVar, fileKey, fallback) => {
|
|
18
|
+
const env = process.env[envVar];
|
|
19
|
+
if (env) return [env, `env:${envVar}`];
|
|
20
|
+
const file = fileConfig[fileKey];
|
|
21
|
+
if (typeof file === "string" && file) return [file, `file:${fileKey}`];
|
|
22
|
+
return [fallback, "default"];
|
|
23
|
+
};
|
|
24
|
+
const [baseURL, baseURLSrc] = pick("BB_EMBEDDING_BASE_URL", "embedding_base_url", "https://api.openai.com/v1");
|
|
25
|
+
const [model, modelSrc] = pick("BB_EMBEDDING_MODEL", "embedding_model", "text-embedding-3-small");
|
|
26
|
+
const [apiKey, apiKeySrc] = pick("BB_EMBEDDING_API_KEY", "embedding_api_key", "");
|
|
27
|
+
return {
|
|
28
|
+
baseURL: baseURL.replace(/\/+$/, ""),
|
|
29
|
+
model,
|
|
30
|
+
apiKey,
|
|
31
|
+
configured: baseURLSrc !== "default" && modelSrc !== "default",
|
|
32
|
+
sources: { baseURL: baseURLSrc, model: modelSrc, apiKey: apiKeySrc }
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
function withEnvironmentOverrides(config) {
|
|
36
|
+
const eff = resolveEmbeddingConfig(config);
|
|
37
|
+
const merged = { ...config };
|
|
38
|
+
if (eff.configured) {
|
|
39
|
+
merged.embedding_base_url = eff.baseURL;
|
|
40
|
+
merged.embedding_model = eff.model;
|
|
41
|
+
merged.embedding_api_key = eff.apiKey;
|
|
42
|
+
}
|
|
43
|
+
if (process.env.BB_PROVIDER) merged.provider = process.env.BB_PROVIDER;
|
|
44
|
+
return merged;
|
|
45
|
+
}
|
|
46
|
+
var Config;
|
|
47
|
+
((Config2) => {
|
|
48
|
+
async function get() {
|
|
49
|
+
if (cached) return withEnvironmentOverrides(cached);
|
|
50
|
+
const home = readJson(path.join(bbDataDir(), "config.json"));
|
|
51
|
+
const local = readJson(path.join(process.cwd(), "bb.json"));
|
|
52
|
+
const explicit = process.env.BB_CONFIG_FILE ? readJson(path.resolve(process.env.BB_CONFIG_FILE)) : null;
|
|
53
|
+
const merged = { ...home ?? {}, ...local ?? {}, ...explicit ?? {} };
|
|
54
|
+
cached = merged;
|
|
55
|
+
return withEnvironmentOverrides(merged);
|
|
56
|
+
}
|
|
57
|
+
Config2.get = get;
|
|
58
|
+
function clearCache() {
|
|
59
|
+
cached = null;
|
|
60
|
+
}
|
|
61
|
+
Config2.clearCache = clearCache;
|
|
62
|
+
})(Config || (Config = {}));
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
resolveEmbeddingConfig,
|
|
66
|
+
Config
|
|
67
|
+
};
|