@layr-labs/ecloud-sdk 0.2.0-dev → 0.2.0-dev.1

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.js CHANGED
@@ -1,6 +1,19 @@
1
1
  import {
2
- createBillingModule
3
- } from "./chunk-LINGJMAS.js";
2
+ createBillingModule,
3
+ deleteLegacyPrivateKey,
4
+ deletePrivateKey,
5
+ generateNewPrivateKey,
6
+ getAddressFromPrivateKey,
7
+ getLegacyKeys,
8
+ getLegacyPrivateKey,
9
+ getPrivateKey,
10
+ getPrivateKeyWithSource,
11
+ keyExists,
12
+ listStoredKeys,
13
+ requirePrivateKey,
14
+ storePrivateKey,
15
+ validatePrivateKey
16
+ } from "./chunk-GB4GM4C2.js";
4
17
  import {
5
18
  PRIMARY_LANGUAGES,
6
19
  assertValidFilePath,
@@ -51,7 +64,7 @@ import {
51
64
  validateXURL,
52
65
  watchDeployment,
53
66
  watchUpgrade
54
- } from "./chunk-HLH3AMQF.js";
67
+ } from "./chunk-O7EU5JL7.js";
55
68
  import {
56
69
  NoopClient,
57
70
  PostHogClient,
@@ -76,7 +89,7 @@ import {
76
89
  isSubscriptionActive,
77
90
  stripHexPrefix,
78
91
  withSDKTelemetry
79
- } from "./chunk-34DXGQ35.js";
92
+ } from "./chunk-FY7UU55U.js";
80
93
 
81
94
  // src/client/common/utils/buildapi.ts
82
95
  import axios from "axios";
@@ -432,245 +445,6 @@ function transformVerifyResult(raw) {
432
445
  };
433
446
  }
434
447
 
435
- // src/client/common/auth/keyring.ts
436
- import { AsyncEntry, findCredentials } from "@napi-rs/keyring";
437
- import { privateKeyToAddress } from "viem/accounts";
438
- var SERVICE_NAME = "ecloud";
439
- var ACCOUNT_NAME = "key";
440
- var EIGENX_SERVICE_NAME = "eigenx-cli";
441
- var EIGENX_DEV_SERVICE_NAME = "eigenx-cli-dev";
442
- var EIGENX_ACCOUNT_PREFIX = "eigenx-";
443
- var GO_KEYRING_BASE64_PREFIX = "go-keyring-base64:";
444
- var GO_KEYRING_ENCODED_PREFIX = "go-keyring-encoded:";
445
- async function storePrivateKey(privateKey) {
446
- const normalizedKey = normalizePrivateKey(privateKey);
447
- const isValid = validatePrivateKey(normalizedKey);
448
- if (!isValid) {
449
- throw new Error("Invalid private key format");
450
- }
451
- const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);
452
- try {
453
- await entry.setPassword(normalizedKey);
454
- } catch (err) {
455
- throw new Error(
456
- `Failed to store key in OS keyring: ${err?.message ?? err}. Ensure keyring service is available.`
457
- );
458
- }
459
- }
460
- async function getPrivateKey() {
461
- const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);
462
- try {
463
- const key = await entry.getPassword();
464
- if (key && validatePrivateKey(key)) {
465
- return key;
466
- }
467
- } catch {
468
- }
469
- return null;
470
- }
471
- async function deletePrivateKey() {
472
- const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);
473
- try {
474
- await entry.deletePassword();
475
- return true;
476
- } catch {
477
- console.warn("No key found in keyring");
478
- return false;
479
- }
480
- }
481
- async function listStoredKeys() {
482
- const keys = [];
483
- const creds = findCredentials(SERVICE_NAME);
484
- for (const cred of creds) {
485
- if (cred.account === ACCOUNT_NAME) {
486
- try {
487
- const address = getAddressFromPrivateKey(cred.password);
488
- keys.push({ address });
489
- } catch (err) {
490
- console.warn(`Warning: Invalid key found, skipping: ${err}`);
491
- }
492
- }
493
- }
494
- return keys;
495
- }
496
- async function keyExists() {
497
- const key = await getPrivateKey();
498
- return key !== null;
499
- }
500
- async function getLegacyKeys() {
501
- const keys = [];
502
- try {
503
- const eigenxCreds = findCredentials(EIGENX_SERVICE_NAME);
504
- for (const cred of eigenxCreds) {
505
- const accountName = cred.account;
506
- if (!accountName.startsWith(EIGENX_ACCOUNT_PREFIX)) {
507
- continue;
508
- }
509
- const environment = accountName.substring(EIGENX_ACCOUNT_PREFIX.length);
510
- try {
511
- const decodedKey = decodeGoKeyringValue(cred.password);
512
- const address = getAddressFromPrivateKey(decodedKey);
513
- keys.push({ environment, address, source: "eigenx" });
514
- } catch (err) {
515
- console.warn(
516
- `Warning: Invalid key found for ${environment} (eigenx-cli), skipping: ${err}`
517
- );
518
- }
519
- }
520
- } catch {
521
- }
522
- try {
523
- const eigenxDevCreds = findCredentials(EIGENX_DEV_SERVICE_NAME);
524
- for (const cred of eigenxDevCreds) {
525
- const accountName = cred.account;
526
- if (!accountName.startsWith(EIGENX_ACCOUNT_PREFIX)) {
527
- continue;
528
- }
529
- const environment = accountName.substring(EIGENX_ACCOUNT_PREFIX.length);
530
- try {
531
- const decodedKey = decodeGoKeyringValue(cred.password);
532
- const address = getAddressFromPrivateKey(decodedKey);
533
- keys.push({ environment, address, source: "eigenx-dev" });
534
- } catch (err) {
535
- console.warn(
536
- `Warning: Invalid key found for ${environment} (eigenx-dev), skipping: ${err}`
537
- );
538
- }
539
- }
540
- } catch {
541
- }
542
- return keys;
543
- }
544
- async function getLegacyPrivateKey(environment, source) {
545
- const serviceName = source === "eigenx" ? EIGENX_SERVICE_NAME : EIGENX_DEV_SERVICE_NAME;
546
- const accountName = EIGENX_ACCOUNT_PREFIX + environment;
547
- const entry = new AsyncEntry(serviceName, accountName);
548
- try {
549
- const rawKey = await entry.getPassword();
550
- if (rawKey) {
551
- const decodedKey = decodeGoKeyringValue(rawKey);
552
- if (validatePrivateKey(decodedKey)) {
553
- return decodedKey;
554
- }
555
- }
556
- } catch {
557
- }
558
- return null;
559
- }
560
- async function deleteLegacyPrivateKey(environment, source) {
561
- const serviceName = source === "eigenx" ? EIGENX_SERVICE_NAME : EIGENX_DEV_SERVICE_NAME;
562
- const accountName = EIGENX_ACCOUNT_PREFIX + environment;
563
- const entry = new AsyncEntry(serviceName, accountName);
564
- try {
565
- await entry.deletePassword();
566
- return true;
567
- } catch {
568
- console.warn(`No key found for ${environment} in ${source}`);
569
- return false;
570
- }
571
- }
572
- function validatePrivateKey(privateKey) {
573
- try {
574
- getAddressFromPrivateKey(privateKey);
575
- return true;
576
- } catch {
577
- return false;
578
- }
579
- }
580
- function getAddressFromPrivateKey(privateKey) {
581
- const normalized = normalizePrivateKey(privateKey);
582
- return privateKeyToAddress(normalized);
583
- }
584
- function decodeGoKeyringValue(rawValue) {
585
- if (rawValue.startsWith(GO_KEYRING_BASE64_PREFIX)) {
586
- const encoded = rawValue.substring(GO_KEYRING_BASE64_PREFIX.length);
587
- try {
588
- const decoded = Buffer.from(encoded, "base64").toString("utf8");
589
- return decoded;
590
- } catch (err) {
591
- console.warn(`Warning: Failed to decode go-keyring base64 value: ${err}`);
592
- return rawValue;
593
- }
594
- }
595
- if (rawValue.startsWith(GO_KEYRING_ENCODED_PREFIX)) {
596
- const encoded = rawValue.substring(GO_KEYRING_ENCODED_PREFIX.length);
597
- try {
598
- const decoded = Buffer.from(encoded, "hex").toString("utf8");
599
- return decoded;
600
- } catch (err) {
601
- console.warn(`Warning: Failed to decode go-keyring hex value: ${err}`);
602
- return rawValue;
603
- }
604
- }
605
- return rawValue;
606
- }
607
- function normalizePrivateKey(privateKey) {
608
- if (!privateKey.startsWith("0x")) {
609
- return `0x${privateKey}`;
610
- }
611
- return privateKey;
612
- }
613
-
614
- // src/client/common/auth/resolver.ts
615
- async function getPrivateKeyWithSource(options) {
616
- if (options.privateKey) {
617
- if (!validatePrivateKey(options.privateKey)) {
618
- throw new Error(
619
- "Invalid private key format provided via command flag. Please check and try again."
620
- );
621
- }
622
- return {
623
- key: options.privateKey,
624
- source: "command flag"
625
- };
626
- }
627
- const envKey = process.env.ECLOUD_PRIVATE_KEY;
628
- if (envKey) {
629
- if (!validatePrivateKey(envKey)) {
630
- throw new Error(
631
- "Invalid private key format provided via environment variable. Please check and try again."
632
- );
633
- }
634
- return {
635
- key: envKey,
636
- source: "environment variable (ECLOUD_PRIVATE_KEY)"
637
- };
638
- }
639
- const keyringKey = await getPrivateKey();
640
- if (keyringKey) {
641
- return {
642
- key: keyringKey,
643
- source: "stored credentials"
644
- };
645
- }
646
- return null;
647
- }
648
- async function requirePrivateKey(options) {
649
- const result = await getPrivateKeyWithSource({
650
- privateKey: options.privateKey
651
- });
652
- if (!result) {
653
- throw new Error(
654
- `Private key required. Please provide it via:
655
- \u2022 Keyring: ecloud auth login
656
- \u2022 Flag: --private-key YOUR_KEY
657
- \u2022 Environment: export ECLOUD_PRIVATE_KEY=YOUR_KEY`
658
- );
659
- }
660
- return result;
661
- }
662
-
663
- // src/client/common/auth/generate.ts
664
- import { generatePrivateKey, privateKeyToAddress as privateKeyToAddress2 } from "viem/accounts";
665
- function generateNewPrivateKey() {
666
- const privateKey = generatePrivateKey();
667
- const address = privateKeyToAddress2(privateKey);
668
- return {
669
- privateKey,
670
- address
671
- };
672
- }
673
-
674
448
  // src/client/common/utils/instance.ts
