@phala/cloud 0.2.2 → 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
@@ -1466,20 +1466,56 @@ async function safeGetCvmList(client, request) {
1466
1466
  }
1467
1467
 
1468
1468
  // src/actions/cvms/provision_cvm.ts
1469
+ import { z as z13 } from "zod";
1470
+
1471
+ // src/types/app_compose.ts
1469
1472
  import { z as z12 } from "zod";
1470
- var ProvisionCvmSchema = z12.object({
1471
- app_id: z12.string().nullable().optional(),
1472
- app_env_encrypt_pubkey: z12.string().nullable().optional(),
1473
- compose_hash: z12.string(),
1473
+ var MAX_COMPOSE_PAYLOAD_BYTES = 200 * 1024;
1474
+ function validateComposePayloadSize(dockerComposeFile, preLaunchScript, ctx) {
1475
+ const encoder = new TextEncoder();
1476
+ const composeSize = dockerComposeFile ? encoder.encode(dockerComposeFile).byteLength : 0;
1477
+ const scriptSize = preLaunchScript ? encoder.encode(preLaunchScript).byteLength : 0;
1478
+ const totalSize = composeSize + scriptSize;
1479
+ if (totalSize > MAX_COMPOSE_PAYLOAD_BYTES) {
1480
+ const maxKB = MAX_COMPOSE_PAYLOAD_BYTES / 1024;
1481
+ const currentKB = Math.ceil(totalSize / 1024);
1482
+ ctx.addIssue({
1483
+ code: z12.ZodIssueCode.custom,
1484
+ message: `Combined size of docker_compose_file and pre_launch_script must not exceed ${maxKB}KB (current: ${currentKB}KB)`
1485
+ });
1486
+ }
1487
+ }
1488
+ var LooseAppComposeSchema = z12.object({
1489
+ allowed_envs: z12.array(z12.string()).optional(),
1490
+ docker_compose_file: z12.string(),
1491
+ features: z12.array(z12.string()).optional(),
1492
+ name: z12.string().optional(),
1493
+ manifest_version: z12.number().optional(),
1494
+ kms_enabled: z12.boolean().optional(),
1495
+ public_logs: z12.boolean().optional(),
1496
+ public_sysinfo: z12.boolean().optional(),
1497
+ tproxy_enabled: z12.boolean().optional(),
1498
+ pre_launch_script: z12.string().optional(),
1499
+ env_pubkey: z12.string().optional(),
1500
+ salt: z12.string().optional().nullable()
1501
+ }).passthrough().superRefine((data, ctx) => {
1502
+ validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
1503
+ });
1504
+
1505
+ // src/actions/cvms/provision_cvm.ts
1506
+ var ProvisionCvmSchema = z13.object({
1507
+ app_id: z13.string().nullable().optional(),
1508
+ app_env_encrypt_pubkey: z13.string().nullable().optional(),
1509
+ compose_hash: z13.string(),
1474
1510
  kms_info: KmsInfoSchema.nullable().optional(),
1475
- fmspc: z12.string().nullable().optional(),
1476
- device_id: z12.string().nullable().optional(),
1477
- os_image_hash: z12.string().nullable().optional(),
1478
- instance_type: z12.string().nullable().optional(),
1479
- teepod_id: z12.number().nullable().optional(),
1511
+ fmspc: z13.string().nullable().optional(),
1512
+ device_id: z13.string().nullable().optional(),
1513
+ os_image_hash: z13.string().nullable().optional(),
1514
+ instance_type: z13.string().nullable().optional(),
1515
+ teepod_id: z13.number().nullable().optional(),
1480
1516
  // Will be transformed to node_id
1481
- node_id: z12.number().nullable().optional(),
1482
- kms_id: z12.string().nullable().optional()
1517
+ node_id: z13.number().nullable().optional(),
1518
+ kms_id: z13.string().nullable().optional()
1483
1519
  }).passthrough().transform((data) => {
1484
1520
  if ("teepod_id" in data && data.teepod_id !== void 0) {
1485
1521
  const { teepod_id, ...rest } = data;
@@ -1488,47 +1524,49 @@ var ProvisionCvmSchema = z12.object({
1488
1524
  return data;
1489
1525
  });
1490
1526
  var NAME_VALIDATION_MESSAGE = "Name must be 5-63 characters, start with letter, and contain only letters/numbers/hyphens";
1491
- var ProvisionCvmRequestSchema = z12.object({
1492
- node_id: z12.number().optional(),
1527
+ var ProvisionCvmRequestSchema = z13.object({
1528
+ node_id: z13.number().optional(),
1493
1529
  // recommended - optional, system auto-selects if not specified
1494
- teepod_id: z12.number().optional(),
1530
+ teepod_id: z13.number().optional(),
1495
1531
  // deprecated, for compatibility
1496
- region: z12.string().optional(),
1532
+ region: z13.string().optional(),
1497
1533
  // optional - region filter for auto-selection
1498
- name: z12.string().min(5, NAME_VALIDATION_MESSAGE).max(63, NAME_VALIDATION_MESSAGE).refine((val) => isValidHostname(val), NAME_VALIDATION_MESSAGE),
1499
- instance_type: z12.string().optional(),
1534
+ name: z13.string().min(5, NAME_VALIDATION_MESSAGE).max(63, NAME_VALIDATION_MESSAGE).refine((val) => isValidHostname(val), NAME_VALIDATION_MESSAGE),
1535
+ instance_type: z13.string().optional(),
1500
1536
  // optional, defaults to "tdx.small" when no resource params specified
1501
- image: z12.string().optional(),
1502
- vcpu: z12.number().optional(),
1537
+ image: z13.string().optional(),
1538
+ vcpu: z13.number().optional(),
1503
1539
  // deprecated, use instance_type instead
1504
- memory: z12.number().optional(),
1540
+ memory: z13.number().optional(),
1505
1541
  // deprecated, use instance_type instead
1506
- disk_size: z12.number().optional(),
1507
- compose_file: z12.object({
1508
- allowed_envs: z12.array(z12.string()).optional(),
1509
- pre_launch_script: z12.string().optional(),
1510
- docker_compose_file: z12.string().optional(),
1511
- name: z12.string().optional().default(""),
1542
+ disk_size: z13.number().optional(),
1543
+ compose_file: z13.object({
1544
+ allowed_envs: z13.array(z13.string()).optional(),
1545
+ pre_launch_script: z13.string().optional(),
1546
+ docker_compose_file: z13.string().optional(),
1547
+ name: z13.string().optional().default(""),
1512
1548
  // optional with default empty string
1513
- kms_enabled: z12.boolean().optional(),
1514
- public_logs: z12.boolean().optional(),
1515
- public_sysinfo: z12.boolean().optional(),
1516
- gateway_enabled: z12.boolean().optional(),
1549
+ kms_enabled: z13.boolean().optional(),
1550
+ public_logs: z13.boolean().optional(),
1551
+ public_sysinfo: z13.boolean().optional(),
1552
+ gateway_enabled: z13.boolean().optional(),
1517
1553
  // recommended
1518
- tproxy_enabled: z12.boolean().optional()
1554
+ tproxy_enabled: z13.boolean().optional()
1519
1555
  // deprecated, for compatibility
1556
+ }).superRefine((data, ctx) => {
1557
+ validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
1520
1558
  }),
1521
- listed: z12.boolean().optional(),
1522
- kms_id: z12.string().optional(),
1523
- kms: z12.enum(["PHALA", "ETHEREUM", "BASE"]).optional(),
1559
+ listed: z13.boolean().optional(),
1560
+ kms_id: z13.string().optional(),
1561
+ kms: z13.enum(["PHALA", "ETHEREUM", "BASE"]).optional(),
1524
1562
  // KMS type selection (defaults to PHALA)
1525
- kms_contract: z12.string().optional(),
1563
+ kms_contract: z13.string().optional(),
1526
1564
  // KMS contract address for on-chain KMS
1527
- env_keys: z12.array(z12.string()).optional(),
1565
+ env_keys: z13.array(z13.string()).optional(),
1528
1566
  // Manual nonce specification (Advanced - PHALA KMS only)
1529
- nonce: z12.number().optional(),
1567
+ nonce: z13.number().optional(),
1530
1568
  // User-specified nonce for deterministic app_id generation
1531
- app_id: z12.string().optional()
1569
+ app_id: z13.string().optional()
1532
1570
  // Expected app_id (must match calculated app_id from nonce)
1533
1571
  }).passthrough().transform((data) => {
1534
1572
  if (!data.instance_type && !data.vcpu && !data.memory) {
@@ -1571,66 +1609,49 @@ var { action: provisionCvm, safeAction: safeProvisionCvm } = defineAction(Provis
1571
1609
  });
1572
1610
 
1573
1611
  // src/actions/cvms/commit_cvm_provision.ts
1574
- import { z as z13 } from "zod";
1575
- var CommitCvmProvisionSchema = z13.object({
1576
- id: z13.number(),
1577
- name: z13.string(),
1578
- status: z13.string(),
1579
- teepod_id: z13.number(),
1580
- teepod: z13.object({
1581
- id: z13.number(),
1582
- name: z13.string()
1612
+ import { z as z14 } from "zod";
1613
+ var CommitCvmProvisionSchema = z14.object({
1614
+ id: z14.number(),
1615
+ name: z14.string(),
1616
+ status: z14.string(),
1617
+ teepod_id: z14.number(),
1618
+ teepod: z14.object({
1619
+ id: z14.number(),
1620
+ name: z14.string()
1583
1621
  }).nullable(),
1584
- user_id: z13.number().nullable(),
1585
- app_id: z13.string().nullable(),
1586
- vm_uuid: z13.string().nullable(),
1587
- instance_id: z13.string().nullable(),
1622
+ user_id: z14.number().nullable(),
1623
+ app_id: z14.string().nullable(),
1624
+ vm_uuid: z14.string().nullable(),
1625
+ instance_id: z14.string().nullable(),
1588
1626
  // Deprecated fields - will be removed in next API version
1589
- app_url: z13.string().nullable().default(null),
1590
- base_image: z13.string().nullable(),
1591
- vcpu: z13.number(),
1592
- memory: z13.number(),
1593
- disk_size: z13.number(),
1594
- manifest_version: z13.number().nullable().default(2),
1595
- version: z13.string().nullable().default("1.0.0"),
1596
- runner: z13.string().nullable().default("docker-compose"),
1597
- docker_compose_file: z13.string().nullable(),
1598
- features: z13.array(z13.string()).nullable().default(["kms", "tproxy-net"]),
1599
- created_at: z13.string(),
1600
- encrypted_env_pubkey: z13.string().nullable().optional(),
1601
- app_auth_contract_address: z13.string().nullable().optional(),
1602
- deployer_address: z13.string().nullable().optional()
1627
+ app_url: z14.string().nullable().default(null),
1628
+ base_image: z14.string().nullable(),
1629
+ vcpu: z14.number(),
1630
+ memory: z14.number(),
1631
+ disk_size: z14.number(),
1632
+ manifest_version: z14.number().nullable().default(2),
1633
+ version: z14.string().nullable().default("1.0.0"),
1634
+ runner: z14.string().nullable().default("docker-compose"),
1635
+ docker_compose_file: z14.string().nullable(),
1636
+ features: z14.array(z14.string()).nullable().default(["kms", "tproxy-net"]),
1637
+ created_at: z14.string(),
1638
+ encrypted_env_pubkey: z14.string().nullable().optional(),
1639
+ app_auth_contract_address: z14.string().nullable().optional(),
1640
+ deployer_address: z14.string().nullable().optional()
1603
1641
  }).passthrough();
1604
- var CommitCvmProvisionRequestSchema = z13.object({
1605
- encrypted_env: z13.string().optional().nullable(),
1606
- app_id: z13.string(),
1607
- compose_hash: z13.string(),
1608
- kms_id: z13.string().optional(),
1609
- contract_address: z13.string().optional(),
1610
- deployer_address: z13.string().optional(),
1611
- env_keys: z13.array(z13.string()).optional().nullable()
1642
+ var CommitCvmProvisionRequestSchema = z14.object({
1643
+ encrypted_env: z14.string().optional().nullable(),
1644
+ app_id: z14.string(),
1645
+ compose_hash: z14.string(),
1646
+ kms_id: z14.string().optional(),
1647
+ contract_address: z14.string().optional(),
1648
+ deployer_address: z14.string().optional(),
1649
+ env_keys: z14.array(z14.string()).optional().nullable()
1612
1650
  }).passthrough();
1613
1651
  var { action: commitCvmProvision, safeAction: safeCommitCvmProvision } = defineAction(CommitCvmProvisionSchema, async (client, payload) => {
1614
1652
  return await client.post("/cvms", payload);
1615
1653
  });
1616
1654
 
1617
- // src/types/app_compose.ts
1618
- import { z as z14 } from "zod";
1619
- var LooseAppComposeSchema = z14.object({
1620
- allowed_envs: z14.array(z14.string()).optional(),
1621
- docker_compose_file: z14.string(),
1622
- features: z14.array(z14.string()).optional(),
1623
- name: z14.string().optional(),
1624
- manifest_version: z14.number().optional(),
1625
- kms_enabled: z14.boolean().optional(),
1626
- public_logs: z14.boolean().optional(),
1627
- public_sysinfo: z14.boolean().optional(),
1628
- tproxy_enabled: z14.boolean().optional(),
1629
- pre_launch_script: z14.string().optional(),
1630
- env_pubkey: z14.string().optional(),
1631
- salt: z14.string().optional().nullable()
1632
- }).passthrough();
1633
-
1634
1655
  // src/utils/get_compose_hash.ts
1635
1656
  import crypto from "crypto";
1636
1657
  function sortObject(obj) {
@@ -2332,14 +2353,19 @@ import { z as z34 } from "zod";
2332
2353
  var UpdateCvmVisibilityRequestSchema = refineCvmId(
2333
2354
  CvmIdObjectSchema.extend({
2334
2355
  public_sysinfo: z34.boolean(),
2335
- public_logs: z34.boolean()
2356
+ public_logs: z34.boolean(),
2357
+ public_tcbinfo: z34.boolean().optional()
2336
2358
  })
2337
2359
  );
2338
2360
  var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defineAction(CvmDetailV20251028Schema, async (client, request) => {
2339
2361
  const parsed = UpdateCvmVisibilityRequestSchema.parse(request);
2340
2362
  const { cvmId } = CvmIdSchema.parse(parsed);
2341
- const { public_sysinfo, public_logs } = parsed;
2342
- return await client.patch(`/cvms/${cvmId}/visibility`, { public_sysinfo, public_logs });
2363
+ const { public_sysinfo, public_logs, public_tcbinfo } = parsed;
2364
+ return await client.patch(`/cvms/${cvmId}/visibility`, {
2365
+ public_sysinfo,
2366
+ public_logs,
2367
+ public_tcbinfo
2368
+ });
2343
2369
  });
2344
2370
 
2345
2371
  // src/actions/cvms/get_available_os_images.ts
@@ -2398,6 +2424,101 @@ var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmState
2398
2424
  return await client.get(`/cvms/${cvmId}/state`);
2399
2425
  });
2400
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
+
2401
2522
  // src/create-client.ts
2402
2523
  function createClient2(config = {}) {
2403
2524
  const client = createClient(config);
@@ -2473,152 +2594,177 @@ function createClient2(config = {}) {
2473
2594
  nextAppIds,
2474
2595
  safeNextAppIds,
2475
2596
  getCvmState,
2476
- safeGetCvmState
2597
+ safeGetCvmState,
2598
+ listSshKeys,
2599
+ safeListSshKeys,
2600
+ importGithubProfileSshKeys,
2601
+ safeImportGithubProfileSshKeys,
2602
+ createSshKey,
2603
+ safeCreateSshKey,
2604
+ deleteSshKey,
2605
+ safeDeleteSshKey,
2606
+ syncGithubSshKeys,
2607
+ safeSyncGithubSshKeys
2477
2608
  };
2478
2609
  return client.extend(allActions);
2479
2610
  }
2480
2611
 
2481
2612
  // src/types/app_info_v20251028.ts
2482
- import { z as z38 } from "zod";
2483
- var CvmBasicInfoV20251028Schema = z38.object({
2484
- vm_uuid: z38.string().nullable(),
2485
- app_id: z38.string(),
2486
- name: z38.string().default(""),
2487
- status: z38.string(),
2488
- vcpu: z38.number().int(),
2489
- memory: z38.number().int(),
2490
- disk_size: z38.number().int(),
2491
- teepod_id: z38.number().int(),
2492
- teepod_name: z38.string(),
2493
- region_identifier: z38.string().nullable().optional(),
2494
- kms_type: z38.string().nullable().optional(),
2495
- instance_type: z38.string().nullable().optional(),
2496
- listed: z38.boolean().nullable().optional(),
2497
- base_image: z38.string().nullable().optional(),
2498
- kms_slug: z38.string().nullable().optional(),
2499
- kms_id: z38.string().nullable().optional(),
2500
- 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(),
2501
2632
  machine_info: MachineInfoV20251028Schema.nullable().optional(),
2502
- updated_at: z38.string().nullable().optional()
2633
+ updated_at: z43.string().nullable().optional()
2503
2634
  });
2504
- var DstackAppFullResponseV20251028Schema = z38.object({
2505
- id: z38.string(),
2506
- name: z38.string(),
2507
- app_id: z38.string(),
2508
- app_provision_type: z38.string().nullable().optional(),
2509
- app_icon_url: z38.string().nullable().optional(),
2510
- created_at: z38.string(),
2511
- kms_type: z38.string(),
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()
2640
+ });
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(),
2649
+ profile: AppProfileSchema.nullable().optional(),
2512
2650
  current_cvm: CvmBasicInfoV20251028Schema.nullable().optional(),
2513
- cvms: z38.array(CvmBasicInfoV20251028Schema).default([]),
2514
- cvm_count: z38.number().int().default(0)
2651
+ cvms: z43.array(CvmBasicInfoV20251028Schema).default([]),
2652
+ cvm_count: z43.number().int().default(0)
2515
2653
  });
2516
- var DstackAppMinimalResponseV20251028Schema = z38.object({
2517
- id: z38.null().optional(),
2518
- app_id: z38.string(),
2519
- name: z38.null().optional(),
2520
- app_provision_type: z38.null().optional(),
2521
- app_icon_url: z38.null().optional(),
2522
- created_at: z38.null().optional(),
2523
- kms_type: z38.null().optional(),
2524
- current_cvm: z38.null().optional(),
2525
- cvms: z38.null().optional(),
2526
- 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()
2527
2665
  });
2528
- var DstackAppWithCvmResponseV20251028Schema = z38.union([
2666
+ var DstackAppWithCvmResponseV20251028Schema = z43.union([
2529
2667
  DstackAppFullResponseV20251028Schema,
2530
2668
  DstackAppMinimalResponseV20251028Schema
2531
2669
  ]);
2532
- var DstackAppListResponseV20251028Schema = z38.object({
2533
- dstack_apps: z38.array(DstackAppWithCvmResponseV20251028Schema),
2534
- page: z38.number().int(),
2535
- page_size: z38.number().int(),
2536
- total: z38.number().int(),
2537
- 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()
2538
2676
  });
2539
2677
 
2540
2678
  // src/types/app_info_v20260121.ts
2541
- import { z as z39 } from "zod";
2542
- var DstackAppFullResponseV20260121Schema = z39.object({
2543
- id: z39.string(),
2544
- name: z39.string(),
2545
- app_id: z39.string(),
2546
- app_provision_type: z39.string().nullable().optional(),
2547
- app_icon_url: z39.string().nullable().optional(),
2548
- created_at: z39.string(),
2549
- kms_type: z39.string(),
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()
2693
+ }).nullable().optional(),
2550
2694
  current_cvm: CvmInfoV20260121Schema.nullable().optional(),
2551
- cvms: z39.array(CvmInfoV20260121Schema).default([]),
2552
- cvm_count: z39.number().int().default(0)
2695
+ cvms: z44.array(CvmInfoV20260121Schema).default([]),
2696
+ cvm_count: z44.number().int().default(0)
2553
2697
  });
2554
- var DstackAppMinimalResponseV20260121Schema = z39.object({
2555
- id: z39.null().optional(),
2556
- app_id: z39.string(),
2557
- name: z39.null().optional(),
2558
- app_provision_type: z39.null().optional(),
2559
- app_icon_url: z39.null().optional(),
2560
- created_at: z39.null().optional(),
2561
- kms_type: z39.null().optional(),
2562
- current_cvm: z39.null().optional(),
2563
- cvms: z39.null().optional(),
2564
- 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()
2565
2709
  });
2566
- var DstackAppWithCvmResponseV20260121Schema = z39.union([
2710
+ var DstackAppWithCvmResponseV20260121Schema = z44.union([
2567
2711
  DstackAppFullResponseV20260121Schema,
2568
2712
  DstackAppMinimalResponseV20260121Schema
2569
2713
  ]);
2570
- var DstackAppListResponseV20260121Schema = z39.object({
2571
- dstack_apps: z39.array(DstackAppWithCvmResponseV20260121Schema),
2572
- page: z39.number().int(),
2573
- page_size: z39.number().int(),
2574
- total: z39.number().int(),
2575
- 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()
2576
2720
  });
2577
2721
 
2578
2722
  // src/types/app_revision.ts
2579
- import { z as z40 } from "zod";
2580
- var CvmRefSchema = z40.object({
2581
- object_type: z40.literal("cvm"),
2582
- id: z40.string().nullable().optional(),
2583
- name: z40.string().nullable().optional(),
2584
- app_id: z40.string().nullable().optional(),
2585
- 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()
2586
2730
  });
2587
- var AppRevisionResponseSchema = z40.object({
2588
- app_id: z40.string(),
2589
- vm_uuid: z40.string(),
2590
- compose_hash: z40.string(),
2591
- created_at: z40.string(),
2592
- trace_id: z40.string().nullable().optional(),
2593
- 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(),
2594
2739
  triggered_by: UserRefSchema.nullable().optional(),
2595
2740
  cvm: CvmRefSchema.nullable().optional(),
2596
2741
  workspace: WorkspaceRefSchema.nullable().optional()
2597
2742
  });
2598
- var AppRevisionDetailResponseSchema = z40.object({
2599
- app_id: z40.string(),
2600
- vm_uuid: z40.string(),
2601
- compose_hash: z40.string(),
2602
- compose_file: z40.union([z40.record(z40.any()), z40.string()]).nullable().optional(),
2603
- encrypted_env: z40.string(),
2604
- user_config: z40.string(),
2605
- created_at: z40.string(),
2606
- trace_id: z40.string().nullable().optional(),
2607
- 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(),
2608
2754
  triggered_by: UserRefSchema.nullable().optional(),
2609
2755
  cvm: CvmRefSchema.nullable().optional(),
2610
2756
  workspace: WorkspaceRefSchema.nullable().optional()
2611
2757
  });
2612
- var AppRevisionsResponseSchema = z40.object({
2613
- revisions: z40.array(AppRevisionResponseSchema),
2614
- total: z40.number().int(),
2615
- page: z40.number().int(),
2616
- page_size: z40.number().int(),
2617
- 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()
2618
2764
  });
2619
2765
 
2620
2766
  // src/actions/blockchains/deploy_app_auth.ts
2621
- import { z as z41 } from "zod";
2767
+ import { z as z46 } from "zod";
2622
2768
  import {
2623
2769
  createPublicClient as createPublicClient2,
2624
2770
  createWalletClient as createWalletClient2,
@@ -3279,25 +3425,25 @@ var kmsAuthAbi = [
3279
3425
  anonymous: false
3280
3426
  }
3281
3427
  ];
3282
- var DeployAppAuthRequestBaseSchema = z41.object({
3428
+ var DeployAppAuthRequestBaseSchema = z46.object({
3283
3429
  // Chain configuration (conditionally required)
3284
- chain: z41.unknown().optional(),
3285
- rpcUrl: z41.string().optional(),
3430
+ chain: z46.unknown().optional(),
3431
+ rpcUrl: z46.string().optional(),
3286
3432
  // Contract configuration (required)
3287
- kmsContractAddress: z41.string(),
3433
+ kmsContractAddress: z46.string(),
3288
3434
  // Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
3289
- privateKey: z41.string().optional(),
3290
- walletClient: z41.unknown().optional(),
3435
+ privateKey: z46.string().optional(),
3436
+ walletClient: z46.unknown().optional(),
3291
3437
  // Public client (optional, will create default if not provided)
3292
- publicClient: z41.unknown().optional(),
3438
+ publicClient: z46.unknown().optional(),
3293
3439
  // App configuration (optional)
3294
- allowAnyDevice: z41.boolean().optional().default(false),
3295
- deviceId: z41.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3296
- composeHash: z41.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
3297
- 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),
3298
3444
  // Validation configuration (optional)
3299
- skipPrerequisiteChecks: z41.boolean().optional().default(false),
3300
- minBalance: z41.string().optional()
3445
+ skipPrerequisiteChecks: z46.boolean().optional().default(false),
3446
+ minBalance: z46.string().optional()
3301
3447
  // ETH amount as string, e.g., "0.01"
3302
3448
  }).passthrough();
3303
3449
  var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
@@ -3325,13 +3471,13 @@ var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
3325
3471
  path: ["chain"]
3326
3472
  }
3327
3473
  );
3328
- var DeployAppAuthSchema = z41.object({
3329
- appId: z41.string(),
3330
- appAuthAddress: z41.string(),
3331
- deployer: z41.string(),
3332
- transactionHash: z41.string(),
3333
- blockNumber: z41.bigint().optional(),
3334
- 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()
3335
3481
  }).passthrough();
3336
3482
  function parseDeploymentResult(receipt, deployer, kmsContractAddress) {
3337
3483
  try {
@@ -3577,7 +3723,7 @@ async function safeDeployAppAuth(request, parameters) {
3577
3723
  }
3578
3724
 
3579
3725
  // src/actions/blockchains/add_compose_hash.ts
3580
- import { z as z42 } from "zod";
3726
+ import { z as z47 } from "zod";
3581
3727
  import {
3582
3728
  createPublicClient as createPublicClient3,
3583
3729
  createWalletClient as createWalletClient3,
@@ -3601,29 +3747,29 @@ var appAuthAbi = [
3601
3747
  anonymous: false
3602
3748
  }
3603
3749
  ];
3604
- var AddComposeHashRequestSchema = z42.object({
3750
+ var AddComposeHashRequestSchema = z47.object({
3605
3751
  // Chain configuration (conditionally required)
3606
- chain: z42.unknown().optional(),
3607
- rpcUrl: z42.string().optional(),
3608
- appId: z42.string(),
3609
- composeHash: z42.string(),
3752
+ chain: z47.unknown().optional(),
3753
+ rpcUrl: z47.string().optional(),
3754
+ appId: z47.string(),
3755
+ composeHash: z47.string(),
3610
3756
  // Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
3611
- privateKey: z42.string().optional(),
3612
- walletClient: z42.unknown().optional(),
3757
+ privateKey: z47.string().optional(),
3758
+ walletClient: z47.unknown().optional(),
3613
3759
  // Public client (optional, will create default if not provided)
3614
- publicClient: z42.unknown().optional(),
3760
+ publicClient: z47.unknown().optional(),
3615
3761
  // Validation configuration (optional)
3616
- skipPrerequisiteChecks: z42.boolean().optional().default(false),
3617
- minBalance: z42.string().optional(),
3762
+ skipPrerequisiteChecks: z47.boolean().optional().default(false),
3763
+ minBalance: z47.string().optional(),
3618
3764
  // ETH amount as string, e.g., "0.01"
3619
3765
  // Transaction control options
3620
- timeout: z42.number().optional().default(12e4),
3621
- retryOptions: z42.unknown().optional(),
3622
- signal: z42.unknown().optional(),
3766
+ timeout: z47.number().optional().default(12e4),
3767
+ retryOptions: z47.unknown().optional(),
3768
+ signal: z47.unknown().optional(),
3623
3769
  // Progress callbacks
3624
- onTransactionStateChange: z42.function().optional(),
3625
- onTransactionSubmitted: z42.function().optional(),
3626
- onTransactionConfirmed: z42.function().optional()
3770
+ onTransactionStateChange: z47.function().optional(),
3771
+ onTransactionSubmitted: z47.function().optional(),
3772
+ onTransactionConfirmed: z47.function().optional()
3627
3773
  }).passthrough().refine(
3628
3774
  (data) => {
3629
3775
  const hasPrivateKey = !!data.privateKey;
@@ -3647,12 +3793,12 @@ var AddComposeHashRequestSchema = z42.object({
3647
3793
  path: ["chain"]
3648
3794
  }
3649
3795
  );
3650
- var AddComposeHashSchema = z42.object({
3651
- composeHash: z42.string(),
3652
- appId: z42.string(),
3653
- transactionHash: z42.string(),
3654
- blockNumber: z42.bigint().optional(),
3655
- 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()
3656
3802
  }).passthrough();
3657
3803
  function parseComposeHashResult(receipt, composeHash, appAuthAddress, appId) {
3658
3804
  console.log(receipt.logs);
@@ -3844,15 +3990,15 @@ async function safeAddComposeHash(request, parameters) {
3844
3990
  }
3845
3991
 
3846
3992
  // src/actions/workspaces/get_workspace_nodes.ts
3847
- import { z as z43 } from "zod";
3993
+ import { z as z48 } from "zod";
3848
3994
  var NodeRefSchema2 = NodeRefSchema;
3849
3995
  var NodeInfoSchema = NodeRefSchema2;
3850
- var GetWorkspaceNodesSchema = z43.object({
3851
- items: z43.array(NodeRefSchema2),
3852
- total: z43.number(),
3853
- page: z43.number(),
3854
- page_size: z43.number(),
3855
- 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()
3856
4002
  }).passthrough();
3857
4003
  var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAction(GetWorkspaceNodesSchema, async (client, request) => {
3858
4004
  const { teamSlug, page, pageSize } = request;
@@ -3864,42 +4010,42 @@ var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAct
3864
4010
  });
3865
4011
 
3866
4012
  // src/actions/workspaces/get_workspace_quotas.ts
3867
- import { z as z44 } from "zod";
3868
- var QuotaMetricSchema = z44.object({
3869
- limit: z44.number(),
3870
- remaining: z44.number()
4013
+ import { z as z49 } from "zod";
4014
+ var QuotaMetricSchema = z49.object({
4015
+ limit: z49.number(),
4016
+ remaining: z49.number()
3871
4017
  }).passthrough();
3872
- var WorkspaceQuotasSchema = z44.object({
4018
+ var WorkspaceQuotasSchema = z49.object({
3873
4019
  vm_slots: QuotaMetricSchema,
3874
4020
  vcpu: QuotaMetricSchema,
3875
4021
  memory_mb: QuotaMetricSchema,
3876
4022
  disk_gb: QuotaMetricSchema
3877
4023
  }).passthrough();
3878
- var WorkspaceReservedGpuQuotaSchema = z44.object({
4024
+ var WorkspaceReservedGpuQuotaSchema = z49.object({
3879
4025
  gpus: QuotaMetricSchema,
3880
- in_use: z44.number(),
3881
- misconfigured: z44.number()
4026
+ in_use: z49.number(),
4027
+ misconfigured: z49.number()
3882
4028
  }).passthrough();
3883
- var GetWorkspaceQuotasSchema = z44.object({
3884
- team_slug: z44.string(),
3885
- tier: z44.string(),
4029
+ var GetWorkspaceQuotasSchema = z49.object({
4030
+ team_slug: z49.string(),
4031
+ tier: z49.string(),
3886
4032
  quotas: WorkspaceQuotasSchema,
3887
4033
  reserved_nodes: QuotaMetricSchema,
3888
4034
  reserved_gpu: WorkspaceReservedGpuQuotaSchema,
3889
- as_of: z44.string()
4035
+ as_of: z49.string()
3890
4036
  }).passthrough();
3891
4037
  var { action: getWorkspaceQuotas, safeAction: safeGetWorkspaceQuotas } = defineAction(GetWorkspaceQuotasSchema, async (client, request) => {
3892
4038
  return await client.get(`/workspaces/${request.teamSlug}/quotas`);
3893
4039
  });
3894
4040
 
3895
4041
  // src/actions/cvms/watch_cvm_state.ts
3896
- import { z as z45 } from "zod";
3897
- var WatchCvmStateParamsSchema = z45.object({
3898
- target: z45.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
3899
- interval: z45.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
3900
- timeout: z45.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
3901
- maxRetries: z45.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
3902
- 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")
3903
4049
  });
3904
4050
  var WatchCvmStateRequestSchema = WatchCvmStateParamsSchema;
3905
4051
  var WatchAbortedError = class extends Error {
@@ -4087,41 +4233,54 @@ function sleep(ms, signal) {
4087
4233
  }
4088
4234
 
4089
4235
  // src/actions/cvms/get_cvm_status_batch.ts
4090
- import { z as z46 } from "zod";
4091
- var CvmStatusSchema = z46.object({
4092
- vm_uuid: z46.string(),
4093
- status: z46.string(),
4094
- uptime: z46.string().nullable().optional(),
4095
- in_progress: z46.boolean(),
4096
- boot_progress: z46.string().nullable().optional(),
4097
- boot_error: z46.string().nullable().optional(),
4098
- operation_type: z46.string().nullable().optional(),
4099
- operation_started_at: z46.string().nullable().optional(),
4100
- 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()
4101
4247
  });
4102
- var GetCvmStatusBatchResponseSchema = z46.record(z46.string(), CvmStatusSchema);
4103
- var GetCvmStatusBatchRequestSchema = z46.object({
4104
- vmUuids: z46.array(z46.string())
4248
+ var GetCvmStatusBatchResponseSchema = z51.record(z51.string(), CvmStatusSchema);
4249
+ var GetCvmStatusBatchRequestSchema = z51.object({
4250
+ vmUuids: z51.array(z51.string())
4105
4251
  });
4106
4252
  var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
4107
4253
  const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
4108
4254
  return await client.post("/status/batch", { vm_uuids: vmUuids });
4109
4255
  });
4110
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
+
4111
4270
  // src/actions/apps/get_app_list.ts
4112
- import { z as z47 } from "zod";
4113
- var GetAppListRequestSchema = z47.object({
4114
- page: z47.number().int().min(1).optional(),
4115
- page_size: z47.number().int().min(1).max(100).optional(),
4116
- search: z47.string().optional(),
4117
- status: z47.array(z47.string()).optional(),
4118
- listed: z47.boolean().optional(),
4119
- base_image: z47.string().optional(),
4120
- instance_type: z47.string().optional(),
4121
- kms_slug: z47.string().optional(),
4122
- kms_type: z47.string().optional(),
4123
- teepod_name: z47.string().optional(),
4124
- 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()
4125
4284
  }).strict();
4126
4285
  function getSchemaForVersion4(version) {
4127
4286
  return version === "2025-10-28" ? DstackAppListResponseV20251028Schema : DstackAppListResponseV20260121Schema;
@@ -4151,9 +4310,9 @@ async function safeGetAppList(client, request) {
4151
4310
  }
4152
4311
 
4153
4312
  // src/actions/apps/get_app_info.ts
4154
- import { z as z48 } from "zod";
4155
- var GetAppInfoRequestSchema = z48.object({
4156
- appId: z48.string().min(1)
4313
+ import { z as z54 } from "zod";
4314
+ var GetAppInfoRequestSchema = z54.object({
4315
+ appId: z54.string().min(1)
4157
4316
  }).strict();
4158
4317
  function getSchemaForVersion5(version) {
4159
4318
  return version === "2025-10-28" ? DstackAppWithCvmResponseV20251028Schema : DstackAppWithCvmResponseV20260121Schema;
@@ -4183,12 +4342,12 @@ async function safeGetAppInfo(client, request) {
4183
4342
  }
4184
4343
 
4185
4344
  // src/actions/apps/get_app_cvms.ts
4186
- import { z as z49 } from "zod";
4187
- var GetAppCvmsRequestSchema = z49.object({
4188
- appId: z49.string().min(1)
4345
+ import { z as z55 } from "zod";
4346
+ var GetAppCvmsRequestSchema = z55.object({
4347
+ appId: z55.string().min(1)
4189
4348
  }).strict();
4190
4349
  function getSchemaForVersion6(version) {
4191
- return version === "2025-10-28" ? z49.array(CvmInfoV20251028Schema) : z49.array(CvmInfoV20260121Schema);
4350
+ return version === "2025-10-28" ? z55.array(CvmInfoV20251028Schema) : z55.array(CvmInfoV20260121Schema);
4192
4351
  }
4193
4352
  async function getAppCvms(client, request) {
4194
4353
  const { appId } = GetAppCvmsRequestSchema.parse(request);
@@ -4215,11 +4374,11 @@ async function safeGetAppCvms(client, request) {
4215
4374
  }
4216
4375
 
4217
4376
  // src/actions/apps/get_app_revisions.ts
4218
- import { z as z50 } from "zod";
4219
- var GetAppRevisionsRequestSchema = z50.object({
4220
- appId: z50.string().min(1),
4221
- page: z50.number().int().min(1).optional(),
4222
- 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()
4223
4382
  }).strict();
4224
4383
  async function getAppRevisions(client, request) {
4225
4384
  const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
@@ -4245,16 +4404,16 @@ async function safeGetAppRevisions(client, request) {
4245
4404
  }
4246
4405
 
4247
4406
  // src/actions/apps/get_app_revision_detail.ts
4248
- import { z as z51 } from "zod";
4249
- var GetAppRevisionDetailRequestSchema = z51.object({
4250
- appId: z51.string().min(1),
4251
- composeHash: z51.string().min(1),
4252
- 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()
4253
4412
  }).strict();
4254
4413
  async function getAppRevisionDetail(client, request) {
4255
- const { appId, composeHash, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
4414
+ const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
4256
4415
  const params = rawComposeFile !== void 0 ? { raw_compose_file: rawComposeFile } : void 0;
4257
- const response = await client.get(`/apps/${appId}/revisions/${composeHash}`, { params });
4416
+ const response = await client.get(`/apps/${appId}/revisions/${revisionId}`, { params });
4258
4417
  return AppRevisionDetailResponseSchema.parse(response);
4259
4418
  }
4260
4419
  async function safeGetAppRevisionDetail(client, request) {
@@ -4275,6 +4434,39 @@ async function safeGetAppRevisionDetail(client, request) {
4275
4434
  }
4276
4435
  }
4277
4436
 
4437
+ // src/actions/apps/get_app_filter_options.ts
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())
4447
+ });
4448
+ async function getAppFilterOptions(client) {
4449
+ const response = await client.get("/apps/filter-options");
4450
+ return AppFilterOptionsSchema.parse(response);
4451
+ }
4452
+ async function safeGetAppFilterOptions(client) {
4453
+ try {
4454
+ const data = await getAppFilterOptions(client);
4455
+ return { success: true, data };
4456
+ } catch (error) {
4457
+ if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
4458
+ return { success: false, error };
4459
+ }
4460
+ return {
4461
+ success: false,
4462
+ error: {
4463
+ name: "Error",
4464
+ message: error instanceof Error ? error.message : String(error)
4465
+ }
4466
+ };
4467
+ }
4468
+ }
4469
+
4278
4470
  // src/parse_dotenv.ts
4279
4471
  var LINE = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/gm;
4280
4472
  function parseEnv(input) {
@@ -4316,6 +4508,8 @@ export {
4316
4508
  AddComposeHashSchema,
4317
4509
  AllFamiliesResponseSchema,
4318
4510
  ApiErrorSchema,
4511
+ AppFilterOptionsSchema,
4512
+ AppProfileSchema,
4319
4513
  AppRevisionDetailResponseSchema,
4320
4514
  AppRevisionResponseSchema,
4321
4515
  AppRevisionsResponseSchema,
@@ -4328,6 +4522,7 @@ export {
4328
4522
  CommitCvmComposeFileUpdateSchema,
4329
4523
  CommitCvmProvisionRequestSchema,
4330
4524
  CommitCvmProvisionSchema,
4525
+ CreateSshKeyRequestSchema,
4331
4526
  CreditsInfoSchema,
4332
4527
  CurrentUserV20251028Schema as CurrentUserSchema,
4333
4528
  CurrentUserV20251028Schema,
@@ -4355,7 +4550,9 @@ export {
4355
4550
  CvmStateSchema,
4356
4551
  CvmStatusSchema,
4357
4552
  CvmSystemInfoSchema,
4553
+ CvmUserConfigSchema,
4358
4554
  DeleteCvmRequestSchema,
4555
+ DeleteSshKeyRequestSchema,
4359
4556
  DeployAppAuthRequestSchema,
4360
4557
  DeployAppAuthSchema,
4361
4558
  DstackAppFullResponseV20251028Schema,
@@ -4389,16 +4586,22 @@ export {
4389
4586
  GetCvmStatsRequestSchema,
4390
4587
  GetCvmStatusBatchRequestSchema,
4391
4588
  GetCvmStatusBatchResponseSchema,
4589
+ GetCvmUserConfigRequestSchema,
4392
4590
  GetKmsInfoRequestSchema,
4393
4591
  GetKmsListRequestSchema,
4394
4592
  GetKmsListSchema,
4395
4593
  GetWorkspaceNodesSchema,
4396
4594
  GetWorkspaceQuotasSchema,
4595
+ ImportGithubProfileRequestSchema,
4596
+ ImportGithubProfileResponseSchema,
4397
4597
  InstanceTypeSchema,
4398
4598
  KmsInfoSchema,
4399
4599
  KmsTypeSchema,
4400
4600
  ListFamilyInstanceTypesRequestSchema,
4601
+ ListSshKeysResponseSchema,
4401
4602
  ListWorkspacesSchema,
4603
+ LooseAppComposeSchema,
4604
+ MAX_COMPOSE_PAYLOAD_BYTES,
4402
4605
  MachineInfoV20251028Schema,
4403
4606
  ManagedUserV20251028Schema,
4404
4607
  MaxRetriesExceededError,
@@ -4424,8 +4627,10 @@ export {
4424
4627
  SUPPORTED_CHAINS,
4425
4628
  ServerError,
4426
4629
  ShutdownCvmRequestSchema,
4630
+ SshKeySchema,
4427
4631
  StartCvmRequestSchema,
4428
4632
  StopCvmRequestSchema,
4633
+ SyncGithubSshKeysResponseSchema,
4429
4634
  TransactionError,
4430
4635
  UnknownError,
4431
4636
  UpdateCvmEnvsRequestSchema,
@@ -4464,10 +4669,12 @@ export {
4464
4669
  createClientsFromBrowser,
4465
4670
  createClientsFromPrivateKey,
4466
4671
  createNetworkClients,
4672
+ createSshKey,
4467
4673
  createTransactionTracker,
4468
4674
  defineAction,
4469
4675
  defineSimpleAction,
4470
4676
  deleteCvm,
4677
+ deleteSshKey,
4471
4678
  deployAppAuth,
4472
4679
  dumpAppCompose,
4473
4680
  encryptEnvVars2 as encryptEnvVars,
@@ -4483,6 +4690,7 @@ export {
4483
4690
  generateFallbackHostname,
4484
4691
  getAppCvms,
4485
4692
  getAppEnvEncryptPubKey,
4693
+ getAppFilterOptions,
4486
4694
  getAppInfo,
4487
4695
  getAppList,
4488
4696
  getAppRevisionDetail,
@@ -4502,6 +4710,7 @@ export {
4502
4710
  getCvmState,
4503
4711
  getCvmStats,
4504
4712
  getCvmStatusBatch,
4713
+ getCvmUserConfig,
4505
4714
  getErrorMessage,
4506
4715
  getKmsInfo,
4507
4716
  getKmsList,
@@ -4509,9 +4718,11 @@ export {
4509
4718
  getWorkspace,
4510
4719
  getWorkspaceNodes,
4511
4720
  getWorkspaceQuotas,
4721
+ importGithubProfileSshKeys,
4512
4722
  isValidHostname,
4513
4723
  listAllInstanceTypeFamilies,
4514
4724
  listFamilyInstanceTypes,
4725
+ listSshKeys,
4515
4726
  listWorkspaces,
4516
4727
  nextAppIds,
4517
4728
  parseApiError,
@@ -4525,10 +4736,13 @@ export {
4525
4736
  safeAddComposeHash,
4526
4737
  safeCommitCvmComposeFileUpdate,
4527
4738
  safeCommitCvmProvision,
4739
+ safeCreateSshKey,
4528
4740
  safeDeleteCvm,
4741
+ safeDeleteSshKey,
4529
4742
  safeDeployAppAuth,
4530
4743
  safeGetAppCvms,
4531
4744
  safeGetAppEnvEncryptPubKey,
4745
+ safeGetAppFilterOptions,
4532
4746
  safeGetAppInfo,
4533
4747
  safeGetAppList,
4534
4748
  safeGetAppRevisionDetail,
@@ -4547,13 +4761,16 @@ export {
4547
4761
  safeGetCvmState,
4548
4762
  safeGetCvmStats,
4549
4763
  safeGetCvmStatusBatch,
4764
+ safeGetCvmUserConfig,
4550
4765
  safeGetKmsInfo,
4551
4766
  safeGetKmsList,
4552
4767
  safeGetWorkspace,
4553
4768
  safeGetWorkspaceNodes,
4554
4769
  safeGetWorkspaceQuotas,
4770
+ safeImportGithubProfileSshKeys,
4555
4771
  safeListAllInstanceTypeFamilies,
4556
4772
  safeListFamilyInstanceTypes,
4773
+ safeListSshKeys,
4557
4774
  safeListWorkspaces,
4558
4775
  safeNextAppIds,
4559
4776
  safeProvisionCvm,
@@ -4562,6 +4779,7 @@ export {
4562
4779
  safeShutdownCvm,
4563
4780
  safeStartCvm,
4564
4781
  safeStopCvm,
4782
+ safeSyncGithubSshKeys,
4565
4783
  safeUpdateCvmEnvs,
4566
4784
  safeUpdateCvmResources,
4567
4785
  safeUpdateCvmVisibility,
@@ -4574,6 +4792,7 @@ export {
4574
4792
  startCvm,
4575
4793
  stopCvm,
4576
4794
  switchToNetwork,
4795
+ syncGithubSshKeys,
4577
4796
  updateCvmEnvs,
4578
4797
  updateCvmResources,
4579
4798
  updateCvmVisibility,
@@ -4581,6 +4800,7 @@ export {
4581
4800
  updateOsImage,
4582
4801
  updatePreLaunchScript,
4583
4802
  validateActionParameters,
4803
+ validateComposePayloadSize,
4584
4804
  validateNetworkPrerequisites,
4585
4805
  verifyEnvEncryptPublicKey,
4586
4806
  waitForTransactionReceipt,