@zeph-to/mcp-server 1.7.0 → 1.8.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 +10 -1
- 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":"AAOA,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;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAuBD,eAAO,MAAM,UAAU,QAAO,eA0B7B,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.loadConfig = void 0;
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const crypto_1 = require("crypto");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
6
7
|
const path_1 = require("path");
|
|
7
8
|
const DEFAULT_BASE_URL = 'https://api.zeph.to/v1';
|
|
8
9
|
const resolvedEnv = (key) => {
|
|
@@ -24,12 +25,20 @@ const loadConfig = () => {
|
|
|
24
25
|
if (!apiKey) {
|
|
25
26
|
throw new Error('ZEPH_API_KEY not found. Run "npx @zeph-to/hook-sdk install" or set ZEPH_API_KEY env var.');
|
|
26
27
|
}
|
|
28
|
+
const sessionId = resolvedEnv('ZEPH_SESSION_ID') ?? `sess_${(0, crypto_1.randomBytes)(12).toString('base64url')}`;
|
|
29
|
+
// Write sessionId to tmp file so shell hooks (zeph-stop.sh) can read it
|
|
30
|
+
try {
|
|
31
|
+
const projectDir = process.env.CLAUDE_PROJECT_DIR ?? process.cwd();
|
|
32
|
+
const hash = (0, child_process_1.execFileSync)('cksum', { input: projectDir, encoding: 'utf-8' }).split(' ')[0];
|
|
33
|
+
(0, fs_1.writeFileSync)(`/tmp/zeph-session-${hash}`, sessionId);
|
|
34
|
+
}
|
|
35
|
+
catch { /* best-effort */ }
|
|
27
36
|
return {
|
|
28
37
|
apiKey,
|
|
29
38
|
baseUrl: (resolvedEnv('ZEPH_BASE_URL') ?? fileConfig.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, ''),
|
|
30
39
|
hookId: resolvedEnv('ZEPH_HOOK_ID') ?? fileConfig.hookId,
|
|
31
40
|
deviceId: resolvedEnv('ZEPH_DEVICE_ID') ?? fileConfig.deviceId,
|
|
32
|
-
sessionId
|
|
41
|
+
sessionId,
|
|
33
42
|
};
|
|
34
43
|
};
|
|
35
44
|
exports.loadConfig = loadConfig;
|