@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
@@ -11,7 +11,6 @@ import {
11
11
 
12
12
  // src/flags.ts
13
13
  import { Flags } from "@oclif/core";
14
- import { getBuildType as getBuildType2 } from "@layr-labs/ecloud-sdk";
15
14
 
16
15
  // src/utils/prompts.ts
17
16
  import { input, select, password, confirm as inquirerConfirm } from "@inquirer/prompts";
@@ -93,27 +92,6 @@ function saveGlobalConfig(config) {
93
92
  const content = dumpYaml(config, { lineWidth: -1 });
94
93
  fs.writeFileSync(configPath, content, { mode: 420 });
95
94
  }
96
- function normalizeDirectoryPath(directoryPath) {
97
- const resolved = path.resolve(directoryPath);
98
- try {
99
- return fs.realpathSync(resolved);
100
- } catch {
101
- return resolved;
102
- }
103
- }
104
- function getLinkedAppForDirectory(environment, directoryPath) {
105
- if (!directoryPath) {
106
- return null;
107
- }
108
- const config = loadGlobalConfig();
109
- const links = config.directory_links?.[environment];
110
- if (!links) {
111
- return null;
112
- }
113
- const normalizedPath = normalizeDirectoryPath(directoryPath);
114
- const appId = links[normalizedPath];
115
- return appId || null;
116
- }
117
95
  function getDefaultEnvironment() {
118
96
  const config = loadGlobalConfig();
119
97
  return config.default_environment;
@@ -188,7 +166,7 @@ function listApps(environment) {
188
166
 
189
167
  // src/utils/version.ts
190
168
  function getCliVersion() {
191
- return true ? "0.2.0-dev.1" : "0.0.0";
169
+ return true ? "0.2.0-dev.2" : "0.0.0";
192
170
  }
193
171
  function getClientId() {
194
172
  return `ecloud-cli/v${getCliVersion()}`;
@@ -217,9 +195,6 @@ function addHexPrefix(value) {
217
195
  }
218
196
  return `0x${value}`;
219
197
  }
220
- function getCurrentProjectPath() {
221
- return process.env.INIT_CWD || process.cwd();
222
- }
223
198
  var ContractAppStatusStarted = 1;
224
199
  var ContractAppStatusStopped = 2;
225
200
  var ContractAppStatusTerminated = 3;
@@ -358,7 +333,6 @@ Select an app to ${action}:
358
333
  switch (action) {
359
334
  case "view":
360
335
  case "view info for":
361
- case "view releases for":
362
336
  case "set profile for":
363
337
  return true;
364
338
  case "start":
@@ -387,19 +361,7 @@ Select an app to ${action}:
387
361
  index: i
388
362
  });
389
363
  }
390
- const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
391
- const normalizedLinkedAppId = linkedAppId ? linkedAppId.toLowerCase() : "";
392
364
  appItems.sort((a, b) => {
393
- if (normalizedLinkedAppId) {
394
- const aLinked = String(a.addr).toLowerCase() === normalizedLinkedAppId;
395
- const bLinked = String(b.addr).toLowerCase() === normalizedLinkedAppId;
396
- if (aLinked && !bLinked) {
397
- return -1;
398
- }
399
- if (bLinked && !aLinked) {
400
- return 1;
401
- }
402
- }
403
365
  const aPriority = getStatusPriority(a.status, false);
404
366
  const bPriority = getStatusPriority(b.status, false);
405
367
  if (aPriority !== bPriority) {
@@ -465,18 +427,7 @@ async function getAppIDInteractiveFromRegistry(environment, action) {
465
427
  }
466
428
  throw new Error(`Invalid app ID address: ${appIDInput}`);
467
429
  }
468
- const entries = Object.entries(allApps);
469
- const linkedAppId = getLinkedAppForDirectory(environment, getCurrentProjectPath());
470
- if (linkedAppId) {
471
- const linkedIndex = entries.findIndex(
472
- ([, appId]) => String(appId).toLowerCase() === linkedAppId.toLowerCase()
473
- );
474
- if (linkedIndex > 0) {
475
- const [linkedEntry] = entries.splice(linkedIndex, 1);
476
- entries.unshift(linkedEntry);
477
- }
478
- }
479
- const choices = entries.map(([name, appID]) => {
430
+ const choices = Object.entries(allApps).map(([name, appID]) => {
480
431
  const displayName = `${name} (${appID})`;
481
432
  return { name: displayName, value: appID };
482
433
  });
@@ -595,8 +546,7 @@ var commonFlags = {
595
546
  environment: Flags.string({
596
547
  required: false,
597
548
  description: "Deployment environment to use",
598
- env: "ECLOUD_ENV",
599
- default: async () => getDefaultEnvironment() || (getBuildType2() === "dev" ? "sepolia-dev" : "sepolia")
549
+ env: "ECLOUD_ENV"
600
550
  }),
601
551
  "private-key": Flags.string({
602
552
  required: false,
@@ -614,11 +564,12 @@ var commonFlags = {
614
564
  default: false
615
565
  })
616
566
  };
617
- async function validateCommonFlags(flags, options) {
618
- flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
619
- if (options?.requirePrivateKey !== false) {
620
- flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
567
+ async function validateCommonFlags(flags) {
568
+ if (!flags["environment"]) {
569
+ flags["environment"] = getDefaultEnvironment();
621
570
  }
571
+ flags["environment"] = await getEnvironmentInteractive(flags["environment"]);
572
+ flags["private-key"] = await getPrivateKeyInteractive(flags["private-key"]);
622
573
  return flags;
623
574
  }
624
575
 
@@ -773,7 +724,7 @@ var AppInfo2 = class _AppInfo extends Command {
773
724
  async run() {
774
725
  const { args, flags } = await this.parse(_AppInfo);
775
726
  const validatedFlags = await validateCommonFlags(flags);
776
- const environment = validatedFlags.environment;
727
+ const environment = validatedFlags.environment || "sepolia";
777
728
  const environmentConfig = getEnvironmentConfig2(environment);
778
729
  const rpcUrl = validatedFlags["rpc-url"] || environmentConfig.defaultRPCURL;
779
730
  const privateKey = validatedFlags["private-key"];
@@ -858,7 +809,7 @@ async function showCountdown(seconds) {
858
809
  for (let i = seconds; i >= 0; i--) {
859
810
  process.stdout.write(chalk2.gray(`\rRefreshing in ${i}...`));
860
811
  if (i > 0) {
861
- await new Promise((resolve2) => setTimeout(resolve2, 1e3));
812
+ await new Promise((resolve) => setTimeout(resolve, 1e3));
862
813
  }
863
814
  }
864
815
  }