claude-notification-plugin 1.1.94 → 1.1.96
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/commit-sha +1 -1
- package/listener/listener.js +11 -4
- package/listener/pty-runner.js +7 -1
- 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.96",
|
|
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/commit-sha
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
32972e747e117771d32217ae045b1e64ef008505
|
package/listener/listener.js
CHANGED
|
@@ -380,9 +380,8 @@ function hasAnyJsonl (workDir) {
|
|
|
380
380
|
}
|
|
381
381
|
|
|
382
382
|
// Decide whether to add --continue or --resume <id> to claudeArgs for a fresh PTY.
|
|
383
|
-
//
|
|
384
|
-
//
|
|
385
|
-
// PTY, claudeArgs are ignored anyway.
|
|
383
|
+
// Priority: explicit caller flag > pending /resume <sid> > /newsession opt-out >
|
|
384
|
+
// global resumeLastSession default. If reusing an idle PTY, claudeArgs are ignored anyway.
|
|
386
385
|
function applyResumeArgs (claudeArgs, workDir) {
|
|
387
386
|
if (claudeArgs.includes('--continue') || claudeArgs.includes('--resume')) {
|
|
388
387
|
return claudeArgs;
|
|
@@ -392,6 +391,12 @@ function applyResumeArgs (claudeArgs, workDir) {
|
|
|
392
391
|
pendingResumeBySid.delete(workDir);
|
|
393
392
|
return [...claudeArgs, '--resume', sid];
|
|
394
393
|
}
|
|
394
|
+
// /newsession or /clear sets freshSessionDirs to opt out of auto-continue
|
|
395
|
+
// for this one task (consumed here so subsequent tasks resume normally).
|
|
396
|
+
if (freshSessionDirs.has(workDir)) {
|
|
397
|
+
freshSessionDirs.delete(workDir);
|
|
398
|
+
return claudeArgs;
|
|
399
|
+
}
|
|
395
400
|
if (resumeLastSessionEnabled && hasAnyJsonl(workDir)) {
|
|
396
401
|
return [...claudeArgs, '--continue'];
|
|
397
402
|
}
|
|
@@ -415,12 +420,14 @@ function formatTimeAgo (ms) {
|
|
|
415
420
|
return `${d}d ago`;
|
|
416
421
|
}
|
|
417
422
|
|
|
423
|
+
// Reuse the in-memory PTY session only if one exists and the user hasn't asked
|
|
424
|
+
// for a fresh start. The freshSessionDirs flag is read here and *consumed* by
|
|
425
|
+
// applyResumeArgs (which also needs it to suppress --continue).
|
|
418
426
|
function shouldContinueSession (workDir) {
|
|
419
427
|
if (!continueSessionEnabled) {
|
|
420
428
|
return false;
|
|
421
429
|
}
|
|
422
430
|
if (freshSessionDirs.has(workDir)) {
|
|
423
|
-
freshSessionDirs.delete(workDir);
|
|
424
431
|
return false;
|
|
425
432
|
}
|
|
426
433
|
return sessions.has(workDir);
|
package/listener/pty-runner.js
CHANGED
|
@@ -456,8 +456,14 @@ export class PtyRunner extends EventEmitter {
|
|
|
456
456
|
this.logger.info(`Creating PTY session in ${workDir} with args: ${JSON.stringify(args)}`);
|
|
457
457
|
|
|
458
458
|
const shell = process.platform === 'win32' ? 'cmd.exe' : '/bin/bash';
|
|
459
|
+
// Switch CMD to UTF-8 codepage (65001) so non-ASCII prompts piped via
|
|
460
|
+
// pty.write() reach claude as valid UTF-8. Without this, cmd.exe applies
|
|
461
|
+
// the system OEM codepage to the input stream and Cyrillic/CJK bytes
|
|
462
|
+
// arrive at claude mangled (`�`), so the prompt is never submitted.
|
|
463
|
+
// `chcp` and `&` MUST be separate argv tokens — bundling them into one
|
|
464
|
+
// string ("chcp 65001 & claude") trips cmd.exe's argument parser.
|
|
459
465
|
const shellArgs = process.platform === 'win32'
|
|
460
|
-
? ['/c', 'claude', ...args]
|
|
466
|
+
? ['/c', 'chcp', '65001', '&', 'claude', ...args]
|
|
461
467
|
: ['-c', ['claude', ...args].join(' ')];
|
|
462
468
|
|
|
463
469
|
const ptyProcess = spawn(shell, shellArgs, {
|
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.96",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|