@zeph-to/hook-sdk 1.5.1 → 1.6.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 +5 -3
- package/dist/crypto.d.ts.map +1 -1
- package/dist/crypto.js +19 -9
- package/dist/templates.d.ts +0 -1
- package/dist/templates.d.ts.map +1 -1
- package/dist/templates.js +1 -5
- package/dist/types.d.ts +0 -6
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -54,7 +54,7 @@ zeph notify --title "Hello" --json
|
|
|
54
54
|
| `notify` | Send a push notification |
|
|
55
55
|
| `list` | List recent push notifications |
|
|
56
56
|
| `dismiss <id>` | Dismiss a push (or `--all`) |
|
|
57
|
-
| `test` |
|
|
57
|
+
| `test` | Verify connection and API key |
|
|
58
58
|
|
|
59
59
|
### Notify Options
|
|
60
60
|
|
|
@@ -63,7 +63,7 @@ zeph notify --title "Hello" --json
|
|
|
63
63
|
| `--title <text>` | Push title |
|
|
64
64
|
| `--body <text>` | Push body |
|
|
65
65
|
| `--url <url>` | URL to include |
|
|
66
|
-
| `--type <type>` | Push type: `note`, `link`, `file` |
|
|
66
|
+
| `--type <type>` | Push type: `note`, `link`, `file`, `hook` |
|
|
67
67
|
| `--priority <p>` | Priority: `low`, `normal`, `high`, `urgent` |
|
|
68
68
|
| `--device <id>` | Target device ID |
|
|
69
69
|
|
|
@@ -85,6 +85,8 @@ zeph notify --title "Hello" --json
|
|
|
85
85
|
|
|
86
86
|
### Mute
|
|
87
87
|
|
|
88
|
+
Mute is project-scoped (uses project directory hash). Created by Claude Code `/zeph-mute` command.
|
|
89
|
+
|
|
88
90
|
Notifications are silently skipped when a mute file exists for the current project:
|
|
89
91
|
|
|
90
92
|
```bash
|
|
@@ -154,7 +156,7 @@ await hook.dismissAll();
|
|
|
154
156
|
| `title` | `string?` | Push title |
|
|
155
157
|
| `body` | `string?` | Push body |
|
|
156
158
|
| `url` | `string?` | URL to include |
|
|
157
|
-
| `type` | `'note' \| 'link' \| 'file'?` | Push type (default: `
|
|
159
|
+
| `type` | `'note' \| 'link' \| 'file' \| 'hook'?` | Push type (default: `hook`) |
|
|
158
160
|
| `priority` | `'low' \| 'normal' \| 'high' \| 'urgent'?` | Priority (default: `normal`) |
|
|
159
161
|
| `targetDeviceId` | `string?` | Send to specific device |
|
|
160
162
|
|
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,CAsE5E,CAAC;AAqCF,eAAO,MAAM,UAAU,QAAO,aAAa,GAAG,IAAqB,CAAC;AACpE,eAAO,MAAM,YAAY,QAAO,MAAM,GAAG,IAA+B,CAAC;AAEzE;;;GAGG;AACH,eAAO,MAAM,eAAe,GAC1B,OAAO;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAE,EACtD,uBAAuB,MAAM,KAC5B,OAAO,CAAC;IACT,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,IAAI,CAAC;CACnB,CAeA,CAAC;AAEF;;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;;;GAGG;AACH,eAAO,MAAM,uBAAuB,GAClC,SAAS,MAAM,EACf,uBAAuB,MAAM,KAC5B,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,YAAY,EAAE,MAAM,CAAA;CAAE,CASlE,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
|
@@ -112,16 +112,23 @@ const initCrypto = (apiKey, baseUrl) => {
|
|
|
112
112
|
const stored = loadStoredKeys();
|
|
113
113
|
// Try server sync if API key available
|
|
114
114
|
if (apiKey) {
|
|
115
|
-
const
|
|
116
|
-
|
|
115
|
+
const serverResult = await fetchServerKeys(apiKey, baseUrl);
|
|
116
|
+
// Server says encryption disabled — skip crypto init
|
|
117
|
+
if (serverResult && !serverResult.encryptionEnabled) {
|
|
118
|
+
cachedKeyPair = null;
|
|
119
|
+
cachedExportedPublicKey = null;
|
|
120
|
+
cachedOwnPublicKey = null;
|
|
121
|
+
return '';
|
|
122
|
+
}
|
|
123
|
+
if (serverResult?.keys) {
|
|
117
124
|
// Server has keys — adopt them (server is source of truth)
|
|
118
|
-
if (!stored || stored.publicKey !==
|
|
119
|
-
storeKeys(
|
|
125
|
+
if (!stored || stored.publicKey !== serverResult.keys.publicKey) {
|
|
126
|
+
storeKeys(serverResult.keys);
|
|
120
127
|
}
|
|
121
|
-
cachedKeyPair = await importKeyPair(
|
|
122
|
-
cachedExportedPublicKey =
|
|
128
|
+
cachedKeyPair = await importKeyPair(serverResult.keys);
|
|
129
|
+
cachedExportedPublicKey = serverResult.keys.publicKey;
|
|
123
130
|
cachedOwnPublicKey = cachedKeyPair.publicKey;
|
|
124
|
-
return
|
|
131
|
+
return serverResult.keys.publicKey;
|
|
125
132
|
}
|
|
126
133
|
// Server has no keys
|
|
127
134
|
if (stored) {
|
|
@@ -163,7 +170,6 @@ const initCrypto = (apiKey, baseUrl) => {
|
|
|
163
170
|
return initPromise;
|
|
164
171
|
};
|
|
165
172
|
exports.initCrypto = initCrypto;
|
|
166
|
-
// ─── Server key sync helpers ───
|
|
167
173
|
const fetchServerKeys = async (apiKey, baseUrl) => {
|
|
168
174
|
try {
|
|
169
175
|
const url = `${(baseUrl ?? 'https://api.zeph.to/v1').replace(/\/$/, '')}/users/me/keys`;
|
|
@@ -172,7 +178,11 @@ const fetchServerKeys = async (apiKey, baseUrl) => {
|
|
|
172
178
|
return null;
|
|
173
179
|
const json = await res.json();
|
|
174
180
|
const keys = json.data?.encryptionKeys;
|
|
175
|
-
|
|
181
|
+
const encryptionEnabled = json.data?.encryptionEnabled ?? (keys ? true : false);
|
|
182
|
+
return {
|
|
183
|
+
keys: keys?.publicKey && keys?.privateKey ? keys : null,
|
|
184
|
+
encryptionEnabled,
|
|
185
|
+
};
|
|
176
186
|
}
|
|
177
187
|
catch {
|
|
178
188
|
return null;
|
package/dist/templates.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
export declare const CURSOR_HOOKS: string;
|
|
2
2
|
export declare const CURSOR_RULE = "---\ndescription: \"Zeph notification rules\"\nalwaysApply: true\n---\n\nWhen you complete a coding task, call the zeph_notify MCP tool with a brief summary.\nUse zeph_prompt for user decisions (2-4 options). Use zeph_input for free-form text.\nDo not notify for trivial operations (file reads, simple searches).\n";
|
|
3
3
|
export declare const WINDSURF_HOOKS: string;
|
|
4
|
-
export declare const WINDSURF_RULE = "When you complete a coding task, call the zeph_notify MCP tool with a brief summary.\nUse zeph_prompt for user decisions (2-4 options). Use zeph_input for free-form text.\nDo not notify for trivial operations (file reads, simple searches).\n";
|
|
5
4
|
export declare const GEMINI_HOOKS: {
|
|
6
5
|
hooks: {
|
|
7
6
|
AfterAgent: {
|
package/dist/templates.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,QAOd,CAAC;AAEZ,eAAO,MAAM,WAAW,+TAQvB,CAAC;AAIF,eAAO,MAAM,cAAc,QAOhB,CAAC;
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../src/templates.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,YAAY,QAOd,CAAC;AAEZ,eAAO,MAAM,WAAW,+TAQvB,CAAC;AAIF,eAAO,MAAM,cAAc,QAOhB,CAAC;AAIZ,eAAO,MAAM,YAAY;;;;;;;;;;;;;;CAYxB,CAAC;AAIF,eAAO,MAAM,WAAW,QAQb,CAAC;AAIZ,eAAO,MAAM,aAAa,QASf,CAAC;AAIZ,eAAO,MAAM,UAAU,sPAGtB,CAAC"}
|
package/dist/templates.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// ── Hook & Rule templates for each agent ─────────────────────────
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.CLINE_RULE = exports.COPILOT_HOOKS = exports.CODEX_HOOKS = exports.GEMINI_HOOKS = exports.
|
|
4
|
+
exports.CLINE_RULE = exports.COPILOT_HOOKS = exports.CODEX_HOOKS = exports.GEMINI_HOOKS = exports.WINDSURF_HOOKS = exports.CURSOR_RULE = exports.CURSOR_HOOKS = void 0;
|
|
5
5
|
const NOTIFY_CMD = 'npx @zeph-to/hook-sdk notify --title "Task done" 2>/dev/null || true';
|
|
6
6
|
// ── Cursor ───────────────────────────────────────────────────────
|
|
7
7
|
exports.CURSOR_HOOKS = JSON.stringify({
|
|
@@ -30,10 +30,6 @@ exports.WINDSURF_HOOKS = JSON.stringify({
|
|
|
30
30
|
}],
|
|
31
31
|
},
|
|
32
32
|
}, null, 2);
|
|
33
|
-
exports.WINDSURF_RULE = `When you complete a coding task, call the zeph_notify MCP tool with a brief summary.
|
|
34
|
-
Use zeph_prompt for user decisions (2-4 options). Use zeph_input for free-form text.
|
|
35
|
-
Do not notify for trivial operations (file reads, simple searches).
|
|
36
|
-
`;
|
|
37
33
|
// ── Gemini ───────────────────────────────────────────────────────
|
|
38
34
|
exports.GEMINI_HOOKS = {
|
|
39
35
|
hooks: {
|
package/dist/types.d.ts
CHANGED
|
@@ -16,12 +16,6 @@ export interface NotifyResult {
|
|
|
16
16
|
fileKey?: string;
|
|
17
17
|
autoFile?: boolean;
|
|
18
18
|
}
|
|
19
|
-
export interface FileAttachment {
|
|
20
|
-
fileKey: string;
|
|
21
|
-
fileName: string;
|
|
22
|
-
fileSize: number;
|
|
23
|
-
fileType: string;
|
|
24
|
-
}
|
|
25
19
|
export interface UploadRequestResult {
|
|
26
20
|
fileId: string;
|
|
27
21
|
fileKey: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,M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