@zeph-to/mcp-server 1.2.0 → 1.2.2
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/README.md +3 -1
- package/dist/api-client.js +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +8 -4
- package/dist/error-format.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -48,11 +48,13 @@ Add to `~/.claude/settings.json`:
|
|
|
48
48
|
|
|
49
49
|
| Variable | Required | Description |
|
|
50
50
|
|----------|----------|-------------|
|
|
51
|
-
| `ZEPH_API_KEY` | Yes | API key from Settings > API Keys |
|
|
51
|
+
| `ZEPH_API_KEY` | Yes* | API key from Settings > API Keys |
|
|
52
52
|
| `ZEPH_HOOK_ID` | No | Hook ID for interactive tools (`zeph_prompt`, `zeph_input`) |
|
|
53
53
|
| `ZEPH_DEVICE_ID` | No | Target device ID. Omit to send to all devices |
|
|
54
54
|
| `ZEPH_BASE_URL` | No | API base URL (default: `https://api.zeph.to/v1`) |
|
|
55
55
|
|
|
56
|
+
\* All env vars fall back to `~/.zeph/config.json` if not set or if the value is an unresolved `${...}` interpolation.
|
|
57
|
+
|
|
56
58
|
## Tools
|
|
57
59
|
|
|
58
60
|
### zeph_notify
|
package/dist/api-client.js
CHANGED
|
@@ -57,7 +57,7 @@ class ZephApiClient {
|
|
|
57
57
|
async uploadToS3(url, content, contentType) {
|
|
58
58
|
const response = await fetch(url, {
|
|
59
59
|
method: 'PUT',
|
|
60
|
-
headers: { 'Content-Type': contentType },
|
|
60
|
+
headers: { 'Content-Type': `${contentType}; charset=utf-8` },
|
|
61
61
|
body: content,
|
|
62
62
|
signal: AbortSignal.timeout(DEFAULT_TIMEOUT_MS),
|
|
63
63
|
});
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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;
|
|
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;AAuBD,eAAO,MAAM,UAAU,QAAO,eAgB7B,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -4,6 +4,10 @@ exports.loadConfig = void 0;
|
|
|
4
4
|
const fs_1 = require("fs");
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const DEFAULT_BASE_URL = 'https://api.zeph.to/v1';
|
|
7
|
+
const resolvedEnv = (key) => {
|
|
8
|
+
const val = process.env[key];
|
|
9
|
+
return val && !val.startsWith('${') ? val : undefined;
|
|
10
|
+
};
|
|
7
11
|
const loadFileConfig = () => {
|
|
8
12
|
try {
|
|
9
13
|
const configPath = (0, path_1.join)(process.env.HOME ?? '~', '.zeph', 'config.json');
|
|
@@ -15,15 +19,15 @@ const loadFileConfig = () => {
|
|
|
15
19
|
};
|
|
16
20
|
const loadConfig = () => {
|
|
17
21
|
const fileConfig = loadFileConfig();
|
|
18
|
-
const apiKey =
|
|
22
|
+
const apiKey = resolvedEnv('ZEPH_API_KEY') ?? fileConfig.apiKey;
|
|
19
23
|
if (!apiKey) {
|
|
20
24
|
throw new Error('ZEPH_API_KEY not found. Run "npx @zeph-to/hook-sdk install" or set ZEPH_API_KEY env var.');
|
|
21
25
|
}
|
|
22
26
|
return {
|
|
23
27
|
apiKey,
|
|
24
|
-
baseUrl: (
|
|
25
|
-
hookId:
|
|
26
|
-
deviceId:
|
|
28
|
+
baseUrl: (resolvedEnv('ZEPH_BASE_URL') ?? fileConfig.baseUrl ?? DEFAULT_BASE_URL).replace(/\/$/, ''),
|
|
29
|
+
hookId: resolvedEnv('ZEPH_HOOK_ID') ?? fileConfig.hookId,
|
|
30
|
+
deviceId: resolvedEnv('ZEPH_DEVICE_ID') ?? fileConfig.deviceId,
|
|
27
31
|
};
|
|
28
32
|
};
|
|
29
33
|
exports.loadConfig = loadConfig;
|
package/dist/error-format.js
CHANGED
|
@@ -35,7 +35,7 @@ const formatToolError = (err) => {
|
|
|
35
35
|
toolError.suggestion = 'Monthly quota exceeded. Upgrade plan for higher limits';
|
|
36
36
|
}
|
|
37
37
|
else if (err.code === 'UNAUTHORIZED') {
|
|
38
|
-
toolError.suggestion = 'Check ZEPH_API_KEY environment variable';
|
|
38
|
+
toolError.suggestion = 'Check ZEPH_API_KEY environment variable or ~/.zeph/config.json';
|
|
39
39
|
}
|
|
40
40
|
else if (err.code === 'HOOK_DISABLED') {
|
|
41
41
|
toolError.suggestion = 'Enable the Hook in Settings → Hooks';
|