@layr-labs/ecloud-cli 0.2.0-dev.1 → 0.2.0-dev.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.
Files changed (58) hide show
  1. package/VERSION +2 -2
  2. package/dist/commands/auth/generate.js +2 -2
  3. package/dist/commands/auth/generate.js.map +1 -1
  4. package/dist/commands/auth/login.js.map +1 -1
  5. package/dist/commands/auth/logout.js.map +1 -1
  6. package/dist/commands/auth/migrate.js.map +1 -1
  7. package/dist/commands/auth/whoami.js +3 -5
  8. package/dist/commands/auth/whoami.js.map +1 -1
  9. package/dist/commands/billing/cancel.js +3 -6
  10. package/dist/commands/billing/cancel.js.map +1 -1
  11. package/dist/commands/billing/status.js +3 -6
  12. package/dist/commands/billing/status.js.map +1 -1
  13. package/dist/commands/billing/subscribe.js +7 -12
  14. package/dist/commands/billing/subscribe.js.map +1 -1
  15. package/dist/commands/compute/app/create.js.map +1 -1
  16. package/dist/commands/compute/app/deploy.js +86 -614
  17. package/dist/commands/compute/app/deploy.js.map +1 -1
  18. package/dist/commands/compute/app/info.js +10 -59
  19. package/dist/commands/compute/app/info.js.map +1 -1
  20. package/dist/commands/compute/app/list.js +9 -10
  21. package/dist/commands/compute/app/list.js.map +1 -1
  22. package/dist/commands/compute/app/logs.js +11 -61
  23. package/dist/commands/compute/app/logs.js.map +1 -1
  24. package/dist/commands/compute/app/profile/set.js +20 -145
  25. package/dist/commands/compute/app/profile/set.js.map +1 -1
  26. package/dist/commands/compute/app/start.js +11 -61
  27. package/dist/commands/compute/app/start.js.map +1 -1
  28. package/dist/commands/compute/app/stop.js +11 -61
  29. package/dist/commands/compute/app/stop.js.map +1 -1
  30. package/dist/commands/compute/app/terminate.js +11 -61
  31. package/dist/commands/compute/app/terminate.js.map +1 -1
  32. package/dist/commands/compute/app/upgrade.js +52 -615
  33. package/dist/commands/compute/app/upgrade.js.map +1 -1
  34. package/dist/commands/compute/environment/list.js.map +1 -1
  35. package/dist/commands/compute/environment/set.js.map +1 -1
  36. package/dist/commands/compute/environment/show.js.map +1 -1
  37. package/dist/commands/compute/undelegate.js +9 -11
  38. package/dist/commands/compute/undelegate.js.map +1 -1
  39. package/dist/commands/telemetry/disable.js.map +1 -1
  40. package/dist/commands/telemetry/enable.js.map +1 -1
  41. package/dist/commands/telemetry/status.js.map +1 -1
  42. package/dist/commands/upgrade.js.map +1 -1
  43. package/dist/commands/version.js.map +1 -1
  44. package/package.json +2 -7
  45. package/dist/commands/compute/app/releases.js +0 -1111
  46. package/dist/commands/compute/app/releases.js.map +0 -1
  47. package/dist/commands/compute/build/info.js +0 -500
  48. package/dist/commands/compute/build/info.js.map +0 -1
  49. package/dist/commands/compute/build/list.js +0 -494
  50. package/dist/commands/compute/build/list.js.map +0 -1
  51. package/dist/commands/compute/build/logs.js +0 -459
  52. package/dist/commands/compute/build/logs.js.map +0 -1
  53. package/dist/commands/compute/build/status.js +0 -481
  54. package/dist/commands/compute/build/status.js.map +0 -1
  55. package/dist/commands/compute/build/submit.js +0 -618
  56. package/dist/commands/compute/build/submit.js.map +0 -1
  57. package/dist/commands/compute/build/verify.js +0 -439
  58. package/dist/commands/compute/build/verify.js.map +0 -1
