claude-notification-plugin 1.1.55 → 1.1.56
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 +1 -1
- package/README.md +4 -2
- package/commit-sha +1 -1
- package/listener/LISTENER-DETAILED.md +2 -1
- package/listener/listener.js +7 -7
- package/listener/telegram-poller.js +21 -4
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-notification-plugin",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.56",
|
|
4
4
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Viacheslav Makarov",
|
package/README.md
CHANGED
|
@@ -98,7 +98,8 @@ Config file: `~/.claude/claude-notify.config.json`
|
|
|
98
98
|
"logDir": "abs-path-to-listener-logs",
|
|
99
99
|
"taskLogDir": "abs-path-to-task-logs",
|
|
100
100
|
"liveConsole": true,
|
|
101
|
-
"
|
|
101
|
+
"liveConsoleIntervalMillis": 1,
|
|
102
|
+
"liveConsoleMaxOutputChars": 300
|
|
102
103
|
}
|
|
103
104
|
}
|
|
104
105
|
```
|
|
@@ -271,7 +272,8 @@ Projects are referenced with the `&` prefix (e.g. `&api`, `&api/branch`).
|
|
|
271
272
|
| `logDir` | `~/.claude` | Listener log directory |
|
|
272
273
|
| `taskLogDir` | same as `logDir` | Task Q&A log directory |
|
|
273
274
|
| `liveConsole` | `true` | Stream PTY output + tool activity to the "Running..." Telegram message in real-time |
|
|
274
|
-
| `
|
|
275
|
+
| `liveConsoleIntervalMillis`| `1` | Live console update interval in seconds |
|
|
276
|
+
| `liveConsoleMaxOutputChars`| `300` | Max characters of PTY output to show in live console |
|
|
275
277
|
|
|
276
278
|
|
|
277
279
|
### Projects and worktrees
|
package/commit-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
dcf4136a64282b07c755d01b99b1aba6fa0e7de1
|
|
@@ -768,7 +768,8 @@ The output is cleaned from ANSI escape codes and Claude Code UI chrome (logo, st
|
|
|
768
768
|
|
|
769
769
|
Configuration:
|
|
770
770
|
- `liveConsole` — enable/disable (default: `true`)
|
|
771
|
-
- `
|
|
771
|
+
- `liveConsoleIntervalMillis` — update interval in seconds (default: `1`)
|
|
772
|
+
- `liveConsoleMaxOutputChars` — max characters of PTY output to show (default: `300`)
|
|
772
773
|
|
|
773
774
|
### PTY logs
|
|
774
775
|
|
package/listener/listener.js
CHANGED
|
@@ -127,8 +127,8 @@ const runner = new PtyRunner(logger, taskTimeout, taskLogger, taskLogDir);
|
|
|
127
127
|
const worktreeManager = new WorktreeManager(config, logger);
|
|
128
128
|
|
|
129
129
|
const liveConsoleEnabled = listenerConfig.liveConsole !== false; // default: true
|
|
130
|
-
const
|
|
131
|
-
const
|
|
130
|
+
const liveConsoleIntervalMillis = (listenerConfig.liveConsoleIntervalMillis || 1) * 1000;
|
|
131
|
+
const liveConsoleMaxOutputChars = listenerConfig.liveConsoleMaxOutputChars || 300;
|
|
132
132
|
|
|
133
133
|
const startTime = Date.now();
|
|
134
134
|
|
|
@@ -142,7 +142,7 @@ const liveConsoleTimers = new Map();
|
|
|
142
142
|
logger.info('Listener started');
|
|
143
143
|
logger.info(`Projects: ${JSON.stringify(Object.keys(listenerConfig.projects))}`);
|
|
144
144
|
logger.info(`Session continuity: ${continueSessionEnabled ? 'enabled' : 'disabled'}`);
|
|
145
|
-
logger.info(`Live console: ${liveConsoleEnabled ? `enabled (${
|
|
145
|
+
logger.info(`Live console: ${liveConsoleEnabled ? `enabled (${liveConsoleIntervalMillis / 1000}s interval, max ${liveConsoleMaxOutputChars} chars)` : 'disabled'}`);
|
|
146
146
|
|
|
147
147
|
// ----------------------
|
|
148
148
|
// DISCOVER WORKTREES ON START
|
|
@@ -339,11 +339,11 @@ function startLiveConsole (workDir, messageId, header) {
|
|
|
339
339
|
return;
|
|
340
340
|
}
|
|
341
341
|
// Take the tail that fits
|
|
342
|
-
const tail = cleaned.length >
|
|
343
|
-
? cleaned.slice(-
|
|
342
|
+
const tail = cleaned.length > liveConsoleMaxOutputChars
|
|
343
|
+
? cleaned.slice(-liveConsoleMaxOutputChars)
|
|
344
344
|
: cleaned;
|
|
345
345
|
// Trim to last complete line if we sliced mid-line
|
|
346
|
-
const output = cleaned.length >
|
|
346
|
+
const output = cleaned.length > liveConsoleMaxOutputChars
|
|
347
347
|
? tail.slice(tail.indexOf('\n') + 1)
|
|
348
348
|
: tail;
|
|
349
349
|
if (!output || output === lastSentText) {
|
|
@@ -360,7 +360,7 @@ function startLiveConsole (workDir, messageId, header) {
|
|
|
360
360
|
} catch (err) {
|
|
361
361
|
logger.warn(`Live console edit error: ${err.message}`);
|
|
362
362
|
}
|
|
363
|
-
},
|
|
363
|
+
}, liveConsoleIntervalMillis);
|
|
364
364
|
liveConsoleTimers.set(workDir, timer);
|
|
365
365
|
}
|
|
366
366
|
|
|
@@ -276,17 +276,34 @@ function splitMessage (text) {
|
|
|
276
276
|
|
|
277
277
|
// Strip ANSI escape codes and terminal control sequences from PTY output
|
|
278
278
|
function stripAnsi (text) {
|
|
279
|
-
|
|
279
|
+
let result = text
|
|
280
|
+
// Cursor-right (\x1b[<N>C) → replace with N spaces (preserves word spacing)
|
|
281
|
+
.replace(/\x1b\[(\d+)C/g, (_, n) => ' '.repeat(parseInt(n, 10)))
|
|
282
|
+
// Cursor-position (\x1b[<row>;<col>H) → replace with newline (absolute move = new line)
|
|
283
|
+
.replace(/\x1b\[\d+;\d+H/g, '\n')
|
|
280
284
|
// CSI sequences: \x1b[ followed by optional ?/>/! prefix, params, and terminator
|
|
281
285
|
.replace(/\x1b\[[?>=!]?[0-9;]*[a-zA-Z~]/g, '')
|
|
282
286
|
// OSC sequences: \x1b] ... (terminated by BEL or ST)
|
|
283
287
|
.replace(/\x1b][^\x07\x1b]*(?:\x07|\x1b\\)/g, '')
|
|
284
288
|
// Other two-char escape sequences (\x1b followed by any single char)
|
|
285
289
|
.replace(/\x1b[^[\]]/g, '')
|
|
286
|
-
//
|
|
287
|
-
.replace(/\r/g, '')
|
|
288
|
-
// Remaining control chars except newline and tab
|
|
290
|
+
// Remaining control chars except newline, tab, and CR
|
|
289
291
|
.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f]/g, '');
|
|
292
|
+
|
|
293
|
+
// Normalize \r\n to \n first, then simulate standalone \r (line overwrite)
|
|
294
|
+
result = result.replace(/\r\n/g, '\n');
|
|
295
|
+
const lines = result.split('\n');
|
|
296
|
+
const resolved = [];
|
|
297
|
+
for (const line of lines) {
|
|
298
|
+
if (line.includes('\r')) {
|
|
299
|
+
// Standalone \r means overwrite — keep only the last segment
|
|
300
|
+
const parts = line.split('\r');
|
|
301
|
+
resolved.push(parts[parts.length - 1]);
|
|
302
|
+
} else {
|
|
303
|
+
resolved.push(line);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return resolved.join('\n');
|
|
290
307
|
}
|
|
291
308
|
|
|
292
309
|
// Clean PTY output for display: strip ANSI + remove Claude Code UI chrome
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "claude-notification-plugin",
|
|
3
3
|
"productName": "claude-notification-plugin",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.56",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|