@link-assistant/agent 0.1.1 → 0.1.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/agent",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "A minimal, public domain AI CLI agent compatible with OpenCode's JSON interface. Bun-only runtime.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -599,14 +599,14 @@ export namespace Provider {
599
599
  // load env
600
600
  for (const [providerID, provider] of Object.entries(database)) {
601
601
  if (disabled.has(providerID)) continue;
602
- const apiKey = provider.env.map((item) => process.env[item]).at(0);
602
+ // Find the first truthy env var (supports multiple env var options like Google's
603
+ // GOOGLE_GENERATIVE_AI_API_KEY and GEMINI_API_KEY)
604
+ const apiKey = provider.env
605
+ .map((item) => process.env[item])
606
+ .find(Boolean);
603
607
  if (!apiKey) continue;
604
- mergeProvider(
605
- providerID,
606
- // only include apiKey if there's only one potential option
607
- provider.env.length === 1 ? { apiKey } : {},
608
- 'env'
609
- );
608
+ // Always pass the API key - the provider SDK needs it for authentication
609
+ mergeProvider(providerID, { apiKey }, 'env');
610
610
  }
611
611
 
612
612
  // load apikeys