ciphermesh 2.13.0 → 2.14.0
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/CHANGELOG.md +69 -0
- package/README.md +4 -3
- package/README.pt-BR.md +4 -3
- package/docs/ARCHITECTURE.md +321 -225
- package/docs/SETUP.md +18 -0
- package/docs/commands.json +2 -2
- package/package.json +2 -2
- package/src/client/ChatController.js +22 -4
- package/src/client/UI.js +617 -124
- package/src/client/keyboard.js +388 -0
- package/src/p2p/P2PChatController.js +21 -4
- package/src/shared/desktopNotify.js +204 -0
- package/src/shared/notifyWorker.js +46 -0
- package/src/shared/tips.js +1 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// One-shot desktop-notification helper.
|
|
3
|
+
//
|
|
4
|
+
// Spawned detached, hidden and with stdio ignored (see desktopNotify.js), so it
|
|
5
|
+
// owns no console: when SnoreToast writes its "Notifications are disabled"
|
|
6
|
+
// diagnostics past the stdio pipes, they land in this process's void instead of
|
|
7
|
+
// on top of the chat UI.
|
|
8
|
+
//
|
|
9
|
+
// Reads a single JSON argument ({ title, message, sound }) and exits 0 on
|
|
10
|
+
// success, NOTIFY_FAILED_EXIT when the OS refused the notification.
|
|
11
|
+
|
|
12
|
+
import notifier from 'node-notifier';
|
|
13
|
+
import { NOTIFY_FAILED_EXIT } from './desktopNotify.js';
|
|
14
|
+
|
|
15
|
+
// The platform callback only fires when the toast is dismissed or times out on
|
|
16
|
+
// screen, which can be tens of seconds — so this cap is a leak guard, not a
|
|
17
|
+
// verdict. Exiting 0 here means "handed over, outcome unknown"; only an actual
|
|
18
|
+
// error from the notifier is allowed to trip the caller's breaker.
|
|
19
|
+
const TIMEOUT_MS = 8000;
|
|
20
|
+
|
|
21
|
+
function main() {
|
|
22
|
+
let options;
|
|
23
|
+
try {
|
|
24
|
+
options = JSON.parse(process.argv[2] || '{}');
|
|
25
|
+
} catch {
|
|
26
|
+
process.exit(NOTIFY_FAILED_EXIT);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
const timer = setTimeout(() => process.exit(0), TIMEOUT_MS);
|
|
30
|
+
timer.unref();
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
notifier.notify(
|
|
34
|
+
{
|
|
35
|
+
title: String(options.title ?? ''),
|
|
36
|
+
message: String(options.message ?? ''),
|
|
37
|
+
sound: !!options.sound,
|
|
38
|
+
},
|
|
39
|
+
(err) => process.exit(err ? NOTIFY_FAILED_EXIT : 0),
|
|
40
|
+
);
|
|
41
|
+
} catch {
|
|
42
|
+
process.exit(NOTIFY_FAILED_EXIT);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
main();
|
package/src/shared/tips.js
CHANGED
|
@@ -9,6 +9,7 @@ export const TIPS = [
|
|
|
9
9
|
'/panic wipes every on-disk secret and exits — for a lost or seized device.',
|
|
10
10
|
'/backup saves your identity + verified peers as an encrypted file.',
|
|
11
11
|
'Ctrl+K opens the command palette; Ctrl+E the emoji picker; PgUp/PgDn scrolls.',
|
|
12
|
+
'Shift+Enter starts a new line without sending; Alt+Enter and Ctrl+J do too.',
|
|
12
13
|
'A ✗ next to a name means their key changed since you last saw it — verify before trusting.',
|
|
13
14
|
'/deniable on switches to plausibly-deniable messages (no cryptographic proof you sent them).',
|
|
14
15
|
'No server? Run it in P2P mode — peers find each other on the LAN via mDNS, no relay at all.',
|