import { createOpenRouter } from "@openrouter/ai-sdk-provider"; import { personalAssistantAgent } from "./agents/personalAssistant.js"; import { chefAgent } from "./agents/chef.js"; import { Agent } from "./types.js"; // This declaration is primarily for providing type hints in your code interface Env { OPENROUTER_API_KEY: string; } declare global { const env: Env; } // Create OpenRouter instance export const openrouter = createOpenRouter({ apiKey: import.meta.env.VITE_OPENROUTER_API_KEY || env.OPENROUTER_API_KEY, }); // Define the agents by ID export const agentsById: Record = { "personal-assistant": personalAssistantAgent, chef: chefAgent, }; // Helper function to get an agent by ID export function getAgentById(agentId: string): Agent | undefined { return agentsById[agentId]; }