@sanctuary-framework/mcp-server 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -257,7 +257,18 @@ function defaultConfig() {
257
257
  };
258
258
  }
259
259
  async function loadConfig(configPath) {
260
- const config = defaultConfig();
260
+ let config = defaultConfig();
261
+ const storagePath = process.env.SANCTUARY_STORAGE_PATH ?? config.storage_path;
262
+ const path$1 = configPath ?? path.join(storagePath, "sanctuary.json");
263
+ try {
264
+ const raw = await promises.readFile(path$1, "utf-8");
265
+ const fileConfig = JSON.parse(raw);
266
+ config = deepMerge(config, fileConfig);
267
+ } catch (err) {
268
+ if (err instanceof Error && err.message.includes("unimplemented features")) {
269
+ throw err;
270
+ }
271
+ }
261
272
  if (process.env.SANCTUARY_STORAGE_PATH) {
262
273
  config.storage_path = process.env.SANCTUARY_STORAGE_PATH;
263
274
  }
@@ -270,6 +281,9 @@ async function loadConfig(configPath) {
270
281
  if (process.env.SANCTUARY_DASHBOARD_ENABLED === "true") {
271
282
  config.dashboard.enabled = true;
272
283
  }
284
+ if (process.env.SANCTUARY_DASHBOARD_ENABLED === "false") {
285
+ config.dashboard.enabled = false;
286
+ }
273
287
  if (process.env.SANCTUARY_DASHBOARD_PORT) {
274
288
  config.dashboard.port = parseInt(process.env.SANCTUARY_DASHBOARD_PORT, 10);
275
289
  }
@@ -288,6 +302,9 @@ async function loadConfig(configPath) {
288
302
  if (process.env.SANCTUARY_WEBHOOK_ENABLED === "true") {
289
303
  config.webhook.enabled = true;
290
304
  }
305
+ if (process.env.SANCTUARY_WEBHOOK_ENABLED === "false") {
306
+ config.webhook.enabled = false;
307
+ }
291
308
  if (process.env.SANCTUARY_WEBHOOK_URL) {
292
309
  config.webhook.url = process.env.SANCTUARY_WEBHOOK_URL;
293
310
  }
@@ -300,19 +317,9 @@ async function loadConfig(configPath) {
300
317
  if (process.env.SANCTUARY_WEBHOOK_CALLBACK_HOST) {
301
318
  config.webhook.callback_host = process.env.SANCTUARY_WEBHOOK_CALLBACK_HOST;
302
319
  }
303
- const path$1 = configPath ?? path.join(config.storage_path, "sanctuary.json");
304
- try {
305
- const raw = await promises.readFile(path$1, "utf-8");
306
- const fileConfig = JSON.parse(raw);
307
- const merged = deepMerge(config, fileConfig);
308
- validateConfig(merged);
309
- return merged;
310
- } catch (err) {
311
- if (err instanceof Error && err.message.includes("unimplemented features")) {
312
- throw err;
313
- }
314
- return config;
315
- }
320
+ config.version = PKG_VERSION;
321
+ validateConfig(config);
322
+ return config;
316
323
  }
317
324
  async function saveConfig(config, configPath) {
318
325
  const path$1 = path.join(config.storage_path, "sanctuary.json");