@layr-labs/ecloud-cli 0.4.0-dev.1 → 0.4.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 (70) hide show
  1. package/VERSION +2 -0
  2. package/bin/dev.js +0 -0
  3. package/dist/commands/auth/generate.js +0 -0
  4. package/dist/commands/auth/login.js +0 -0
  5. package/dist/commands/auth/logout.js +0 -0
  6. package/dist/commands/auth/migrate.js +0 -0
  7. package/dist/commands/auth/whoami.js +1 -0
  8. package/dist/commands/auth/whoami.js.map +1 -1
  9. package/dist/commands/billing/__tests__/status.test.js +89 -22
  10. package/dist/commands/billing/__tests__/status.test.js.map +1 -1
  11. package/dist/commands/billing/__tests__/subscribe.test.js +88 -20
  12. package/dist/commands/billing/__tests__/subscribe.test.js.map +1 -1
  13. package/dist/commands/billing/__tests__/top-up.test.js +139 -201
  14. package/dist/commands/billing/__tests__/top-up.test.js.map +1 -1
  15. package/dist/commands/billing/cancel.js +88 -19
  16. package/dist/commands/billing/cancel.js.map +1 -1
  17. package/dist/commands/billing/status.js +89 -21
  18. package/dist/commands/billing/status.js.map +1 -1
  19. package/dist/commands/billing/subscribe.js +88 -19
  20. package/dist/commands/billing/subscribe.js.map +1 -1
  21. package/dist/commands/billing/top-up.js +102 -91
  22. package/dist/commands/billing/top-up.js.map +1 -1
  23. package/dist/commands/compute/app/configure/tls.js +0 -0
  24. package/dist/commands/compute/app/create.js +1 -0
  25. package/dist/commands/compute/app/create.js.map +1 -1
  26. package/dist/commands/compute/app/deploy.js +38 -24
  27. package/dist/commands/compute/app/deploy.js.map +1 -1
  28. package/dist/commands/compute/app/info.js +2 -1
  29. package/dist/commands/compute/app/info.js.map +1 -1
  30. package/dist/commands/compute/app/list.js +2 -1
  31. package/dist/commands/compute/app/list.js.map +1 -1
  32. package/dist/commands/compute/app/logs.js +5 -8
  33. package/dist/commands/compute/app/logs.js.map +1 -1
  34. package/dist/commands/compute/app/profile/set.js +5 -8
  35. package/dist/commands/compute/app/profile/set.js.map +1 -1
  36. package/dist/commands/compute/app/releases.js +2 -1
  37. package/dist/commands/compute/app/releases.js.map +1 -1
  38. package/dist/commands/compute/app/start.js +5 -8
  39. package/dist/commands/compute/app/start.js.map +1 -1
  40. package/dist/commands/compute/app/stop.js +5 -8
  41. package/dist/commands/compute/app/stop.js.map +1 -1
  42. package/dist/commands/compute/app/terminate.js +5 -8
  43. package/dist/commands/compute/app/terminate.js.map +1 -1
  44. package/dist/commands/compute/app/upgrade.js +36 -14
  45. package/dist/commands/compute/app/upgrade.js.map +1 -1
  46. package/dist/commands/compute/build/info.js +9 -12
  47. package/dist/commands/compute/build/info.js.map +1 -1
  48. package/dist/commands/compute/build/list.js +9 -12
  49. package/dist/commands/compute/build/list.js.map +1 -1
  50. package/dist/commands/compute/build/logs.js +9 -12
  51. package/dist/commands/compute/build/logs.js.map +1 -1
  52. package/dist/commands/compute/build/status.js +9 -12
  53. package/dist/commands/compute/build/status.js.map +1 -1
  54. package/dist/commands/compute/build/submit.js +32 -10
  55. package/dist/commands/compute/build/submit.js.map +1 -1
  56. package/dist/commands/compute/build/verify.js +9 -12
  57. package/dist/commands/compute/build/verify.js.map +1 -1
  58. package/dist/commands/compute/environment/list.js +0 -0
  59. package/dist/commands/compute/environment/set.js +1 -0
  60. package/dist/commands/compute/environment/set.js.map +1 -1
  61. package/dist/commands/compute/environment/show.js +0 -0
  62. package/dist/commands/compute/undelegate.js +5 -8
  63. package/dist/commands/compute/undelegate.js.map +1 -1
  64. package/dist/commands/telemetry/disable.js +0 -0
  65. package/dist/commands/telemetry/enable.js +0 -0
  66. package/dist/commands/telemetry/status.js +0 -0
  67. package/dist/commands/upgrade.js +0 -0
  68. package/dist/commands/version.js +0 -0
  69. package/package.json +15 -14
  70. package/LICENSE +0 -7
