brainbank 0.8.2 → 0.8.4

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.
@@ -3014,6 +3014,13 @@ async function resolveEmbeddingKey(key) {
3014
3014
  }
3015
3015
  __name(resolveEmbeddingKey, "resolveEmbeddingKey");
3016
3016
  async function setupProviders(brainOpts, config, flags, env) {
3017
+ const keys = config?.keys ?? {};
3018
+ const anthropicKey = keys.anthropic || process.env.ANTHROPIC_API_KEY;
3019
+ const perplexityKey = keys.perplexity || process.env.PERPLEXITY_API_KEY;
3020
+ const openaiKey = keys.openai || process.env.OPENAI_API_KEY;
3021
+ if (anthropicKey) process.env.ANTHROPIC_API_KEY = anthropicKey;
3022
+ if (perplexityKey) process.env.PERPLEXITY_API_KEY = perplexityKey;
3023
+ if (openaiKey) process.env.OPENAI_API_KEY = openaiKey;
3017
3024
  const rerankerFlag = flags?.reranker ?? config?.reranker;
3018
3025
  if (rerankerFlag === "qwen3") {
3019
3026
  const { Qwen3Reranker } = await import("./qwen3-reranker-HVIQOLKS.js");
@@ -3022,13 +3029,13 @@ async function setupProviders(brainOpts, config, flags, env) {
3022
3029
  const prunerFlag = flags?.pruner ?? config?.pruner;
3023
3030
  if (prunerFlag === "haiku") {
3024
3031
  const { HaikuPruner } = await import("./haiku-pruner-DB77ZQLJ.js");
3025
- brainOpts.pruner = new HaikuPruner();
3032
+ brainOpts.pruner = new HaikuPruner({ apiKey: anthropicKey });
3026
3033
  }
3027
3034
  const expanderFlag = flags?.expander ?? config?.expander;
3028
3035
  if (expanderFlag === "haiku") {
3029
3036
  try {
3030
3037
  const { HaikuExpander } = await import("./haiku-expander-WOVJIVXD.js");
3031
- brainOpts.expander = new HaikuExpander();
3038
+ brainOpts.expander = new HaikuExpander({ apiKey: anthropicKey });
3032
3039
  } catch {
3033
3040
  }
3034
3041
  }
@@ -3253,4 +3260,4 @@ export {
3253
3260
  resetFactoryCache,
3254
3261
  createBrain
3255
3262
  };
3256
- //# sourceMappingURL=chunk-JRVYSTMP.js.map
3263
+ //# sourceMappingURL=chunk-IB3X5D5Y.js.map