@mmmbuto/nexuscrew 0.9.73 → 0.9.75

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.
@@ -49,7 +49,7 @@ function fleetRoutes(fleetP, cfg = {}) {
49
49
  if (opts.action) emit('info', 'FLEET_ACTION_STARTED', 'Fleet action started', {
50
50
  action: opts.action, cell: safeCell(body), state: 'starting',
51
51
  });
52
- const result = await fn(fleet, body);
52
+ const result = await fn(fleet, body, req);
53
53
  if (opts.action) emit('info', 'FLEET_ACTION_COMPLETED', 'Fleet action completed', {
54
54
  action: opts.action, cell: safeCell(body), state: opts.action === 'down' ? 'stopped' : 'ready',
55
55
  });
@@ -178,6 +178,23 @@ function fleetRoutes(fleetP, cfg = {}) {
178
178
  }
179
179
  return f.testModel(String(b.engine || ''), String(b.model || ''));
180
180
  }));
181
+ // «Puoi usare questi»: la scoperta modelli di un engine (record normalizzati
182
+ // con provenienza campo per campo, inApi, catalogo pubblico, stale). E' una
183
+ // lettura diagnostica come model-test: stessa ACL dell'editor (bearer token
184
+ // del router), non gated da READONLY. `refresh=1` salta la cache. La chiave
185
+ // e l'endpoint dell'engine non attraversano il router: la risposta e'
186
+ // curata dal provider e gli errori del modulo sono stringhe fisse.
187
+ r.get('/engine-models', guard((f, _b, req) => {
188
+ requireCap(f, 'model-discovery');
189
+ if (typeof f.discoverEngineModels !== 'function') {
190
+ const e = new Error('not supported by this fleet provider'); e.status = 501; throw e;
191
+ }
192
+ const engine = String((req.query && req.query.engine) || '');
193
+ if (!engine || engine.length > 64 || !/^[A-Za-z0-9._-]+$/.test(engine)) {
194
+ const e = new Error('engine non valido'); e.status = 400; throw e;
195
+ }
196
+ return f.discoverEngineModels(engine, { refresh: req.query.refresh === '1' || req.query.refresh === 'true' });
197
+ }));
181
198
  r.post('/define-model', guard((f, b) => {
182
199
  requireCap(f, 'define');
183
200
  if (typeof f.defineModel !== 'function') { const e = new Error('not supported by this fleet provider'); e.status = 501; throw e; }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@mmmbuto/nexuscrew",
3
- "version": "0.9.73",
4
- "description": "Faithful browser tmux client \u2014 attach to live sessions over a real PTY, localhost-only, mobile-easy",
3
+ "version": "0.9.75",
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": {
7
7
  "nexuscrew": "bin/nexuscrew.js"