@mmmbuto/nexuscrew 0.9.61 → 0.9.63

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,8 +11,8 @@
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-VtTd56fc.js"></script>
15
- <link rel="stylesheet" crossorigin href="/assets/index-fCIoVxeq.css">
14
+ <script type="module" crossorigin src="/assets/index-maPH0v_e.js"></script>
15
+ <link rel="stylesheet" crossorigin href="/assets/index-D1cTtNED.css">
16
16
  </head>
17
17
  <body>
18
18
  <div id="root"></div>
@@ -1 +1 @@
1
- {"version":"0.9.61"}
1
+ {"version":"0.9.63"}
package/lib/server.js CHANGED
@@ -1455,9 +1455,15 @@ function createServer(opts = {}) {
1455
1455
  return res.status(409).json({ error: 'answer requires reconciliation', reason: 'delivery-unknown-block' });
1456
1456
  }
1457
1457
  if (!ask && previous) return res.json({ dismissed: true, scope: 'local', ownerSync: previous.syncState === 'blocked' ? 'blocked' : 'pending' });
1458
- if (!unavailable) return res.status(409).json({ error: 'owner channel is not known unavailable', reason: 'owner-availability-unknown' });
1458
+ // Removing a card from THIS node's view is a local intent: it needs the
1459
+ // ask to be visible and quiet, not a permission from the owner. It is
1460
+ // persisted durably here (removing is not answering). Only the offline
1461
+ // path (owner channel unavailable AND the local reply grant present)
1462
+ // queues a sync for when the owner returns; a reachable owner is never
1463
+ // queued, whatever this node's own grants say — the owner's denial is
1464
+ // what governs the remote closure.
1459
1465
  const out = asksStore.dismissImported({ ownerId: b.ownerId, ownerAskId: b.askId, ask, cellId, retryBinding: dismissalBinding(b.ownerId),
1460
- syncState: grants.grants.askReplyAccess === true ? 'pending' : 'blocked' });
1466
+ syncState: unavailable && grants.grants.askReplyAccess === true ? 'pending' : 'blocked' });
1461
1467
  if (!out.ok) return res.status(out.reason === 'dismissal-cap' ? 429 : 503).json({ error: 'local dismissal refused', reason: out.reason });
1462
1468
  notifier.deliverOnlyRaw({ type: 'ask-dismissed', id: alias ? alias.id : b.askId, ownerId: b.ownerId, ownerAskId: b.askId, scope: 'local',
1463
1469
  // UI-only context also distinguishes changed content before the first snapshot.
@@ -1503,7 +1509,7 @@ function createServer(opts = {}) {
1503
1509
  let readable = false;
1504
1510
  try { readable = asksStore.health().readable; } catch (_) {}
1505
1511
  res.json({ ...remote, canDismissRemote: mutable && remote.canReply === true,
1506
- canDismissLocal: mutable && readable && local.visible && !local.blocked && (local.unavailable || !!local.previous) });
1512
+ canDismissLocal: mutable && readable && local.visible && !local.blocked });
1507
1513
  }
1508
1514
  catch (_) { res.json({ ownerId, askId, canReply: false, status: 'unreachable' }); }
1509
1515
  });
package/lib/tmux/list.js CHANGED
@@ -62,6 +62,15 @@ function isNoTmuxServerError(raw) {
62
62
  || /error connecting to .*(?:No such file or directory|Connection refused)/i.test(message);
63
63
  }
64
64
 
65
+ // NexusCrew starts tmux with `set -s exit-empty off`, so a live server with
66
+ // no sessions answers `list-panes -a` with "no current target" (not "no
67
+ // server running"): that is an empty inventory, not an error — otherwise the
68
+ // node would drop out of the fleet whenever its last session closes. This
69
+ // applies to list-panes ONLY: the other commands keep rejecting it.
70
+ function isNoCurrentTargetError(message) {
71
+ return /no current target/i.test(String(message || ''));
72
+ }
73
+
65
74
  function setSessionVisibility(tmuxBin = 'tmux', name, technical = false) {
66
75
  return new Promise((resolve, reject) => {
67
76
  if (typeof name !== 'string' || !/^[\w.@%:+-]{1,128}$/.test(name) || name.startsWith('-')) {
@@ -88,8 +97,9 @@ function listPanes(tmuxBin = 'tmux') {
88
97
  return new Promise((resolve, reject) => {
89
98
  execFile(tmuxBin, ['list-panes', '-a', '-F', PANES_FMT], (err, stdout, stderr) => {
90
99
  if (err) {
91
- if (isNoTmuxServerError(stderr || err.message)) return resolve('');
92
- return reject(new Error(`tmux list-panes failed: ${stderr || err.message}`));
100
+ const message = String(stderr || err.message);
101
+ if (isNoTmuxServerError(message) || isNoCurrentTargetError(message)) return resolve('');
102
+ return reject(new Error(`tmux list-panes failed: ${message}`));
93
103
  }
94
104
  resolve(stdout);
95
105
  });
@@ -144,8 +154,9 @@ function listFleetPanes(tmuxBin = 'tmux') {
144
154
  return new Promise((resolve, reject) => {
145
155
  execFile(tmuxBin, ['list-panes', '-a', '-F', FLEET_PANES_FMT], (err, stdout, stderr) => {
146
156
  if (err) {
147
- if (isNoTmuxServerError(stderr || err.message)) return resolve('');
148
- return reject(new Error(`tmux list-panes failed: ${stderr || err.message}`));
157
+ const message = String(stderr || err.message);
158
+ if (isNoTmuxServerError(message) || isNoCurrentTargetError(message)) return resolve('');
159
+ return reject(new Error(`tmux list-panes failed: ${message}`));
149
160
  }
150
161
  resolve(stdout);
151
162
  });
@@ -166,6 +177,6 @@ function attachedClients(tmuxBin = 'tmux', session) {
166
177
  }
167
178
 
168
179
  module.exports = {
169
- parsePaneTitle, parseSessions, isNoTmuxServerError, listSessions, listPanes, attachedClients, setSessionVisibility, FMT,
180
+ parsePaneTitle, parseSessions, isNoTmuxServerError, isNoCurrentTargetError, listSessions, listPanes, attachedClients, setSessionVisibility, FMT,
170
181
  FLEET_PANES_FMT, sessionsFromPanes, listFleetPanes,
171
182
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/nexuscrew",
3
- "version": "0.9.61",
3
+ "version": "0.9.63",
4
4
  "description": "Faithful browser tmux client — attach to live sessions over a real PTY, localhost-only, mobile-easy",
5
5
  "main": "lib/server.js",
6
6
  "bin": {