runcloud 0.2.169 → 0.2.170

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.
@@ -280,6 +280,10 @@ export async function readFleetLogs(client, hostId, source = 'service', limit =
280
280
  lines: Array.isArray(result.data.lines) ? result.data.lines.map(safeFleetText) : [] };
281
281
  }
282
282
  function credentialsClient() { const credentials = requireCredentials(); return new ApiClient(credentials.apiUrl, credentials.token); }
283
+ function requireFleetReadAccess(reason) {
284
+ if (reason === 'HTTP 401' || reason === 'HTTP 403')
285
+ throw new Error(`Fleet access denied (${reason}); use an admin identity with read permission`);
286
+ }
283
287
  function action(fn) {
284
288
  return fn().catch(error => { console.error(safeFleetText(error instanceof Error ? error.message : 'Fleet read failed')); process.exitCode = 1; });
285
289
  }
@@ -323,9 +327,14 @@ export function registerRunCloudFleet(program) {
323
327
  .option('--event-pages <pages>', 'Maximum pages (1..10)', '1')
324
328
  .action(opts => action(async () => {
325
329
  const result = await readFleetEvents(credentialsClient(), { hostId: opts.host, range: opts.range, limit: Number(opts.limit), eventPages: Number(opts.eventPages) });
330
+ requireFleetReadAccess(result.coverage.reason);
326
331
  console.log(JSON.stringify({ coverage: result.coverage, items: result.items.map(eventEvidence) }, null, 2));
327
332
  }));
328
333
  fleet.command('logs <hostId>').description('Read bounded retained host logs; no SSH or host changes')
329
334
  .option('--source <source>', 'service, warm_pool, or event_log', 'service').option('--limit <rows>', 'Maximum lines (1..500)', '100')
330
- .action((hostId, opts) => action(async () => { console.log(JSON.stringify(await readFleetLogs(credentialsClient(), hostId, opts.source, Number(opts.limit)), null, 2)); }));
335
+ .action((hostId, opts) => action(async () => {
336
+ const result = await readFleetLogs(credentialsClient(), hostId, opts.source, Number(opts.limit));
337
+ requireFleetReadAccess(result.reason);
338
+ console.log(JSON.stringify(result, null, 2));
339
+ }));
331
340
  }
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const CLI_VERSION = '0.2.169';
1
+ export const CLI_VERSION = '0.2.170';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runcloud",
3
- "version": "0.2.169",
3
+ "version": "0.2.170",
4
4
  "description": "Create and control run.cloud remote mobile simulators and cloud sandboxes",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
Binary file
Binary file