claude-remote-approver 0.3.0 → 0.3.1
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 +2 -2
- package/package.json +2 -2
- package/src/setup.mjs +6 -3
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ Claude Code
|
|
|
17
17
|
│
|
|
18
18
|
│ PermissionRequest hook (stdin JSON)
|
|
19
19
|
▼
|
|
20
|
-
|
|
20
|
+
cli.mjs hook
|
|
21
21
|
│
|
|
22
22
|
├──POST──▶ ntfy.sh/<topic> ──push──▶ Phone (ntfy app)
|
|
23
23
|
│ │
|
|
@@ -31,7 +31,7 @@ Claude Code continues or stops
|
|
|
31
31
|
```
|
|
32
32
|
|
|
33
33
|
1. Claude Code invokes the hook, piping the tool request as JSON to stdin.
|
|
34
|
-
2. `
|
|
34
|
+
2. `cli.mjs hook` sends a notification to your ntfy topic with **Approve** and **Deny** action buttons.
|
|
35
35
|
3. The hook subscribes to a response topic (`<topic>-response`) via server-sent events.
|
|
36
36
|
4. When you tap a button on your phone, ntfy.sh publishes your decision to the response topic.
|
|
37
37
|
5. The hook reads the decision, writes `{"behavior":"allow"}` or `{"behavior":"deny"}` to stdout, and exits.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-remote-approver",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Approve or deny Claude Code permission prompts remotely from your phone via ntfy.sh",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
},
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": "git+https://github.com/
|
|
34
|
+
"url": "git+https://github.com/yuuichieguchi/claude-remote-approver.git"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"qrcode-terminal": "0.12.0"
|
package/src/setup.mjs
CHANGED
|
@@ -12,11 +12,14 @@ function isCraEntry(entry) {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
|
-
* Returns the hook command string: `node <
|
|
15
|
+
* Returns the hook command string: `node <absolute_path_to_bin/cli.mjs> hook`
|
|
16
16
|
*/
|
|
17
17
|
export function getHookCommand() {
|
|
18
|
-
const
|
|
19
|
-
|
|
18
|
+
const cliPath = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..", "bin", "cli.mjs");
|
|
19
|
+
if (!fs.existsSync(cliPath)) {
|
|
20
|
+
throw new Error(`CLI entry point not found: ${cliPath}`);
|
|
21
|
+
}
|
|
22
|
+
return `node "${cliPath}" hook`;
|
|
20
23
|
}
|
|
21
24
|
|
|
22
25
|
/**
|