@agents-at-scale/ark 0.1.61 → 0.1.62

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.
@@ -13,6 +13,7 @@ export declare const arkDependencies: DependencyCollection;
13
13
  */
14
14
  export declare const arkServices: ServiceCollection;
15
15
  /**
16
- * Get services that can be installed via Helm charts (only enabled services)
16
+ * Get services that can be installed via Helm charts (only enabled services).
17
+ * When a backend is specified, services with a non-matching requiresBackend are excluded.
17
18
  */
18
- export declare function getInstallableServices(): ServiceCollection;
19
+ export declare function getInstallableServices(backend?: 'etcd' | 'postgresql'): ServiceCollection;
@@ -221,14 +221,17 @@ function applyConfigOverrides(defaults) {
221
221
  */
222
222
  export const arkServices = applyConfigOverrides(defaultArkServices);
223
223
  /**
224
- * Get services that can be installed via Helm charts (only enabled services)
224
+ * Get services that can be installed via Helm charts (only enabled services).
225
+ * When a backend is specified, services with a non-matching requiresBackend are excluded.
225
226
  */
226
- export function getInstallableServices() {
227
+ export function getInstallableServices(backend = 'etcd') {
227
228
  const installable = {};
228
229
  for (const [key, service] of Object.entries(arkServices)) {
229
- if (service.enabled && service.chartPath) {
230
- installable[key] = service;
231
- }
230
+ if (!service.enabled || !service.chartPath)
231
+ continue;
232
+ if (service.requiresBackend && service.requiresBackend !== backend)
233
+ continue;
234
+ installable[key] = service;
232
235
  }
233
236
  return installable;
234
237
  }
@@ -10,6 +10,7 @@ import { printNextSteps } from '../../lib/nextSteps.js';
10
10
  import ora from 'ora';
11
11
  import { waitForServicesReady, } from '../../lib/waitForReady.js';
12
12
  import { parseTimeoutToSeconds } from '../../lib/timeout.js';
13
+ import { detectStorageBackend } from '../../lib/readinessChecks.js';
13
14
  function isValidVersion(version) {
14
15
  return /^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.-]+)?(\+[a-zA-Z0-9.-]+)?$/.test(version);
15
16
  }
@@ -75,7 +76,7 @@ async function checkAndCleanFailedRelease(releaseName, namespace, verbose = fals
75
76
  // Ignore errors - prerequisite may not exist
76
77
  }
77
78
  }
78
- async function installService(service, verbose = false, arkVersionOverride, marketplaceVersionOverride) {
79
+ async function installService(service, verbose = false, arkVersionOverride, marketplaceVersionOverride, backend) {
79
80
  await uninstallPrerequisites(service, verbose);
80
81
  await checkAndCleanFailedRelease(service.helmReleaseName, service.namespace, verbose);
81
82
  let chartPath = service.chartPath;
@@ -140,6 +141,7 @@ export async function installArk(config, serviceNames = [], options = {}) {
140
141
  // Show cluster info
141
142
  output.success(`connected to cluster: ${chalk.bold(clusterInfo.context)}`);
142
143
  console.log(); // Add blank line after cluster info
144
+ const backend = await detectStorageBackend();
143
145
  // If specific services are requested, install only those services
144
146
  if (serviceNames.length > 0) {
145
147
  for (const serviceName of serviceNames) {
@@ -185,7 +187,7 @@ export async function installArk(config, serviceNames = [], options = {}) {
185
187
  continue;
186
188
  }
187
189
  // Core ARK service
188
- const services = getInstallableServices();
190
+ const services = getInstallableServices(backend);
189
191
  const service = Object.values(services).find((s) => s.name === serviceName);
190
192
  if (!service) {
191
193
  output.error(`service '${serviceName}' not found`);
@@ -210,11 +212,19 @@ export async function installArk(config, serviceNames = [], options = {}) {
210
212
  }
211
213
  // If not using -y flag, show checklist interface
212
214
  if (!options.yes) {
215
+ const backendMatch = (s) => !s.requiresBackend || s.requiresBackend === backend;
213
216
  const coreServices = Object.values(arkServices)
214
- .filter((s) => s.category === 'core')
215
- .sort((a, b) => a.name.localeCompare(b.name));
217
+ .filter((s) => s.category === 'core' && backendMatch(s))
218
+ .sort((a, b) => {
219
+ // Ensure ark-controller is always first
220
+ if (a.name === 'ark-controller')
221
+ return -1;
222
+ if (b.name === 'ark-controller')
223
+ return 1;
224
+ return a.name.localeCompare(b.name);
225
+ });
216
226
  const otherServices = Object.values(arkServices)
217
- .filter((s) => s.category === 'service')
227
+ .filter((s) => s.category === 'service' && backendMatch(s))
218
228
  .sort((a, b) => a.name.localeCompare(b.name));
219
229
  const mandatoryServiceNames = [...coreServices, ...otherServices]
220
230
  .filter((s) => s.mandatory)
@@ -361,8 +371,16 @@ export async function installArk(config, serviceNames = [], options = {}) {
361
371
  }
362
372
  }
363
373
  // Install all services
364
- const services = getInstallableServices();
365
- for (const service of Object.values(services)) {
374
+ const services = getInstallableServices(backend);
375
+ const sortedServices = Object.values(services).sort((a, b) => {
376
+ // Ensure ark-controller is always first
377
+ if (a.name === 'ark-controller')
378
+ return -1;
379
+ if (b.name === 'ark-controller')
380
+ return 1;
381
+ return a.name.localeCompare(b.name);
382
+ });
383
+ for (const service of sortedServices) {
366
384
  output.info(`installing ${service.name}...`);
367
385
  try {
368
386
  await installService(service, options.verbose, options.arkVersion, options.marketplaceVersion);
@@ -388,7 +406,8 @@ export async function installArk(config, serviceNames = [], options = {}) {
388
406
  const servicesToWait = Object.values(arkServices).filter((s) => s.enabled &&
389
407
  s.category === 'core' &&
390
408
  s.k8sDeploymentName &&
391
- s.namespace);
409
+ s.namespace &&
410
+ (!s.requiresBackend || s.requiresBackend === backend));
392
411
  const spinner = ora(`Waiting for Ark to be ready (timeout: ${timeoutSeconds}s)...`).start();
393
412
  const statusMap = new Map();
394
413
  servicesToWait.forEach((s) => statusMap.set(s.name, false));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agents-at-scale/ark",
3
- "version": "0.1.61",
3
+ "version": "0.1.62",
4
4
  "description": "Ark CLI - Interactive terminal interface for ARK agents",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",