modal 0.11.1-dev.7 → 0.11.1-dev.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +455 -69
- package/dist/index.d.cts +54 -11
- package/dist/index.d.ts +54 -11
- package/dist/index.js +455 -69
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2236,6 +2236,9 @@ function environmentRoleFromJSON(object) {
|
|
|
2236
2236
|
case 3:
|
|
2237
2237
|
case "ENVIRONMENT_ROLE_NO_ACCESS":
|
|
2238
2238
|
return 3 /* ENVIRONMENT_ROLE_NO_ACCESS */;
|
|
2239
|
+
case 4:
|
|
2240
|
+
case "ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER":
|
|
2241
|
+
return 4 /* ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER */;
|
|
2239
2242
|
case -1:
|
|
2240
2243
|
case "UNRECOGNIZED":
|
|
2241
2244
|
default:
|
|
@@ -2252,6 +2255,8 @@ function environmentRoleToJSON(object) {
|
|
|
2252
2255
|
return "ENVIRONMENT_ROLE_CONTRIBUTOR";
|
|
2253
2256
|
case 3 /* ENVIRONMENT_ROLE_NO_ACCESS */:
|
|
2254
2257
|
return "ENVIRONMENT_ROLE_NO_ACCESS";
|
|
2258
|
+
case 4 /* ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER */:
|
|
2259
|
+
return "ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER";
|
|
2255
2260
|
case -1 /* UNRECOGNIZED */:
|
|
2256
2261
|
default:
|
|
2257
2262
|
return "UNRECOGNIZED";
|
|
@@ -2265,6 +2270,9 @@ function environmentTypeFromJSON(object) {
|
|
|
2265
2270
|
case 1:
|
|
2266
2271
|
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2267
2272
|
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2273
|
+
case 2:
|
|
2274
|
+
case "ENVIRONMENT_TYPE_MODAL_ADMINISTERED":
|
|
2275
|
+
return 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */;
|
|
2268
2276
|
case -1:
|
|
2269
2277
|
case "UNRECOGNIZED":
|
|
2270
2278
|
default:
|
|
@@ -2277,6 +2285,8 @@ function environmentTypeToJSON(object) {
|
|
|
2277
2285
|
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2278
2286
|
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2279
2287
|
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2288
|
+
case 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */:
|
|
2289
|
+
return "ENVIRONMENT_TYPE_MODAL_ADMINISTERED";
|
|
2280
2290
|
case -1 /* UNRECOGNIZED */:
|
|
2281
2291
|
default:
|
|
2282
2292
|
return "UNRECOGNIZED";
|
|
@@ -12696,6 +12706,377 @@ var ClusterListResponse = {
|
|
|
12696
12706
|
return message;
|
|
12697
12707
|
}
|
|
12698
12708
|
};
|
|
12709
|
+
function createBaseClusterReservation() {
|
|
12710
|
+
return {
|
|
12711
|
+
name: "",
|
|
12712
|
+
gpuType: "",
|
|
12713
|
+
region: "",
|
|
12714
|
+
minReservedWorkers: 0,
|
|
12715
|
+
reservedWorkers: 0,
|
|
12716
|
+
activeWorkers: 0,
|
|
12717
|
+
idleWorkers: 0,
|
|
12718
|
+
unfulfilledWorkers: 0,
|
|
12719
|
+
tasks: []
|
|
12720
|
+
};
|
|
12721
|
+
}
|
|
12722
|
+
var ClusterReservation = {
|
|
12723
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12724
|
+
if (message.name !== "") {
|
|
12725
|
+
writer.uint32(10).string(message.name);
|
|
12726
|
+
}
|
|
12727
|
+
if (message.gpuType !== "") {
|
|
12728
|
+
writer.uint32(18).string(message.gpuType);
|
|
12729
|
+
}
|
|
12730
|
+
if (message.region !== "") {
|
|
12731
|
+
writer.uint32(26).string(message.region);
|
|
12732
|
+
}
|
|
12733
|
+
if (message.minReservedWorkers !== 0) {
|
|
12734
|
+
writer.uint32(32).int32(message.minReservedWorkers);
|
|
12735
|
+
}
|
|
12736
|
+
if (message.reservedWorkers !== 0) {
|
|
12737
|
+
writer.uint32(40).int32(message.reservedWorkers);
|
|
12738
|
+
}
|
|
12739
|
+
if (message.activeWorkers !== 0) {
|
|
12740
|
+
writer.uint32(48).int32(message.activeWorkers);
|
|
12741
|
+
}
|
|
12742
|
+
if (message.idleWorkers !== 0) {
|
|
12743
|
+
writer.uint32(56).int32(message.idleWorkers);
|
|
12744
|
+
}
|
|
12745
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12746
|
+
writer.uint32(64).int32(message.unfulfilledWorkers);
|
|
12747
|
+
}
|
|
12748
|
+
for (const v of message.tasks) {
|
|
12749
|
+
ClusterReservation_Task.encode(v, writer.uint32(74).fork()).join();
|
|
12750
|
+
}
|
|
12751
|
+
return writer;
|
|
12752
|
+
},
|
|
12753
|
+
decode(input, length) {
|
|
12754
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12755
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12756
|
+
const message = createBaseClusterReservation();
|
|
12757
|
+
while (reader.pos < end) {
|
|
12758
|
+
const tag = reader.uint32();
|
|
12759
|
+
switch (tag >>> 3) {
|
|
12760
|
+
case 1: {
|
|
12761
|
+
if (tag !== 10) {
|
|
12762
|
+
break;
|
|
12763
|
+
}
|
|
12764
|
+
message.name = reader.string();
|
|
12765
|
+
continue;
|
|
12766
|
+
}
|
|
12767
|
+
case 2: {
|
|
12768
|
+
if (tag !== 18) {
|
|
12769
|
+
break;
|
|
12770
|
+
}
|
|
12771
|
+
message.gpuType = reader.string();
|
|
12772
|
+
continue;
|
|
12773
|
+
}
|
|
12774
|
+
case 3: {
|
|
12775
|
+
if (tag !== 26) {
|
|
12776
|
+
break;
|
|
12777
|
+
}
|
|
12778
|
+
message.region = reader.string();
|
|
12779
|
+
continue;
|
|
12780
|
+
}
|
|
12781
|
+
case 4: {
|
|
12782
|
+
if (tag !== 32) {
|
|
12783
|
+
break;
|
|
12784
|
+
}
|
|
12785
|
+
message.minReservedWorkers = reader.int32();
|
|
12786
|
+
continue;
|
|
12787
|
+
}
|
|
12788
|
+
case 5: {
|
|
12789
|
+
if (tag !== 40) {
|
|
12790
|
+
break;
|
|
12791
|
+
}
|
|
12792
|
+
message.reservedWorkers = reader.int32();
|
|
12793
|
+
continue;
|
|
12794
|
+
}
|
|
12795
|
+
case 6: {
|
|
12796
|
+
if (tag !== 48) {
|
|
12797
|
+
break;
|
|
12798
|
+
}
|
|
12799
|
+
message.activeWorkers = reader.int32();
|
|
12800
|
+
continue;
|
|
12801
|
+
}
|
|
12802
|
+
case 7: {
|
|
12803
|
+
if (tag !== 56) {
|
|
12804
|
+
break;
|
|
12805
|
+
}
|
|
12806
|
+
message.idleWorkers = reader.int32();
|
|
12807
|
+
continue;
|
|
12808
|
+
}
|
|
12809
|
+
case 8: {
|
|
12810
|
+
if (tag !== 64) {
|
|
12811
|
+
break;
|
|
12812
|
+
}
|
|
12813
|
+
message.unfulfilledWorkers = reader.int32();
|
|
12814
|
+
continue;
|
|
12815
|
+
}
|
|
12816
|
+
case 9: {
|
|
12817
|
+
if (tag !== 74) {
|
|
12818
|
+
break;
|
|
12819
|
+
}
|
|
12820
|
+
message.tasks.push(ClusterReservation_Task.decode(reader, reader.uint32()));
|
|
12821
|
+
continue;
|
|
12822
|
+
}
|
|
12823
|
+
}
|
|
12824
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12825
|
+
break;
|
|
12826
|
+
}
|
|
12827
|
+
reader.skip(tag & 7);
|
|
12828
|
+
}
|
|
12829
|
+
return message;
|
|
12830
|
+
},
|
|
12831
|
+
fromJSON(object) {
|
|
12832
|
+
return {
|
|
12833
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
12834
|
+
gpuType: isSet5(object.gpuType) ? globalThis.String(object.gpuType) : "",
|
|
12835
|
+
region: isSet5(object.region) ? globalThis.String(object.region) : "",
|
|
12836
|
+
minReservedWorkers: isSet5(object.minReservedWorkers) ? globalThis.Number(object.minReservedWorkers) : 0,
|
|
12837
|
+
reservedWorkers: isSet5(object.reservedWorkers) ? globalThis.Number(object.reservedWorkers) : 0,
|
|
12838
|
+
activeWorkers: isSet5(object.activeWorkers) ? globalThis.Number(object.activeWorkers) : 0,
|
|
12839
|
+
idleWorkers: isSet5(object.idleWorkers) ? globalThis.Number(object.idleWorkers) : 0,
|
|
12840
|
+
unfulfilledWorkers: isSet5(object.unfulfilledWorkers) ? globalThis.Number(object.unfulfilledWorkers) : 0,
|
|
12841
|
+
tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => ClusterReservation_Task.fromJSON(e)) : []
|
|
12842
|
+
};
|
|
12843
|
+
},
|
|
12844
|
+
toJSON(message) {
|
|
12845
|
+
const obj = {};
|
|
12846
|
+
if (message.name !== "") {
|
|
12847
|
+
obj.name = message.name;
|
|
12848
|
+
}
|
|
12849
|
+
if (message.gpuType !== "") {
|
|
12850
|
+
obj.gpuType = message.gpuType;
|
|
12851
|
+
}
|
|
12852
|
+
if (message.region !== "") {
|
|
12853
|
+
obj.region = message.region;
|
|
12854
|
+
}
|
|
12855
|
+
if (message.minReservedWorkers !== 0) {
|
|
12856
|
+
obj.minReservedWorkers = Math.round(message.minReservedWorkers);
|
|
12857
|
+
}
|
|
12858
|
+
if (message.reservedWorkers !== 0) {
|
|
12859
|
+
obj.reservedWorkers = Math.round(message.reservedWorkers);
|
|
12860
|
+
}
|
|
12861
|
+
if (message.activeWorkers !== 0) {
|
|
12862
|
+
obj.activeWorkers = Math.round(message.activeWorkers);
|
|
12863
|
+
}
|
|
12864
|
+
if (message.idleWorkers !== 0) {
|
|
12865
|
+
obj.idleWorkers = Math.round(message.idleWorkers);
|
|
12866
|
+
}
|
|
12867
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12868
|
+
obj.unfulfilledWorkers = Math.round(message.unfulfilledWorkers);
|
|
12869
|
+
}
|
|
12870
|
+
if (message.tasks?.length) {
|
|
12871
|
+
obj.tasks = message.tasks.map((e) => ClusterReservation_Task.toJSON(e));
|
|
12872
|
+
}
|
|
12873
|
+
return obj;
|
|
12874
|
+
},
|
|
12875
|
+
create(base) {
|
|
12876
|
+
return ClusterReservation.fromPartial(base ?? {});
|
|
12877
|
+
},
|
|
12878
|
+
fromPartial(object) {
|
|
12879
|
+
const message = createBaseClusterReservation();
|
|
12880
|
+
message.name = object.name ?? "";
|
|
12881
|
+
message.gpuType = object.gpuType ?? "";
|
|
12882
|
+
message.region = object.region ?? "";
|
|
12883
|
+
message.minReservedWorkers = object.minReservedWorkers ?? 0;
|
|
12884
|
+
message.reservedWorkers = object.reservedWorkers ?? 0;
|
|
12885
|
+
message.activeWorkers = object.activeWorkers ?? 0;
|
|
12886
|
+
message.idleWorkers = object.idleWorkers ?? 0;
|
|
12887
|
+
message.unfulfilledWorkers = object.unfulfilledWorkers ?? 0;
|
|
12888
|
+
message.tasks = object.tasks?.map((e) => ClusterReservation_Task.fromPartial(e)) || [];
|
|
12889
|
+
return message;
|
|
12890
|
+
}
|
|
12891
|
+
};
|
|
12892
|
+
function createBaseClusterReservation_Task() {
|
|
12893
|
+
return { taskId: "", clusterRank: 0, appId: "", functionId: "" };
|
|
12894
|
+
}
|
|
12895
|
+
var ClusterReservation_Task = {
|
|
12896
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12897
|
+
if (message.taskId !== "") {
|
|
12898
|
+
writer.uint32(10).string(message.taskId);
|
|
12899
|
+
}
|
|
12900
|
+
if (message.clusterRank !== 0) {
|
|
12901
|
+
writer.uint32(16).int32(message.clusterRank);
|
|
12902
|
+
}
|
|
12903
|
+
if (message.appId !== "") {
|
|
12904
|
+
writer.uint32(26).string(message.appId);
|
|
12905
|
+
}
|
|
12906
|
+
if (message.functionId !== "") {
|
|
12907
|
+
writer.uint32(34).string(message.functionId);
|
|
12908
|
+
}
|
|
12909
|
+
return writer;
|
|
12910
|
+
},
|
|
12911
|
+
decode(input, length) {
|
|
12912
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12913
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12914
|
+
const message = createBaseClusterReservation_Task();
|
|
12915
|
+
while (reader.pos < end) {
|
|
12916
|
+
const tag = reader.uint32();
|
|
12917
|
+
switch (tag >>> 3) {
|
|
12918
|
+
case 1: {
|
|
12919
|
+
if (tag !== 10) {
|
|
12920
|
+
break;
|
|
12921
|
+
}
|
|
12922
|
+
message.taskId = reader.string();
|
|
12923
|
+
continue;
|
|
12924
|
+
}
|
|
12925
|
+
case 2: {
|
|
12926
|
+
if (tag !== 16) {
|
|
12927
|
+
break;
|
|
12928
|
+
}
|
|
12929
|
+
message.clusterRank = reader.int32();
|
|
12930
|
+
continue;
|
|
12931
|
+
}
|
|
12932
|
+
case 3: {
|
|
12933
|
+
if (tag !== 26) {
|
|
12934
|
+
break;
|
|
12935
|
+
}
|
|
12936
|
+
message.appId = reader.string();
|
|
12937
|
+
continue;
|
|
12938
|
+
}
|
|
12939
|
+
case 4: {
|
|
12940
|
+
if (tag !== 34) {
|
|
12941
|
+
break;
|
|
12942
|
+
}
|
|
12943
|
+
message.functionId = reader.string();
|
|
12944
|
+
continue;
|
|
12945
|
+
}
|
|
12946
|
+
}
|
|
12947
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12948
|
+
break;
|
|
12949
|
+
}
|
|
12950
|
+
reader.skip(tag & 7);
|
|
12951
|
+
}
|
|
12952
|
+
return message;
|
|
12953
|
+
},
|
|
12954
|
+
fromJSON(object) {
|
|
12955
|
+
return {
|
|
12956
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
12957
|
+
clusterRank: isSet5(object.clusterRank) ? globalThis.Number(object.clusterRank) : 0,
|
|
12958
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
12959
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
12960
|
+
};
|
|
12961
|
+
},
|
|
12962
|
+
toJSON(message) {
|
|
12963
|
+
const obj = {};
|
|
12964
|
+
if (message.taskId !== "") {
|
|
12965
|
+
obj.taskId = message.taskId;
|
|
12966
|
+
}
|
|
12967
|
+
if (message.clusterRank !== 0) {
|
|
12968
|
+
obj.clusterRank = Math.round(message.clusterRank);
|
|
12969
|
+
}
|
|
12970
|
+
if (message.appId !== "") {
|
|
12971
|
+
obj.appId = message.appId;
|
|
12972
|
+
}
|
|
12973
|
+
if (message.functionId !== "") {
|
|
12974
|
+
obj.functionId = message.functionId;
|
|
12975
|
+
}
|
|
12976
|
+
return obj;
|
|
12977
|
+
},
|
|
12978
|
+
create(base) {
|
|
12979
|
+
return ClusterReservation_Task.fromPartial(base ?? {});
|
|
12980
|
+
},
|
|
12981
|
+
fromPartial(object) {
|
|
12982
|
+
const message = createBaseClusterReservation_Task();
|
|
12983
|
+
message.taskId = object.taskId ?? "";
|
|
12984
|
+
message.clusterRank = object.clusterRank ?? 0;
|
|
12985
|
+
message.appId = object.appId ?? "";
|
|
12986
|
+
message.functionId = object.functionId ?? "";
|
|
12987
|
+
return message;
|
|
12988
|
+
}
|
|
12989
|
+
};
|
|
12990
|
+
function createBaseClusterReservationListRequest() {
|
|
12991
|
+
return {};
|
|
12992
|
+
}
|
|
12993
|
+
var ClusterReservationListRequest = {
|
|
12994
|
+
encode(_, writer = new BinaryWriter()) {
|
|
12995
|
+
return writer;
|
|
12996
|
+
},
|
|
12997
|
+
decode(input, length) {
|
|
12998
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12999
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
13000
|
+
const message = createBaseClusterReservationListRequest();
|
|
13001
|
+
while (reader.pos < end) {
|
|
13002
|
+
const tag = reader.uint32();
|
|
13003
|
+
switch (tag >>> 3) {
|
|
13004
|
+
}
|
|
13005
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13006
|
+
break;
|
|
13007
|
+
}
|
|
13008
|
+
reader.skip(tag & 7);
|
|
13009
|
+
}
|
|
13010
|
+
return message;
|
|
13011
|
+
},
|
|
13012
|
+
fromJSON(_) {
|
|
13013
|
+
return {};
|
|
13014
|
+
},
|
|
13015
|
+
toJSON(_) {
|
|
13016
|
+
const obj = {};
|
|
13017
|
+
return obj;
|
|
13018
|
+
},
|
|
13019
|
+
create(base) {
|
|
13020
|
+
return ClusterReservationListRequest.fromPartial(base ?? {});
|
|
13021
|
+
},
|
|
13022
|
+
fromPartial(_) {
|
|
13023
|
+
const message = createBaseClusterReservationListRequest();
|
|
13024
|
+
return message;
|
|
13025
|
+
}
|
|
13026
|
+
};
|
|
13027
|
+
function createBaseClusterReservationListResponse() {
|
|
13028
|
+
return { reservations: [] };
|
|
13029
|
+
}
|
|
13030
|
+
var ClusterReservationListResponse = {
|
|
13031
|
+
encode(message, writer = new BinaryWriter()) {
|
|
13032
|
+
for (const v of message.reservations) {
|
|
13033
|
+
ClusterReservation.encode(v, writer.uint32(10).fork()).join();
|
|
13034
|
+
}
|
|
13035
|
+
return writer;
|
|
13036
|
+
},
|
|
13037
|
+
decode(input, length) {
|
|
13038
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13039
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
13040
|
+
const message = createBaseClusterReservationListResponse();
|
|
13041
|
+
while (reader.pos < end) {
|
|
13042
|
+
const tag = reader.uint32();
|
|
13043
|
+
switch (tag >>> 3) {
|
|
13044
|
+
case 1: {
|
|
13045
|
+
if (tag !== 10) {
|
|
13046
|
+
break;
|
|
13047
|
+
}
|
|
13048
|
+
message.reservations.push(ClusterReservation.decode(reader, reader.uint32()));
|
|
13049
|
+
continue;
|
|
13050
|
+
}
|
|
13051
|
+
}
|
|
13052
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13053
|
+
break;
|
|
13054
|
+
}
|
|
13055
|
+
reader.skip(tag & 7);
|
|
13056
|
+
}
|
|
13057
|
+
return message;
|
|
13058
|
+
},
|
|
13059
|
+
fromJSON(object) {
|
|
13060
|
+
return {
|
|
13061
|
+
reservations: globalThis.Array.isArray(object?.reservations) ? object.reservations.map((e) => ClusterReservation.fromJSON(e)) : []
|
|
13062
|
+
};
|
|
13063
|
+
},
|
|
13064
|
+
toJSON(message) {
|
|
13065
|
+
const obj = {};
|
|
13066
|
+
if (message.reservations?.length) {
|
|
13067
|
+
obj.reservations = message.reservations.map((e) => ClusterReservation.toJSON(e));
|
|
13068
|
+
}
|
|
13069
|
+
return obj;
|
|
13070
|
+
},
|
|
13071
|
+
create(base) {
|
|
13072
|
+
return ClusterReservationListResponse.fromPartial(base ?? {});
|
|
13073
|
+
},
|
|
13074
|
+
fromPartial(object) {
|
|
13075
|
+
const message = createBaseClusterReservationListResponse();
|
|
13076
|
+
message.reservations = object.reservations?.map((e) => ClusterReservation.fromPartial(e)) || [];
|
|
13077
|
+
return message;
|
|
13078
|
+
}
|
|
13079
|
+
};
|
|
12699
13080
|
function createBaseClusterStats() {
|
|
12700
13081
|
return { appId: "", taskIds: [], clusterId: "", startedAt: 0 };
|
|
12701
13082
|
}
|
|
@@ -17899,7 +18280,8 @@ function createBaseEndpointCreateRequest() {
|
|
|
17899
18280
|
environmentName: "",
|
|
17900
18281
|
unauthenticated: false,
|
|
17901
18282
|
servingMode: 0,
|
|
17902
|
-
sharedEndpointNoticeAcknowledged: false
|
|
18283
|
+
sharedEndpointNoticeAcknowledged: false,
|
|
18284
|
+
recipeId: void 0
|
|
17903
18285
|
};
|
|
17904
18286
|
}
|
|
17905
18287
|
var EndpointCreateRequest = {
|
|
@@ -17941,6 +18323,9 @@ var EndpointCreateRequest = {
|
|
|
17941
18323
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17942
18324
|
writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
|
|
17943
18325
|
}
|
|
18326
|
+
if (message.recipeId !== void 0) {
|
|
18327
|
+
writer.uint32(98).string(message.recipeId);
|
|
18328
|
+
}
|
|
17944
18329
|
return writer;
|
|
17945
18330
|
},
|
|
17946
18331
|
decode(input, length) {
|
|
@@ -18041,6 +18426,13 @@ var EndpointCreateRequest = {
|
|
|
18041
18426
|
message.sharedEndpointNoticeAcknowledged = reader.bool();
|
|
18042
18427
|
continue;
|
|
18043
18428
|
}
|
|
18429
|
+
case 12: {
|
|
18430
|
+
if (tag !== 98) {
|
|
18431
|
+
break;
|
|
18432
|
+
}
|
|
18433
|
+
message.recipeId = reader.string();
|
|
18434
|
+
continue;
|
|
18435
|
+
}
|
|
18044
18436
|
}
|
|
18045
18437
|
if ((tag & 7) === 4 || tag === 0) {
|
|
18046
18438
|
break;
|
|
@@ -18061,7 +18453,8 @@ var EndpointCreateRequest = {
|
|
|
18061
18453
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
18062
18454
|
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
18063
18455
|
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
18064
|
-
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
|
|
18456
|
+
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false,
|
|
18457
|
+
recipeId: isSet5(object.recipeId) ? globalThis.String(object.recipeId) : void 0
|
|
18065
18458
|
};
|
|
18066
18459
|
},
|
|
18067
18460
|
toJSON(message) {
|
|
@@ -18099,6 +18492,9 @@ var EndpointCreateRequest = {
|
|
|
18099
18492
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
18100
18493
|
obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
|
|
18101
18494
|
}
|
|
18495
|
+
if (message.recipeId !== void 0) {
|
|
18496
|
+
obj.recipeId = message.recipeId;
|
|
18497
|
+
}
|
|
18102
18498
|
return obj;
|
|
18103
18499
|
},
|
|
18104
18500
|
create(base) {
|
|
@@ -18117,6 +18513,7 @@ var EndpointCreateRequest = {
|
|
|
18117
18513
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
18118
18514
|
message.servingMode = object.servingMode ?? 0;
|
|
18119
18515
|
message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
|
|
18516
|
+
message.recipeId = object.recipeId ?? void 0;
|
|
18120
18517
|
return message;
|
|
18121
18518
|
}
|
|
18122
18519
|
};
|
|
@@ -61698,6 +62095,14 @@ var ModalClientDefinition = {
|
|
|
61698
62095
|
responseStream: false,
|
|
61699
62096
|
options: {}
|
|
61700
62097
|
},
|
|
62098
|
+
clusterReservationList: {
|
|
62099
|
+
name: "ClusterReservationList",
|
|
62100
|
+
requestType: ClusterReservationListRequest,
|
|
62101
|
+
requestStream: false,
|
|
62102
|
+
responseType: ClusterReservationListResponse,
|
|
62103
|
+
responseStream: false,
|
|
62104
|
+
options: {}
|
|
62105
|
+
},
|
|
61701
62106
|
/** Container */
|
|
61702
62107
|
containerCheckpoint: {
|
|
61703
62108
|
name: "ContainerCheckpoint",
|
|
@@ -64181,7 +64586,7 @@ var SecretService = class {
|
|
|
64181
64586
|
"secret_name",
|
|
64182
64587
|
name
|
|
64183
64588
|
);
|
|
64184
|
-
return new Secret(resp.secretId, name
|
|
64589
|
+
return new Secret(resp.secretId, name);
|
|
64185
64590
|
} catch (err) {
|
|
64186
64591
|
if (err instanceof import_nice_grpc2.ClientError && err.code === import_nice_grpc2.Status.NOT_FOUND)
|
|
64187
64592
|
throw new NotFoundError(err.details);
|
|
@@ -64280,20 +64685,16 @@ var Secret = class {
|
|
|
64280
64685
|
// constructed already-hydrated (e.g. from fromName), and not consulted again
|
|
64281
64686
|
// once secretId is set.
|
|
64282
64687
|
#hydrator;
|
|
64283
|
-
// Names of the env vars a server-side Secret defines, as reported by the
|
|
64284
|
-
// control plane on fromName. Undefined when unknown.
|
|
64285
|
-
#keys;
|
|
64286
64688
|
// Caches the single in-flight (or successfully completed) hydration so the
|
|
64287
64689
|
// ephemeral Secret is created at most once, even if multiple callers hydrate
|
|
64288
64690
|
// the same Secret concurrently. Cleared on failure so a transient error
|
|
64289
64691
|
// doesn't permanently break the Secret; subsequent calls can retry.
|
|
64290
64692
|
#hydratePromise;
|
|
64291
64693
|
/** @ignore */
|
|
64292
|
-
constructor(secretId, name, hydrator
|
|
64694
|
+
constructor(secretId, name, hydrator) {
|
|
64293
64695
|
this.#secretId = secretId;
|
|
64294
64696
|
this.name = name;
|
|
64295
64697
|
this.#hydrator = hydrator;
|
|
64296
|
-
this.#keys = keys !== void 0 ? new Set(keys) : void 0;
|
|
64297
64698
|
}
|
|
64298
64699
|
/** The ID of the server-side Secret, or an empty string if not yet hydrated. */
|
|
64299
64700
|
get secretId() {
|
|
@@ -64309,16 +64710,6 @@ var Secret = class {
|
|
|
64309
64710
|
get _hydrator() {
|
|
64310
64711
|
return this.#hydrator;
|
|
64311
64712
|
}
|
|
64312
|
-
/**
|
|
64313
|
-
* Names of the env vars this server-side Secret defines, or `undefined` if
|
|
64314
|
-
* unknown (e.g. for lazy fromObject Secrets or Secrets constructed by id).
|
|
64315
|
-
*
|
|
64316
|
-
* @internal
|
|
64317
|
-
* @hidden
|
|
64318
|
-
*/
|
|
64319
|
-
get _keys() {
|
|
64320
|
-
return this.#keys;
|
|
64321
|
-
}
|
|
64322
64713
|
/**
|
|
64323
64714
|
* Lazily create the ephemeral server-side Secret backing a fromObject Secret
|
|
64324
64715
|
* and populate {@link Secret#secretId secretId}. A no-op once secretId is set
|
|
@@ -64378,21 +64769,39 @@ function collectSecretIds(secrets) {
|
|
|
64378
64769
|
return secret.secretId;
|
|
64379
64770
|
});
|
|
64380
64771
|
}
|
|
64381
|
-
function
|
|
64382
|
-
|
|
64383
|
-
|
|
64384
|
-
|
|
64772
|
+
function resolvableSecrets(secrets) {
|
|
64773
|
+
return secrets.filter(
|
|
64774
|
+
(secret) => secret == null || secretEnvDictHydrator(secret) === void 0
|
|
64775
|
+
);
|
|
64776
|
+
}
|
|
64777
|
+
function secretSources(secrets, env) {
|
|
64778
|
+
const sources = [];
|
|
64779
|
+
secrets.forEach((secret, i) => {
|
|
64385
64780
|
const hydrator = secret != null ? secretEnvDictHydrator(secret) : void 0;
|
|
64386
64781
|
if (hydrator !== void 0) {
|
|
64387
|
-
Object.
|
|
64388
|
-
|
|
64389
|
-
|
|
64390
|
-
|
|
64782
|
+
if (Object.keys(hydrator.envDict).length > 0) {
|
|
64783
|
+
sources.push(
|
|
64784
|
+
SecretSource.create({
|
|
64785
|
+
env: StringMap.create({ contents: hydrator.envDict })
|
|
64786
|
+
})
|
|
64787
|
+
);
|
|
64391
64788
|
}
|
|
64392
|
-
|
|
64789
|
+
return;
|
|
64790
|
+
}
|
|
64791
|
+
if (secret == null) {
|
|
64792
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
64793
|
+
}
|
|
64794
|
+
if (secret.secretId === "") {
|
|
64795
|
+
throw new InvalidError(`secret at index ${i} has not been hydrated`);
|
|
64393
64796
|
}
|
|
64797
|
+
sources.push(SecretSource.create({ secretId: secret.secretId }));
|
|
64798
|
+
});
|
|
64799
|
+
if (env && Object.keys(env).length > 0) {
|
|
64800
|
+
sources.push(
|
|
64801
|
+
SecretSource.create({ env: StringMap.create({ contents: env }) })
|
|
64802
|
+
);
|
|
64394
64803
|
}
|
|
64395
|
-
return
|
|
64804
|
+
return sources;
|
|
64396
64805
|
}
|
|
64397
64806
|
|
|
64398
64807
|
// src/image.ts
|
|
@@ -71826,16 +72235,14 @@ var SidecarService = class {
|
|
|
71826
72235
|
}
|
|
71827
72236
|
}
|
|
71828
72237
|
validateEnvVarKeys(params?.env ?? {});
|
|
71829
|
-
const
|
|
71830
|
-
params?.secrets ?? []
|
|
71831
|
-
);
|
|
71832
|
-
Object.assign(envDict, params?.env ?? {});
|
|
72238
|
+
const resolvable = resolvableSecrets(params?.secrets ?? []);
|
|
71833
72239
|
await hydrateSandboxSecrets(
|
|
71834
72240
|
this.#access.client,
|
|
71835
|
-
|
|
72241
|
+
resolvable,
|
|
71836
72242
|
params?.cloudBucketMounts
|
|
71837
72243
|
);
|
|
71838
|
-
const secretIds = collectSecretIds(
|
|
72244
|
+
const secretIds = collectSecretIds(resolvable);
|
|
72245
|
+
const sources = secretSources(params?.secrets ?? [], params?.env);
|
|
71839
72246
|
const volumeMounts = buildSidecarVolumeMounts(params?.volumes);
|
|
71840
72247
|
const cloudBucketMounts = buildCloudBucketMountProtos(
|
|
71841
72248
|
params?.cloudBucketMounts
|
|
@@ -71849,7 +72256,6 @@ var SidecarService = class {
|
|
|
71849
72256
|
let resp;
|
|
71850
72257
|
try {
|
|
71851
72258
|
if (viaControlPlane) {
|
|
71852
|
-
const ephemeralSecrets = Object.keys(envDict).length > 0 ? StringMap.create({ contents: envDict }) : void 0;
|
|
71853
72259
|
resp = await this.#access.client.cpClient.sandboxContainerCreateV2(
|
|
71854
72260
|
SandboxContainerCreateV2Request.create({
|
|
71855
72261
|
sandboxId: this.#access.sandboxId,
|
|
@@ -71869,7 +72275,7 @@ var SidecarService = class {
|
|
|
71869
72275
|
memoryMb: params.experimentalMemoryReserveConsumeMiB
|
|
71870
72276
|
}) : void 0
|
|
71871
72277
|
}),
|
|
71872
|
-
|
|
72278
|
+
secretSources: sources
|
|
71873
72279
|
})
|
|
71874
72280
|
);
|
|
71875
72281
|
} else {
|
|
@@ -71880,9 +72286,8 @@ var SidecarService = class {
|
|
|
71880
72286
|
containerName: name,
|
|
71881
72287
|
imageId: image.imageId,
|
|
71882
72288
|
args: command,
|
|
71883
|
-
env: envDict,
|
|
71884
72289
|
workdir: params?.workdir ?? "",
|
|
71885
|
-
|
|
72290
|
+
secretSources: sources,
|
|
71886
72291
|
volumeMounts,
|
|
71887
72292
|
networkAccess,
|
|
71888
72293
|
ptyInfo,
|
|
@@ -72677,16 +73082,15 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
|
|
|
72677
73082
|
}
|
|
72678
73083
|
});
|
|
72679
73084
|
}
|
|
72680
|
-
async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}) {
|
|
73085
|
+
async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}, secretSources2 = []) {
|
|
72681
73086
|
if (params.gpu) {
|
|
72682
73087
|
throw new Error("GPUs are not supported by experimentalCreate");
|
|
72683
73088
|
}
|
|
72684
73089
|
const req = await buildSandboxCreateRequestProto(appId, imageId, params);
|
|
72685
|
-
const ephemeralSecrets = params.env && Object.keys(params.env).length > 0 ? StringMap.create({ contents: params.env }) : void 0;
|
|
72686
73090
|
return SandboxCreateV2Request.create({
|
|
72687
73091
|
appId: req.appId,
|
|
72688
73092
|
definition: req.definition,
|
|
72689
|
-
|
|
73093
|
+
secretSources: secretSources2,
|
|
72690
73094
|
tags: req.tags
|
|
72691
73095
|
});
|
|
72692
73096
|
}
|
|
@@ -72770,27 +73174,17 @@ var SandboxService = class {
|
|
|
72770
73174
|
async experimentalCreate(app, image, params = {}) {
|
|
72771
73175
|
await image.build(app);
|
|
72772
73176
|
validateEnvVarKeys(params.env ?? {});
|
|
72773
|
-
const
|
|
72774
|
-
params.secrets ?? []
|
|
72775
|
-
);
|
|
72776
|
-
Object.assign(envDict, params.env ?? {});
|
|
73177
|
+
const resolvable = resolvableSecrets(params.secrets ?? []);
|
|
72777
73178
|
await hydrateSandboxSecrets(
|
|
72778
73179
|
this.#client,
|
|
72779
|
-
[
|
|
72780
|
-
...resolvableSecrets,
|
|
72781
|
-
...params.experimentalOutboundPolicy?._secrets() ?? []
|
|
72782
|
-
],
|
|
73180
|
+
[...resolvable, ...params.experimentalOutboundPolicy?._secrets() ?? []],
|
|
72783
73181
|
params.cloudBucketMounts
|
|
72784
73182
|
);
|
|
72785
|
-
const mergedParams = {
|
|
72786
|
-
...params,
|
|
72787
|
-
secrets: resolvableSecrets,
|
|
72788
|
-
env: envDict
|
|
72789
|
-
};
|
|
72790
73183
|
const createReq = await buildSandboxCreateV2RequestProto(
|
|
72791
73184
|
app.appId,
|
|
72792
73185
|
image.imageId,
|
|
72793
|
-
|
|
73186
|
+
{ ...params, secrets: resolvable },
|
|
73187
|
+
secretSources(params.secrets ?? [], params.env)
|
|
72794
73188
|
);
|
|
72795
73189
|
let createResp;
|
|
72796
73190
|
try {
|
|
@@ -73116,7 +73510,6 @@ function buildTaskExecStartRequestProto(taskId, execId, command, params, contain
|
|
|
73116
73510
|
);
|
|
73117
73511
|
}
|
|
73118
73512
|
validateWorkdir(params?.workdir);
|
|
73119
|
-
const secretIds = (params?.secrets || []).map((secret) => secret.secretId);
|
|
73120
73513
|
const stdout = params?.stdout ?? "pipe";
|
|
73121
73514
|
const stderr = params?.stderr ?? "pipe";
|
|
73122
73515
|
let stdoutConfig;
|
|
@@ -73147,8 +73540,7 @@ function buildTaskExecStartRequestProto(taskId, execId, command, params, contain
|
|
|
73147
73540
|
stderrConfig,
|
|
73148
73541
|
timeoutSecs: params?.timeoutMs ? params.timeoutMs / 1e3 : void 0,
|
|
73149
73542
|
workdir: params?.workdir,
|
|
73150
|
-
|
|
73151
|
-
env: params?.env ?? {},
|
|
73543
|
+
secretSources: secretSources(params?.secrets ?? [], params?.env),
|
|
73152
73544
|
ptyInfo,
|
|
73153
73545
|
runtimeDebug: false,
|
|
73154
73546
|
containerId: containerId ?? ""
|
|
@@ -73421,23 +73813,17 @@ var Sandbox2 = class {
|
|
|
73421
73813
|
this.#ensureAttached();
|
|
73422
73814
|
validateExecArgs(command);
|
|
73423
73815
|
validateEnvVarKeys(params?.env ?? {});
|
|
73424
|
-
|
|
73425
|
-
|
|
73816
|
+
await hydrateSecrets(
|
|
73817
|
+
this.#client,
|
|
73818
|
+
resolvableSecrets(params?.secrets ?? [])
|
|
73426
73819
|
);
|
|
73427
|
-
Object.assign(envDict, params?.env ?? {});
|
|
73428
|
-
await hydrateSecrets(this.#client, resolvableSecrets);
|
|
73429
|
-
const execParams = {
|
|
73430
|
-
...params,
|
|
73431
|
-
env: envDict,
|
|
73432
|
-
secrets: resolvableSecrets
|
|
73433
|
-
};
|
|
73434
73820
|
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
73435
73821
|
const execId = (0, import_uuid2.v4)();
|
|
73436
73822
|
const request = buildTaskExecStartRequestProto(
|
|
73437
73823
|
taskId,
|
|
73438
73824
|
execId,
|
|
73439
73825
|
command,
|
|
73440
|
-
|
|
73826
|
+
params,
|
|
73441
73827
|
containerId
|
|
73442
73828
|
);
|
|
73443
73829
|
await commandRouterClient.execStart(request);
|
|
@@ -74625,7 +75011,7 @@ var AuthTokenManager = class {
|
|
|
74625
75011
|
};
|
|
74626
75012
|
|
|
74627
75013
|
// src/version.ts
|
|
74628
|
-
var SDK_VERSION = "0.11.1-dev.
|
|
75014
|
+
var SDK_VERSION = "0.11.1-dev.9";
|
|
74629
75015
|
function getSDKVersion() {
|
|
74630
75016
|
return SDK_VERSION;
|
|
74631
75017
|
}
|