claude-notification-plugin 1.0.82 → 1.0.88
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/.claude-plugin/plugin.json +13 -14
- package/README.md +276 -287
- package/bin/install.js +262 -16
- package/bin/uninstall.js +3 -2
- package/listener/LISTENER-DETAILED.md +3 -3
- package/listener/listener.js +1 -0
- package/package.json +60 -60
- package/bin/register-cli.js +0 -142
- package/commands/listener.md +0 -100
- package/commands/setup.md +0 -54
package/commands/listener.md
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Manage the Telegram Listener daemon (start, stop, status, logs, restart)
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Listener Management
|
|
6
|
-
|
|
7
|
-
Manage the Telegram Listener daemon that receives tasks from Telegram and executes them via `claude -p`.
|
|
8
|
-
|
|
9
|
-
The user invokes this command as `/claude-notification-plugin:listener <action>`.
|
|
10
|
-
|
|
11
|
-
## Actions
|
|
12
|
-
|
|
13
|
-
Determine the action from the user's input. If no action is provided, show the help text below and ask which action they want.
|
|
14
|
-
|
|
15
|
-
### start
|
|
16
|
-
|
|
17
|
-
Start the listener daemon.
|
|
18
|
-
|
|
19
|
-
1. Determine the plugin root path — use the directory where this command file lives: `${CLAUDE_PLUGIN_ROOT}`. The listener CLI script is at `${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js`.
|
|
20
|
-
2. Run in a shell:
|
|
21
|
-
```bash
|
|
22
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js" start
|
|
23
|
-
```
|
|
24
|
-
3. Show the output to the user. If it says "Listener started", confirm success. If there is an error (missing config, missing projects, already running), explain what to do.
|
|
25
|
-
|
|
26
|
-
### stop
|
|
27
|
-
|
|
28
|
-
Stop the listener daemon.
|
|
29
|
-
|
|
30
|
-
1. Run:
|
|
31
|
-
```bash
|
|
32
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js" stop
|
|
33
|
-
```
|
|
34
|
-
2. Show the output.
|
|
35
|
-
|
|
36
|
-
### status
|
|
37
|
-
|
|
38
|
-
Show the listener status.
|
|
39
|
-
|
|
40
|
-
1. Run:
|
|
41
|
-
```bash
|
|
42
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js" status
|
|
43
|
-
```
|
|
44
|
-
2. Show the output.
|
|
45
|
-
|
|
46
|
-
### logs
|
|
47
|
-
|
|
48
|
-
Show recent log entries.
|
|
49
|
-
|
|
50
|
-
1. Run:
|
|
51
|
-
```bash
|
|
52
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js" logs
|
|
53
|
-
```
|
|
54
|
-
2. Show the output.
|
|
55
|
-
|
|
56
|
-
### restart
|
|
57
|
-
|
|
58
|
-
Restart the listener daemon.
|
|
59
|
-
|
|
60
|
-
1. Run:
|
|
61
|
-
```bash
|
|
62
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/listener-cli.js" restart
|
|
63
|
-
```
|
|
64
|
-
2. Show the output.
|
|
65
|
-
|
|
66
|
-
## Help text
|
|
67
|
-
|
|
68
|
-
If the user doesn't specify an action, show:
|
|
69
|
-
|
|
70
|
-
```
|
|
71
|
-
Telegram Listener — receives tasks from Telegram and executes via claude -p.
|
|
72
|
-
|
|
73
|
-
Usage:
|
|
74
|
-
/claude-notification-plugin:listener start — Start the daemon
|
|
75
|
-
/claude-notification-plugin:listener stop — Stop the daemon
|
|
76
|
-
/claude-notification-plugin:listener status — Show status
|
|
77
|
-
/claude-notification-plugin:listener logs — Show recent logs
|
|
78
|
-
/claude-notification-plugin:listener restart — Restart the daemon
|
|
79
|
-
|
|
80
|
-
Prerequisites:
|
|
81
|
-
1. Telegram bot configured (token + chatId in ~/.claude/notifier.config.json)
|
|
82
|
-
2. "listener.projects" section in config with at least one project
|
|
83
|
-
|
|
84
|
-
See LISTENER.md for detailed documentation.
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
## Important
|
|
88
|
-
|
|
89
|
-
- The `${CLAUDE_PLUGIN_ROOT}` variable resolves to the plugin installation directory. Always use it to build the path to `bin/listener-cli.js`.
|
|
90
|
-
- If the config doesn't have a `listener.projects` section, tell the user to add one and show a minimal example:
|
|
91
|
-
```json
|
|
92
|
-
{
|
|
93
|
-
"listener": {
|
|
94
|
-
"projects": {
|
|
95
|
-
"default": { "path": "/path/to/your/project" }
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
```
|
|
100
|
-
- If Telegram credentials are missing, suggest running `/claude-notification-plugin:setup` first.
|
package/commands/setup.md
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
description: Configure Telegram credentials and notification settings
|
|
3
|
-
---
|
|
4
|
-
|
|
5
|
-
# Setup claude-notification-plugin
|
|
6
|
-
|
|
7
|
-
Help the user configure the notification plugin. The config file is `~/.claude/notifier.config.json`.
|
|
8
|
-
|
|
9
|
-
## Steps
|
|
10
|
-
|
|
11
|
-
1. **Read existing config** (if it exists) from `~/.claude/notifier.config.json` to preserve current settings.
|
|
12
|
-
|
|
13
|
-
2. **Ask for Telegram bot token**. If a token already exists in the config, show a masked version (first 6 and last 4 characters) and ask if the user wants to keep it. If they want a new one, ask them to provide it.
|
|
14
|
-
|
|
15
|
-
3. **Get the Chat ID**. If the token is available and Chat ID is missing:
|
|
16
|
-
- Ask the user to send any message to their bot in Telegram.
|
|
17
|
-
- Fetch `https://api.telegram.org/bot<TOKEN>/getUpdates` to auto-detect the Chat ID.
|
|
18
|
-
- If auto-detection fails, ask the user to enter the Chat ID manually.
|
|
19
|
-
- If Chat ID already exists, show it and ask if the user wants to keep it.
|
|
20
|
-
|
|
21
|
-
4. **Write the config** to `~/.claude/notifier.config.json`. Merge with existing config — do NOT overwrite settings that already exist (`notifyAfterSeconds`, `notifyOnWaiting`, `debug`, channel `enabled` flags, etc.). Only update `telegram.token` and `telegram.chatId` with the values from this session.
|
|
22
|
-
|
|
23
|
-
Default config structure (for new installs):
|
|
24
|
-
```json
|
|
25
|
-
{
|
|
26
|
-
"telegram": {
|
|
27
|
-
"enabled": true,
|
|
28
|
-
"token": "<TOKEN>",
|
|
29
|
-
"chatId": "<CHAT_ID>",
|
|
30
|
-
"deleteAfterHours": 24
|
|
31
|
-
},
|
|
32
|
-
"windowsNotification": { "enabled": true },
|
|
33
|
-
"sound": { "enabled": true, "file": "C:/Windows/Media/notify.wav" },
|
|
34
|
-
"voice": { "enabled": true },
|
|
35
|
-
"notifyAfterSeconds": 15,
|
|
36
|
-
"notifyOnWaiting": false,
|
|
37
|
-
"debug": false
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
5. **Register CLI commands** — so that `claude-notify-listener`, `claude-notify-install`, and `claude-notify-uninstall` are available from the terminal (not just inside Claude).
|
|
42
|
-
|
|
43
|
-
Run in a shell:
|
|
44
|
-
```bash
|
|
45
|
-
node "${CLAUDE_PLUGIN_ROOT}/bin/register-cli.js"
|
|
46
|
-
```
|
|
47
|
-
This finds the directory where `claude` is installed and creates wrapper scripts there. Show the output to the user. If registration fails (e.g. `claude` not in PATH), inform the user but do NOT treat it as a fatal error — the rest of setup is still valid.
|
|
48
|
-
|
|
49
|
-
6. **Confirm** — show the user a summary of what was saved.
|
|
50
|
-
|
|
51
|
-
## Important
|
|
52
|
-
|
|
53
|
-
- NEVER log or display the full token. Always mask it.
|
|
54
|
-
- Preserve all existing config values when writing — only update token and chatId.
|