@mmmbuto/nexuscrew 0.9.67 → 0.9.68

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.
@@ -11,7 +11,7 @@
11
11
  <meta name="apple-mobile-web-app-title" content="NexusCrew" />
12
12
  <link rel="manifest" href="/manifest.json" />
13
13
  <title>NexusCrew</title>
14
- <script type="module" crossorigin src="/assets/index-D__76yWR.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-Bq57nMaf.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-Dwd37Z_R.css">
16
16
  </head>
17
17
  <body>
@@ -1 +1 @@
1
- {"version":"0.9.67"}
1
+ {"version":"0.9.68"}
package/lib/ws/bridge.js CHANGED
@@ -342,7 +342,23 @@ function bindWs(ws, deps) {
342
342
  if (isBinary) { if (!record.readonly) record.pty.write(data); return; }
343
343
  let msg;
344
344
  try { msg = JSON.parse(data.toString()); } catch (_) { return; }
345
- if (msg.type === 'attach') return fail(1002, 'already attached'); // no 2nd attach
345
+ // Hub-held reconnect: while a client is away the hub proxy keeps THIS
346
+ // websocket attached upstream, so the returning client's fresh attach
347
+ // frame lands on a bridge that is already attached. Same session means
348
+ // idempotent reconnect: re-ack the attach and keep streaming instead of
349
+ // closing 1002 (which the client reads as a protocol fault and retries
350
+ // forever, leaving the terminal black). Nothing from the payload is
351
+ // applied — readonly cannot be downgraded, geometry stays with its
352
+ // current owner — and a DIFFERENT session is still rejected: reusing one
353
+ // authenticated channel for another session would be stream theft.
354
+ if (msg.type === 'attach') {
355
+ if (!record.ended && msg.session === session) {
356
+ sendJson(ws, { type: 'attached', reconnectToken: record.resumeToken });
357
+ sendJson(ws, { type: 'link', state: 'live' });
358
+ return;
359
+ }
360
+ return fail(1002, 'already attached'); // no 2nd attach (per session)
361
+ }
346
362
  if (msg.type === 'resize') record.pty.resize(clamp(msg.cols, 20, 300, 80), clamp(msg.rows, 5, 120, 24));
347
363
  // focus: il tile che prende il focus diventa size-owner (promote); perdendolo
348
364
  // torna ignore-size (demote). Cosi' N deck/tile sulla stessa sessione NON si
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/nexuscrew",
3
- "version": "0.9.67",
3
+ "version": "0.9.68",
4
4
  "description": "Faithful browser tmux client \u2014 attach to live sessions over a real PTY, localhost-only, mobile-easy",
5
5
  "main": "lib/server.js",
6
6
  "bin": {