@phala/cloud 0.2.3 → 0.2.4

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.mjs CHANGED
@@ -2424,6 +2424,101 @@ var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmState
2424
2424
  return await client.get(`/cvms/${cvmId}/state`);
2425
2425
  });
2426
2426
 
2427
+ // src/actions/ssh_keys/list_ssh_keys.ts
2428
+ import { z as z38 } from "zod";
2429
+ var SshKeySchema = z38.object({
2430
+ id: z38.string(),
2431
+ user_id: z38.string(),
2432
+ name: z38.string(),
2433
+ public_key: z38.string(),
2434
+ fingerprint: z38.string(),
2435
+ key_type: z38.string(),
2436
+ source: z38.string(),
2437
+ key_metadata: z38.record(z38.unknown()).nullable().optional(),
2438
+ last_synced_at: z38.string().nullable().optional(),
2439
+ created_at: z38.string(),
2440
+ updated_at: z38.string()
2441
+ });
2442
+ var ListSshKeysResponseSchema = z38.array(SshKeySchema);
2443
+ async function listSshKeys(client) {
2444
+ const response = await client.get("/user/ssh-keys");
2445
+ return ListSshKeysResponseSchema.parse(response);
2446
+ }
2447
+ async function safeListSshKeys(client) {
2448
+ try {
2449
+ const data = await listSshKeys(client);
2450
+ return { success: true, data };
2451
+ } catch (error) {
2452
+ if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
2453
+ return { success: false, error };
2454
+ }
2455
+ return {
2456
+ success: false,
2457
+ error: {
2458
+ name: "Error",
2459
+ message: error instanceof Error ? error.message : String(error)
2460
+ }
2461
+ };
2462
+ }
2463
+ }
2464
+
2465
+ // src/actions/ssh_keys/import_github_profile.ts
2466
+ import { z as z39 } from "zod";
2467
+ var ImportGithubProfileRequestSchema = z39.object({
2468
+ github_username: z39.string().min(1)
2469
+ });
2470
+ var ImportGithubProfileResponseSchema = z39.object({
2471
+ github_username: z39.string(),
2472
+ keys_added: z39.number().int(),
2473
+ keys_skipped: z39.number().int(),
2474
+ errors: z39.array(z39.string()).default([])
2475
+ });
2476
+ var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSshKeys } = defineAction(
2477
+ ImportGithubProfileResponseSchema,
2478
+ async (client, request) => {
2479
+ const { github_username } = ImportGithubProfileRequestSchema.parse(request);
2480
+ return await client.post("/user/ssh-keys/github-profile", { github_username });
2481
+ }
2482
+ );
2483
+
2484
+ // src/actions/ssh_keys/create_ssh_key.ts
2485
+ import { z as z40 } from "zod";
2486
+ var CreateSshKeyRequestSchema = z40.object({
2487
+ name: z40.string().min(1),
2488
+ public_key: z40.string().min(1)
2489
+ });
2490
+ var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKeySchema, async (client, request) => {
2491
+ const { name, public_key } = CreateSshKeyRequestSchema.parse(request);
2492
+ return await client.post("/user/ssh-keys", { name, public_key });
2493
+ });
2494
+
2495
+ // src/actions/ssh_keys/delete_ssh_key.ts
2496
+ import { z as z41 } from "zod";
2497
+ var DeleteSshKeyRequestSchema = z41.object({
2498
+ keyId: z41.string().min(1)
2499
+ });
2500
+ var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(z41.void(), async (client, request) => {
2501
+ const { keyId } = DeleteSshKeyRequestSchema.parse(request);
2502
+ await client.delete(`/user/ssh-keys/${keyId}`);
2503
+ return void 0;
2504
+ });
2505
+
2506
+ // src/actions/ssh_keys/sync_github_ssh_keys.ts
2507
+ import { z as z42 } from "zod";
2508
+ var SyncGithubSshKeysResponseSchema = z42.object({
2509
+ synced_count: z42.number().int(),
2510
+ keys_added: z42.number().int(),
2511
+ keys_updated: z42.number().int(),
2512
+ keys_removed: z42.number().int(),
2513
+ errors: z42.array(z42.string()).default([])
2514
+ });
2515
+ var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSimpleAction(
2516
+ SyncGithubSshKeysResponseSchema,
2517
+ async (client) => {
2518
+ return await client.post("/user/ssh-keys/github-sync", {});
2519
+ }
2520
+ );
2521
+
2427
2522
  // src/create-client.ts
2428
2523
  function createClient2(config = {}) {
2429
2524
  const client = createClient(config);
@@ -2499,167 +2594,177 @@ function createClient2(config = {}) {
2499
2594
  nextAppIds,
2500
2595
  safeNextAppIds,
2501
2596
  getCvmState,
2502
- safeGetCvmState
2597
+ safeGetCvmState,
2598
+ listSshKeys,
2599
+ safeListSshKeys,
2600
+ importGithubProfileSshKeys,
2601
+ safeImportGithubProfileSshKeys,
2602
+ createSshKey,
2603
+ safeCreateSshKey,
2604
+ deleteSshKey,
2605
+ safeDeleteSshKey,
2606
+ syncGithubSshKeys,
2607
+ safeSyncGithubSshKeys
2503
2608
  };
2504
2609
  return client.extend(allActions);
2505
2610
  }
2506
2611
 
2507
2612
  // src/types/app_info_v20251028.ts