@@ -7,7 +7,6 @@ import { Command, Args } from "@oclif/core";
7
7
  import {
8
8
  createComputeModule,
9
9
  createBillingModule,
10
- createBuildModule,
11
10
  getEnvironmentConfig as getEnvironmentConfig2,
12
11
  requirePrivateKey,
13
12
  getPrivateKeyWithSource
@@ -15,7 +14,6 @@ import {
15
14
 
16
15
  // src/flags.ts
17
16
  import { Flags } from "@oclif/core";
18
- import { getBuildType as getBuildType2 } from "@layr-labs/ecloud-sdk";
19
17
 
20
18
  // src/utils/prompts.ts
21
19
  import { input, select, password, confirm as inquirerConfirm } from "@inquirer/prompts";
@@ -97,27 +95,6 @@ function saveGlobalConfig(config) {
97
95
  const content = dumpYaml(config, { lineWidth: -1 });
98
96
  fs.writeFileSync(configPath, content, { mode: 420 });
99
97
  }
100
- function normalizeDirectoryPath(directoryPath) {
101
- const resolved = path.resolve(directoryPath);
102
- try {
103
- return fs.realpathSync(resolved);
104
- } catch {
105
- return resolved;
106
- }
107
- }
108
- function getLinkedAppForDirectory(environment, directoryPath) {
109
- if (!directoryPath) {
110
- return null;
111
- }
112
- const config = loadGlobalConfig();
113
- const links = config.directory_links?.[environment];
114
- if (!links) {
115
- return null;
116
- }
117
- const normalizedPath = normalizeDirectoryPath(directoryPath);
118
- const appId = links[normalizedPath];
119
- return appId || null;
120
- }
121
98
  function getDefaultEnvironment() {
122
99
  const config = loadGlobalConfig();
123
100
  return config.default_environment;
@@ -214,7 +191,7 @@ function listApps(environment) {
214
191
 
215
192
  // src/utils/version.ts
216
193
  function getCliVersion() {
217
- return true ? "0.2.0-dev.1" : "0.0.0";
194
+ return true ? "0.2.0-dev.2" : "0.0.0";
218
195
  }
219
196
  function getClientId() {
220
197
  return `ecloud-cli/v${getCliVersion()}`;
@@ -243,9 +220,6 @@ function addHexPrefix(value) {
243
220
  }
244
221
  return `0x${value}`;
245
222
  }
246
- function getCurrentProjectPath() {
247
- return process.env.INIT_CWD || process.cwd();
248
- }
249
223
  var ContractAppStatusStarted = 1;
250
224
  var ContractAppStatusStopped = 2;
251
225
  var ContractAppStatusTerminated = 3;
@@ -384,7 +358,6 @@ Select an app to ${action}:
384
358
  switch (action) {
385
359
  case "view":
386
360
  case "view info for":
387
- case "view releases for":
388
361
  case "set profile for":
389
362
  return true;
390
363
  case "start":
@@ -413,19 +386,7 @@ Select an app to ${action}:
413
386
  index: i
414
387
  });
415
388
  }
416
- const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
417
- const normalizedLinkedAppId = linkedAppId ? linkedAppId.toLowerCase() : "";
418
389
  appItems.sort((a, b) => {
419
- if (normalizedLinkedAppId) {
420
- const aLinked = String(a.addr).toLowerCase() === normalizedLinkedAppId;
421
- const bLinked = String(b.addr).toLowerCase() === normalizedLinkedAppId;
422
- if (aLinked && !bLinked) {
423
- return -1;
424
- }
425
- if (bLinked && !aLinked) {
426
- return 1;
427
- }
428
- }
429
390
  const aPriority = getStatusPriority(a.status, false);
430
391
  const bPriority = getStatusPriority(b.status, false);
431
392
  if (aPriority !== bPriority) {
@@ -491,18 +452,7 @@ async function getAppIDInteractiveFromRegistry(environment, action) {
491
452
  }
492
453
  throw new Error(`Invalid app ID address: ${appIDInput}`);
493
454
  }
494
- const entries = Object.entries(allApps);
495
- const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
496
- if (linkedAppId) {
497
- const linkedIndex = entries.findIndex(
498
- ([, appId]) => String(appId).toLowerCase() === linkedAppId.toLowerCase()
499
- );
500
- if (linkedIndex > 0) {
501
- const [linkedEntry] = entries.splice(linkedIndex, 1);
502
- entries.unshift(linkedEntry);
503
- }
504
- }
505
- const choices = entries.map(([name, appID]) => {
455
+ const choices = Object.entries(allApps).map(([name, appID]) => {
506
456
  const displayName = `${name} (${appID})`;
507
457
  return { name: displayName, value: appID };
508
458
  });
@@ -630,8 +580,7 @@ var commonFlags = {
630
580
  environment: Flags.string({
631
581
  required: false,
632
582
  description: "Deployment environment to use",
633
- env: "ECLOUD_ENV",
634
- default: async () => getDefaultEnvironment() || (getBuildType2() === "dev" ? "sepolia-dev" : "sepolia")
583
+ env: "ECLOUD_ENV"
635
584
  }),
636
585
  "private-key": Flags.string({
637
586
  required: false,
@@ -649,11 +598,12 @@ var commonFlags = {
649
598
  default: false
650
599
  })
651
600
  };
652
- async function validateCommonFlags(flags, options) {
653
- flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
654
- if (options?.requirePrivateKey !== false) {
655
- flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
601
+ async function validateCommonFlags(flags) {
602
+ if (!flags["environment"]) {
603
+ flags["environment"] = getDefaultEnvironment();
656
604
  }
605
+ flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
606
+ flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
657
607
  return flags;
658
608
  }
659
609
 
@@ -697,7 +647,7 @@ import {
697
647
  addMetric,
698
648
  addMetricWithDimensions,
699
649
  emitMetrics,
700
- getBuildType as getBuildType3
650
+ getBuildType as getBuildType2
701
651
  } from "@layr-labs/ecloud-sdk";
702
652
  function createCLITelemetryClient() {
703
653
  const userUUID = getOrCreateUserUUID();
@@ -715,7 +665,7 @@ async function withTelemetry(command, action) {
715
665
  metrics.properties["command"] = command.id || command.constructor.name;
716
666
  const environment = getDefaultEnvironment() || "sepolia";
717
667
  metrics.properties["environment"] = environment;
718
- const buildType = getBuildType3() || "prod";
668
+ const buildType = getBuildType2() || "prod";
719
669
  metrics.properties["build_type"] = buildType;
720
670
  const cliVersion = command.config.version;
721
671
  if (cliVersion) {
@@ -763,7 +713,7 @@ var AppLifecycleStop = class _AppLifecycleStop extends Command {
763
713
  return withTelemetry(this, async () => {
764
714
  const { args, flags } = await this.parse(_AppLifecycleStop);
765
715
  const compute = await createComputeClient(flags);
766
- const environment = flags.environment;
716
+ const environment = flags.environment || "sepolia";
767
717
  const environmentConfig = getEnvironmentConfig3(environment);
768
718
  const rpcUrl = flags.rpcUrl || environmentConfig.defaultRPCURL;
769
719
  const privateKey = flags["private-key"] || await getPrivateKeyInteractive(environment);