@zeph-to/mcp-server 1.4.1 → 1.5.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/README.md +3 -3
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +19 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -49,11 +49,11 @@ Add to `~/.claude/settings.json`:
|
|
|
49
49
|
| Variable | Required | Description |
|
|
50
50
|
|----------|----------|-------------|
|
|
51
51
|
| `ZEPH_API_KEY` | Yes* | API key from Settings > API Keys |
|
|
52
|
-
| `ZEPH_HOOK_ID` | No | Hook ID for interactive tools
|
|
53
|
-
| `ZEPH_DEVICE_ID` | No | Target device ID. Omit to send to all devices |
|
|
52
|
+
| `ZEPH_HOOK_ID` | No | Hook ID (optional — only needed for interactive tools like `zeph_ask`/`zeph_prompt`/`zeph_input`) |
|
|
53
|
+
| `ZEPH_DEVICE_ID` | No | Target device ID (optional — only needed for interactive tools like `zeph_ask`/`zeph_prompt`/`zeph_input`). Omit to send to all devices |
|
|
54
54
|
| `ZEPH_BASE_URL` | No | API base URL (default: `https://api.zeph.to/v1`) |
|
|
55
55
|
|
|
56
|
-
\*
|
|
56
|
+
\* If env vars are not set, the server reads from `~/.zeph/config.json` (created by `npx @zeph-to/hook-sdk install`). Unresolved `${...}` interpolations are also treated as unset.
|
|
57
57
|
|
|
58
58
|
## Tools
|
|
59
59
|
|
package/dist/crypto.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0JH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../src/crypto.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AA0JH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,UAAU,MAAM,KAAG,OAAO,CAAC,MAAM,CAiE5E,CAAC;AAqCF,eAAO,MAAM,UAAU,QAAO,aAAa,GAAG,IAAqB,CAAC;AACpE,eAAO,MAAM,YAAY,QAAO,MAAM,GAAG,IAA+B,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,sBAAsB,GACjC,OAAO;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,KACrD,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,CAAC;CACnB,CAaA,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,GAC7B,SAAS,MAAM,KACd,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CAQlE,CAAC"}
|
package/dist/crypto.js
CHANGED
|
@@ -111,15 +111,22 @@ const initCrypto = (apiKey, baseUrl) => {
|
|
|
111
111
|
const stored = loadStoredKeys();
|
|
112
112
|
// Try server sync if API key available
|
|
113
113
|
if (apiKey) {
|
|
114
|
-
const
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
114
|
+
const serverResult = await fetchServerKeys(apiKey, baseUrl);
|
|
115
|
+
// Server says encryption disabled — skip crypto init
|
|
116
|
+
if (serverResult && !serverResult.encryptionEnabled) {
|
|
117
|
+
cachedKeyPair = null;
|
|
118
|
+
cachedExportedPublicKey = null;
|
|
119
|
+
cachedOwnPublicKey = null;
|
|
120
|
+
return '';
|
|
121
|
+
}
|
|
122
|
+
if (serverResult?.keys) {
|
|
123
|
+
if (!stored || stored.publicKey !== serverResult.keys.publicKey) {
|
|
124
|
+
storeKeys(serverResult.keys);
|
|
118
125
|
}
|
|
119
|
-
cachedKeyPair = await importKeyPair(
|
|
120
|
-
cachedExportedPublicKey =
|
|
126
|
+
cachedKeyPair = await importKeyPair(serverResult.keys);
|
|
127
|
+
cachedExportedPublicKey = serverResult.keys.publicKey;
|
|
121
128
|
cachedOwnPublicKey = cachedKeyPair.publicKey;
|
|
122
|
-
return
|
|
129
|
+
return serverResult.keys.publicKey;
|
|
123
130
|
}
|
|
124
131
|
if (stored) {
|
|
125
132
|
await uploadServerKeys(stored, apiKey, baseUrl);
|
|
@@ -158,7 +165,6 @@ const initCrypto = (apiKey, baseUrl) => {
|
|
|
158
165
|
return initPromise;
|
|
159
166
|
};
|
|
160
167
|
exports.initCrypto = initCrypto;
|
|
161
|
-
// ─── Server key sync helpers ───
|
|
162
168
|
const fetchServerKeys = async (apiKey, baseUrl) => {
|
|
163
169
|
try {
|
|
164
170
|
const url = `${(baseUrl ?? 'https://api.zeph.to/v1').replace(/\/$/, '')}/users/me/keys`;
|
|
@@ -167,7 +173,11 @@ const fetchServerKeys = async (apiKey, baseUrl) => {
|
|
|
167
173
|
return null;
|
|
168
174
|
const json = await res.json();
|
|
169
175
|
const keys = json.data?.encryptionKeys;
|
|
170
|
-
|
|
176
|
+
const encryptionEnabled = json.data?.encryptionEnabled ?? (keys ? true : false);
|
|
177
|
+
return {
|
|
178
|
+
keys: keys?.publicKey && keys?.privateKey ? keys : null,
|
|
179
|
+
encryptionEnabled,
|
|
180
|
+
};
|
|
171
181
|
}
|
|
172
182
|
catch {
|
|
173
183
|
return null;
|