@zeph-to/mcp-server 0.3.0 → 0.4.0
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/config.d.ts.map +1 -1
- package/dist/config.js +17 -5
- package/package.json +1 -1
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAKA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAkBD,eAAO,MAAM,UAAU,QAAO,eAgB7B,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.loadConfig = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const path_1 = require("path");
|
|
4
6
|
const DEFAULT_BASE_URL = 'https://api.zeph.to/v1';
|
|
7
|
+
const loadFileConfig = () => {
|
|
8
|
+
try {
|
|
9
|
+
const configPath = (0, path_1.join)(process.env.HOME ?? '~', '.zeph', 'config.json');
|
|
10
|
+
return JSON.parse((0, fs_1.readFileSync)(configPath, 'utf-8'));
|
|
11
|
+
}
|
|
12
|
+
catch {
|
|
13
|
+
return {};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
5
16
|
const loadConfig = () => {
|
|
6
|
-
const
|
|
17
|
+
const fileConfig = loadFileConfig();
|
|
18
|
+
const apiKey = process.env['ZEPH_API_KEY'] || fileConfig.apiKey;
|
|
7
19
|
if (!apiKey) {
|
|
8
|
-
throw new Error('ZEPH_API_KEY
|
|
20
|
+
throw new Error('ZEPH_API_KEY not found. Run "npx @zeph-to/hook-sdk setup" or set ZEPH_API_KEY env var.');
|
|
9
21
|
}
|
|
10
22
|
return {
|
|
11
23
|
apiKey,
|
|
12
|
-
baseUrl: (process.env['ZEPH_BASE_URL'] ?? DEFAULT_BASE_URL).replace(/\/$/, ''),
|
|
13
|
-
hookId: process.env['ZEPH_HOOK_ID'],
|
|
14
|
-
deviceId: process.env['ZEPH_DEVICE_ID'],
|
|
24
|
+
baseUrl: (process.env['ZEPH_BASE_URL'] ?? fileConfig.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, ''),
|
|
25
|
+
hookId: process.env['ZEPH_HOOK_ID'] || fileConfig.hookId,
|
|
26
|
+
deviceId: process.env['ZEPH_DEVICE_ID'] || fileConfig.deviceId,
|
|
15
27
|
};
|
|
16
28
|
};
|
|
17
29
|
exports.loadConfig = loadConfig;
|