@agentdao/core
Version:
Core functionality, skills, and ready-made UI components for AgentDAO - Web3 subscriptions, content generation, social media, help support, live chat, RSS fetching, web search, and agent pricing integration
92 lines (91 loc) • 2.37 kB
TypeScript
/**
* Environment Configuration Utility
*
* This utility helps users configure their API keys and provides helpful error messages
* when required keys are missing.
*/
export interface EnvConfig {
openai?: {
apiKey?: string;
model?: string;
};
google?: {
apiKey?: string;
searchEngineId?: string;
};
bing?: {
apiKey?: string;
};
newsapi?: {
apiKey?: string;
};
database?: {
endpoint?: string;
apiKey?: string;
};
twitter?: {
apiKey?: string;
apiSecret?: string;
accessToken?: string;
accessTokenSecret?: string;
};
unsplash?: {
accessKey?: string;
};
blockchain?: {
ethereumRpcUrl?: string;
polygonRpcUrl?: string;
arbitrumRpcUrl?: string;
};
demoMode?: boolean;
}
export declare class EnvConfigManager {
private config;
constructor();
private loadEnvironmentVariables;
/**
* Get configuration for a specific service
*/
getServiceConfig(service: keyof EnvConfig): any;
/**
* Check if a required API key is available
*/
hasApiKey(service: string, keyName: string): boolean;
/**
* Get API key with helpful error message if missing
*/
getApiKey(service: string, keyName: string): string;
/**
* Check if demo mode is enabled
*/
isDemoMode(): boolean;
/**
* Get all missing API keys for a specific skill
*/
getMissingKeysForSkill(skillName: string): string[];
/**
* Get setup instructions for missing API keys
*/
getSetupInstructions(skillName: string): string;
/**
* Validate configuration for a skill
*/
validateSkillConfig(skillName: string): {
valid: boolean;
missingKeys: string[];
instructions: string;
};
/**
* Get all configuration
*/
getAllConfig(): EnvConfig;
}
export declare const hasApiKey: (service: string, keyName: string) => boolean;
export declare const getApiKey: (service: string, keyName: string) => string;
export declare const isDemoMode: () => boolean;
export declare const getSetupInstructions: (skillName: string) => string;
export declare const validateSkillConfig: (skillName: string) => {
valid: boolean;
missingKeys: string[];
instructions: string;
};