claude-notification-plugin 1.1.95 → 1.1.97
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/pty-runner.js +23 -20
- 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.97",
|
|
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
|
+
a8a48c155fceb62317866537f758bed0f6a7213b
|
package/listener/pty-runner.js
CHANGED
|
@@ -328,28 +328,25 @@ export class PtyRunner extends EventEmitter {
|
|
|
328
328
|
const inactivityMs = task.raw ? RAW_INACTIVITY_MS : this.timeout;
|
|
329
329
|
const markerPromise = this._waitForMarker(pendingId, inactivityMs, session);
|
|
330
330
|
|
|
331
|
-
// Send the task text to the PTY.
|
|
332
|
-
//
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
//
|
|
331
|
+
// Send the task text to the PTY. Bracketed paste mode (\x1b[200~...\x1b[201~)
|
|
332
|
+
// hangs claude under ConPTY, so we send raw text and submit with a CR.
|
|
333
|
+
// CRITICAL: write the text first, *then* the CR with a small delay — claude's
|
|
334
|
+
// Ink-based input handler intermittently swallows submit when the CR arrives
|
|
335
|
+
// in the same PTY write as the text. Separating them is reliable.
|
|
336
|
+
// Multiline: each non-final line ends with `\\\r` (claude treats `\` + Enter
|
|
337
|
+
// as a soft newline within the prompt), with inter-line delays so claude
|
|
338
|
+
// processes each one.
|
|
336
339
|
const lines = task.text.split(/\r?\n/);
|
|
337
340
|
const writeLines = async () => {
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
for (let i = 0; i < lines.length; i++) {
|
|
342
|
-
if (i > 0) {
|
|
343
|
-
await new Promise(r => setTimeout(r, 300));
|
|
344
|
-
}
|
|
345
|
-
if (i < lines.length - 1) {
|
|
346
|
-
session.pty.write(`${lines[i]}\\\r`);
|
|
347
|
-
} else {
|
|
348
|
-
session.pty.write(`${lines[i]}\r`);
|
|
349
|
-
}
|
|
341
|
+
for (let i = 0; i < lines.length; i++) {
|
|
342
|
+
if (i > 0) {
|
|
343
|
+
await new Promise(r => setTimeout(r, 300));
|
|
350
344
|
}
|
|
351
|
-
|
|
352
|
-
|
|
345
|
+
const isLast = i === lines.length - 1;
|
|
346
|
+
session.pty.write(isLast ? lines[i] : `${lines[i]}\\`);
|
|
347
|
+
// Submit the line. For non-final lines a soft-newline CR; for the final
|
|
348
|
+
// (or only) line, a delay then the submit CR.
|
|
349
|
+
await new Promise(r => setTimeout(r, isLast ? 300 : 0));
|
|
353
350
|
session.pty.write('\r');
|
|
354
351
|
}
|
|
355
352
|
};
|
|
@@ -456,8 +453,14 @@ export class PtyRunner extends EventEmitter {
|
|
|
456
453
|
this.logger.info(`Creating PTY session in ${workDir} with args: ${JSON.stringify(args)}`);
|
|
457
454
|
|
|
458
455
|
const shell = process.platform === 'win32' ? 'cmd.exe' : '/bin/bash';
|
|
456
|
+
// Switch CMD to UTF-8 codepage (65001) so non-ASCII prompts piped via
|
|
457
|
+
// pty.write() reach claude as valid UTF-8. Without this, cmd.exe applies
|
|
458
|
+
// the system OEM codepage to the input stream and Cyrillic/CJK bytes
|
|
459
|
+
// arrive at claude mangled (`�`), so the prompt is never submitted.
|
|
460
|
+
// `chcp` and `&` MUST be separate argv tokens — bundling them into one
|
|
461
|
+
// string ("chcp 65001 & claude") trips cmd.exe's argument parser.
|
|
459
462
|
const shellArgs = process.platform === 'win32'
|
|
460
|
-
? ['/c', 'claude', ...args]
|
|
463
|
+
? ['/c', 'chcp', '65001', '&', 'claude', ...args]
|
|
461
464
|
: ['-c', ['claude', ...args].join(' ')];
|
|
462
465
|
|
|
463
466
|
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.97",
|
|
5
5
|
"description": "Claude Code task-completion notifications: Telegram, desktop notifications (Windows/macOS/Linux), sound, and voice",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"engines": {
|