UNPKG

agentis

Version:

A TypeScript framework for building sophisticated multi-agent systems

23 lines (22 loc) 871 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.ConfigLoader = void 0; const fs_1 = require("fs"); const path_1 = __importDefault(require("path")); class ConfigLoader { static initialize(toolRegistry) { this.toolRegistry = toolRegistry; } static loadAgentConfig(configName) { const configPath = path_1.default.join(process.cwd(), 'src', 'config', 'agents', `${configName}.json`); const rawConfig = JSON.parse((0, fs_1.readFileSync)(configPath, 'utf-8')); return { ...rawConfig, tools: (rawConfig.defaultTools || []).map((toolName) => this.toolRegistry.getTool(toolName)) }; } } exports.ConfigLoader = ConfigLoader;