@layr-labs/ecloud-sdk 0.1.0-rc.2 → 0.1.1-dev

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/dist/index.cjs CHANGED
@@ -30,18 +30,26 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
30
30
  // src/index.ts
31
31
  var index_exports = {};
32
32
  __export(index_exports, {
33
+ NoopClient: () => NoopClient,
33
34
  PRIMARY_LANGUAGES: () => PRIMARY_LANGUAGES,
35
+ PostHogClient: () => PostHogClient,
34
36
  UserApiClient: () => UserApiClient,
37
+ addMetric: () => addMetric,
38
+ addMetricWithDimensions: () => addMetricWithDimensions,
35
39
  assertValidFilePath: () => assertValidFilePath,
36
40
  assertValidImageReference: () => assertValidImageReference,
37
41
  assertValidPrivateKey: () => assertValidPrivateKey,
38
42
  checkERC7702Delegation: () => checkERC7702Delegation,
39
43
  createApp: () => createApp,
40
- createAppModule: () => createAppModule,
44
+ createAppEnvironment: () => createAppEnvironment,
41
45
  createBillingModule: () => createBillingModule,
46
+ createComputeModule: () => createComputeModule,
42
47
  createECloudClient: () => createECloudClient,
48
+ createMetricsContext: () => createMetricsContext,
49
+ createTelemetryClient: () => createTelemetryClient,
43
50
  deleteLegacyPrivateKey: () => deleteLegacyPrivateKey,
44
51
  deletePrivateKey: () => deletePrivateKey,
52
+ emitMetrics: () => emitMetrics,
45
53
  encodeStartAppData: () => encodeStartAppData,
46
54
  encodeStopAppData: () => encodeStopAppData,
47
55
  encodeTerminateAppData: () => encodeTerminateAppData,
@@ -65,11 +73,14 @@ __export(index_exports, {
65
73
  getEnvironmentConfig: () => getEnvironmentConfig,
66
74
  getLegacyKeys: () => getLegacyKeys,
67
75
  getLegacyPrivateKey: () => getLegacyPrivateKey,
76
+ getPostHogAPIKey: () => getPostHogAPIKey,
77
+ getPostHogEndpoint: () => getPostHogEndpoint,
68
78
  getPrivateKey: () => getPrivateKey,
69
79
  getPrivateKeyWithSource: () => getPrivateKeyWithSource,
70
80
  getTemplate: () => getTemplate,
71
81
  isEnvironmentAvailable: () => isEnvironmentAvailable,
72
82
  isMainnet: () => isMainnet,
83
+ isNoopClient: () => isNoopClient,
73
84
  isSubscriptionActive: () => isSubscriptionActive,
74
85
  keyExists: () => keyExists,
75
86
  listStoredKeys: () => listStoredKeys,
@@ -99,11 +110,12 @@ __export(index_exports, {
99
110
  validateUpgradeParams: () => validateUpgradeParams,
100
111
  validateXURL: () => validateXURL,
101
112
  watchDeployment: () => watchDeployment,
102
- watchUpgrade: () => watchUpgrade
113
+ watchUpgrade: () => watchUpgrade,
114
+ withSDKTelemetry: () => withSDKTelemetry
103
115
  });
104
116
  module.exports = __toCommonJS(index_exports);
105
117
 
106
- // src/client/modules/app/index.ts
118
+ // src/client/modules/compute/app/index.ts
107
119
  var import_viem9 = require("viem");
108
120
 
109
121
  // src/client/common/config/environment.ts
@@ -194,7 +206,7 @@ function getBillingEnvironmentConfig(build) {
194
206
  return config;
195
207
  }
196
208
  function getBuildType() {
197
- const buildTimeType = true ? "prod"?.toLowerCase() : void 0;
209
+ const buildTimeType = true ? "dev"?.toLowerCase() : void 0;
198
210
  const runtimeType = process.env.BUILD_TYPE?.toLowerCase();
199
211
  const buildType = buildTimeType || runtimeType;
200
212
  if (buildType === "dev") {
@@ -338,10 +350,10 @@ async function checkIfImageAlreadyLayeredForECloud(docker, imageTag) {
338
350
  return false;
339
351
  }
340
352
  }
341
- async function pullDockerImage(docker, imageTag, platform = "linux/amd64", logger) {
353
+ async function pullDockerImage(docker, imageTag, platform2 = "linux/amd64", logger) {
342
354
  logger?.info?.(`Pulling image ${imageTag}...`);
343
355
  return new Promise((resolve2, reject) => {
344
- docker.pull(imageTag, { platform }, (err, stream) => {
356
+ docker.pull(imageTag, { platform: platform2 }, (err, stream) => {
345
357
  if (err) {
346
358
  reject(new Error(`Failed to pull image ${imageTag}: ${err.message}`));
347
359
  return;
@@ -937,9 +949,9 @@ function extractDigestFromMultiPlatform(manifest, imageRef) {
937
949
  const platforms = [];
938
950
  for (const m of manifest.manifests) {
939
951
  if (m.platform) {
940
- const platform = `${m.platform.os}/${m.platform.architecture}`;
941
- platforms.push(platform);
942
- if (platform === DOCKER_PLATFORM) {
952
+ const platform2 = `${m.platform.os}/${m.platform.architecture}`;
953
+ platforms.push(platform2);
954
+ if (platform2 === DOCKER_PLATFORM) {
943
955
  const digest = hexStringToBytes32(m.digest);
944
956
  const registry = extractRegistryName(imageRef);
945
957
  return {
@@ -954,7 +966,7 @@ function extractDigestFromMultiPlatform(manifest, imageRef) {
954
966
  }
955
967
  async function extractDigestFromSinglePlatform(manifest, imageRef) {
956
968
  try {
957
- const { stdout } = await execFile("docker", ["inspect", imageRef], {
969
+ const { stdout } = await execFileAsync("docker", ["inspect", imageRef], {
958
970
  maxBuffer: 10 * 1024 * 1024
959
971
  });
960
972
  const inspectData = JSON.parse(stdout);
@@ -977,8 +989,8 @@ async function extractDigestFromSinglePlatform(manifest, imageRef) {
977
989
  }
978
990
  throw new Error(`Could not determine platform for ${imageRef}`);
979
991
  }
980
- const platform = `${config.os}/${config.architecture}`;
981
- if (platform === DOCKER_PLATFORM) {
992
+ const platform2 = `${config.os}/${config.architecture}`;
993
+ if (platform2 === DOCKER_PLATFORM) {
982
994
  let digest;
983
995
  if (inspectData[0].RepoDigests && inspectData[0].RepoDigests.length > 0) {
984
996
  const repoDigest = inspectData[0].RepoDigests[0];
@@ -995,7 +1007,7 @@ async function extractDigestFromSinglePlatform(manifest, imageRef) {
995
1007
  platform: DOCKER_PLATFORM
996
1008
  };
997
1009
  }
998
- throw createPlatformErrorMessage(imageRef, [platform]);
1010
+ throw createPlatformErrorMessage(imageRef, [platform2]);
999
1011
  } catch (error) {
1000
1012
  if (error.message.includes("platform")) {
1001
1013
  throw error;
@@ -2513,7 +2525,7 @@ var CanViewAppLogsPermission = "0x2fd3f2fe";
2513
2525
  var CanViewSensitiveAppInfoPermission = "0x0e67b22f";
2514
2526
  var CanUpdateAppProfilePermission = "0x036fef61";
2515
2527
  function getDefaultClientId() {
2516
- const version = true ? "0.1.0-rc.2" : "0.0.0";
2528
+ const version = true ? "0.1.1-dev" : "0.0.0";
2517
2529
  return `ecloud-sdk/v${version}`;
2518
2530
  }
2519
2531
  var UserApiClient = class {
@@ -5325,7 +5337,202 @@ function validatePrivateKey(key) {
5325
5337
  }
5326
5338
  }
5327
5339
 
5328
- // src/client/modules/app/deploy.ts
5340
+ // src/client/common/telemetry/noop.ts
5341
+ var NoopClient = class {
5342
+ /**
5343
+ * AddMetric implements the TelemetryClient interface
5344
+ */
5345
+ async addMetric(_metric) {
5346
+ }
5347
+ /**
5348
+ * Close implements the TelemetryClient interface
5349
+ */
5350
+ async close() {
5351
+ }
5352
+ };
5353
+ function isNoopClient(client) {
5354
+ return client instanceof NoopClient;
5355
+ }
5356
+
5357
+ // src/client/common/telemetry/posthog.ts
5358
+ var import_posthog_node = require("posthog-node");
5359
+ var PostHogClient = class {
5360
+ constructor(environment, namespace, apiKey, endpoint) {
5361
+ this.namespace = namespace;
5362
+ this.appEnvironment = environment;
5363
+ const host = endpoint || "https://us.i.posthog.com";
5364
+ this.client = new import_posthog_node.PostHog(apiKey, {
5365
+ host,
5366
+ flushAt: 1,
5367
+ // Flush immediately for CLI/SDK usage
5368
+ flushInterval: 0
5369
+ // Disable interval flushing
5370
+ });
5371
+ this.client.identify({
5372
+ distinctId: environment.userUUID,
5373
+ properties: {
5374
+ os: environment.os,
5375
+ arch: environment.arch,
5376
+ ...environment.cliVersion ? { cliVersion: environment.cliVersion } : {}
5377
+ }
5378
+ });
5379
+ }
5380
+ /**
5381
+ * AddMetric implements the TelemetryClient interface
5382
+ */
5383
+ async addMetric(metric) {
5384
+ try {
5385
+ const props = {
5386
+ name: metric.name,
5387
+ value: metric.value
5388
+ };
5389
+ for (const [k, v] of Object.entries(metric.dimensions)) {
5390
+ props[k] = v;
5391
+ }
5392
+ this.client.capture({
5393
+ distinctId: this.appEnvironment.userUUID,
5394
+ event: this.namespace,
5395
+ properties: props
5396
+ });
5397
+ } catch {
5398
+ }
5399
+ }
5400
+ /**
5401
+ * Close implements the TelemetryClient interface
5402
+ */
5403
+ async close() {
5404
+ try {
5405
+ this.client.shutdown();
5406
+ } catch {
5407
+ }
5408
+ }
5409
+ };
5410
+ function getPostHogAPIKey() {
5411
+ if (process.env.ECLOUD_POSTHOG_KEY) {
5412
+ return process.env.ECLOUD_POSTHOG_KEY;
5413
+ }
5414
+ return true ? "phc_BiKfywNft5iBI8N7MxmuVCkb4GGZj4mDFXYPmOPUAI8" : void 0;
5415
+ }
5416
+ function getPostHogEndpoint() {
5417
+ return process.env.ECLOUD_POSTHOG_ENDPOINT || "https://us.i.posthog.com";
5418
+ }
5419
+
5420
+ // src/client/common/telemetry/index.ts
5421
+ var os2 = __toESM(require("os"), 1);
5422
+
5423
+ // src/client/common/telemetry/metricsContext.ts
5424
+ function createMetricsContext() {
5425
+ return {
5426
+ startTime: /* @__PURE__ */ new Date(),
5427
+ metrics: [],
5428
+ properties: {}
5429
+ };
5430
+ }
5431
+ function addMetric(context, name, value) {
5432
+ addMetricWithDimensions(context, name, value, {});
5433
+ }
5434
+ function addMetricWithDimensions(context, name, value, dimensions) {
5435
+ context.metrics.push({
5436
+ name,
5437
+ value,
5438
+ dimensions
5439
+ });
5440
+ }
5441
+
5442
+ // src/client/common/telemetry/index.ts
5443
+ function createTelemetryClient(environment, namespace, options) {
5444
+ const telemetryEnabled = options?.telemetryEnabled === true;
5445
+ if (!telemetryEnabled) {
5446
+ return new NoopClient();
5447
+ }
5448
+ const resolvedApiKey = options?.apiKey || getPostHogAPIKey();
5449
+ if (!resolvedApiKey) {
5450
+ return new NoopClient();
5451
+ }
5452
+ const endpoint = options?.endpoint || getPostHogEndpoint();
5453
+ try {
5454
+ return new PostHogClient(environment, namespace, resolvedApiKey, endpoint);
5455
+ } catch {
5456
+ return new NoopClient();
5457
+ }
5458
+ }
5459
+ function createAppEnvironment(userUUID, cliVersion, osOverride, archOverride) {
5460
+ return {
5461
+ userUUID,
5462
+ cliVersion,
5463
+ os: osOverride || os2.platform(),
5464
+ arch: archOverride || os2.arch()
5465
+ };
5466
+ }
5467
+ async function emitMetrics(client, context) {
5468
+ if (isNoopClient(client)) {
5469
+ return;
5470
+ }
5471
+ for (const metric of context.metrics) {
5472
+ const dimensions = {
5473
+ ...metric.dimensions,
5474
+ ...context.properties
5475
+ };
5476
+ const metricWithProperties = {
5477
+ ...metric,
5478
+ dimensions
5479
+ };
5480
+ try {
5481
+ await client.addMetric(metricWithProperties);
5482
+ } catch {
5483
+ }
5484
+ }
5485
+ }
5486
+
5487
+ // src/client/common/telemetry/wrapper.ts
5488
+ var import_crypto = require("crypto");
5489
+ function generateRandomUUID() {
5490
+ return (0, import_crypto.randomUUID)();
5491
+ }
5492
+ async function withSDKTelemetry(options, action) {
5493
+ if (options.skipTelemetry) {
5494
+ return action();
5495
+ }
5496
+ const userUUID = options.userUUID || generateRandomUUID();
5497
+ const environment = createAppEnvironment(userUUID);
5498
+ const client = createTelemetryClient(environment, "ecloud-sdk", {
5499
+ telemetryEnabled: options.telemetryEnabled,
5500
+ apiKey: options.apiKey,
5501
+ endpoint: options.endpoint
5502
+ });
5503
+ const metrics = createMetricsContext();
5504
+ metrics.properties["source"] = "ecloud-sdk";
5505
+ metrics.properties["function"] = options.functionName;
5506
+ if (options.properties) {
5507
+ Object.assign(metrics.properties, options.properties);
5508
+ }
5509
+ addMetric(metrics, "Count", 1);
5510
+ let actionError;
5511
+ let result;
5512
+ try {
5513
+ result = await action();
5514
+ return result;
5515
+ } catch (err) {
5516
+ actionError = err instanceof Error ? err : new Error(String(err));
5517
+ throw err;
5518
+ } finally {
5519
+ const resultValue = actionError ? "Failure" : "Success";
5520
+ const dimensions = {};
5521
+ if (actionError) {
5522
+ dimensions["error"] = actionError.message;
5523
+ }
5524
+ addMetricWithDimensions(metrics, resultValue, 1, dimensions);
5525
+ const duration = Date.now() - metrics.startTime.getTime();
5526
+ addMetric(metrics, "DurationMilliseconds", duration);
5527
+ try {
5528
+ await emitMetrics(client, metrics);
5529
+ await client.close();
5530
+ } catch {
5531
+ }
5532
+ }
5533
+ }
5534
+
5535
+ // src/client/modules/compute/app/deploy.ts
5329
5536
  function validateDeployOptions(options) {
5330
5537
  if (!options.privateKey) {
5331
5538
  throw new Error("privateKey is required for deployment");
@@ -5352,84 +5559,95 @@ function validateDeployOptions(options) {
5352
5559
  validateLogVisibility(options.logVisibility);
5353
5560
  }
5354
5561
  async function deploy(options, logger = defaultLogger) {
5355
- validateDeployOptions(options);
5356
- const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5357
- const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5358
- logger.debug("Performing preflight checks...");
5359
- const preflightCtx = await doPreflightChecks(
5360
- {
5361
- privateKey: options.privateKey,
5362
- rpcUrl: options.rpcUrl,
5363
- environment: options.environment
5364
- },
5365
- logger
5366
- );
5367
- logger.debug("Checking quota availability...");
5368
- await checkQuotaAvailable(preflightCtx);
5369
- logger.debug("Checking Docker...");
5370
- await ensureDockerIsRunning();
5371
- const dockerfilePath = options.dockerfilePath || "";
5372
- const imageRef = options.imageRef || "";
5373
- const appName = options.appName;
5374
- const envFilePath = options.envFilePath || "";
5375
- const instanceType = options.instanceType;
5376
- const salt = generateRandomSalt();
5377
- logger.debug(`Generated salt: ${Buffer.from(salt).toString("hex")}`);
5378
- logger.debug("Calculating app ID...");
5379
- const appIDToBeDeployed = await calculateAppID(
5380
- preflightCtx.privateKey,
5381
- options.rpcUrl || preflightCtx.rpcUrl,
5382
- preflightCtx.environmentConfig,
5383
- salt
5384
- );
5385
- logger.info(``);
5386
- logger.info(`App ID: ${appIDToBeDeployed}`);
5387
- logger.info(``);
5388
- logger.info("Preparing release...");
5389
- const { release, finalImageRef } = await prepareRelease(
5390
- {
5391
- dockerfilePath,
5392
- imageRef,
5393
- envFilePath,
5394
- logRedirect,
5395
- resourceUsageAllow,
5396
- instanceType,
5397
- environmentConfig: preflightCtx.environmentConfig,
5398
- appId: appIDToBeDeployed
5399
- },
5400
- logger
5401
- );
5402
- logger.info("Deploying on-chain...");
5403
- const deployResult = await deployApp(
5404
- {
5405
- privateKey: preflightCtx.privateKey,
5406
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5407
- environmentConfig: preflightCtx.environmentConfig,
5408
- salt,
5409
- release,
5410
- publicLogs,
5411
- imageRef: finalImageRef,
5412
- gas: options.gas
5413
- },
5414
- logger
5415
- );
5416
- logger.info("Waiting for app to start...");
5417
- const ipAddress = await watchUntilRunning(
5562
+ return withSDKTelemetry(
5418
5563
  {
5419
- privateKey: preflightCtx.privateKey,
5420
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5421
- environmentConfig: preflightCtx.environmentConfig,
5422
- appId: deployResult.appId
5564
+ functionName: "deploy",
5565
+ skipTelemetry: options.skipTelemetry,
5566
+ properties: {
5567
+ environment: options.environment || "sepolia"
5568
+ }
5423
5569
  },
5424
- logger
5570
+ async () => {
5571
+ validateDeployOptions(options);
5572
+ const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5573
+ const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5574
+ logger.debug("Performing preflight checks...");
5575
+ const preflightCtx = await doPreflightChecks(
5576
+ {
5577
+ privateKey: options.privateKey,
5578
+ rpcUrl: options.rpcUrl,
5579
+ environment: options.environment
5580
+ },
5581
+ logger
5582
+ );
5583
+ logger.debug("Checking quota availability...");
5584
+ await checkQuotaAvailable(preflightCtx);
5585
+ logger.debug("Checking Docker...");
5586
+ await ensureDockerIsRunning();
5587
+ const dockerfilePath = options.dockerfilePath || "";
5588
+ const imageRef = options.imageRef || "";
5589
+ const appName = options.appName;
5590
+ const envFilePath = options.envFilePath || "";
5591
+ const instanceType = options.instanceType;
5592
+ const salt = generateRandomSalt();
5593
+ logger.debug(`Generated salt: ${Buffer.from(salt).toString("hex")}`);
5594
+ logger.debug("Calculating app ID...");
5595
+ const appIDToBeDeployed = await calculateAppID(
5596
+ preflightCtx.privateKey,
5597
+ options.rpcUrl || preflightCtx.rpcUrl,
5598
+ preflightCtx.environmentConfig,
5599
+ salt
5600
+ );
5601
+ logger.info(``);
5602
+ logger.info(`App ID: ${appIDToBeDeployed}`);
5603
+ logger.info(``);
5604
+ logger.info("Preparing release...");
5605
+ const { release, finalImageRef } = await prepareRelease(
5606
+ {
5607
+ dockerfilePath,
5608
+ imageRef,
5609
+ envFilePath,
5610
+ logRedirect,
5611
+ resourceUsageAllow,
5612
+ instanceType,
5613
+ environmentConfig: preflightCtx.environmentConfig,
5614
+ appId: appIDToBeDeployed
5615
+ },
5616
+ logger
5617
+ );
5618
+ logger.info("Deploying on-chain...");
5619
+ const deployResult = await deployApp(
5620
+ {
5621
+ privateKey: preflightCtx.privateKey,
5622
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5623
+ environmentConfig: preflightCtx.environmentConfig,
5624
+ salt,
5625
+ release,
5626
+ publicLogs,
5627
+ imageRef: finalImageRef,
5628
+ gas: options.gas
5629
+ },
5630
+ logger
5631
+ );
5632
+ logger.info("Waiting for app to start...");
5633
+ const ipAddress = await watchUntilRunning(
5634
+ {
5635
+ privateKey: preflightCtx.privateKey,
5636
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5637
+ environmentConfig: preflightCtx.environmentConfig,
5638
+ appId: deployResult.appId
5639
+ },
5640
+ logger
5641
+ );
5642
+ return {
5643
+ appId: deployResult.appId,
5644
+ txHash: deployResult.txHash,
5645
+ appName,
5646
+ imageRef: finalImageRef,
5647
+ ipAddress
5648
+ };
5649
+ }
5425
5650
  );
5426
- return {
5427
- appId: deployResult.appId,
5428
- txHash: deployResult.txHash,
5429
- appName,
5430
- imageRef: finalImageRef,
5431
- ipAddress
5432
- };
5433
5651
  }
5434
5652
  async function checkQuotaAvailable(preflightCtx) {
5435
5653
  const rpcUrl = preflightCtx.rpcUrl;
@@ -5464,107 +5682,137 @@ function generateRandomSalt() {
5464
5682
  return salt;
5465
5683
  }
5466
5684
  async function prepareDeploy(options, logger = defaultLogger) {
5467
- validateDeployOptions(options);
5468
- const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5469
- const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5470
- logger.debug("Performing preflight checks...");
5471
- const preflightCtx = await doPreflightChecks(
5472
- {
5473
- privateKey: options.privateKey,
5474
- rpcUrl: options.rpcUrl,
5475
- environment: options.environment
5476
- },
5477
- logger
5478
- );
5479
- logger.debug("Checking quota availability...");
5480
- await checkQuotaAvailable(preflightCtx);
5481
- logger.debug("Checking Docker...");
5482
- await ensureDockerIsRunning();
5483
- const dockerfilePath = options.dockerfilePath || "";
5484
- const imageRef = options.imageRef || "";
5485
- const appName = options.appName;
5486
- const envFilePath = options.envFilePath || "";
5487
- const instanceType = options.instanceType;
5488
- const salt = generateRandomSalt();
5489
- logger.debug(`Generated salt: ${Buffer.from(salt).toString("hex")}`);
5490
- logger.debug("Calculating app ID...");
5491
- const appIDToBeDeployed = await calculateAppID(
5492
- preflightCtx.privateKey,
5493
- options.rpcUrl || preflightCtx.rpcUrl,
5494
- preflightCtx.environmentConfig,
5495
- salt
5496
- );
5497
- logger.info(``);
5498
- logger.info(`App ID: ${appIDToBeDeployed}`);
5499
- logger.info(``);
5500
- logger.info("Preparing release...");
5501
- const { release, finalImageRef } = await prepareRelease(
5685
+ return withSDKTelemetry(
5502
5686
  {
5503
- dockerfilePath,
5504
- imageRef,
5505
- envFilePath,
5506
- logRedirect,
5507
- resourceUsageAllow,
5508
- instanceType,
5509
- environmentConfig: preflightCtx.environmentConfig,
5510
- appId: appIDToBeDeployed
5687
+ functionName: "prepareDeploy",
5688
+ skipTelemetry: options.skipTelemetry,
5689
+ properties: {
5690
+ environment: options.environment || "sepolia"
5691
+ }
5511
5692
  },
5512
- logger
5693
+ async () => {
5694
+ validateDeployOptions(options);
5695
+ const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5696
+ const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5697
+ logger.debug("Performing preflight checks...");
5698
+ const preflightCtx = await doPreflightChecks(
5699
+ {
5700
+ privateKey: options.privateKey,
5701
+ rpcUrl: options.rpcUrl,
5702
+ environment: options.environment
5703
+ },
5704
+ logger
5705
+ );
5706
+ logger.debug("Checking quota availability...");
5707
+ await checkQuotaAvailable(preflightCtx);
5708
+ logger.debug("Checking Docker...");
5709
+ await ensureDockerIsRunning();
5710
+ const dockerfilePath = options.dockerfilePath || "";
5711
+ const imageRef = options.imageRef || "";
5712
+ const appName = options.appName;
5713
+ const envFilePath = options.envFilePath || "";
5714
+ const instanceType = options.instanceType;
5715
+ const salt = generateRandomSalt();
5716
+ logger.debug(`Generated salt: ${Buffer.from(salt).toString("hex")}`);
5717
+ logger.debug("Calculating app ID...");
5718
+ const appIDToBeDeployed = await calculateAppID(
5719
+ preflightCtx.privateKey,
5720
+ options.rpcUrl || preflightCtx.rpcUrl,
5721
+ preflightCtx.environmentConfig,
5722
+ salt
5723
+ );
5724
+ logger.info(``);
5725
+ logger.info(`App ID: ${appIDToBeDeployed}`);
5726
+ logger.info(``);
5727
+ logger.info("Preparing release...");
5728
+ const { release, finalImageRef } = await prepareRelease(
5729
+ {
5730
+ dockerfilePath,
5731
+ imageRef,
5732
+ envFilePath,
5733
+ logRedirect,
5734
+ resourceUsageAllow,
5735
+ instanceType,
5736
+ environmentConfig: preflightCtx.environmentConfig,
5737
+ appId: appIDToBeDeployed
5738
+ },
5739
+ logger
5740
+ );
5741
+ logger.debug("Preparing deploy batch...");
5742
+ const batch = await prepareDeployBatch(
5743
+ {
5744
+ privateKey: preflightCtx.privateKey,
5745
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5746
+ environmentConfig: preflightCtx.environmentConfig,
5747
+ salt,
5748
+ release,
5749
+ publicLogs
5750
+ },
5751
+ logger
5752
+ );
5753
+ logger.debug("Estimating gas...");
5754
+ const gasEstimate = await estimateBatchGas({
5755
+ publicClient: batch.publicClient,
5756
+ environmentConfig: batch.environmentConfig,
5757
+ executions: batch.executions
5758
+ });
5759
+ return {
5760
+ prepared: {
5761
+ batch,
5762
+ appName,
5763
+ imageRef: finalImageRef,
5764
+ preflightCtx: {
5765
+ privateKey: preflightCtx.privateKey,
5766
+ rpcUrl: preflightCtx.rpcUrl,
5767
+ environmentConfig: preflightCtx.environmentConfig
5768
+ }
5769
+ },
5770
+ gasEstimate
5771
+ };
5772
+ }
5513
5773
  );
5514
- logger.debug("Preparing deploy batch...");
5515
- const batch = await prepareDeployBatch(
5774
+ }
5775
+ async function executeDeploy(prepared, gas, logger = defaultLogger, skipTelemetry) {
5776
+ return withSDKTelemetry(
5516
5777
  {
5517
- privateKey: preflightCtx.privateKey,
5518
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5519
- environmentConfig: preflightCtx.environmentConfig,
5520
- salt,
5521
- release,
5522
- publicLogs
5778
+ functionName: "executeDeploy",
5779
+ skipTelemetry
5523
5780
  },
5524
- logger
5781
+ async () => {
5782
+ logger.info("Deploying on-chain...");
5783
+ const { appId, txHash } = await executeDeployBatch(prepared.batch, gas, logger);
5784
+ return {
5785
+ appId,
5786
+ txHash,
5787
+ appName: prepared.appName,
5788
+ imageRef: prepared.imageRef
5789
+ };
5790
+ }
5525
5791
  );
5526
- logger.debug("Estimating gas...");
5527
- const gasEstimate = await estimateBatchGas({
5528
- publicClient: batch.publicClient,
5529
- environmentConfig: batch.environmentConfig,
5530
- executions: batch.executions
5531
- });
5532
- return {
5533
- prepared: {
5534
- batch,
5535
- appName,
5536
- imageRef: finalImageRef,
5537
- preflightCtx: {
5538
- privateKey: preflightCtx.privateKey,
5539
- rpcUrl: preflightCtx.rpcUrl,
5540
- environmentConfig: preflightCtx.environmentConfig
5541
- }
5542
- },
5543
- gasEstimate
5544
- };
5545
5792
  }
5546
- async function executeDeploy(prepared, gas, logger = defaultLogger) {
5547
- logger.info("Deploying on-chain...");
5548
- const { appId, txHash } = await executeDeployBatch(prepared.batch, gas, logger);
5549
- return {
5550
- appId,
5551
- txHash,
5552
- appName: prepared.appName,
5553
- imageRef: prepared.imageRef
5554
- };
5555
- }
5556
- async function watchDeployment(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId) {
5557
- const environmentConfig = getEnvironmentConfig(environment);
5558
- logger.info("Waiting for app to start...");
5559
- return watchUntilRunning(
5793
+ async function watchDeployment(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId, skipTelemetry) {
5794
+ return withSDKTelemetry(
5560
5795
  {
5561
- privateKey,
5562
- rpcUrl,
5563
- environmentConfig,
5564
- appId,
5565
- clientId
5796
+ functionName: "watchDeployment",
5797
+ skipTelemetry,
5798
+ properties: {
5799
+ environment
5800
+ }
5566
5801
  },
5567
- logger
5802
+ async () => {
5803
+ const environmentConfig = getEnvironmentConfig(environment);
5804
+ logger.info("Waiting for app to start...");
5805
+ return watchUntilRunning(
5806
+ {
5807
+ privateKey,
5808
+ rpcUrl,
5809
+ environmentConfig,
5810
+ appId,
5811
+ clientId
5812
+ },
5813
+ logger
5814
+ );
5815
+ }
5568
5816
  );
5569
5817
  }
5570
5818
 
@@ -5593,7 +5841,7 @@ async function checkAppLogPermission(preflightCtx, appAddress, logger) {
5593
5841
  }
5594
5842
  }
5595
5843
 
5596
- // src/client/modules/app/upgrade.ts
5844
+ // src/client/modules/compute/app/upgrade.ts
5597
5845
  function validateUpgradeOptions(options) {
5598
5846
  if (!options.privateKey) {
5599
5847
  throw new Error("privateKey is required for upgrade");
@@ -5621,163 +5869,204 @@ function validateUpgradeOptions(options) {
5621
5869
  return resolvedAppID;
5622
5870
  }
5623
5871
  async function upgrade(options, logger = defaultLogger) {
5624
- logger.debug("Performing preflight checks...");
5625
- const preflightCtx = await doPreflightChecks(
5626
- {
5627
- privateKey: options.privateKey,
5628
- rpcUrl: options.rpcUrl,
5629
- environment: options.environment
5630
- },
5631
- logger
5632
- );
5633
- const appID = validateUpgradeOptions(options);
5634
- const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5635
- const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5636
- logger.debug("Checking Docker...");
5637
- await ensureDockerIsRunning();
5638
- const dockerfilePath = options.dockerfilePath || "";
5639
- const imageRef = options.imageRef || "";
5640
- const envFilePath = options.envFilePath || "";
5641
- const instanceType = options.instanceType;
5642
- logger.info("Preparing release...");
5643
- const { release, finalImageRef } = await prepareRelease(
5644
- {
5645
- dockerfilePath,
5646
- imageRef,
5647
- envFilePath,
5648
- logRedirect,
5649
- resourceUsageAllow,
5650
- instanceType,
5651
- environmentConfig: preflightCtx.environmentConfig,
5652
- appId: appID
5653
- },
5654
- logger
5655
- );
5656
- logger.debug("Checking current log permission state...");
5657
- const currentlyPublic = await checkAppLogPermission(preflightCtx, appID, logger);
5658
- const needsPermissionChange = currentlyPublic !== publicLogs;
5659
- logger.info("Upgrading on-chain...");
5660
- const txHash = await upgradeApp(
5872
+ return withSDKTelemetry(
5661
5873
  {
5662
- privateKey: preflightCtx.privateKey,
5663
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5664
- environmentConfig: preflightCtx.environmentConfig,
5665
- appId: appID,
5666
- release,
5667
- publicLogs,
5668
- needsPermissionChange,
5669
- imageRef: finalImageRef,
5670
- gas: options.gas
5671
- },
5672
- logger
5673
- );
5674
- logger.info("Waiting for upgrade to complete...");
5675
- await watchUntilUpgradeComplete(
5676
- {
5677
- privateKey: preflightCtx.privateKey,
5678
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5679
- environmentConfig: preflightCtx.environmentConfig,
5680
- appId: appID
5874
+ functionName: "upgrade",
5875
+ skipTelemetry: options.skipTelemetry,
5876
+ properties: {
5877
+ environment: options.environment || "sepolia"
5878
+ }
5681
5879
  },
5682
- logger
5880
+ async () => {
5881
+ logger.debug("Performing preflight checks...");
5882
+ const preflightCtx = await doPreflightChecks(
5883
+ {
5884
+ privateKey: options.privateKey,
5885
+ rpcUrl: options.rpcUrl,
5886
+ environment: options.environment
5887
+ },
5888
+ logger
5889
+ );
5890
+ const appID = validateUpgradeOptions(options);
5891
+ const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5892
+ const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5893
+ logger.debug("Checking Docker...");
5894
+ await ensureDockerIsRunning();
5895
+ const dockerfilePath = options.dockerfilePath || "";
5896
+ const imageRef = options.imageRef || "";
5897
+ const envFilePath = options.envFilePath || "";
5898
+ const instanceType = options.instanceType;
5899
+ logger.info("Preparing release...");
5900
+ const { release, finalImageRef } = await prepareRelease(
5901
+ {
5902
+ dockerfilePath,
5903
+ imageRef,
5904
+ envFilePath,
5905
+ logRedirect,
5906
+ resourceUsageAllow,
5907
+ instanceType,
5908
+ environmentConfig: preflightCtx.environmentConfig,
5909
+ appId: appID
5910
+ },
5911
+ logger
5912
+ );
5913
+ logger.debug("Checking current log permission state...");
5914
+ const currentlyPublic = await checkAppLogPermission(preflightCtx, appID, logger);
5915
+ const needsPermissionChange = currentlyPublic !== publicLogs;
5916
+ logger.info("Upgrading on-chain...");
5917
+ const txHash = await upgradeApp(
5918
+ {
5919
+ privateKey: preflightCtx.privateKey,
5920
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5921
+ environmentConfig: preflightCtx.environmentConfig,
5922
+ appId: appID,
5923
+ release,
5924
+ publicLogs,
5925
+ needsPermissionChange,
5926
+ imageRef: finalImageRef,
5927
+ gas: options.gas
5928
+ },
5929
+ logger
5930
+ );
5931
+ logger.info("Waiting for upgrade to complete...");
5932
+ await watchUntilUpgradeComplete(
5933
+ {
5934
+ privateKey: preflightCtx.privateKey,
5935
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5936
+ environmentConfig: preflightCtx.environmentConfig,
5937
+ appId: appID
5938
+ },
5939
+ logger
5940
+ );
5941
+ return {
5942
+ appId: appID,
5943
+ imageRef: finalImageRef,
5944
+ txHash
5945
+ };
5946
+ }
5683
5947
  );
5684
- return {
5685
- appId: appID,
5686
- imageRef: finalImageRef,
5687
- txHash
5688
- };
5689
5948
  }
5690
5949
  async function prepareUpgrade(options, logger = defaultLogger) {
5691
- logger.debug("Performing preflight checks...");
5692
- const preflightCtx = await doPreflightChecks(
5950
+ return withSDKTelemetry(
5693
5951
  {
5694
- privateKey: options.privateKey,
5695
- rpcUrl: options.rpcUrl,
5696
- environment: options.environment
5952
+ functionName: "prepareUpgrade",
5953
+ skipTelemetry: options.skipTelemetry,
5954
+ properties: {
5955
+ environment: options.environment || "sepolia"
5956
+ }
5697
5957
  },
5698
- logger
5958
+ async () => {
5959
+ logger.debug("Performing preflight checks...");
5960
+ const preflightCtx = await doPreflightChecks(
5961
+ {
5962
+ privateKey: options.privateKey,
5963
+ rpcUrl: options.rpcUrl,
5964
+ environment: options.environment
5965
+ },
5966
+ logger
5967
+ );
5968
+ const appID = validateUpgradeOptions(options);
5969
+ const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5970
+ const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5971
+ logger.debug("Checking Docker...");
5972
+ await ensureDockerIsRunning();
5973
+ const dockerfilePath = options.dockerfilePath || "";
5974
+ const imageRef = options.imageRef || "";
5975
+ const envFilePath = options.envFilePath || "";
5976
+ const instanceType = options.instanceType;
5977
+ logger.info("Preparing release...");
5978
+ const { release, finalImageRef } = await prepareRelease(
5979
+ {
5980
+ dockerfilePath,
5981
+ imageRef,
5982
+ envFilePath,
5983
+ logRedirect,
5984
+ resourceUsageAllow,
5985
+ instanceType,
5986
+ environmentConfig: preflightCtx.environmentConfig,
5987
+ appId: appID
5988
+ },
5989
+ logger
5990
+ );
5991
+ logger.debug("Checking current log permission state...");
5992
+ const currentlyPublic = await checkAppLogPermission(preflightCtx, appID, logger);
5993
+ const needsPermissionChange = currentlyPublic !== publicLogs;
5994
+ logger.debug("Preparing upgrade batch...");
5995
+ const batch = await prepareUpgradeBatch({
5996
+ privateKey: preflightCtx.privateKey,
5997
+ rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5998
+ environmentConfig: preflightCtx.environmentConfig,
5999
+ appId: appID,
6000
+ release,
6001
+ publicLogs,
6002
+ needsPermissionChange
6003
+ });
6004
+ logger.debug("Estimating gas...");
6005
+ const gasEstimate = await estimateBatchGas({
6006
+ publicClient: batch.publicClient,
6007
+ environmentConfig: batch.environmentConfig,
6008
+ executions: batch.executions
6009
+ });
6010
+ return {
6011
+ prepared: {
6012
+ batch,
6013
+ appId: appID,
6014
+ imageRef: finalImageRef,
6015
+ preflightCtx: {
6016
+ privateKey: preflightCtx.privateKey,
6017
+ rpcUrl: preflightCtx.rpcUrl,
6018
+ environmentConfig: preflightCtx.environmentConfig
6019
+ }
6020
+ },
6021
+ gasEstimate
6022
+ };
6023
+ }
5699
6024
  );
5700
- const appID = validateUpgradeOptions(options);
5701
- const { logRedirect, publicLogs } = validateLogVisibility(options.logVisibility);
5702
- const resourceUsageAllow = validateResourceUsageMonitoring(options.resourceUsageMonitoring);
5703
- logger.debug("Checking Docker...");
5704
- await ensureDockerIsRunning();
5705
- const dockerfilePath = options.dockerfilePath || "";
5706
- const imageRef = options.imageRef || "";
5707
- const envFilePath = options.envFilePath || "";
5708
- const instanceType = options.instanceType;
5709
- logger.info("Preparing release...");
5710
- const { release, finalImageRef } = await prepareRelease(
6025
+ }
6026
+ async function executeUpgrade(prepared, gas, logger = defaultLogger, skipTelemetry) {
6027
+ return withSDKTelemetry(
5711
6028
  {
5712
- dockerfilePath,
5713
- imageRef,
5714
- envFilePath,
5715
- logRedirect,
5716
- resourceUsageAllow,
5717
- instanceType,
5718
- environmentConfig: preflightCtx.environmentConfig,
5719
- appId: appID
6029
+ functionName: "executeUpgrade",
6030
+ skipTelemetry
5720
6031
  },
5721
- logger
6032
+ async () => {
6033
+ logger.info("Upgrading on-chain...");
6034
+ const txHash = await executeUpgradeBatch(prepared.batch, gas, logger);
6035
+ return {
6036
+ appId: prepared.appId,
6037
+ imageRef: prepared.imageRef,
6038
+ txHash
6039
+ };
6040
+ }
5722
6041
  );
5723
- logger.debug("Checking current log permission state...");
5724
- const currentlyPublic = await checkAppLogPermission(preflightCtx, appID, logger);
5725
- const needsPermissionChange = currentlyPublic !== publicLogs;
5726
- logger.debug("Preparing upgrade batch...");
5727
- const batch = await prepareUpgradeBatch({
5728
- privateKey: preflightCtx.privateKey,
5729
- rpcUrl: options.rpcUrl || preflightCtx.rpcUrl,
5730
- environmentConfig: preflightCtx.environmentConfig,
5731
- appId: appID,
5732
- release,
5733
- publicLogs,
5734
- needsPermissionChange
5735
- });
5736
- logger.debug("Estimating gas...");
5737
- const gasEstimate = await estimateBatchGas({
5738
- publicClient: batch.publicClient,
5739
- environmentConfig: batch.environmentConfig,
5740
- executions: batch.executions
5741
- });
5742
- return {
5743
- prepared: {
5744
- batch,
5745
- appId: appID,
5746
- imageRef: finalImageRef,
5747
- preflightCtx: {
5748
- privateKey: preflightCtx.privateKey,
5749
- rpcUrl: preflightCtx.rpcUrl,
5750
- environmentConfig: preflightCtx.environmentConfig
5751
- }
5752
- },
5753
- gasEstimate
5754
- };
5755
6042
  }
5756
- async function executeUpgrade(prepared, gas, logger = defaultLogger) {
5757
- logger.info("Upgrading on-chain...");
5758
- const txHash = await executeUpgradeBatch(prepared.batch, gas, logger);
5759
- return {
5760
- appId: prepared.appId,
5761
- imageRef: prepared.imageRef,
5762
- txHash
5763
- };
5764
- }
5765
- async function watchUpgrade(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId) {
5766
- const environmentConfig = getEnvironmentConfig(environment);
5767
- logger.info("Waiting for upgrade to complete...");
5768
- await watchUntilUpgradeComplete(
6043
+ async function watchUpgrade(appId, privateKey, rpcUrl, environment, logger = defaultLogger, clientId, skipTelemetry) {
6044
+ return withSDKTelemetry(
5769
6045
  {
5770
- privateKey,
5771
- rpcUrl,
5772
- environmentConfig,
5773
- appId,
5774
- clientId
6046
+ functionName: "watchUpgrade",
6047
+ skipTelemetry,
6048
+ properties: {
6049
+ environment
6050
+ }
5775
6051
  },
5776
- logger
6052
+ async () => {
6053
+ const environmentConfig = getEnvironmentConfig(environment);
6054
+ logger.info("Waiting for upgrade to complete...");
6055
+ await watchUntilUpgradeComplete(
6056
+ {
6057
+ privateKey,
6058
+ rpcUrl,
6059
+ environmentConfig,
6060
+ appId,
6061
+ clientId
6062
+ },
6063
+ logger
6064
+ );
6065
+ }
5777
6066
  );
5778
6067
  }
5779
6068
 
5780
- // src/client/modules/app/create.ts
6069
+ // src/client/modules/compute/app/create.ts
5781
6070
  var fs7 = __toESM(require("fs"), 1);
5782
6071
  var path7 = __toESM(require("path"), 1);
5783
6072
 
@@ -5870,7 +6159,7 @@ function getCategoryDescriptions(catalog, language) {
5870
6159
  // src/client/common/templates/git.ts
5871
6160
  var fs5 = __toESM(require("fs"), 1);
5872
6161
  var path5 = __toESM(require("path"), 1);
5873
- var os2 = __toESM(require("os"), 1);
6162
+ var os3 = __toESM(require("os"), 1);
5874
6163
  var import_child_process2 = require("child_process");
5875
6164
  var import_util4 = require("util");
5876
6165
  var execAsync2 = (0, import_util4.promisify)(import_child_process2.exec);
@@ -5909,9 +6198,9 @@ async function fetchTemplateSubdirectory(repoURL, ref, subPath, targetDir, logge
5909
6198
  }
5910
6199
  let tempDir;
5911
6200
  try {
5912
- tempDir = fs5.mkdtempSync(path5.join(os2.tmpdir(), "eigenx-template-"));
6201
+ tempDir = fs5.mkdtempSync(path5.join(os3.tmpdir(), "eigenx-template-"));
5913
6202
  } catch {
5914
- const homeDir = os2.homedir();
6203
+ const homeDir = os3.homedir();
5915
6204
  const fallbackBase = path5.join(homeDir, ".eigenx", "tmp");
5916
6205
  fs5.mkdirSync(fallbackBase, { recursive: true });
5917
6206
  tempDir = fs5.mkdtempSync(path5.join(fallbackBase, "eigenx-template-"));
@@ -6088,7 +6377,7 @@ async function updateProjectFile(projectDir, filename, oldString, newString, log
6088
6377
  fs6.writeFileSync(filePath, newContent, { mode: 420 });
6089
6378
  }
6090
6379
 
6091
- // src/client/modules/app/create.ts
6380
+ // src/client/modules/compute/app/create.ts
6092
6381
  var PRIMARY_LANGUAGES = ["typescript", "golang", "rust", "python"];
6093
6382
  function validateProjectName(name) {
6094
6383
  if (!name) {
@@ -6129,30 +6418,41 @@ async function getAvailableTemplates(language) {
6129
6418
  }));
6130
6419
  }
6131
6420
  async function createApp(options, logger = defaultLogger) {
6132
- validateProjectName(options.name || "");
6133
- validateLanguage(options.language || "");
6134
- const cfg = await gatherProjectConfig(
6421
+ return withSDKTelemetry(
6135
6422
  {
6136
- ...options,
6137
- name: options.name,
6138
- language: options.language
6423
+ functionName: "createApp",
6424
+ skipTelemetry: options.skipTelemetry,
6425
+ properties: {
6426
+ language: options.language || ""
6427
+ }
6139
6428
  },
6140
- logger
6141
- );
6142
- if (fs7.existsSync(cfg.name)) {
6143
- throw new Error(`Directory ${cfg.name} already exists`);
6144
- }
6145
- fs7.mkdirSync(cfg.name, { mode: 493 });
6146
- try {
6147
- await populateProjectFromTemplate(cfg, options, logger);
6148
- if (cfg.subPath && cfg.language && cfg.templateEntry) {
6149
- await postProcessTemplate(cfg.name, cfg.language, cfg.templateEntry, logger);
6429
+ async () => {
6430
+ validateProjectName(options.name || "");
6431
+ validateLanguage(options.language || "");
6432
+ const cfg = await gatherProjectConfig(
6433
+ {
6434
+ ...options,
6435
+ name: options.name,
6436
+ language: options.language
6437
+ },
6438
+ logger
6439
+ );
6440
+ if (fs7.existsSync(cfg.name)) {
6441
+ throw new Error(`Directory ${cfg.name} already exists`);
6442
+ }
6443
+ fs7.mkdirSync(cfg.name, { mode: 493 });
6444
+ try {
6445
+ await populateProjectFromTemplate(cfg, options, logger);
6446
+ if (cfg.subPath && cfg.language && cfg.templateEntry) {
6447
+ await postProcessTemplate(cfg.name, cfg.language, cfg.templateEntry, logger);
6448
+ }
6449
+ logger.info(`Successfully created ${cfg.language || "project"} project: ${cfg.name}`);
6450
+ } catch (error) {
6451
+ fs7.rmSync(cfg.name, { recursive: true, force: true });
6452
+ throw error;
6453
+ }
6150
6454
  }
6151
- logger.info(`Successfully created ${cfg.language || "project"} project: ${cfg.name}`);
6152
- } catch (error) {
6153
- fs7.rmSync(cfg.name, { recursive: true, force: true });
6154
- throw error;
6155
- }
6455
+ );
6156
6456
  }
6157
6457
  async function gatherProjectConfig(options, logger) {
6158
6458
  const cfg = {
@@ -6240,7 +6540,7 @@ async function copyDirectory2(src, dst) {
6240
6540
  }
6241
6541
  }
6242
6542
 
6243
- // src/client/modules/app/logs.ts
6543
+ // src/client/modules/compute/app/logs.ts
6244
6544
  var import_chalk = __toESM(require("chalk"), 1);
6245
6545
  var AppStatusCreated = "Created";
6246
6546
  var AppStatusDeploying = "Deploying";
@@ -6322,93 +6622,107 @@ async function watchLogs(appID, userApiClient, initialLogs) {
6322
6622
  }
6323
6623
  console.log("\nStopped watching");
6324
6624
  }
6325
- async function logs(options, logger = defaultLogger) {
6326
- console.log();
6327
- if (!options.appID) {
6328
- throw new Error("appID is required for viewing logs");
6329
- }
6330
- const environment = options.environment || "sepolia";
6331
- const environmentConfig = getEnvironmentConfig(environment);
6332
- const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
6333
- if (!rpcUrl) {
6334
- throw new Error("RPC URL is required for authenticated requests");
6335
- }
6336
- const appID = validateAppID(options.appID);
6337
- const formattedApp = formatAppDisplay(environmentConfig.name, appID, "");
6338
- const userApiClient = new UserApiClient(
6339
- environmentConfig,
6340
- options.privateKey,
6341
- rpcUrl,
6342
- options.clientId
6343
- );
6344
- let logsText;
6345
- let logsError = null;
6346
- try {
6347
- logsText = await userApiClient.getLogs(appID);
6348
- } catch (err) {
6349
- logsError = err;
6350
- logsText = "";
6351
- }
6352
- const watchMode = options.watch || false;
6353
- if (logsError || logsText.trim() === "") {
6354
- if (watchMode) {
6355
- logger.info("\nWaiting for logs to become available...");
6625
+ async function logs(options, logger = defaultLogger, skipTelemetry = false) {
6626
+ const skipTelemetryFlag = skipTelemetry || options.skipTelemetry || false;
6627
+ return withSDKTelemetry(
6628
+ {
6629
+ functionName: "logs",
6630
+ skipTelemetry: skipTelemetryFlag,
6631
+ properties: { environment: options.environment || "sepolia" }
6632
+ },
6633
+ async () => {
6356
6634
  console.log();
6357
- await watchLogs(appID, userApiClient, "");
6358
- return;
6359
- }
6360
- try {
6361
- const statuses = await userApiClient.getStatuses([appID]);
6362
- if (statuses.length > 0) {
6363
- const status = statuses[0].status;
6364
- switch (status) {
6365
- case AppStatusCreated:
6366
- case AppStatusDeploying:
6367
- logger.info(
6368
- `${formattedApp} is currently being provisioned. Logs will be available once deployment is complete.`
6369
- );
6370
- return;
6371
- case AppStatusUpgrading:
6372
- logger.info(
6373
- `${formattedApp} is currently upgrading. Logs will be available once upgrade is complete.`
6374
- );
6375
- return;
6376
- case AppStatusResuming:
6377
- logger.info(`${formattedApp} is currently resuming. Logs will be available shortly.`);
6378
- return;
6379
- case AppStatusStopping:
6380
- logger.info(`${formattedApp} is currently stopping. Logs may be limited.`);
6381
- return;
6382
- case AppStatusStopped:
6383
- case AppStatusTerminating:
6384
- case AppStatusTerminated:
6385
- case AppStatusSuspended:
6386
- logger.info(`${formattedApp} is ${status.toLowerCase()}. Logs are not available.`);
6387
- return;
6388
- case AppStatusFailed:
6389
- logger.info(`${formattedApp} has failed. Check the app status for more information.`);
6390
- return;
6635
+ if (!options.appID) {
6636
+ throw new Error("appID is required for viewing logs");
6637
+ }
6638
+ const environment = options.environment || "sepolia";
6639
+ const environmentConfig = getEnvironmentConfig(environment);
6640
+ const rpcUrl = options.rpcUrl || environmentConfig.defaultRPCURL;
6641
+ if (!rpcUrl) {
6642
+ throw new Error("RPC URL is required for authenticated requests");
6643
+ }
6644
+ const appID = validateAppID(options.appID);
6645
+ const formattedApp = formatAppDisplay(environmentConfig.name, appID, "");
6646
+ const userApiClient = new UserApiClient(
6647
+ environmentConfig,
6648
+ options.privateKey,
6649
+ rpcUrl,
6650
+ options.clientId
6651
+ );
6652
+ let logsText;
6653
+ let logsError = null;
6654
+ try {
6655
+ logsText = await userApiClient.getLogs(appID);
6656
+ } catch (err) {
6657
+ logsError = err;
6658
+ logsText = "";
6659
+ }
6660
+ const watchMode = options.watch || false;
6661
+ if (logsError || logsText.trim() === "") {
6662
+ if (watchMode) {
6663
+ logger.info("\nWaiting for logs to become available...");
6664
+ console.log();
6665
+ await watchLogs(appID, userApiClient, "");
6666
+ return;
6391
6667
  }
6668
+ try {
6669
+ const statuses = await userApiClient.getStatuses([appID]);
6670
+ if (statuses.length > 0) {
6671
+ const status = statuses[0].status;
6672
+ switch (status) {
6673
+ case AppStatusCreated:
6674
+ case AppStatusDeploying:
6675
+ logger.info(
6676
+ `${formattedApp} is currently being provisioned. Logs will be available once deployment is complete.`
6677
+ );
6678
+ return;
6679
+ case AppStatusUpgrading:
6680
+ logger.info(
6681
+ `${formattedApp} is currently upgrading. Logs will be available once upgrade is complete.`
6682
+ );
6683
+ return;
6684
+ case AppStatusResuming:
6685
+ logger.info(
6686
+ `${formattedApp} is currently resuming. Logs will be available shortly.`
6687
+ );
6688
+ return;
6689
+ case AppStatusStopping:
6690
+ logger.info(`${formattedApp} is currently stopping. Logs may be limited.`);
6691
+ return;
6692
+ case AppStatusStopped:
6693
+ case AppStatusTerminating:
6694
+ case AppStatusTerminated:
6695
+ case AppStatusSuspended:
6696
+ logger.info(`${formattedApp} is ${status.toLowerCase()}. Logs are not available.`);
6697
+ return;
6698
+ case AppStatusFailed:
6699
+ logger.info(
6700
+ `${formattedApp} has failed. Check the app status for more information.`
6701
+ );
6702
+ return;
6703
+ }
6704
+ }
6705
+ } catch {
6706
+ }
6707
+ if (logsError) {
6708
+ throw new Error(
6709
+ `Failed to get logs, you can watch for logs by calling this command with the --watch flag (or --w): ${logsError.message}`
6710
+ );
6711
+ }
6712
+ throw new Error(
6713
+ "Failed to get logs, you can watch for logs by calling this command with the --watch flag (or --w): empty logs"
6714
+ );
6392
6715
  }
6393
- } catch {
6394
- }
6395
- if (logsError) {
6396
- throw new Error(
6397
- `Failed to get logs, you can watch for logs by calling this command with the --watch flag (or --w): ${logsError.message}`
6398
- );
6716
+ console.log(logsText);
6717
+ if (!watchMode) {
6718
+ return;
6719
+ }
6720
+ await watchLogs(appID, userApiClient, logsText);
6399
6721
  }
6400
- throw new Error(
6401
- "Failed to get logs, you can watch for logs by calling this command with the --watch flag (or --w): empty logs"
6402
- );
6403
- }
6404
- console.log(logsText);
6405
- if (!watchMode) {
6406
- return;
6407
- }
6408
- await watchLogs(appID, userApiClient, logsText);
6722
+ );
6409
6723
  }
6410
6724
 
6411
- // src/client/modules/app/index.ts
6725
+ // src/client/modules/compute/app/index.ts
6412
6726
  var CONTROLLER_ABI = (0, import_viem9.parseAbi)([
6413
6727
  "function startApp(address appId)",
6414
6728
  "function stopApp(address appId)",
@@ -6437,6 +6751,7 @@ function encodeTerminateAppData(appId) {
6437
6751
  }
6438
6752
  function createAppModule(ctx) {
6439
6753
  const privateKey = addHexPrefix(ctx.privateKey);
6754
+ const skipTelemetry = ctx.skipTelemetry || false;
6440
6755
  const environment = getEnvironmentConfig(ctx.environment);
6441
6756
  const logger = getLogger(ctx.verbose);
6442
6757
  return {
@@ -6499,74 +6814,106 @@ function createAppModule(ctx) {
6499
6814
  environment: ctx.environment,
6500
6815
  clientId: ctx.clientId
6501
6816
  },
6502
- logger
6817
+ logger,
6818
+ skipTelemetry
6819
+ // Skip if called from CLI
6503
6820
  );
6504
6821
  },
6505
6822
  async start(appId, opts) {
6506
- const pendingMessage = `Starting app ${appId}...`;
6507
- const data = (0, import_viem9.encodeFunctionData)({
6508
- abi: CONTROLLER_ABI,
6509
- functionName: "startApp",
6510
- args: [appId]
6511
- });
6512
- const tx = await sendAndWaitForTransaction(
6823
+ return withSDKTelemetry(
6513
6824
  {
6514
- privateKey,
6515
- rpcUrl: ctx.rpcUrl,
6516
- environmentConfig: environment,
6517
- to: environment.appControllerAddress,
6518
- data,
6519
- pendingMessage,
6520
- txDescription: "StartApp",
6521
- gas: opts?.gas
6825
+ functionName: "start",
6826
+ skipTelemetry,
6827
+ // Skip if called from CLI
6828
+ properties: { environment: ctx.environment }
6522
6829
  },
6523
- logger
6830
+ async () => {
6831
+ const pendingMessage = `Starting app ${appId}...`;
6832
+ const data = (0, import_viem9.encodeFunctionData)({
6833
+ abi: CONTROLLER_ABI,
6834
+ functionName: "startApp",
6835
+ args: [appId]
6836
+ });
6837
+ const tx = await sendAndWaitForTransaction(
6838
+ {
6839
+ privateKey,
6840
+ rpcUrl: ctx.rpcUrl,
6841
+ environmentConfig: environment,
6842
+ to: environment.appControllerAddress,
6843
+ data,
6844
+ pendingMessage,
6845
+ txDescription: "StartApp",
6846
+ gas: opts?.gas
6847
+ },
6848
+ logger
6849
+ );
6850
+ return { tx };
6851
+ }
6524
6852
  );
6525
- return { tx };
6526
6853
  },
6527
6854
  async stop(appId, opts) {
6528
- const pendingMessage = `Stopping app ${appId}...`;
6529
- const data = (0, import_viem9.encodeFunctionData)({
6530
- abi: CONTROLLER_ABI,
6531
- functionName: "stopApp",
6532
- args: [appId]
6533
- });
6534
- const tx = await sendAndWaitForTransaction(
6855
+ return withSDKTelemetry(
6535
6856
  {
6536
- privateKey,
6537
- rpcUrl: ctx.rpcUrl,
6538
- environmentConfig: environment,
6539
- to: environment.appControllerAddress,
6540
- data,
6541
- pendingMessage,
6542
- txDescription: "StopApp",
6543
- gas: opts?.gas
6857
+ functionName: "stop",
6858
+ skipTelemetry,
6859
+ // Skip if called from CLI
6860
+ properties: { environment: ctx.environment }
6544
6861
  },
6545
- logger
6862
+ async () => {
6863
+ const pendingMessage = `Stopping app ${appId}...`;
6864
+ const data = (0, import_viem9.encodeFunctionData)({
6865
+ abi: CONTROLLER_ABI,
6866
+ functionName: "stopApp",
6867
+ args: [appId]
6868
+ });
6869
+ const tx = await sendAndWaitForTransaction(
6870
+ {
6871
+ privateKey,
6872
+ rpcUrl: ctx.rpcUrl,
6873
+ environmentConfig: environment,
6874
+ to: environment.appControllerAddress,
6875
+ data,
6876
+ pendingMessage,
6877
+ txDescription: "StopApp",
6878
+ gas: opts?.gas
6879
+ },
6880
+ logger
6881
+ );
6882
+ return { tx };
6883
+ }
6546
6884
  );
6547
- return { tx };
6548
6885
  },
6549
6886
  async terminate(appId, opts) {
6550
- const pendingMessage = `Terminating app ${appId}...`;
6551
- const data = (0, import_viem9.encodeFunctionData)({
6552
- abi: CONTROLLER_ABI,
6553
- functionName: "terminateApp",
6554
- args: [appId]
6555
- });
6556
- const tx = await sendAndWaitForTransaction(
6887
+ return withSDKTelemetry(
6557
6888
  {
6558
- privateKey,
6559
- rpcUrl: ctx.rpcUrl,
6560
- environmentConfig: environment,
6561
- to: environment.appControllerAddress,
6562
- data,
6563
- pendingMessage,
6564
- txDescription: "TerminateApp",
6565
- gas: opts?.gas
6889
+ functionName: "terminate",
6890
+ skipTelemetry,
6891
+ // Skip if called from CLI
6892
+ properties: { environment: ctx.environment }
6566
6893
  },
6567
- logger
6894
+ async () => {
6895
+ const pendingMessage = `Terminating app ${appId}...`;
6896
+ const data = (0, import_viem9.encodeFunctionData)({
6897
+ abi: CONTROLLER_ABI,
6898
+ functionName: "terminateApp",
6899
+ args: [appId]
6900
+ });
6901
+ const tx = await sendAndWaitForTransaction(
6902
+ {
6903
+ privateKey,
6904
+ rpcUrl: ctx.rpcUrl,
6905
+ environmentConfig: environment,
6906
+ to: environment.appControllerAddress,
6907
+ data,
6908
+ pendingMessage,
6909
+ txDescription: "TerminateApp",
6910
+ gas: opts?.gas
6911
+ },
6912
+ logger
6913
+ );
6914
+ return { tx };
6915
+ }
6568
6916
  );
6569
- return { tx };
6570
6917
  },
6571
6918
  async isDelegated() {
6572
6919
  return isDelegated({
@@ -6576,19 +6923,36 @@ function createAppModule(ctx) {
6576
6923
  });
6577
6924
  },
6578
6925
  async undelegate() {
6579
- const tx = await undelegate(
6926
+ return withSDKTelemetry(
6580
6927
  {
6581
- privateKey,
6582
- rpcUrl: ctx.rpcUrl,
6583
- environmentConfig: environment
6928
+ functionName: "undelegate",
6929
+ skipTelemetry,
6930
+ // Skip if called from CLI
6931
+ properties: { environment: ctx.environment }
6584
6932
  },
6585
- logger
6933
+ async () => {
6934
+ const tx = await undelegate(
6935
+ {
6936
+ privateKey,
6937
+ rpcUrl: ctx.rpcUrl,
6938
+ environmentConfig: environment
6939
+ },
6940
+ logger
6941
+ );
6942
+ return { tx };
6943
+ }
6586
6944
  );
6587
- return { tx };
6588
6945
  }
6589
6946
  };
6590
6947
  }
6591
6948
 
6949
+ // src/client/modules/compute/index.ts
6950
+ function createComputeModule(config) {
6951
+ return {
6952
+ app: createAppModule(config)
6953
+ };
6954
+ }
6955
+
6592
6956
  // src/client/common/utils/billingapi.ts
6593
6957
  var import_axios2 = __toESM(require("axios"), 1);
6594
6958
  var import_accounts5 = require("viem/accounts");
@@ -6662,69 +7026,6 @@ Please check:
6662
7026
  }
6663
7027
  };
6664
7028
 
6665
- // src/client/modules/billing/index.ts
6666
- function createBillingModule(config) {
6667
- const { verbose = false } = config;
6668
- const privateKey = addHexPrefix(config.privateKey);
6669
- const logger = getLogger(verbose);
6670
- const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
6671
- const billingApi = new BillingApiClient(billingEnvConfig, privateKey);
6672
- return {
6673
- async subscribe(opts) {
6674
- const productId = opts?.productId || "compute";
6675
- logger.debug(`Checking existing subscription for ${productId}...`);
6676
- const currentStatus = await billingApi.getSubscription(productId);
6677
- if (isSubscriptionActive(currentStatus.subscriptionStatus)) {
6678
- logger.debug(`Subscription already active: ${currentStatus.subscriptionStatus}`);
6679
- return {
6680
- type: "already_active",
6681
- status: currentStatus.subscriptionStatus
6682
- };
6683
- }
6684
- if (currentStatus.subscriptionStatus === "past_due" || currentStatus.subscriptionStatus === "unpaid") {
6685
- logger.debug(`Subscription has payment issue: ${currentStatus.subscriptionStatus}`);
6686
- return {
6687
- type: "payment_issue",
6688
- status: currentStatus.subscriptionStatus,
6689
- portalUrl: currentStatus.portalUrl
6690
- };
6691
- }
6692
- logger.debug(`Creating subscription for ${productId}...`);
6693
- const result = await billingApi.createSubscription(productId);
6694
- logger.debug(`Checkout URL: ${result.checkoutUrl}`);
6695
- return {
6696
- type: "checkout_created",
6697
- checkoutUrl: result.checkoutUrl
6698
- };
6699
- },
6700
- async getStatus(opts) {
6701
- const productId = opts?.productId || "compute";
6702
- logger.debug(`Fetching subscription status for ${productId}...`);
6703
- const result = await billingApi.getSubscription(productId);
6704
- logger.debug(`Subscription status: ${result.subscriptionStatus}`);
6705
- return result;
6706
- },
6707
- async cancel(opts) {
6708
- const productId = opts?.productId || "compute";
6709
- logger.debug(`Checking subscription status for ${productId}...`);
6710
- const currentStatus = await billingApi.getSubscription(productId);
6711
- if (!isSubscriptionActive(currentStatus.subscriptionStatus)) {
6712
- logger.debug(`No active subscription to cancel: ${currentStatus.subscriptionStatus}`);
6713
- return {
6714
- type: "no_active_subscription",
6715
- status: currentStatus.subscriptionStatus
6716
- };
6717
- }
6718
- logger.debug(`Canceling subscription for ${productId}...`);
6719
- await billingApi.cancelSubscription(productId);
6720
- logger.debug(`Subscription canceled successfully`);
6721
- return {
6722
- type: "canceled"
6723
- };
6724
- }
6725
- };
6726
- }
6727
-
6728
7029
  // src/client/common/auth/keyring.ts
6729
7030
  var import_keyring = require("@napi-rs/keyring");
6730
7031
  var import_accounts6 = require("viem/accounts");
@@ -6964,6 +7265,101 @@ function generateNewPrivateKey() {
6964
7265
  };
6965
7266
  }
6966
7267
 
7268
+ // src/client/modules/billing/index.ts
7269
+ function createBillingModule(config) {
7270
+ const { verbose = false, skipTelemetry = false } = config;
7271
+ const privateKey = addHexPrefix(config.privateKey);
7272
+ const address = getAddressFromPrivateKey(privateKey);
7273
+ const logger = getLogger(verbose);
7274
+ const billingEnvConfig = getBillingEnvironmentConfig(getBuildType());
7275
+ const billingApi = new BillingApiClient(billingEnvConfig, privateKey);
7276
+ return {
7277
+ address,
7278
+ async subscribe(opts) {
7279
+ return withSDKTelemetry(
7280
+ {
7281
+ functionName: "subscribe",
7282
+ skipTelemetry,
7283
+ // Skip if called from CLI
7284
+ properties: { productId: opts?.productId || "compute" }
7285
+ },
7286
+ async () => {
7287
+ const productId = opts?.productId || "compute";
7288
+ logger.debug(`Checking existing subscription for ${productId}...`);
7289
+ const currentStatus = await billingApi.getSubscription(productId);
7290
+ if (isSubscriptionActive(currentStatus.subscriptionStatus)) {
7291
+ logger.debug(`Subscription already active: ${currentStatus.subscriptionStatus}`);
7292
+ return {
7293
+ type: "already_active",
7294
+ status: currentStatus.subscriptionStatus
7295
+ };
7296
+ }
7297
+ if (currentStatus.subscriptionStatus === "past_due" || currentStatus.subscriptionStatus === "unpaid") {
7298
+ logger.debug(`Subscription has payment issue: ${currentStatus.subscriptionStatus}`);
7299
+ return {
7300
+ type: "payment_issue",
7301
+ status: currentStatus.subscriptionStatus,
7302
+ portalUrl: currentStatus.portalUrl
7303
+ };
7304
+ }
7305
+ logger.debug(`Creating subscription for ${productId}...`);
7306
+ const result = await billingApi.createSubscription(productId);
7307
+ logger.debug(`Checkout URL: ${result.checkoutUrl}`);
7308
+ return {
7309
+ type: "checkout_created",
7310
+ checkoutUrl: result.checkoutUrl
7311
+ };
7312
+ }
7313
+ );
7314
+ },
7315
+ async getStatus(opts) {
7316
+ return withSDKTelemetry(
7317
+ {
7318
+ functionName: "getStatus",
7319
+ skipTelemetry,
7320
+ // Skip if called from CLI
7321
+ properties: { productId: opts?.productId || "compute" }
7322
+ },
7323
+ async () => {
7324
+ const productId = opts?.productId || "compute";
7325
+ logger.debug(`Fetching subscription status for ${productId}...`);
7326
+ const result = await billingApi.getSubscription(productId);
7327
+ logger.debug(`Subscription status: ${result.subscriptionStatus}`);
7328
+ return result;
7329
+ }
7330
+ );
7331
+ },
7332
+ async cancel(opts) {
7333
+ return withSDKTelemetry(
7334
+ {
7335
+ functionName: "cancel",
7336
+ skipTelemetry,
7337
+ // Skip if called from CLI
7338
+ properties: { productId: opts?.productId || "compute" }
7339
+ },
7340
+ async () => {
7341
+ const productId = opts?.productId || "compute";
7342
+ logger.debug(`Checking subscription status for ${productId}...`);
7343
+ const currentStatus = await billingApi.getSubscription(productId);
7344
+ if (!isSubscriptionActive(currentStatus.subscriptionStatus)) {
7345
+ logger.debug(`No active subscription to cancel: ${currentStatus.subscriptionStatus}`);
7346
+ return {
7347
+ type: "no_active_subscription",
7348
+ status: currentStatus.subscriptionStatus
7349
+ };
7350
+ }
7351
+ logger.debug(`Canceling subscription for ${productId}...`);
7352
+ await billingApi.cancelSubscription(productId);
7353
+ logger.debug(`Subscription canceled successfully`);
7354
+ return {
7355
+ type: "canceled"
7356
+ };
7357
+ }
7358
+ );
7359
+ }
7360
+ };
7361
+ }
7362
+
6967
7363
  // src/client/common/utils/instance.ts
6968
7364
  async function getCurrentInstanceType(preflightCtx, appID, logger, clientId) {
6969
7365
  try {
@@ -7004,7 +7400,7 @@ function createECloudClient(cfg) {
7004
7400
  );
7005
7401
  }
7006
7402
  return {
7007
- app: createAppModule({
7403
+ compute: createComputeModule({
7008
7404
  rpcUrl,
7009
7405
  verbose: cfg.verbose,
7010
7406
  privateKey: cfg.privateKey,
@@ -7018,18 +7414,26 @@ function createECloudClient(cfg) {
7018
7414
  }
7019
7415
  // Annotate the CommonJS export names for ESM import in node:
7020
7416
  0 && (module.exports = {
7417
+ NoopClient,
7021
7418
  PRIMARY_LANGUAGES,
7419
+ PostHogClient,
7022
7420
  UserApiClient,
7421
+ addMetric,
7422
+ addMetricWithDimensions,
7023
7423
  assertValidFilePath,
7024
7424
  assertValidImageReference,
7025
7425
  assertValidPrivateKey,
7026
7426
  checkERC7702Delegation,
7027
7427
  createApp,
7028
- createAppModule,
7428
+ createAppEnvironment,
7029
7429
  createBillingModule,
7430
+ createComputeModule,
7030
7431
  createECloudClient,
7432
+ createMetricsContext,
7433
+ createTelemetryClient,
7031
7434
  deleteLegacyPrivateKey,
7032
7435
  deletePrivateKey,
7436
+ emitMetrics,
7033
7437
  encodeStartAppData,
7034
7438
  encodeStopAppData,
7035
7439
  encodeTerminateAppData,
@@ -7053,11 +7457,14 @@ function createECloudClient(cfg) {
7053
7457
  getEnvironmentConfig,
7054
7458
  getLegacyKeys,
7055
7459
  getLegacyPrivateKey,
7460
+ getPostHogAPIKey,
7461
+ getPostHogEndpoint,
7056
7462
  getPrivateKey,
7057
7463
  getPrivateKeyWithSource,
7058
7464
  getTemplate,
7059
7465
  isEnvironmentAvailable,
7060
7466
  isMainnet,
7467
+ isNoopClient,
7061
7468
  isSubscriptionActive,
7062
7469
  keyExists,
7063
7470
  listStoredKeys,
@@ -7087,6 +7494,7 @@ function createECloudClient(cfg) {
7087
7494
  validateUpgradeParams,
7088
7495
  validateXURL,
7089
7496
  watchDeployment,
7090
- watchUpgrade
7497
+ watchUpgrade,
7498
+ withSDKTelemetry
7091
7499
  });
7092
7500
  //# sourceMappingURL=index.cjs.map