675
449
  async function getCurrentInstanceType(preflightCtx, appID, logger, clientId) {
676
450
  try {
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/client/common/utils/buildapi.ts","../src/client/modules/build/types.ts","../src/client/modules/build/errors.ts","../src/client/modules/build/index.ts","../src/client/common/auth/keyring.ts","../src/client/common/auth/resolver.ts","../src/client/common/auth/generate.ts","../src/client/common/utils/instance.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Build API Client to manage verifiable builds and provenance\n *\n * This is a standalone HTTP client that talks to the (compute) UserAPI host.\n */\n\nimport axios, { AxiosResponse } from \"axios\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport type { Hex } from \"viem\";\nimport { calculateBillingAuthSignature } from \"./auth\";\n\nexport class BuildApiClient {\n private readonly baseUrl: string;\n private readonly account?: ReturnType<typeof privateKeyToAccount>;\n private readonly clientId?: string;\n\n constructor(options: { baseUrl: string; privateKey?: Hex | string; clientId?: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/+$/, \"\");\n this.clientId = options.clientId;\n\n if (options.privateKey) {\n this.account = privateKeyToAccount(options.privateKey as Hex);\n }\n }\n\n async submitBuild(payload: {\n repo_url: string;\n git_ref: string;\n dockerfile_path: string;\n caddyfile_path?: string;\n build_context_path: string;\n dependencies: string[];\n }): Promise<{ build_id: string }> {\n return this.authenticatedJsonRequest<{ build_id: string }>(\"/builds\", \"POST\", payload);\n }\n\n async getBuild(buildId: string): Promise<any> {\n return this.publicJsonRequest(`/builds/${encodeURIComponent(buildId)}`);\n }\n\n async getBuildByDigest(digest: string): Promise<any> {\n return this.publicJsonRequest(`/builds/image/${encodeURIComponent(digest)}`);\n }\n\n async verify(identifier: string): Promise<any> {\n return this.publicJsonRequest(`/builds/verify/${encodeURIComponent(identifier)}`);\n }\n\n async getLogs(buildId: string): Promise<string> {\n return this.authenticatedTextRequest(`/builds/${encodeURIComponent(buildId)}/logs`);\n }\n\n async listBuilds(params: {\n billing_address: string;\n limit?: number;\n offset?: number;\n }): Promise<any[]> {\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}/builds`,\n method: \"GET\",\n params,\n headers: this.clientId ? { \"x-client-id\": this.clientId } : undefined,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data as any[];\n }\n\n private async publicJsonRequest(path: string): Promise<any> {\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method: \"GET\",\n headers: this.clientId ? { \"x-client-id\": this.clientId } : undefined,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data;\n }\n\n private async authenticatedJsonRequest<T>(\n path: string,\n method: \"POST\" | \"GET\",\n body?: unknown,\n ): Promise<T> {\n if (!this.account) throw new Error(\"Private key required for authenticated requests\");\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n if (this.clientId) headers[\"x-client-id\"] = this.clientId;\n\n // Builds API uses BillingAuth signature format (same as Billing API).\n // Keep expiry short to reduce replay window.\n const expiry = BigInt(Math.floor(Date.now() / 1000) + 60);\n const { signature } = await calculateBillingAuthSignature({\n account: this.account,\n product: \"compute\",\n expiry,\n });\n headers.Authorization = `Bearer ${signature}`;\n headers[\"X-eigenx-expiry\"] = expiry.toString();\n headers[\"X-Account\"] = this.account.address;\n\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method,\n headers,\n data: body,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data as T;\n }\n\n private async authenticatedTextRequest(path: string): Promise<string> {\n if (!this.account) throw new Error(\"Private key required for authenticated requests\");\n\n const headers: Record<string, string> = {};\n if (this.clientId) headers[\"x-client-id\"] = this.clientId;\n\n const expiry = BigInt(Math.floor(Date.now() / 1000) + 60);\n const { signature } = await calculateBillingAuthSignature({\n account: this.account,\n product: \"compute\",\n expiry,\n });\n headers.Authorization = `Bearer ${signature}`;\n headers[\"X-eigenx-expiry\"] = expiry.toString();\n headers[\"X-Account\"] = this.account.address;\n\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method: \"GET\",\n headers,\n timeout: 60_000,\n responseType: \"text\",\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return typeof res.data === \"string\" ? res.data : JSON.stringify(res.data);\n }\n}\n\nfunction buildApiHttpError(res: AxiosResponse): Error {\n const status = res.status;\n const body = typeof res.data === \"string\" ? res.data : res.data ? JSON.stringify(res.data) : \"\";\n const url = res.config?.url ? ` ${res.config.url}` : \"\";\n return new Error(`BuildAPI request failed: ${status}${url} - ${body || \"Unknown error\"}`);\n}\n","// ============ Request/Response Types ============\n\nexport interface SubmitBuildRequest {\n repoUrl: string;\n gitRef: string;\n dockerfilePath?: string;\n /**\n * Path to a Caddyfile within the repository (relative to buildContextPath).\n * If omitted, the build service will not copy a Caddyfile into the image.\n */\n caddyfilePath?: string;\n buildContextPath?: string;\n dependencies?: string[];\n}\n\nexport interface SubmitBuildResponse {\n buildId: string;\n}\n\nexport const BUILD_STATUS = {\n BUILDING: \"building\",\n SUCCESS: \"success\",\n FAILED: \"failed\",\n} as const;\n\nexport type BuildStatus = (typeof BUILD_STATUS)[keyof typeof BUILD_STATUS];\n\nexport interface Build {\n buildId: string;\n billingAddress: string;\n repoUrl: string;\n gitRef: string;\n status: BuildStatus;\n /** 'application' | 'dependency' (as returned by the API) */\n buildType: string;\n imageName: string;\n imageUrl?: string;\n imageDigest?: string;\n provenanceJson?: Record<string, unknown>;\n provenanceSignature?: string;\n errorMessage?: string;\n createdAt: string;\n updatedAt: string;\n dependencies?: Record<string, Build>;\n}\n\n// ============ Verification Types ============\n\nexport type VerifyProvenanceResult = VerifyProvenanceSuccess | VerifyProvenanceFailure;\n\nexport interface VerifyProvenanceSuccess {\n status: \"verified\";\n buildId: string;\n imageUrl: string;\n imageDigest: string;\n repoUrl: string;\n gitRef: string;\n provenanceJson: Record<string, unknown>;\n provenanceSignature: string;\n payloadType: string;\n payload: string;\n}\n\nexport interface VerifyProvenanceFailure {\n status: \"failed\";\n error: string;\n buildId?: string;\n}\n\n// ============ Log Streaming ============\n\nexport interface LogChunk {\n content: string;\n totalLength: number;\n isComplete: boolean;\n finalStatus?: BuildStatus;\n}\n\nexport interface BuildProgress {\n build: Build;\n logs: string;\n}\n","export class BuildError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"BuildError\";\n }\n}\n\nexport class AuthRequiredError extends BuildError {\n constructor(message = \"Authentication required\") {\n super(message);\n this.name = \"AuthRequiredError\";\n }\n}\n\nexport class BuildFailedError extends BuildError {\n constructor(\n message: string,\n public readonly buildId: string,\n ) {\n super(message);\n this.name = \"BuildFailedError\";\n }\n}\n\nexport class ConflictError extends BuildError {\n constructor(message = \"Build already in progress\") {\n super(message);\n this.name = \"ConflictError\";\n }\n}\n\nexport class NotFoundError extends BuildError {\n constructor(message = \"Build not found\") {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\nexport class ForbiddenError extends BuildError {\n constructor(message = \"Permission denied\") {\n super(message);\n this.name = \"ForbiddenError\";\n }\n}\n\nexport class TimeoutError extends BuildError {\n constructor(message = \"Operation timed out\") {\n super(message);\n this.name = \"TimeoutError\";\n }\n}\n\nexport class BadRequestError extends BuildError {\n constructor(message = \"Bad request\") {\n super(message);\n this.name = \"BadRequestError\";\n }\n}\n\n","/**\n * Build module entry point (verifiable builds + provenance)\n */\n\nimport { getEnvironmentConfig } from \"../../common/config/environment\";\nimport { withSDKTelemetry } from \"../../common/telemetry/wrapper\";\nimport { getLogger, addHexPrefix } from \"../../common/utils\";\nimport { BuildApiClient } from \"../../common/utils/buildapi\";\n\nimport { BUILD_STATUS } from \"./types\";\nimport type {\n Build,\n BuildProgress,\n BuildStatus,\n LogChunk,\n SubmitBuildRequest,\n SubmitBuildResponse,\n VerifyProvenanceResult,\n} from \"./types\";\nimport { AuthRequiredError, BuildFailedError, TimeoutError } from \"./errors\";\n\nexport interface BuildModuleConfig {\n privateKey?: string;\n environment?: string;\n verbose?: boolean;\n clientId?: string;\n skipTelemetry?: boolean;\n}\n\nexport interface BuildModule {\n submit(request: SubmitBuildRequest): Promise<SubmitBuildResponse>;\n getLogs(buildId: string): Promise<string>;\n\n list(options: { billingAddress: string; limit?: number; offset?: number }): Promise<Build[]>;\n get(buildId: string): Promise<Build>;\n getByDigest(digest: string): Promise<Build>;\n verify(identifier: string): Promise<VerifyProvenanceResult>;\n\n submitAndWait(\n request: SubmitBuildRequest,\n options?: {\n onLog?: (chunk: string) => void;\n onProgress?: (progress: BuildProgress) => void;\n pollIntervalMs?: number;\n timeoutMs?: number;\n },\n ): Promise<Build>;\n\n waitForBuild(\n buildId: string,\n options?: {\n onLog?: (chunk: string) => void;\n onProgress?: (progress: BuildProgress) => void;\n pollIntervalMs?: number;\n timeoutMs?: number;\n },\n ): Promise<Build>;\n\n streamLogs(buildId: string, pollIntervalMs?: number): AsyncGenerator<LogChunk, void, unknown>;\n}\n\nconst DEFAULT_POLL_INTERVAL = 2000;\nconst DEFAULT_TIMEOUT = 30 * 60 * 1000;\n\nexport function createBuildModule(config: BuildModuleConfig): BuildModule {\n const { verbose = false, skipTelemetry = false } = config;\n const logger = getLogger(verbose);\n\n const environment = config.environment || \"sepolia\";\n const environmentConfig = getEnvironmentConfig(environment);\n\n // NOTE: build endpoints are served from the compute UserAPI host\n const api = new BuildApiClient({\n baseUrl: environmentConfig.userApiServerURL,\n privateKey: config.privateKey ? addHexPrefix(config.privateKey) : undefined,\n clientId: config.clientId,\n });\n\n return {\n async submit(request: SubmitBuildRequest): Promise<SubmitBuildResponse> {\n return withSDKTelemetry(\n {\n functionName: \"build.submit\",\n skipTelemetry,\n properties: { environment, repoUrl: request.repoUrl },\n },\n async () => {\n if (!config.privateKey) throw new AuthRequiredError(\"Private key required for submit()\");\n\n const data = await api.submitBuild({\n repo_url: request.repoUrl,\n git_ref: request.gitRef,\n dockerfile_path: request.dockerfilePath ?? \"Dockerfile\",\n caddyfile_path: request.caddyfilePath,\n build_context_path: request.buildContextPath ?? \".\",\n dependencies: request.dependencies ?? [],\n });\n\n logger.debug(`Submitted build: ${data.build_id}`);\n return { buildId: data.build_id };\n },\n );\n },\n\n async list(options): Promise<Build[]> {\n const { billingAddress, limit, offset } = options;\n return withSDKTelemetry(\n {\n functionName: \"build.list\",\n skipTelemetry,\n properties: {\n environment,\n billingAddress,\n ...(limit !== undefined ? { limit: String(limit) } : {}),\n ...(offset !== undefined ? { offset: String(offset) } : {}),\n },\n },\n async () => {\n const data = await api.listBuilds({\n billing_address: billingAddress,\n limit,\n offset,\n });\n return Array.isArray(data) ? data.map(transformBuild) : [];\n },\n );\n },\n\n async get(buildId: string): Promise<Build> {\n return withSDKTelemetry(\n { functionName: \"build.get\", skipTelemetry, properties: { environment, buildId } },\n async () => transformBuild(await api.getBuild(buildId)),\n );\n },\n\n async getByDigest(digest: string): Promise<Build> {\n return withSDKTelemetry(\n { functionName: \"build.getByDigest\", skipTelemetry, properties: { environment, digest } },\n async () => transformBuild(await api.getBuildByDigest(digest)),\n );\n },\n\n async verify(identifier: string): Promise<VerifyProvenanceResult> {\n return withSDKTelemetry(\n { functionName: \"build.verify\", skipTelemetry, properties: { environment, identifier } },\n async () => transformVerifyResult(await api.verify(identifier)),\n );\n },\n\n async getLogs(buildId: string): Promise<string> {\n return withSDKTelemetry(\n { functionName: \"build.getLogs\", skipTelemetry, properties: { environment, buildId } },\n async () => {\n if (!config.privateKey) throw new AuthRequiredError(\"Private key required for getLogs()\");\n return api.getLogs(buildId);\n },\n );\n },\n\n async submitAndWait(request, options = {}) {\n const { buildId } = await this.submit(request);\n return this.waitForBuild(buildId, options);\n },\n\n async waitForBuild(buildId, options = {}) {\n const {\n onLog,\n onProgress,\n pollIntervalMs = DEFAULT_POLL_INTERVAL,\n timeoutMs = DEFAULT_TIMEOUT,\n } = options;\n\n const startTime = Date.now();\n let lastLogLength = 0;\n\n while (true) {\n if (Date.now() - startTime > timeoutMs) {\n throw new TimeoutError(`Build timed out after ${timeoutMs}ms`);\n }\n\n const build = await this.get(buildId);\n let logs = \"\";\n\n try {\n logs = await this.getLogs(buildId);\n if (onLog && logs.length > lastLogLength) {\n onLog(logs.slice(lastLogLength));\n lastLogLength = logs.length;\n }\n } catch {\n // ignore\n }\n\n onProgress?.({ build, logs });\n\n if (build.status === BUILD_STATUS.SUCCESS) return build;\n if (build.status === BUILD_STATUS.FAILED) {\n throw new BuildFailedError(build.errorMessage ?? \"Build failed\", buildId);\n }\n\n await sleep(pollIntervalMs);\n }\n },\n\n async *streamLogs(buildId, pollIntervalMs = DEFAULT_POLL_INTERVAL) {\n let lastLength = 0;\n while (true) {\n const build = await this.get(buildId);\n let logs = \"\";\n\n try {\n logs = await this.getLogs(buildId);\n } catch {\n // ignore\n }\n\n if (logs.length > lastLength) {\n yield {\n content: logs.slice(lastLength),\n totalLength: logs.length,\n isComplete: build.status !== BUILD_STATUS.BUILDING,\n finalStatus: build.status !== BUILD_STATUS.BUILDING ? build.status : undefined,\n };\n lastLength = logs.length;\n }\n\n if (build.status !== BUILD_STATUS.BUILDING) break;\n await sleep(pollIntervalMs);\n }\n },\n };\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction transformBuild(raw: any): Build {\n return {\n buildId: raw.build_id,\n billingAddress: raw.billing_address,\n repoUrl: raw.repo_url,\n gitRef: raw.git_ref,\n status: raw.status as BuildStatus,\n buildType: raw.build_type,\n imageName: raw.image_name,\n imageUrl: raw.image_url,\n imageDigest: raw.image_digest,\n provenanceJson: raw.provenance_json ?? undefined,\n provenanceSignature: raw.provenance_signature ?? undefined,\n errorMessage: raw.error_message ?? undefined,\n createdAt: raw.created_at,\n updatedAt: raw.updated_at,\n dependencies: raw.dependencies\n ? Object.fromEntries(Object.entries(raw.dependencies).map(([k, v]) => [k, transformBuild(v)]))\n : undefined,\n };\n}\n\nfunction transformVerifyResult(raw: any): VerifyProvenanceResult {\n if (raw.status === \"verified\") {\n return {\n status: \"verified\",\n buildId: raw.build_id,\n imageUrl: raw.image_url,\n imageDigest: raw.image_digest,\n repoUrl: raw.repo_url,\n gitRef: raw.git_ref,\n provenanceJson: raw.provenance_json,\n provenanceSignature: raw.provenance_signature,\n payloadType: raw.payload_type,\n payload: raw.payload,\n };\n }\n\n return {\n status: \"failed\",\n error: raw.error,\n buildId: raw.build_id,\n };\n}\n\n// Re-export errors/types for convenience\nexport * from \"./types\";\nexport * from \"./errors\";\n","/**\n * OS Keyring Integration\n *\n * Provides secure storage for private keys using native OS keychains:\n * - macOS: Keychain\n * - Linux: Secret Service API (libsecret/gnome-keyring)\n * - Windows: Credential Manager\n *\n * Uses a single key for all environments.\n */\n\nimport { AsyncEntry, findCredentials } from \"@napi-rs/keyring\";\nimport { privateKeyToAddress } from \"viem/accounts\";\n\n// ecloud keyring identifiers\nconst SERVICE_NAME = \"ecloud\";\nconst ACCOUNT_NAME = \"key\"; // Single key for all environments\n\n// eigenx-cli keyring identifiers (for legacy key detection)\nconst EIGENX_SERVICE_NAME = \"eigenx-cli\";\nconst EIGENX_DEV_SERVICE_NAME = \"eigenx-cli-dev\";\nconst EIGENX_ACCOUNT_PREFIX = \"eigenx-\"; // eigenx-cli prefixes account names\n\n// go-keyring encoding constants (used by eigenx-cli on macOS)\nconst GO_KEYRING_BASE64_PREFIX = \"go-keyring-base64:\";\nconst GO_KEYRING_ENCODED_PREFIX = \"go-keyring-encoded:\"; // legacy hex encoding\n\nexport interface StoredKey {\n address: string;\n}\n\nexport interface LegacyKey {\n environment: string;\n address: string;\n source: \"eigenx\" | \"eigenx-dev\";\n}\n\n/**\n * Store a private key in OS keyring\n *\n * Note: Stores a single key for all environments.\n * The environment parameter is kept for API compatibility but is ignored.\n */\nexport async function storePrivateKey(privateKey: string): Promise<void> {\n // Validate private key format\n const normalizedKey = normalizePrivateKey(privateKey);\n\n // Validate by deriving address (will throw if invalid)\n const isValid = validatePrivateKey(normalizedKey);\n if (!isValid) {\n throw new Error(\"Invalid private key format\");\n }\n\n // Store in single-key format\n const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);\n try {\n await entry.setPassword(normalizedKey);\n } catch (err: any) {\n throw new Error(\n `Failed to store key in OS keyring: ${err?.message ?? err}. Ensure keyring service is available.`,\n );\n }\n}\n\n/**\n * Get a private key from OS keyring\n *\n * Note: Returns the single stored key for all environments.\n * The environment parameter is kept for API compatibility but is ignored.\n */\nexport async function getPrivateKey(): Promise<`0x${string}` | null> {\n const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);\n try {\n const key = await entry.getPassword();\n if (key && validatePrivateKey(key)) {\n return key as `0x${string}`;\n }\n } catch {\n // Key not found\n }\n\n return null;\n}\n\n/**\n * Delete a private key from OS keyring\n * Returns true if deletion was successful, false otherwise\n *\n * Note: Deletes the single stored key.\n * The environment parameter is kept for API compatibility but is ignored.\n */\nexport async function deletePrivateKey(): Promise<boolean> {\n const entry = new AsyncEntry(SERVICE_NAME, ACCOUNT_NAME);\n try {\n await entry.deletePassword();\n return true;\n } catch {\n console.warn(\"No key found in keyring\");\n return false;\n }\n}\n\n/**\n * List all stored keys\n * Returns an array with the single stored key (if it exists)\n */\nexport async function listStoredKeys(): Promise<StoredKey[]> {\n const keys: StoredKey[] = [];\n\n const creds = findCredentials(SERVICE_NAME);\n for (const cred of creds) {\n if (cred.account === ACCOUNT_NAME) {\n try {\n const address = getAddressFromPrivateKey(cred.password as `0x${string}`);\n keys.push({ address });\n } catch (err) {\n console.warn(`Warning: Invalid key found, skipping: ${err}`);\n }\n }\n }\n\n return keys;\n}\n\n/**\n * Check if a key exists\n *\n * Note: Checks for the single stored key.\n * The environment parameter is kept for API compatibility but is ignored.\n */\nexport async function keyExists(): Promise<boolean> {\n const key = await getPrivateKey();\n return key !== null;\n}\n\n/**\n * Get legacy keys from eigenx-cli\n * Returns an array of keys found in eigenx-cli keyring formats\n */\nexport async function getLegacyKeys(): Promise<LegacyKey[]> {\n const keys: LegacyKey[] = [];\n\n // 1. Check eigenx-cli production keys\n try {\n const eigenxCreds = findCredentials(EIGENX_SERVICE_NAME);\n for (const cred of eigenxCreds) {\n // eigenx-cli stores keys with account name \"eigenx-<environment>\"\n // Strip the prefix to get the environment name\n const accountName = cred.account;\n if (!accountName.startsWith(EIGENX_ACCOUNT_PREFIX)) {\n continue; // Skip if it doesn't have the expected prefix\n }\n const environment = accountName.substring(EIGENX_ACCOUNT_PREFIX.length);\n\n try {\n // Decode go-keyring encoding (used on macOS)\n const decodedKey = decodeGoKeyringValue(cred.password);\n const address = getAddressFromPrivateKey(decodedKey as `0x${string}`);\n keys.push({ environment, address, source: \"eigenx\" });\n } catch (err) {\n console.warn(\n `Warning: Invalid key found for ${environment} (eigenx-cli), skipping: ${err}`,\n );\n }\n }\n } catch {\n // eigenx-cli service not found, that's ok\n }\n\n // 2. Check eigenx-cli dev keys\n try {\n const eigenxDevCreds = findCredentials(EIGENX_DEV_SERVICE_NAME);\n for (const cred of eigenxDevCreds) {\n // eigenx-cli stores keys with account name \"eigenx-<environment>\"\n // Strip the prefix to get the environment name\n const accountName = cred.account;\n if (!accountName.startsWith(EIGENX_ACCOUNT_PREFIX)) {\n continue; // Skip if it doesn't have the expected prefix\n }\n const environment = accountName.substring(EIGENX_ACCOUNT_PREFIX.length);\n\n try {\n // Decode go-keyring encoding (used on macOS)\n const decodedKey = decodeGoKeyringValue(cred.password);\n const address = getAddressFromPrivateKey(decodedKey as `0x${string}`);\n keys.push({ environment, address, source: \"eigenx-dev\" });\n } catch (err) {\n console.warn(\n `Warning: Invalid key found for ${environment} (eigenx-dev), skipping: ${err}`,\n );\n }\n }\n } catch {\n // eigenx-dev service not found, that's ok\n }\n\n return keys;\n}\n\n/**\n * Get a specific legacy private key from eigenx-cli keyring\n */\nexport async function getLegacyPrivateKey(\n environment: string,\n source: \"eigenx\" | \"eigenx-dev\",\n): Promise<string | null> {\n const serviceName = source === \"eigenx\" ? EIGENX_SERVICE_NAME : EIGENX_DEV_SERVICE_NAME;\n\n // eigenx-cli stores keys with account name \"eigenx-<environment>\"\n const accountName = EIGENX_ACCOUNT_PREFIX + environment;\n\n const entry = new AsyncEntry(serviceName, accountName);\n try {\n const rawKey = await entry.getPassword();\n if (rawKey) {\n // Decode go-keyring encoding (used on macOS)\n const decodedKey = decodeGoKeyringValue(rawKey);\n if (validatePrivateKey(decodedKey)) {\n return decodedKey;\n }\n }\n } catch {\n // Key not found\n }\n\n return null;\n}\n\n/**\n * Delete a specific legacy private key from eigenx-cli keyring\n * Returns true if deletion was successful, false otherwise\n */\nexport async function deleteLegacyPrivateKey(\n environment: string,\n source: \"eigenx\" | \"eigenx-dev\",\n): Promise<boolean> {\n const serviceName = source === \"eigenx\" ? EIGENX_SERVICE_NAME : EIGENX_DEV_SERVICE_NAME;\n\n // eigenx-cli stores keys with account name \"eigenx-<environment>\"\n const accountName = EIGENX_ACCOUNT_PREFIX + environment;\n\n const entry = new AsyncEntry(serviceName, accountName);\n try {\n await entry.deletePassword();\n return true;\n } catch {\n console.warn(`No key found for ${environment} in ${source}`);\n return false;\n }\n}\n\n/**\n * Validate private key format\n */\nexport function validatePrivateKey(privateKey: string): boolean {\n try {\n getAddressFromPrivateKey(privateKey);\n return true;\n } catch {\n return false;\n }\n}\n\n/**\n * Get address from private key\n */\nexport function getAddressFromPrivateKey(privateKey: string): string {\n const normalized = normalizePrivateKey(privateKey);\n return privateKeyToAddress(normalized);\n}\n\n/**\n * Decode go-keyring encoded values\n *\n * go-keyring (used by eigenx-cli) stores values with special encoding on macOS:\n * - \"go-keyring-base64:\" prefix + base64-encoded value\n * - \"go-keyring-encoded:\" prefix + hex-encoded value (legacy)\n *\n * This function detects and decodes these formats.\n */\nfunction decodeGoKeyringValue(rawValue: string): string {\n // Check for base64 encoding (primary format)\n if (rawValue.startsWith(GO_KEYRING_BASE64_PREFIX)) {\n const encoded = rawValue.substring(GO_KEYRING_BASE64_PREFIX.length);\n try {\n // Decode base64\n const decoded = Buffer.from(encoded, \"base64\").toString(\"utf8\");\n return decoded;\n } catch (err) {\n console.warn(`Warning: Failed to decode go-keyring base64 value: ${err}`);\n return rawValue; // Return as-is if decoding fails\n }\n }\n\n // Check for hex encoding (legacy format)\n if (rawValue.startsWith(GO_KEYRING_ENCODED_PREFIX)) {\n const encoded = rawValue.substring(GO_KEYRING_ENCODED_PREFIX.length);\n try {\n // Decode hex\n const decoded = Buffer.from(encoded, \"hex\").toString(\"utf8\");\n return decoded;\n } catch (err) {\n console.warn(`Warning: Failed to decode go-keyring hex value: ${err}`);\n return rawValue; // Return as-is if decoding fails\n }\n }\n\n // No encoding detected, return as-is\n return rawValue;\n}\n\n/**\n * Normalize private key (ensure 0x prefix)\n */\nfunction normalizePrivateKey(privateKey: string): `0x${string}` {\n if (!privateKey.startsWith(\"0x\")) {\n return `0x${privateKey}` as `0x${string}`;\n }\n return privateKey as `0x${string}`;\n}\n","/**\n * Private Key Resolution\n *\n * Implements 3-tier priority system for private key retrieval:\n * 1. Command-line flag (--private-key)\n * 2. Environment variable (ECLOUD_PRIVATE_KEY)\n * 3. OS keyring (stored via `ecloud auth login`)\n */\n\nimport { getPrivateKey, validatePrivateKey } from \"./keyring\";\n\nexport interface PrivateKeySource {\n key: `0x${string}`;\n source: string;\n}\n\n/**\n * Get private key from any available source\n *\n * Priority order:\n * 1. Direct parameter (from --private-key flag)\n * 2. Environment variable (ECLOUD_PRIVATE_KEY)\n * 3. OS keyring (single key for all environments)\n *\n * Returns null if no key found\n */\nexport async function getPrivateKeyWithSource(options: {\n privateKey?: string; // From flag\n}): Promise<PrivateKeySource | null> {\n // 1. Check direct parameter (flag)\n if (options.privateKey) {\n if (!validatePrivateKey(options.privateKey)) {\n throw new Error(\n \"Invalid private key format provided via command flag. Please check and try again.\",\n );\n }\n return {\n key: options.privateKey as `0x${string}`,\n source: \"command flag\",\n };\n }\n\n // 2. Check environment variable\n const envKey = process.env.ECLOUD_PRIVATE_KEY as `0x${string}`;\n if (envKey) {\n if (!validatePrivateKey(envKey)) {\n throw new Error(\n \"Invalid private key format provided via environment variable. Please check and try again.\",\n );\n }\n return {\n key: envKey,\n source: \"environment variable (ECLOUD_PRIVATE_KEY)\",\n };\n }\n\n // 3. Check OS keyring (single key for all environments)\n const keyringKey = await getPrivateKey();\n if (keyringKey) {\n return {\n key: keyringKey,\n source: \"stored credentials\",\n };\n }\n\n return null;\n}\n\n/**\n * Get private key with source or throw error\n */\nexport async function requirePrivateKey(options: {\n privateKey?: string;\n}): Promise<PrivateKeySource> {\n const result = await getPrivateKeyWithSource({\n privateKey: options.privateKey,\n });\n\n if (!result) {\n throw new Error(\n `Private key required. Please provide it via:\\n` +\n ` • Keyring: ecloud auth login\\n` +\n ` • Flag: --private-key YOUR_KEY\\n` +\n ` • Environment: export ECLOUD_PRIVATE_KEY=YOUR_KEY`,\n );\n }\n\n return result;\n}\n","/**\n * Private Key Generation\n *\n * Generate new secp256k1 private keys for Ethereum\n */\n\nimport { generatePrivateKey, privateKeyToAddress } from \"viem/accounts\";\n\nexport interface GeneratedKey {\n privateKey: string;\n address: string;\n}\n\n/**\n * Generate a new secp256k1 private key\n */\nexport function generateNewPrivateKey(): GeneratedKey {\n const privateKey = generatePrivateKey();\n const address = privateKeyToAddress(privateKey);\n\n return {\n privateKey,\n address,\n };\n}\n","/**\n * Instance type utilities\n */\n\nimport { Address } from \"viem\";\nimport { PreflightContext } from \"./preflight\";\nimport { Logger } from \"../types\";\nimport { UserApiClient } from \"./userapi\";\n\n/**\n * Get current instance type for an app (best-effort)\n * Returns empty string if unable to fetch (API unavailable, app info not ready, etc.).\n * This is used as a convenience default for the upgrade flow.\n */\nexport async function getCurrentInstanceType(\n preflightCtx: PreflightContext,\n appID: Address,\n logger: Logger,\n clientId?: string,\n): Promise<string> {\n try {\n const userApiClient = new UserApiClient(\n preflightCtx.environmentConfig,\n preflightCtx.privateKey,\n preflightCtx.rpcUrl,\n clientId,\n );\n\n const infos = await userApiClient.getInfos([appID], 1);\n if (infos.length === 0) {\n return \"\"; // No app info available yet\n }\n\n return infos[0].machineType || \"\";\n } catch (err: any) {\n logger.debug(`Failed to get current instance type: ${err.message}`);\n return \"\"; // API call failed, skip default\n }\n}\n","/**\n * Main SDK Client entry point\n */\n\nimport { createComputeModule, type ComputeModule } from \"./modules/compute\";\nimport {\n getEnvironmentConfig,\n isEnvironmentAvailable,\n getAvailableEnvironments,\n} from \"./common/config/environment\";\nimport { createBillingModule, type BillingModule } from \"./modules/billing\";\nimport { createBuildModule, type BuildModule, type BuildModuleConfig } from \"./modules/build\";\nimport { addHexPrefix } from \"./common/utils\";\n\n// Export all types\nexport * from \"./common/types\";\n\n// Export validation utilities (non-interactive)\nexport * from \"./common/utils/validation\";\n\n// Export common hex helpers (used by CLI as well)\nexport { addHexPrefix, stripHexPrefix } from \"./common/utils\";\n\n// Special case on createApp - we don't need the client to run it\nexport {\n createApp,\n CreateAppOpts,\n SDKCreateAppOpts,\n PRIMARY_LANGUAGES,\n getAvailableTemplates,\n} from \"./modules/compute/app/create\";\nexport { logs, LogsOptions, SDKLogsOptions } from \"./modules/compute/app/logs\";\nexport {\n SDKDeployOptions,\n prepareDeploy,\n prepareDeployFromVerifiableBuild,\n executeDeploy,\n watchDeployment,\n type PreparedDeploy,\n type PrepareDeployResult,\n} from \"./modules/compute/app/deploy\";\nexport {\n SDKUpgradeOptions,\n prepareUpgrade,\n prepareUpgradeFromVerifiableBuild,\n executeUpgrade,\n watchUpgrade,\n type PreparedUpgrade,\n type PrepareUpgradeResult,\n} from \"./modules/compute/app/upgrade\";\n\n// Export compute module for standalone use\nexport {\n createComputeModule,\n type ComputeModule,\n type ComputeModuleConfig,\n encodeStartAppData,\n encodeStopAppData,\n encodeTerminateAppData,\n} from \"./modules/compute\";\nexport {\n createBillingModule,\n type BillingModule,\n type BillingModuleConfig,\n} from \"./modules/billing\";\n\n// Export environment config utilities\nexport {\n getEnvironmentConfig,\n getAvailableEnvironments,\n isEnvironmentAvailable,\n getBuildType,\n isMainnet,\n} from \"./common/config/environment\";\nexport { isSubscriptionActive } from \"./common/utils/billing\";\n\n// Export auth utilities\nexport * from \"./common/auth\";\n\n// Export telemetry\nexport * from \"./common/telemetry\";\n\n// Export template catalog utilities for CLI\nexport {\n fetchTemplateCatalog,\n getTemplate,\n getCategoryDescriptions,\n} from \"./common/templates/catalog\";\n\n// Export contract utilities\nexport {\n getAllAppsByDeveloper,\n getAppLatestReleaseBlockNumbers,\n getBlockTimestamps,\n estimateTransactionGas,\n formatETH,\n type GasEstimate,\n type EstimateGasOptions,\n} from \"./common/contract/caller\";\n\n// Export batch gas estimation and delegation check\nexport {\n estimateBatchGas,\n checkERC7702Delegation,\n type EstimateBatchGasOptions,\n} from \"./common/contract/eip7702\";\n\n// Export instance type utilities\nexport { getCurrentInstanceType } from \"./common/utils/instance\";\n\n// Export user API client\nexport {\n UserApiClient,\n type AppInfo,\n type AppProfileInfo,\n type AppMetrics,\n type AppRelease,\n type AppReleaseBuild,\n type AppResponse,\n} from \"./common/utils/userapi\";\n\nexport type Environment = \"sepolia\" | \"sepolia-dev\" | \"mainnet-alpha\";\n\nexport interface ClientConfig {\n verbose: boolean;\n privateKey: `0x${string}`;\n environment: Environment | string;\n rpcUrl?: string;\n}\n\nexport interface ECloudClient {\n compute: ComputeModule;\n billing: BillingModule;\n}\n\nexport function createECloudClient(cfg: ClientConfig): ECloudClient {\n cfg.privateKey = addHexPrefix(cfg.privateKey);\n\n // Validate environment is available in current build\n const environment = cfg.environment || \"sepolia\";\n if (!isEnvironmentAvailable(environment)) {\n throw new Error(\n `Environment \"${environment}\" is not available in this build type. ` +\n `Available environments: ${getAvailableEnvironments().join(\", \")}`,\n );\n }\n\n // Get environment config\n const environmentConfig = getEnvironmentConfig(environment);\n\n // Get rpc url from environment config or use provided rpc url\n let rpcUrl = cfg.rpcUrl;\n if (!rpcUrl) {\n rpcUrl = process.env.RPC_URL ?? environmentConfig.defaultRPCURL;\n }\n if (!rpcUrl) {\n throw new Error(\n `RPC URL is required. Provide via options.rpcUrl, RPC_URL env var, or ensure environment has default RPC URL`,\n );\n }\n\n return {\n compute: createComputeModule({\n rpcUrl,\n verbose: cfg.verbose,\n privateKey: cfg.privateKey,\n environment: cfg.environment,\n }),\n billing: createBillingModule({\n verbose: cfg.verbose,\n privateKey: cfg.privateKey,\n }),\n };\n}\n\n// ============ Build module exports ============\nexport { createBuildModule };\nexport type { BuildModule, BuildModuleConfig };\nexport * from \"./modules/build/types\";\nexport * from \"./modules/build/errors\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAMA,OAAO,WAA8B;AACrC,SAAS,2BAA2B;AAK7B,IAAM,iBAAN,MAAqB;AAAA,EAK1B,YAAY,SAA4E;AACtF,SAAK,UAAU,QAAQ,QAAQ,QAAQ,QAAQ,EAAE;AACjD,SAAK,WAAW,QAAQ;AAExB,QAAI,QAAQ,YAAY;AACtB,WAAK,UAAU,oBAAoB,QAAQ,UAAiB;AAAA,IAC9D;AAAA,EACF;AAAA,EAEA,MAAM,YAAY,SAOgB;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Q;AACX,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,SAAS,oBAAoB;AAAA,MAC3B;AAAA,MACA,SAAS,IAAI;AAAA,MACb,YAAY,IAAI;AAAA,MAChB,aAAa,IAAI;AAAA,IACnB,CAAC;AAAA,IACD,SAAS,oBAAoB;AAAA,MAC3B,SAAS,IAAI;AAAA,MACb,YAAY,IAAI;AAAA,IAClB,CAAC;AAAA,EACH;AACF;","names":["logs","privateKeyToAddress"]}
1
+ {"version":3,"sources":["../src/client/common/utils/buildapi.ts","../src/client/modules/build/types.ts","../src/client/modules/build/errors.ts","../src/client/modules/build/index.ts","../src/client/common/utils/instance.ts","../src/client/index.ts"],"sourcesContent":["/**\n * Build API Client to manage verifiable builds and provenance\n *\n * This is a standalone HTTP client that talks to the (compute) UserAPI host.\n */\n\nimport axios, { AxiosResponse } from \"axios\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport type { Hex } from \"viem\";\nimport { calculateBillingAuthSignature } from \"./auth\";\n\nexport class BuildApiClient {\n private readonly baseUrl: string;\n private readonly account?: ReturnType<typeof privateKeyToAccount>;\n private readonly clientId?: string;\n\n constructor(options: { baseUrl: string; privateKey?: Hex | string; clientId?: string }) {\n this.baseUrl = options.baseUrl.replace(/\\/+$/, \"\");\n this.clientId = options.clientId;\n\n if (options.privateKey) {\n this.account = privateKeyToAccount(options.privateKey as Hex);\n }\n }\n\n async submitBuild(payload: {\n repo_url: string;\n git_ref: string;\n dockerfile_path: string;\n caddyfile_path?: string;\n build_context_path: string;\n dependencies: string[];\n }): Promise<{ build_id: string }> {\n return this.authenticatedJsonRequest<{ build_id: string }>(\"/builds\", \"POST\", payload);\n }\n\n async getBuild(buildId: string): Promise<any> {\n return this.publicJsonRequest(`/builds/${encodeURIComponent(buildId)}`);\n }\n\n async getBuildByDigest(digest: string): Promise<any> {\n return this.publicJsonRequest(`/builds/image/${encodeURIComponent(digest)}`);\n }\n\n async verify(identifier: string): Promise<any> {\n return this.publicJsonRequest(`/builds/verify/${encodeURIComponent(identifier)}`);\n }\n\n async getLogs(buildId: string): Promise<string> {\n return this.authenticatedTextRequest(`/builds/${encodeURIComponent(buildId)}/logs`);\n }\n\n async listBuilds(params: {\n billing_address: string;\n limit?: number;\n offset?: number;\n }): Promise<any[]> {\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}/builds`,\n method: \"GET\",\n params,\n headers: this.clientId ? { \"x-client-id\": this.clientId } : undefined,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data as any[];\n }\n\n private async publicJsonRequest(path: string): Promise<any> {\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method: \"GET\",\n headers: this.clientId ? { \"x-client-id\": this.clientId } : undefined,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data;\n }\n\n private async authenticatedJsonRequest<T>(\n path: string,\n method: \"POST\" | \"GET\",\n body?: unknown,\n ): Promise<T> {\n if (!this.account) throw new Error(\"Private key required for authenticated requests\");\n\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n };\n if (this.clientId) headers[\"x-client-id\"] = this.clientId;\n\n // Builds API uses BillingAuth signature format (same as Billing API).\n // Keep expiry short to reduce replay window.\n const expiry = BigInt(Math.floor(Date.now() / 1000) + 60);\n const { signature } = await calculateBillingAuthSignature({\n account: this.account,\n product: \"compute\",\n expiry,\n });\n headers.Authorization = `Bearer ${signature}`;\n headers[\"X-eigenx-expiry\"] = expiry.toString();\n headers[\"X-Account\"] = this.account.address;\n\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method,\n headers,\n data: body,\n timeout: 60_000,\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return res.data as T;\n }\n\n private async authenticatedTextRequest(path: string): Promise<string> {\n if (!this.account) throw new Error(\"Private key required for authenticated requests\");\n\n const headers: Record<string, string> = {};\n if (this.clientId) headers[\"x-client-id\"] = this.clientId;\n\n const expiry = BigInt(Math.floor(Date.now() / 1000) + 60);\n const { signature } = await calculateBillingAuthSignature({\n account: this.account,\n product: \"compute\",\n expiry,\n });\n headers.Authorization = `Bearer ${signature}`;\n headers[\"X-eigenx-expiry\"] = expiry.toString();\n headers[\"X-Account\"] = this.account.address;\n\n const res: AxiosResponse = await axios({\n url: `${this.baseUrl}${path}`,\n method: \"GET\",\n headers,\n timeout: 60_000,\n responseType: \"text\",\n validateStatus: () => true,\n });\n if (res.status < 200 || res.status >= 300) throw buildApiHttpError(res);\n return typeof res.data === \"string\" ? res.data : JSON.stringify(res.data);\n }\n}\n\nfunction buildApiHttpError(res: AxiosResponse): Error {\n const status = res.status;\n const body = typeof res.data === \"string\" ? res.data : res.data ? JSON.stringify(res.data) : \"\";\n const url = res.config?.url ? ` ${res.config.url}` : \"\";\n return new Error(`BuildAPI request failed: ${status}${url} - ${body || \"Unknown error\"}`);\n}\n","// ============ Request/Response Types ============\n\nexport interface SubmitBuildRequest {\n repoUrl: string;\n gitRef: string;\n dockerfilePath?: string;\n /**\n * Path to a Caddyfile within the repository (relative to buildContextPath).\n * If omitted, the build service will not copy a Caddyfile into the image.\n */\n caddyfilePath?: string;\n buildContextPath?: string;\n dependencies?: string[];\n}\n\nexport interface SubmitBuildResponse {\n buildId: string;\n}\n\nexport const BUILD_STATUS = {\n BUILDING: \"building\",\n SUCCESS: \"success\",\n FAILED: \"failed\",\n} as const;\n\nexport type BuildStatus = (typeof BUILD_STATUS)[keyof typeof BUILD_STATUS];\n\nexport interface Build {\n buildId: string;\n billingAddress: string;\n repoUrl: string;\n gitRef: string;\n status: BuildStatus;\n /** 'application' | 'dependency' (as returned by the API) */\n buildType: string;\n imageName: string;\n imageUrl?: string;\n imageDigest?: string;\n provenanceJson?: Record<string, unknown>;\n provenanceSignature?: string;\n errorMessage?: string;\n createdAt: string;\n updatedAt: string;\n dependencies?: Record<string, Build>;\n}\n\n// ============ Verification Types ============\n\nexport type VerifyProvenanceResult = VerifyProvenanceSuccess | VerifyProvenanceFailure;\n\nexport interface VerifyProvenanceSuccess {\n status: \"verified\";\n buildId: string;\n imageUrl: string;\n imageDigest: string;\n repoUrl: string;\n gitRef: string;\n provenanceJson: Record<string, unknown>;\n provenanceSignature: string;\n payloadType: string;\n payload: string;\n}\n\nexport interface VerifyProvenanceFailure {\n status: \"failed\";\n error: string;\n buildId?: string;\n}\n\n// ============ Log Streaming ============\n\nexport interface LogChunk {\n content: string;\n totalLength: number;\n isComplete: boolean;\n finalStatus?: BuildStatus;\n}\n\nexport interface BuildProgress {\n build: Build;\n logs: string;\n}\n","export class BuildError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"BuildError\";\n }\n}\n\nexport class AuthRequiredError extends BuildError {\n constructor(message = \"Authentication required\") {\n super(message);\n this.name = \"AuthRequiredError\";\n }\n}\n\nexport class BuildFailedError extends BuildError {\n constructor(\n message: string,\n public readonly buildId: string,\n ) {\n super(message);\n this.name = \"BuildFailedError\";\n }\n}\n\nexport class ConflictError extends BuildError {\n constructor(message = \"Build already in progress\") {\n super(message);\n this.name = \"ConflictError\";\n }\n}\n\nexport class NotFoundError extends BuildError {\n constructor(message = \"Build not found\") {\n super(message);\n this.name = \"NotFoundError\";\n }\n}\n\nexport class ForbiddenError extends BuildError {\n constructor(message = \"Permission denied\") {\n super(message);\n this.name = \"ForbiddenError\";\n }\n}\n\nexport class TimeoutError extends BuildError {\n constructor(message = \"Operation timed out\") {\n super(message);\n this.name = \"TimeoutError\";\n }\n}\n\nexport class BadRequestError extends BuildError {\n constructor(message = \"Bad request\") {\n super(message);\n this.name = \"BadRequestError\";\n }\n}\n","/**\n * Build module entry point (verifiable builds + provenance)\n */\n\nimport { getEnvironmentConfig } from \"../../common/config/environment\";\nimport { withSDKTelemetry } from \"../../common/telemetry/wrapper\";\nimport { getLogger, addHexPrefix } from \"../../common/utils\";\nimport { BuildApiClient } from \"../../common/utils/buildapi\";\n\nimport { BUILD_STATUS } from \"./types\";\nimport type {\n Build,\n BuildProgress,\n BuildStatus,\n LogChunk,\n SubmitBuildRequest,\n SubmitBuildResponse,\n VerifyProvenanceResult,\n} from \"./types\";\nimport { AuthRequiredError, BuildFailedError, TimeoutError } from \"./errors\";\n\nexport interface BuildModuleConfig {\n privateKey?: string;\n environment?: string;\n verbose?: boolean;\n clientId?: string;\n skipTelemetry?: boolean;\n}\n\nexport interface BuildModule {\n submit(request: SubmitBuildRequest): Promise<SubmitBuildResponse>;\n getLogs(buildId: string): Promise<string>;\n\n list(options: { billingAddress: string; limit?: number; offset?: number }): Promise<Build[]>;\n get(buildId: string): Promise<Build>;\n getByDigest(digest: string): Promise<Build>;\n verify(identifier: string): Promise<VerifyProvenanceResult>;\n\n submitAndWait(\n request: SubmitBuildRequest,\n options?: {\n onLog?: (chunk: string) => void;\n onProgress?: (progress: BuildProgress) => void;\n pollIntervalMs?: number;\n timeoutMs?: number;\n },\n ): Promise<Build>;\n\n waitForBuild(\n buildId: string,\n options?: {\n onLog?: (chunk: string) => void;\n onProgress?: (progress: BuildProgress) => void;\n pollIntervalMs?: number;\n timeoutMs?: number;\n },\n ): Promise<Build>;\n\n streamLogs(buildId: string, pollIntervalMs?: number): AsyncGenerator<LogChunk, void, unknown>;\n}\n\nconst DEFAULT_POLL_INTERVAL = 2000;\nconst DEFAULT_TIMEOUT = 30 * 60 * 1000;\n\nexport function createBuildModule(config: BuildModuleConfig): BuildModule {\n const { verbose = false, skipTelemetry = false } = config;\n const logger = getLogger(verbose);\n\n const environment = config.environment || \"sepolia\";\n const environmentConfig = getEnvironmentConfig(environment);\n\n // NOTE: build endpoints are served from the compute UserAPI host\n const api = new BuildApiClient({\n baseUrl: environmentConfig.userApiServerURL,\n privateKey: config.privateKey ? addHexPrefix(config.privateKey) : undefined,\n clientId: config.clientId,\n });\n\n return {\n async submit(request: SubmitBuildRequest): Promise<SubmitBuildResponse> {\n return withSDKTelemetry(\n {\n functionName: \"build.submit\",\n skipTelemetry,\n properties: { environment, repoUrl: request.repoUrl },\n },\n async () => {\n if (!config.privateKey) throw new AuthRequiredError(\"Private key required for submit()\");\n\n const data = await api.submitBuild({\n repo_url: request.repoUrl,\n git_ref: request.gitRef,\n dockerfile_path: request.dockerfilePath ?? \"Dockerfile\",\n caddyfile_path: request.caddyfilePath,\n build_context_path: request.buildContextPath ?? \".\",\n dependencies: request.dependencies ?? [],\n });\n\n logger.debug(`Submitted build: ${data.build_id}`);\n return { buildId: data.build_id };\n },\n );\n },\n\n async list(options): Promise<Build[]> {\n const { billingAddress, limit, offset } = options;\n return withSDKTelemetry(\n {\n functionName: \"build.list\",\n skipTelemetry,\n properties: {\n environment,\n billingAddress,\n ...(limit !== undefined ? { limit: String(limit) } : {}),\n ...(offset !== undefined ? { offset: String(offset) } : {}),\n },\n },\n async () => {\n const data = await api.listBuilds({\n billing_address: billingAddress,\n limit,\n offset,\n });\n return Array.isArray(data) ? data.map(transformBuild) : [];\n },\n );\n },\n\n async get(buildId: string): Promise<Build> {\n return withSDKTelemetry(\n { functionName: \"build.get\", skipTelemetry, properties: { environment, buildId } },\n async () => transformBuild(await api.getBuild(buildId)),\n );\n },\n\n async getByDigest(digest: string): Promise<Build> {\n return withSDKTelemetry(\n { functionName: \"build.getByDigest\", skipTelemetry, properties: { environment, digest } },\n async () => transformBuild(await api.getBuildByDigest(digest)),\n );\n },\n\n async verify(identifier: string): Promise<VerifyProvenanceResult> {\n return withSDKTelemetry(\n { functionName: \"build.verify\", skipTelemetry, properties: { environment, identifier } },\n async () => transformVerifyResult(await api.verify(identifier)),\n );\n },\n\n async getLogs(buildId: string): Promise<string> {\n return withSDKTelemetry(\n { functionName: \"build.getLogs\", skipTelemetry, properties: { environment, buildId } },\n async () => {\n if (!config.privateKey) throw new AuthRequiredError(\"Private key required for getLogs()\");\n return api.getLogs(buildId);\n },\n );\n },\n\n async submitAndWait(request, options = {}) {\n const { buildId } = await this.submit(request);\n return this.waitForBuild(buildId, options);\n },\n\n async waitForBuild(buildId, options = {}) {\n const {\n onLog,\n onProgress,\n pollIntervalMs = DEFAULT_POLL_INTERVAL,\n timeoutMs = DEFAULT_TIMEOUT,\n } = options;\n\n const startTime = Date.now();\n let lastLogLength = 0;\n\n while (true) {\n if (Date.now() - startTime > timeoutMs) {\n throw new TimeoutError(`Build timed out after ${timeoutMs}ms`);\n }\n\n const build = await this.get(buildId);\n let logs = \"\";\n\n try {\n logs = await this.getLogs(buildId);\n if (onLog && logs.length > lastLogLength) {\n onLog(logs.slice(lastLogLength));\n lastLogLength = logs.length;\n }\n } catch {\n // ignore\n }\n\n onProgress?.({ build, logs });\n\n if (build.status === BUILD_STATUS.SUCCESS) return build;\n if (build.status === BUILD_STATUS.FAILED) {\n throw new BuildFailedError(build.errorMessage ?? \"Build failed\", buildId);\n }\n\n await sleep(pollIntervalMs);\n }\n },\n\n async *streamLogs(buildId, pollIntervalMs = DEFAULT_POLL_INTERVAL) {\n let lastLength = 0;\n while (true) {\n const build = await this.get(buildId);\n let logs = \"\";\n\n try {\n logs = await this.getLogs(buildId);\n } catch {\n // ignore\n }\n\n if (logs.length > lastLength) {\n yield {\n content: logs.slice(lastLength),\n totalLength: logs.length,\n isComplete: build.status !== BUILD_STATUS.BUILDING,\n finalStatus: build.status !== BUILD_STATUS.BUILDING ? build.status : undefined,\n };\n lastLength = logs.length;\n }\n\n if (build.status !== BUILD_STATUS.BUILDING) break;\n await sleep(pollIntervalMs);\n }\n },\n };\n}\n\nfunction sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n\nfunction transformBuild(raw: any): Build {\n return {\n buildId: raw.build_id,\n billingAddress: raw.billing_address,\n repoUrl: raw.repo_url,\n gitRef: raw.git_ref,\n status: raw.status as BuildStatus,\n buildType: raw.build_type,\n imageName: raw.image_name,\n imageUrl: raw.image_url,\n imageDigest: raw.image_digest,\n provenanceJson: raw.provenance_json ?? undefined,\n provenanceSignature: raw.provenance_signature ?? undefined,\n errorMessage: raw.error_message ?? undefined,\n createdAt: raw.created_at,\n updatedAt: raw.updated_at,\n dependencies: raw.dependencies\n ? Object.fromEntries(Object.entries(raw.dependencies).map(([k, v]) => [k, transformBuild(v)]))\n : undefined,\n };\n}\n\nfunction transformVerifyResult(raw: any): VerifyProvenanceResult {\n if (raw.status === \"verified\") {\n return {\n status: \"verified\",\n buildId: raw.build_id,\n imageUrl: raw.image_url,\n imageDigest: raw.image_digest,\n repoUrl: raw.repo_url,\n gitRef: raw.git_ref,\n provenanceJson: raw.provenance_json,\n provenanceSignature: raw.provenance_signature,\n payloadType: raw.payload_type,\n payload: raw.payload,\n };\n }\n\n return {\n status: \"failed\",\n error: raw.error,\n buildId: raw.build_id,\n };\n}\n\n// Re-export errors/types for convenience\nexport * from \"./types\";\nexport * from \"./errors\";\n","/**\n * Instance type utilities\n */\n\nimport { Address } from \"viem\";\nimport { PreflightContext } from \"./preflight\";\nimport { Logger } from \"../types\";\nimport { UserApiClient } from \"./userapi\";\n\n/**\n * Get current instance type for an app (best-effort)\n * Returns empty string if unable to fetch (API unavailable, app info not ready, etc.).\n * This is used as a convenience default for the upgrade flow.\n */\nexport async function getCurrentInstanceType(\n preflightCtx: PreflightContext,\n appID: Address,\n logger: Logger,\n clientId?: string,\n): Promise<string> {\n try {\n const userApiClient = new UserApiClient(\n preflightCtx.environmentConfig,\n preflightCtx.privateKey,\n preflightCtx.rpcUrl,\n clientId,\n );\n\n const infos = await userApiClient.getInfos([appID], 1);\n if (infos.length === 0) {\n return \"\"; // No app info available yet\n }\n\n return infos[0].machineType || \"\";\n } catch (err: any) {\n logger.debug(`Failed to get current instance type: ${err.message}`);\n return \"\"; // API call failed, skip default\n }\n}\n","/**\n * Main SDK Client entry point\n */\n\nimport { createComputeModule, type ComputeModule } from \"./modules/compute\";\nimport {\n getEnvironmentConfig,\n isEnvironmentAvailable,\n getAvailableEnvironments,\n} from \"./common/config/environment\";\nimport { createBillingModule, type BillingModule } from \"./modules/billing\";\nimport { createBuildModule, type BuildModule, type BuildModuleConfig } from \"./modules/build\";\nimport { addHexPrefix } from \"./common/utils\";\nimport { Hex } from \"viem\";\n\n// Export all types\nexport * from \"./common/types\";\n\n// Export validation utilities (non-interactive)\nexport * from \"./common/utils/validation\";\n\n// Export common hex helpers (used by CLI as well)\nexport { addHexPrefix, stripHexPrefix } from \"./common/utils\";\n\n// Special case on createApp - we don't need the client to run it\nexport {\n createApp,\n CreateAppOpts,\n SDKCreateAppOpts,\n PRIMARY_LANGUAGES,\n getAvailableTemplates,\n} from \"./modules/compute/app/create\";\nexport { logs, LogsOptions, SDKLogsOptions } from \"./modules/compute/app/logs\";\nexport {\n SDKDeployOptions,\n prepareDeploy,\n prepareDeployFromVerifiableBuild,\n executeDeploy,\n watchDeployment,\n type PrepareDeployResult,\n} from \"./modules/compute/app/deploy\";\nexport {\n SDKUpgradeOptions,\n prepareUpgrade,\n prepareUpgradeFromVerifiableBuild,\n executeUpgrade,\n watchUpgrade,\n type PrepareUpgradeResult,\n} from \"./modules/compute/app/upgrade\";\n\n// Export compute module for standalone use\nexport {\n createComputeModule,\n type ComputeModule,\n type ComputeModuleConfig,\n encodeStartAppData,\n encodeStopAppData,\n encodeTerminateAppData,\n} from \"./modules/compute\";\nexport {\n createBillingModule,\n type BillingModule,\n type BillingModuleConfig,\n} from \"./modules/billing\";\n\n// Export environment config utilities\nexport {\n getEnvironmentConfig,\n getAvailableEnvironments,\n isEnvironmentAvailable,\n getBuildType,\n isMainnet,\n} from \"./common/config/environment\";\nexport { isSubscriptionActive } from \"./common/utils/billing\";\n\n// Export auth utilities\nexport * from \"./common/auth\";\n\n// Export telemetry\nexport * from \"./common/telemetry\";\n\n// Export template catalog utilities for CLI\nexport {\n fetchTemplateCatalog,\n getTemplate,\n getCategoryDescriptions,\n} from \"./common/templates/catalog\";\n\n// Export contract utilities\nexport {\n getAllAppsByDeveloper,\n getAppLatestReleaseBlockNumbers,\n getBlockTimestamps,\n estimateTransactionGas,\n formatETH,\n type GasEstimate,\n type EstimateGasOptions,\n} from \"./common/contract/caller\";\n\n// Export batch gas estimation and delegation check\nexport {\n estimateBatchGas,\n checkERC7702Delegation,\n type EstimateBatchGasOptions,\n} from \"./common/contract/eip7702\";\n\n// Export instance type utilities\nexport { getCurrentInstanceType } from \"./common/utils/instance\";\n\n// Export user API client\nexport {\n UserApiClient,\n type AppInfo,\n type AppProfileInfo,\n type AppMetrics,\n type AppRelease,\n type AppReleaseBuild,\n type AppResponse,\n} from \"./common/utils/userapi\";\n\nexport type Environment = \"sepolia\" | \"sepolia-dev\" | \"mainnet-alpha\";\n\nexport interface ClientConfig {\n verbose: boolean;\n privateKey: Hex;\n environment: Environment | string;\n rpcUrl?: string;\n}\n\nexport interface ECloudClient {\n compute: ComputeModule;\n billing: BillingModule;\n}\n\nexport function createECloudClient(cfg: ClientConfig): ECloudClient {\n cfg.privateKey = addHexPrefix(cfg.privateKey);\n\n // Validate environment is available in current build\n const environment = cfg.environment || \"sepolia\";\n if (!isEnvironmentAvailable(environment)) {\n throw new Error(\n `Environment \"${environment}\" is not available in this build type. ` +\n `Available environments: ${getAvailableEnvironments().join(\", \")}`,\n );\n }\n\n // Get environment config\n const environmentConfig = getEnvironmentConfig(environment);\n\n // Get rpc url from environment config or use provided rpc url\n let rpcUrl = cfg.rpcUrl;\n if (!rpcUrl) {\n rpcUrl = process.env.RPC_URL ?? environmentConfig.defaultRPCURL;\n }\n if (!rpcUrl) {\n throw new Error(\n `RPC URL is required. Provide via options.rpcUrl, RPC_URL env var, or ensure environment has default RPC URL`,\n );\n }\n\n return {\n compute: createComputeModule({\n rpcUrl,\n verbose: cfg.verbose,\n privateKey: cfg.privateKey,\n environment: cfg.environment,\n }),\n billing: createBillingModule({\n verbose: cfg.verbose,\n privateKey: cfg.privateKey,\n }),\n };\n}\n\n// ============ Build module exports ============\nexport { createBuildModule };\nexport type { BuildModule, BuildModuleConfig };\nexport * from \"./modules/build/types\";\nexport * from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AAE;AAClE,WAAO;AAAA,EACT;AACF;;;ACgGO,SAAS,mBAAmB,KAAiC;AAClE,MAAI,aAAa,aAAa,IAAI,UAAU;AAG5C,QAAM,cAAc,IAAI,eAAe;AACvC,MAAI,CAAC,uBAAuB,WAAW,GAAG;AACxC,UAAM,IAAI;AAAA,MACR,gBAAgB,WAAW,kEACE,yBAAyB,EAAE,KAAK,IAAI,CAAC;AAAA,IACpE;AAAA,EACF;AAGA,QAAM,oBAAoB,qBAAqB,WAAW;AAG1D,MAAI,SAAS,IAAI;AACjB,MAAI,CAAC,QAAQ;AACX,aAAS,QAAQ,IAAI,WAAW,kBAAkB;AAAA,EACpD;AACA,MAAI,CAAC,QAAQ;AACX,UAAM,IAAI;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEA,SAAO;AAAA,IACL,SAAS,oBAAoB;AAAA,MAC3B;AAAA,MACA,SAAS,IAAI;AAAA,MACb,YAAY,IAAI;AAAA,MAChB,aAAa,IAAI;AAAA,IACnB,CAAC;AAAA,IACD,SAAS,oBAAoB;AAAA,MAC3B,SAAS,IAAI;AAAA,MACb,YAAY,IAAI;AAAA,IAClB,CAAC;AAAA,EACH;AACF;","names":["logs"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layr-labs/ecloud-sdk",
3
- "version": "0.2.0-dev",
3
+ "version": "0.2.0-dev.1",
4
4
  "type": "module",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",
@@ -30,6 +30,7 @@
30
30
  },
31
31
  "scripts": {
32
32
  "build": "tsup",
33
+ "build:dev": "BUILD_TYPE=dev tsup",
33
34
  "prepublishOnly": "cp ../../README.md .",
34
35
  "lint": "eslint .",
35
36
  "format": "prettier --check .",