peer-term 1.4.7 → 1.4.9

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/README.md CHANGED
@@ -63,7 +63,8 @@ While running, you can manage sessions directly from the host CLI:
63
63
  | Command | Description |
64
64
  | :--- | :--- |
65
65
  | `n` | Create a new session |
66
- | `l` | List all active sessions |
66
+ | `l` | List all active sessions and permissions (`[READ-ONLY]` vs `[INTERACTIVE]`) |
67
+ | `r <code>` | Toggle read-only / interactive mode for an active session (alias: `rt <code>`) |
67
68
  | `a <code>` | Authorize verified fingerprint (in `--secure` mode) |
68
69
  | `k <code>` | Kill a specific session |
69
70
  | `q` | Quit all sessions and exit |
@@ -74,13 +75,13 @@ While running, you can manage sessions directly from the host CLI:
74
75
  - **No Config**: Works instantly. No port forwarding or firewall configuration needed.
75
76
  - **End-to-End Encrypted**: Terminal data is encrypted locally using AES-256-GCM with ECDH P-256 key exchange. The relay never sees plaintext. A `--secure` flag enables an out-of-band fingerprint check for strict MITM protection.
76
77
  - **WebRTC P2P**: Creates a direct Peer-to-Peer connection on the same LAN for zero-latency, relay-free sessions.
77
- - **Read-Only Mode**: Guests can view your terminal but cannot type commands.
78
+ - **Live Permission Toggling & Read-Only**: Start view-only with `--readonly` or switch between Read-Only and Interactive mode on the fly with `r <code>`. Guests get instant visual badges and notifications without reconnecting.
78
79
  - **File Uploads**: Clients can drag-and-drop to securely upload files directly to `~/peerterm-uploads/` on the host machine. Fully encrypted end-to-end.
79
80
  - **Custom Start Path**: Set the starting directory with `--path`.
80
81
  - **Resilient Connections**: Both host and client get a 2-minute rejoin window if their IP changes or connection drops. PTY state is fully preserved — no session restart needed.
81
82
  - **Multi-Session**: Manage multiple simultaneous sessions with the interactive CLI menu.
82
83
  - **QR Code Support**: Displays a terminal QR code for instant connection from mobile or tablet devices without manually entering the code.
83
- - **Interactive Controls**: Manage sessions directly from the CLI (`n` for new session, `l` to list, `k` to kill, `a` to authorize fingerprint, `q` to quit).
84
+ - **Interactive Controls**: Manage sessions directly from the CLI (`n` for new session, `l` to list, `r <code>` to toggle permissions, `k` to kill, `a` to authorize fingerprint, `q` to quit).
84
85
 
85
86
  ## How It Works
86
87
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "peer-term",
3
- "version": "1.4.7",
3
+ "version": "1.4.9",
4
4
  "license": "MIT",
5
5
  "description": "Share your terminal instantly using a 6-digit code or QR code. Encrypted. No config.",
6
6
  "repository": {
package/src/index.js CHANGED
@@ -105,7 +105,7 @@ export class Session {
105
105
  const modeStr = this.readonly ? 'READ-ONLY' : 'INTERACTIVE (write enabled)';
106
106
  const codeLabel = this.code ? `Session ${this.code}` : 'Session';
107
107
  this.log(`${codeLabel} is now ${modeStr}`);
108
- if (this.sharedKey) {
108
+ if (this.sharedKey && this.fingerprintAuthorized) {
109
109
  await this._sendSessionConfig();
110
110
  }
111
111
  return this.readonly;
@@ -263,7 +263,10 @@ export class Session {
263
263
  });
264
264
  try {
265
265
  const payload = await encrypt(this.sharedKey, config);
266
- this._sendEncryptedToClient(payload);
266
+ this._sendEncryptedToClient(payload, {
267
+ directPayload: JSON.stringify({ _meta: 'session-config', payload }),
268
+ meta: 'session-config',
269
+ });
267
270
  } catch (err) {
268
271
  this.log(`Failed to send session config: ${err.message}`);
269
272
  }