MCPcopy Create free account
hub / github.com/CreminiAI/skillpack / load

Method load

src/runtime/config.ts:271–295  ·  view source on GitHub ↗
(rootDir: string)

Source from the content-addressed store, hash-verified

269
270 public static getInstance(): ConfigManager {
271 if (!ConfigManager.instance) {
272 ConfigManager.instance = new ConfigManager();
273 }
274 return ConfigManager.instance;
275 }
276
277 public load(rootDir: string): DataConfig {
278 this.configPath = path.join(rootDir, "data", "config.json");
279 this.configData = {};
280 this.fileConfigData = {};
281 if (fs.existsSync(this.configPath)) {
282 try {
283 const parsed = JSON.parse(fs.readFileSync(this.configPath, "utf-8")) as unknown;
284 if (
285 parsed &&
286 typeof parsed === "object" &&
287 "scheduledJobs" in (parsed as Record<string, unknown>)
288 ) {
289 console.warn(
290 ' Warning: data/config.json contains deprecated "scheduledJobs". Move them to job.json at the pack root; the old field is ignored.',
291 );
292 }
293 this.fileConfigData = normalizeDataConfig(parsed);
294 console.log(" Loaded config from data/config.json");
295 } catch (err) {
296 console.warn(" Warning: Failed to parse data/config.json:", err);
297 }
298 }

Callers 4

mainFunction · 0.80
load_run_resultsFunction · 0.80
startServerFunction · 0.80

Calls 3

normalizeDataConfigFunction · 0.85
resolveRuntimeConfigFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected