ghostterm 2.2.1 → 2.2.2

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
@@ -56,14 +56,21 @@ Purpose-built buttons for Claude Code workflows:
56
56
 
57
57
  ## Quick Start
58
58
 
59
+ **Install once:**
59
60
  ```bash
60
- npx ghostterm
61
+ npm install -g ghostterm
61
62
  ```
62
63
 
63
- 1. Run the command above on your PC (requires [Node.js 18+](https://nodejs.org))
64
- 2. First time: browser opens for Google sign-in (one-time, remembered after)
65
- 3. Open **[ghostterm.pages.dev](https://ghostterm.pages.dev)** on your phone
66
- 4. Sign in with the same Google account → **auto-connects, no pairing codes**
64
+ **Then just run:**
65
+ ```bash
66
+ ghostterm
67
+ ```
68
+
69
+ 1. First time: browser opens for Google sign-in (one-time, remembered after)
70
+ 2. Open **[ghostterm.pages.dev](https://ghostterm.pages.dev)** on your phone
71
+ 3. Sign in with the same Google account → **auto-connects, no pairing codes**
72
+
73
+ > Don't want to install? Use `npx ghostterm` to run without installing.
67
74
 
68
75
  ## Security
69
76
 
@@ -269,11 +269,15 @@ class PtyManager extends EventEmitter {
269
269
  }
270
270
 
271
271
  case 'file-upload': {
272
- // Handle file upload: write base64 content to temp file
273
272
  this._handleFileUpload(msg, responses);
274
273
  break;
275
274
  }
276
275
 
276
+ case 'file-chunk': {
277
+ this._handleFileChunk(msg, responses);
278
+ break;
279
+ }
280
+
277
281
  default:
278
282
  break;
279
283
  }
@@ -315,6 +319,30 @@ class PtyManager extends EventEmitter {
315
319
  }
316
320
  }
317
321
 
322
+ _handleFileChunk(msg, responses) {
323
+ if (!this._fileChunks) this._fileChunks = {};
324
+ const key = msg.filename;
325
+ if (!this._fileChunks[key]) {
326
+ this._fileChunks[key] = { chunks: [], total: msg.total, ext: msg.ext, size: msg.size };
327
+ }
328
+ const entry = this._fileChunks[key];
329
+ entry.chunks[msg.index] = msg.chunk;
330
+
331
+ // Check if all chunks received
332
+ const received = entry.chunks.filter(Boolean).length;
333
+ if (received === entry.total) {
334
+ // Reassemble
335
+ const fullBase64 = entry.chunks.join('');
336
+ delete this._fileChunks[key];
337
+ this._handleFileUpload({
338
+ data: fullBase64,
339
+ filename: msg.filename,
340
+ ext: entry.ext,
341
+ size: entry.size,
342
+ }, responses);
343
+ }
344
+ }
345
+
318
346
  _sessionList() {
319
347
  const list = [];
320
348
  for (const [id, session] of this.sessions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghostterm",
3
- "version": "2.2.1",
3
+ "version": "2.2.2",
4
4
  "description": "Control your PC terminal from your phone — direct P2P, no server in between",
5
5
  "bin": {
6
6
  "ghostterm": "bin/ghostterm-p2p.js"