@phala/cloud 0.2.10 → 0.4.0
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/actions/apps/check_app_cvms_is_allowed.d.ts +100 -161
- package/dist/actions/apps/check_app_is_allowed.d.ts +14 -14
- package/dist/actions/apps/create_app_instance.d.ts +22 -22
- package/dist/actions/apps/get_app_attestation.d.ts +43 -33
- package/dist/actions/apps/get_app_device_allowlist.d.ts +51 -50
- package/dist/actions/apps/get_app_list.d.ts +2 -2
- package/dist/actions/cvms/check_cvm_is_allowed.d.ts +40 -102
- package/dist/actions/cvms/commit_cvm_compose_file_update.d.ts +12 -12
- package/dist/actions/cvms/commit_cvm_provision.d.ts +11 -135
- package/dist/actions/cvms/commit_cvm_update.d.ts +2 -2
- package/dist/actions/cvms/confirm_cvm_patch.d.ts +2 -2
- package/dist/actions/cvms/delete_cvm.d.ts +2 -2
- package/dist/actions/cvms/get_available_os_images.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_attestation.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_compose_file.d.ts +166 -22
- package/dist/actions/cvms/get_cvm_containers_stats.d.ts +10 -10
- package/dist/actions/cvms/get_cvm_docker_compose.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_info.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_list.d.ts +8 -10
- package/dist/actions/cvms/get_cvm_network.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_prelaunch_script.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_state.d.ts +6 -6
- package/dist/actions/cvms/get_cvm_stats.d.ts +2 -2
- package/dist/actions/cvms/get_cvm_status_batch.d.ts +253 -30
- package/dist/actions/cvms/get_cvm_user_config.d.ts +2 -2
- package/dist/actions/cvms/get_prelaunch_script_upgrade_status.d.ts +2 -2
- package/dist/actions/cvms/patch_cvm.d.ts +34 -18
- package/dist/actions/cvms/provision_cvm.d.ts +900 -51
- package/dist/actions/cvms/provision_cvm_compose_file_update.d.ts +253 -43
- package/dist/actions/cvms/refresh_cvm_instance_id.d.ts +27 -58
- package/dist/actions/cvms/refresh_cvm_instance_ids.d.ts +120 -165
- package/dist/actions/cvms/replicate_cvm.d.ts +7 -72
- package/dist/actions/cvms/restart_cvm.d.ts +7 -72
- package/dist/actions/cvms/shutdown_cvm.d.ts +9 -72
- package/dist/actions/cvms/start_cvm.d.ts +7 -72
- package/dist/actions/cvms/stop_cvm.d.ts +7 -72
- package/dist/actions/cvms/update_cvm_envs.d.ts +36 -20
- package/dist/actions/cvms/update_cvm_resources.d.ts +26 -4
- package/dist/actions/cvms/update_cvm_visibility.d.ts +26 -24
- package/dist/actions/cvms/update_docker_compose.d.ts +51 -20
- package/dist/actions/cvms/update_os_image.d.ts +2 -2
- package/dist/actions/cvms/update_prelaunch_script.d.ts +51 -20
- package/dist/actions/cvms/upgrade_prelaunch_script.d.ts +36 -20
- package/dist/actions/get_available_nodes.d.ts +259 -0
- package/dist/actions/get_cvm_create_resources.d.ts +351 -0
- package/dist/actions/index.d.ts +6 -2
- package/dist/actions/kms/get_kms_contract.d.ts +59 -0
- package/dist/actions/kms/get_kms_list.d.ts +25 -10
- package/dist/actions/kms/get_kms_onchain_detail.d.ts +54 -0
- package/dist/actions/kms/list_kms_contract_nodes.d.ts +98 -0
- package/dist/actions/kms/list_kms_contracts.d.ts +152 -0
- package/dist/actions/kms/next_app_ids.d.ts +6 -6
- package/dist/actions/list-instance-types.d.ts +12 -12
- package/dist/actions/ssh_keys/create_ssh_key.d.ts +2 -2
- package/dist/actions/ssh_keys/list_ssh_keys.d.ts +4 -4
- package/dist/actions/workspaces/get_workspace.d.ts +4 -0
- package/dist/actions/workspaces/get_workspace_nodes.d.ts +175 -14
- package/dist/actions/workspaces/list_workspaces.d.ts +126 -0
- package/dist/client.d.ts +4 -1
- package/dist/create-client.d.ts +48 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1779 -1250
- package/dist/index.mjs +1704 -1194
- package/dist/types/app_compose.d.ts +50 -5
- package/dist/types/app_info_v20251028.d.ts +172 -128
- package/dist/types/app_info_v20260121.d.ts +2814 -490
- package/dist/types/app_revision.d.ts +8 -8
- package/dist/types/client.d.ts +2 -2
- package/dist/types/cvm_id.d.ts +6 -6
- package/dist/types/cvm_info.d.ts +98 -98
- package/dist/types/cvm_info_v20251028.d.ts +70 -47
- package/dist/types/cvm_info_v20260121.d.ts +1125 -148
- package/dist/types/kms_contract.d.ts +64 -0
- package/dist/types/kms_info.d.ts +8 -0
- package/dist/types/version-mappings.d.ts +43 -6
- package/dist/utils/error_codes.d.ts +1 -0
- package/dist/utils/errors.d.ts +30 -1
- package/dist/utils/get_compose_hash.d.ts +24 -0
- package/dist/utils/get_mr_config_id.d.ts +55 -0
- package/dist/utils/index.d.ts +3 -2
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -80,6 +80,8 @@ __export(index_exports, {
|
|
|
80
80
|
CvmCreateResourceGraphV20260522Schema: () => CvmCreateResourceGraphV20260522Schema,
|
|
81
81
|
CvmDetailV20251028Schema: () => CvmDetailV20251028Schema,
|
|
82
82
|
CvmGatewayInfoV20260121Schema: () => CvmGatewayInfoV20260121Schema,
|
|
83
|
+
CvmGpuRentalOrderInfoV20260121Schema: () => CvmGpuRentalOrderInfoV20260121Schema,
|
|
84
|
+
CvmHourlyRateV20260121Schema: () => CvmHourlyRateV20260121Schema,
|
|
83
85
|
CvmIdBaseSchema: () => CvmIdBaseSchema,
|
|
84
86
|
CvmIdObjectSchema: () => CvmIdObjectSchema,
|
|
85
87
|
CvmIdSchema: () => CvmIdSchema,
|
|
@@ -98,6 +100,7 @@ __export(index_exports, {
|
|
|
98
100
|
CvmProgressInfoV20260121Schema: () => CvmProgressInfoV20260121Schema,
|
|
99
101
|
CvmRefSchema: () => CvmRefSchema,
|
|
100
102
|
CvmResourceInfoV20260121Schema: () => CvmResourceInfoV20260121Schema,
|
|
103
|
+
CvmResourceUsageSchema: () => CvmResourceUsageSchema,
|
|
101
104
|
CvmStateSchema: () => CvmStateSchema,
|
|
102
105
|
CvmStatusSchema: () => CvmStatusSchema,
|
|
103
106
|
CvmSystemInfoSchema: () => CvmSystemInfoSchema,
|
|
@@ -106,6 +109,7 @@ __export(index_exports, {
|
|
|
106
109
|
DeleteSshKeyRequestSchema: () => DeleteSshKeyRequestSchema,
|
|
107
110
|
DeployAppAuthRequestSchema: () => DeployAppAuthRequestSchema,
|
|
108
111
|
DeployAppAuthSchema: () => DeployAppAuthSchema,
|
|
112
|
+
DeviceIdEntrySchema: () => DeviceIdEntrySchema,
|
|
109
113
|
DstackAppFullResponseV20251028Schema: () => DstackAppFullResponseV20251028Schema,
|
|
110
114
|
DstackAppFullResponseV20260121Schema: () => DstackAppFullResponseV20260121Schema,
|
|
111
115
|
DstackAppFullResponseV20260522Schema: () => DstackAppFullResponseV20260522Schema,
|
|
@@ -144,6 +148,7 @@ __export(index_exports, {
|
|
|
144
148
|
GetCvmStatusBatchRequestSchema: () => GetCvmStatusBatchRequestSchema,
|
|
145
149
|
GetCvmStatusBatchResponseSchema: () => GetCvmStatusBatchResponseSchema,
|
|
146
150
|
GetCvmUserConfigRequestSchema: () => GetCvmUserConfigRequestSchema,
|
|
151
|
+
GetKmsContractRequestSchema: () => GetKmsContractRequestSchema,
|
|
147
152
|
GetKmsInfoRequestSchema: () => GetKmsInfoRequestSchema,
|
|
148
153
|
GetKmsListRequestSchema: () => GetKmsListRequestSchema,
|
|
149
154
|
GetKmsListSchema: () => GetKmsListSchema,
|
|
@@ -160,9 +165,15 @@ __export(index_exports, {
|
|
|
160
165
|
InstanceIdRefreshResultSchema: () => InstanceIdRefreshResultSchema,
|
|
161
166
|
InstanceTypeSchema: () => InstanceTypeSchema,
|
|
162
167
|
IsAllowedResultSchema: () => IsAllowedResultSchema,
|
|
168
|
+
KmsContractInfoSchema: () => KmsContractInfoSchema,
|
|
169
|
+
KmsContractNodeSchema: () => KmsContractNodeSchema,
|
|
163
170
|
KmsInfoSchema: () => KmsInfoSchema,
|
|
164
171
|
KmsTypeSchema: () => KmsTypeSchema,
|
|
165
172
|
ListFamilyInstanceTypesRequestSchema: () => ListFamilyInstanceTypesRequestSchema,
|
|
173
|
+
ListKmsContractNodesRequestSchema: () => ListKmsContractNodesRequestSchema,
|
|
174
|
+
ListKmsContractNodesSchema: () => ListKmsContractNodesSchema,
|
|
175
|
+
ListKmsContractsRequestSchema: () => ListKmsContractsRequestSchema,
|
|
176
|
+
ListKmsContractsSchema: () => ListKmsContractsSchema,
|
|
166
177
|
ListSshKeysResponseSchema: () => ListSshKeysResponseSchema,
|
|
167
178
|
ListWorkspacesSchema: () => ListWorkspacesSchema,
|
|
168
179
|
LooseAppComposeSchema: () => LooseAppComposeSchema,
|
|
@@ -281,6 +292,7 @@ __export(index_exports, {
|
|
|
281
292
|
extractNetworkClients: () => extractNetworkClients,
|
|
282
293
|
formatErrorMessage: () => formatErrorMessage,
|
|
283
294
|
formatStructuredError: () => formatStructuredError,
|
|
295
|
+
formatStructuredErrorDetailValue: () => formatStructuredErrorDetailValue,
|
|
284
296
|
formatValidationErrors: () => formatValidationErrors,
|
|
285
297
|
generateDefaultCvmName: () => generateDefaultCvmName,
|
|
286
298
|
generateFallbackHostname: () => generateFallbackHostname,
|
|
@@ -312,9 +324,12 @@ __export(index_exports, {
|
|
|
312
324
|
getCvmStatusBatch: () => getCvmStatusBatch,
|
|
313
325
|
getCvmUserConfig: () => getCvmUserConfig,
|
|
314
326
|
getErrorMessage: () => getErrorMessage,
|
|
327
|
+
getKmsContract: () => getKmsContract,
|
|
315
328
|
getKmsInfo: () => getKmsInfo,
|
|
316
329
|
getKmsList: () => getKmsList,
|
|
317
330
|
getKmsOnChainDetail: () => getKmsOnChainDetail,
|
|
331
|
+
getMrConfigId: () => getMrConfigId,
|
|
332
|
+
getMrConfigIdV1: () => getMrConfigIdV1,
|
|
318
333
|
getOsImages: () => getOsImages,
|
|
319
334
|
getPreLaunchScriptUpgradeStatus: () => getPreLaunchScriptUpgradeStatus,
|
|
320
335
|
getVMSchemaForVersion: () => getVMSchemaForVersion,
|
|
@@ -328,6 +343,8 @@ __export(index_exports, {
|
|
|
328
343
|
isValidHostname: () => isValidHostname,
|
|
329
344
|
listAllInstanceTypeFamilies: () => listAllInstanceTypeFamilies,
|
|
330
345
|
listFamilyInstanceTypes: () => listFamilyInstanceTypes,
|
|
346
|
+
listKmsContractNodes: () => listKmsContractNodes,
|
|
347
|
+
listKmsContracts: () => listKmsContracts,
|
|
331
348
|
listSshKeys: () => listSshKeys,
|
|
332
349
|
listWorkspaces: () => listWorkspaces,
|
|
333
350
|
nextAppIds: () => nextAppIds,
|
|
@@ -387,6 +404,7 @@ __export(index_exports, {
|
|
|
387
404
|
safeGetCvmStats: () => safeGetCvmStats,
|
|
388
405
|
safeGetCvmStatusBatch: () => safeGetCvmStatusBatch,
|
|
389
406
|
safeGetCvmUserConfig: () => safeGetCvmUserConfig,
|
|
407
|
+
safeGetKmsContract: () => safeGetKmsContract,
|
|
390
408
|
safeGetKmsInfo: () => safeGetKmsInfo,
|
|
391
409
|
safeGetKmsList: () => safeGetKmsList,
|
|
392
410
|
safeGetKmsOnChainDetail: () => safeGetKmsOnChainDetail,
|
|
@@ -398,6 +416,8 @@ __export(index_exports, {
|
|
|
398
416
|
safeImportGithubProfileSshKeys: () => safeImportGithubProfileSshKeys,
|
|
399
417
|
safeListAllInstanceTypeFamilies: () => safeListAllInstanceTypeFamilies,
|
|
400
418
|
safeListFamilyInstanceTypes: () => safeListFamilyInstanceTypes,
|
|
419
|
+
safeListKmsContractNodes: () => safeListKmsContractNodes,
|
|
420
|
+
safeListKmsContracts: () => safeListKmsContracts,
|
|
401
421
|
safeListSshKeys: () => safeListSshKeys,
|
|
402
422
|
safeListWorkspaces: () => safeListWorkspaces,
|
|
403
423
|
safeNextAppIds: () => safeNextAppIds,
|
|
@@ -440,6 +460,8 @@ __export(index_exports, {
|
|
|
440
460
|
validateComposePayloadSize: () => validateComposePayloadSize,
|
|
441
461
|
validateNetworkPrerequisites: () => validateNetworkPrerequisites,
|
|
442
462
|
verifyEnvEncryptPublicKey: () => import_verify_env_encrypt_public_key.verifyEnvEncryptPublicKey,
|
|
463
|
+
verifyEnvEncryptPublicKeyLegacy: () => import_verify_env_encrypt_public_key.verifyEnvEncryptPublicKeyLegacy,
|
|
464
|
+
verifyMrConfigId: () => verifyMrConfigId,
|
|
443
465
|
waitForTransactionReceipt: () => waitForTransactionReceipt,
|
|
444
466
|
watchCvmState: () => watchCvmState,
|
|
445
467
|
withComposeMethods: () => withComposeMethods
|
|
@@ -481,6 +503,13 @@ function extractRequestId(data) {
|
|
|
481
503
|
function extractRequestIdFromResponse(response) {
|
|
482
504
|
return response?.headers?.get("X-Request-ID") ?? void 0;
|
|
483
505
|
}
|
|
506
|
+
function extractRequestMethod(method) {
|
|
507
|
+
if (typeof method !== "string") {
|
|
508
|
+
return void 0;
|
|
509
|
+
}
|
|
510
|
+
const normalized = method.trim().toUpperCase();
|
|
511
|
+
return normalized.length > 0 ? normalized : void 0;
|
|
512
|
+
}
|
|
484
513
|
var PhalaCloudError = class extends Error {
|
|
485
514
|
constructor(message, data) {
|
|
486
515
|
super(message);
|
|
@@ -489,6 +518,9 @@ var PhalaCloudError = class extends Error {
|
|
|
489
518
|
this.statusText = data.statusText;
|
|
490
519
|
this.detail = data.detail;
|
|
491
520
|
this.requestId = data.requestId;
|
|
521
|
+
this.request = data.request;
|
|
522
|
+
this.requestMethod = data.requestMethod;
|
|
523
|
+
this.data = data.data;
|
|
492
524
|
this.code = data.code;
|
|
493
525
|
if (Error.captureStackTrace) {
|
|
494
526
|
Error.captureStackTrace(this, this.constructor);
|
|
@@ -502,12 +534,16 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
502
534
|
statusText: options?.statusText ?? "Unknown Error",
|
|
503
535
|
detail: options?.detail || message,
|
|
504
536
|
requestId: options?.requestId,
|
|
537
|
+
request: options?.request,
|
|
538
|
+
requestMethod: options?.requestMethod,
|
|
539
|
+
data: options?.data,
|
|
505
540
|
code: options?.code
|
|
506
541
|
});
|
|
507
542
|
this.name = "RequestError";
|
|
508
543
|
this.isRequestError = true;
|
|
509
544
|
this.data = options?.data;
|
|
510
545
|
this.request = options?.request;
|
|
546
|
+
this.requestMethod = options?.requestMethod;
|
|
511
547
|
this.response = options?.response;
|
|
512
548
|
this.type = options?.type;
|
|
513
549
|
}
|
|
@@ -518,6 +554,7 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
518
554
|
const bodyRequestId = extractRequestId(error.data);
|
|
519
555
|
const headerRequestId = extractRequestIdFromResponse(error.response);
|
|
520
556
|
const requestId = bodyRequestId ?? headerRequestId;
|
|
557
|
+
const requestMethod = extractRequestMethod(error.options?.method);
|
|
521
558
|
const parseResult = ApiErrorSchema.safeParse(error.data);
|
|
522
559
|
if (parseResult.success) {
|
|
523
560
|
const detail = parseResult.data.detail ?? (error.data && typeof error.data === "object" && "error_code" in error.data ? error.data : void 0);
|
|
@@ -526,6 +563,7 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
526
563
|
statusText: error.statusText ?? void 0,
|
|
527
564
|
data: error.data,
|
|
528
565
|
request: error.request ?? void 0,
|
|
566
|
+
requestMethod,
|
|
529
567
|
response: error.response ?? void 0,
|
|
530
568
|
detail,
|
|
531
569
|
code: parseResult.data.code ?? void 0,
|
|
@@ -541,6 +579,7 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
541
579
|
statusText: "Request Timeout",
|
|
542
580
|
data: error.data,
|
|
543
581
|
request: error.request ?? void 0,
|
|
582
|
+
requestMethod,
|
|
544
583
|
response: error.response ?? void 0,
|
|
545
584
|
detail: message,
|
|
546
585
|
code: "TIMEOUT",
|
|
@@ -552,6 +591,7 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
552
591
|
statusText: error.statusText ?? void 0,
|
|
553
592
|
data: error.data,
|
|
554
593
|
request: error.request ?? void 0,
|
|
594
|
+
requestMethod,
|
|
555
595
|
response: error.response ?? void 0,
|
|
556
596
|
detail: error.data?.detail || error.message || "Unknown API error",
|
|
557
597
|
code: error.status?.toString() ?? void 0,
|
|
@@ -561,9 +601,10 @@ var RequestError = class _RequestError extends PhalaCloudError {
|
|
|
561
601
|
/**
|
|
562
602
|
* Create RequestError from generic Error
|
|
563
603
|
*/
|
|
564
|
-
static fromError(error, request) {
|
|
604
|
+
static fromError(error, request, requestMethod) {
|
|
565
605
|
return new _RequestError(error.message, {
|
|
566
606
|
request: request ?? void 0,
|
|
607
|
+
requestMethod: extractRequestMethod(requestMethod),
|
|
567
608
|
detail: error.message
|
|
568
609
|
});
|
|
569
610
|
}
|
|
@@ -682,6 +723,9 @@ function parseApiError(requestError) {
|
|
|
682
723
|
statusText,
|
|
683
724
|
detail,
|
|
684
725
|
requestId: structured.request_id ?? requestError.requestId,
|
|
726
|
+
request: requestError.request,
|
|
727
|
+
requestMethod: requestError.requestMethod,
|
|
728
|
+
data: requestError.data,
|
|
685
729
|
errorCode: structured.error_code,
|
|
686
730
|
structuredDetails: structured.details,
|
|
687
731
|
suggestions: structured.suggestions,
|
|
@@ -695,6 +739,9 @@ function parseApiError(requestError) {
|
|
|
695
739
|
statusText,
|
|
696
740
|
detail,
|
|
697
741
|
requestId: requestError.requestId,
|
|
742
|
+
request: requestError.request,
|
|
743
|
+
requestMethod: requestError.requestMethod,
|
|
744
|
+
data: requestError.data,
|
|
698
745
|
code: requestError.code
|
|
699
746
|
};
|
|
700
747
|
if (errorType === "validation" && Array.isArray(detail)) {
|
|
@@ -758,6 +805,16 @@ function getErrorMessage(error) {
|
|
|
758
805
|
}
|
|
759
806
|
return "Unknown error occurred";
|
|
760
807
|
}
|
|
808
|
+
function formatStructuredErrorDetailValue(value) {
|
|
809
|
+
if (value === null || value === void 0) return "";
|
|
810
|
+
if (typeof value === "string") return value;
|
|
811
|
+
if (typeof value === "number" || typeof value === "boolean") return String(value);
|
|
812
|
+
try {
|
|
813
|
+
return JSON.stringify(value);
|
|
814
|
+
} catch {
|
|
815
|
+
return String(value);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
761
818
|
var ResourceError = class extends BusinessError {
|
|
762
819
|
constructor(message, data) {
|
|
763
820
|
super(message, data);
|
|
@@ -803,7 +860,7 @@ function formatStructuredError(error, options) {
|
|
|
803
860
|
if (d.message) {
|
|
804
861
|
parts.push(` - ${d.message}`);
|
|
805
862
|
} else if (d.field && d.value !== void 0) {
|
|
806
|
-
parts.push(` - ${d.field}: ${d.value}`);
|
|
863
|
+
parts.push(` - ${d.field}: ${formatStructuredErrorDetailValue(d.value)}`);
|
|
807
864
|
}
|
|
808
865
|
});
|
|
809
866
|
}
|
|
@@ -834,9 +891,10 @@ function isAppIdConflictError(error) {
|
|
|
834
891
|
var SUPPORTED_API_VERSIONS = [
|
|
835
892
|
"2025-10-28",
|
|
836
893
|
"2026-01-21",
|
|
837
|
-
"2026-05-22"
|
|
894
|
+
"2026-05-22",
|
|
895
|
+
"2026-06-23"
|
|
838
896
|
];
|
|
839
|
-
var DEFAULT_API_VERSION = "2026-
|
|
897
|
+
var DEFAULT_API_VERSION = "2026-06-23";
|
|
840
898
|
var logger = (0, import_debug.default)("phala::api-client");
|
|
841
899
|
function formatHeaders(headers) {
|
|
842
900
|
return Object.entries(headers).map(([key, value]) => ` -H "${key}: ${value}"`).join("\n");
|
|
@@ -1307,6 +1365,12 @@ async function safeGetCurrentUser(client, parameters) {
|
|
|
1307
1365
|
}
|
|
1308
1366
|
|
|
1309
1367
|
// src/actions/get_available_nodes.ts
|
|
1368
|
+
var import_zod7 = require("zod");
|
|
1369
|
+
|
|
1370
|
+
// src/types/cvm_info_v20260121.ts
|
|
1371
|
+
var import_zod6 = require("zod");
|
|
1372
|
+
|
|
1373
|
+
// src/types/cvm_info_v20251028.ts
|
|
1310
1374
|
var import_zod5 = require("zod");
|
|
1311
1375
|
|
|
1312
1376
|
// src/types/kms_info.ts
|
|
@@ -1328,7 +1392,8 @@ var KmsInfoBaseSchema = import_zod4.z.object({
|
|
|
1328
1392
|
version: import_zod4.z.string(),
|
|
1329
1393
|
chain_id: import_zod4.z.number().nullable(),
|
|
1330
1394
|
kms_contract_address: import_zod4.z.string().nullable().transform((val) => val),
|
|
1331
|
-
gateway_app_id: import_zod4.z.string().nullable().transform((val) => val)
|
|
1395
|
+
gateway_app_id: import_zod4.z.string().nullable().transform((val) => val),
|
|
1396
|
+
k256_pubkey: import_zod4.z.string().nullable().optional()
|
|
1332
1397
|
}).passthrough();
|
|
1333
1398
|
var KmsInfoSchema = KmsInfoBaseSchema.transform((data) => {
|
|
1334
1399
|
if (data.chain_id != null) {
|
|
@@ -1340,6 +1405,262 @@ var KmsInfoSchema = KmsInfoBaseSchema.transform((data) => {
|
|
|
1340
1405
|
return data;
|
|
1341
1406
|
});
|
|
1342
1407
|
|
|
1408
|
+
// src/types/cvm_info_v20251028.ts
|
|
1409
|
+
var TableIdSchema = import_zod5.z.union([import_zod5.z.number(), import_zod5.z.string()]);
|
|
1410
|
+
var VmInfoV20251028Schema = import_zod5.z.object({
|
|
1411
|
+
id: import_zod5.z.string(),
|
|
1412
|
+
name: import_zod5.z.string(),
|
|
1413
|
+
status: import_zod5.z.string(),
|
|
1414
|
+
uptime: import_zod5.z.string(),
|
|
1415
|
+
app_url: import_zod5.z.string().nullable(),
|
|
1416
|
+
app_id: import_zod5.z.string(),
|
|
1417
|
+
instance_id: import_zod5.z.string().nullable(),
|
|
1418
|
+
configuration: import_zod5.z.any().optional(),
|
|
1419
|
+
exited_at: import_zod5.z.string().nullable(),
|
|
1420
|
+
boot_progress: import_zod5.z.string().nullable(),
|
|
1421
|
+
boot_error: import_zod5.z.string().nullable(),
|
|
1422
|
+
shutdown_progress: import_zod5.z.string().nullable(),
|
|
1423
|
+
image_version: import_zod5.z.string().nullable()
|
|
1424
|
+
});
|
|
1425
|
+
var ManagedUserV20251028Schema = import_zod5.z.object({
|
|
1426
|
+
id: TableIdSchema,
|
|
1427
|
+
username: import_zod5.z.string()
|
|
1428
|
+
});
|
|
1429
|
+
var CvmNodeV20251028Schema = import_zod5.z.object({
|
|
1430
|
+
id: import_zod5.z.number(),
|
|
1431
|
+
name: import_zod5.z.string(),
|
|
1432
|
+
region_identifier: import_zod5.z.string().nullable().optional()
|
|
1433
|
+
});
|
|
1434
|
+
var MachineInfoV20251028Schema = import_zod5.z.object({
|
|
1435
|
+
vcpu: import_zod5.z.number(),
|
|
1436
|
+
memory: import_zod5.z.number(),
|
|
1437
|
+
disk_size: import_zod5.z.number(),
|
|
1438
|
+
gpu_count: import_zod5.z.number().default(0)
|
|
1439
|
+
});
|
|
1440
|
+
var CvmNetworkUrlsV20251028Schema = import_zod5.z.object({
|
|
1441
|
+
app: import_zod5.z.string(),
|
|
1442
|
+
instance: import_zod5.z.string()
|
|
1443
|
+
});
|
|
1444
|
+
var CvmInfoV20251028Schema = import_zod5.z.object({
|
|
1445
|
+
hosted: VmInfoV20251028Schema,
|
|
1446
|
+
name: import_zod5.z.string(),
|
|
1447
|
+
managed_user: ManagedUserV20251028Schema.nullable(),
|
|
1448
|
+
node: CvmNodeV20251028Schema.nullable(),
|
|
1449
|
+
listed: import_zod5.z.boolean().default(false),
|
|
1450
|
+
status: import_zod5.z.string(),
|
|
1451
|
+
in_progress: import_zod5.z.boolean().default(false),
|
|
1452
|
+
dapp_dashboard_url: import_zod5.z.string().nullable(),
|
|
1453
|
+
syslog_endpoint: import_zod5.z.string().nullable(),
|
|
1454
|
+
allow_upgrade: import_zod5.z.boolean().default(false),
|
|
1455
|
+
project_id: import_zod5.z.string().nullable(),
|
|
1456
|
+
project_type: import_zod5.z.string().nullable(),
|
|
1457
|
+
billing_period: import_zod5.z.string().nullable(),
|
|
1458
|
+
kms_info: KmsInfoSchema.nullable(),
|
|
1459
|
+
vcpu: import_zod5.z.number().nullable(),
|
|
1460
|
+
memory: import_zod5.z.number().nullable(),
|
|
1461
|
+
disk_size: import_zod5.z.number().nullable(),
|
|
1462
|
+
gateway_domain: import_zod5.z.string().nullable(),
|
|
1463
|
+
public_urls: import_zod5.z.array(CvmNetworkUrlsV20251028Schema),
|
|
1464
|
+
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
1465
|
+
updated_at: import_zod5.z.string().nullable().optional()
|
|
1466
|
+
});
|
|
1467
|
+
var CvmDetailV20251028Schema = import_zod5.z.object({
|
|
1468
|
+
id: TableIdSchema,
|
|
1469
|
+
name: import_zod5.z.string(),
|
|
1470
|
+
status: import_zod5.z.string(),
|
|
1471
|
+
in_progress: import_zod5.z.boolean().optional().default(false),
|
|
1472
|
+
teepod_id: import_zod5.z.number().nullable(),
|
|
1473
|
+
teepod: CvmNodeV20251028Schema.optional().nullable(),
|
|
1474
|
+
app_id: import_zod5.z.string(),
|
|
1475
|
+
vm_uuid: import_zod5.z.string().nullable(),
|
|
1476
|
+
instance_id: import_zod5.z.string().nullable(),
|
|
1477
|
+
vcpu: import_zod5.z.number(),
|
|
1478
|
+
memory: import_zod5.z.number(),
|
|
1479
|
+
disk_size: import_zod5.z.number(),
|
|
1480
|
+
base_image: import_zod5.z.string().nullable(),
|
|
1481
|
+
encrypted_env_pubkey: import_zod5.z.string().nullable(),
|
|
1482
|
+
listed: import_zod5.z.boolean().optional().default(false),
|
|
1483
|
+
project_id: import_zod5.z.string().optional().nullable(),
|
|
1484
|
+
project_type: import_zod5.z.string().optional().nullable(),
|
|
1485
|
+
instance_type: import_zod5.z.string().optional().nullable(),
|
|
1486
|
+
public_sysinfo: import_zod5.z.boolean().optional().default(false),
|
|
1487
|
+
public_logs: import_zod5.z.boolean().optional().default(false),
|
|
1488
|
+
dapp_dashboard_url: import_zod5.z.string().optional().nullable(),
|
|
1489
|
+
syslog_endpoint: import_zod5.z.string().optional().nullable(),
|
|
1490
|
+
kms_info: KmsInfoSchema.optional().nullable(),
|
|
1491
|
+
contract_address: import_zod5.z.string().optional().nullable(),
|
|
1492
|
+
deployer_address: import_zod5.z.string().optional().nullable(),
|
|
1493
|
+
scheduled_delete_at: import_zod5.z.string().optional().nullable(),
|
|
1494
|
+
public_urls: import_zod5.z.array(CvmNetworkUrlsV20251028Schema).optional().default([]),
|
|
1495
|
+
gateway_domain: import_zod5.z.string().optional().nullable(),
|
|
1496
|
+
machine_info: MachineInfoV20251028Schema.optional().nullable(),
|
|
1497
|
+
updated_at: import_zod5.z.string().optional().nullable()
|
|
1498
|
+
});
|
|
1499
|
+
var PaginatedCvmInfosV20251028Schema = import_zod5.z.object({
|
|
1500
|
+
items: import_zod5.z.array(CvmInfoV20251028Schema),
|
|
1501
|
+
total: import_zod5.z.number(),
|
|
1502
|
+
page: import_zod5.z.number(),
|
|
1503
|
+
page_size: import_zod5.z.number(),
|
|
1504
|
+
pages: import_zod5.z.number()
|
|
1505
|
+
});
|
|
1506
|
+
|
|
1507
|
+
// src/types/cvm_info_v20260121.ts
|
|
1508
|
+
var BillingPeriodSchema = import_zod6.z.enum(["skip", "hourly", "monthly"]);
|
|
1509
|
+
var KmsTypeSchema = import_zod6.z.enum(["phala", "ethereum", "base", "legacy"]);
|
|
1510
|
+
var UserRefSchema = import_zod6.z.object({
|
|
1511
|
+
object_type: import_zod6.z.literal("user"),
|
|
1512
|
+
id: import_zod6.z.string().nullable().optional(),
|
|
1513
|
+
username: import_zod6.z.string().nullable().optional(),
|
|
1514
|
+
avatar_url: import_zod6.z.string().nullable().optional()
|
|
1515
|
+
});
|
|
1516
|
+
var WorkspaceRefSchema = import_zod6.z.object({
|
|
1517
|
+
object_type: import_zod6.z.literal("workspace"),
|
|
1518
|
+
id: import_zod6.z.string(),
|
|
1519
|
+
name: import_zod6.z.string(),
|
|
1520
|
+
slug: import_zod6.z.string().nullable().optional(),
|
|
1521
|
+
avatar_url: import_zod6.z.string().nullable().optional()
|
|
1522
|
+
});
|
|
1523
|
+
var CvmResourceInfoV20260121Schema = import_zod6.z.object({
|
|
1524
|
+
instance_type: import_zod6.z.string().nullable().optional(),
|
|
1525
|
+
vcpu: import_zod6.z.number().int().nullable().optional(),
|
|
1526
|
+
memory_in_gb: import_zod6.z.number().nullable().optional(),
|
|
1527
|
+
disk_in_gb: import_zod6.z.number().int().nullable().optional(),
|
|
1528
|
+
gpus: import_zod6.z.number().int().nullable().optional(),
|
|
1529
|
+
compute_billing_price: import_zod6.z.string().nullable().optional(),
|
|
1530
|
+
billing_period: BillingPeriodSchema.nullable().optional()
|
|
1531
|
+
});
|
|
1532
|
+
var CvmHourlyRateV20260121Schema = import_zod6.z.object({
|
|
1533
|
+
total: import_zod6.z.string().nullable().optional(),
|
|
1534
|
+
compute: import_zod6.z.string().nullable().optional(),
|
|
1535
|
+
disk: import_zod6.z.string().nullable().optional()
|
|
1536
|
+
});
|
|
1537
|
+
var CvmGpuRentalOrderInfoV20260121Schema = import_zod6.z.object({
|
|
1538
|
+
order_id: import_zod6.z.string(),
|
|
1539
|
+
status: import_zod6.z.string(),
|
|
1540
|
+
pricing_plan: import_zod6.z.string().nullable().optional(),
|
|
1541
|
+
commitment_days: import_zod6.z.number().int().nullable().optional(),
|
|
1542
|
+
agreed_hourly_rate: import_zod6.z.string().nullable().optional(),
|
|
1543
|
+
hourly_billing_start_time: import_zod6.z.string().nullable().optional(),
|
|
1544
|
+
activated_at: import_zod6.z.string().nullable().optional(),
|
|
1545
|
+
completed_at: import_zod6.z.string().nullable().optional(),
|
|
1546
|
+
cancelled_at: import_zod6.z.string().nullable().optional(),
|
|
1547
|
+
decoupled_at: import_zod6.z.string().nullable().optional(),
|
|
1548
|
+
sku_code: import_zod6.z.string().nullable().optional(),
|
|
1549
|
+
sku_display_name: import_zod6.z.string().nullable().optional()
|
|
1550
|
+
});
|
|
1551
|
+
var CvmOsInfoV20260121Schema = import_zod6.z.object({
|
|
1552
|
+
name: import_zod6.z.string().nullable().optional(),
|
|
1553
|
+
version: import_zod6.z.string().nullable().optional(),
|
|
1554
|
+
is_dev: import_zod6.z.boolean().nullable().optional(),
|
|
1555
|
+
os_image_hash: import_zod6.z.string().nullable().optional()
|
|
1556
|
+
});
|
|
1557
|
+
var CvmKmsInfoV20260121BaseSchema = import_zod6.z.object({
|
|
1558
|
+
chain_id: import_zod6.z.number().int().nullable().optional(),
|
|
1559
|
+
dstack_kms_address: import_zod6.z.string().nullable().optional(),
|
|
1560
|
+
dstack_app_address: import_zod6.z.string().nullable().optional(),
|
|
1561
|
+
deployer_address: import_zod6.z.string().nullable().optional(),
|
|
1562
|
+
rpc_endpoint: import_zod6.z.string().nullable().optional(),
|
|
1563
|
+
encrypted_env_pubkey: import_zod6.z.string().nullable().optional()
|
|
1564
|
+
});
|
|
1565
|
+
var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) => {
|
|
1566
|
+
if (data.chain_id != null) {
|
|
1567
|
+
const chain = SUPPORTED_CHAINS[data.chain_id];
|
|
1568
|
+
if (chain) {
|
|
1569
|
+
return { ...data, chain };
|
|
1570
|
+
}
|
|
1571
|
+
}
|
|
1572
|
+
return data;
|
|
1573
|
+
});
|
|
1574
|
+
var CvmProgressInfoV20260121Schema = import_zod6.z.object({
|
|
1575
|
+
target: import_zod6.z.string().nullable().optional(),
|
|
1576
|
+
started_at: import_zod6.z.string().nullable().optional(),
|
|
1577
|
+
correlation_id: import_zod6.z.string().nullable().optional()
|
|
1578
|
+
});
|
|
1579
|
+
var CvmGatewayInfoV20260121Schema = import_zod6.z.object({
|
|
1580
|
+
base_domain: import_zod6.z.string().nullable().optional(),
|
|
1581
|
+
cname: import_zod6.z.string().nullable().optional()
|
|
1582
|
+
});
|
|
1583
|
+
var CvmLogUrlsV20260121Schema = import_zod6.z.object({
|
|
1584
|
+
serial: import_zod6.z.string().nullable().optional(),
|
|
1585
|
+
stdout: import_zod6.z.string().nullable().optional(),
|
|
1586
|
+
stderr: import_zod6.z.string().nullable().optional(),
|
|
1587
|
+
container_log_base: import_zod6.z.string().nullable().optional()
|
|
1588
|
+
});
|
|
1589
|
+
var DeviceIdEntrySchema = import_zod6.z.object({
|
|
1590
|
+
device_id: import_zod6.z.string(),
|
|
1591
|
+
algorithm_version: import_zod6.z.string(),
|
|
1592
|
+
enabled: import_zod6.z.boolean()
|
|
1593
|
+
});
|
|
1594
|
+
var NodeRefSchema = import_zod6.z.object({
|
|
1595
|
+
object_type: import_zod6.z.literal("node"),
|
|
1596
|
+
id: import_zod6.z.number().int().nullable().optional(),
|
|
1597
|
+
name: import_zod6.z.string().nullable().optional(),
|
|
1598
|
+
region: import_zod6.z.string().nullable().optional(),
|
|
1599
|
+
// Deprecated: resolved single device_id. Use device_ids for the full matrix.
|
|
1600
|
+
device_id: import_zod6.z.string().nullable().optional(),
|
|
1601
|
+
device_ids: import_zod6.z.array(DeviceIdEntrySchema).default([]),
|
|
1602
|
+
ppid: import_zod6.z.string().nullable().optional(),
|
|
1603
|
+
status: import_zod6.z.string().nullable().optional(),
|
|
1604
|
+
version: import_zod6.z.string().nullable().optional()
|
|
1605
|
+
});
|
|
1606
|
+
var CvmNodeInfoV20260121Schema = NodeRefSchema;
|
|
1607
|
+
var CvmInfoV20260121Schema = import_zod6.z.object({
|
|
1608
|
+
id: import_zod6.z.string(),
|
|
1609
|
+
name: import_zod6.z.string(),
|
|
1610
|
+
app_id: import_zod6.z.string().nullable().optional(),
|
|
1611
|
+
vm_uuid: import_zod6.z.string().nullable().optional(),
|
|
1612
|
+
instance_id: import_zod6.z.string().nullable().optional(),
|
|
1613
|
+
resource: CvmResourceInfoV20260121Schema,
|
|
1614
|
+
node_info: NodeRefSchema.nullable().optional(),
|
|
1615
|
+
os: CvmOsInfoV20260121Schema.nullable().optional(),
|
|
1616
|
+
kms_type: KmsTypeSchema.nullable().optional(),
|
|
1617
|
+
kms_info: CvmKmsInfoV20260121Schema.nullable().optional(),
|
|
1618
|
+
status: import_zod6.z.string(),
|
|
1619
|
+
in_progress: import_zod6.z.boolean().optional().default(false),
|
|
1620
|
+
progress: CvmProgressInfoV20260121Schema.nullable().optional(),
|
|
1621
|
+
compose_hash: import_zod6.z.string().nullable().optional(),
|
|
1622
|
+
docker_compose_hash: import_zod6.z.string().nullable().optional(),
|
|
1623
|
+
pre_launch_script_hash: import_zod6.z.string().nullable().optional(),
|
|
1624
|
+
gateway: CvmGatewayInfoV20260121Schema,
|
|
1625
|
+
logs: CvmLogUrlsV20260121Schema.optional().default({}),
|
|
1626
|
+
services: import_zod6.z.array(import_zod6.z.record(import_zod6.z.any())).optional().default([]),
|
|
1627
|
+
endpoints: import_zod6.z.array(CvmNetworkUrlsV20251028Schema).nullable().optional(),
|
|
1628
|
+
public_logs: import_zod6.z.boolean().optional(),
|
|
1629
|
+
public_sysinfo: import_zod6.z.boolean().optional(),
|
|
1630
|
+
public_tcbinfo: import_zod6.z.boolean().optional(),
|
|
1631
|
+
gateway_enabled: import_zod6.z.boolean().optional(),
|
|
1632
|
+
secure_time: import_zod6.z.boolean().optional(),
|
|
1633
|
+
listed: import_zod6.z.boolean().optional().default(false),
|
|
1634
|
+
storage_fs: import_zod6.z.string().optional(),
|
|
1635
|
+
workspace: WorkspaceRefSchema.nullable().optional(),
|
|
1636
|
+
creator: UserRefSchema.nullable().optional(),
|
|
1637
|
+
created_at: import_zod6.z.string().nullable().optional(),
|
|
1638
|
+
deleted_at: import_zod6.z.string().nullable().optional(),
|
|
1639
|
+
project_type: import_zod6.z.string().nullable().optional(),
|
|
1640
|
+
hourly_rate: CvmHourlyRateV20260121Schema.nullable().optional(),
|
|
1641
|
+
billing_interval: import_zod6.z.string().nullable().optional(),
|
|
1642
|
+
gpu_rental_order: CvmGpuRentalOrderInfoV20260121Schema.nullable().optional()
|
|
1643
|
+
});
|
|
1644
|
+
var CvmInfoV20260522Schema = CvmInfoV20260121Schema.extend({
|
|
1645
|
+
id: import_zod6.z.string()
|
|
1646
|
+
});
|
|
1647
|
+
var CvmInfoDetailV20260121Schema = CvmInfoV20260121Schema.extend({
|
|
1648
|
+
compose_file: import_zod6.z.union([import_zod6.z.record(import_zod6.z.any()), import_zod6.z.string()]).nullable().optional()
|
|
1649
|
+
});
|
|
1650
|
+
var CvmInfoDetailV20260522Schema = CvmInfoV20260522Schema.extend({
|
|
1651
|
+
compose_file: import_zod6.z.union([import_zod6.z.record(import_zod6.z.any()), import_zod6.z.string()]).nullable().optional()
|
|
1652
|
+
});
|
|
1653
|
+
var PaginatedCvmInfosV20260121Schema = import_zod6.z.object({
|
|
1654
|
+
items: import_zod6.z.array(CvmInfoV20260121Schema),
|
|
1655
|
+
total: import_zod6.z.number(),
|
|
1656
|
+
page: import_zod6.z.number(),
|
|
1657
|
+
page_size: import_zod6.z.number(),
|
|
1658
|
+
pages: import_zod6.z.number()
|
|
1659
|
+
});
|
|
1660
|
+
var PaginatedCvmInfosV20260522Schema = PaginatedCvmInfosV20260121Schema.extend({
|
|
1661
|
+
items: import_zod6.z.array(CvmInfoV20260522Schema)
|
|
1662
|
+
});
|
|
1663
|
+
|
|
1343
1664
|
// src/utils/validate-parameters.ts
|
|
1344
1665
|
function validateActionParameters(parameters) {
|
|
1345
1666
|
if (parameters?.schema !== void 0 && parameters?.schema !== false) {
|
|
@@ -1487,43 +1808,44 @@ function defineAction(schema, fn) {
|
|
|
1487
1808
|
}
|
|
1488
1809
|
|
|
1489
1810
|
// src/actions/get_available_nodes.ts
|
|
1490
|
-
var AvailableOSImageSchema =
|
|
1491
|
-
name:
|
|
1492
|
-
is_dev:
|
|
1493
|
-
version:
|
|
1494
|
-
|
|
1495
|
-
|
|
1811
|
+
var AvailableOSImageSchema = import_zod7.z.object({
|
|
1812
|
+
name: import_zod7.z.string(),
|
|
1813
|
+
is_dev: import_zod7.z.boolean(),
|
|
1814
|
+
version: import_zod7.z.union([
|
|
1815
|
+
import_zod7.z.tuple([import_zod7.z.number(), import_zod7.z.number(), import_zod7.z.number()]),
|
|
1816
|
+
import_zod7.z.tuple([import_zod7.z.number(), import_zod7.z.number(), import_zod7.z.number(), import_zod7.z.number()])
|
|
1496
1817
|
]),
|
|
1497
|
-
os_image_hash:
|
|
1818
|
+
os_image_hash: import_zod7.z.string().nullable().optional()
|
|
1498
1819
|
}).passthrough();
|
|
1499
|
-
var TeepodCapacitySchema =
|
|
1500
|
-
teepod_id:
|
|
1501
|
-
name:
|
|
1502
|
-
listed:
|
|
1503
|
-
resource_score:
|
|
1504
|
-
remaining_vcpu:
|
|
1505
|
-
remaining_memory:
|
|
1506
|
-
remaining_cvm_slots:
|
|
1507
|
-
images:
|
|
1508
|
-
support_onchain_kms:
|
|
1509
|
-
fmspc:
|
|
1510
|
-
device_id:
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1820
|
+
var TeepodCapacitySchema = import_zod7.z.object({
|
|
1821
|
+
teepod_id: import_zod7.z.number(),
|
|
1822
|
+
name: import_zod7.z.string(),
|
|
1823
|
+
listed: import_zod7.z.boolean(),
|
|
1824
|
+
resource_score: import_zod7.z.number(),
|
|
1825
|
+
remaining_vcpu: import_zod7.z.number(),
|
|
1826
|
+
remaining_memory: import_zod7.z.number(),
|
|
1827
|
+
remaining_cvm_slots: import_zod7.z.number(),
|
|
1828
|
+
images: import_zod7.z.array(AvailableOSImageSchema),
|
|
1829
|
+
support_onchain_kms: import_zod7.z.boolean().optional(),
|
|
1830
|
+
fmspc: import_zod7.z.string().nullable().optional(),
|
|
1831
|
+
device_id: import_zod7.z.string().nullable().optional(),
|
|
1832
|
+
device_ids: import_zod7.z.array(DeviceIdEntrySchema).default([]),
|
|
1833
|
+
region_identifier: import_zod7.z.string().nullable().optional(),
|
|
1834
|
+
default_kms: import_zod7.z.string().nullable().optional(),
|
|
1835
|
+
kms_list: import_zod7.z.array(import_zod7.z.string()).default([])
|
|
1514
1836
|
}).passthrough();
|
|
1515
|
-
var ResourceThresholdSchema =
|
|
1516
|
-
max_instances:
|
|
1517
|
-
max_vcpu:
|
|
1518
|
-
max_memory:
|
|
1519
|
-
max_disk:
|
|
1837
|
+
var ResourceThresholdSchema = import_zod7.z.object({
|
|
1838
|
+
max_instances: import_zod7.z.number().nullable().optional(),
|
|
1839
|
+
max_vcpu: import_zod7.z.number().nullable().optional(),
|
|
1840
|
+
max_memory: import_zod7.z.number().nullable().optional(),
|
|
1841
|
+
max_disk: import_zod7.z.number().nullable().optional()
|
|
1520
1842
|
}).passthrough();
|
|
1521
|
-
var AvailableNodesSchema =
|
|
1522
|
-
tier:
|
|
1843
|
+
var AvailableNodesSchema = import_zod7.z.object({
|
|
1844
|
+
tier: import_zod7.z.string(),
|
|
1523
1845
|
// TeamTier is string enum
|
|
1524
1846
|
capacity: ResourceThresholdSchema,
|
|
1525
|
-
nodes:
|
|
1526
|
-
kms_list:
|
|
1847
|
+
nodes: import_zod7.z.array(TeepodCapacitySchema),
|
|
1848
|
+
kms_list: import_zod7.z.array(KmsInfoSchema)
|
|
1527
1849
|
}).passthrough();
|
|
1528
1850
|
var { action: getAvailableNodes, safeAction: safeGetAvailableNodes } = defineSimpleAction(
|
|
1529
1851
|
AvailableNodesSchema,
|
|
@@ -1533,42 +1855,42 @@ var { action: getAvailableNodes, safeAction: safeGetAvailableNodes } = defineSim
|
|
|
1533
1855
|
);
|
|
1534
1856
|
|
|
1535
1857
|
// src/actions/get_cvm_create_resources.ts
|
|
1536
|
-
var
|
|
1537
|
-
var ResourceIdV20260121Schema =
|
|
1538
|
-
var HashIdSchema =
|
|
1539
|
-
var GpuAvailabilitySchema =
|
|
1540
|
-
has_reserved_gpus:
|
|
1541
|
-
reserved_gpu_count:
|
|
1542
|
-
has_public_gpus:
|
|
1543
|
-
public_gpu_count:
|
|
1858
|
+
var import_zod8 = require("zod");
|
|
1859
|
+
var ResourceIdV20260121Schema = import_zod8.z.union([import_zod8.z.number(), import_zod8.z.string()]);
|
|
1860
|
+
var HashIdSchema = import_zod8.z.string();
|
|
1861
|
+
var GpuAvailabilitySchema = import_zod8.z.object({
|
|
1862
|
+
has_reserved_gpus: import_zod8.z.boolean(),
|
|
1863
|
+
reserved_gpu_count: import_zod8.z.number(),
|
|
1864
|
+
has_public_gpus: import_zod8.z.boolean(),
|
|
1865
|
+
public_gpu_count: import_zod8.z.number()
|
|
1544
1866
|
}).passthrough();
|
|
1545
|
-
var CvmCreateKmsResourceV20260121Schema =
|
|
1867
|
+
var CvmCreateKmsResourceV20260121Schema = import_zod8.z.object({
|
|
1546
1868
|
id: ResourceIdV20260121Schema,
|
|
1547
|
-
slug:
|
|
1548
|
-
url:
|
|
1549
|
-
version:
|
|
1550
|
-
kms_type:
|
|
1551
|
-
chain_id:
|
|
1869
|
+
slug: import_zod8.z.string().nullable().optional(),
|
|
1870
|
+
url: import_zod8.z.string(),
|
|
1871
|
+
version: import_zod8.z.string().nullable().optional(),
|
|
1872
|
+
kms_type: import_zod8.z.string(),
|
|
1873
|
+
chain_id: import_zod8.z.number().nullable().optional(),
|
|
1552
1874
|
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1553
|
-
kms_contract_address:
|
|
1554
|
-
gateway_app_id:
|
|
1555
|
-
supported_os_images:
|
|
1875
|
+
kms_contract_address: import_zod8.z.string().nullable().optional(),
|
|
1876
|
+
gateway_app_id: import_zod8.z.string().nullable().optional(),
|
|
1877
|
+
supported_os_images: import_zod8.z.array(import_zod8.z.string()).default([])
|
|
1556
1878
|
}).passthrough();
|
|
1557
|
-
var CvmCreateNodeKmsRelationV20260121Schema =
|
|
1558
|
-
teepod_id:
|
|
1879
|
+
var CvmCreateNodeKmsRelationV20260121Schema = import_zod8.z.object({
|
|
1880
|
+
teepod_id: import_zod8.z.number(),
|
|
1559
1881
|
kms_id: ResourceIdV20260121Schema,
|
|
1560
|
-
kms_type:
|
|
1882
|
+
kms_type: import_zod8.z.string(),
|
|
1561
1883
|
kms_contract_id: ResourceIdV20260121Schema.nullable().optional(),
|
|
1562
|
-
kms_contract_address:
|
|
1563
|
-
supported_os_images:
|
|
1884
|
+
kms_contract_address: import_zod8.z.string().nullable().optional(),
|
|
1885
|
+
supported_os_images: import_zod8.z.array(import_zod8.z.string()).default([])
|
|
1564
1886
|
}).passthrough();
|
|
1565
|
-
var CvmCreateGatewayResourceV20260121Schema =
|
|
1887
|
+
var CvmCreateGatewayResourceV20260121Schema = import_zod8.z.object({
|
|
1566
1888
|
id: ResourceIdV20260121Schema,
|
|
1567
|
-
teepod_id:
|
|
1889
|
+
teepod_id: import_zod8.z.number().nullable().optional(),
|
|
1568
1890
|
kms_contract_id: ResourceIdV20260121Schema,
|
|
1569
|
-
rpc_url:
|
|
1570
|
-
domain_suffix:
|
|
1571
|
-
enabled:
|
|
1891
|
+
rpc_url: import_zod8.z.string().nullable().optional(),
|
|
1892
|
+
domain_suffix: import_zod8.z.string().nullable().optional(),
|
|
1893
|
+
enabled: import_zod8.z.boolean()
|
|
1572
1894
|
}).passthrough();
|
|
1573
1895
|
var CvmCreateKmsResourceSchema = CvmCreateKmsResourceV20260121Schema.extend({
|
|
1574
1896
|
id: HashIdSchema,
|
|
@@ -1582,31 +1904,31 @@ var CvmCreateGatewayResourceSchema = CvmCreateGatewayResourceV20260121Schema.ext
|
|
|
1582
1904
|
id: HashIdSchema,
|
|
1583
1905
|
kms_contract_id: HashIdSchema
|
|
1584
1906
|
});
|
|
1585
|
-
var CvmCreateInstanceTypeResourceSchema =
|
|
1586
|
-
id:
|
|
1587
|
-
name:
|
|
1588
|
-
vcpu:
|
|
1589
|
-
memory_mb:
|
|
1590
|
-
default_disk_size_gb:
|
|
1591
|
-
requires_gpu:
|
|
1592
|
-
requires_gpu_count:
|
|
1593
|
-
family:
|
|
1594
|
-
display_order:
|
|
1907
|
+
var CvmCreateInstanceTypeResourceSchema = import_zod8.z.object({
|
|
1908
|
+
id: import_zod8.z.string(),
|
|
1909
|
+
name: import_zod8.z.string(),
|
|
1910
|
+
vcpu: import_zod8.z.number(),
|
|
1911
|
+
memory_mb: import_zod8.z.number(),
|
|
1912
|
+
default_disk_size_gb: import_zod8.z.number(),
|
|
1913
|
+
requires_gpu: import_zod8.z.boolean(),
|
|
1914
|
+
requires_gpu_count: import_zod8.z.number(),
|
|
1915
|
+
family: import_zod8.z.string().nullable().optional(),
|
|
1916
|
+
display_order: import_zod8.z.number().nullable().optional()
|
|
1595
1917
|
}).passthrough();
|
|
1596
|
-
var CvmCreateResourceGraphV20260121Schema =
|
|
1597
|
-
tier:
|
|
1918
|
+
var CvmCreateResourceGraphV20260121Schema = import_zod8.z.object({
|
|
1919
|
+
tier: import_zod8.z.string(),
|
|
1598
1920
|
capacity: ResourceThresholdSchema,
|
|
1599
|
-
nodes:
|
|
1600
|
-
kms_nodes:
|
|
1601
|
-
node_kms_relations:
|
|
1602
|
-
gateway_nodes:
|
|
1603
|
-
instance_types:
|
|
1921
|
+
nodes: import_zod8.z.array(TeepodCapacitySchema),
|
|
1922
|
+
kms_nodes: import_zod8.z.array(CvmCreateKmsResourceV20260121Schema),
|
|
1923
|
+
node_kms_relations: import_zod8.z.array(CvmCreateNodeKmsRelationV20260121Schema),
|
|
1924
|
+
gateway_nodes: import_zod8.z.array(CvmCreateGatewayResourceV20260121Schema),
|
|
1925
|
+
instance_types: import_zod8.z.array(CvmCreateInstanceTypeResourceSchema),
|
|
1604
1926
|
gpu_availability: GpuAvailabilitySchema
|
|
1605
1927
|
}).passthrough();
|
|
1606
1928
|
var CvmCreateResourceGraphV20260522Schema = CvmCreateResourceGraphV20260121Schema.extend({
|
|
1607
|
-
kms_nodes:
|
|
1608
|
-
node_kms_relations:
|
|
1609
|
-
gateway_nodes:
|
|
1929
|
+
kms_nodes: import_zod8.z.array(CvmCreateKmsResourceSchema),
|
|
1930
|
+
node_kms_relations: import_zod8.z.array(CvmCreateNodeKmsRelationSchema),
|
|
1931
|
+
gateway_nodes: import_zod8.z.array(CvmCreateGatewayResourceSchema)
|
|
1610
1932
|
});
|
|
1611
1933
|
var CvmCreateResourceGraphSchema = CvmCreateResourceGraphV20260522Schema;
|
|
1612
1934
|
function getSchemaForVersion2(version) {
|
|
@@ -1634,33 +1956,33 @@ async function safeGetCvmCreateResources(client, parameters) {
|
|
|
1634
1956
|
}
|
|
1635
1957
|
|
|
1636
1958
|
// src/actions/list-instance-types.ts
|
|
1637
|
-
var
|
|
1638
|
-
var InstanceTypeSchema =
|
|
1639
|
-
id:
|
|
1640
|
-
name:
|
|
1641
|
-
description:
|
|
1642
|
-
vcpu:
|
|
1643
|
-
memory_mb:
|
|
1644
|
-
hourly_rate:
|
|
1645
|
-
requires_gpu:
|
|
1646
|
-
default_disk_size_gb:
|
|
1647
|
-
family:
|
|
1959
|
+
var import_zod9 = require("zod");
|
|
1960
|
+
var InstanceTypeSchema = import_zod9.z.object({
|
|
1961
|
+
id: import_zod9.z.string(),
|
|
1962
|
+
name: import_zod9.z.string(),
|
|
1963
|
+
description: import_zod9.z.string(),
|
|
1964
|
+
vcpu: import_zod9.z.number(),
|
|
1965
|
+
memory_mb: import_zod9.z.number(),
|
|
1966
|
+
hourly_rate: import_zod9.z.string(),
|
|
1967
|
+
requires_gpu: import_zod9.z.boolean(),
|
|
1968
|
+
default_disk_size_gb: import_zod9.z.number().default(20),
|
|
1969
|
+
family: import_zod9.z.string().nullable()
|
|
1648
1970
|
}).passthrough();
|
|
1649
|
-
var FamilyGroupSchema =
|
|
1650
|
-
name:
|
|
1651
|
-
items:
|
|
1652
|
-
total:
|
|
1971
|
+
var FamilyGroupSchema = import_zod9.z.object({
|
|
1972
|
+
name: import_zod9.z.string(),
|
|
1973
|
+
items: import_zod9.z.array(InstanceTypeSchema),
|
|
1974
|
+
total: import_zod9.z.number()
|
|
1653
1975
|
}).strict();
|
|
1654
|
-
var AllFamiliesResponseSchema =
|
|
1655
|
-
result:
|
|
1976
|
+
var AllFamiliesResponseSchema = import_zod9.z.object({
|
|
1977
|
+
result: import_zod9.z.array(FamilyGroupSchema)
|
|
1656
1978
|
}).strict();
|
|
1657
|
-
var FamilyInstanceTypesResponseSchema =
|
|
1658
|
-
items:
|
|
1659
|
-
total:
|
|
1660
|
-
family:
|
|
1979
|
+
var FamilyInstanceTypesResponseSchema = import_zod9.z.object({
|
|
1980
|
+
items: import_zod9.z.array(InstanceTypeSchema),
|
|
1981
|
+
total: import_zod9.z.number(),
|
|
1982
|
+
family: import_zod9.z.string()
|
|
1661
1983
|
}).strict();
|
|
1662
|
-
var ListFamilyInstanceTypesRequestSchema =
|
|
1663
|
-
family:
|
|
1984
|
+
var ListFamilyInstanceTypesRequestSchema = import_zod9.z.object({
|
|
1985
|
+
family: import_zod9.z.string()
|
|
1664
1986
|
}).strict();
|
|
1665
1987
|
var { action: listAllInstanceTypeFamilies, safeAction: safeListAllInstanceTypeFamilies } = defineAction(
|
|
1666
1988
|
AllFamiliesResponseSchema,
|
|
@@ -1674,25 +1996,32 @@ var { action: listFamilyInstanceTypes, safeAction: safeListFamilyInstanceTypes }
|
|
|
1674
1996
|
});
|
|
1675
1997
|
|
|
1676
1998
|
// src/actions/workspaces/list_workspaces.ts
|
|
1677
|
-
var
|
|
1678
|
-
var WorkspaceResponseSchema =
|
|
1679
|
-
id:
|
|
1680
|
-
name:
|
|
1681
|
-
slug:
|
|
1682
|
-
avatar_url:
|
|
1683
|
-
tier:
|
|
1684
|
-
role:
|
|
1685
|
-
is_default:
|
|
1686
|
-
created_at:
|
|
1687
|
-
confidential_models_enabled:
|
|
1999
|
+
var import_zod10 = require("zod");
|
|
2000
|
+
var WorkspaceResponseSchema = import_zod10.z.object({
|
|
2001
|
+
id: import_zod10.z.string(),
|
|
2002
|
+
name: import_zod10.z.string(),
|
|
2003
|
+
slug: import_zod10.z.string().nullable(),
|
|
2004
|
+
avatar_url: import_zod10.z.string().nullable().optional(),
|
|
2005
|
+
tier: import_zod10.z.string(),
|
|
2006
|
+
role: import_zod10.z.string(),
|
|
2007
|
+
is_default: import_zod10.z.boolean(),
|
|
2008
|
+
created_at: import_zod10.z.string(),
|
|
2009
|
+
confidential_models_enabled: import_zod10.z.boolean().optional(),
|
|
2010
|
+
/**
|
|
2011
|
+
* Billing lifecycle state. A suspended workspace still runs but owes money;
|
|
2012
|
+
* an abandoned one is closed and read-only until its balance is settled.
|
|
2013
|
+
*/
|
|
2014
|
+
billing_status: import_zod10.z.enum(["active", "suspended", "abandoned"]).default("active"),
|
|
2015
|
+
/** When the workspace was suspended. Null unless billing_status is suspended. */
|
|
2016
|
+
suspended_at: import_zod10.z.string().nullable().optional()
|
|
1688
2017
|
}).passthrough();
|
|
1689
|
-
var PaginationMetadataSchema =
|
|
1690
|
-
has_more:
|
|
1691
|
-
next_cursor:
|
|
1692
|
-
total:
|
|
2018
|
+
var PaginationMetadataSchema = import_zod10.z.object({
|
|
2019
|
+
has_more: import_zod10.z.boolean(),
|
|
2020
|
+
next_cursor: import_zod10.z.string().nullable(),
|
|
2021
|
+
total: import_zod10.z.number().nullable()
|
|
1693
2022
|
}).passthrough();
|
|
1694
|
-
var ListWorkspacesSchema =
|
|
1695
|
-
data:
|
|
2023
|
+
var ListWorkspacesSchema = import_zod10.z.object({
|
|
2024
|
+
data: import_zod10.z.array(WorkspaceResponseSchema),
|
|
1696
2025
|
pagination: PaginationMetadataSchema
|
|
1697
2026
|
}).passthrough();
|
|
1698
2027
|
var { action: listWorkspaces, safeAction: safeListWorkspaces } = defineAction(ListWorkspacesSchema, async (client, request) => {
|
|
@@ -1708,235 +2037,6 @@ var { action: getWorkspace, safeAction: safeGetWorkspace } = defineAction(Worksp
|
|
|
1708
2037
|
return await client.get(`/workspaces/${teamSlug}`);
|
|
1709
2038
|
});
|
|
1710
2039
|
|
|
1711
|
-
// src/types/cvm_info_v20251028.ts
|
|
1712
|
-
var import_zod9 = require("zod");
|
|
1713
|
-
var TableIdSchema = import_zod9.z.union([import_zod9.z.number(), import_zod9.z.string()]);
|
|
1714
|
-
var VmInfoV20251028Schema = import_zod9.z.object({
|
|
1715
|
-
id: import_zod9.z.string(),
|
|
1716
|
-
name: import_zod9.z.string(),
|
|
1717
|
-
status: import_zod9.z.string(),
|
|
1718
|
-
uptime: import_zod9.z.string(),
|
|
1719
|
-
app_url: import_zod9.z.string().nullable(),
|
|
1720
|
-
app_id: import_zod9.z.string(),
|
|
1721
|
-
instance_id: import_zod9.z.string().nullable(),
|
|
1722
|
-
configuration: import_zod9.z.any().optional(),
|
|
1723
|
-
exited_at: import_zod9.z.string().nullable(),
|
|
1724
|
-
boot_progress: import_zod9.z.string().nullable(),
|
|
1725
|
-
boot_error: import_zod9.z.string().nullable(),
|
|
1726
|
-
shutdown_progress: import_zod9.z.string().nullable(),
|
|
1727
|
-
image_version: import_zod9.z.string().nullable()
|
|
1728
|
-
});
|
|
1729
|
-
var ManagedUserV20251028Schema = import_zod9.z.object({
|
|
1730
|
-
id: TableIdSchema,
|
|
1731
|
-
username: import_zod9.z.string()
|
|
1732
|
-
});
|
|
1733
|
-
var CvmNodeV20251028Schema = import_zod9.z.object({
|
|
1734
|
-
id: import_zod9.z.number(),
|
|
1735
|
-
name: import_zod9.z.string(),
|
|
1736
|
-
region_identifier: import_zod9.z.string().nullable().optional()
|
|
1737
|
-
});
|
|
1738
|
-
var MachineInfoV20251028Schema = import_zod9.z.object({
|
|
1739
|
-
vcpu: import_zod9.z.number(),
|
|
1740
|
-
memory: import_zod9.z.number(),
|
|
1741
|
-
disk_size: import_zod9.z.number(),
|
|
1742
|
-
gpu_count: import_zod9.z.number().default(0)
|
|
1743
|
-
});
|
|
1744
|
-
var CvmNetworkUrlsV20251028Schema = import_zod9.z.object({
|
|
1745
|
-
app: import_zod9.z.string(),
|
|
1746
|
-
instance: import_zod9.z.string()
|
|
1747
|
-
});
|
|
1748
|
-
var CvmInfoV20251028Schema = import_zod9.z.object({
|
|
1749
|
-
hosted: VmInfoV20251028Schema,
|
|
1750
|
-
name: import_zod9.z.string(),
|
|
1751
|
-
managed_user: ManagedUserV20251028Schema.nullable(),
|
|
1752
|
-
node: CvmNodeV20251028Schema.nullable(),
|
|
1753
|
-
listed: import_zod9.z.boolean().default(false),
|
|
1754
|
-
status: import_zod9.z.string(),
|
|
1755
|
-
in_progress: import_zod9.z.boolean().default(false),
|
|
1756
|
-
dapp_dashboard_url: import_zod9.z.string().nullable(),
|
|
1757
|
-
syslog_endpoint: import_zod9.z.string().nullable(),
|
|
1758
|
-
allow_upgrade: import_zod9.z.boolean().default(false),
|
|
1759
|
-
project_id: import_zod9.z.string().nullable(),
|
|
1760
|
-
project_type: import_zod9.z.string().nullable(),
|
|
1761
|
-
billing_period: import_zod9.z.string().nullable(),
|
|
1762
|
-
kms_info: KmsInfoSchema.nullable(),
|
|
1763
|
-
vcpu: import_zod9.z.number().nullable(),
|
|
1764
|
-
memory: import_zod9.z.number().nullable(),
|
|
1765
|
-
disk_size: import_zod9.z.number().nullable(),
|
|
1766
|
-
gateway_domain: import_zod9.z.string().nullable(),
|
|
1767
|
-
public_urls: import_zod9.z.array(CvmNetworkUrlsV20251028Schema),
|
|
1768
|
-
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
1769
|
-
updated_at: import_zod9.z.string().nullable().optional()
|
|
1770
|
-
});
|
|
1771
|
-
var CvmDetailV20251028Schema = import_zod9.z.object({
|
|
1772
|
-
id: TableIdSchema,
|
|
1773
|
-
name: import_zod9.z.string(),
|
|
1774
|
-
status: import_zod9.z.string(),
|
|
1775
|
-
in_progress: import_zod9.z.boolean().optional().default(false),
|
|
1776
|
-
teepod_id: import_zod9.z.number().nullable(),
|
|
1777
|
-
teepod: CvmNodeV20251028Schema.optional().nullable(),
|
|
1778
|
-
app_id: import_zod9.z.string(),
|
|
1779
|
-
vm_uuid: import_zod9.z.string().nullable(),
|
|
1780
|
-
instance_id: import_zod9.z.string().nullable(),
|
|
1781
|
-
vcpu: import_zod9.z.number(),
|
|
1782
|
-
memory: import_zod9.z.number(),
|
|
1783
|
-
disk_size: import_zod9.z.number(),
|
|
1784
|
-
base_image: import_zod9.z.string().nullable(),
|
|
1785
|
-
encrypted_env_pubkey: import_zod9.z.string().nullable(),
|
|
1786
|
-
listed: import_zod9.z.boolean().optional().default(false),
|
|
1787
|
-
project_id: import_zod9.z.string().optional().nullable(),
|
|
1788
|
-
project_type: import_zod9.z.string().optional().nullable(),
|
|
1789
|
-
instance_type: import_zod9.z.string().optional().nullable(),
|
|
1790
|
-
public_sysinfo: import_zod9.z.boolean().optional().default(false),
|
|
1791
|
-
public_logs: import_zod9.z.boolean().optional().default(false),
|
|
1792
|
-
dapp_dashboard_url: import_zod9.z.string().optional().nullable(),
|
|
1793
|
-
syslog_endpoint: import_zod9.z.string().optional().nullable(),
|
|
1794
|
-
kms_info: KmsInfoSchema.optional().nullable(),
|
|
1795
|
-
contract_address: import_zod9.z.string().optional().nullable(),
|
|
1796
|
-
deployer_address: import_zod9.z.string().optional().nullable(),
|
|
1797
|
-
scheduled_delete_at: import_zod9.z.string().optional().nullable(),
|
|
1798
|
-
public_urls: import_zod9.z.array(CvmNetworkUrlsV20251028Schema).optional().default([]),
|
|
1799
|
-
gateway_domain: import_zod9.z.string().optional().nullable(),
|
|
1800
|
-
machine_info: MachineInfoV20251028Schema.optional().nullable(),
|
|
1801
|
-
updated_at: import_zod9.z.string().optional().nullable()
|
|
1802
|
-
});
|
|
1803
|
-
var PaginatedCvmInfosV20251028Schema = import_zod9.z.object({
|
|
1804
|
-
items: import_zod9.z.array(CvmInfoV20251028Schema),
|
|
1805
|
-
total: import_zod9.z.number(),
|
|
1806
|
-
page: import_zod9.z.number(),
|
|
1807
|
-
page_size: import_zod9.z.number(),
|
|
1808
|
-
pages: import_zod9.z.number()
|
|
1809
|
-
});
|
|
1810
|
-
|
|
1811
|
-
// src/types/cvm_info_v20260121.ts
|
|
1812
|
-
var import_zod10 = require("zod");
|
|
1813
|
-
var BillingPeriodSchema = import_zod10.z.enum(["skip", "hourly", "monthly"]);
|
|
1814
|
-
var KmsTypeSchema = import_zod10.z.enum(["phala", "ethereum", "base", "legacy"]);
|
|
1815
|
-
var UserRefSchema = import_zod10.z.object({
|
|
1816
|
-
object_type: import_zod10.z.literal("user"),
|
|
1817
|
-
id: import_zod10.z.string().nullable().optional(),
|
|
1818
|
-
username: import_zod10.z.string().nullable().optional(),
|
|
1819
|
-
avatar_url: import_zod10.z.string().nullable().optional()
|
|
1820
|
-
});
|
|
1821
|
-
var WorkspaceRefSchema = import_zod10.z.object({
|
|
1822
|
-
object_type: import_zod10.z.literal("workspace"),
|
|
1823
|
-
id: import_zod10.z.string(),
|
|
1824
|
-
name: import_zod10.z.string(),
|
|
1825
|
-
slug: import_zod10.z.string().nullable().optional(),
|
|
1826
|
-
avatar_url: import_zod10.z.string().nullable().optional()
|
|
1827
|
-
});
|
|
1828
|
-
var CvmResourceInfoV20260121Schema = import_zod10.z.object({
|
|
1829
|
-
instance_type: import_zod10.z.string().nullable().optional(),
|
|
1830
|
-
vcpu: import_zod10.z.number().int().nullable().optional(),
|
|
1831
|
-
memory_in_gb: import_zod10.z.number().nullable().optional(),
|
|
1832
|
-
disk_in_gb: import_zod10.z.number().int().nullable().optional(),
|
|
1833
|
-
gpus: import_zod10.z.number().int().nullable().optional(),
|
|
1834
|
-
compute_billing_price: import_zod10.z.string().nullable().optional(),
|
|
1835
|
-
billing_period: BillingPeriodSchema.nullable().optional()
|
|
1836
|
-
});
|
|
1837
|
-
var CvmOsInfoV20260121Schema = import_zod10.z.object({
|
|
1838
|
-
name: import_zod10.z.string().nullable().optional(),
|
|
1839
|
-
version: import_zod10.z.string().nullable().optional(),
|
|
1840
|
-
is_dev: import_zod10.z.boolean().nullable().optional(),
|
|
1841
|
-
os_image_hash: import_zod10.z.string().nullable().optional()
|
|
1842
|
-
});
|
|
1843
|
-
var CvmKmsInfoV20260121BaseSchema = import_zod10.z.object({
|
|
1844
|
-
chain_id: import_zod10.z.number().int().nullable().optional(),
|
|
1845
|
-
dstack_kms_address: import_zod10.z.string().nullable().optional(),
|
|
1846
|
-
dstack_app_address: import_zod10.z.string().nullable().optional(),
|
|
1847
|
-
deployer_address: import_zod10.z.string().nullable().optional(),
|
|
1848
|
-
rpc_endpoint: import_zod10.z.string().nullable().optional(),
|
|
1849
|
-
encrypted_env_pubkey: import_zod10.z.string().nullable().optional()
|
|
1850
|
-
});
|
|
1851
|
-
var CvmKmsInfoV20260121Schema = CvmKmsInfoV20260121BaseSchema.transform((data) => {
|
|
1852
|
-
if (data.chain_id != null) {
|
|
1853
|
-
const chain = SUPPORTED_CHAINS[data.chain_id];
|
|
1854
|
-
if (chain) {
|
|
1855
|
-
return { ...data, chain };
|
|
1856
|
-
}
|
|
1857
|
-
}
|
|
1858
|
-
return data;
|
|
1859
|
-
});
|
|
1860
|
-
var CvmProgressInfoV20260121Schema = import_zod10.z.object({
|
|
1861
|
-
target: import_zod10.z.string().nullable().optional(),
|
|
1862
|
-
started_at: import_zod10.z.string().nullable().optional(),
|
|
1863
|
-
correlation_id: import_zod10.z.string().nullable().optional()
|
|
1864
|
-
});
|
|
1865
|
-
var CvmGatewayInfoV20260121Schema = import_zod10.z.object({
|
|
1866
|
-
base_domain: import_zod10.z.string().nullable().optional(),
|
|
1867
|
-
cname: import_zod10.z.string().nullable().optional()
|
|
1868
|
-
});
|
|
1869
|
-
var CvmLogUrlsV20260121Schema = import_zod10.z.object({
|
|
1870
|
-
serial: import_zod10.z.string().nullable().optional(),
|
|
1871
|
-
stdout: import_zod10.z.string().nullable().optional(),
|
|
1872
|
-
stderr: import_zod10.z.string().nullable().optional(),
|
|
1873
|
-
container_log_base: import_zod10.z.string().nullable().optional()
|
|
1874
|
-
});
|
|
1875
|
-
var NodeRefSchema = import_zod10.z.object({
|
|
1876
|
-
object_type: import_zod10.z.literal("node"),
|
|
1877
|
-
id: import_zod10.z.number().int().nullable().optional(),
|
|
1878
|
-
name: import_zod10.z.string().nullable().optional(),
|
|
1879
|
-
region: import_zod10.z.string().nullable().optional(),
|
|
1880
|
-
device_id: import_zod10.z.string().nullable().optional(),
|
|
1881
|
-
ppid: import_zod10.z.string().nullable().optional(),
|
|
1882
|
-
status: import_zod10.z.string().nullable().optional(),
|
|
1883
|
-
version: import_zod10.z.string().nullable().optional()
|
|
1884
|
-
});
|
|
1885
|
-
var CvmNodeInfoV20260121Schema = NodeRefSchema;
|
|
1886
|
-
var CvmInfoV20260121Schema = import_zod10.z.object({
|
|
1887
|
-
id: import_zod10.z.string(),
|
|
1888
|
-
name: import_zod10.z.string(),
|
|
1889
|
-
app_id: import_zod10.z.string().nullable().optional(),
|
|
1890
|
-
vm_uuid: import_zod10.z.string().nullable().optional(),
|
|
1891
|
-
instance_id: import_zod10.z.string().nullable().optional(),
|
|
1892
|
-
resource: CvmResourceInfoV20260121Schema,
|
|
1893
|
-
node_info: NodeRefSchema.nullable().optional(),
|
|
1894
|
-
os: CvmOsInfoV20260121Schema.nullable().optional(),
|
|
1895
|
-
kms_type: KmsTypeSchema.nullable().optional(),
|
|
1896
|
-
kms_info: CvmKmsInfoV20260121Schema.nullable().optional(),
|
|
1897
|
-
status: import_zod10.z.string(),
|
|
1898
|
-
in_progress: import_zod10.z.boolean().optional().default(false),
|
|
1899
|
-
progress: CvmProgressInfoV20260121Schema.nullable().optional(),
|
|
1900
|
-
compose_hash: import_zod10.z.string().nullable().optional(),
|
|
1901
|
-
docker_compose_hash: import_zod10.z.string().nullable().optional(),
|
|
1902
|
-
pre_launch_script_hash: import_zod10.z.string().nullable().optional(),
|
|
1903
|
-
gateway: CvmGatewayInfoV20260121Schema,
|
|
1904
|
-
logs: CvmLogUrlsV20260121Schema.optional().default({}),
|
|
1905
|
-
services: import_zod10.z.array(import_zod10.z.record(import_zod10.z.any())).optional().default([]),
|
|
1906
|
-
endpoints: import_zod10.z.array(CvmNetworkUrlsV20251028Schema).nullable().optional(),
|
|
1907
|
-
public_logs: import_zod10.z.boolean().optional(),
|
|
1908
|
-
public_sysinfo: import_zod10.z.boolean().optional(),
|
|
1909
|
-
public_tcbinfo: import_zod10.z.boolean().optional(),
|
|
1910
|
-
gateway_enabled: import_zod10.z.boolean().optional(),
|
|
1911
|
-
secure_time: import_zod10.z.boolean().optional(),
|
|
1912
|
-
listed: import_zod10.z.boolean().optional().default(false),
|
|
1913
|
-
storage_fs: import_zod10.z.string().optional(),
|
|
1914
|
-
workspace: WorkspaceRefSchema.nullable().optional(),
|
|
1915
|
-
creator: UserRefSchema.nullable().optional(),
|
|
1916
|
-
created_at: import_zod10.z.string().nullable().optional(),
|
|
1917
|
-
deleted_at: import_zod10.z.string().nullable().optional(),
|
|
1918
|
-
project_type: import_zod10.z.string().nullable().optional()
|
|
1919
|
-
});
|
|
1920
|
-
var CvmInfoV20260522Schema = CvmInfoV20260121Schema.extend({
|
|
1921
|
-
id: import_zod10.z.string()
|
|
1922
|
-
});
|
|
1923
|
-
var CvmInfoDetailV20260121Schema = CvmInfoV20260121Schema.extend({
|
|
1924
|
-
compose_file: import_zod10.z.union([import_zod10.z.record(import_zod10.z.any()), import_zod10.z.string()]).nullable().optional()
|
|
1925
|
-
});
|
|
1926
|
-
var CvmInfoDetailV20260522Schema = CvmInfoV20260522Schema.extend({
|
|
1927
|
-
compose_file: import_zod10.z.union([import_zod10.z.record(import_zod10.z.any()), import_zod10.z.string()]).nullable().optional()
|
|
1928
|
-
});
|
|
1929
|
-
var PaginatedCvmInfosV20260121Schema = import_zod10.z.object({
|
|
1930
|
-
items: import_zod10.z.array(CvmInfoV20260121Schema),
|
|
1931
|
-
total: import_zod10.z.number(),
|
|
1932
|
-
page: import_zod10.z.number(),
|
|
1933
|
-
page_size: import_zod10.z.number(),
|
|
1934
|
-
pages: import_zod10.z.number()
|
|
1935
|
-
});
|
|
1936
|
-
var PaginatedCvmInfosV20260522Schema = PaginatedCvmInfosV20260121Schema.extend({
|
|
1937
|
-
items: import_zod10.z.array(CvmInfoV20260522Schema)
|
|
1938
|
-
});
|
|
1939
|
-
|
|
1940
2040
|
// src/types/cvm_id.ts
|
|
1941
2041
|
var import_zod11 = require("zod");
|
|
1942
2042
|
|
|
@@ -2087,9 +2187,8 @@ var import_zod12 = require("zod");
|
|
|
2087
2187
|
var GetCvmListRequestSchema = import_zod12.z.object({
|
|
2088
2188
|
page: import_zod12.z.number().int().min(1).optional(),
|
|
2089
2189
|
page_size: import_zod12.z.number().int().min(1).optional(),
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
user_id: import_zod12.z.string().optional()
|
|
2190
|
+
family: import_zod12.z.enum(["all", "cpu", "gpu"]).optional(),
|
|
2191
|
+
instance_types: import_zod12.z.array(import_zod12.z.string()).optional()
|
|
2093
2192
|
}).strict();
|
|
2094
2193
|
function getSchemaForVersion4(version) {
|
|
2095
2194
|
if (version === "2025-10-28") return PaginatedCvmInfosV20251028Schema;
|
|
@@ -2146,10 +2245,18 @@ var LooseAppComposeSchema = import_zod13.z.object({
|
|
|
2146
2245
|
features: import_zod13.z.array(import_zod13.z.string()).optional(),
|
|
2147
2246
|
name: import_zod13.z.string().optional(),
|
|
2148
2247
|
manifest_version: import_zod13.z.number().optional(),
|
|
2248
|
+
runner: import_zod13.z.string().optional(),
|
|
2149
2249
|
kms_enabled: import_zod13.z.boolean().optional(),
|
|
2250
|
+
gateway_enabled: import_zod13.z.boolean().optional(),
|
|
2251
|
+
tproxy_enabled: import_zod13.z.boolean().optional(),
|
|
2252
|
+
local_key_provider_enabled: import_zod13.z.boolean().optional(),
|
|
2253
|
+
key_provider: import_zod13.z.enum(["none", "kms", "local", "tpm"]).optional(),
|
|
2254
|
+
key_provider_id: import_zod13.z.string().optional(),
|
|
2150
2255
|
public_logs: import_zod13.z.boolean().optional(),
|
|
2151
2256
|
public_sysinfo: import_zod13.z.boolean().optional(),
|
|
2152
|
-
|
|
2257
|
+
public_tcbinfo: import_zod13.z.boolean().optional(),
|
|
2258
|
+
no_instance_id: import_zod13.z.boolean().optional(),
|
|
2259
|
+
secure_time: import_zod13.z.boolean().optional(),
|
|
2153
2260
|
port_policy: import_zod13.z.object({
|
|
2154
2261
|
ports: import_zod13.z.array(
|
|
2155
2262
|
import_zod13.z.object({
|
|
@@ -2160,6 +2267,7 @@ var LooseAppComposeSchema = import_zod13.z.object({
|
|
|
2160
2267
|
restrict_mode: import_zod13.z.boolean()
|
|
2161
2268
|
}).optional(),
|
|
2162
2269
|
storage_fs: import_zod13.z.enum(["ext4", "zfs"]).optional(),
|
|
2270
|
+
swap_size: import_zod13.z.string().optional(),
|
|
2163
2271
|
pre_launch_script: import_zod13.z.string().optional(),
|
|
2164
2272
|
env_pubkey: import_zod13.z.string().optional(),
|
|
2165
2273
|
salt: import_zod13.z.string().optional().nullable()
|
|
@@ -2180,7 +2288,9 @@ var ProvisionCvmSchema = import_zod14.z.object({
|
|
|
2180
2288
|
teepod_id: import_zod14.z.number().nullable().optional(),
|
|
2181
2289
|
// Will be transformed to node_id
|
|
2182
2290
|
node_id: import_zod14.z.number().nullable().optional(),
|
|
2183
|
-
|
|
2291
|
+
/** @deprecated Identifies a KMS node, not the on-chain KMS contract. Use kms_contract_id. */
|
|
2292
|
+
kms_id: import_zod14.z.string().nullable().optional(),
|
|
2293
|
+
kms_contract_id: import_zod14.z.union([import_zod14.z.string(), import_zod14.z.number()]).nullable().optional()
|
|
2184
2294
|
}).passthrough().transform((data) => {
|
|
2185
2295
|
if ("teepod_id" in data && data.teepod_id !== void 0) {
|
|
2186
2296
|
const { teepod_id, ...rest } = data;
|
|
@@ -2212,13 +2322,24 @@ var ProvisionCvmRequestSchema = import_zod14.z.object({
|
|
|
2212
2322
|
name: import_zod14.z.string().optional().default(""),
|
|
2213
2323
|
// optional with default empty string
|
|
2214
2324
|
kms_enabled: import_zod14.z.boolean().optional(),
|
|
2215
|
-
public_logs: import_zod14.z.boolean().optional(),
|
|
2216
|
-
public_sysinfo: import_zod14.z.boolean().optional(),
|
|
2217
2325
|
gateway_enabled: import_zod14.z.boolean().optional(),
|
|
2218
2326
|
// recommended
|
|
2219
2327
|
tproxy_enabled: import_zod14.z.boolean().optional(),
|
|
2220
2328
|
// deprecated, for compatibility
|
|
2221
|
-
|
|
2329
|
+
local_key_provider_enabled: import_zod14.z.boolean().optional(),
|
|
2330
|
+
key_provider: import_zod14.z.enum(["none", "kms", "local", "tpm"]).optional(),
|
|
2331
|
+
key_provider_id: import_zod14.z.string().optional(),
|
|
2332
|
+
public_logs: import_zod14.z.boolean().optional(),
|
|
2333
|
+
public_sysinfo: import_zod14.z.boolean().optional(),
|
|
2334
|
+
public_tcbinfo: import_zod14.z.boolean().optional(),
|
|
2335
|
+
no_instance_id: import_zod14.z.boolean().optional(),
|
|
2336
|
+
secure_time: import_zod14.z.boolean().optional(),
|
|
2337
|
+
storage_fs: import_zod14.z.enum(["ext4", "zfs"]).optional(),
|
|
2338
|
+
swap_size: import_zod14.z.string().optional(),
|
|
2339
|
+
port_policy: import_zod14.z.object({
|
|
2340
|
+
ports: import_zod14.z.array(import_zod14.z.object({ port: import_zod14.z.number(), pp: import_zod14.z.boolean() })),
|
|
2341
|
+
restrict_mode: import_zod14.z.boolean()
|
|
2342
|
+
}).optional()
|
|
2222
2343
|
}).passthrough().superRefine((data, ctx) => {
|
|
2223
2344
|
validateComposePayloadSize(data.docker_compose_file, data.pre_launch_script, ctx);
|
|
2224
2345
|
}),
|
|
@@ -2319,14 +2440,40 @@ var CommitCvmProvisionRequestSchema = import_zod15.z.object({
|
|
|
2319
2440
|
encrypted_env: import_zod15.z.string().optional().nullable(),
|
|
2320
2441
|
app_id: import_zod15.z.string(),
|
|
2321
2442
|
compose_hash: import_zod15.z.string(),
|
|
2443
|
+
/** @deprecated Identifies a KMS node, not the on-chain KMS contract. Use kms_contract_id. */
|
|
2322
2444
|
kms_id: import_zod15.z.string().optional(),
|
|
2445
|
+
kms_contract_id: import_zod15.z.union([import_zod15.z.string(), import_zod15.z.number()]).optional(),
|
|
2323
2446
|
contract_address: import_zod15.z.string().optional(),
|
|
2324
2447
|
deployer_address: import_zod15.z.string().optional(),
|
|
2325
2448
|
env_keys: import_zod15.z.array(import_zod15.z.string()).optional().nullable()
|
|
2326
2449
|
}).passthrough();
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2450
|
+
function getSchemaForVersion5(version) {
|
|
2451
|
+
if (version === "2026-01-21") return CommitCvmProvisionV20260121Schema;
|
|
2452
|
+
return CommitCvmProvisionV20260522Schema;
|
|
2453
|
+
}
|
|
2454
|
+
async function commitCvmProvision(client, payload) {
|
|
2455
|
+
const response = await client.post("/cvms", payload);
|
|
2456
|
+
return getSchemaForVersion5(client.config.version).parse(
|
|
2457
|
+
response
|
|
2458
|
+
);
|
|
2459
|
+
}
|
|
2460
|
+
async function safeCommitCvmProvision(client, payload) {
|
|
2461
|
+
try {
|
|
2462
|
+
const data = await commitCvmProvision(client, payload);
|
|
2463
|
+
return { success: true, data };
|
|
2464
|
+
} catch (error) {
|
|
2465
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
2466
|
+
return { success: false, error };
|
|
2467
|
+
}
|
|
2468
|
+
return {
|
|
2469
|
+
success: false,
|
|
2470
|
+
error: {
|
|
2471
|
+
name: "Error",
|
|
2472
|
+
message: error instanceof Error ? error.message : String(error)
|
|
2473
|
+
}
|
|
2474
|
+
};
|
|
2475
|
+
}
|
|
2476
|
+
}
|
|
2330
2477
|
|
|
2331
2478
|
// src/utils/get_compose_hash.ts
|
|
2332
2479
|
var import_crypto = __toESM(require("crypto"));
|
|
@@ -2417,7 +2564,8 @@ var ProvisionCvmComposeFileUpdateResultSchema = import_zod16.z.object({
|
|
|
2417
2564
|
device_id: import_zod16.z.string().nullable(),
|
|
2418
2565
|
compose_hash: import_zod16.z.string(),
|
|
2419
2566
|
kms_info: KmsInfoSchema.nullable().optional(),
|
|
2420
|
-
compose_hash_registered: import_zod16.z.boolean().optional().default(false)
|
|
2567
|
+
compose_hash_registered: import_zod16.z.boolean().optional().default(false),
|
|
2568
|
+
compose_unchanged: import_zod16.z.boolean().optional().default(false)
|
|
2421
2569
|
}).passthrough();
|
|
2422
2570
|
var { action: provisionCvmComposeFileUpdate, safeAction: safeProvisionCvmComposeFileUpdate } = defineAction(ProvisionCvmComposeFileUpdateResultSchema, async (client, request) => {
|
|
2423
2571
|
const validatedRequest = ProvisionCvmComposeFileUpdateRequestSchema.parse(request);
|
|
@@ -2581,9 +2729,14 @@ var UpdateDockerComposePreconditionRequiredSchema = import_zod19.z.object({
|
|
|
2581
2729
|
device_id: import_zod19.z.string(),
|
|
2582
2730
|
kms_info: KmsInfoSchema
|
|
2583
2731
|
});
|
|
2732
|
+
var UpdateDockerComposeNoChangeSchema = import_zod19.z.object({
|
|
2733
|
+
status: import_zod19.z.literal("no_change"),
|
|
2734
|
+
message: import_zod19.z.string()
|
|
2735
|
+
});
|
|
2584
2736
|
var UpdateDockerComposeResultSchema = import_zod19.z.union([
|
|
2585
2737
|
UpdateDockerComposeInProgressSchema,
|
|
2586
|
-
UpdateDockerComposePreconditionRequiredSchema
|
|
2738
|
+
UpdateDockerComposePreconditionRequiredSchema,
|
|
2739
|
+
UpdateDockerComposeNoChangeSchema
|
|
2587
2740
|
]);
|
|
2588
2741
|
var { action: updateDockerCompose, safeAction: safeUpdateDockerCompose } = defineAction(UpdateDockerComposeResultSchema, async (client, request) => {
|
|
2589
2742
|
const validatedRequest = UpdateDockerComposeRequestSchema.parse(request);
|
|
@@ -2665,9 +2818,14 @@ var UpdatePreLaunchScriptPreconditionRequiredSchema = import_zod20.z.object({
|
|
|
2665
2818
|
device_id: import_zod20.z.string(),
|
|
2666
2819
|
kms_info: KmsInfoSchema
|
|
2667
2820
|
});
|
|
2821
|
+
var UpdatePreLaunchScriptNoChangeSchema = import_zod20.z.object({
|
|
2822
|
+
status: import_zod20.z.literal("no_change"),
|
|
2823
|
+
message: import_zod20.z.string()
|
|
2824
|
+
});
|
|
2668
2825
|
var UpdatePreLaunchScriptResultSchema = import_zod20.z.union([
|
|
2669
2826
|
UpdatePreLaunchScriptInProgressSchema,
|
|
2670
|
-
UpdatePreLaunchScriptPreconditionRequiredSchema
|
|
2827
|
+
UpdatePreLaunchScriptPreconditionRequiredSchema,
|
|
2828
|
+
UpdatePreLaunchScriptNoChangeSchema
|
|
2671
2829
|
]);
|
|
2672
2830
|
var { action: updatePreLaunchScript, safeAction: safeUpdatePreLaunchScript } = defineAction(UpdatePreLaunchScriptResultSchema, async (client, request) => {
|
|
2673
2831
|
const validatedRequest = UpdatePreLaunchScriptRequestSchema.parse(request);
|
|
@@ -2829,7 +2987,9 @@ var GetKmsInfoRequestSchema = import_zod24.z.object({
|
|
|
2829
2987
|
});
|
|
2830
2988
|
var { action: getKmsInfo, safeAction: safeGetKmsInfo } = defineAction(KmsInfoSchema, async (client, request) => {
|
|
2831
2989
|
const validatedRequest = GetKmsInfoRequestSchema.parse(request);
|
|
2832
|
-
return await client.get(`/kms/${validatedRequest.kms_id}
|
|
2990
|
+
return await client.get(`/kms/${validatedRequest.kms_id}`, {
|
|
2991
|
+
headers: { "X-Phala-Version": "2026-05-22" }
|
|
2992
|
+
});
|
|
2833
2993
|
});
|
|
2834
2994
|
|
|
2835
2995
|
// src/actions/kms/get_kms_list.ts
|
|
@@ -2848,37 +3008,119 @@ var GetKmsListSchema = import_zod25.z.object({
|
|
|
2848
3008
|
}).strict();
|
|
2849
3009
|
var { action: getKmsList, safeAction: safeGetKmsList } = defineAction(GetKmsListSchema, async (client, request) => {
|
|
2850
3010
|
const validatedRequest = GetKmsListRequestSchema.parse(request ?? {});
|
|
2851
|
-
return await client.get("/kms", {
|
|
3011
|
+
return await client.get("/kms", {
|
|
3012
|
+
params: validatedRequest,
|
|
3013
|
+
headers: { "X-Phala-Version": "2026-05-22" }
|
|
3014
|
+
});
|
|
2852
3015
|
});
|
|
2853
3016
|
|
|
2854
|
-
// src/actions/kms/
|
|
3017
|
+
// src/actions/kms/list_kms_contracts.ts
|
|
3018
|
+
var import_zod27 = require("zod");
|
|
3019
|
+
|
|
3020
|
+
// src/types/kms_contract.ts
|
|
2855
3021
|
var import_zod26 = require("zod");
|
|
2856
|
-
var
|
|
2857
|
-
|
|
2858
|
-
|
|
3022
|
+
var KmsContractInfoSchema = import_zod26.z.object({
|
|
3023
|
+
id: import_zod26.z.string(),
|
|
3024
|
+
slug: import_zod26.z.string().nullable(),
|
|
3025
|
+
label: import_zod26.z.string().nullable(),
|
|
3026
|
+
contract_address: import_zod26.z.string(),
|
|
3027
|
+
chain_id: import_zod26.z.number(),
|
|
3028
|
+
k256_pubkey: import_zod26.z.string().nullable(),
|
|
3029
|
+
ca_pubkey: import_zod26.z.string().nullable(),
|
|
3030
|
+
node_count: import_zod26.z.number()
|
|
3031
|
+
}).passthrough();
|
|
3032
|
+
var KmsContractNodeSchema = import_zod26.z.object({
|
|
3033
|
+
id: import_zod26.z.string(),
|
|
3034
|
+
slug: import_zod26.z.string().nullable(),
|
|
3035
|
+
url: import_zod26.z.string(),
|
|
3036
|
+
version: import_zod26.z.string(),
|
|
3037
|
+
kms_type: import_zod26.z.string()
|
|
3038
|
+
}).passthrough();
|
|
3039
|
+
|
|
3040
|
+
// src/actions/kms/list_kms_contracts.ts
|
|
3041
|
+
var KMS_CONTRACT_API_VERSION = "2026-06-23";
|
|
3042
|
+
var ListKmsContractsRequestSchema = import_zod27.z.object({
|
|
3043
|
+
page: import_zod27.z.number().int().min(1).optional(),
|
|
3044
|
+
page_size: import_zod27.z.number().int().min(1).optional(),
|
|
3045
|
+
is_onchain: import_zod27.z.boolean().optional()
|
|
3046
|
+
}).strict();
|
|
3047
|
+
var ListKmsContractsSchema = import_zod27.z.object({
|
|
3048
|
+
items: import_zod27.z.array(KmsContractInfoSchema),
|
|
3049
|
+
total: import_zod27.z.number(),
|
|
3050
|
+
page: import_zod27.z.number(),
|
|
3051
|
+
page_size: import_zod27.z.number(),
|
|
3052
|
+
pages: import_zod27.z.number()
|
|
3053
|
+
}).strict();
|
|
3054
|
+
var { action: listKmsContracts, safeAction: safeListKmsContracts } = defineAction(ListKmsContractsSchema, async (client, request) => {
|
|
3055
|
+
const validatedRequest = ListKmsContractsRequestSchema.parse(request ?? {});
|
|
3056
|
+
return await client.get("/kms", {
|
|
3057
|
+
params: validatedRequest,
|
|
3058
|
+
headers: { "X-Phala-Version": KMS_CONTRACT_API_VERSION }
|
|
3059
|
+
});
|
|
3060
|
+
});
|
|
3061
|
+
|
|
3062
|
+
// src/actions/kms/get_kms_contract.ts
|
|
3063
|
+
var import_zod28 = require("zod");
|
|
3064
|
+
var KMS_CONTRACT_API_VERSION2 = "2026-06-23";
|
|
3065
|
+
var GetKmsContractRequestSchema = import_zod28.z.object({
|
|
3066
|
+
// Contract slug (documented). A kc_ hashed id also resolves.
|
|
3067
|
+
slug: import_zod28.z.string().min(1, "KMS contract slug is required")
|
|
3068
|
+
}).strict();
|
|
3069
|
+
var { action: getKmsContract, safeAction: safeGetKmsContract } = defineAction(KmsContractInfoSchema, async (client, payload) => {
|
|
3070
|
+
const { slug } = GetKmsContractRequestSchema.parse(payload);
|
|
3071
|
+
return await client.get(`/kms/${slug}`, {
|
|
3072
|
+
headers: { "X-Phala-Version": KMS_CONTRACT_API_VERSION2 }
|
|
3073
|
+
});
|
|
3074
|
+
});
|
|
3075
|
+
|
|
3076
|
+
// src/actions/kms/list_kms_contract_nodes.ts
|
|
3077
|
+
var import_zod29 = require("zod");
|
|
3078
|
+
var KMS_CONTRACT_API_VERSION3 = "2026-06-23";
|
|
3079
|
+
var ListKmsContractNodesRequestSchema = import_zod29.z.object({
|
|
3080
|
+
// Contract slug (documented). A kc_ hashed id also resolves.
|
|
3081
|
+
slug: import_zod29.z.string().min(1, "KMS contract slug is required")
|
|
3082
|
+
}).strict();
|
|
3083
|
+
var ListKmsContractNodesSchema = import_zod29.z.object({
|
|
3084
|
+
items: import_zod29.z.array(KmsContractNodeSchema),
|
|
3085
|
+
total: import_zod29.z.number()
|
|
3086
|
+
}).strict();
|
|
3087
|
+
var { action: listKmsContractNodes, safeAction: safeListKmsContractNodes } = defineAction(ListKmsContractNodesSchema, async (client, payload) => {
|
|
3088
|
+
const { slug } = ListKmsContractNodesRequestSchema.parse(payload);
|
|
3089
|
+
return await client.get(`/kms/${slug}/nodes`, {
|
|
3090
|
+
headers: { "X-Phala-Version": KMS_CONTRACT_API_VERSION3 }
|
|
3091
|
+
});
|
|
3092
|
+
});
|
|
3093
|
+
|
|
3094
|
+
// src/actions/kms/get_app_env_encrypt_pubkey.ts
|
|
3095
|
+
var import_zod30 = require("zod");
|
|
3096
|
+
var GetAppEnvEncryptPubKeyRequestSchema = import_zod30.z.object({
|
|
3097
|
+
kms: import_zod30.z.string().min(1, "KMS ID or slug is required"),
|
|
3098
|
+
app_id: import_zod30.z.string().refine(
|
|
2859
3099
|
(val) => val.length === 40 || val.startsWith("0x") && val.length === 42,
|
|
2860
3100
|
"App ID must be exactly 40 characters or 42 characters with 0x prefix"
|
|
2861
3101
|
)
|
|
2862
3102
|
}).strict();
|
|
2863
|
-
var GetAppEnvEncryptPubKeySchema =
|
|
2864
|
-
public_key:
|
|
2865
|
-
signature:
|
|
3103
|
+
var GetAppEnvEncryptPubKeySchema = import_zod30.z.object({
|
|
3104
|
+
public_key: import_zod30.z.string(),
|
|
3105
|
+
signature: import_zod30.z.string()
|
|
2866
3106
|
}).strict();
|
|
2867
3107
|
var { action: getAppEnvEncryptPubKey, safeAction: safeGetAppEnvEncryptPubKey } = defineAction(GetAppEnvEncryptPubKeySchema, async (client, payload) => {
|
|
2868
3108
|
const validatedRequest = GetAppEnvEncryptPubKeyRequestSchema.parse(payload);
|
|
2869
|
-
return await client.get(`/kms/${validatedRequest.kms}/pubkey/${validatedRequest.app_id}
|
|
3109
|
+
return await client.get(`/kms/${validatedRequest.kms}/pubkey/${validatedRequest.app_id}`, {
|
|
3110
|
+
headers: { "X-Phala-Version": "2026-05-22" }
|
|
3111
|
+
});
|
|
2870
3112
|
});
|
|
2871
3113
|
|
|
2872
3114
|
// src/actions/kms/next_app_ids.ts
|
|
2873
|
-
var
|
|
2874
|
-
var NextAppIdsRequestSchema =
|
|
2875
|
-
counts:
|
|
3115
|
+
var import_zod31 = require("zod");
|
|
3116
|
+
var NextAppIdsRequestSchema = import_zod31.z.object({
|
|
3117
|
+
counts: import_zod31.z.number().int().min(1).max(20).optional().default(1)
|
|
2876
3118
|
}).strict();
|
|
2877
|
-
var NextAppIdsSchema =
|
|
2878
|
-
app_ids:
|
|
2879
|
-
|
|
2880
|
-
app_id:
|
|
2881
|
-
nonce:
|
|
3119
|
+
var NextAppIdsSchema = import_zod31.z.object({
|
|
3120
|
+
app_ids: import_zod31.z.array(
|
|
3121
|
+
import_zod31.z.object({
|
|
3122
|
+
app_id: import_zod31.z.string(),
|
|
3123
|
+
nonce: import_zod31.z.number().int().min(0)
|
|
2882
3124
|
})
|
|
2883
3125
|
)
|
|
2884
3126
|
}).strict();
|
|
@@ -2890,41 +3132,41 @@ var { action: nextAppIds, safeAction: safeNextAppIds } = defineAction(NextAppIds
|
|
|
2890
3132
|
});
|
|
2891
3133
|
|
|
2892
3134
|
// src/types/cvm_info.ts
|
|
2893
|
-
var
|
|
2894
|
-
var VMBaseSchema =
|
|
2895
|
-
name:
|
|
2896
|
-
status:
|
|
2897
|
-
teepod_id:
|
|
2898
|
-
teepod:
|
|
2899
|
-
id:
|
|
2900
|
-
name:
|
|
2901
|
-
region_identifier:
|
|
3135
|
+
var import_zod32 = require("zod");
|
|
3136
|
+
var VMBaseSchema = import_zod32.z.object({
|
|
3137
|
+
name: import_zod32.z.string(),
|
|
3138
|
+
status: import_zod32.z.string(),
|
|
3139
|
+
teepod_id: import_zod32.z.number(),
|
|
3140
|
+
teepod: import_zod32.z.object({
|
|
3141
|
+
id: import_zod32.z.number(),
|
|
3142
|
+
name: import_zod32.z.string(),
|
|
3143
|
+
region_identifier: import_zod32.z.string().nullable().optional()
|
|
2902
3144
|
}).optional().nullable(),
|
|
2903
|
-
app_id:
|
|
2904
|
-
vm_uuid:
|
|
2905
|
-
instance_id:
|
|
2906
|
-
app_url:
|
|
2907
|
-
base_image:
|
|
2908
|
-
vcpu:
|
|
2909
|
-
memory:
|
|
2910
|
-
disk_size:
|
|
2911
|
-
manifest_version:
|
|
2912
|
-
version:
|
|
2913
|
-
runner:
|
|
2914
|
-
docker_compose_file:
|
|
2915
|
-
features:
|
|
2916
|
-
created_at:
|
|
2917
|
-
encrypted_env_pubkey:
|
|
3145
|
+
app_id: import_zod32.z.string(),
|
|
3146
|
+
vm_uuid: import_zod32.z.string().nullable(),
|
|
3147
|
+
instance_id: import_zod32.z.string().nullable(),
|
|
3148
|
+
app_url: import_zod32.z.string().optional().nullable(),
|
|
3149
|
+
base_image: import_zod32.z.string().optional().nullable(),
|
|
3150
|
+
vcpu: import_zod32.z.number(),
|
|
3151
|
+
memory: import_zod32.z.number(),
|
|
3152
|
+
disk_size: import_zod32.z.number(),
|
|
3153
|
+
manifest_version: import_zod32.z.number().optional().nullable(),
|
|
3154
|
+
version: import_zod32.z.string().optional().nullable(),
|
|
3155
|
+
runner: import_zod32.z.string().optional().nullable(),
|
|
3156
|
+
docker_compose_file: import_zod32.z.string().optional().nullable(),
|
|
3157
|
+
features: import_zod32.z.array(import_zod32.z.string()).optional().nullable(),
|
|
3158
|
+
created_at: import_zod32.z.string(),
|
|
3159
|
+
encrypted_env_pubkey: import_zod32.z.string().nullable()
|
|
2918
3160
|
});
|
|
2919
3161
|
var VMV20260121Schema = VMBaseSchema.extend({
|
|
2920
|
-
id:
|
|
2921
|
-
user_id:
|
|
3162
|
+
id: import_zod32.z.number(),
|
|
3163
|
+
user_id: import_zod32.z.number().optional().nullable()
|
|
2922
3164
|
});
|
|
2923
3165
|
var VMV20260522Schema = VMBaseSchema.extend({
|
|
2924
|
-
id:
|
|
2925
|
-
user_id:
|
|
3166
|
+
id: import_zod32.z.string(),
|
|
3167
|
+
user_id: import_zod32.z.string().optional().nullable()
|
|
2926
3168
|
});
|
|
2927
|
-
var VMAnySchema =
|
|
3169
|
+
var VMAnySchema = import_zod32.z.union([VMV20260121Schema, VMV20260522Schema]);
|
|
2928
3170
|
var VMSchema = VMV20260522Schema;
|
|
2929
3171
|
function getVMSchemaForVersion(version) {
|
|
2930
3172
|
if (version === "2026-01-21") return VMV20260121Schema;
|
|
@@ -2933,47 +3175,116 @@ function getVMSchemaForVersion(version) {
|
|
|
2933
3175
|
|
|
2934
3176
|
// src/actions/cvms/start_cvm.ts
|
|
2935
3177
|
var StartCvmRequestSchema = CvmIdSchema;
|
|
2936
|
-
|
|
3178
|
+
async function startCvm(client, request) {
|
|
2937
3179
|
const { cvmId } = StartCvmRequestSchema.parse(request);
|
|
2938
|
-
|
|
2939
|
-
|
|
3180
|
+
const response = await client.post(`/cvms/${cvmId}/start`);
|
|
3181
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3182
|
+
}
|
|
3183
|
+
async function safeStartCvm(client, request) {
|
|
3184
|
+
try {
|
|
3185
|
+
const data = await startCvm(client, request);
|
|
3186
|
+
return { success: true, data };
|
|
3187
|
+
} catch (error) {
|
|
3188
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3189
|
+
return { success: false, error };
|
|
3190
|
+
}
|
|
3191
|
+
return {
|
|
3192
|
+
success: false,
|
|
3193
|
+
error: {
|
|
3194
|
+
name: "Error",
|
|
3195
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3196
|
+
}
|
|
3197
|
+
};
|
|
3198
|
+
}
|
|
3199
|
+
}
|
|
2940
3200
|
|
|
2941
3201
|
// src/actions/cvms/stop_cvm.ts
|
|
2942
3202
|
var StopCvmRequestSchema = CvmIdSchema;
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
3203
|
+
async function stopCvm(client, request) {
|
|
3204
|
+
const { cvmId } = StopCvmRequestSchema.parse(request);
|
|
3205
|
+
const response = await client.post(`/cvms/${cvmId}/stop`);
|
|
3206
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3207
|
+
}
|
|
3208
|
+
async function safeStopCvm(client, request) {
|
|
3209
|
+
try {
|
|
3210
|
+
const data = await stopCvm(client, request);
|
|
3211
|
+
return { success: true, data };
|
|
3212
|
+
} catch (error) {
|
|
3213
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3214
|
+
return { success: false, error };
|
|
3215
|
+
}
|
|
3216
|
+
return {
|
|
3217
|
+
success: false,
|
|
3218
|
+
error: {
|
|
3219
|
+
name: "Error",
|
|
3220
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3221
|
+
}
|
|
3222
|
+
};
|
|
2948
3223
|
}
|
|
2949
|
-
|
|
3224
|
+
}
|
|
2950
3225
|
|
|
2951
3226
|
// src/actions/cvms/shutdown_cvm.ts
|
|
2952
3227
|
var ShutdownCvmRequestSchema = CvmIdSchema;
|
|
2953
|
-
|
|
3228
|
+
async function shutdownCvm(client, request) {
|
|
2954
3229
|
const { cvmId } = ShutdownCvmRequestSchema.parse(request);
|
|
2955
|
-
|
|
2956
|
-
|
|
3230
|
+
const response = await client.post(`/cvms/${cvmId}/shutdown`);
|
|
3231
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3232
|
+
}
|
|
3233
|
+
async function safeShutdownCvm(client, request) {
|
|
3234
|
+
try {
|
|
3235
|
+
const data = await shutdownCvm(client, request);
|
|
3236
|
+
return { success: true, data };
|
|
3237
|
+
} catch (error) {
|
|
3238
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3239
|
+
return { success: false, error };
|
|
3240
|
+
}
|
|
3241
|
+
return {
|
|
3242
|
+
success: false,
|
|
3243
|
+
error: {
|
|
3244
|
+
name: "Error",
|
|
3245
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3246
|
+
}
|
|
3247
|
+
};
|
|
3248
|
+
}
|
|
3249
|
+
}
|
|
2957
3250
|
|
|
2958
3251
|
// src/actions/cvms/restart_cvm.ts
|
|
2959
|
-
var
|
|
3252
|
+
var import_zod33 = require("zod");
|
|
2960
3253
|
var RestartCvmRequestSchema = refineCvmId(
|
|
2961
3254
|
CvmIdObjectSchema.extend({
|
|
2962
|
-
force:
|
|
3255
|
+
force: import_zod33.z.boolean().optional()
|
|
2963
3256
|
})
|
|
2964
3257
|
);
|
|
2965
|
-
|
|
3258
|
+
async function restartCvm(client, request) {
|
|
2966
3259
|
const parsed = RestartCvmRequestSchema.parse(request);
|
|
2967
3260
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
2968
3261
|
const { force = false } = parsed;
|
|
2969
|
-
|
|
2970
|
-
|
|
3262
|
+
const response = await client.post(`/cvms/${cvmId}/restart`, { force });
|
|
3263
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
3264
|
+
}
|
|
3265
|
+
async function safeRestartCvm(client, request) {
|
|
3266
|
+
try {
|
|
3267
|
+
const data = await restartCvm(client, request);
|
|
3268
|
+
return { success: true, data };
|
|
3269
|
+
} catch (error) {
|
|
3270
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
3271
|
+
return { success: false, error };
|
|
3272
|
+
}
|
|
3273
|
+
return {
|
|
3274
|
+
success: false,
|
|
3275
|
+
error: {
|
|
3276
|
+
name: "Error",
|
|
3277
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3278
|
+
}
|
|
3279
|
+
};
|
|
3280
|
+
}
|
|
3281
|
+
}
|
|
2971
3282
|
|
|
2972
3283
|
// src/actions/cvms/delete_cvm.ts
|
|
2973
|
-
var
|
|
3284
|
+
var import_zod34 = require("zod");
|
|
2974
3285
|
var DeleteCvmRequestSchema = CvmIdSchema;
|
|
2975
3286
|
var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
2976
|
-
|
|
3287
|
+
import_zod34.z.void(),
|
|
2977
3288
|
async (client, request) => {
|
|
2978
3289
|
const { cvmId } = DeleteCvmRequestSchema.parse(request);
|
|
2979
3290
|
await client.delete(`/cvms/${cvmId}`);
|
|
@@ -2982,41 +3293,41 @@ var { action: deleteCvm, safeAction: safeDeleteCvm } = defineAction(
|
|
|
2982
3293
|
);
|
|
2983
3294
|
|
|
2984
3295
|
// src/actions/cvms/get_cvm_stats.ts
|
|
2985
|
-
var
|
|
2986
|
-
var DiskInfoSchema =
|
|
2987
|
-
name:
|
|
2988
|
-
mount_point:
|
|
2989
|
-
total_size:
|
|
2990
|
-
free_size:
|
|
2991
|
-
});
|
|
2992
|
-
var SystemInfoSchema =
|
|
2993
|
-
os_name:
|
|
2994
|
-
os_version:
|
|
2995
|
-
kernel_version:
|
|
2996
|
-
cpu_model:
|
|
2997
|
-
num_cpus:
|
|
2998
|
-
total_memory:
|
|
2999
|
-
available_memory:
|
|
3000
|
-
used_memory:
|
|
3001
|
-
free_memory:
|
|
3002
|
-
total_swap:
|
|
3003
|
-
used_swap:
|
|
3004
|
-
free_swap:
|
|
3005
|
-
uptime:
|
|
3006
|
-
loadavg_one:
|
|
3007
|
-
loadavg_five:
|
|
3008
|
-
loadavg_fifteen:
|
|
3009
|
-
disks:
|
|
3010
|
-
});
|
|
3011
|
-
var CvmSystemInfoSchema =
|
|
3012
|
-
is_online:
|
|
3013
|
-
is_public:
|
|
3014
|
-
error:
|
|
3296
|
+
var import_zod35 = require("zod");
|
|
3297
|
+
var DiskInfoSchema = import_zod35.z.object({
|
|
3298
|
+
name: import_zod35.z.string(),
|
|
3299
|
+
mount_point: import_zod35.z.string(),
|
|
3300
|
+
total_size: import_zod35.z.number(),
|
|
3301
|
+
free_size: import_zod35.z.number()
|
|
3302
|
+
});
|
|
3303
|
+
var SystemInfoSchema = import_zod35.z.object({
|
|
3304
|
+
os_name: import_zod35.z.string(),
|
|
3305
|
+
os_version: import_zod35.z.string(),
|
|
3306
|
+
kernel_version: import_zod35.z.string(),
|
|
3307
|
+
cpu_model: import_zod35.z.string(),
|
|
3308
|
+
num_cpus: import_zod35.z.number(),
|
|
3309
|
+
total_memory: import_zod35.z.number(),
|
|
3310
|
+
available_memory: import_zod35.z.number(),
|
|
3311
|
+
used_memory: import_zod35.z.number(),
|
|
3312
|
+
free_memory: import_zod35.z.number(),
|
|
3313
|
+
total_swap: import_zod35.z.number(),
|
|
3314
|
+
used_swap: import_zod35.z.number(),
|
|
3315
|
+
free_swap: import_zod35.z.number(),
|
|
3316
|
+
uptime: import_zod35.z.number(),
|
|
3317
|
+
loadavg_one: import_zod35.z.number(),
|
|
3318
|
+
loadavg_five: import_zod35.z.number(),
|
|
3319
|
+
loadavg_fifteen: import_zod35.z.number(),
|
|
3320
|
+
disks: import_zod35.z.array(DiskInfoSchema)
|
|
3321
|
+
});
|
|
3322
|
+
var CvmSystemInfoSchema = import_zod35.z.object({
|
|
3323
|
+
is_online: import_zod35.z.boolean(),
|
|
3324
|
+
is_public: import_zod35.z.boolean().default(false),
|
|
3325
|
+
error: import_zod35.z.string().nullable(),
|
|
3015
3326
|
sysinfo: SystemInfoSchema.nullable(),
|
|
3016
|
-
status:
|
|
3017
|
-
in_progress:
|
|
3018
|
-
boot_progress:
|
|
3019
|
-
boot_error:
|
|
3327
|
+
status: import_zod35.z.string().nullable(),
|
|
3328
|
+
in_progress: import_zod35.z.boolean().default(false),
|
|
3329
|
+
boot_progress: import_zod35.z.string().nullable(),
|
|
3330
|
+
boot_error: import_zod35.z.string().nullable()
|
|
3020
3331
|
});
|
|
3021
3332
|
var GetCvmStatsRequestSchema = CvmIdSchema;
|
|
3022
3333
|
var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSystemInfoSchema, async (client, request) => {
|
|
@@ -3025,18 +3336,18 @@ var { action: getCvmStats, safeAction: safeGetCvmStats } = defineAction(CvmSyste
|
|
|
3025
3336
|
});
|
|
3026
3337
|
|
|
3027
3338
|
// src/actions/cvms/get_cvm_network.ts
|
|
3028
|
-
var
|
|
3029
|
-
var CvmNetworkUrlsSchema =
|
|
3030
|
-
app:
|
|
3031
|
-
instance:
|
|
3032
|
-
});
|
|
3033
|
-
var CvmNetworkSchema =
|
|
3034
|
-
is_online:
|
|
3035
|
-
is_public:
|
|
3036
|
-
error:
|
|
3037
|
-
internal_ip:
|
|
3038
|
-
latest_handshake:
|
|
3039
|
-
public_urls:
|
|
3339
|
+
var import_zod36 = require("zod");
|
|
3340
|
+
var CvmNetworkUrlsSchema = import_zod36.z.object({
|
|
3341
|
+
app: import_zod36.z.string(),
|
|
3342
|
+
instance: import_zod36.z.string()
|
|
3343
|
+
});
|
|
3344
|
+
var CvmNetworkSchema = import_zod36.z.object({
|
|
3345
|
+
is_online: import_zod36.z.boolean(),
|
|
3346
|
+
is_public: import_zod36.z.boolean().default(true),
|
|
3347
|
+
error: import_zod36.z.string().nullable(),
|
|
3348
|
+
internal_ip: import_zod36.z.string().nullable(),
|
|
3349
|
+
latest_handshake: import_zod36.z.string().nullable(),
|
|
3350
|
+
public_urls: import_zod36.z.array(CvmNetworkUrlsSchema).nullable()
|
|
3040
3351
|
});
|
|
3041
3352
|
var GetCvmNetworkRequestSchema = CvmIdSchema;
|
|
3042
3353
|
var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmNetworkSchema, async (client, request) => {
|
|
@@ -3045,36 +3356,36 @@ var { action: getCvmNetwork, safeAction: safeGetCvmNetwork } = defineAction(CvmN
|
|
|
3045
3356
|
});
|
|
3046
3357
|
|
|
3047
3358
|
// src/actions/cvms/get_cvm_docker_compose.ts
|
|
3048
|
-
var
|
|
3359
|
+
var import_zod37 = require("zod");
|
|
3049
3360
|
var GetCvmDockerComposeRequestSchema = CvmIdSchema;
|
|
3050
|
-
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(
|
|
3361
|
+
var { action: getCvmDockerCompose, safeAction: safeGetCvmDockerCompose } = defineAction(import_zod37.z.string(), async (client, request) => {
|
|
3051
3362
|
const { cvmId } = GetCvmDockerComposeRequestSchema.parse(request);
|
|
3052
3363
|
return await client.get(`/cvms/${cvmId}/docker-compose.yml`);
|
|
3053
3364
|
});
|
|
3054
3365
|
|
|
3055
3366
|
// src/actions/cvms/get_cvm_containers_stats.ts
|
|
3056
|
-
var
|
|
3057
|
-
var ContainerInfoSchema =
|
|
3058
|
-
id:
|
|
3059
|
-
names:
|
|
3060
|
-
image:
|
|
3061
|
-
image_id:
|
|
3062
|
-
command:
|
|
3063
|
-
created:
|
|
3064
|
-
state:
|
|
3065
|
-
status:
|
|
3066
|
-
log_endpoint:
|
|
3067
|
-
});
|
|
3068
|
-
var CvmContainersStatsSchema =
|
|
3069
|
-
is_online:
|
|
3070
|
-
is_public:
|
|
3071
|
-
error:
|
|
3072
|
-
docker_compose_file:
|
|
3073
|
-
manifest_version:
|
|
3074
|
-
version:
|
|
3075
|
-
runner:
|
|
3076
|
-
features:
|
|
3077
|
-
containers:
|
|
3367
|
+
var import_zod38 = require("zod");
|
|
3368
|
+
var ContainerInfoSchema = import_zod38.z.object({
|
|
3369
|
+
id: import_zod38.z.string(),
|
|
3370
|
+
names: import_zod38.z.array(import_zod38.z.string()),
|
|
3371
|
+
image: import_zod38.z.string(),
|
|
3372
|
+
image_id: import_zod38.z.string(),
|
|
3373
|
+
command: import_zod38.z.string().nullable().optional(),
|
|
3374
|
+
created: import_zod38.z.number(),
|
|
3375
|
+
state: import_zod38.z.string(),
|
|
3376
|
+
status: import_zod38.z.string(),
|
|
3377
|
+
log_endpoint: import_zod38.z.string().nullable()
|
|
3378
|
+
});
|
|
3379
|
+
var CvmContainersStatsSchema = import_zod38.z.object({
|
|
3380
|
+
is_online: import_zod38.z.boolean(),
|
|
3381
|
+
is_public: import_zod38.z.boolean().default(true),
|
|
3382
|
+
error: import_zod38.z.string().nullable(),
|
|
3383
|
+
docker_compose_file: import_zod38.z.string().nullable(),
|
|
3384
|
+
manifest_version: import_zod38.z.number().nullable(),
|
|
3385
|
+
version: import_zod38.z.string().nullable(),
|
|
3386
|
+
runner: import_zod38.z.string().nullable(),
|
|
3387
|
+
features: import_zod38.z.array(import_zod38.z.string()).nullable(),
|
|
3388
|
+
containers: import_zod38.z.array(ContainerInfoSchema).nullable()
|
|
3078
3389
|
});
|
|
3079
3390
|
var GetCvmContainersStatsRequestSchema = CvmIdSchema;
|
|
3080
3391
|
var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = defineAction(CvmContainersStatsSchema, async (client, request) => {
|
|
@@ -3083,62 +3394,62 @@ var { action: getCvmContainersStats, safeAction: safeGetCvmContainersStats } = d
|
|
|
3083
3394
|
});
|
|
3084
3395
|
|
|
3085
3396
|
// src/actions/cvms/get_cvm_attestation.ts
|
|
3086
|
-
var
|
|
3087
|
-
var CertificateSubjectSchema =
|
|
3088
|
-
common_name:
|
|
3089
|
-
organization:
|
|
3090
|
-
country:
|
|
3091
|
-
state:
|
|
3092
|
-
locality:
|
|
3093
|
-
});
|
|
3094
|
-
var CertificateIssuerSchema =
|
|
3095
|
-
common_name:
|
|
3096
|
-
organization:
|
|
3097
|
-
country:
|
|
3098
|
-
});
|
|
3099
|
-
var CertificateSchema =
|
|
3397
|
+
var import_zod39 = require("zod");
|
|
3398
|
+
var CertificateSubjectSchema = import_zod39.z.object({
|
|
3399
|
+
common_name: import_zod39.z.string().nullable(),
|
|
3400
|
+
organization: import_zod39.z.string().nullable(),
|
|
3401
|
+
country: import_zod39.z.string().nullable(),
|
|
3402
|
+
state: import_zod39.z.string().nullable(),
|
|
3403
|
+
locality: import_zod39.z.string().nullable()
|
|
3404
|
+
});
|
|
3405
|
+
var CertificateIssuerSchema = import_zod39.z.object({
|
|
3406
|
+
common_name: import_zod39.z.string().nullable(),
|
|
3407
|
+
organization: import_zod39.z.string().nullable(),
|
|
3408
|
+
country: import_zod39.z.string().nullable()
|
|
3409
|
+
});
|
|
3410
|
+
var CertificateSchema = import_zod39.z.object({
|
|
3100
3411
|
subject: CertificateSubjectSchema,
|
|
3101
3412
|
issuer: CertificateIssuerSchema,
|
|
3102
|
-
serial_number:
|
|
3103
|
-
not_before:
|
|
3413
|
+
serial_number: import_zod39.z.string(),
|
|
3414
|
+
not_before: import_zod39.z.string(),
|
|
3104
3415
|
// datetime serialized as ISO string
|
|
3105
|
-
not_after:
|
|
3416
|
+
not_after: import_zod39.z.string(),
|
|
3106
3417
|
// datetime serialized as ISO string
|
|
3107
|
-
version:
|
|
3108
|
-
fingerprint:
|
|
3109
|
-
signature_algorithm:
|
|
3110
|
-
sans:
|
|
3111
|
-
is_ca:
|
|
3112
|
-
position_in_chain:
|
|
3113
|
-
quote:
|
|
3114
|
-
app_id:
|
|
3115
|
-
cert_usage:
|
|
3116
|
-
});
|
|
3117
|
-
var EventLogSchema =
|
|
3118
|
-
imr:
|
|
3119
|
-
event_type:
|
|
3120
|
-
digest:
|
|
3121
|
-
event:
|
|
3122
|
-
event_payload:
|
|
3123
|
-
});
|
|
3124
|
-
var TcbInfoSchema =
|
|
3125
|
-
mrtd:
|
|
3126
|
-
rootfs_hash:
|
|
3127
|
-
rtmr0:
|
|
3128
|
-
rtmr1:
|
|
3129
|
-
rtmr2:
|
|
3130
|
-
rtmr3:
|
|
3131
|
-
event_log:
|
|
3132
|
-
app_compose:
|
|
3133
|
-
});
|
|
3134
|
-
var CvmAttestationSchema =
|
|
3135
|
-
name:
|
|
3136
|
-
is_online:
|
|
3137
|
-
is_public:
|
|
3138
|
-
error:
|
|
3139
|
-
app_certificates:
|
|
3418
|
+
version: import_zod39.z.string(),
|
|
3419
|
+
fingerprint: import_zod39.z.string(),
|
|
3420
|
+
signature_algorithm: import_zod39.z.string(),
|
|
3421
|
+
sans: import_zod39.z.array(import_zod39.z.string()).nullable(),
|
|
3422
|
+
is_ca: import_zod39.z.boolean(),
|
|
3423
|
+
position_in_chain: import_zod39.z.number().nullable(),
|
|
3424
|
+
quote: import_zod39.z.string().nullable(),
|
|
3425
|
+
app_id: import_zod39.z.string().nullable().optional(),
|
|
3426
|
+
cert_usage: import_zod39.z.string().nullable().optional()
|
|
3427
|
+
});
|
|
3428
|
+
var EventLogSchema = import_zod39.z.object({
|
|
3429
|
+
imr: import_zod39.z.number(),
|
|
3430
|
+
event_type: import_zod39.z.number(),
|
|
3431
|
+
digest: import_zod39.z.string(),
|
|
3432
|
+
event: import_zod39.z.string(),
|
|
3433
|
+
event_payload: import_zod39.z.string()
|
|
3434
|
+
});
|
|
3435
|
+
var TcbInfoSchema = import_zod39.z.object({
|
|
3436
|
+
mrtd: import_zod39.z.string(),
|
|
3437
|
+
rootfs_hash: import_zod39.z.string().nullable().optional(),
|
|
3438
|
+
rtmr0: import_zod39.z.string(),
|
|
3439
|
+
rtmr1: import_zod39.z.string(),
|
|
3440
|
+
rtmr2: import_zod39.z.string(),
|
|
3441
|
+
rtmr3: import_zod39.z.string(),
|
|
3442
|
+
event_log: import_zod39.z.array(EventLogSchema),
|
|
3443
|
+
app_compose: import_zod39.z.string()
|
|
3444
|
+
});
|
|
3445
|
+
var CvmAttestationSchema = import_zod39.z.object({
|
|
3446
|
+
name: import_zod39.z.string().nullable(),
|
|
3447
|
+
is_online: import_zod39.z.boolean(),
|
|
3448
|
+
is_public: import_zod39.z.boolean().default(true),
|
|
3449
|
+
error: import_zod39.z.string().nullable(),
|
|
3450
|
+
app_certificates: import_zod39.z.array(CertificateSchema).nullable(),
|
|
3140
3451
|
tcb_info: TcbInfoSchema.nullable(),
|
|
3141
|
-
compose_file:
|
|
3452
|
+
compose_file: import_zod39.z.string().nullable()
|
|
3142
3453
|
});
|
|
3143
3454
|
var GetCvmAttestationRequestSchema = CvmIdSchema;
|
|
3144
3455
|
var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAction(CvmAttestationSchema, async (client, request) => {
|
|
@@ -3147,31 +3458,35 @@ var { action: getCvmAttestation, safeAction: safeGetCvmAttestation } = defineAct
|
|
|
3147
3458
|
});
|
|
3148
3459
|
|
|
3149
3460
|
// src/actions/cvms/update_cvm_resources.ts
|
|
3150
|
-
var
|
|
3461
|
+
var import_zod40 = require("zod");
|
|
3151
3462
|
var UpdateCvmResourcesRequestSchema = refineCvmId(
|
|
3152
3463
|
CvmIdObjectSchema.extend({
|
|
3153
|
-
vcpu:
|
|
3154
|
-
memory:
|
|
3155
|
-
disk_size:
|
|
3156
|
-
instance_type:
|
|
3157
|
-
allow_restart:
|
|
3464
|
+
vcpu: import_zod40.z.number().optional(),
|
|
3465
|
+
memory: import_zod40.z.number().optional(),
|
|
3466
|
+
disk_size: import_zod40.z.number().optional(),
|
|
3467
|
+
instance_type: import_zod40.z.string().optional(),
|
|
3468
|
+
allow_restart: import_zod40.z.boolean().optional()
|
|
3158
3469
|
})
|
|
3159
3470
|
);
|
|
3160
|
-
var
|
|
3471
|
+
var UpdateCvmResourcesResponseSchema = import_zod40.z.object({
|
|
3472
|
+
message: import_zod40.z.string(),
|
|
3473
|
+
correlation_id: import_zod40.z.string(),
|
|
3474
|
+
status: import_zod40.z.string()
|
|
3475
|
+
});
|
|
3476
|
+
var { action: updateCvmResources, safeAction: safeUpdateCvmResources } = defineAction(UpdateCvmResourcesResponseSchema, async (client, request) => {
|
|
3161
3477
|
const parsed = UpdateCvmResourcesRequestSchema.parse(request);
|
|
3162
3478
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
3163
3479
|
const { ...body } = parsed;
|
|
3164
|
-
await client.patch(`/cvms/${cvmId}
|
|
3165
|
-
return void 0;
|
|
3480
|
+
return await client.patch(`/cvms/${cvmId}`, body);
|
|
3166
3481
|
});
|
|
3167
3482
|
|
|
3168
3483
|
// src/actions/cvms/update_cvm_visibility.ts
|
|
3169
|
-
var
|
|
3484
|
+
var import_zod41 = require("zod");
|
|
3170
3485
|
var UpdateCvmVisibilityRequestSchema = refineCvmId(
|
|
3171
3486
|
CvmIdObjectSchema.extend({
|
|
3172
|
-
public_sysinfo:
|
|
3173
|
-
public_logs:
|
|
3174
|
-
public_tcbinfo:
|
|
3487
|
+
public_sysinfo: import_zod41.z.boolean(),
|
|
3488
|
+
public_logs: import_zod41.z.boolean(),
|
|
3489
|
+
public_tcbinfo: import_zod41.z.boolean().optional()
|
|
3175
3490
|
})
|
|
3176
3491
|
);
|
|
3177
3492
|
var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defineAction(CvmDetailV20251028Schema, async (client, request) => {
|
|
@@ -3186,21 +3501,21 @@ var { action: updateCvmVisibility, safeAction: safeUpdateCvmVisibility } = defin
|
|
|
3186
3501
|
});
|
|
3187
3502
|
|
|
3188
3503
|
// src/actions/cvms/get_available_os_images.ts
|
|
3189
|
-
var
|
|
3190
|
-
var OSImageVariantSchema =
|
|
3191
|
-
name:
|
|
3192
|
-
os_image_hash:
|
|
3193
|
-
is_current:
|
|
3194
|
-
});
|
|
3195
|
-
var AvailableOSImageSchema3 =
|
|
3196
|
-
version:
|
|
3197
|
-
|
|
3198
|
-
|
|
3504
|
+
var import_zod42 = require("zod");
|
|
3505
|
+
var OSImageVariantSchema = import_zod42.z.object({
|
|
3506
|
+
name: import_zod42.z.string(),
|
|
3507
|
+
os_image_hash: import_zod42.z.string().nullable(),
|
|
3508
|
+
is_current: import_zod42.z.boolean()
|
|
3509
|
+
});
|
|
3510
|
+
var AvailableOSImageSchema3 = import_zod42.z.object({
|
|
3511
|
+
version: import_zod42.z.union([
|
|
3512
|
+
import_zod42.z.tuple([import_zod42.z.number(), import_zod42.z.number(), import_zod42.z.number(), import_zod42.z.number()]),
|
|
3513
|
+
import_zod42.z.tuple([import_zod42.z.number(), import_zod42.z.number(), import_zod42.z.number()])
|
|
3199
3514
|
]),
|
|
3200
3515
|
prod: OSImageVariantSchema.nullable(),
|
|
3201
3516
|
dev: OSImageVariantSchema.nullable()
|
|
3202
3517
|
});
|
|
3203
|
-
var GetAvailableOSImagesResponseSchema =
|
|
3518
|
+
var GetAvailableOSImagesResponseSchema = import_zod42.z.array(AvailableOSImageSchema3);
|
|
3204
3519
|
var GetAvailableOSImagesRequestSchema = CvmIdSchema;
|
|
3205
3520
|
var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = defineAction(GetAvailableOSImagesResponseSchema, async (client, request) => {
|
|
3206
3521
|
const { cvmId } = GetAvailableOSImagesRequestSchema.parse(request);
|
|
@@ -3208,13 +3523,13 @@ var { action: getAvailableOsImages, safeAction: safeGetAvailableOsImages } = def
|
|
|
3208
3523
|
});
|
|
3209
3524
|
|
|
3210
3525
|
// src/actions/cvms/update_os_image.ts
|
|
3211
|
-
var
|
|
3526
|
+
var import_zod43 = require("zod");
|
|
3212
3527
|
var UpdateOsImageRequestSchema = refineCvmId(
|
|
3213
3528
|
CvmIdObjectSchema.extend({
|
|
3214
|
-
os_image_name:
|
|
3529
|
+
os_image_name: import_zod43.z.string().min(1, "OS image name is required")
|
|
3215
3530
|
})
|
|
3216
3531
|
);
|
|
3217
|
-
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(
|
|
3532
|
+
var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(import_zod43.z.void(), async (client, request) => {
|
|
3218
3533
|
const parsed = UpdateOsImageRequestSchema.parse(request);
|
|
3219
3534
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
3220
3535
|
const { os_image_name } = parsed;
|
|
@@ -3223,17 +3538,17 @@ var { action: updateOsImage, safeAction: safeUpdateOsImage } = defineAction(impo
|
|
|
3223
3538
|
});
|
|
3224
3539
|
|
|
3225
3540
|
// src/actions/cvms/get_cvm_state.ts
|
|
3226
|
-
var
|
|
3227
|
-
var CvmStateSchema =
|
|
3228
|
-
id:
|
|
3229
|
-
instance_id:
|
|
3230
|
-
name:
|
|
3231
|
-
status:
|
|
3232
|
-
uptime:
|
|
3233
|
-
exited_at:
|
|
3234
|
-
boot_progress:
|
|
3235
|
-
boot_error:
|
|
3236
|
-
shutdown_progress:
|
|
3541
|
+
var import_zod44 = require("zod");
|
|
3542
|
+
var CvmStateSchema = import_zod44.z.object({
|
|
3543
|
+
id: import_zod44.z.string().optional(),
|
|
3544
|
+
instance_id: import_zod44.z.string().optional(),
|
|
3545
|
+
name: import_zod44.z.string(),
|
|
3546
|
+
status: import_zod44.z.string(),
|
|
3547
|
+
uptime: import_zod44.z.string().optional(),
|
|
3548
|
+
exited_at: import_zod44.z.string().optional(),
|
|
3549
|
+
boot_progress: import_zod44.z.string().optional(),
|
|
3550
|
+
boot_error: import_zod44.z.string().optional(),
|
|
3551
|
+
shutdown_progress: import_zod44.z.string().optional()
|
|
3237
3552
|
});
|
|
3238
3553
|
var GetCvmStateRequestSchema = CvmIdSchema;
|
|
3239
3554
|
var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmStateSchema, async (client, request) => {
|
|
@@ -3242,21 +3557,21 @@ var { action: getCvmState, safeAction: safeGetCvmState } = defineAction(CvmState
|
|
|
3242
3557
|
});
|
|
3243
3558
|
|
|
3244
3559
|
// src/actions/ssh_keys/list_ssh_keys.ts
|
|
3245
|
-
var
|
|
3246
|
-
var SshKeySchema =
|
|
3247
|
-
id:
|
|
3248
|
-
user_id:
|
|
3249
|
-
name:
|
|
3250
|
-
public_key:
|
|
3251
|
-
fingerprint:
|
|
3252
|
-
key_type:
|
|
3253
|
-
source:
|
|
3254
|
-
key_metadata:
|
|
3255
|
-
last_synced_at:
|
|
3256
|
-
created_at:
|
|
3257
|
-
updated_at:
|
|
3258
|
-
});
|
|
3259
|
-
var ListSshKeysResponseSchema =
|
|
3560
|
+
var import_zod45 = require("zod");
|
|
3561
|
+
var SshKeySchema = import_zod45.z.object({
|
|
3562
|
+
id: import_zod45.z.string(),
|
|
3563
|
+
user_id: import_zod45.z.string(),
|
|
3564
|
+
name: import_zod45.z.string(),
|
|
3565
|
+
public_key: import_zod45.z.string(),
|
|
3566
|
+
fingerprint: import_zod45.z.string(),
|
|
3567
|
+
key_type: import_zod45.z.string(),
|
|
3568
|
+
source: import_zod45.z.string(),
|
|
3569
|
+
key_metadata: import_zod45.z.record(import_zod45.z.unknown()).nullable().optional(),
|
|
3570
|
+
last_synced_at: import_zod45.z.string().nullable().optional(),
|
|
3571
|
+
created_at: import_zod45.z.string(),
|
|
3572
|
+
updated_at: import_zod45.z.string()
|
|
3573
|
+
});
|
|
3574
|
+
var ListSshKeysResponseSchema = import_zod45.z.array(SshKeySchema);
|
|
3260
3575
|
async function listSshKeys(client) {
|
|
3261
3576
|
const response = await client.get("/user/ssh-keys");
|
|
3262
3577
|
return ListSshKeysResponseSchema.parse(response);
|
|
@@ -3280,15 +3595,15 @@ async function safeListSshKeys(client) {
|
|
|
3280
3595
|
}
|
|
3281
3596
|
|
|
3282
3597
|
// src/actions/ssh_keys/import_github_profile.ts
|
|
3283
|
-
var
|
|
3284
|
-
var ImportGithubProfileRequestSchema =
|
|
3285
|
-
github_username:
|
|
3598
|
+
var import_zod46 = require("zod");
|
|
3599
|
+
var ImportGithubProfileRequestSchema = import_zod46.z.object({
|
|
3600
|
+
github_username: import_zod46.z.string().min(1)
|
|
3286
3601
|
});
|
|
3287
|
-
var ImportGithubProfileResponseSchema =
|
|
3288
|
-
github_username:
|
|
3289
|
-
keys_added:
|
|
3290
|
-
keys_skipped:
|
|
3291
|
-
errors:
|
|
3602
|
+
var ImportGithubProfileResponseSchema = import_zod46.z.object({
|
|
3603
|
+
github_username: import_zod46.z.string(),
|
|
3604
|
+
keys_added: import_zod46.z.number().int(),
|
|
3605
|
+
keys_skipped: import_zod46.z.number().int(),
|
|
3606
|
+
errors: import_zod46.z.array(import_zod46.z.string()).default([])
|
|
3292
3607
|
});
|
|
3293
3608
|
var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSshKeys } = defineAction(
|
|
3294
3609
|
ImportGithubProfileResponseSchema,
|
|
@@ -3299,10 +3614,10 @@ var { action: importGithubProfileSshKeys, safeAction: safeImportGithubProfileSsh
|
|
|
3299
3614
|
);
|
|
3300
3615
|
|
|
3301
3616
|
// src/actions/ssh_keys/create_ssh_key.ts
|
|
3302
|
-
var
|
|
3303
|
-
var CreateSshKeyRequestSchema =
|
|
3304
|
-
name:
|
|
3305
|
-
public_key:
|
|
3617
|
+
var import_zod47 = require("zod");
|
|
3618
|
+
var CreateSshKeyRequestSchema = import_zod47.z.object({
|
|
3619
|
+
name: import_zod47.z.string().min(1),
|
|
3620
|
+
public_key: import_zod47.z.string().min(1)
|
|
3306
3621
|
});
|
|
3307
3622
|
var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKeySchema, async (client, request) => {
|
|
3308
3623
|
const { name, public_key } = CreateSshKeyRequestSchema.parse(request);
|
|
@@ -3310,24 +3625,24 @@ var { action: createSshKey, safeAction: safeCreateSshKey } = defineAction(SshKey
|
|
|
3310
3625
|
});
|
|
3311
3626
|
|
|
3312
3627
|
// src/actions/ssh_keys/delete_ssh_key.ts
|
|
3313
|
-
var
|
|
3314
|
-
var DeleteSshKeyRequestSchema =
|
|
3315
|
-
keyId:
|
|
3628
|
+
var import_zod48 = require("zod");
|
|
3629
|
+
var DeleteSshKeyRequestSchema = import_zod48.z.object({
|
|
3630
|
+
keyId: import_zod48.z.string().min(1)
|
|
3316
3631
|
});
|
|
3317
|
-
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(
|
|
3632
|
+
var { action: deleteSshKey, safeAction: safeDeleteSshKey } = defineAction(import_zod48.z.void(), async (client, request) => {
|
|
3318
3633
|
const { keyId } = DeleteSshKeyRequestSchema.parse(request);
|
|
3319
3634
|
await client.delete(`/user/ssh-keys/${keyId}`);
|
|
3320
3635
|
return void 0;
|
|
3321
3636
|
});
|
|
3322
3637
|
|
|
3323
3638
|
// src/actions/ssh_keys/sync_github_ssh_keys.ts
|
|
3324
|
-
var
|
|
3325
|
-
var SyncGithubSshKeysResponseSchema =
|
|
3326
|
-
synced_count:
|
|
3327
|
-
keys_added:
|
|
3328
|
-
keys_updated:
|
|
3329
|
-
keys_removed:
|
|
3330
|
-
errors:
|
|
3639
|
+
var import_zod49 = require("zod");
|
|
3640
|
+
var SyncGithubSshKeysResponseSchema = import_zod49.z.object({
|
|
3641
|
+
synced_count: import_zod49.z.number().int(),
|
|
3642
|
+
keys_added: import_zod49.z.number().int(),
|
|
3643
|
+
keys_updated: import_zod49.z.number().int(),
|
|
3644
|
+
keys_removed: import_zod49.z.number().int(),
|
|
3645
|
+
errors: import_zod49.z.array(import_zod49.z.string()).default([])
|
|
3331
3646
|
});
|
|
3332
3647
|
var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSimpleAction(
|
|
3333
3648
|
SyncGithubSshKeysResponseSchema,
|
|
@@ -3337,26 +3652,26 @@ var { action: syncGithubSshKeys, safeAction: safeSyncGithubSshKeys } = defineSim
|
|
|
3337
3652
|
);
|
|
3338
3653
|
|
|
3339
3654
|
// src/actions/os_images/get_os_images.ts
|
|
3340
|
-
var
|
|
3341
|
-
var OSImagePublicSchema =
|
|
3342
|
-
name:
|
|
3343
|
-
slug:
|
|
3344
|
-
version:
|
|
3345
|
-
os_image_hash:
|
|
3346
|
-
is_dev:
|
|
3347
|
-
requires_gpu:
|
|
3655
|
+
var import_zod50 = require("zod");
|
|
3656
|
+
var OSImagePublicSchema = import_zod50.z.object({
|
|
3657
|
+
name: import_zod50.z.string(),
|
|
3658
|
+
slug: import_zod50.z.string(),
|
|
3659
|
+
version: import_zod50.z.string(),
|
|
3660
|
+
os_image_hash: import_zod50.z.string().nullable(),
|
|
3661
|
+
is_dev: import_zod50.z.boolean(),
|
|
3662
|
+
requires_gpu: import_zod50.z.boolean()
|
|
3348
3663
|
}).passthrough();
|
|
3349
|
-
var GetOsImagesRequestSchema =
|
|
3350
|
-
page:
|
|
3351
|
-
page_size:
|
|
3352
|
-
is_dev:
|
|
3664
|
+
var GetOsImagesRequestSchema = import_zod50.z.object({
|
|
3665
|
+
page: import_zod50.z.number().int().min(1).optional(),
|
|
3666
|
+
page_size: import_zod50.z.number().int().min(1).optional(),
|
|
3667
|
+
is_dev: import_zod50.z.boolean().optional()
|
|
3353
3668
|
}).strict();
|
|
3354
|
-
var GetOsImagesResponseSchema =
|
|
3355
|
-
items:
|
|
3356
|
-
total:
|
|
3357
|
-
page:
|
|
3358
|
-
page_size:
|
|
3359
|
-
pages:
|
|
3669
|
+
var GetOsImagesResponseSchema = import_zod50.z.object({
|
|
3670
|
+
items: import_zod50.z.array(OSImagePublicSchema),
|
|
3671
|
+
total: import_zod50.z.number(),
|
|
3672
|
+
page: import_zod50.z.number(),
|
|
3673
|
+
page_size: import_zod50.z.number(),
|
|
3674
|
+
pages: import_zod50.z.number()
|
|
3360
3675
|
}).passthrough();
|
|
3361
3676
|
var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsImagesResponseSchema, async (client, request) => {
|
|
3362
3677
|
const validatedRequest = GetOsImagesRequestSchema.parse(request ?? {});
|
|
@@ -3364,32 +3679,35 @@ var { action: getOsImages, safeAction: safeGetOsImages } = defineAction(GetOsIma
|
|
|
3364
3679
|
});
|
|
3365
3680
|
|
|
3366
3681
|
// src/actions/kms/get_kms_onchain_detail.ts
|
|
3367
|
-
var
|
|
3368
|
-
var OnChainDeviceSchema =
|
|
3369
|
-
device_id:
|
|
3370
|
-
node_name:
|
|
3371
|
-
on_chain_allowed:
|
|
3682
|
+
var import_zod51 = require("zod");
|
|
3683
|
+
var OnChainDeviceSchema = import_zod51.z.object({
|
|
3684
|
+
device_id: import_zod51.z.string(),
|
|
3685
|
+
node_name: import_zod51.z.string().nullable().optional(),
|
|
3686
|
+
on_chain_allowed: import_zod51.z.boolean().nullable()
|
|
3372
3687
|
}).passthrough();
|
|
3373
|
-
var OnChainOsImageSchema =
|
|
3374
|
-
name:
|
|
3375
|
-
version:
|
|
3376
|
-
os_image_hash:
|
|
3377
|
-
on_chain_allowed:
|
|
3688
|
+
var OnChainOsImageSchema = import_zod51.z.object({
|
|
3689
|
+
name: import_zod51.z.string(),
|
|
3690
|
+
version: import_zod51.z.string(),
|
|
3691
|
+
os_image_hash: import_zod51.z.string().nullable(),
|
|
3692
|
+
on_chain_allowed: import_zod51.z.boolean().nullable()
|
|
3378
3693
|
}).passthrough();
|
|
3379
|
-
var OnChainKmsContractSchema =
|
|
3380
|
-
contract_address:
|
|
3381
|
-
chain_id:
|
|
3382
|
-
chain_name:
|
|
3383
|
-
|
|
3384
|
-
|
|
3694
|
+
var OnChainKmsContractSchema = import_zod51.z.object({
|
|
3695
|
+
contract_address: import_zod51.z.string(),
|
|
3696
|
+
chain_id: import_zod51.z.number(),
|
|
3697
|
+
chain_name: import_zod51.z.string(),
|
|
3698
|
+
k256_pubkey: import_zod51.z.string().nullable().optional(),
|
|
3699
|
+
ca_pubkey: import_zod51.z.string().nullable().optional(),
|
|
3700
|
+
gateway_contract_address: import_zod51.z.string().nullable().optional(),
|
|
3701
|
+
devices: import_zod51.z.array(OnChainDeviceSchema),
|
|
3702
|
+
os_images: import_zod51.z.array(OnChainOsImageSchema)
|
|
3385
3703
|
}).passthrough();
|
|
3386
|
-
var GetKmsOnChainDetailResponseSchema =
|
|
3387
|
-
chain_name:
|
|
3388
|
-
chain_id:
|
|
3389
|
-
contracts:
|
|
3704
|
+
var GetKmsOnChainDetailResponseSchema = import_zod51.z.object({
|
|
3705
|
+
chain_name: import_zod51.z.string(),
|
|
3706
|
+
chain_id: import_zod51.z.number(),
|
|
3707
|
+
contracts: import_zod51.z.array(OnChainKmsContractSchema)
|
|
3390
3708
|
}).passthrough();
|
|
3391
|
-
var GetKmsOnChainDetailRequestSchema =
|
|
3392
|
-
chain:
|
|
3709
|
+
var GetKmsOnChainDetailRequestSchema = import_zod51.z.object({
|
|
3710
|
+
chain: import_zod51.z.string()
|
|
3393
3711
|
}).strict();
|
|
3394
3712
|
var { action: getKmsOnChainDetail, safeAction: safeGetKmsOnChainDetail } = defineAction(GetKmsOnChainDetailResponseSchema, async (client, request) => {
|
|
3395
3713
|
const { chain } = GetKmsOnChainDetailRequestSchema.parse(request);
|
|
@@ -3472,6 +3790,12 @@ function createClient2(config = {}) {
|
|
|
3472
3790
|
safeGetKmsInfo,
|
|
3473
3791
|
getKmsList,
|
|
3474
3792
|
safeGetKmsList,
|
|
3793
|
+
listKmsContracts,
|
|
3794
|
+
safeListKmsContracts,
|
|
3795
|
+
getKmsContract,
|
|
3796
|
+
safeGetKmsContract,
|
|
3797
|
+
listKmsContractNodes,
|
|
3798
|
+
safeListKmsContractNodes,
|
|
3475
3799
|
getAppEnvEncryptPubKey,
|
|
3476
3800
|
safeGetAppEnvEncryptPubKey,
|
|
3477
3801
|
nextAppIds,
|
|
@@ -3497,152 +3821,197 @@ function createClient2(config = {}) {
|
|
|
3497
3821
|
}
|
|
3498
3822
|
|
|
3499
3823
|
// src/types/app_info_v20251028.ts
|
|
3500
|
-
var
|
|
3501
|
-
var CvmBasicInfoV20251028Schema =
|
|
3502
|
-
vm_uuid:
|
|
3503
|
-
app_id:
|
|
3504
|
-
name:
|
|
3505
|
-
status:
|
|
3506
|
-
vcpu:
|
|
3507
|
-
memory:
|
|
3508
|
-
disk_size:
|
|
3509
|
-
teepod_id:
|
|
3510
|
-
teepod_name:
|
|
3511
|
-
region_identifier:
|
|
3512
|
-
kms_type:
|
|
3513
|
-
instance_type:
|
|
3514
|
-
listed:
|
|
3515
|
-
base_image:
|
|
3516
|
-
kms_slug:
|
|
3517
|
-
|
|
3518
|
-
|
|
3824
|
+
var import_zod52 = require("zod");
|
|
3825
|
+
var CvmBasicInfoV20251028Schema = import_zod52.z.object({
|
|
3826
|
+
vm_uuid: import_zod52.z.string().nullable(),
|
|
3827
|
+
app_id: import_zod52.z.string(),
|
|
3828
|
+
name: import_zod52.z.string().default(""),
|
|
3829
|
+
status: import_zod52.z.string(),
|
|
3830
|
+
vcpu: import_zod52.z.number().int(),
|
|
3831
|
+
memory: import_zod52.z.number().int(),
|
|
3832
|
+
disk_size: import_zod52.z.number().int(),
|
|
3833
|
+
teepod_id: import_zod52.z.number().int(),
|
|
3834
|
+
teepod_name: import_zod52.z.string(),
|
|
3835
|
+
region_identifier: import_zod52.z.string().nullable().optional(),
|
|
3836
|
+
kms_type: import_zod52.z.string().nullable().optional(),
|
|
3837
|
+
instance_type: import_zod52.z.string().nullable().optional(),
|
|
3838
|
+
listed: import_zod52.z.boolean().nullable().optional(),
|
|
3839
|
+
base_image: import_zod52.z.string().nullable().optional(),
|
|
3840
|
+
kms_slug: import_zod52.z.string().nullable().optional(),
|
|
3841
|
+
/** @deprecated Identifies a KMS node, not the on-chain KMS contract. Use kms_contract_id. */
|
|
3842
|
+
kms_id: import_zod52.z.string().nullable().optional(),
|
|
3843
|
+
kms_contract_id: import_zod52.z.string().nullable().optional(),
|
|
3844
|
+
instance_id: import_zod52.z.string().nullable().optional(),
|
|
3519
3845
|
machine_info: MachineInfoV20251028Schema.nullable().optional(),
|
|
3520
|
-
updated_at:
|
|
3521
|
-
});
|
|
3522
|
-
var AppProfileSchema =
|
|
3523
|
-
display_name:
|
|
3524
|
-
avatar_url:
|
|
3525
|
-
description:
|
|
3526
|
-
custom_domain:
|
|
3527
|
-
});
|
|
3528
|
-
var DstackAppFullResponseV20251028Schema =
|
|
3529
|
-
id:
|
|
3530
|
-
name:
|
|
3531
|
-
app_id:
|
|
3532
|
-
app_provision_type:
|
|
3533
|
-
app_icon_url:
|
|
3534
|
-
created_at:
|
|
3535
|
-
kms_type:
|
|
3846
|
+
updated_at: import_zod52.z.string().nullable().optional()
|
|
3847
|
+
});
|
|
3848
|
+
var AppProfileSchema = import_zod52.z.object({
|
|
3849
|
+
display_name: import_zod52.z.string().nullable().optional(),
|
|
3850
|
+
avatar_url: import_zod52.z.string().nullable().optional(),
|
|
3851
|
+
description: import_zod52.z.string().nullable().optional(),
|
|
3852
|
+
custom_domain: import_zod52.z.string().nullable().optional()
|
|
3853
|
+
});
|
|
3854
|
+
var DstackAppFullResponseV20251028Schema = import_zod52.z.object({
|
|
3855
|
+
id: import_zod52.z.string(),
|
|
3856
|
+
name: import_zod52.z.string(),
|
|
3857
|
+
app_id: import_zod52.z.string(),
|
|
3858
|
+
app_provision_type: import_zod52.z.string().nullable().optional(),
|
|
3859
|
+
app_icon_url: import_zod52.z.string().nullable().optional(),
|
|
3860
|
+
created_at: import_zod52.z.string(),
|
|
3861
|
+
kms_type: import_zod52.z.string(),
|
|
3536
3862
|
profile: AppProfileSchema.nullable().optional(),
|
|
3537
3863
|
current_cvm: CvmBasicInfoV20251028Schema.nullable().optional(),
|
|
3538
|
-
cvms:
|
|
3539
|
-
cvm_count:
|
|
3864
|
+
cvms: import_zod52.z.array(CvmBasicInfoV20251028Schema).default([]),
|
|
3865
|
+
cvm_count: import_zod52.z.number().int().default(0)
|
|
3540
3866
|
});
|
|
3541
3867
|
var DstackAppWithCvmResponseV20251028Schema = DstackAppFullResponseV20251028Schema;
|
|
3542
|
-
var DstackAppListResponseV20251028Schema =
|
|
3543
|
-
dstack_apps:
|
|
3544
|
-
page:
|
|
3545
|
-
page_size:
|
|
3546
|
-
total:
|
|
3547
|
-
total_pages:
|
|
3868
|
+
var DstackAppListResponseV20251028Schema = import_zod52.z.object({
|
|
3869
|
+
dstack_apps: import_zod52.z.array(DstackAppWithCvmResponseV20251028Schema),
|
|
3870
|
+
page: import_zod52.z.number().int(),
|
|
3871
|
+
page_size: import_zod52.z.number().int(),
|
|
3872
|
+
total: import_zod52.z.number().int(),
|
|
3873
|
+
total_pages: import_zod52.z.number().int()
|
|
3548
3874
|
});
|
|
3549
3875
|
|
|
3550
3876
|
// src/types/app_info_v20260121.ts
|
|
3551
|
-
var
|
|
3552
|
-
var DstackAppFullResponseV20260121Schema =
|
|
3553
|
-
id:
|
|
3554
|
-
name:
|
|
3555
|
-
app_id:
|
|
3556
|
-
app_provision_type:
|
|
3557
|
-
app_icon_url:
|
|
3558
|
-
created_at:
|
|
3559
|
-
kms_type:
|
|
3560
|
-
profile:
|
|
3561
|
-
display_name:
|
|
3562
|
-
avatar_url:
|
|
3563
|
-
description:
|
|
3564
|
-
custom_domain:
|
|
3877
|
+
var import_zod53 = require("zod");
|
|
3878
|
+
var DstackAppFullResponseV20260121Schema = import_zod53.z.object({
|
|
3879
|
+
id: import_zod53.z.string(),
|
|
3880
|
+
name: import_zod53.z.string(),
|
|
3881
|
+
app_id: import_zod53.z.string(),
|
|
3882
|
+
app_provision_type: import_zod53.z.string().nullable().optional(),
|
|
3883
|
+
app_icon_url: import_zod53.z.string().nullable().optional(),
|
|
3884
|
+
created_at: import_zod53.z.string(),
|
|
3885
|
+
kms_type: import_zod53.z.string(),
|
|
3886
|
+
profile: import_zod53.z.object({
|
|
3887
|
+
display_name: import_zod53.z.string().nullable().optional(),
|
|
3888
|
+
avatar_url: import_zod53.z.string().nullable().optional(),
|
|
3889
|
+
description: import_zod53.z.string().nullable().optional(),
|
|
3890
|
+
custom_domain: import_zod53.z.string().nullable().optional()
|
|
3565
3891
|
}).nullable().optional(),
|
|
3566
3892
|
current_cvm: CvmInfoV20260121Schema.nullable().optional(),
|
|
3567
|
-
cvms:
|
|
3568
|
-
cvm_count:
|
|
3893
|
+
cvms: import_zod53.z.array(CvmInfoV20260121Schema).default([]),
|
|
3894
|
+
cvm_count: import_zod53.z.number().int().default(0)
|
|
3569
3895
|
});
|
|
3570
3896
|
var DstackAppFullResponseV20260522Schema = DstackAppFullResponseV20260121Schema.extend({
|
|
3571
3897
|
current_cvm: CvmInfoV20260522Schema.nullable().optional(),
|
|
3572
|
-
cvms:
|
|
3898
|
+
cvms: import_zod53.z.array(CvmInfoV20260522Schema).default([])
|
|
3573
3899
|
});
|
|
3574
3900
|
var DstackAppWithCvmResponseV20260121Schema = DstackAppFullResponseV20260121Schema;
|
|
3575
3901
|
var DstackAppWithCvmResponseV20260522Schema = DstackAppFullResponseV20260522Schema;
|
|
3576
|
-
var DstackAppListResponseV20260121Schema =
|
|
3577
|
-
dstack_apps:
|
|
3578
|
-
page:
|
|
3579
|
-
page_size:
|
|
3580
|
-
total:
|
|
3581
|
-
total_pages:
|
|
3902
|
+
var DstackAppListResponseV20260121Schema = import_zod53.z.object({
|
|
3903
|
+
dstack_apps: import_zod53.z.array(DstackAppWithCvmResponseV20260121Schema),
|
|
3904
|
+
page: import_zod53.z.number().int(),
|
|
3905
|
+
page_size: import_zod53.z.number().int(),
|
|
3906
|
+
total: import_zod53.z.number().int(),
|
|
3907
|
+
total_pages: import_zod53.z.number().int()
|
|
3582
3908
|
});
|
|
3583
3909
|
var DstackAppListResponseV20260522Schema = DstackAppListResponseV20260121Schema.extend({
|
|
3584
|
-
dstack_apps:
|
|
3910
|
+
dstack_apps: import_zod53.z.array(DstackAppWithCvmResponseV20260522Schema)
|
|
3585
3911
|
});
|
|
3586
3912
|
|
|
3587
3913
|
// src/types/app_revision.ts
|
|
3588
|
-
var
|
|
3589
|
-
var CvmRefSchema =
|
|
3590
|
-
object_type:
|
|
3591
|
-
id:
|
|
3592
|
-
name:
|
|
3593
|
-
app_id:
|
|
3594
|
-
vm_uuid:
|
|
3595
|
-
});
|
|
3596
|
-
var AppRevisionResponseSchema =
|
|
3597
|
-
revision_id:
|
|
3598
|
-
app_id:
|
|
3599
|
-
vm_uuid:
|
|
3600
|
-
compose_hash:
|
|
3601
|
-
created_at:
|
|
3602
|
-
trace_id:
|
|
3603
|
-
operation_type:
|
|
3914
|
+
var import_zod54 = require("zod");
|
|
3915
|
+
var CvmRefSchema = import_zod54.z.object({
|
|
3916
|
+
object_type: import_zod54.z.literal("cvm"),
|
|
3917
|
+
id: import_zod54.z.string().nullable().optional(),
|
|
3918
|
+
name: import_zod54.z.string().nullable().optional(),
|
|
3919
|
+
app_id: import_zod54.z.string().nullable().optional(),
|
|
3920
|
+
vm_uuid: import_zod54.z.string().nullable().optional()
|
|
3921
|
+
});
|
|
3922
|
+
var AppRevisionResponseSchema = import_zod54.z.object({
|
|
3923
|
+
revision_id: import_zod54.z.string(),
|
|
3924
|
+
app_id: import_zod54.z.string(),
|
|
3925
|
+
vm_uuid: import_zod54.z.string(),
|
|
3926
|
+
compose_hash: import_zod54.z.string(),
|
|
3927
|
+
created_at: import_zod54.z.string(),
|
|
3928
|
+
trace_id: import_zod54.z.string().nullable().optional(),
|
|
3929
|
+
operation_type: import_zod54.z.string(),
|
|
3604
3930
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
3605
3931
|
cvm: CvmRefSchema.nullable().optional(),
|
|
3606
3932
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
3607
3933
|
});
|
|
3608
|
-
var AppRevisionDetailResponseSchema =
|
|
3609
|
-
revision_id:
|
|
3610
|
-
app_id:
|
|
3611
|
-
vm_uuid:
|
|
3612
|
-
compose_hash:
|
|
3613
|
-
compose_file:
|
|
3614
|
-
encrypted_env:
|
|
3615
|
-
user_config:
|
|
3616
|
-
created_at:
|
|
3617
|
-
trace_id:
|
|
3618
|
-
operation_type:
|
|
3934
|
+
var AppRevisionDetailResponseSchema = import_zod54.z.object({
|
|
3935
|
+
revision_id: import_zod54.z.string(),
|
|
3936
|
+
app_id: import_zod54.z.string(),
|
|
3937
|
+
vm_uuid: import_zod54.z.string(),
|
|
3938
|
+
compose_hash: import_zod54.z.string(),
|
|
3939
|
+
compose_file: import_zod54.z.union([import_zod54.z.record(import_zod54.z.any()), import_zod54.z.string()]).nullable().optional(),
|
|
3940
|
+
encrypted_env: import_zod54.z.string(),
|
|
3941
|
+
user_config: import_zod54.z.string(),
|
|
3942
|
+
created_at: import_zod54.z.string(),
|
|
3943
|
+
trace_id: import_zod54.z.string().nullable().optional(),
|
|
3944
|
+
operation_type: import_zod54.z.string(),
|
|
3619
3945
|
triggered_by: UserRefSchema.nullable().optional(),
|
|
3620
3946
|
cvm: CvmRefSchema.nullable().optional(),
|
|
3621
3947
|
workspace: WorkspaceRefSchema.nullable().optional()
|
|
3622
3948
|
});
|
|
3623
|
-
var AppRevisionsResponseSchema =
|
|
3624
|
-
revisions:
|
|
3625
|
-
total:
|
|
3626
|
-
page:
|
|
3627
|
-
page_size:
|
|
3628
|
-
total_pages:
|
|
3949
|
+
var AppRevisionsResponseSchema = import_zod54.z.object({
|
|
3950
|
+
revisions: import_zod54.z.array(AppRevisionResponseSchema),
|
|
3951
|
+
total: import_zod54.z.number().int(),
|
|
3952
|
+
page: import_zod54.z.number().int(),
|
|
3953
|
+
page_size: import_zod54.z.number().int(),
|
|
3954
|
+
total_pages: import_zod54.z.number().int()
|
|
3629
3955
|
});
|
|
3630
3956
|
|
|
3631
3957
|
// src/actions/blockchains/deploy_app_auth.ts
|
|
3632
|
-
var
|
|
3633
|
-
var
|
|
3958
|
+
var import_zod55 = require("zod");
|
|
3959
|
+
var import_viem4 = require("viem");
|
|
3634
3960
|
var import_accounts2 = require("viem/accounts");
|
|
3635
3961
|
|
|
3636
3962
|
// src/utils/index.ts
|
|
3637
3963
|
var import_encrypt_env_vars = require("@phala/dstack-sdk/encrypt-env-vars");
|
|
3638
3964
|
|
|
3639
|
-
// src/utils/
|
|
3965
|
+
// src/utils/get_mr_config_id.ts
|
|
3640
3966
|
var import_viem = require("viem");
|
|
3967
|
+
var MR_CONFIG_ID_LENGTH = 48;
|
|
3968
|
+
var KEY_PROVIDER_BYTE = {
|
|
3969
|
+
none: 0,
|
|
3970
|
+
local: 1,
|
|
3971
|
+
kms: 2,
|
|
3972
|
+
tpm: 3
|
|
3973
|
+
};
|
|
3974
|
+
function getMrConfigIdV1(composeHash) {
|
|
3975
|
+
const result = new Uint8Array(MR_CONFIG_ID_LENGTH);
|
|
3976
|
+
result[0] = 1;
|
|
3977
|
+
result.set((0, import_viem.toBytes)(composeHash), 1);
|
|
3978
|
+
return (0, import_viem.toHex)(result);
|
|
3979
|
+
}
|
|
3980
|
+
function getMrConfigId(input) {
|
|
3981
|
+
const composeHashBytes = (0, import_viem.toBytes)(input.compose_hash);
|
|
3982
|
+
const appIdBytes = (0, import_viem.toBytes)(input.app_id);
|
|
3983
|
+
const kpByte = KEY_PROVIDER_BYTE[input.key_provider_type];
|
|
3984
|
+
const kpIdBytes = input.key_provider_id === "0x" ? new Uint8Array(0) : (0, import_viem.toBytes)(input.key_provider_id);
|
|
3985
|
+
const payload = new Uint8Array(
|
|
3986
|
+
composeHashBytes.length + appIdBytes.length + 1 + kpIdBytes.length
|
|
3987
|
+
);
|
|
3988
|
+
let offset = 0;
|
|
3989
|
+
payload.set(composeHashBytes, offset);
|
|
3990
|
+
offset += composeHashBytes.length;
|
|
3991
|
+
payload.set(appIdBytes, offset);
|
|
3992
|
+
offset += appIdBytes.length;
|
|
3993
|
+
payload[offset] = kpByte;
|
|
3994
|
+
offset += 1;
|
|
3995
|
+
payload.set(kpIdBytes, offset);
|
|
3996
|
+
const hash = (0, import_viem.keccak256)(payload);
|
|
3997
|
+
const hashBytes = (0, import_viem.toBytes)(hash);
|
|
3998
|
+
const result = new Uint8Array(MR_CONFIG_ID_LENGTH);
|
|
3999
|
+
result[0] = 2;
|
|
4000
|
+
result.set(hashBytes, 1);
|
|
4001
|
+
return (0, import_viem.toHex)(result);
|
|
4002
|
+
}
|
|
4003
|
+
function verifyMrConfigId(mrConfigId, input) {
|
|
4004
|
+
const expected = getMrConfigId(input);
|
|
4005
|
+
return expected.toLowerCase() === mrConfigId.toLowerCase();
|
|
4006
|
+
}
|
|
4007
|
+
|
|
4008
|
+
// src/utils/as-hex.ts
|
|
4009
|
+
var import_viem2 = require("viem");
|
|
3641
4010
|
function asHex(value) {
|
|
3642
4011
|
if (typeof value === "string") {
|
|
3643
|
-
if (value.startsWith("0x") && (0,
|
|
4012
|
+
if (value.startsWith("0x") && (0, import_viem2.isHex)(value)) {
|
|
3644
4013
|
return value;
|
|
3645
|
-
} else if ((0,
|
|
4014
|
+
} else if ((0, import_viem2.isHex)(`0x${value}`)) {
|
|
3646
4015
|
return `0x${value}`;
|
|
3647
4016
|
}
|
|
3648
4017
|
}
|
|
@@ -3691,7 +4060,8 @@ var ErrorCodes = {
|
|
|
3691
4060
|
TOKEN_LIMIT_EXCEEDED: "ERR-05-001",
|
|
3692
4061
|
TOKEN_RATE_LIMIT: "ERR-05-002",
|
|
3693
4062
|
// Module 06: Auth
|
|
3694
|
-
OAUTH_EMAIL_INVALID: "ERR-06-001"
|
|
4063
|
+
OAUTH_EMAIL_INVALID: "ERR-06-001",
|
|
4064
|
+
PERMISSION_DENIED: "ERR-06-006"
|
|
3695
4065
|
};
|
|
3696
4066
|
|
|
3697
4067
|
// src/utils/network.ts
|
|
@@ -4151,7 +4521,7 @@ async function estimateTransactionGas(clients, transaction, options = {}) {
|
|
|
4151
4521
|
}
|
|
4152
4522
|
|
|
4153
4523
|
// src/utils/client-factories.ts
|
|
4154
|
-
var
|
|
4524
|
+
var import_viem3 = require("viem");
|
|
4155
4525
|
var import_accounts = require("viem/accounts");
|
|
4156
4526
|
function isBrowser() {
|
|
4157
4527
|
return typeof window !== "undefined" && typeof window.ethereum !== "undefined";
|
|
@@ -4164,14 +4534,14 @@ function getEthereumProvider() {
|
|
|
4164
4534
|
function createClientsFromPrivateKey(chain, privateKey, rpcUrl) {
|
|
4165
4535
|
try {
|
|
4166
4536
|
const account = (0, import_accounts.privateKeyToAccount)(privateKey);
|
|
4167
|
-
const publicClient = (0,
|
|
4537
|
+
const publicClient = (0, import_viem3.createPublicClient)({
|
|
4168
4538
|
chain,
|
|
4169
|
-
transport: (0,
|
|
4539
|
+
transport: (0, import_viem3.http)(rpcUrl || chain.rpcUrls.default.http[0])
|
|
4170
4540
|
});
|
|
4171
|
-
const walletClient = (0,
|
|
4541
|
+
const walletClient = (0, import_viem3.createWalletClient)({
|
|
4172
4542
|
account,
|
|
4173
4543
|
chain,
|
|
4174
|
-
transport: (0,
|
|
4544
|
+
transport: (0, import_viem3.http)(rpcUrl || chain.rpcUrls.default.http[0])
|
|
4175
4545
|
});
|
|
4176
4546
|
return createNetworkClients(publicClient, walletClient, account.address, chain.id);
|
|
4177
4547
|
} catch (error) {
|
|
@@ -4209,14 +4579,14 @@ async function createClientsFromBrowser(chain, rpcUrl) {
|
|
|
4209
4579
|
if (currentChainId !== chain.id) {
|
|
4210
4580
|
await switchToNetwork(provider, chain.id);
|
|
4211
4581
|
}
|
|
4212
|
-
const publicClient = (0,
|
|
4582
|
+
const publicClient = (0, import_viem3.createPublicClient)({
|
|
4213
4583
|
chain,
|
|
4214
|
-
transport: (0,
|
|
4584
|
+
transport: (0, import_viem3.http)(rpcUrl || chain.rpcUrls.default.http[0])
|
|
4215
4585
|
});
|
|
4216
|
-
const walletClient = (0,
|
|
4586
|
+
const walletClient = (0, import_viem3.createWalletClient)({
|
|
4217
4587
|
account: address,
|
|
4218
4588
|
chain,
|
|
4219
|
-
transport: (0,
|
|
4589
|
+
transport: (0, import_viem3.custom)(provider)
|
|
4220
4590
|
});
|
|
4221
4591
|
return createNetworkClients(publicClient, walletClient, address, chain.id);
|
|
4222
4592
|
} catch (error) {
|
|
@@ -4324,25 +4694,25 @@ var kmsAuthAbi = [
|
|
|
4324
4694
|
anonymous: false
|
|
4325
4695
|
}
|
|
4326
4696
|
];
|
|
4327
|
-
var DeployAppAuthRequestBaseSchema =
|
|
4697
|
+
var DeployAppAuthRequestBaseSchema = import_zod55.z.object({
|
|
4328
4698
|
// Chain configuration (conditionally required)
|
|
4329
|
-
chain:
|
|
4330
|
-
rpcUrl:
|
|
4699
|
+
chain: import_zod55.z.unknown().optional(),
|
|
4700
|
+
rpcUrl: import_zod55.z.string().optional(),
|
|
4331
4701
|
// Contract configuration (required)
|
|
4332
|
-
kmsContractAddress:
|
|
4702
|
+
kmsContractAddress: import_zod55.z.string(),
|
|
4333
4703
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
4334
|
-
privateKey:
|
|
4335
|
-
walletClient:
|
|
4704
|
+
privateKey: import_zod55.z.string().optional(),
|
|
4705
|
+
walletClient: import_zod55.z.unknown().optional(),
|
|
4336
4706
|
// Public client (optional, will create default if not provided)
|
|
4337
|
-
publicClient:
|
|
4707
|
+
publicClient: import_zod55.z.unknown().optional(),
|
|
4338
4708
|
// App configuration (optional)
|
|
4339
|
-
allowAnyDevice:
|
|
4340
|
-
deviceId:
|
|
4341
|
-
composeHash:
|
|
4342
|
-
disableUpgrades:
|
|
4709
|
+
allowAnyDevice: import_zod55.z.boolean().optional().default(false),
|
|
4710
|
+
deviceId: import_zod55.z.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
4711
|
+
composeHash: import_zod55.z.string().optional().default("0000000000000000000000000000000000000000000000000000000000000000"),
|
|
4712
|
+
disableUpgrades: import_zod55.z.boolean().optional().default(false),
|
|
4343
4713
|
// Validation configuration (optional)
|
|
4344
|
-
skipPrerequisiteChecks:
|
|
4345
|
-
minBalance:
|
|
4714
|
+
skipPrerequisiteChecks: import_zod55.z.boolean().optional().default(false),
|
|
4715
|
+
minBalance: import_zod55.z.string().optional()
|
|
4346
4716
|
// ETH amount as string, e.g., "0.01"
|
|
4347
4717
|
}).passthrough();
|
|
4348
4718
|
var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
@@ -4370,17 +4740,17 @@ var DeployAppAuthRequestSchema = DeployAppAuthRequestBaseSchema.refine(
|
|
|
4370
4740
|
path: ["chain"]
|
|
4371
4741
|
}
|
|
4372
4742
|
);
|
|
4373
|
-
var DeployAppAuthSchema =
|
|
4374
|
-
appId:
|
|
4375
|
-
appAuthAddress:
|
|
4376
|
-
deployer:
|
|
4377
|
-
transactionHash:
|
|
4378
|
-
blockNumber:
|
|
4379
|
-
gasUsed:
|
|
4743
|
+
var DeployAppAuthSchema = import_zod55.z.object({
|
|
4744
|
+
appId: import_zod55.z.string(),
|
|
4745
|
+
appAuthAddress: import_zod55.z.string(),
|
|
4746
|
+
deployer: import_zod55.z.string(),
|
|
4747
|
+
transactionHash: import_zod55.z.string(),
|
|
4748
|
+
blockNumber: import_zod55.z.bigint().optional(),
|
|
4749
|
+
gasUsed: import_zod55.z.bigint().optional()
|
|
4380
4750
|
}).passthrough();
|
|
4381
4751
|
function parseDeploymentResult(receipt, deployer, kmsContractAddress) {
|
|
4382
4752
|
try {
|
|
4383
|
-
const logs = (0,
|
|
4753
|
+
const logs = (0, import_viem4.parseEventLogs)({
|
|
4384
4754
|
abi: kmsAuthAbi,
|
|
4385
4755
|
eventName: "AppDeployedViaFactory",
|
|
4386
4756
|
logs: receipt.logs,
|
|
@@ -4458,18 +4828,18 @@ async function deployAppAuth(request, parameters) {
|
|
|
4458
4828
|
if (!chain) {
|
|
4459
4829
|
throw new Error("Chain required for publicClient");
|
|
4460
4830
|
}
|
|
4461
|
-
publicClient = (0,
|
|
4831
|
+
publicClient = (0, import_viem4.createPublicClient)({
|
|
4462
4832
|
chain,
|
|
4463
|
-
transport: (0,
|
|
4833
|
+
transport: (0, import_viem4.http)(rpcUrl)
|
|
4464
4834
|
});
|
|
4465
4835
|
}
|
|
4466
4836
|
if (!chain) {
|
|
4467
4837
|
throw new Error("Chain required for walletClient");
|
|
4468
4838
|
}
|
|
4469
|
-
walletClient = (0,
|
|
4839
|
+
walletClient = (0, import_viem4.createWalletClient)({
|
|
4470
4840
|
account,
|
|
4471
4841
|
chain,
|
|
4472
|
-
transport: (0,
|
|
4842
|
+
transport: (0, import_viem4.http)(rpcUrl)
|
|
4473
4843
|
});
|
|
4474
4844
|
deployerAddress = account.address;
|
|
4475
4845
|
chainId = chain.id;
|
|
@@ -4487,9 +4857,9 @@ async function deployAppAuth(request, parameters) {
|
|
|
4487
4857
|
if (!chain) {
|
|
4488
4858
|
throw new Error("Chain required for publicClient");
|
|
4489
4859
|
}
|
|
4490
|
-
publicClient = (0,
|
|
4860
|
+
publicClient = (0, import_viem4.createPublicClient)({
|
|
4491
4861
|
chain,
|
|
4492
|
-
transport: (0,
|
|
4862
|
+
transport: (0, import_viem4.http)(rpcUrl)
|
|
4493
4863
|
});
|
|
4494
4864
|
}
|
|
4495
4865
|
if (!walletClient.account?.address) {
|
|
@@ -4525,7 +4895,7 @@ async function deployAppAuth(request, parameters) {
|
|
|
4525
4895
|
if (!skipPrerequisiteChecks) {
|
|
4526
4896
|
const requirements = {
|
|
4527
4897
|
targetChainId: chainId,
|
|
4528
|
-
minBalance: minBalance ? (0,
|
|
4898
|
+
minBalance: minBalance ? (0, import_viem4.parseEther)(minBalance) : (0, import_viem4.parseEther)("0.001")
|
|
4529
4899
|
// Default 0.001 ETH
|
|
4530
4900
|
};
|
|
4531
4901
|
const validation = await validateNetworkPrerequisites(networkClients, requirements);
|
|
@@ -4622,8 +4992,8 @@ async function safeDeployAppAuth(request, parameters) {
|
|
|
4622
4992
|
}
|
|
4623
4993
|
|
|
4624
4994
|
// src/actions/blockchains/add_compose_hash.ts
|
|
4625
|
-
var
|
|
4626
|
-
var
|
|
4995
|
+
var import_zod56 = require("zod");
|
|
4996
|
+
var import_viem5 = require("viem");
|
|
4627
4997
|
var import_accounts3 = require("viem/accounts");
|
|
4628
4998
|
var appAuthAbi = [
|
|
4629
4999
|
{
|
|
@@ -4640,29 +5010,29 @@ var appAuthAbi = [
|
|
|
4640
5010
|
anonymous: false
|
|
4641
5011
|
}
|
|
4642
5012
|
];
|
|
4643
|
-
var AddComposeHashRequestSchema =
|
|
5013
|
+
var AddComposeHashRequestSchema = import_zod56.z.object({
|
|
4644
5014
|
// Chain configuration (conditionally required)
|
|
4645
|
-
chain:
|
|
4646
|
-
rpcUrl:
|
|
4647
|
-
appId:
|
|
4648
|
-
composeHash:
|
|
5015
|
+
chain: import_zod56.z.unknown().optional(),
|
|
5016
|
+
rpcUrl: import_zod56.z.string().optional(),
|
|
5017
|
+
appId: import_zod56.z.string(),
|
|
5018
|
+
composeHash: import_zod56.z.string(),
|
|
4649
5019
|
// Authentication mode: either privateKey OR walletClient (required, mutually exclusive)
|
|
4650
|
-
privateKey:
|
|
4651
|
-
walletClient:
|
|
5020
|
+
privateKey: import_zod56.z.string().optional(),
|
|
5021
|
+
walletClient: import_zod56.z.unknown().optional(),
|
|
4652
5022
|
// Public client (optional, will create default if not provided)
|
|
4653
|
-
publicClient:
|
|
5023
|
+
publicClient: import_zod56.z.unknown().optional(),
|
|
4654
5024
|
// Validation configuration (optional)
|
|
4655
|
-
skipPrerequisiteChecks:
|
|
4656
|
-
minBalance:
|
|
5025
|
+
skipPrerequisiteChecks: import_zod56.z.boolean().optional().default(false),
|
|
5026
|
+
minBalance: import_zod56.z.string().optional(),
|
|
4657
5027
|
// ETH amount as string, e.g., "0.01"
|
|
4658
5028
|
// Transaction control options
|
|
4659
|
-
timeout:
|
|
4660
|
-
retryOptions:
|
|
4661
|
-
signal:
|
|
5029
|
+
timeout: import_zod56.z.number().optional().default(12e4),
|
|
5030
|
+
retryOptions: import_zod56.z.unknown().optional(),
|
|
5031
|
+
signal: import_zod56.z.unknown().optional(),
|
|
4662
5032
|
// Progress callbacks
|
|
4663
|
-
onTransactionStateChange:
|
|
4664
|
-
onTransactionSubmitted:
|
|
4665
|
-
onTransactionConfirmed:
|
|
5033
|
+
onTransactionStateChange: import_zod56.z.function().optional(),
|
|
5034
|
+
onTransactionSubmitted: import_zod56.z.function().optional(),
|
|
5035
|
+
onTransactionConfirmed: import_zod56.z.function().optional()
|
|
4666
5036
|
}).passthrough().refine(
|
|
4667
5037
|
(data) => {
|
|
4668
5038
|
const hasPrivateKey = !!data.privateKey;
|
|
@@ -4686,17 +5056,17 @@ var AddComposeHashRequestSchema = import_zod52.z.object({
|
|
|
4686
5056
|
path: ["chain"]
|
|
4687
5057
|
}
|
|
4688
5058
|
);
|
|
4689
|
-
var AddComposeHashSchema =
|
|
4690
|
-
composeHash:
|
|
4691
|
-
appId:
|
|
4692
|
-
transactionHash:
|
|
4693
|
-
blockNumber:
|
|
4694
|
-
gasUsed:
|
|
5059
|
+
var AddComposeHashSchema = import_zod56.z.object({
|
|
5060
|
+
composeHash: import_zod56.z.string(),
|
|
5061
|
+
appId: import_zod56.z.string(),
|
|
5062
|
+
transactionHash: import_zod56.z.string(),
|
|
5063
|
+
blockNumber: import_zod56.z.bigint().optional(),
|
|
5064
|
+
gasUsed: import_zod56.z.bigint().optional()
|
|
4695
5065
|
}).passthrough();
|
|
4696
5066
|
function parseComposeHashResult(receipt, composeHash, appAuthAddress, appId) {
|
|
4697
5067
|
console.log(receipt.logs);
|
|
4698
5068
|
try {
|
|
4699
|
-
const logs = (0,
|
|
5069
|
+
const logs = (0, import_viem5.parseEventLogs)({
|
|
4700
5070
|
abi: appAuthAbi,
|
|
4701
5071
|
eventName: "ComposeHashAdded",
|
|
4702
5072
|
logs: receipt.logs,
|
|
@@ -4760,13 +5130,13 @@ async function addComposeHash(request, parameters) {
|
|
|
4760
5130
|
publicClient = providedPublicClient;
|
|
4761
5131
|
} else {
|
|
4762
5132
|
if (!chain) throw new Error("Chain required when creating publicClient");
|
|
4763
|
-
publicClient = (0,
|
|
5133
|
+
publicClient = (0, import_viem5.createPublicClient)({ chain, transport: (0, import_viem5.http)(rpcUrl) });
|
|
4764
5134
|
}
|
|
4765
5135
|
if (!chain) throw new Error("Chain required when creating walletClient");
|
|
4766
|
-
walletClient = (0,
|
|
5136
|
+
walletClient = (0, import_viem5.createWalletClient)({
|
|
4767
5137
|
account,
|
|
4768
5138
|
chain,
|
|
4769
|
-
transport: (0,
|
|
5139
|
+
transport: (0, import_viem5.http)(rpcUrl)
|
|
4770
5140
|
});
|
|
4771
5141
|
address = account.address;
|
|
4772
5142
|
chainId = chain.id;
|
|
@@ -4776,7 +5146,7 @@ async function addComposeHash(request, parameters) {
|
|
|
4776
5146
|
publicClient = providedPublicClient;
|
|
4777
5147
|
} else {
|
|
4778
5148
|
if (!chain) throw new Error("Chain required when creating publicClient");
|
|
4779
|
-
publicClient = (0,
|
|
5149
|
+
publicClient = (0, import_viem5.createPublicClient)({ chain, transport: (0, import_viem5.http)(rpcUrl) });
|
|
4780
5150
|
}
|
|
4781
5151
|
if (!walletClient.account?.address) {
|
|
4782
5152
|
throw new Error("WalletClient must have an account with address");
|
|
@@ -4805,7 +5175,7 @@ async function addComposeHash(request, parameters) {
|
|
|
4805
5175
|
if (!skipPrerequisiteChecks) {
|
|
4806
5176
|
const requirements = {
|
|
4807
5177
|
targetChainId: chainId,
|
|
4808
|
-
minBalance: minBalance ? (0,
|
|
5178
|
+
minBalance: minBalance ? (0, import_viem5.parseEther)(minBalance) : (0, import_viem5.parseEther)("0.001")
|
|
4809
5179
|
};
|
|
4810
5180
|
const validation = await validateNetworkPrerequisites(networkClients, requirements);
|
|
4811
5181
|
if (!validation.networkValid) {
|
|
@@ -4901,8 +5271,8 @@ async function safeAddComposeHash(request, parameters) {
|
|
|
4901
5271
|
}
|
|
4902
5272
|
|
|
4903
5273
|
// src/actions/blockchains/add_device.ts
|
|
4904
|
-
var
|
|
4905
|
-
var
|
|
5274
|
+
var import_zod57 = require("zod");
|
|
5275
|
+
var import_viem6 = require("viem");
|
|
4906
5276
|
var import_accounts4 = require("viem/accounts");
|
|
4907
5277
|
|
|
4908
5278
|
// src/actions/blockchains/abi/dstack_app.ts
|
|
@@ -4991,22 +5361,22 @@ var dstackAppAbi = [
|
|
|
4991
5361
|
];
|
|
4992
5362
|
|
|
4993
5363
|
// src/actions/blockchains/add_device.ts
|
|
4994
|
-
var AddDeviceRequestSchema =
|
|
4995
|
-
chain:
|
|
4996
|
-
rpcUrl:
|
|
4997
|
-
appAddress:
|
|
4998
|
-
deviceId:
|
|
4999
|
-
privateKey:
|
|
5000
|
-
walletClient:
|
|
5001
|
-
publicClient:
|
|
5002
|
-
skipPrerequisiteChecks:
|
|
5003
|
-
minBalance:
|
|
5004
|
-
timeout:
|
|
5005
|
-
retryOptions:
|
|
5006
|
-
signal:
|
|
5007
|
-
onTransactionStateChange:
|
|
5008
|
-
onTransactionSubmitted:
|
|
5009
|
-
onTransactionConfirmed:
|
|
5364
|
+
var AddDeviceRequestSchema = import_zod57.z.object({
|
|
5365
|
+
chain: import_zod57.z.unknown().optional(),
|
|
5366
|
+
rpcUrl: import_zod57.z.string().optional(),
|
|
5367
|
+
appAddress: import_zod57.z.string(),
|
|
5368
|
+
deviceId: import_zod57.z.string(),
|
|
5369
|
+
privateKey: import_zod57.z.string().optional(),
|
|
5370
|
+
walletClient: import_zod57.z.unknown().optional(),
|
|
5371
|
+
publicClient: import_zod57.z.unknown().optional(),
|
|
5372
|
+
skipPrerequisiteChecks: import_zod57.z.boolean().optional().default(false),
|
|
5373
|
+
minBalance: import_zod57.z.string().optional(),
|
|
5374
|
+
timeout: import_zod57.z.number().optional().default(12e4),
|
|
5375
|
+
retryOptions: import_zod57.z.unknown().optional(),
|
|
5376
|
+
signal: import_zod57.z.unknown().optional(),
|
|
5377
|
+
onTransactionStateChange: import_zod57.z.function().optional(),
|
|
5378
|
+
onTransactionSubmitted: import_zod57.z.function().optional(),
|
|
5379
|
+
onTransactionConfirmed: import_zod57.z.function().optional()
|
|
5010
5380
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
5011
5381
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
5012
5382
|
path: ["privateKey", "walletClient"]
|
|
@@ -5020,12 +5390,12 @@ var AddDeviceRequestSchema = import_zod53.z.object({
|
|
|
5020
5390
|
path: ["chain"]
|
|
5021
5391
|
}
|
|
5022
5392
|
);
|
|
5023
|
-
var AddDeviceSchema =
|
|
5024
|
-
appAddress:
|
|
5025
|
-
deviceId:
|
|
5026
|
-
transactionHash:
|
|
5027
|
-
blockNumber:
|
|
5028
|
-
gasUsed:
|
|
5393
|
+
var AddDeviceSchema = import_zod57.z.object({
|
|
5394
|
+
appAddress: import_zod57.z.string(),
|
|
5395
|
+
deviceId: import_zod57.z.string(),
|
|
5396
|
+
transactionHash: import_zod57.z.string(),
|
|
5397
|
+
blockNumber: import_zod57.z.bigint().optional(),
|
|
5398
|
+
gasUsed: import_zod57.z.bigint().optional()
|
|
5029
5399
|
}).passthrough();
|
|
5030
5400
|
async function addDevice(request, parameters) {
|
|
5031
5401
|
const validatedRequest = AddDeviceRequestSchema.parse(request);
|
|
@@ -5054,9 +5424,9 @@ async function addDevice(request, parameters) {
|
|
|
5054
5424
|
let chainId;
|
|
5055
5425
|
if (privateKey) {
|
|
5056
5426
|
const account = (0, import_accounts4.privateKeyToAccount)(privateKey);
|
|
5057
|
-
const transport = (0,
|
|
5058
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5059
|
-
walletClient = (0,
|
|
5427
|
+
const transport = (0, import_viem6.http)(rpcUrl, { timeout });
|
|
5428
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem6.createPublicClient)({ chain, transport });
|
|
5429
|
+
walletClient = (0, import_viem6.createWalletClient)({
|
|
5060
5430
|
account,
|
|
5061
5431
|
chain,
|
|
5062
5432
|
transport
|
|
@@ -5065,9 +5435,9 @@ async function addDevice(request, parameters) {
|
|
|
5065
5435
|
chainId = chain.id;
|
|
5066
5436
|
} else if (providedWalletClient) {
|
|
5067
5437
|
walletClient = providedWalletClient;
|
|
5068
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5438
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem6.createPublicClient)({
|
|
5069
5439
|
chain,
|
|
5070
|
-
transport: (0,
|
|
5440
|
+
transport: (0, import_viem6.http)(rpcUrl, { timeout })
|
|
5071
5441
|
});
|
|
5072
5442
|
if (!walletClient.account?.address) {
|
|
5073
5443
|
throw new Error("WalletClient must have an account with address");
|
|
@@ -5091,7 +5461,7 @@ async function addDevice(request, parameters) {
|
|
|
5091
5461
|
if (!skipPrerequisiteChecks) {
|
|
5092
5462
|
const requirements = {
|
|
5093
5463
|
targetChainId: chainId,
|
|
5094
|
-
minBalance: minBalance ? (0,
|
|
5464
|
+
minBalance: minBalance ? (0, import_viem6.parseEther)(minBalance) : (0, import_viem6.parseEther)("0.001")
|
|
5095
5465
|
};
|
|
5096
5466
|
const validation = await validateNetworkPrerequisites(networkClients, requirements);
|
|
5097
5467
|
if (!validation.networkValid) {
|
|
@@ -5173,25 +5543,25 @@ async function safeAddDevice(request, parameters) {
|
|
|
5173
5543
|
}
|
|
5174
5544
|
|
|
5175
5545
|
// src/actions/blockchains/remove_device.ts
|
|
5176
|
-
var
|
|
5177
|
-
var
|
|
5546
|
+
var import_zod58 = require("zod");
|
|
5547
|
+
var import_viem7 = require("viem");
|
|
5178
5548
|
var import_accounts5 = require("viem/accounts");
|
|
5179
|
-
var RemoveDeviceRequestSchema =
|
|
5180
|
-
chain:
|
|
5181
|
-
rpcUrl:
|
|
5182
|
-
appAddress:
|
|
5183
|
-
deviceId:
|
|
5184
|
-
privateKey:
|
|
5185
|
-
walletClient:
|
|
5186
|
-
publicClient:
|
|
5187
|
-
skipPrerequisiteChecks:
|
|
5188
|
-
minBalance:
|
|
5189
|
-
timeout:
|
|
5190
|
-
retryOptions:
|
|
5191
|
-
signal:
|
|
5192
|
-
onTransactionStateChange:
|
|
5193
|
-
onTransactionSubmitted:
|
|
5194
|
-
onTransactionConfirmed:
|
|
5549
|
+
var RemoveDeviceRequestSchema = import_zod58.z.object({
|
|
5550
|
+
chain: import_zod58.z.unknown().optional(),
|
|
5551
|
+
rpcUrl: import_zod58.z.string().optional(),
|
|
5552
|
+
appAddress: import_zod58.z.string(),
|
|
5553
|
+
deviceId: import_zod58.z.string(),
|
|
5554
|
+
privateKey: import_zod58.z.string().optional(),
|
|
5555
|
+
walletClient: import_zod58.z.unknown().optional(),
|
|
5556
|
+
publicClient: import_zod58.z.unknown().optional(),
|
|
5557
|
+
skipPrerequisiteChecks: import_zod58.z.boolean().optional().default(false),
|
|
5558
|
+
minBalance: import_zod58.z.string().optional(),
|
|
5559
|
+
timeout: import_zod58.z.number().optional().default(12e4),
|
|
5560
|
+
retryOptions: import_zod58.z.unknown().optional(),
|
|
5561
|
+
signal: import_zod58.z.unknown().optional(),
|
|
5562
|
+
onTransactionStateChange: import_zod58.z.function().optional(),
|
|
5563
|
+
onTransactionSubmitted: import_zod58.z.function().optional(),
|
|
5564
|
+
onTransactionConfirmed: import_zod58.z.function().optional()
|
|
5195
5565
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
5196
5566
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
5197
5567
|
path: ["privateKey", "walletClient"]
|
|
@@ -5205,12 +5575,12 @@ var RemoveDeviceRequestSchema = import_zod54.z.object({
|
|
|
5205
5575
|
path: ["chain"]
|
|
5206
5576
|
}
|
|
5207
5577
|
);
|
|
5208
|
-
var RemoveDeviceSchema =
|
|
5209
|
-
appAddress:
|
|
5210
|
-
deviceId:
|
|
5211
|
-
transactionHash:
|
|
5212
|
-
blockNumber:
|
|
5213
|
-
gasUsed:
|
|
5578
|
+
var RemoveDeviceSchema = import_zod58.z.object({
|
|
5579
|
+
appAddress: import_zod58.z.string(),
|
|
5580
|
+
deviceId: import_zod58.z.string(),
|
|
5581
|
+
transactionHash: import_zod58.z.string(),
|
|
5582
|
+
blockNumber: import_zod58.z.bigint().optional(),
|
|
5583
|
+
gasUsed: import_zod58.z.bigint().optional()
|
|
5214
5584
|
}).passthrough();
|
|
5215
5585
|
async function removeDevice(request, parameters) {
|
|
5216
5586
|
const validatedRequest = RemoveDeviceRequestSchema.parse(request);
|
|
@@ -5239,9 +5609,9 @@ async function removeDevice(request, parameters) {
|
|
|
5239
5609
|
let chainId;
|
|
5240
5610
|
if (privateKey) {
|
|
5241
5611
|
const account = (0, import_accounts5.privateKeyToAccount)(privateKey);
|
|
5242
|
-
const transport = (0,
|
|
5243
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5244
|
-
walletClient = (0,
|
|
5612
|
+
const transport = (0, import_viem7.http)(rpcUrl, { timeout });
|
|
5613
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem7.createPublicClient)({ chain, transport });
|
|
5614
|
+
walletClient = (0, import_viem7.createWalletClient)({
|
|
5245
5615
|
account,
|
|
5246
5616
|
chain,
|
|
5247
5617
|
transport
|
|
@@ -5250,9 +5620,9 @@ async function removeDevice(request, parameters) {
|
|
|
5250
5620
|
chainId = chain.id;
|
|
5251
5621
|
} else if (providedWalletClient) {
|
|
5252
5622
|
walletClient = providedWalletClient;
|
|
5253
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5623
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem7.createPublicClient)({
|
|
5254
5624
|
chain,
|
|
5255
|
-
transport: (0,
|
|
5625
|
+
transport: (0, import_viem7.http)(rpcUrl, { timeout })
|
|
5256
5626
|
});
|
|
5257
5627
|
if (!walletClient.account?.address) {
|
|
5258
5628
|
throw new Error("WalletClient must have an account with address");
|
|
@@ -5276,7 +5646,7 @@ async function removeDevice(request, parameters) {
|
|
|
5276
5646
|
if (!skipPrerequisiteChecks) {
|
|
5277
5647
|
const requirements = {
|
|
5278
5648
|
targetChainId: chainId,
|
|
5279
|
-
minBalance: minBalance ? (0,
|
|
5649
|
+
minBalance: minBalance ? (0, import_viem7.parseEther)(minBalance) : (0, import_viem7.parseEther)("0.001")
|
|
5280
5650
|
};
|
|
5281
5651
|
const validation = await validateNetworkPrerequisites(networkClients, requirements);
|
|
5282
5652
|
if (!validation.networkValid) {
|
|
@@ -5348,25 +5718,25 @@ async function safeRemoveDevice(request, parameters) {
|
|
|
5348
5718
|
}
|
|
5349
5719
|
|
|
5350
5720
|
// src/actions/blockchains/set_allow_any_device.ts
|
|
5351
|
-
var
|
|
5352
|
-
var
|
|
5721
|
+
var import_zod59 = require("zod");
|
|
5722
|
+
var import_viem8 = require("viem");
|
|
5353
5723
|
var import_accounts6 = require("viem/accounts");
|
|
5354
|
-
var SetAllowAnyDeviceRequestSchema =
|
|
5355
|
-
chain:
|
|
5356
|
-
rpcUrl:
|
|
5357
|
-
appAddress:
|
|
5358
|
-
allow:
|
|
5359
|
-
privateKey:
|
|
5360
|
-
walletClient:
|
|
5361
|
-
publicClient:
|
|
5362
|
-
skipPrerequisiteChecks:
|
|
5363
|
-
minBalance:
|
|
5364
|
-
timeout:
|
|
5365
|
-
retryOptions:
|
|
5366
|
-
signal:
|
|
5367
|
-
onTransactionStateChange:
|
|
5368
|
-
onTransactionSubmitted:
|
|
5369
|
-
onTransactionConfirmed:
|
|
5724
|
+
var SetAllowAnyDeviceRequestSchema = import_zod59.z.object({
|
|
5725
|
+
chain: import_zod59.z.unknown().optional(),
|
|
5726
|
+
rpcUrl: import_zod59.z.string().optional(),
|
|
5727
|
+
appAddress: import_zod59.z.string(),
|
|
5728
|
+
allow: import_zod59.z.boolean(),
|
|
5729
|
+
privateKey: import_zod59.z.string().optional(),
|
|
5730
|
+
walletClient: import_zod59.z.unknown().optional(),
|
|
5731
|
+
publicClient: import_zod59.z.unknown().optional(),
|
|
5732
|
+
skipPrerequisiteChecks: import_zod59.z.boolean().optional().default(false),
|
|
5733
|
+
minBalance: import_zod59.z.string().optional(),
|
|
5734
|
+
timeout: import_zod59.z.number().optional().default(12e4),
|
|
5735
|
+
retryOptions: import_zod59.z.unknown().optional(),
|
|
5736
|
+
signal: import_zod59.z.unknown().optional(),
|
|
5737
|
+
onTransactionStateChange: import_zod59.z.function().optional(),
|
|
5738
|
+
onTransactionSubmitted: import_zod59.z.function().optional(),
|
|
5739
|
+
onTransactionConfirmed: import_zod59.z.function().optional()
|
|
5370
5740
|
}).passthrough().refine((data) => !!data.privateKey !== !!data.walletClient, {
|
|
5371
5741
|
message: "Either 'privateKey' or 'walletClient' must be provided, but not both",
|
|
5372
5742
|
path: ["privateKey", "walletClient"]
|
|
@@ -5380,12 +5750,12 @@ var SetAllowAnyDeviceRequestSchema = import_zod55.z.object({
|
|
|
5380
5750
|
path: ["chain"]
|
|
5381
5751
|
}
|
|
5382
5752
|
);
|
|
5383
|
-
var SetAllowAnyDeviceSchema =
|
|
5384
|
-
appAddress:
|
|
5385
|
-
allow:
|
|
5386
|
-
transactionHash:
|
|
5387
|
-
blockNumber:
|
|
5388
|
-
gasUsed:
|
|
5753
|
+
var SetAllowAnyDeviceSchema = import_zod59.z.object({
|
|
5754
|
+
appAddress: import_zod59.z.string(),
|
|
5755
|
+
allow: import_zod59.z.boolean(),
|
|
5756
|
+
transactionHash: import_zod59.z.string(),
|
|
5757
|
+
blockNumber: import_zod59.z.bigint().optional(),
|
|
5758
|
+
gasUsed: import_zod59.z.bigint().optional()
|
|
5389
5759
|
}).passthrough();
|
|
5390
5760
|
async function setAllowAnyDevice(request, parameters) {
|
|
5391
5761
|
const validatedRequest = SetAllowAnyDeviceRequestSchema.parse(request);
|
|
@@ -5413,9 +5783,9 @@ async function setAllowAnyDevice(request, parameters) {
|
|
|
5413
5783
|
let chainId;
|
|
5414
5784
|
if (privateKey) {
|
|
5415
5785
|
const account = (0, import_accounts6.privateKeyToAccount)(privateKey);
|
|
5416
|
-
const transport = (0,
|
|
5417
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5418
|
-
walletClient = (0,
|
|
5786
|
+
const transport = (0, import_viem8.http)(rpcUrl, { timeout });
|
|
5787
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem8.createPublicClient)({ chain, transport });
|
|
5788
|
+
walletClient = (0, import_viem8.createWalletClient)({
|
|
5419
5789
|
account,
|
|
5420
5790
|
chain,
|
|
5421
5791
|
transport
|
|
@@ -5424,9 +5794,9 @@ async function setAllowAnyDevice(request, parameters) {
|
|
|
5424
5794
|
chainId = chain.id;
|
|
5425
5795
|
} else if (providedWalletClient) {
|
|
5426
5796
|
walletClient = providedWalletClient;
|
|
5427
|
-
publicClient = providedPublicClient ? providedPublicClient : (0,
|
|
5797
|
+
publicClient = providedPublicClient ? providedPublicClient : (0, import_viem8.createPublicClient)({
|
|
5428
5798
|
chain,
|
|
5429
|
-
transport: (0,
|
|
5799
|
+
transport: (0, import_viem8.http)(rpcUrl, { timeout })
|
|
5430
5800
|
});
|
|
5431
5801
|
if (!walletClient.account?.address) {
|
|
5432
5802
|
throw new Error("WalletClient must have an account with address");
|
|
@@ -5450,7 +5820,7 @@ async function setAllowAnyDevice(request, parameters) {
|
|
|
5450
5820
|
if (!skipPrerequisiteChecks) {
|
|
5451
5821
|
const requirements = {
|
|
5452
5822
|
targetChainId: chainId,
|
|
5453
|
-
minBalance: minBalance ? (0,
|
|
5823
|
+
minBalance: minBalance ? (0, import_viem8.parseEther)(minBalance) : (0, import_viem8.parseEther)("0.001")
|
|
5454
5824
|
};
|
|
5455
5825
|
const validation = await validateNetworkPrerequisites(networkClients, requirements);
|
|
5456
5826
|
if (!validation.networkValid) {
|
|
@@ -5522,20 +5892,20 @@ async function safeSetAllowAnyDevice(request, parameters) {
|
|
|
5522
5892
|
}
|
|
5523
5893
|
|
|
5524
5894
|
// src/actions/blockchains/get_allowed_devices.ts
|
|
5525
|
-
var
|
|
5526
|
-
var
|
|
5527
|
-
var GetAllowedDevicesSchema =
|
|
5528
|
-
appAddress:
|
|
5529
|
-
owner:
|
|
5530
|
-
allowAnyDevice:
|
|
5531
|
-
devices:
|
|
5895
|
+
var import_zod60 = require("zod");
|
|
5896
|
+
var import_viem9 = require("viem");
|
|
5897
|
+
var GetAllowedDevicesSchema = import_zod60.z.object({
|
|
5898
|
+
appAddress: import_zod60.z.string(),
|
|
5899
|
+
owner: import_zod60.z.string(),
|
|
5900
|
+
allowAnyDevice: import_zod60.z.boolean(),
|
|
5901
|
+
devices: import_zod60.z.array(import_zod60.z.string())
|
|
5532
5902
|
});
|
|
5533
5903
|
async function getAllowedDevices(request) {
|
|
5534
5904
|
const { chain, rpcUrl, appAddress, deviceIds, publicClient: providedPublicClient } = request;
|
|
5535
5905
|
const contractAddress = appAddress.startsWith("0x") ? appAddress : `0x${appAddress}`;
|
|
5536
5906
|
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
5537
5907
|
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
5538
|
-
return (0,
|
|
5908
|
+
return (0, import_viem9.createPublicClient)({ chain, transport: (0, import_viem9.http)(rpcUrl) });
|
|
5539
5909
|
})();
|
|
5540
5910
|
const [allowAnyDevice, owner] = await Promise.all([
|
|
5541
5911
|
publicClient.readContract({
|
|
@@ -5594,14 +5964,14 @@ async function safeGetAllowedDevices(request) {
|
|
|
5594
5964
|
}
|
|
5595
5965
|
|
|
5596
5966
|
// src/actions/blockchains/check_device_allowed.ts
|
|
5597
|
-
var
|
|
5967
|
+
var import_viem10 = require("viem");
|
|
5598
5968
|
async function checkDeviceAllowed(request) {
|
|
5599
5969
|
const { chain, rpcUrl, appAddress, deviceId, publicClient: providedPublicClient } = request;
|
|
5600
5970
|
const contractAddress = appAddress.startsWith("0x") ? appAddress : `0x${appAddress}`;
|
|
5601
5971
|
const deviceIdHex = asHex(deviceId);
|
|
5602
5972
|
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
5603
5973
|
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
5604
|
-
return (0,
|
|
5974
|
+
return (0, import_viem10.createPublicClient)({ chain, transport: (0, import_viem10.http)(rpcUrl) });
|
|
5605
5975
|
})();
|
|
5606
5976
|
const allowAny = await publicClient.readContract({
|
|
5607
5977
|
address: contractAddress,
|
|
@@ -5631,14 +6001,14 @@ async function safeCheckDeviceAllowed(request) {
|
|
|
5631
6001
|
}
|
|
5632
6002
|
|
|
5633
6003
|
// src/actions/blockchains/check_compose_hash_allowed.ts
|
|
5634
|
-
var
|
|
6004
|
+
var import_viem11 = require("viem");
|
|
5635
6005
|
async function checkComposeHashAllowed(request) {
|
|
5636
6006
|
const { chain, rpcUrl, appAddress, composeHash, publicClient: providedPublicClient } = request;
|
|
5637
6007
|
const contractAddress = appAddress.startsWith("0x") ? appAddress : `0x${appAddress}`;
|
|
5638
6008
|
const composeHashHex = asHex(composeHash);
|
|
5639
6009
|
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
5640
6010
|
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
5641
|
-
return (0,
|
|
6011
|
+
return (0, import_viem11.createPublicClient)({ chain, transport: (0, import_viem11.http)(rpcUrl) });
|
|
5642
6012
|
})();
|
|
5643
6013
|
const allowed = await publicClient.readContract({
|
|
5644
6014
|
address: contractAddress,
|
|
@@ -5662,7 +6032,7 @@ async function safeCheckComposeHashAllowed(request) {
|
|
|
5662
6032
|
}
|
|
5663
6033
|
|
|
5664
6034
|
// src/actions/blockchains/check_on_chain_prerequisites.ts
|
|
5665
|
-
var
|
|
6035
|
+
var import_viem12 = require("viem");
|
|
5666
6036
|
async function checkOnChainPrerequisites(request) {
|
|
5667
6037
|
const {
|
|
5668
6038
|
chain,
|
|
@@ -5677,7 +6047,7 @@ async function checkOnChainPrerequisites(request) {
|
|
|
5677
6047
|
const composeHashHex = asHex(composeHash);
|
|
5678
6048
|
const publicClient = providedPublicClient ? providedPublicClient : (() => {
|
|
5679
6049
|
if (!chain) throw new Error("Chain is required when publicClient is not provided");
|
|
5680
|
-
return (0,
|
|
6050
|
+
return (0, import_viem12.createPublicClient)({ chain, transport: (0, import_viem12.http)(rpcUrl) });
|
|
5681
6051
|
})();
|
|
5682
6052
|
const calls = [
|
|
5683
6053
|
{
|
|
@@ -5722,15 +6092,15 @@ async function safeCheckOnChainPrerequisites(request) {
|
|
|
5722
6092
|
}
|
|
5723
6093
|
|
|
5724
6094
|
// src/actions/workspaces/get_workspace_nodes.ts
|
|
5725
|
-
var
|
|
6095
|
+
var import_zod61 = require("zod");
|
|
5726
6096
|
var NodeRefSchema2 = NodeRefSchema;
|
|
5727
6097
|
var NodeInfoSchema = NodeRefSchema2;
|
|
5728
|
-
var GetWorkspaceNodesSchema =
|
|
5729
|
-
items:
|
|
5730
|
-
total:
|
|
5731
|
-
page:
|
|
5732
|
-
page_size:
|
|
5733
|
-
pages:
|
|
6098
|
+
var GetWorkspaceNodesSchema = import_zod61.z.object({
|
|
6099
|
+
items: import_zod61.z.array(NodeRefSchema2),
|
|
6100
|
+
total: import_zod61.z.number(),
|
|
6101
|
+
page: import_zod61.z.number(),
|
|
6102
|
+
page_size: import_zod61.z.number(),
|
|
6103
|
+
pages: import_zod61.z.number()
|
|
5734
6104
|
}).passthrough();
|
|
5735
6105
|
var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAction(GetWorkspaceNodesSchema, async (client, request) => {
|
|
5736
6106
|
const { teamSlug, page, pageSize } = request;
|
|
@@ -5742,56 +6112,74 @@ var { action: getWorkspaceNodes, safeAction: safeGetWorkspaceNodes } = defineAct
|
|
|
5742
6112
|
});
|
|
5743
6113
|
|
|
5744
6114
|
// src/actions/workspaces/get_workspace_quotas.ts
|
|
5745
|
-
var
|
|
5746
|
-
var QuotaMetricSchema =
|
|
5747
|
-
limit:
|
|
5748
|
-
remaining:
|
|
6115
|
+
var import_zod62 = require("zod");
|
|
6116
|
+
var QuotaMetricSchema = import_zod62.z.object({
|
|
6117
|
+
limit: import_zod62.z.number(),
|
|
6118
|
+
remaining: import_zod62.z.number()
|
|
5749
6119
|
}).passthrough();
|
|
5750
|
-
var WorkspaceQuotasSchema =
|
|
6120
|
+
var WorkspaceQuotasSchema = import_zod62.z.object({
|
|
5751
6121
|
vm_slots: QuotaMetricSchema,
|
|
5752
6122
|
vcpu: QuotaMetricSchema,
|
|
5753
6123
|
memory_mb: QuotaMetricSchema,
|
|
5754
6124
|
disk_gb: QuotaMetricSchema
|
|
5755
6125
|
}).passthrough();
|
|
5756
|
-
var WorkspaceReservedGpuQuotaSchema =
|
|
6126
|
+
var WorkspaceReservedGpuQuotaSchema = import_zod62.z.object({
|
|
5757
6127
|
gpus: QuotaMetricSchema,
|
|
5758
|
-
in_use:
|
|
5759
|
-
misconfigured:
|
|
6128
|
+
in_use: import_zod62.z.number(),
|
|
6129
|
+
misconfigured: import_zod62.z.number()
|
|
5760
6130
|
}).passthrough();
|
|
5761
|
-
var GetWorkspaceQuotasSchema =
|
|
5762
|
-
team_slug:
|
|
5763
|
-
tier:
|
|
6131
|
+
var GetWorkspaceQuotasSchema = import_zod62.z.object({
|
|
6132
|
+
team_slug: import_zod62.z.string(),
|
|
6133
|
+
tier: import_zod62.z.string(),
|
|
5764
6134
|
quotas: WorkspaceQuotasSchema,
|
|
5765
6135
|
reserved_nodes: QuotaMetricSchema,
|
|
5766
6136
|
reserved_gpu: WorkspaceReservedGpuQuotaSchema,
|
|
5767
|
-
as_of:
|
|
6137
|
+
as_of: import_zod62.z.string()
|
|
5768
6138
|
}).passthrough();
|
|
5769
6139
|
var { action: getWorkspaceQuotas, safeAction: safeGetWorkspaceQuotas } = defineAction(GetWorkspaceQuotasSchema, async (client, request) => {
|
|
5770
6140
|
return await client.get(`/workspaces/${request.teamSlug}/quotas`);
|
|
5771
6141
|
});
|
|
5772
6142
|
|
|
5773
6143
|
// src/actions/cvms/replicate_cvm.ts
|
|
5774
|
-
var
|
|
6144
|
+
var import_zod63 = require("zod");
|
|
5775
6145
|
var ReplicateCvmRequestSchema = refineCvmId(
|
|
5776
6146
|
CvmIdObjectSchema.extend({
|
|
5777
|
-
node_id:
|
|
6147
|
+
node_id: import_zod63.z.number().optional()
|
|
5778
6148
|
})
|
|
5779
6149
|
);
|
|
5780
|
-
|
|
6150
|
+
async function replicateCvm(client, request) {
|
|
5781
6151
|
const parsed = ReplicateCvmRequestSchema.parse(request);
|
|
5782
6152
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
5783
6153
|
const { node_id } = parsed;
|
|
5784
|
-
|
|
5785
|
-
|
|
6154
|
+
const response = await client.post(`/cvms/${cvmId}/replicas`, { node_id });
|
|
6155
|
+
return getVMSchemaForVersion(client.config.version).parse(response);
|
|
6156
|
+
}
|
|
6157
|
+
async function safeReplicateCvm(client, request) {
|
|
6158
|
+
try {
|
|
6159
|
+
const data = await replicateCvm(client, request);
|
|
6160
|
+
return { success: true, data };
|
|
6161
|
+
} catch (error) {
|
|
6162
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6163
|
+
return { success: false, error };
|
|
6164
|
+
}
|
|
6165
|
+
return {
|
|
6166
|
+
success: false,
|
|
6167
|
+
error: {
|
|
6168
|
+
name: "Error",
|
|
6169
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6170
|
+
}
|
|
6171
|
+
};
|
|
6172
|
+
}
|
|
6173
|
+
}
|
|
5786
6174
|
|
|
5787
6175
|
// src/actions/cvms/watch_cvm_state.ts
|
|
5788
|
-
var
|
|
5789
|
-
var WatchCvmStateParamsSchema =
|
|
5790
|
-
target:
|
|
5791
|
-
interval:
|
|
5792
|
-
timeout:
|
|
5793
|
-
maxRetries:
|
|
5794
|
-
retryDelay:
|
|
6176
|
+
var import_zod64 = require("zod");
|
|
6177
|
+
var WatchCvmStateParamsSchema = import_zod64.z.object({
|
|
6178
|
+
target: import_zod64.z.string().describe("Target status to wait for (e.g., 'running', 'stopped')"),
|
|
6179
|
+
interval: import_zod64.z.number().min(5).max(30).default(5).describe("Polling interval in seconds"),
|
|
6180
|
+
timeout: import_zod64.z.number().min(10).max(600).default(300).describe("Timeout per attempt in seconds"),
|
|
6181
|
+
maxRetries: import_zod64.z.number().min(0).default(Number.POSITIVE_INFINITY).describe("Maximum number of retry attempts (Infinity for unlimited)"),
|
|
6182
|
+
retryDelay: import_zod64.z.number().min(0).default(5e3).describe("Delay between retries in milliseconds")
|
|
5795
6183
|
});
|
|
5796
6184
|
var WatchCvmStateRequestSchema = WatchCvmStateParamsSchema;
|
|
5797
6185
|
var WatchAbortedError = class extends Error {
|
|
@@ -5979,57 +6367,57 @@ function sleep(ms, signal) {
|
|
|
5979
6367
|
}
|
|
5980
6368
|
|
|
5981
6369
|
// src/actions/cvms/patch_cvm.ts
|
|
5982
|
-
var
|
|
6370
|
+
var import_zod65 = require("zod");
|
|
5983
6371
|
var PatchCvmRequestSchema = refineCvmId(
|
|
5984
6372
|
CvmIdObjectSchema.extend({
|
|
5985
6373
|
// Compose-hash-affecting fields
|
|
5986
|
-
docker_compose_file:
|
|
5987
|
-
pre_launch_script:
|
|
5988
|
-
allowed_envs:
|
|
6374
|
+
docker_compose_file: import_zod65.z.string().optional(),
|
|
6375
|
+
pre_launch_script: import_zod65.z.string().optional(),
|
|
6376
|
+
allowed_envs: import_zod65.z.array(import_zod65.z.string()).optional(),
|
|
5989
6377
|
// Visibility
|
|
5990
|
-
public_logs:
|
|
5991
|
-
public_sysinfo:
|
|
5992
|
-
public_tcbinfo:
|
|
6378
|
+
public_logs: import_zod65.z.boolean().optional(),
|
|
6379
|
+
public_sysinfo: import_zod65.z.boolean().optional(),
|
|
6380
|
+
public_tcbinfo: import_zod65.z.boolean().optional(),
|
|
5993
6381
|
// Non-compose-hash config
|
|
5994
|
-
encrypted_env:
|
|
5995
|
-
user_config:
|
|
5996
|
-
gpus:
|
|
5997
|
-
count:
|
|
5998
|
-
product_name:
|
|
6382
|
+
encrypted_env: import_zod65.z.string().optional(),
|
|
6383
|
+
user_config: import_zod65.z.string().optional(),
|
|
6384
|
+
gpus: import_zod65.z.object({
|
|
6385
|
+
count: import_zod65.z.number(),
|
|
6386
|
+
product_name: import_zod65.z.string().optional()
|
|
5999
6387
|
}).optional(),
|
|
6000
6388
|
// Resources
|
|
6001
|
-
vcpu:
|
|
6002
|
-
memory:
|
|
6003
|
-
disk_size:
|
|
6389
|
+
vcpu: import_zod65.z.number().optional(),
|
|
6390
|
+
memory: import_zod65.z.number().optional(),
|
|
6391
|
+
disk_size: import_zod65.z.number().optional(),
|
|
6004
6392
|
// OS image
|
|
6005
|
-
image:
|
|
6393
|
+
image: import_zod65.z.string().optional(),
|
|
6006
6394
|
// Shutdown behavior
|
|
6007
|
-
shutdown_timeout:
|
|
6008
|
-
allow_force_stop:
|
|
6395
|
+
shutdown_timeout: import_zod65.z.number().optional(),
|
|
6396
|
+
allow_force_stop: import_zod65.z.boolean().optional(),
|
|
6009
6397
|
// Prepare-only mode (for multisig workflows)
|
|
6010
|
-
prepareOnly:
|
|
6398
|
+
prepareOnly: import_zod65.z.boolean().optional()
|
|
6011
6399
|
})
|
|
6012
6400
|
);
|
|
6013
|
-
var PatchCvmAcceptedSchema =
|
|
6014
|
-
requiresOnChainHash:
|
|
6015
|
-
correlationId:
|
|
6016
|
-
});
|
|
6017
|
-
var PatchCvmHashRequiredSchema =
|
|
6018
|
-
requiresOnChainHash:
|
|
6019
|
-
composeHash:
|
|
6020
|
-
appId:
|
|
6021
|
-
deviceId:
|
|
6401
|
+
var PatchCvmAcceptedSchema = import_zod65.z.object({
|
|
6402
|
+
requiresOnChainHash: import_zod65.z.literal(false),
|
|
6403
|
+
correlationId: import_zod65.z.string()
|
|
6404
|
+
});
|
|
6405
|
+
var PatchCvmHashRequiredSchema = import_zod65.z.object({
|
|
6406
|
+
requiresOnChainHash: import_zod65.z.literal(true),
|
|
6407
|
+
composeHash: import_zod65.z.string(),
|
|
6408
|
+
appId: import_zod65.z.string(),
|
|
6409
|
+
deviceId: import_zod65.z.string(),
|
|
6022
6410
|
kmsInfo: KmsInfoSchema,
|
|
6023
|
-
commitToken:
|
|
6024
|
-
commitUrl:
|
|
6025
|
-
apiCommitUrl:
|
|
6026
|
-
onchainStatus:
|
|
6027
|
-
compose_hash_allowed:
|
|
6028
|
-
device_id_allowed:
|
|
6029
|
-
is_allowed:
|
|
6411
|
+
commitToken: import_zod65.z.string().optional(),
|
|
6412
|
+
commitUrl: import_zod65.z.string().optional(),
|
|
6413
|
+
apiCommitUrl: import_zod65.z.string().optional(),
|
|
6414
|
+
onchainStatus: import_zod65.z.object({
|
|
6415
|
+
compose_hash_allowed: import_zod65.z.boolean(),
|
|
6416
|
+
device_id_allowed: import_zod65.z.boolean(),
|
|
6417
|
+
is_allowed: import_zod65.z.boolean()
|
|
6030
6418
|
}).optional()
|
|
6031
6419
|
});
|
|
6032
|
-
var PatchCvmResultSchema =
|
|
6420
|
+
var PatchCvmResultSchema = import_zod65.z.discriminatedUnion("requiresOnChainHash", [
|
|
6033
6421
|
PatchCvmAcceptedSchema,
|
|
6034
6422
|
PatchCvmHashRequiredSchema
|
|
6035
6423
|
]);
|
|
@@ -6078,15 +6466,15 @@ var { action: patchCvm, safeAction: safePatchCvm } = defineAction(PatchCvmResult
|
|
|
6078
6466
|
});
|
|
6079
6467
|
|
|
6080
6468
|
// src/actions/cvms/confirm_cvm_patch.ts
|
|
6081
|
-
var
|
|
6469
|
+
var import_zod66 = require("zod");
|
|
6082
6470
|
var ConfirmCvmPatchRequestSchema = refineCvmId(
|
|
6083
6471
|
CvmIdObjectSchema.extend({
|
|
6084
|
-
composeHash:
|
|
6085
|
-
transactionHash:
|
|
6472
|
+
composeHash: import_zod66.z.string().describe("Compose hash from patchCvm Phase 1 response"),
|
|
6473
|
+
transactionHash: import_zod66.z.string().describe("Transaction hash proving on-chain registration")
|
|
6086
6474
|
})
|
|
6087
6475
|
);
|
|
6088
|
-
var ConfirmCvmPatchResultSchema =
|
|
6089
|
-
correlationId:
|
|
6476
|
+
var ConfirmCvmPatchResultSchema = import_zod66.z.object({
|
|
6477
|
+
correlationId: import_zod66.z.string()
|
|
6090
6478
|
});
|
|
6091
6479
|
var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(ConfirmCvmPatchResultSchema, async (client, request) => {
|
|
6092
6480
|
const parsed = ConfirmCvmPatchRequestSchema.parse(request);
|
|
@@ -6107,17 +6495,17 @@ var { action: confirmCvmPatch, safeAction: safeConfirmCvmPatch } = defineAction(
|
|
|
6107
6495
|
});
|
|
6108
6496
|
|
|
6109
6497
|
// src/actions/cvms/commit_cvm_update.ts
|
|
6110
|
-
var
|
|
6498
|
+
var import_zod67 = require("zod");
|
|
6111
6499
|
var CommitCvmUpdateRequestSchema = refineCvmId(
|
|
6112
6500
|
CvmIdObjectSchema.extend({
|
|
6113
|
-
token:
|
|
6114
|
-
composeHash:
|
|
6115
|
-
transactionHash:
|
|
6501
|
+
token: import_zod67.z.string().describe("One-time commit token from prepare-only flow"),
|
|
6502
|
+
composeHash: import_zod67.z.string().describe("Compose hash from Phase 1 response"),
|
|
6503
|
+
transactionHash: import_zod67.z.string().describe("Transaction hash proving on-chain registration")
|
|
6116
6504
|
})
|
|
6117
6505
|
);
|
|
6118
|
-
var CommitCvmUpdateResultSchema =
|
|
6119
|
-
correlationId:
|
|
6120
|
-
status:
|
|
6506
|
+
var CommitCvmUpdateResultSchema = import_zod67.z.object({
|
|
6507
|
+
correlationId: import_zod67.z.string(),
|
|
6508
|
+
status: import_zod67.z.string()
|
|
6121
6509
|
});
|
|
6122
6510
|
var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(CommitCvmUpdateResultSchema, async (client, request) => {
|
|
6123
6511
|
const parsed = CommitCvmUpdateRequestSchema.parse(request);
|
|
@@ -6134,93 +6522,160 @@ var { action: commitCvmUpdate, safeAction: safeCommitCvmUpdate } = defineAction(
|
|
|
6134
6522
|
});
|
|
6135
6523
|
|
|
6136
6524
|
// src/actions/cvms/refresh_cvm_instance_id.ts
|
|
6137
|
-
var
|
|
6138
|
-
var InstanceIdRefreshResultBaseSchema =
|
|
6139
|
-
identifier:
|
|
6140
|
-
status:
|
|
6141
|
-
old_instance_id:
|
|
6142
|
-
new_instance_id:
|
|
6143
|
-
source:
|
|
6144
|
-
verified_with_gateway:
|
|
6145
|
-
reason:
|
|
6525
|
+
var import_zod68 = require("zod");
|
|
6526
|
+
var InstanceIdRefreshResultBaseSchema = import_zod68.z.object({
|
|
6527
|
+
identifier: import_zod68.z.string(),
|
|
6528
|
+
status: import_zod68.z.enum(["updated", "unchanged", "skipped", "conflict", "error"]),
|
|
6529
|
+
old_instance_id: import_zod68.z.string().nullable().optional(),
|
|
6530
|
+
new_instance_id: import_zod68.z.string().nullable().optional(),
|
|
6531
|
+
source: import_zod68.z.enum(["teepod_state", "teepod_info", "gateway", "none"]),
|
|
6532
|
+
verified_with_gateway: import_zod68.z.boolean(),
|
|
6533
|
+
reason: import_zod68.z.string().nullable().optional()
|
|
6146
6534
|
});
|
|
6147
6535
|
var InstanceIdRefreshResultV20260121Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
6148
|
-
cvm_id:
|
|
6536
|
+
cvm_id: import_zod68.z.number().nullable()
|
|
6149
6537
|
});
|
|
6150
6538
|
var InstanceIdRefreshResultV20260522Schema = InstanceIdRefreshResultBaseSchema.extend({
|
|
6151
|
-
cvm_id:
|
|
6539
|
+
cvm_id: import_zod68.z.string().nullable()
|
|
6152
6540
|
});
|
|
6153
|
-
var InstanceIdRefreshResultAnySchema =
|
|
6541
|
+
var InstanceIdRefreshResultAnySchema = import_zod68.z.union([
|
|
6154
6542
|
InstanceIdRefreshResultV20260121Schema,
|
|
6155
6543
|
InstanceIdRefreshResultV20260522Schema
|
|
6156
6544
|
]);
|
|
6157
6545
|
var InstanceIdRefreshResultSchema = InstanceIdRefreshResultV20260522Schema;
|
|
6158
6546
|
var RefreshCvmInstanceIdRequestSchema = refineCvmId(
|
|
6159
6547
|
CvmIdObjectSchema.extend({
|
|
6160
|
-
overwrite:
|
|
6161
|
-
dry_run:
|
|
6548
|
+
overwrite: import_zod68.z.boolean().optional(),
|
|
6549
|
+
dry_run: import_zod68.z.boolean().optional()
|
|
6162
6550
|
})
|
|
6163
6551
|
);
|
|
6164
|
-
|
|
6552
|
+
function getSchemaForVersion6(version) {
|
|
6553
|
+
if (version === "2026-01-21") return InstanceIdRefreshResultV20260121Schema;
|
|
6554
|
+
return InstanceIdRefreshResultV20260522Schema;
|
|
6555
|
+
}
|
|
6556
|
+
async function refreshCvmInstanceId(client, request) {
|
|
6165
6557
|
const parsed = RefreshCvmInstanceIdRequestSchema.parse(request);
|
|
6166
6558
|
const { cvmId } = CvmIdSchema.parse(parsed);
|
|
6167
6559
|
const { overwrite, dry_run } = parsed;
|
|
6168
|
-
|
|
6169
|
-
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
}
|
|
6560
|
+
const response = await client.patch(`/cvms/${cvmId}/instance-id`, { overwrite, dry_run });
|
|
6561
|
+
return getSchemaForVersion6(client.config.version).parse(
|
|
6562
|
+
response
|
|
6563
|
+
);
|
|
6564
|
+
}
|
|
6565
|
+
async function safeRefreshCvmInstanceId(client, request) {
|
|
6566
|
+
try {
|
|
6567
|
+
const data = await refreshCvmInstanceId(client, request);
|
|
6568
|
+
return { success: true, data };
|
|
6569
|
+
} catch (error) {
|
|
6570
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6571
|
+
return { success: false, error };
|
|
6572
|
+
}
|
|
6573
|
+
return {
|
|
6574
|
+
success: false,
|
|
6575
|
+
error: {
|
|
6576
|
+
name: "Error",
|
|
6577
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6578
|
+
}
|
|
6579
|
+
};
|
|
6580
|
+
}
|
|
6581
|
+
}
|
|
6173
6582
|
|
|
6174
6583
|
// src/actions/cvms/refresh_cvm_instance_ids.ts
|
|
6175
|
-
var
|
|
6176
|
-
var RefreshCvmInstanceIdsRequestSchema =
|
|
6177
|
-
cvm_ids:
|
|
6178
|
-
running_only:
|
|
6179
|
-
missing_only:
|
|
6180
|
-
overwrite:
|
|
6181
|
-
limit:
|
|
6182
|
-
dry_run:
|
|
6584
|
+
var import_zod69 = require("zod");
|
|
6585
|
+
var RefreshCvmInstanceIdsRequestSchema = import_zod69.z.object({
|
|
6586
|
+
cvm_ids: import_zod69.z.array(import_zod69.z.string()).optional(),
|
|
6587
|
+
running_only: import_zod69.z.boolean().optional(),
|
|
6588
|
+
missing_only: import_zod69.z.boolean().optional(),
|
|
6589
|
+
overwrite: import_zod69.z.boolean().optional(),
|
|
6590
|
+
limit: import_zod69.z.number().int().min(1).max(500).optional(),
|
|
6591
|
+
dry_run: import_zod69.z.boolean().optional()
|
|
6183
6592
|
}).strict();
|
|
6184
|
-
var RefreshCvmInstanceIdsResponseBaseSchema =
|
|
6185
|
-
total:
|
|
6186
|
-
scanned:
|
|
6187
|
-
updated:
|
|
6188
|
-
unchanged:
|
|
6189
|
-
skipped:
|
|
6190
|
-
conflicts:
|
|
6191
|
-
errors:
|
|
6593
|
+
var RefreshCvmInstanceIdsResponseBaseSchema = import_zod69.z.object({
|
|
6594
|
+
total: import_zod69.z.number().int(),
|
|
6595
|
+
scanned: import_zod69.z.number().int(),
|
|
6596
|
+
updated: import_zod69.z.number().int(),
|
|
6597
|
+
unchanged: import_zod69.z.number().int(),
|
|
6598
|
+
skipped: import_zod69.z.number().int(),
|
|
6599
|
+
conflicts: import_zod69.z.number().int(),
|
|
6600
|
+
errors: import_zod69.z.number().int()
|
|
6192
6601
|
});
|
|
6193
6602
|
var RefreshCvmInstanceIdsResponseV20260121Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6194
|
-
items:
|
|
6603
|
+
items: import_zod69.z.array(InstanceIdRefreshResultV20260121Schema)
|
|
6195
6604
|
});
|
|
6196
6605
|
var RefreshCvmInstanceIdsResponseV20260522Schema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6197
|
-
items:
|
|
6606
|
+
items: import_zod69.z.array(InstanceIdRefreshResultV20260522Schema)
|
|
6198
6607
|
});
|
|
6199
6608
|
var RefreshCvmInstanceIdsResponseAnySchema = RefreshCvmInstanceIdsResponseBaseSchema.extend({
|
|
6200
|
-
items:
|
|
6609
|
+
items: import_zod69.z.array(
|
|
6610
|
+
import_zod69.z.union([InstanceIdRefreshResultV20260121Schema, InstanceIdRefreshResultV20260522Schema])
|
|
6611
|
+
)
|
|
6201
6612
|
});
|
|
6202
6613
|
var RefreshCvmInstanceIdsResponseSchema = RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
6203
|
-
|
|
6614
|
+
function getSchemaForVersion7(version) {
|
|
6615
|
+
if (version === "2026-01-21") return RefreshCvmInstanceIdsResponseV20260121Schema;
|
|
6616
|
+
return RefreshCvmInstanceIdsResponseV20260522Schema;
|
|
6617
|
+
}
|
|
6618
|
+
async function refreshCvmInstanceIds(client, request) {
|
|
6204
6619
|
const parsed = RefreshCvmInstanceIdsRequestSchema.parse(request);
|
|
6205
|
-
|
|
6206
|
-
|
|
6620
|
+
const response = await client.patch("/cvms/instance-ids", parsed);
|
|
6621
|
+
return getSchemaForVersion7(client.config.version).parse(
|
|
6622
|
+
response
|
|
6623
|
+
);
|
|
6624
|
+
}
|
|
6625
|
+
async function safeRefreshCvmInstanceIds(client, request) {
|
|
6626
|
+
try {
|
|
6627
|
+
const data = await refreshCvmInstanceIds(client, request);
|
|
6628
|
+
return { success: true, data };
|
|
6629
|
+
} catch (error) {
|
|
6630
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6631
|
+
return { success: false, error };
|
|
6632
|
+
}
|
|
6633
|
+
return {
|
|
6634
|
+
success: false,
|
|
6635
|
+
error: {
|
|
6636
|
+
name: "Error",
|
|
6637
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6638
|
+
}
|
|
6639
|
+
};
|
|
6640
|
+
}
|
|
6641
|
+
}
|
|
6207
6642
|
|
|
6208
6643
|
// src/actions/cvms/get_cvm_status_batch.ts
|
|
6209
|
-
var
|
|
6210
|
-
var
|
|
6211
|
-
|
|
6212
|
-
|
|
6213
|
-
|
|
6214
|
-
|
|
6215
|
-
|
|
6216
|
-
|
|
6217
|
-
|
|
6218
|
-
|
|
6219
|
-
|
|
6220
|
-
|
|
6221
|
-
|
|
6222
|
-
|
|
6223
|
-
|
|
6644
|
+
var import_zod70 = require("zod");
|
|
6645
|
+
var CvmResourceUsageSchema = import_zod70.z.object({
|
|
6646
|
+
cpu_percent: import_zod70.z.number().nullable().optional(),
|
|
6647
|
+
memory_used_bytes: import_zod70.z.number().nullable().optional(),
|
|
6648
|
+
memory_total_bytes: import_zod70.z.number().nullable().optional(),
|
|
6649
|
+
disk_used_bytes: import_zod70.z.number().nullable().optional(),
|
|
6650
|
+
disk_total_bytes: import_zod70.z.number().nullable().optional(),
|
|
6651
|
+
egress_bytes: import_zod70.z.number().nullable().optional()
|
|
6652
|
+
});
|
|
6653
|
+
var CvmStatusSchema = import_zod70.z.object({
|
|
6654
|
+
vm_uuid: import_zod70.z.string(),
|
|
6655
|
+
status: import_zod70.z.string(),
|
|
6656
|
+
uptime: import_zod70.z.string().nullable().optional(),
|
|
6657
|
+
in_progress: import_zod70.z.boolean(),
|
|
6658
|
+
boot_progress: import_zod70.z.string().nullable().optional(),
|
|
6659
|
+
boot_error: import_zod70.z.string().nullable().optional(),
|
|
6660
|
+
shutdown_progress: import_zod70.z.string().nullable().optional(),
|
|
6661
|
+
events: import_zod70.z.array(
|
|
6662
|
+
import_zod70.z.object({
|
|
6663
|
+
event: import_zod70.z.string(),
|
|
6664
|
+
body: import_zod70.z.string(),
|
|
6665
|
+
timestamp: import_zod70.z.number()
|
|
6666
|
+
})
|
|
6667
|
+
).default([]),
|
|
6668
|
+
operation: import_zod70.z.object({
|
|
6669
|
+
type: import_zod70.z.string().nullable().optional(),
|
|
6670
|
+
phase: import_zod70.z.string().nullable().optional(),
|
|
6671
|
+
started_at: import_zod70.z.string().nullable().optional(),
|
|
6672
|
+
correlation_id: import_zod70.z.string().nullable().optional()
|
|
6673
|
+
}).nullable().optional(),
|
|
6674
|
+
resource_usage: CvmResourceUsageSchema.nullable().optional()
|
|
6675
|
+
});
|
|
6676
|
+
var GetCvmStatusBatchResponseSchema = import_zod70.z.record(import_zod70.z.string(), CvmStatusSchema);
|
|
6677
|
+
var GetCvmStatusBatchRequestSchema = import_zod70.z.object({
|
|
6678
|
+
vmUuids: import_zod70.z.array(import_zod70.z.string())
|
|
6224
6679
|
});
|
|
6225
6680
|
var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAction(GetCvmStatusBatchResponseSchema, async (client, request) => {
|
|
6226
6681
|
const { vmUuids } = GetCvmStatusBatchRequestSchema.parse(request);
|
|
@@ -6228,11 +6683,11 @@ var { action: getCvmStatusBatch, safeAction: safeGetCvmStatusBatch } = defineAct
|
|
|
6228
6683
|
});
|
|
6229
6684
|
|
|
6230
6685
|
// src/actions/cvms/get_cvm_user_config.ts
|
|
6231
|
-
var
|
|
6232
|
-
var CvmUserConfigSchema =
|
|
6233
|
-
hostname:
|
|
6234
|
-
ssh_authorized_keys:
|
|
6235
|
-
default_gateway_domain:
|
|
6686
|
+
var import_zod71 = require("zod");
|
|
6687
|
+
var CvmUserConfigSchema = import_zod71.z.object({
|
|
6688
|
+
hostname: import_zod71.z.string().nullable().optional(),
|
|
6689
|
+
ssh_authorized_keys: import_zod71.z.array(import_zod71.z.string()).default([]),
|
|
6690
|
+
default_gateway_domain: import_zod71.z.string().nullable().optional()
|
|
6236
6691
|
});
|
|
6237
6692
|
var GetCvmUserConfigRequestSchema = CvmIdSchema;
|
|
6238
6693
|
var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineAction(CvmUserConfigSchema, async (client, request) => {
|
|
@@ -6241,48 +6696,70 @@ var { action: getCvmUserConfig, safeAction: safeGetCvmUserConfig } = defineActio
|
|
|
6241
6696
|
});
|
|
6242
6697
|
|
|
6243
6698
|
// src/actions/cvms/check_cvm_is_allowed.ts
|
|
6244
|
-
var
|
|
6245
|
-
var IsAllowedResultBaseSchema =
|
|
6246
|
-
app_contract_address:
|
|
6247
|
-
compose_hash:
|
|
6248
|
-
device_id:
|
|
6249
|
-
compose_hash_allowed:
|
|
6250
|
-
allow_any_device:
|
|
6251
|
-
device_id_allowed:
|
|
6252
|
-
is_allowed:
|
|
6253
|
-
error:
|
|
6699
|
+
var import_zod72 = require("zod");
|
|
6700
|
+
var IsAllowedResultBaseSchema = import_zod72.z.object({
|
|
6701
|
+
app_contract_address: import_zod72.z.string(),
|
|
6702
|
+
compose_hash: import_zod72.z.string(),
|
|
6703
|
+
device_id: import_zod72.z.string(),
|
|
6704
|
+
compose_hash_allowed: import_zod72.z.boolean(),
|
|
6705
|
+
allow_any_device: import_zod72.z.boolean(),
|
|
6706
|
+
device_id_allowed: import_zod72.z.boolean().nullable().optional(),
|
|
6707
|
+
is_allowed: import_zod72.z.boolean(),
|
|
6708
|
+
error: import_zod72.z.string().nullable().optional()
|
|
6254
6709
|
});
|
|
6255
6710
|
var IsAllowedResultV20260121Schema = IsAllowedResultBaseSchema.extend({
|
|
6256
|
-
cvm_id:
|
|
6711
|
+
cvm_id: import_zod72.z.number().optional()
|
|
6257
6712
|
});
|
|
6258
6713
|
var IsAllowedResultV20260522Schema = IsAllowedResultBaseSchema.extend({
|
|
6259
|
-
cvm_id:
|
|
6714
|
+
cvm_id: import_zod72.z.string().optional()
|
|
6260
6715
|
});
|
|
6261
|
-
var IsAllowedResultAnySchema =
|
|
6716
|
+
var IsAllowedResultAnySchema = import_zod72.z.union([
|
|
6262
6717
|
IsAllowedResultV20260121Schema,
|
|
6263
6718
|
IsAllowedResultV20260522Schema
|
|
6264
6719
|
]);
|
|
6265
6720
|
var IsAllowedResultSchema = IsAllowedResultV20260522Schema;
|
|
6266
|
-
var CheckCvmIsAllowedInputSchema =
|
|
6267
|
-
cvmId:
|
|
6268
|
-
compose_hash:
|
|
6269
|
-
node_id:
|
|
6270
|
-
device_id:
|
|
6721
|
+
var CheckCvmIsAllowedInputSchema = import_zod72.z.object({
|
|
6722
|
+
cvmId: import_zod72.z.string().min(1),
|
|
6723
|
+
compose_hash: import_zod72.z.string().optional(),
|
|
6724
|
+
node_id: import_zod72.z.number().optional(),
|
|
6725
|
+
device_id: import_zod72.z.string().optional()
|
|
6271
6726
|
});
|
|
6272
6727
|
var CheckCvmIsAllowedRequestSchema = CheckCvmIsAllowedInputSchema;
|
|
6273
|
-
|
|
6728
|
+
function getSchemaForVersion8(version) {
|
|
6729
|
+
if (version === "2026-01-21") return IsAllowedResultV20260121Schema;
|
|
6730
|
+
return IsAllowedResultV20260522Schema;
|
|
6731
|
+
}
|
|
6732
|
+
async function checkCvmIsAllowed(client, request) {
|
|
6274
6733
|
const { cvmId, ...body } = CheckCvmIsAllowedRequestSchema.parse(request);
|
|
6275
|
-
|
|
6276
|
-
|
|
6734
|
+
const response = await client.post(`/cvms/${cvmId}/is-allowed`, body);
|
|
6735
|
+
return getSchemaForVersion8(client.config.version).parse(response);
|
|
6736
|
+
}
|
|
6737
|
+
async function safeCheckCvmIsAllowed(client, request) {
|
|
6738
|
+
try {
|
|
6739
|
+
const data = await checkCvmIsAllowed(client, request);
|
|
6740
|
+
return { success: true, data };
|
|
6741
|
+
} catch (error) {
|
|
6742
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6743
|
+
return { success: false, error };
|
|
6744
|
+
}
|
|
6745
|
+
return {
|
|
6746
|
+
success: false,
|
|
6747
|
+
error: {
|
|
6748
|
+
name: "Error",
|
|
6749
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6750
|
+
}
|
|
6751
|
+
};
|
|
6752
|
+
}
|
|
6753
|
+
}
|
|
6277
6754
|
|
|
6278
6755
|
// src/actions/apps/check_app_is_allowed.ts
|
|
6279
|
-
var
|
|
6280
|
-
var CheckAppIsAllowedRequestSchema =
|
|
6281
|
-
appId:
|
|
6282
|
-
compose_hash:
|
|
6283
|
-
node_id:
|
|
6284
|
-
device_id:
|
|
6285
|
-
chain_id:
|
|
6756
|
+
var import_zod73 = require("zod");
|
|
6757
|
+
var CheckAppIsAllowedRequestSchema = import_zod73.z.object({
|
|
6758
|
+
appId: import_zod73.z.string().min(1),
|
|
6759
|
+
compose_hash: import_zod73.z.string(),
|
|
6760
|
+
node_id: import_zod73.z.number().optional(),
|
|
6761
|
+
device_id: import_zod73.z.string().optional(),
|
|
6762
|
+
chain_id: import_zod73.z.number().optional()
|
|
6286
6763
|
});
|
|
6287
6764
|
var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAction(IsAllowedResultSchema, async (client, request) => {
|
|
6288
6765
|
const { appId, ...body } = CheckAppIsAllowedRequestSchema.parse(request);
|
|
@@ -6290,51 +6767,75 @@ var { action: checkAppIsAllowed, safeAction: safeCheckAppIsAllowed } = defineAct
|
|
|
6290
6767
|
});
|
|
6291
6768
|
|
|
6292
6769
|
// src/actions/apps/check_app_cvms_is_allowed.ts
|
|
6293
|
-
var
|
|
6294
|
-
var AppCvmsBatchIsAllowedResponseBaseSchema =
|
|
6295
|
-
is_onchain:
|
|
6296
|
-
total:
|
|
6297
|
-
allowed_count:
|
|
6298
|
-
denied_count:
|
|
6299
|
-
error_count:
|
|
6770
|
+
var import_zod74 = require("zod");
|
|
6771
|
+
var AppCvmsBatchIsAllowedResponseBaseSchema = import_zod74.z.object({
|
|
6772
|
+
is_onchain: import_zod74.z.boolean(),
|
|
6773
|
+
total: import_zod74.z.number().default(0),
|
|
6774
|
+
allowed_count: import_zod74.z.number().default(0),
|
|
6775
|
+
denied_count: import_zod74.z.number().default(0),
|
|
6776
|
+
error_count: import_zod74.z.number().default(0)
|
|
6300
6777
|
});
|
|
6301
6778
|
var AppCvmsBatchIsAllowedResponseV20260121Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6302
|
-
results:
|
|
6303
|
-
skipped_cvm_ids:
|
|
6779
|
+
results: import_zod74.z.array(IsAllowedResultV20260121Schema.extend({ cvm_id: import_zod74.z.number() })).default([]),
|
|
6780
|
+
skipped_cvm_ids: import_zod74.z.array(import_zod74.z.number()).default([])
|
|
6304
6781
|
});
|
|
6305
6782
|
var AppCvmsBatchIsAllowedResponseV20260522Schema = AppCvmsBatchIsAllowedResponseBaseSchema.extend({
|
|
6306
|
-
results:
|
|
6307
|
-
skipped_cvm_ids:
|
|
6783
|
+
results: import_zod74.z.array(IsAllowedResultV20260522Schema.extend({ cvm_id: import_zod74.z.string() })).default([]),
|
|
6784
|
+
skipped_cvm_ids: import_zod74.z.array(import_zod74.z.string()).default([])
|
|
6308
6785
|
});
|
|
6309
|
-
var AppCvmsBatchIsAllowedResponseAnySchema =
|
|
6786
|
+
var AppCvmsBatchIsAllowedResponseAnySchema = import_zod74.z.union([
|
|
6310
6787
|
AppCvmsBatchIsAllowedResponseV20260121Schema,
|
|
6311
6788
|
AppCvmsBatchIsAllowedResponseV20260522Schema
|
|
6312
6789
|
]);
|
|
6313
6790
|
var AppCvmsBatchIsAllowedResponseSchema = AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6314
|
-
var CheckAppCvmsIsAllowedRequestSchema =
|
|
6315
|
-
appId:
|
|
6791
|
+
var CheckAppCvmsIsAllowedRequestSchema = import_zod74.z.object({
|
|
6792
|
+
appId: import_zod74.z.string().min(1)
|
|
6316
6793
|
});
|
|
6317
|
-
|
|
6794
|
+
function getSchemaForVersion9(version) {
|
|
6795
|
+
if (version === "2026-01-21") return AppCvmsBatchIsAllowedResponseV20260121Schema;
|
|
6796
|
+
return AppCvmsBatchIsAllowedResponseV20260522Schema;
|
|
6797
|
+
}
|
|
6798
|
+
async function checkAppCvmsIsAllowed(client, request) {
|
|
6318
6799
|
const { appId } = CheckAppCvmsIsAllowedRequestSchema.parse(request);
|
|
6319
|
-
|
|
6320
|
-
|
|
6800
|
+
const response = await client.post(`/apps/${appId}/cvms/is-allowed`, {});
|
|
6801
|
+
return getSchemaForVersion9(client.config.version).parse(
|
|
6802
|
+
response
|
|
6803
|
+
);
|
|
6804
|
+
}
|
|
6805
|
+
async function safeCheckAppCvmsIsAllowed(client, request) {
|
|
6806
|
+
try {
|
|
6807
|
+
const data = await checkAppCvmsIsAllowed(client, request);
|
|
6808
|
+
return { success: true, data };
|
|
6809
|
+
} catch (error) {
|
|
6810
|
+
if (error && typeof error === "object" && ("status" in error || "issues" in error)) {
|
|
6811
|
+
return { success: false, error };
|
|
6812
|
+
}
|
|
6813
|
+
return {
|
|
6814
|
+
success: false,
|
|
6815
|
+
error: {
|
|
6816
|
+
name: "Error",
|
|
6817
|
+
message: error instanceof Error ? error.message : String(error)
|
|
6818
|
+
}
|
|
6819
|
+
};
|
|
6820
|
+
}
|
|
6821
|
+
}
|
|
6321
6822
|
|
|
6322
6823
|
// src/actions/apps/get_app_list.ts
|
|
6323
|
-
var
|
|
6324
|
-
var GetAppListRequestSchema =
|
|
6325
|
-
page:
|
|
6326
|
-
page_size:
|
|
6327
|
-
search:
|
|
6328
|
-
status:
|
|
6329
|
-
listed:
|
|
6330
|
-
base_image:
|
|
6331
|
-
instance_type:
|
|
6332
|
-
kms_slug:
|
|
6333
|
-
kms_type:
|
|
6334
|
-
node:
|
|
6335
|
-
region:
|
|
6824
|
+
var import_zod75 = require("zod");
|
|
6825
|
+
var GetAppListRequestSchema = import_zod75.z.object({
|
|
6826
|
+
page: import_zod75.z.number().int().min(1).optional(),
|
|
6827
|
+
page_size: import_zod75.z.number().int().min(1).max(100).optional(),
|
|
6828
|
+
search: import_zod75.z.string().optional(),
|
|
6829
|
+
status: import_zod75.z.array(import_zod75.z.string()).optional(),
|
|
6830
|
+
listed: import_zod75.z.boolean().optional(),
|
|
6831
|
+
base_image: import_zod75.z.string().optional(),
|
|
6832
|
+
instance_type: import_zod75.z.string().optional(),
|
|
6833
|
+
kms_slug: import_zod75.z.string().optional(),
|
|
6834
|
+
kms_type: import_zod75.z.string().optional(),
|
|
6835
|
+
node: import_zod75.z.string().optional(),
|
|
6836
|
+
region: import_zod75.z.string().optional()
|
|
6336
6837
|
}).strict();
|
|
6337
|
-
function
|
|
6838
|
+
function getSchemaForVersion10(version) {
|
|
6338
6839
|
if (version === "2025-10-28") return DstackAppListResponseV20251028Schema;
|
|
6339
6840
|
if (version === "2026-01-21") return DstackAppListResponseV20260121Schema;
|
|
6340
6841
|
return DstackAppListResponseV20260522Schema;
|
|
@@ -6342,7 +6843,7 @@ function getSchemaForVersion5(version) {
|
|
|
6342
6843
|
async function getAppList(client, request) {
|
|
6343
6844
|
const validatedRequest = GetAppListRequestSchema.parse(request ?? {});
|
|
6344
6845
|
const response = await client.get("/apps", { params: validatedRequest });
|
|
6345
|
-
const schema =
|
|
6846
|
+
const schema = getSchemaForVersion10(client.config.version);
|
|
6346
6847
|
return schema.parse(response);
|
|
6347
6848
|
}
|
|
6348
6849
|
async function safeGetAppList(client, request) {
|
|
@@ -6364,11 +6865,11 @@ async function safeGetAppList(client, request) {
|
|
|
6364
6865
|
}
|
|
6365
6866
|
|
|
6366
6867
|
// src/actions/apps/get_app_info.ts
|
|
6367
|
-
var
|
|
6368
|
-
var GetAppInfoRequestSchema =
|
|
6369
|
-
appId:
|
|
6868
|
+
var import_zod76 = require("zod");
|
|
6869
|
+
var GetAppInfoRequestSchema = import_zod76.z.object({
|
|
6870
|
+
appId: import_zod76.z.string().min(1)
|
|
6370
6871
|
}).strict();
|
|
6371
|
-
function
|
|
6872
|
+
function getSchemaForVersion11(version) {
|
|
6372
6873
|
if (version === "2025-10-28") return DstackAppWithCvmResponseV20251028Schema;
|
|
6373
6874
|
if (version === "2026-01-21") return DstackAppWithCvmResponseV20260121Schema;
|
|
6374
6875
|
return DstackAppWithCvmResponseV20260522Schema;
|
|
@@ -6376,7 +6877,7 @@ function getSchemaForVersion6(version) {
|
|
|
6376
6877
|
async function getAppInfo(client, request) {
|
|
6377
6878
|
const { appId } = GetAppInfoRequestSchema.parse(request);
|
|
6378
6879
|
const response = await client.get(`/apps/${appId}`);
|
|
6379
|
-
const schema =
|
|
6880
|
+
const schema = getSchemaForVersion11(client.config.version);
|
|
6380
6881
|
return schema.parse(response);
|
|
6381
6882
|
}
|
|
6382
6883
|
async function safeGetAppInfo(client, request) {
|
|
@@ -6398,19 +6899,19 @@ async function safeGetAppInfo(client, request) {
|
|
|
6398
6899
|
}
|
|
6399
6900
|
|
|
6400
6901
|
// src/actions/apps/get_app_cvms.ts
|
|
6401
|
-
var
|
|
6402
|
-
var GetAppCvmsRequestSchema =
|
|
6403
|
-
appId:
|
|
6902
|
+
var import_zod77 = require("zod");
|
|
6903
|
+
var GetAppCvmsRequestSchema = import_zod77.z.object({
|
|
6904
|
+
appId: import_zod77.z.string().min(1)
|
|
6404
6905
|
}).strict();
|
|
6405
|
-
function
|
|
6406
|
-
if (version === "2025-10-28") return
|
|
6407
|
-
if (version === "2026-01-21") return
|
|
6408
|
-
return
|
|
6906
|
+
function getSchemaForVersion12(version) {
|
|
6907
|
+
if (version === "2025-10-28") return import_zod77.z.array(CvmInfoV20251028Schema);
|
|
6908
|
+
if (version === "2026-01-21") return import_zod77.z.array(CvmInfoV20260121Schema);
|
|
6909
|
+
return import_zod77.z.array(CvmInfoV20260522Schema);
|
|
6409
6910
|
}
|
|
6410
6911
|
async function getAppCvms(client, request) {
|
|
6411
6912
|
const { appId } = GetAppCvmsRequestSchema.parse(request);
|
|
6412
6913
|
const response = await client.get(`/apps/${appId}/cvms`);
|
|
6413
|
-
const schema =
|
|
6914
|
+
const schema = getSchemaForVersion12(client.config.version);
|
|
6414
6915
|
return schema.parse(response);
|
|
6415
6916
|
}
|
|
6416
6917
|
async function safeGetAppCvms(client, request) {
|
|
@@ -6432,17 +6933,17 @@ async function safeGetAppCvms(client, request) {
|
|
|
6432
6933
|
}
|
|
6433
6934
|
|
|
6434
6935
|
// src/actions/apps/create_app_instance.ts
|
|
6435
|
-
var
|
|
6436
|
-
var CreateAppInstanceRequestSchema =
|
|
6437
|
-
appId:
|
|
6438
|
-
name:
|
|
6439
|
-
node_id:
|
|
6440
|
-
docker_compose_file:
|
|
6441
|
-
pre_launch_script:
|
|
6442
|
-
encrypted_env:
|
|
6443
|
-
compose_hash:
|
|
6444
|
-
token:
|
|
6445
|
-
transaction_hash:
|
|
6936
|
+
var import_zod78 = require("zod");
|
|
6937
|
+
var CreateAppInstanceRequestSchema = import_zod78.z.object({
|
|
6938
|
+
appId: import_zod78.z.string().min(1),
|
|
6939
|
+
name: import_zod78.z.string().optional(),
|
|
6940
|
+
node_id: import_zod78.z.number().optional(),
|
|
6941
|
+
docker_compose_file: import_zod78.z.string().optional(),
|
|
6942
|
+
pre_launch_script: import_zod78.z.string().optional(),
|
|
6943
|
+
encrypted_env: import_zod78.z.string().optional(),
|
|
6944
|
+
compose_hash: import_zod78.z.string().optional(),
|
|
6945
|
+
token: import_zod78.z.string().optional(),
|
|
6946
|
+
transaction_hash: import_zod78.z.string().optional()
|
|
6446
6947
|
}).strict();
|
|
6447
6948
|
var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAction(VMSchema, async (client, request) => {
|
|
6448
6949
|
const parsed = CreateAppInstanceRequestSchema.parse(request);
|
|
@@ -6451,47 +6952,52 @@ var { action: createAppInstance, safeAction: safeCreateAppInstance } = defineAct
|
|
|
6451
6952
|
});
|
|
6452
6953
|
|
|
6453
6954
|
// src/actions/apps/get_app_device_allowlist.ts
|
|
6454
|
-
var
|
|
6455
|
-
var DeviceAllowlistItemBaseSchema =
|
|
6456
|
-
device_id:
|
|
6457
|
-
node_name:
|
|
6458
|
-
allowed_onchain:
|
|
6459
|
-
status:
|
|
6955
|
+
var import_zod79 = require("zod");
|
|
6956
|
+
var DeviceAllowlistItemBaseSchema = import_zod79.z.object({
|
|
6957
|
+
device_id: import_zod79.z.string(),
|
|
6958
|
+
node_name: import_zod79.z.string().nullable(),
|
|
6959
|
+
allowed_onchain: import_zod79.z.boolean(),
|
|
6960
|
+
status: import_zod79.z.string()
|
|
6460
6961
|
});
|
|
6461
6962
|
var DeviceAllowlistItemV20260121Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6462
|
-
cvm_ids:
|
|
6963
|
+
cvm_ids: import_zod79.z.array(import_zod79.z.number())
|
|
6463
6964
|
});
|
|
6464
6965
|
var DeviceAllowlistItemV20260522Schema = DeviceAllowlistItemBaseSchema.extend({
|
|
6465
|
-
cvm_ids:
|
|
6966
|
+
cvm_ids: import_zod79.z.array(import_zod79.z.string())
|
|
6466
6967
|
});
|
|
6467
|
-
var DeviceAllowlistResponseBaseSchema =
|
|
6468
|
-
is_onchain_kms:
|
|
6469
|
-
allow_any_device:
|
|
6470
|
-
chain_id:
|
|
6471
|
-
app_contract_address:
|
|
6968
|
+
var DeviceAllowlistResponseBaseSchema = import_zod79.z.object({
|
|
6969
|
+
is_onchain_kms: import_zod79.z.boolean(),
|
|
6970
|
+
allow_any_device: import_zod79.z.boolean().nullable().optional(),
|
|
6971
|
+
chain_id: import_zod79.z.number().nullable().optional(),
|
|
6972
|
+
app_contract_address: import_zod79.z.string().nullable().optional()
|
|
6472
6973
|
});
|
|
6473
6974
|
var DeviceAllowlistResponseV20260121Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6474
|
-
devices:
|
|
6975
|
+
devices: import_zod79.z.array(DeviceAllowlistItemV20260121Schema).optional().default([])
|
|
6475
6976
|
});
|
|
6476
6977
|
var DeviceAllowlistResponseV20260522Schema = DeviceAllowlistResponseBaseSchema.extend({
|
|
6477
|
-
devices:
|
|
6978
|
+
devices: import_zod79.z.array(DeviceAllowlistItemV20260522Schema).optional().default([])
|
|
6478
6979
|
});
|
|
6479
|
-
var DeviceAllowlistItemAnySchema =
|
|
6980
|
+
var DeviceAllowlistItemAnySchema = import_zod79.z.union([
|
|
6480
6981
|
DeviceAllowlistItemV20260121Schema,
|
|
6481
6982
|
DeviceAllowlistItemV20260522Schema
|
|
6482
6983
|
]);
|
|
6483
|
-
var DeviceAllowlistResponseAnySchema =
|
|
6984
|
+
var DeviceAllowlistResponseAnySchema = import_zod79.z.union([
|
|
6484
6985
|
DeviceAllowlistResponseV20260121Schema,
|
|
6485
6986
|
DeviceAllowlistResponseV20260522Schema
|
|
6486
6987
|
]);
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6988
|
+
function getSchemaForVersion13(version) {
|
|
6989
|
+
if (version === "2026-01-21") return DeviceAllowlistResponseV20260121Schema;
|
|
6990
|
+
return DeviceAllowlistResponseV20260522Schema;
|
|
6991
|
+
}
|
|
6992
|
+
var GetAppDeviceAllowlistRequestSchema = import_zod79.z.object({
|
|
6993
|
+
appId: import_zod79.z.string().min(1)
|
|
6490
6994
|
}).strict();
|
|
6491
6995
|
async function getAppDeviceAllowlist(client, request) {
|
|
6492
6996
|
const { appId } = GetAppDeviceAllowlistRequestSchema.parse(request);
|
|
6493
6997
|
const response = await client.get(`/apps/${appId}/device-allowlist`);
|
|
6494
|
-
return
|
|
6998
|
+
return getSchemaForVersion13(client.config.version).parse(
|
|
6999
|
+
response
|
|
7000
|
+
);
|
|
6495
7001
|
}
|
|
6496
7002
|
async function safeGetAppDeviceAllowlist(client, request) {
|
|
6497
7003
|
try {
|
|
@@ -6512,11 +7018,11 @@ async function safeGetAppDeviceAllowlist(client, request) {
|
|
|
6512
7018
|
}
|
|
6513
7019
|
|
|
6514
7020
|
// src/actions/apps/get_app_revisions.ts
|
|
6515
|
-
var
|
|
6516
|
-
var GetAppRevisionsRequestSchema =
|
|
6517
|
-
appId:
|
|
6518
|
-
page:
|
|
6519
|
-
page_size:
|
|
7021
|
+
var import_zod80 = require("zod");
|
|
7022
|
+
var GetAppRevisionsRequestSchema = import_zod80.z.object({
|
|
7023
|
+
appId: import_zod80.z.string().min(1),
|
|
7024
|
+
page: import_zod80.z.number().int().min(1).optional(),
|
|
7025
|
+
page_size: import_zod80.z.number().int().min(1).max(1e3).optional()
|
|
6520
7026
|
}).strict();
|
|
6521
7027
|
async function getAppRevisions(client, request) {
|
|
6522
7028
|
const { appId, ...params } = GetAppRevisionsRequestSchema.parse(request);
|
|
@@ -6542,11 +7048,11 @@ async function safeGetAppRevisions(client, request) {
|
|
|
6542
7048
|
}
|
|
6543
7049
|
|
|
6544
7050
|
// src/actions/apps/get_app_revision_detail.ts
|
|
6545
|
-
var
|
|
6546
|
-
var GetAppRevisionDetailRequestSchema =
|
|
6547
|
-
appId:
|
|
6548
|
-
revisionId:
|
|
6549
|
-
rawComposeFile:
|
|
7051
|
+
var import_zod81 = require("zod");
|
|
7052
|
+
var GetAppRevisionDetailRequestSchema = import_zod81.z.object({
|
|
7053
|
+
appId: import_zod81.z.string().min(1),
|
|
7054
|
+
revisionId: import_zod81.z.string().min(1),
|
|
7055
|
+
rawComposeFile: import_zod81.z.boolean().optional()
|
|
6550
7056
|
}).strict();
|
|
6551
7057
|
async function getAppRevisionDetail(client, request) {
|
|
6552
7058
|
const { appId, revisionId, rawComposeFile } = GetAppRevisionDetailRequestSchema.parse(request);
|
|
@@ -6573,15 +7079,15 @@ async function safeGetAppRevisionDetail(client, request) {
|
|
|
6573
7079
|
}
|
|
6574
7080
|
|
|
6575
7081
|
// src/actions/apps/get_app_filter_options.ts
|
|
6576
|
-
var
|
|
6577
|
-
var AppFilterOptionsSchema =
|
|
6578
|
-
statuses:
|
|
6579
|
-
image_versions:
|
|
6580
|
-
instance_types:
|
|
6581
|
-
kms_slugs:
|
|
6582
|
-
kms_types:
|
|
6583
|
-
regions:
|
|
6584
|
-
nodes:
|
|
7082
|
+
var import_zod82 = require("zod");
|
|
7083
|
+
var AppFilterOptionsSchema = import_zod82.z.object({
|
|
7084
|
+
statuses: import_zod82.z.array(import_zod82.z.string()),
|
|
7085
|
+
image_versions: import_zod82.z.array(import_zod82.z.string()),
|
|
7086
|
+
instance_types: import_zod82.z.array(import_zod82.z.string()),
|
|
7087
|
+
kms_slugs: import_zod82.z.array(import_zod82.z.string()),
|
|
7088
|
+
kms_types: import_zod82.z.array(import_zod82.z.string()),
|
|
7089
|
+
regions: import_zod82.z.array(import_zod82.z.string()),
|
|
7090
|
+
nodes: import_zod82.z.array(import_zod82.z.string())
|
|
6585
7091
|
});
|
|
6586
7092
|
async function getAppFilterOptions(client) {
|
|
6587
7093
|
const response = await client.get("/apps/filter-options");
|
|
@@ -6606,52 +7112,53 @@ async function safeGetAppFilterOptions(client) {
|
|
|
6606
7112
|
}
|
|
6607
7113
|
|
|
6608
7114
|
// src/actions/apps/get_app_attestation.ts
|
|
6609
|
-
var
|
|
6610
|
-
var KmsInfoSchema2 =
|
|
6611
|
-
contract_address:
|
|
6612
|
-
chain_id:
|
|
6613
|
-
version:
|
|
6614
|
-
url:
|
|
6615
|
-
gateway_app_id:
|
|
6616
|
-
gateway_app_url:
|
|
6617
|
-
kms_type:
|
|
6618
|
-
});
|
|
6619
|
-
var GuestAgentInfoSchema =
|
|
6620
|
-
app_id:
|
|
6621
|
-
instance_id:
|
|
6622
|
-
app_name:
|
|
6623
|
-
device_id:
|
|
7115
|
+
var import_zod83 = require("zod");
|
|
7116
|
+
var KmsInfoSchema2 = import_zod83.z.object({
|
|
7117
|
+
contract_address: import_zod83.z.string(),
|
|
7118
|
+
chain_id: import_zod83.z.number().nullable(),
|
|
7119
|
+
version: import_zod83.z.string(),
|
|
7120
|
+
url: import_zod83.z.string(),
|
|
7121
|
+
gateway_app_id: import_zod83.z.string().nullable(),
|
|
7122
|
+
gateway_app_url: import_zod83.z.string(),
|
|
7123
|
+
kms_type: import_zod83.z.string()
|
|
7124
|
+
});
|
|
7125
|
+
var GuestAgentInfoSchema = import_zod83.z.object({
|
|
7126
|
+
app_id: import_zod83.z.string().optional(),
|
|
7127
|
+
instance_id: import_zod83.z.string().optional(),
|
|
7128
|
+
app_name: import_zod83.z.string().optional(),
|
|
7129
|
+
device_id: import_zod83.z.string().optional()
|
|
6624
7130
|
}).passthrough().nullable();
|
|
6625
|
-
var AppAttestationInstanceSchema =
|
|
6626
|
-
vm_uuid:
|
|
6627
|
-
name:
|
|
6628
|
-
instance_id:
|
|
6629
|
-
status:
|
|
6630
|
-
image_version:
|
|
6631
|
-
quote:
|
|
6632
|
-
ppid:
|
|
6633
|
-
ppid_sha256:
|
|
6634
|
-
device_id:
|
|
6635
|
-
fmspc:
|
|
6636
|
-
tee_tcb_svn:
|
|
6637
|
-
|
|
6638
|
-
|
|
7131
|
+
var AppAttestationInstanceSchema = import_zod83.z.object({
|
|
7132
|
+
vm_uuid: import_zod83.z.string().nullable().optional(),
|
|
7133
|
+
name: import_zod83.z.string().optional(),
|
|
7134
|
+
instance_id: import_zod83.z.string().nullable().optional(),
|
|
7135
|
+
status: import_zod83.z.string().optional(),
|
|
7136
|
+
image_version: import_zod83.z.string().nullable().optional(),
|
|
7137
|
+
quote: import_zod83.z.string().nullable().optional(),
|
|
7138
|
+
ppid: import_zod83.z.string().optional(),
|
|
7139
|
+
ppid_sha256: import_zod83.z.string().nullable().optional(),
|
|
7140
|
+
device_id: import_zod83.z.string().optional(),
|
|
7141
|
+
fmspc: import_zod83.z.string().nullable().optional(),
|
|
7142
|
+
tee_tcb_svn: import_zod83.z.string().nullable().optional(),
|
|
7143
|
+
mr_config_id: import_zod83.z.string().nullable().optional(),
|
|
7144
|
+
cpusvn: import_zod83.z.string().nullable().optional(),
|
|
7145
|
+
pcesvn: import_zod83.z.number().nullable().optional(),
|
|
6639
7146
|
tcb_info: TcbInfoSchema.nullable().optional(),
|
|
6640
|
-
app_certificates:
|
|
6641
|
-
compose_file:
|
|
6642
|
-
error:
|
|
7147
|
+
app_certificates: import_zod83.z.array(CertificateSchema).nullable().optional(),
|
|
7148
|
+
compose_file: import_zod83.z.string().nullable().optional(),
|
|
7149
|
+
error: import_zod83.z.string().nullable().optional()
|
|
6643
7150
|
});
|
|
6644
|
-
var AppAttestationResponseSchema =
|
|
6645
|
-
app_id:
|
|
6646
|
-
contract_address:
|
|
7151
|
+
var AppAttestationResponseSchema = import_zod83.z.object({
|
|
7152
|
+
app_id: import_zod83.z.string(),
|
|
7153
|
+
contract_address: import_zod83.z.string(),
|
|
6647
7154
|
kms_info: KmsInfoSchema2,
|
|
6648
|
-
instances:
|
|
7155
|
+
instances: import_zod83.z.array(AppAttestationInstanceSchema),
|
|
6649
7156
|
kms_guest_agent_info: GuestAgentInfoSchema,
|
|
6650
7157
|
gateway_guest_agent_info: GuestAgentInfoSchema,
|
|
6651
|
-
qemu_version:
|
|
7158
|
+
qemu_version: import_zod83.z.string().nullable()
|
|
6652
7159
|
});
|
|
6653
|
-
var GetAppAttestationRequestSchema =
|
|
6654
|
-
appId:
|
|
7160
|
+
var GetAppAttestationRequestSchema = import_zod83.z.object({
|
|
7161
|
+
appId: import_zod83.z.string().min(1)
|
|
6655
7162
|
}).strict();
|
|
6656
7163
|
var { action: getAppAttestation, safeAction: safeGetAppAttestation } = defineAction(AppAttestationResponseSchema, async (client, request) => {
|
|
6657
7164
|
const { appId } = GetAppAttestationRequestSchema.parse(request);
|
|
@@ -6745,6 +7252,8 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6745
7252
|
CvmCreateResourceGraphV20260522Schema,
|
|
6746
7253
|
CvmDetailV20251028Schema,
|
|
6747
7254
|
CvmGatewayInfoV20260121Schema,
|
|
7255
|
+
CvmGpuRentalOrderInfoV20260121Schema,
|
|
7256
|
+
CvmHourlyRateV20260121Schema,
|
|
6748
7257
|
CvmIdBaseSchema,
|
|
6749
7258
|
CvmIdObjectSchema,
|
|
6750
7259
|
CvmIdSchema,
|
|
@@ -6763,6 +7272,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6763
7272
|
CvmProgressInfoV20260121Schema,
|
|
6764
7273
|
CvmRefSchema,
|
|
6765
7274
|
CvmResourceInfoV20260121Schema,
|
|
7275
|
+
CvmResourceUsageSchema,
|
|
6766
7276
|
CvmStateSchema,
|
|
6767
7277
|
CvmStatusSchema,
|
|
6768
7278
|
CvmSystemInfoSchema,
|
|
@@ -6771,6 +7281,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6771
7281
|
DeleteSshKeyRequestSchema,
|
|
6772
7282
|
DeployAppAuthRequestSchema,
|
|
6773
7283
|
DeployAppAuthSchema,
|
|
7284
|
+
DeviceIdEntrySchema,
|
|
6774
7285
|
DstackAppFullResponseV20251028Schema,
|
|
6775
7286
|
DstackAppFullResponseV20260121Schema,
|
|
6776
7287
|
DstackAppFullResponseV20260522Schema,
|
|
@@ -6809,6 +7320,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6809
7320
|
GetCvmStatusBatchRequestSchema,
|
|
6810
7321
|
GetCvmStatusBatchResponseSchema,
|
|
6811
7322
|
GetCvmUserConfigRequestSchema,
|
|
7323
|
+
GetKmsContractRequestSchema,
|
|
6812
7324
|
GetKmsInfoRequestSchema,
|
|
6813
7325
|
GetKmsListRequestSchema,
|
|
6814
7326
|
GetKmsListSchema,
|
|
@@ -6825,9 +7337,15 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6825
7337
|
InstanceIdRefreshResultSchema,
|
|
6826
7338
|
InstanceTypeSchema,
|
|
6827
7339
|
IsAllowedResultSchema,
|
|
7340
|
+
KmsContractInfoSchema,
|
|
7341
|
+
KmsContractNodeSchema,
|
|
6828
7342
|
KmsInfoSchema,
|
|
6829
7343
|
KmsTypeSchema,
|
|
6830
7344
|
ListFamilyInstanceTypesRequestSchema,
|
|
7345
|
+
ListKmsContractNodesRequestSchema,
|
|
7346
|
+
ListKmsContractNodesSchema,
|
|
7347
|
+
ListKmsContractsRequestSchema,
|
|
7348
|
+
ListKmsContractsSchema,
|
|
6831
7349
|
ListSshKeysResponseSchema,
|
|
6832
7350
|
ListWorkspacesSchema,
|
|
6833
7351
|
LooseAppComposeSchema,
|
|
@@ -6946,6 +7464,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6946
7464
|
extractNetworkClients,
|
|
6947
7465
|
formatErrorMessage,
|
|
6948
7466
|
formatStructuredError,
|
|
7467
|
+
formatStructuredErrorDetailValue,
|
|
6949
7468
|
formatValidationErrors,
|
|
6950
7469
|
generateDefaultCvmName,
|
|
6951
7470
|
generateFallbackHostname,
|
|
@@ -6977,9 +7496,12 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6977
7496
|
getCvmStatusBatch,
|
|
6978
7497
|
getCvmUserConfig,
|
|
6979
7498
|
getErrorMessage,
|
|
7499
|
+
getKmsContract,
|
|
6980
7500
|
getKmsInfo,
|
|
6981
7501
|
getKmsList,
|
|
6982
7502
|
getKmsOnChainDetail,
|
|
7503
|
+
getMrConfigId,
|
|
7504
|
+
getMrConfigIdV1,
|
|
6983
7505
|
getOsImages,
|
|
6984
7506
|
getPreLaunchScriptUpgradeStatus,
|
|
6985
7507
|
getVMSchemaForVersion,
|
|
@@ -6993,6 +7515,8 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
6993
7515
|
isValidHostname,
|
|
6994
7516
|
listAllInstanceTypeFamilies,
|
|
6995
7517
|
listFamilyInstanceTypes,
|
|
7518
|
+
listKmsContractNodes,
|
|
7519
|
+
listKmsContracts,
|
|
6996
7520
|
listSshKeys,
|
|
6997
7521
|
listWorkspaces,
|
|
6998
7522
|
nextAppIds,
|
|
@@ -7052,6 +7576,7 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
7052
7576
|
safeGetCvmStats,
|
|
7053
7577
|
safeGetCvmStatusBatch,
|
|
7054
7578
|
safeGetCvmUserConfig,
|
|
7579
|
+
safeGetKmsContract,
|
|
7055
7580
|
safeGetKmsInfo,
|
|
7056
7581
|
safeGetKmsList,
|
|
7057
7582
|
safeGetKmsOnChainDetail,
|
|
@@ -7063,6 +7588,8 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
7063
7588
|
safeImportGithubProfileSshKeys,
|
|
7064
7589
|
safeListAllInstanceTypeFamilies,
|
|
7065
7590
|
safeListFamilyInstanceTypes,
|
|
7591
|
+
safeListKmsContractNodes,
|
|
7592
|
+
safeListKmsContracts,
|
|
7066
7593
|
safeListSshKeys,
|
|
7067
7594
|
safeListWorkspaces,
|
|
7068
7595
|
safeNextAppIds,
|
|
@@ -7105,6 +7632,8 @@ var import_verify_env_encrypt_public_key = require("@phala/dstack-sdk/verify-env
|
|
|
7105
7632
|
validateComposePayloadSize,
|
|
7106
7633
|
validateNetworkPrerequisites,
|
|
7107
7634
|
verifyEnvEncryptPublicKey,
|
|
7635
|
+
verifyEnvEncryptPublicKeyLegacy,
|
|
7636
|
+
verifyMrConfigId,
|
|
7108
7637
|
waitForTransactionReceipt,
|
|
7109
7638
|
watchCvmState,
|
|
7110
7639
|
withComposeMethods
|