ninedeploy 0.17.0 → 0.18.2

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.
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  #!/usr/bin/env node
2
+ import { volumeFilesList, volumeFileRead, volumeFileWrite, volumeFileMkdir, volumeFileDelete, type VolumeFileOptions } from './commands/volumeFiles.js';
2
3
  import { createRequire } from 'node:module';
3
4
  import { Command } from 'commander';
4
5
  import { getClient } from './client.js';
@@ -112,8 +113,9 @@ import {
112
113
  configPresetListAction, configPresetRegisterAction, configPresetRemoveAction,
113
114
  } from './commands/configPresets.js';
114
115
  import {
115
- metricsFlushAction, metricsShowAction,
116
+ metricsFlushAction, metricsShowAction, resourceMetricsSettingsAction, resourceMetricsConfigureAction,
116
117
  } from './commands/metrics.js';
118
+ import { logDrainQueueAction, logDrainRetryAction, logDrainDiscardAction } from './commands/logDrains.js';
117
119
  import {
118
120
  buildCacheStatsAction,
119
121
  } from './commands/buildCache.js';
@@ -443,7 +445,7 @@ deploys.command('rollback <serviceId> <deployId>').description('Rollback to a pr
443
445
 
444
446
  /* v8 ignore start -- exercised by test/aiDiagnose.test.ts. */
445
447
  deploys.command('diagnose <service> <deployId>')
446
- .description('0.16.16: the configured AI provider diagnoses a failed deployment and may propose a settings change')
448
+ .description('The configured AI provider diagnoses a failed deployment and may propose a settings change')
447
449
  .option('--apply', 'Apply the proposed settings change and start a deploy')
448
450
  .option('--json', 'Print raw JSON')
449
451
  .action((service: string, depId: string, opts: { apply?: boolean; json?: boolean }) => deploysDiagnose(getClient(), service, depId, opts));
@@ -594,10 +596,26 @@ configPresetsCmd.command('apply <id>')
594
596
  configPresetsCmd.command('remove <id>').description('Unregister a preset (does NOT undo the live apply)').action((id: string) => configPresetRemoveAction(getClient(), id));
595
597
 
596
598
  // ── Metrics (G-09) ────────────────────────────────────────────────────────
597
- const metricsCmd = program.command('metrics').description('Metric history plugin — archive kernel events to a pluggable backend (G-09)');
599
+ const metricsCmd = program.command('metrics').description('Resource monitoring and kernel event history');
600
+ metricsCmd.command('settings').description('Resource retention, Prometheus and collector settings').action(() => resourceMetricsSettingsAction(getClient()));
601
+ metricsCmd.command('configure').description('Update resource monitoring settings')
602
+ .option('--retention-days <days>', 'Service history retention, 1–90 days')
603
+ .option('--prometheus <on|off>', 'Enable or disable authenticated Prometheus scraping')
604
+ .option('--otlp-endpoint <url>', 'OTLP/HTTP JSON metrics endpoint, empty disables export')
605
+ .option('--otlp-authorization-env <name>', 'Read collector Authorization from this environment variable')
606
+ .option('--clear-otlp-authorization', 'Remove the saved collector credential')
607
+ .option('--log-queue-mb <mb>', 'Encrypted log payload limit per destination, 1–256 MiB')
608
+ .action((opts) => resourceMetricsConfigureAction(getClient(), opts));
598
609
  metricsCmd.command('show').description('Show the active backend, events, and last flush marker').action(() => metricsShowAction(getClient()));
599
610
  metricsCmd.command('flush').description('Run the built-in backend retention sweep').action(() => metricsFlushAction(getClient()));
600
611
 
612
+ const logDrainsCmd = program.command('log-drains').description('Inspect and recover durable log delivery');
613
+ logDrainsCmd.command('queue <id>').description('Show pending, blocked and paused log delivery').action((id: string) => logDrainQueueAction(getClient(), id));
614
+ logDrainsCmd.command('retry <id>').description('Schedule pending logs for the next delivery cycle').action((id: string) => logDrainRetryAction(getClient(), id));
615
+ logDrainsCmd.command('discard <id>').description('Permanently discard pending logs')
616
+ .option('--yes', 'Confirm permanent removal of queued logs')
617
+ .action((id: string, opts) => logDrainDiscardAction(getClient(), id, opts));
618
+
601
619
  // ── Build Cache (G-01) ────────────────────────────────────────────────────
602
620
  const buildCacheCmd = program.command('build-cache').description('Build cache plugin — per-backend LRU stats (G-01)');
603
621
  buildCacheCmd.command('stats').description('Show per-backend cache counters and the merged totals').action(() => buildCacheStatsAction(getClient()));
@@ -677,6 +695,23 @@ ssoCmd.command('remove <id>').description('Remove a provider by id').action((id:
677
695
  // ── Volumes ────────────────────────────────────────────────────────────────
678
696
  const volumesCmd = program.command('volumes').description('Manage Docker volumes');
679
697
 
698
+ volumesCmd.command('files <name> [path]').description('List files inside a managed volume')
699
+ .option('--server <id>', 'Read this node instead of the panel host').option('--json', 'Print raw JSON')
700
+ .action((name:string,path:string|undefined,opts:VolumeFileOptions)=>volumeFilesList(getClient(),name,path??'',opts));
701
+ volumesCmd.command('read <name> <path>').description('Read exact file bytes from a managed volume')
702
+ .option('--server <id>', 'Read this node instead of the panel host').option('--output <file>', 'Save to a local file instead of stdout').option('--force', 'Overwrite an existing output file')
703
+ .action((name:string,path:string,opts:VolumeFileOptions)=>volumeFileRead(getClient(),name,path,opts));
704
+ volumesCmd.command('write <name> <path>').description('Write a local file into a managed volume (maximum 1 MiB)')
705
+ .requiredOption('--file <file>', 'Local input file').option('--server <id>', 'Write this node instead of the panel host')
706
+ .action((name:string,path:string,opts:VolumeFileOptions)=>volumeFileWrite(getClient(),name,path,opts));
707
+ volumesCmd.command('mkdir <name> <path>').description('Create a directory inside a managed volume')
708
+ .option('--server <id>', 'Use this node instead of the panel host')
709
+ .action((name:string,path:string,opts:VolumeFileOptions)=>volumeFileMkdir(getClient(),name,path,opts));
710
+ volumesCmd.command('delete-file <name> <path>').description('Delete a file or directory inside a volume, with confirmation')
711
+ .option('--server <id>', 'Use this node instead of the panel host').option('--yes', 'Confirm this exact path without prompting')
712
+ .action((name:string,path:string,opts:VolumeFileOptions)=>volumeFileDelete(getClient(),name,path,opts));
713
+
714
+
680
715
  volumesCmd.command('list')
681
716
  .description('List all volumes')
682
717
  .option('--server <id>', 'A node\'s volumes instead of the panel host\'s')
package/src/lib/format.ts CHANGED
@@ -36,6 +36,7 @@ const STATUS_COLORS: Record<string, (s: string) => string> = {
36
36
  building: c.yellow,
37
37
  queued: c.yellow,
38
38
  awaiting_approval: c.magenta,
39
+ awaiting_ci: c.yellow,
39
40
  pending: c.yellow,
40
41
  creating: c.yellow,
41
42
  error: c.red,