@@ -157,17 +157,43 @@ var APPS_DIR = path2.join(CONFIG_DIR, "apps");
157
157
 
158
158
  // src/utils/version.ts
159
159
  function getCliVersion() {
160
- return true ? "0.4.0-dev.1" : "0.0.0";
160
+ return true ? "0.4.0-dev.2" : "0.0.0";
161
161
  }
162
162
  function getClientId() {
163
163
  return `ecloud-cli/v${getCliVersion()}`;
164
164
  }
165
165
 
166
166
  // src/utils/prompts.ts
167
+ import { execSync } from "child_process";
168
+ function detectGitRepoInfo() {
169
+ const git = (cmd) => execSync(cmd, { encoding: "utf-8", stdio: ["pipe", "pipe", "pipe"] }).trim();
170
+ const detectRepoUrl = () => {
171
+ try {
172
+ const remote = git("git remote get-url origin").replace(/^git@github\.com:(.+?)(?:\.git)?$/, "https://github.com/$1").replace(/\.git$/, "");
173
+ if (/^https:\/\/github\.com\/[^/]+\/[^/]+/.test(remote)) return remote;
174
+ } catch {
175
+ }
176
+ };
177
+ const detectCommitSha = () => {
178
+ try {
179
+ const branch = git("git rev-parse --abbrev-ref HEAD");
180
+ if (!branch || branch === "HEAD") return;
181
+ const lsRemote = git(`git ls-remote origin refs/heads/${branch}`);
182
+ return lsRemote.match(/^([0-9a-f]{40})\s/i)?.[1];
183
+ } catch {
184
+ }
185
+ };
186
+ try {
187
+ return { repoUrl: detectRepoUrl(), commitSha: detectCommitSha() };
188
+ } catch {
189
+ return {};
190
+ }
191
+ }
167
192
  async function promptVerifiableGitSourceInputs() {
193
+ const detected = detectGitRepoInfo();
168
194
  const repoUrl = (await input({
169
195
  message: "Enter public git repository URL:",
170
- default: "",
196
+ default: detected.repoUrl ?? "",
171
197
  validate: (value) => {
172
198
  if (!value.trim()) return "Repository URL is required";
173
199
  try {
@@ -190,7 +216,7 @@ async function promptVerifiableGitSourceInputs() {
190
216
  })).trim();
191
217
  const gitRef = (await input({
192
218
  message: "Enter git commit SHA (40 hex chars):",
193
- default: "",
219
+ default: repoUrl === detected.repoUrl ? detected.commitSha ?? "" : "",
194
220
  validate: (value) => {
195
221
  const trimmed = value.trim();
196
222
  if (!trimmed) return "Commit SHA is required";
@@ -251,8 +277,8 @@ async function getPrivateKeyInteractive(privateKey) {
251
277
  }
252
278
  return privateKey;
253
279
  }
254
- const { getPrivateKeyWithSource: getPrivateKeyWithSource2 } = await import("@layr-labs/ecloud-sdk");
255
- const result = await getPrivateKeyWithSource2({ privateKey: void 0 });
280
+ const { getPrivateKeyWithSource } = await import("@layr-labs/ecloud-sdk");
281
+ const result = await getPrivateKeyWithSource({ privateKey: void 0 });
256
282
  if (result) {
257
283
  return result.key;
258
284
  }
@@ -355,12 +381,8 @@ import {
355
381
  createBillingModule,
356
382
  createBuildModule,
357
383
  getEnvironmentConfig as getEnvironmentConfig3,
358
- requirePrivateKey,
359
- getPrivateKeyWithSource,
360
- addHexPrefix as addHexPrefix2
384
+ requirePrivateKey
361
385
  } from "@layr-labs/ecloud-sdk";
362
- import { createWalletClient, custom } from "viem";
363
- import { privateKeyToAccount as privateKeyToAccount4 } from "viem/accounts";
364
386
  async function createBuildClient(flags) {
365
387
  flags = await validateCommonFlags(flags, { requirePrivateKey: false });
366
388
  const environment = flags.environment;