Lines 148-188typescript
148 packageVersion: string,
150 const path = overridePath
151 ? resolveUserPath(overridePath)
152 : resolve(PACKAGE_ROOT, defaultRelativePath);
155 kind: overridePath ? "custom" : "default",
159 releaseUrl: `https://github.com/evgenest/ai-agents-arsenal/blob/v${packageVersion}/${defaultRelativePath.replace(/\\/g, "/")}`,
163function resolveUserPath(filePath: string): string {
164 return isAbsolute(filePath) ? filePath : resolve(process.cwd(), filePath);
167async function importConfigModule(filePath: string, configName: string): Promise<RuntimeConfigModule> {
169 return await import(pathToFileURL(filePath).href) as RuntimeConfigModule;
170 } catch (error) {
MediumDynamic Require
Package source references dynamic require/import behavior.
setup/config.tsView on unpkg · L168 171 const message = error instanceof Error ? error.message : String(error);
172 throw new Error(`Failed to load ${configName} config from ${filePath}: ${message}`);
176function parseAgentsConfig(value: unknown, filePath: string): AgentConfigEntry[] {
177 if (!Array.isArray(value)) {
178 throw new Error(`Expected agentsConfig export in ${filePath} to be an array`);
181 return value.map((entry, index) => {
182 const configEntry = expectObject(entry, `agentsConfig[${index}]`, filePath);
183 const { id, enabled, mcpTargets, skillsPath } = configEntry;
185 if (typeof id !== "string" || id.length === 0) {
186 throw new Error(`Expected agentsConfig[${index}].id in ${filePath} to be a non-empty string`);
188 if (typeof enabled !== "boolean") {