2508
- import { z as z38 } from "zod";
2509
- var CvmBasicInfoV20251028Schema = z38.object({
2510
- vm_uuid: z38.string().nullable(),
2511
- app_id: z38.string(),
2512
- name: z38.string().default(""),
2513
- status: z38.string(),
2514
- vcpu: z38.number().int(),
2515
- memory: z38.number().int(),
2516
- disk_size: z38.number().int(),
2517
- teepod_id: z38.number().int(),
2518
- teepod_name: z38.string(),
2519
- region_identifier: z38.string().nullable().optional(),
2520
- kms_type: z38.string().nullable().optional(),
2521
- instance_type: z38.string().nullable().optional(),
2522
- listed: z38.boolean().nullable().optional(),
2523
- base_image: z38.string().nullable().optional(),
2524
- kms_slug: z38.string().nullable().optional(),
2525
- kms_id: z38.string().nullable().optional(),
2526
- instance_id: z38.string().nullable().optional(),
2613
+ import { z as z43 } from "zod";
2614
+ var CvmBasicInfoV20251028Schema = z43.object({
2615
+ vm_uuid: z43.string().nullable(),
2616
+ app_id: z43.string(),
2617
+ name: z43.string().default(""),
2618
+ status: z43.string(),
2619
+ vcpu: z43.number().int(),
2620
+ memory: z43.number().int(),
2621
+ disk_size: z43.number().int(),
2622
+ teepod_id: z43.number().int(),
2623
+ teepod_name: z43.string(),
2624
+ region_identifier: z43.string().nullable().optional(),
2625
+ kms_type: z43.string().nullable().optional(),
2626
+ instance_type: z43.string().nullable().optional(),
2627
+ listed: z43.boolean().nullable().optional(),
2628
+ base_image: z43.string().nullable().optional(),
2629
+ kms_slug: z43.string().nullable().optional(),
2630
+ kms_id: z43.string().nullable().optional(),
2631
+ instance_id: z43.string().nullable().optional(),
2527
2632
  machine_info: MachineInfoV20251028Schema.nullable().optional(),
2528
- updated_at: z38.string().nullable().optional()
2633
+ updated_at: z43.string().nullable().optional()
2529
2634
  });
2530
- var AppProfileSchema = z38.object({
2531
- display_name: z38.string().nullable().optional(),
2532
- avatar_url: z38.string().nullable().optional(),
2533
- description: z38.string().nullable().optional(),
2534
- custom_domain: z38.string().nullable().optional()
2635
+ var AppProfileSchema = z43.object({
2636
+ display_name: z43.string().nullable().optional(),
2637
+ avatar_url: z43.string().nullable().optional(),
2638
+ description: z43.string().nullable().optional(),
2639
+ custom_domain: z43.string().nullable().optional()
2535
2640
  });
2536
- var DstackAppFullResponseV20251028Schema = z38.object({
2537
- id: z38.string(),
2538
- name: z38.string(),
2539
- app_id: z38.string(),
2540
- app_provision_type: z38.string().nullable().optional(),
2541
- app_icon_url: z38.string().nullable().optional(),
2542
- created_at: z38.string(),
2543
- kms_type: z38.string(),
2641
+ var DstackAppFullResponseV20251028Schema = z43.object({
2642
+ id: z43.string(),
2643
+ name: z43.string(),
2644
+ app_id: z43.string(),
2645
+ app_provision_type: z43.string().nullable().optional(),
2646
+ app_icon_url: z43.string().nullable().optional(),
2647
+ created_at: z43.string(),
2648
+ kms_type: z43.string(),
2544
2649
  profile: AppProfileSchema.nullable().optional(),
2545
2650
  current_cvm: CvmBasicInfoV20251028Schema.nullable().optional(),
2546
- cvms: z38.array(CvmBasicInfoV20251028Schema).default([]),
2547
- cvm_count: z38.number().int().default(0)
2651
+ cvms: z43.array(CvmBasicInfoV20251028Schema).default([]),
2652
+ cvm_count: z43.number().int().default(0)
2548
2653
  });
2549
- var DstackAppMinimalResponseV20251028Schema = z38.object({
2550
- id: z38.null().optional(),
2551
- app_id: z38.string(),
2552
- name: z38.null().optional(),
2553
- app_provision_type: z38.null().optional(),
2554
- app_icon_url: z38.null().optional(),
2555
- created_at: z38.null().optional(),
2556
- kms_type: z38.null().optional(),
2557
- current_cvm: z38.null().optional(),
2558
- cvms: z38.null().optional(),
2559
- cvm_count: z38.null().optional()
2654
+ var DstackAppMinimalResponseV20251028Schema = z43.object({
2655
+ id: z43.null().optional(),
2656
+ app_id: z43.string(),
2657
+ name: z43.null().optional(),
2658
+ app_provision_type: z43.null().optional(),
2659
+ app_icon_url: z43.null().optional(),
2660
+ created_at: z43.null().optional(),
2661
+ kms_type: z43.null().optional(),
2662
+ current_cvm: z43.null().optional(),
2663
+ cvms: z43.null().optional(),
2664
+ cvm_count: z43.null().optional()
2560
2665
  });
2561
- var DstackAppWithCvmResponseV20251028Schema = z38.union([
2666
+ var DstackAppWithCvmResponseV20251028Schema = z43.union([
2562
2667
  DstackAppFullResponseV20251028Schema,
2563
2668
  DstackAppMinimalResponseV20251028Schema
2564
2669
  ]);
2565
- var DstackAppListResponseV20251028Schema = z38.object({
2566
- dstack_apps: z38.array(DstackAppWithCvmResponseV20251028Schema),
2567
- page: z38.number().int(),
2568
- page_size: z38.number().int(),
2569
- total: z38.number().int(),
2570
- total_pages: z38.number().int()
2670
+ var DstackAppListResponseV20251028Schema = z43.object({
2671
+ dstack_apps: z43.array(DstackAppWithCvmResponseV20251028Schema),
2672
+ page: z43.number().int(),
2673
+ page_size: z43.number().int(),
2674
+ total: z43.number().int(),
2675
+ total_pages: z43.number().int()
2571
2676
  });
2572
2677
 
2573
2678
  // src/types/app_info_v20260121.ts
2574
- import { z as z39 } from "zod";
2575
- var DstackAppFullResponseV20260121Schema = z39.object({
2576
- id: z39.string(),
2577
- name: z39.string(),
2578
- app_id: z39.string(),
2579
- app_provision_type: z39.string().nullable().optional(),
2580
- app_icon_url: z39.string().nullable().optional(),
2581
- created_at: z39.string(),
2582
- kms_type: z39.string(),
2583
- profile: z39.object({
2584
- display_name: z39.string().nullable().optional(),
2585
- avatar_url: z39.string().nullable().optional(),
2586
- description: z39.string().nullable().optional(),
2587
- custom_domain: z39.string().nullable().optional()
2679
+ import { z as z44 } from "zod";
2680
+ var DstackAppFullResponseV20260121Schema = z44.object({
2681
+ id: z44.string(),
2682
+ name: z44.string(),
2683
+ app_id: z44.string(),
2684
+ app_provision_type: z44.string().nullable().optional(),
2685
+ app_icon_url: z44.string().nullable().optional(),
2686
+ created_at: z44.string(),
2687
+ kms_type: z44.string(),
2688
+ profile: z44.object({
2689
+ display_name: z44.string().nullable().optional(),
2690
+ avatar_url: z44.string().nullable().optional(),
2691
+ description: z44.string().nullable().optional(),
2692
+ custom_domain: z44.string().nullable().optional()
2588
2693
  }).nullable().optional(),
2589
2694
  current_cvm: CvmInfoV20260121Schema.nullable().optional(),
2590
- cvms: z39.array(CvmInfoV20260121Schema).default([]),
2591
- cvm_count: z39.number().int().default(0)
2695
+ cvms: z44.array(CvmInfoV20260121Schema).default([]),
2696
+ cvm_count: z44.number().int().default(0)
2592
2697
  });
2593
- var DstackAppMinimalResponseV20260121Schema = z39.object({
2594
- id: z39.null().optional(),
2595
- app_id: z39.string(),
2596
- name: z39.null().optional(),
2597
- app_provision_type: z39.null().optional(),
2598
- app_icon_url: z39.null().optional(),
2599
- created_at: z39.null().optional(),
2600
- kms_type: z39.null().optional(),
2601
- current_cvm: z39.null().optional(),
2602
- cvms: z39.null().optional(),
2603
- cvm_count: z39.null().optional()
2698
+ var DstackAppMinimalResponseV20260121Schema = z44.object({
2699
+ id: z44.null().optional(),
2700
+ app_id: z44.string(),
2701
+ name: z44.null().optional(),
2702
+ app_provision_type: z44.null().optional(),
2703
+ app_icon_url: z44.null().optional(),
2704
+ created_at: z44.null().optional(),
2705
+ kms_type: z44.null().optional(),
2706
+ current_cvm: z44.null().optional(),
2707
+ cvms: z44.null().optional(),
2708
+ cvm_count: z44.null().optional()
2604
2709
  });
2605
- var DstackAppWithCvmResponseV20260121Schema = z39.union([
2710
+ var DstackAppWithCvmResponseV20260121Schema = z44.union([
2606
2711
  DstackAppFullResponseV20260121Schema,
2607
2712
  DstackAppMinimalResponseV20260121Schema
2608
2713
  ]);
2609
- var DstackAppListResponseV20260121Schema = z39.object({
2610
- dstack_apps: z39.array(DstackAppWithCvmResponseV20260121Schema),
2611
- page: z39.number().int(),
2612
- page_size: z39.number().int(),
2613
- total: z39.number().int(),
2614
- total_pages: z39.number().int()
2714
+ var DstackAppListResponseV20260121Schema = z44.object({
2715
+ dstack_apps: z44.array(DstackAppWithCvmResponseV20260121Schema),
2716
+ page: z44.number().int(),
2717
+ page_size: z44.number().int(),
2718
+ total: z44.number().int(),
2719
+ total_pages: z44.number().int()
2615
2720
  });
2616
2721
 
2617
2722
  // src/types/app_revision.ts
2618
- import { z as z40 } from "zod";
2619
- var CvmRefSchema = z40.object({
2620
- object_type: z40.literal("cvm"),
2621
- id: z40.string().nullable().optional(),
2622
- name: z40.string().nullable().optional(),
2623
- app_id: z40.string().nullable().optional(),
2624
- vm_uuid: z40.string().nullable().optional()
2723
+ import { z as z45 } from "zod";
2724
+ var CvmRefSchema = z45.object({
2725
+ object_type: z45.literal("cvm"),
2726
+ id: z45.string().nullable().optional(),
2727
+ name: z45.string().nullable().optional(),
2728
+ app_id: z45.string().nullable().optional(),
2729
+ vm_uuid: z45.string().nullable().optional()
2625
2730
  });
2626
- var AppRevisionResponseSchema = z40.object({
2627
- revision_id: z40.string(),
2628
- app_id: z40.string(),
2629
- vm_uuid: z40.string(),
2630
- compose_hash: z40.string(),
2631
- created_at: z40.string(),
2632
- trace_id: z40.string().nullable().optional(),
2633
- operation_type: z40.string(),
2731
+ var AppRevisionResponseSchema = z45.object({
2732
+ revision_id: z45.string(),
2733
+ app_id: z45.string(),
2734
+ vm_uuid: z45.string(),
2735
+ compose_hash: z45.string(),
2736
+ created_at: z45.string(),
2737
+ trace_id: z45.string().nullable().optional(),
2738
+ operation_type: z45.string(),
2634
2739
  triggered_by: UserRefSchema.nullable().optional(),
2635
2740
  cvm: CvmRefSchema.nullable().optional(),
2636
2741
  workspace: WorkspaceRefSchema.nullable().optional()
2637
2742
  });
2638
- var AppRevisionDetailResponseSchema = z40.object({
2639
- revision_id: z40.string(),
2640
- app_id: z40.string(),
2641
- vm_uuid: z40.string(),
2642
- compose_hash: z40.string(),
2643
- compose_file: z40.union([z40.record(z40.any()), z40.string()]).nullable().optional(),
2644
- encrypted_env: z40.string(),
2645
- user_config: z40.string(),
2646
- created_at: z40.string(),
2647
- trace_id: z40.string().nullable().optional(),
2648
- operation_type: z40.string(),
2743
+ var AppRevisionDetailResponseSchema = z45.object({
2744
+ revision_id: z45.string(),
2745
+ app_id: z45.string(),
2746
+ vm_uuid: z45.string(),
2747
+ compose_hash: z45.string(),
2748
+ compose_file: z45.union([z45.record(z45.any()), z45.string()]).nullable().optional(),
2749
+ encrypted_env: z45.string(),
2750
+ user_config: z45.string(),
2751
+ created_at: z45.string(),
2752
+ trace_id: z45.string().nullable().optional(),
2753
+ operation_type: z45.string(),
2649
2754
  triggered_by: UserRefSchema.nullable().optional(),
2650
2755
  cvm: CvmRefSchema.nullable().optional(),
2651
2756
  workspace: WorkspaceRefSchema.nullable().optional()
2652
2757
  });
2653
- var AppRevisionsResponseSchema = z40.object({
2654
- revisions: z40.array(AppRevisionResponseSchema),
2655
- total: z40.number().int(),
2656
- page: z40.number().int(),
2657
- page_size: z40.number().int(),
2658
- total_pages: z40.number().int()
2758
+ var AppRevisionsResponseSchema = z45.object({
2759
+ revisions: z45.array(AppRevisionResponseSchema),
2760
+ total: z45.number().int(),
2761
+ page: z45.number().int(),
2762
+ page_size: z45.number().int(),
2763
+ total_pages: z45.number().int()
2659
2764
  });
2660
2765
 
2661
2766
  // src/actions/blockchains/deploy_app_auth.ts
2662
- import { z as z41 } from "zod";
2767
+ import { z as z46 } from "zod";
2663
2768
  import {
2664
2769
  createPublicClient as createPublicClient2,
2665
2770
  createWalletClient as createWalletClient2,
@@ -3320,25 +3425,25 @@ var kmsAuthAbi = [
3320
3425
  anonymous: false
3321
3426
  }
3322
3427
  ];
3323
- var DeployAppAuthRequestBaseSchema = z41.object({
3428
+ var DeployAppAuthRequestBaseSchema = z46.object({
3324
3429
  // Chain configuration (conditionally required)
3325
- chain: z41.unknown().optional(),
3326
- rpcUrl: z41.string().optional(),
3430
+ chain: z46.unknown().optional(),
3431
+ rpcUrl: z46.string().optional(),
3327
3432
  // Contract configuration (required)
3328
- kmsContractAddress: z41.string(),
3433
+ kmsContractAddress: z46.string(),
3329
3434
  // Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
3330
- privateKey: z41.string().optional(),
3331
- walletClient: z41.unknown().optional(),
3435
+ privateKey: z46.string().optional(),
3436
+ walletClient: z46.unknown().optional(),
3332
3437
  // Public client (optional, will create default if not provided)
3333
- publicClient: z41.unknown().optional(),
3438
+ publicClient: z46.unknown().optional(),
3334
3439
  // App configuration (optional)
3335
- allowAnyDevice: z41.boolean().optional().default(false),
3336
- deviceId: z41.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3337
- composeHash: z41.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3338
- disableUpgrades: z41.boolean().optional().default(false),
3440
+ allowAnyDevice: z46.boolean().optional().default(false),
3441
+ deviceId: z46.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3442
+ composeHash: z46.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3443
+ disableUpgrades: z46.boolean().optional().default(false),
3339
3444
  // Validation configuration (optional)
3340
- skipPrerequisiteChecks: z41.boolean().optional().default(false),
3341
- minBalance: z41.string().optional()
3445
+ skipPrerequisiteChecks: z46.boolean().optional().default(false),
3446
+ minBalance: z46.string().optional()
3342
3447
  // ETH amount as string, e.g., "0.01"
3343
3448
  }).passthrough();
3344
3449
  var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
@@ -3366,13 +3471,13 @@ var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
3366
3471
  path: ["chain"]
3367
3472
  }
3368
3473
  );
3369
- var DeployAppAuthSchema = z41.object({
3370
- appId: z41.string(),
3371
- appAuthAddress: z41.string(),
3372
- deployer: z41.string(),
3373
- transactionHash: z41.string(),
3374
- blockNumber: z41.bigint().optional(),
3375
- gasUsed: z41.bigint().optional()
3474
+ var DeployAppAuthSchema = z46.object({
3475
+ appId: z46.string(),
3476
+ appAuthAddress: z46.string(),
3477
+ deployer: z46.string(),
3478
+ transactionHash: z46.string(),
3479
+ blockNumber: z46.bigint().optional(),
3480
+ gasUsed: z46.bigint().optional()
3376
3481
  }).passthrough();
3377
3482
  function parseDeploymentResult(receipt, deployer, kmsContractAddress) {
3378
3483
  try {
@@ -3618,7 +3723,7 @@ async function safeDeployAppAuth(request, parameters) {
3618
3723
  }
3619
3724
 
3620
3725
  // src/actions/blockchains/add_compose_hash.ts
3621
- import { z as z42 } from "zod";
3726
+ import { z as z47 } from "zod";
3622
3727
  import {
3623
3728
  createPublicClient as createPublicClient3,
3624
3729
  createWalletClient as createWalletClient3,
@@ -3642,29 +3747,29 @@ var appAuthAbi = [
3642
3747
  anonymous: false
3643
3748
  }
3644
3749
  ];
3645
- var AddComposeHashRequestSchema = z42.object({
3750
+ var AddComposeHashRequestSchema = z47.object({
3646
3751
  // Chain configuration (conditionally required)
3647
- chain: z42.unknown().optional(),
3648
- rpcUrl: z42.string().optional(),
3649
- appId: z42.string(),
3650
- composeHash: z42.string(),
3752
+ chain: z47.unknown().optional(),
3753
+ rpcUrl: z47.string().optional(),
3754
+ appId: z47.string(),
3755
+ composeHash: z47.string(),
3651
3756
  // Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
3652
- privateKey: z42.string().optional(),
3653
- walletClient: z42.unknown().optional(),
3757
+ privateKey: z47.string().optional(),
3758
+ walletClient: z47.unknown().optional(),
3654
3759
  // Public client (optional, will create default if not provided)
3655
- publicClient: z42.unknown().optional(),
3760
+ publicClient: z47.unknown().optional(),
3656
3761
  // Validation configuration (optional)
3657
- skipPrerequisiteChecks: z42.boolean().optional().default(false),
3658
- minBalance: z42.string().optional(),
3762
+ skipPrerequisiteChecks: z47.boolean().optional().default(false),
3763
+ minBalance: z47.string().optional(),
3659
3764
  // ETH amount as string, e.g., "0.01"
3660
3765
  // Transaction control options
3661
- timeout: z42.number().optional().default(12e4),
3662
- retryOptions: z42.unknown().optional(),
3663
- signal: z42.unknown().optional(),
3766
+ timeout: z47.number().optional().default(12e4),
3767
+ retryOptions: z47.unknown().optional(),
3768
+ signal: z47.unknown().optional(),
3664
3769
  // Progress callbacks
3665
- onTransactionStateChange: z42.function().optional(),
3666
- onTransactionSubmitted: z42.function().optional(),
3667
- onTransactionConfirmed: z42.function().optional()
3770
+ onTransactionStateChange: z47.function().optional(),
3771
+ onTransactionSubmitted: z47.function().optional(),
3772
+ onTransactionConfirmed: z47.function().optional()
3668
3773
  }).passthrough().refine(
3669
3774
  (data) => {
3670
3775
  const hasPrivateKey = !!data.privateKey;
@@ -3688,12 +3793,12 @@ var AddComposeHashRequestSchema = z42.object({
3688
3793
  path: ["chain"]
3689
3794
  }
3690
3795
  );
3691
- var AddComposeHashSchema = z42.object({
3692
- composeHash: z42.string(),
3693
- appId: z42.string(),
3694
- transactionHash: z42.string(),
3695
- blockNumber: z42.bigint().optional(),
3696
- gasUsed: z42.bigint().optional()
3796
+ var AddComposeHashSchema = z47.object({
3797
+ composeHash: z47.string(),
3798
+ appId: z47.string(),
3799
+ transactionHash: z47.string(),
3800
+ blockNumber: z47.bigint().optional(),
3801
+ gasUsed: z47.bigint().optional()
3697
3802
  }).passthrough();
3698
3803
  function parseComposeHashResult(receipt, composeHash, appAuthAddress, appId) {
3699
3804
  console.log(receipt.logs);
@@ -3885,15 +3990,15 @@ async function safeAddComposeHash(request, parameters) {
3885
3990
  }
3886
3991
 
3887
3992
  // src/actions/workspaces/get_workspace_nodes.ts
3888
- import { z as z43 } from "zod";
3993
+ import { z as z48 } from "zod";
3889
3994
  var NodeRefSchema2 = NodeRefSchema;
3890
3995
  var NodeInfoSchema = NodeRefSchema2;
3891
- var GetWorkspaceNodesSchema = z43.object({
3892
- items: z43.array(NodeRefSchema2),
3893
- total: z43.number(),
3894
- page: z43.number(),
3895
- page_size: z43.number(),
3896
- pages: z43.number()
3996
+ var GetWorkspaceNodesSchema = z48.object({
3997
+ items: z48.array(NodeRefSchema2),
3998
+ total: z48.number(),
3999
+ page: z48.number(),
4000
+ page_size: z48.number(),
4001
+ pages: z48.number()
3897
4002
  }).passthrough();
3898
4003
  var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAction(GetWorkspaceNodesSchema, async (client, request) => {
3899
4004
  const { teamSlug, page, pageSize } = request;
@@ -3905,42 +4010,42 @@ var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAct
3905
4010
  });
3906
4011
 
3907
4012
  // src/actions/workspaces/get_workspace_quotas.ts
3908
- import { z as z44 } from "zod";
3909
- var QuotaMetricSchema = z44.object({
3910
- limit: z44.number(),
3911
- remaining: z44.number()
4013
+ import { z as z49 } from "zod";
4014
+ var QuotaMetricSchema = z49.object({
4015
+ limit: z49.number(),
4016
+ remaining: z49.number()
3912
4017
  }).passthrough();
3913
- var WorkspaceQuotasSchema = z44.object({
4018
+ var WorkspaceQuotasSchema = z49.object({
3914
4019
  vm_slots: QuotaMetricSchema,
3915
4020
  vcpu: QuotaMetricSchema,
3916
4021
  memory_mb: QuotaMetricSchema,
3917
4022
  disk_gb: QuotaMetricSchema
3918
4023
  }).passthrough();
3919
- var WorkspaceReservedGpuQuotaSchema = z44.object({
4024
+ var WorkspaceReservedGpuQuotaSchema = z49.object({
3920
4025
  gpus: QuotaMetricSchema,
3921
- in_use: z44.number(),
3922
- misconfigured: z44.number()
4026
+ in_use: z49.number(),
4027
+ misconfigured: z49.number()
3923
4028
  }).passthrough();
3924
- var GetWorkspaceQuotasSchema = z44.object({
3925
- team_slug: z44.string(),
3926
- tier: z44.string(),
4029
+ var GetWorkspaceQuotasSchema = z49.object({
4030
+ team_slug: z49.string(),
4031
+ tier: z49.string(),
3927
4032
  quotas: WorkspaceQuotasSchema,
3928
4033
  reserved_nodes: QuotaMetricSchema,
3929
4034
  reserved_gpu: WorkspaceReservedGpuQuotaSchema,
3930
- as_of: z44.string()
4035
+ as_of: z49.string()
3931
4036
  }).passthrough();
3932
4037
  var { action: getWorkspaceQuotas, safeAction: safeGetWorkspaceQuotas } = defineAction(GetWorkspaceQuotasSchema, async (client, request) => {
3933
4038
  return await client.get(`/workspaces/${request.teamSlug}/quotas`);
3934
4039
  });
3935
4040
 
3936
4041
  // src/actions/cvms/watch_cvm_state.ts
3937
- import { z as z45 } from "zod";
3938
- var WatchCvmStateParamsSchema = z45.object({
3939
- target: z45.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
3940
- interval: z45.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
3941
- timeout: z45.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
3942
- maxRetries: z45.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
3943
- retryDelay: z45.number().min(0).default(5e3).describe("Delay between retries in milliseconds")
4042
+ import { z as z50 } from "zod";
4043
+ var WatchCvmStateParamsSchema = z50.object({
4044
+ target: z50.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
4045
+ interval: z50.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
4046
+ timeout: z50.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
4047
+ maxRetries: z50.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
4048
+ retryDelay: z50.number().min(0).default(5e3).describe("Delay between retries in milliseconds")
3944
4049
  });
3945
4050
  var WatchCvmStateRequestSchema = WatchCvmStateParamsSchema;
3946
4051
  var WatchAbortedError = class extends Error {
@@ -4128,41 +4233,54 @@ function sleep(ms, signal) {
4128
4233
  }
4129
4234
 
4130
4235
  // src/actions/cvms/get_cvm_status_batch.ts
4131
- import { z as z46 } from "zod";
4132
- var CvmStatusSchema = z46.object({
4133
- vm_uuid: z46.string(),
4134
- status: z46.string(),
4135
- uptime: z46.string().nullable().optional(),
4136
- in_progress: z46.boolean(),
4137
- boot_progress: z46.string().nullable().optional(),
4138
- boot_error: z46.string().nullable().optional(),
4139
- operation_type: z46.string().nullable().optional(),
4140
- operation_started_at: z46.string().nullable().optional(),
4141
- correlation_id: z46.string().nullable().optional()
4236
+ import { z as z51 } from "zod";
4237
+ var CvmStatusSchema = z51.object({
4238
+ vm_uuid: z51.string(),
4239
+ status: z51.string(),
4240
+ uptime: z51.string().nullable().optional(),
4241
+ in_progress: z51.boolean(),
4242
+ boot_progress: z51.string().nullable().optional(),
4243
+ boot_error: z51.string().nullable().optional(),
4244
+ operation_type: z51.string().nullable().optional(),
4245
+ operation_started_at: z51.string().nullable().optional(),
4246
+ correlation_id: z51.string().nullable().optional()
4142
4247
  });
4143
- var GetCvmStatusBatchResponseSchema = z46.record(z46.string(), CvmStatusSchema);
4144
- var GetCvmStatusBatchRequestSchema = z46.object({
4145
- vmUuids: z46.array(z46.string())
4248
+ var GetCvmStatusBatchResponseSchema = z51.record(z51.string(), CvmStatusSchema);
4249
+ var GetCvmStatusBatchRequestSchema = z51.object({
4250
+ vmUuids: z51.array(z51.string())
4146
4251
  });
4147
4252
  var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
4148
4253
  const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
4149
4254
  return await client.post("/status/batch", { vm_uuids: vmUuids });
4150
4255
  });
4151
4256
 
4257
+ // src/actions/cvms/get_cvm_user_config.ts
4258
+ import { z as z52 } from "zod";
4259
+ var CvmUserConfigSchema = z52.object({
4260
+ hostname: z52.string().nullable().optional(),
4261
+ ssh_authorized_keys: z52.array(z52.string()).default([]),
4262
+ default_gateway_domain: z52.string().nullable().optional()
4263
+ });
4264
+ var GetCvmUserConfigRequestSchema = CvmIdSchema;
4265
+ var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineAction(CvmUserConfigSchema, async (client, request) => {
4266
+ const { cvmId } = GetCvmUserConfigRequestSchema.parse(request);
4267
+ return await client.get(`/cvms/${cvmId}/user_config`);
4268
+ });
4269
+
4152
4270
  // src/actions/apps/get_app_list.ts
4153
- import { z as z47 } from "zod";
4154
- var GetAppListRequestSchema = z47.object({
4155
- page: z47.number().int().min(1).optional(),
4156
- page_size: z47.number().int().min(1).max(100).optional(),
4157
- search: z47.string().optional(),
4158
- status: z47.array(z47.string()).optional(),
4159
- listed: z47.boolean().optional(),
4160
- base_image: z47.string().optional(),
4161
- instance_type: z47.string().optional(),
4162
- kms_slug: z47.string().optional(),
4163
- kms_type: z47.string().optional(),
4164
- node: z47.string().optional(),
4165
- region: z47.string().optional()
4271
+ import { z as z53 } from "zod";
4272
+ var GetAppListRequestSchema = z53.object({
4273
+ page: z53.number().int().min(1).optional(),
4274
+ page_size: z53.number().int().min(1).max(100).optional(),
4275
+ search: z53.string().optional(),
4276
+ status: z53.array(z53.string()).optional(),
4277
+ listed: z53.boolean().optional(),
4278
+ base_image: z53.string().optional(),
4279
+ instance_type: z53.string().optional(),
4280
+ kms_slug: z53.string().optional(),
4281
+ kms_type: z53.string().optional(),
4282
+ node: z53.string().optional(),
4283
+ region: z53.string().optional()
4166
4284
  }).strict();
4167
4285
  function getSchemaForVersion4(version) {
4168
4286
  return version === "2025-10-28" ? DstackAppListResponseV20251028Schema : DstackAppListResponseV20260121Schema;
@@ -4192,9 +4310,9 @@ async function safeGetAppList(client, request) {
4192
4310
  }
4193
4311
 
4194
4312
  // src/actions/apps/get_app_info.ts
4195
- import { z as z48 } from "zod";
4196
- var GetAppInfoRequestSchema = z48.object({
4197
- appId: z48.string().min(1)
4313
+ import { z as z54 } from "zod";
4314
+ var GetAppInfoRequestSchema = z54.object({
4315
+ appId: z54.string().min(1)
4198
4316
  }).strict();
4199
4317
  function getSchemaForVersion5(version) {
4200
4318
  return version === "2025-10-28" ? DstackAppWithCvmResponseV20251028Schema : DstackAppWithCvmResponseV20260121Schema;
@@ -4224,12 +4342,12 @@ async function safeGetAppInfo(client, request) {
4224
4342
  }
4225
4343
 
4226
4344
  // src/actions/apps/get_app_cvms.ts
4227
- import { z as z49 } from "zod";
4228
- var GetAppCvmsRequestSchema = z49.object({
4229
- appId: z49.string().min(1)
4345
+ import { z as z55 } from "zod";
4346
+ var GetAppCvmsRequestSchema = z55.object({
4347
+ appId: z55.string().min(1)
4230
4348
  }).strict();
4231
4349
  function getSchemaForVersion6(version) {
4232
- return version === "2025-10-28" ? z49.array(CvmInfoV20251028Schema) : z49.array(CvmInfoV20260121Schema);
4350
+ return version === "2025-10-28" ? z55.array(CvmInfoV20251028Schema) : z55.array(CvmInfoV20260121Schema);
4233
4351
  }
4234
4352
  async function getAppCvms(client, request) {
4235
4353
  const { appId } = GetAppCvmsRequestSchema.parse(request);
@@ -4256,11 +4374,11 @@ async function safeGetAppCvms(client, request) {
4256
4374
  }
4257
4375
 
4258
4376
  // src/actions/apps/get_app_revisions.ts
4259
- import { z as z50 } from "zod";
4260
- var GetAppRevisionsRequestSchema = z50.object({
4261
- appId: z50.string().min(1),
4262
- page: z50.number().int().min(1).optional(),
4263
- page_size: z50.number().int().min(1).max(1e3).optional()
4377
+ import { z as z56 } from "zod";
4378
+ var GetAppRevisionsRequestSchema = z56.object({
4379
+ appId: z56.string().min(1),
4380
+ page: z56.number().int().min(1).optional(),
4381
+ page_size: z56.number().int().min(1).max(1e3).optional()
4264
4382
  }).strict();
4265
4383
  async function getAppRevisions(client, request) {
4266
4384
  const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
@@ -4286,11 +4404,11 @@ async function safeGetAppRevisions(client, request) {
4286
4404
  }
4287
4405
 
4288
4406
  // src/actions/apps/get_app_revision_detail.ts
4289
- import { z as z51 } from "zod";
4290
- var GetAppRevisionDetailRequestSchema = z51.object({
4291
- appId: z51.string().min(1),
4292
- revisionId: z51.string().min(1),
4293
- rawComposeFile: z51.boolean().optional()
4407
+ import { z as z57 } from "zod";
4408
+ var GetAppRevisionDetailRequestSchema = z57.object({
4409
+ appId: z57.string().min(1),
4410
+ revisionId: z57.string().min(1),
4411
+ rawComposeFile: z57.boolean().optional()
4294
4412
  }).strict();
4295
4413
  async function getAppRevisionDetail(client, request) {
4296
4414
  const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
@@ -4317,15 +4435,15 @@ async function safeGetAppRevisionDetail(client, request) {
4317
4435
  }
4318
4436
 
4319
4437
  // src/actions/apps/get_app_filter_options.ts
4320
- import { z as z52 } from "zod";
4321
- var AppFilterOptionsSchema = z52.object({
4322
- statuses: z52.array(z52.string()),
4323
- image_versions: z52.array(z52.string()),
4324
- instance_types: z52.array(z52.string()),
4325
- kms_slugs: z52.array(z52.string()),
4326
- kms_types: z52.array(z52.string()),
4327
- regions: z52.array(z52.string()),
4328
- nodes: z52.array(z52.string())
4438
+ import { z as z58 } from "zod";
4439
+ var AppFilterOptionsSchema = z58.object({
4440
+ statuses: z58.array(z58.string()),
4441
+ image_versions: z58.array(z58.string()),
4442
+ instance_types: z58.array(z58.string()),
4443
+ kms_slugs: z58.array(z58.string()),
4444
+ kms_types: z58.array(z58.string()),
4445
+ regions: z58.array(z58.string()),
4446
+ nodes: z58.array(z58.string())
4329
4447
  });
4330
4448
  async function getAppFilterOptions(client) {
4331
4449
  const response = await client.get("/apps/filter-options");
@@ -4404,6 +4522,7 @@ export {
4404
4522
  CommitCvmComposeFileUpdateSchema,
4405
4523
  CommitCvmProvisionRequestSchema,
4406
4524
  CommitCvmProvisionSchema,
4525
+ CreateSshKeyRequestSchema,
4407
4526
  CreditsInfoSchema,
4408
4527
  CurrentUserV20251028Schema as CurrentUserSchema,
4409
4528
  CurrentUserV20251028Schema,
@@ -4431,7 +4550,9 @@ export {
4431
4550
  CvmStateSchema,
4432
4551
  CvmStatusSchema,
4433
4552
  CvmSystemInfoSchema,
4553
+ CvmUserConfigSchema,
4434
4554
  DeleteCvmRequestSchema,
4555
+ DeleteSshKeyRequestSchema,
4435
4556
  DeployAppAuthRequestSchema,
4436
4557
  DeployAppAuthSchema,
4437
4558
  DstackAppFullResponseV20251028Schema,
@@ -4465,15 +4586,19 @@ export {
4465
4586
  GetCvmStatsRequestSchema,
4466
4587
  GetCvmStatusBatchRequestSchema,
4467
4588
  GetCvmStatusBatchResponseSchema,
4589
+ GetCvmUserConfigRequestSchema,
4468
4590
  GetKmsInfoRequestSchema,
4469
4591
  GetKmsListRequestSchema,
4470
4592
  GetKmsListSchema,
4471
4593
  GetWorkspaceNodesSchema,
4472
4594
  GetWorkspaceQuotasSchema,
4595
+ ImportGithubProfileRequestSchema,
4596
+ ImportGithubProfileResponseSchema,
4473
4597
  InstanceTypeSchema,
4474
4598
  KmsInfoSchema,
4475
4599
  KmsTypeSchema,
4476
4600
  ListFamilyInstanceTypesRequestSchema,
4601
+ ListSshKeysResponseSchema,
4477
4602
  ListWorkspacesSchema,
4478
4603
  LooseAppComposeSchema,
4479
4604
  MAX_COMPOSE_PAYLOAD_BYTES,
@@ -4502,8 +4627,10 @@ export {
4502
4627
  SUPPORTED_CHAINS,
4503
4628
  ServerError,
4504
4629
  ShutdownCvmRequestSchema,
4630
+ SshKeySchema,
4505
4631
  StartCvmRequestSchema,
4506
4632
  StopCvmRequestSchema,
4633
+ SyncGithubSshKeysResponseSchema,
4507
4634
  TransactionError,
4508
4635
  UnknownError,
4509
4636
  UpdateCvmEnvsRequestSchema,
@@ -4542,10 +4669,12 @@ export {
4542
4669
  createClientsFromBrowser,
4543
4670
  createClientsFromPrivateKey,
4544
4671
  createNetworkClients,
4672
+ createSshKey,
4545
4673
  createTransactionTracker,
4546
4674
  defineAction,
4547
4675
  defineSimpleAction,
4548
4676
  deleteCvm,
4677
+ deleteSshKey,
4549
4678
  deployAppAuth,
4550
4679
  dumpAppCompose,
4551
4680
  encryptEnvVars2 as encryptEnvVars,
@@ -4581,6 +4710,7 @@ export {
4581
4710
  getCvmState,
4582
4711
  getCvmStats,
4583
4712
  getCvmStatusBatch,
4713
+ getCvmUserConfig,
4584
4714
  getErrorMessage,
4585
4715
  getKmsInfo,
4586
4716
  getKmsList,
@@ -4588,9 +4718,11 @@ export {
4588
4718
  getWorkspace,
4589
4719
  getWorkspaceNodes,
4590
4720
  getWorkspaceQuotas,
4721
+ importGithubProfileSshKeys,
4591
4722
  isValidHostname,
4592
4723
  listAllInstanceTypeFamilies,
4593
4724
  listFamilyInstanceTypes,
4725
+ listSshKeys,
4594
4726
  listWorkspaces,
4595
4727
  nextAppIds,
4596
4728
  parseApiError,
@@ -4604,7 +4736,9 @@ export {
4604
4736
  safeAddComposeHash,
4605
4737
  safeCommitCvmComposeFileUpdate,
4606
4738
  safeCommitCvmProvision,
4739
+ safeCreateSshKey,
4607
4740
  safeDeleteCvm,
4741
+ safeDeleteSshKey,
4608
4742
  safeDeployAppAuth,
4609
4743
  safeGetAppCvms,
4610
4744
  safeGetAppEnvEncryptPubKey,
@@ -4627,13 +4761,16 @@ export {
4627
4761
  safeGetCvmState,
4628
4762
  safeGetCvmStats,
4629
4763
  safeGetCvmStatusBatch,
4764
+ safeGetCvmUserConfig,
4630
4765
  safeGetKmsInfo,
4631
4766
  safeGetKmsList,
4632
4767
  safeGetWorkspace,
4633
4768
  safeGetWorkspaceNodes,
4634
4769
  safeGetWorkspaceQuotas,
4770
+ safeImportGithubProfileSshKeys,
4635
4771
  safeListAllInstanceTypeFamilies,
4636
4772
  safeListFamilyInstanceTypes,
4773
+ safeListSshKeys,
4637
4774
  safeListWorkspaces,
4638
4775
  safeNextAppIds,
4639
4776
  safeProvisionCvm,
@@ -4642,6 +4779,7 @@ export {
4642
4779
  safeShutdownCvm,
4643
4780
  safeStartCvm,
4644
4781
  safeStopCvm,
4782
+ safeSyncGithubSshKeys,
4645
4783
  safeUpdateCvmEnvs,
4646
4784
  safeUpdateCvmResources,
4647
4785
  safeUpdateCvmVisibility,
@@ -4654,6 +4792,7 @@ export {
4654
4792
  startCvm,
4655
4793
  stopCvm,
4656
4794
  switchToNetwork,
4795
+ syncGithubSshKeys,
4657
4796
  updateCvmEnvs,
4658
4797
  updateCvmResources,
4659
4798
  updateCvmVisibility,