@mmmbuto/nexuscrew 0.9.60 → 0.9.61

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-D42BJVwr.js"></script>
14
+ <script type="module" crossorigin src="/assets/index-VtTd56fc.js"></script>
15
15
  <link rel="stylesheet" crossorigin href="/assets/index-fCIoVxeq.css">
16
16
  </head>
17
17
  <body>
@@ -1 +1 @@
1
- {"version":"0.9.60"}
1
+ {"version":"0.9.61"}
@@ -30,7 +30,7 @@ const fs = require('node:fs');
30
30
  const os = require('node:os');
31
31
  const path = require('node:path');
32
32
  const {
33
- loadDefinitions, atomicWrite, CAPS, MAX_CELLS, validTmuxName, validateCommandTrust,
33
+ loadDefinitions, atomicWrite, CAPS, MAX_CELLS, validTmuxName, validateCommandTrust, defaultDefinitionsPath,
34
34
  aggiornaDefinizioni,
35
35
  cellIdFromTmuxSession,
36
36
  resolveCwd, normalizeCwdRel, deriveCwdRel,
@@ -611,7 +611,7 @@ async function createBuiltinFleet(cfg = {}) {
611
611
  if (cfg.builtinEnabled === false) return off;
612
612
 
613
613
  const home = cfg.home || os.homedir();
614
- const defsPath = cfg.fleetDefsPath || path.join(home, '.nexuscrew', 'fleet.json');
614
+ const defsPath = defaultDefinitionsPath(cfg);
615
615
  const tmuxBin = cfg.tmuxBin || process.env.TMUX_BIN || 'tmux';
616
616
  const readonly = () => (cfg.readonlyDefault === true || process.env.NEXUSCREW_READONLY === '1');
617
617
  // Lease opt-in: attivo solo quando cfg.cellLeaseEnabled === true. server.js lo
@@ -10,12 +10,21 @@
10
10
  // lib/fs/routes.js and lib/tmux/lifecycle.js.
11
11
  const fs = require('node:fs');
12
12
  const path = require('node:path');
13
+ const os = require('node:os');
13
14
  const crypto = require('node:crypto');
14
15
  const { normalizeManagedSpec } = require('./managed.js');
15
16
 
16
17
  // --- Cap + identita' (dichiarati; 100 regge una flotta reale con margine;
17
18
  // il limite resta deliberato contro un file patologico) ---
18
19
  const SCHEMA_VERSION = 1;
20
+
21
+ // Un cfg.home assente e' la NORMA delle installazioni reali (bin/nexuscrew
22
+ // serve non passa home): il default segue os.homedir(), esattamente come
23
+ // ogni altro path del server (server.js) e come il runtime Fleet.
24
+ function defaultDefinitionsPath(cfg = {}) {
25
+ const home = (cfg && cfg.home) || os.homedir();
26
+ return cfg.fleetDefsPath || path.join(home, '.nexuscrew', 'fleet.json');
27
+ }
19
28
  const MAX_ENGINES = 100;
20
29
  const MAX_CELLS = 32;
21
30
  const MAX_ARGS = 32; // argv: array, mai stringa spezzata (no shell)
@@ -1198,6 +1207,12 @@ const CAPS = {
1198
1207
  };
1199
1208
 
1200
1209
  module.exports = {
1210
+ // Il default canonico del path di fleet.json: UNA ricetta sola per il
1211
+ // runtime Fleet (builtin.js) e per ogni lettore delle definizioni (owner
1212
+ // ASK scope incluso). Come tutto il resto del server, un cfg.home assente
1213
+ // cade su os.homedir(): due ricette divergenti qui hanno prodotto il
1214
+ // crash all'avvio delle installazioni senza home esplicita.
1215
+ defaultDefinitionsPath,
1201
1216
  parseDefinitions,
1202
1217
  effectiveCapabilities,
1203
1218
  parseCapabilitySet,
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
- const path = require('node:path');
3
- const { loadDefinitions, cellIdFromTmuxSession } = require('../fleet/definitions.js');
2
+ const { loadDefinitions, cellIdFromTmuxSession, defaultDefinitionsPath } = require('../fleet/definitions.js');
4
3
 
5
4
  // The owner resolves local definitions, never a cell id supplied by a peer.
6
5
  // Activity and tmux polling do not participate in ASK authorization.
@@ -14,7 +13,7 @@ function resolveOwnerSession(session, cells) {
14
13
 
15
14
  function createOwnerAskScope(cfg) {
16
15
  const enabled = cfg.fleetEnabled !== false && cfg.builtinEnabled !== false;
17
- const definitionsPath = enabled ? (cfg.fleetDefsPath || path.join(cfg.home, '.nexuscrew', 'fleet.json')) : null;
16
+ const definitionsPath = enabled ? defaultDefinitionsPath(cfg) : null;
18
17
  function read() {
19
18
  if (!enabled) return { available: true, cells: [] };
20
19
  const definitions = loadDefinitions(definitionsPath);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/nexuscrew",
3
- "version": "0.9.60",
3
+ "version": "0.9.61",
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": {