UNPKG

@agentkai/node

Version:

AgentKai的Node.js环境特定实现

21 lines (20 loc) 703 B
import { BaseConfigService } from '@agentkai/core'; import { platform } from '../platform'; /** * 配置服务,用于管理所有配置 */ export class ConfigService extends BaseConfigService { ensureDirExists() { this.checkAndCreateDir(platform.path.join(platform.path.home(), '.agentkai')); this.checkAndCreateDir(platform.path.join(platform.path.home(), '.agentkai', 'goals')); this.checkAndCreateDir(platform.path.join(platform.path.home(), '.agentkai', 'memory')); } checkAndCreateDir(dir) { if (!platform.fs.exists(dir)) { platform.fs.mkdir(dir, { recursive: true }); } } getPlatform() { return platform; } }