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.js
CHANGED
|
@@ -2141,6 +2141,9 @@ function environmentRoleFromJSON(object) {
|
|
|
2141
2141
|
case 3:
|
|
2142
2142
|
case "ENVIRONMENT_ROLE_NO_ACCESS":
|
|
2143
2143
|
return 3 /* ENVIRONMENT_ROLE_NO_ACCESS */;
|
|
2144
|
+
case 4:
|
|
2145
|
+
case "ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER":
|
|
2146
|
+
return 4 /* ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER */;
|
|
2144
2147
|
case -1:
|
|
2145
2148
|
case "UNRECOGNIZED":
|
|
2146
2149
|
default:
|
|
@@ -2157,6 +2160,8 @@ function environmentRoleToJSON(object) {
|
|
|
2157
2160
|
return "ENVIRONMENT_ROLE_CONTRIBUTOR";
|
|
2158
2161
|
case 3 /* ENVIRONMENT_ROLE_NO_ACCESS */:
|
|
2159
2162
|
return "ENVIRONMENT_ROLE_NO_ACCESS";
|
|
2163
|
+
case 4 /* ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER */:
|
|
2164
|
+
return "ENVIRONMENT_ROLE_MODAL_ADMINISTERED_OBSERVER";
|
|
2160
2165
|
case -1 /* UNRECOGNIZED */:
|
|
2161
2166
|
default:
|
|
2162
2167
|
return "UNRECOGNIZED";
|
|
@@ -2170,6 +2175,9 @@ function environmentTypeFromJSON(object) {
|
|
|
2170
2175
|
case 1:
|
|
2171
2176
|
case "ENVIRONMENT_TYPE_PUBLIC":
|
|
2172
2177
|
return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
|
|
2178
|
+
case 2:
|
|
2179
|
+
case "ENVIRONMENT_TYPE_MODAL_ADMINISTERED":
|
|
2180
|
+
return 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */;
|
|
2173
2181
|
case -1:
|
|
2174
2182
|
case "UNRECOGNIZED":
|
|
2175
2183
|
default:
|
|
@@ -2182,6 +2190,8 @@ function environmentTypeToJSON(object) {
|
|
|
2182
2190
|
return "ENVIRONMENT_TYPE_UNSPECIFIED";
|
|
2183
2191
|
case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
|
|
2184
2192
|
return "ENVIRONMENT_TYPE_PUBLIC";
|
|
2193
|
+
case 2 /* ENVIRONMENT_TYPE_MODAL_ADMINISTERED */:
|
|
2194
|
+
return "ENVIRONMENT_TYPE_MODAL_ADMINISTERED";
|
|
2185
2195
|
case -1 /* UNRECOGNIZED */:
|
|
2186
2196
|
default:
|
|
2187
2197
|
return "UNRECOGNIZED";
|
|
@@ -12601,6 +12611,377 @@ var ClusterListResponse = {
|
|
|
12601
12611
|
return message;
|
|
12602
12612
|
}
|
|
12603
12613
|
};
|
|
12614
|
+
function createBaseClusterReservation() {
|
|
12615
|
+
return {
|
|
12616
|
+
name: "",
|
|
12617
|
+
gpuType: "",
|
|
12618
|
+
region: "",
|
|
12619
|
+
minReservedWorkers: 0,
|
|
12620
|
+
reservedWorkers: 0,
|
|
12621
|
+
activeWorkers: 0,
|
|
12622
|
+
idleWorkers: 0,
|
|
12623
|
+
unfulfilledWorkers: 0,
|
|
12624
|
+
tasks: []
|
|
12625
|
+
};
|
|
12626
|
+
}
|
|
12627
|
+
var ClusterReservation = {
|
|
12628
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12629
|
+
if (message.name !== "") {
|
|
12630
|
+
writer.uint32(10).string(message.name);
|
|
12631
|
+
}
|
|
12632
|
+
if (message.gpuType !== "") {
|
|
12633
|
+
writer.uint32(18).string(message.gpuType);
|
|
12634
|
+
}
|
|
12635
|
+
if (message.region !== "") {
|
|
12636
|
+
writer.uint32(26).string(message.region);
|
|
12637
|
+
}
|
|
12638
|
+
if (message.minReservedWorkers !== 0) {
|
|
12639
|
+
writer.uint32(32).int32(message.minReservedWorkers);
|
|
12640
|
+
}
|
|
12641
|
+
if (message.reservedWorkers !== 0) {
|
|
12642
|
+
writer.uint32(40).int32(message.reservedWorkers);
|
|
12643
|
+
}
|
|
12644
|
+
if (message.activeWorkers !== 0) {
|
|
12645
|
+
writer.uint32(48).int32(message.activeWorkers);
|
|
12646
|
+
}
|
|
12647
|
+
if (message.idleWorkers !== 0) {
|
|
12648
|
+
writer.uint32(56).int32(message.idleWorkers);
|
|
12649
|
+
}
|
|
12650
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12651
|
+
writer.uint32(64).int32(message.unfulfilledWorkers);
|
|
12652
|
+
}
|
|
12653
|
+
for (const v of message.tasks) {
|
|
12654
|
+
ClusterReservation_Task.encode(v, writer.uint32(74).fork()).join();
|
|
12655
|
+
}
|
|
12656
|
+
return writer;
|
|
12657
|
+
},
|
|
12658
|
+
decode(input, length) {
|
|
12659
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12660
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12661
|
+
const message = createBaseClusterReservation();
|
|
12662
|
+
while (reader.pos < end) {
|
|
12663
|
+
const tag = reader.uint32();
|
|
12664
|
+
switch (tag >>> 3) {
|
|
12665
|
+
case 1: {
|
|
12666
|
+
if (tag !== 10) {
|
|
12667
|
+
break;
|
|
12668
|
+
}
|
|
12669
|
+
message.name = reader.string();
|
|
12670
|
+
continue;
|
|
12671
|
+
}
|
|
12672
|
+
case 2: {
|
|
12673
|
+
if (tag !== 18) {
|
|
12674
|
+
break;
|
|
12675
|
+
}
|
|
12676
|
+
message.gpuType = reader.string();
|
|
12677
|
+
continue;
|
|
12678
|
+
}
|
|
12679
|
+
case 3: {
|
|
12680
|
+
if (tag !== 26) {
|
|
12681
|
+
break;
|
|
12682
|
+
}
|
|
12683
|
+
message.region = reader.string();
|
|
12684
|
+
continue;
|
|
12685
|
+
}
|
|
12686
|
+
case 4: {
|
|
12687
|
+
if (tag !== 32) {
|
|
12688
|
+
break;
|
|
12689
|
+
}
|
|
12690
|
+
message.minReservedWorkers = reader.int32();
|
|
12691
|
+
continue;
|
|
12692
|
+
}
|
|
12693
|
+
case 5: {
|
|
12694
|
+
if (tag !== 40) {
|
|
12695
|
+
break;
|
|
12696
|
+
}
|
|
12697
|
+
message.reservedWorkers = reader.int32();
|
|
12698
|
+
continue;
|
|
12699
|
+
}
|
|
12700
|
+
case 6: {
|
|
12701
|
+
if (tag !== 48) {
|
|
12702
|
+
break;
|
|
12703
|
+
}
|
|
12704
|
+
message.activeWorkers = reader.int32();
|
|
12705
|
+
continue;
|
|
12706
|
+
}
|
|
12707
|
+
case 7: {
|
|
12708
|
+
if (tag !== 56) {
|
|
12709
|
+
break;
|
|
12710
|
+
}
|
|
12711
|
+
message.idleWorkers = reader.int32();
|
|
12712
|
+
continue;
|
|
12713
|
+
}
|
|
12714
|
+
case 8: {
|
|
12715
|
+
if (tag !== 64) {
|
|
12716
|
+
break;
|
|
12717
|
+
}
|
|
12718
|
+
message.unfulfilledWorkers = reader.int32();
|
|
12719
|
+
continue;
|
|
12720
|
+
}
|
|
12721
|
+
case 9: {
|
|
12722
|
+
if (tag !== 74) {
|
|
12723
|
+
break;
|
|
12724
|
+
}
|
|
12725
|
+
message.tasks.push(ClusterReservation_Task.decode(reader, reader.uint32()));
|
|
12726
|
+
continue;
|
|
12727
|
+
}
|
|
12728
|
+
}
|
|
12729
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12730
|
+
break;
|
|
12731
|
+
}
|
|
12732
|
+
reader.skip(tag & 7);
|
|
12733
|
+
}
|
|
12734
|
+
return message;
|
|
12735
|
+
},
|
|
12736
|
+
fromJSON(object) {
|
|
12737
|
+
return {
|
|
12738
|
+
name: isSet5(object.name) ? globalThis.String(object.name) : "",
|
|
12739
|
+
gpuType: isSet5(object.gpuType) ? globalThis.String(object.gpuType) : "",
|
|
12740
|
+
region: isSet5(object.region) ? globalThis.String(object.region) : "",
|
|
12741
|
+
minReservedWorkers: isSet5(object.minReservedWorkers) ? globalThis.Number(object.minReservedWorkers) : 0,
|
|
12742
|
+
reservedWorkers: isSet5(object.reservedWorkers) ? globalThis.Number(object.reservedWorkers) : 0,
|
|
12743
|
+
activeWorkers: isSet5(object.activeWorkers) ? globalThis.Number(object.activeWorkers) : 0,
|
|
12744
|
+
idleWorkers: isSet5(object.idleWorkers) ? globalThis.Number(object.idleWorkers) : 0,
|
|
12745
|
+
unfulfilledWorkers: isSet5(object.unfulfilledWorkers) ? globalThis.Number(object.unfulfilledWorkers) : 0,
|
|
12746
|
+
tasks: globalThis.Array.isArray(object?.tasks) ? object.tasks.map((e) => ClusterReservation_Task.fromJSON(e)) : []
|
|
12747
|
+
};
|
|
12748
|
+
},
|
|
12749
|
+
toJSON(message) {
|
|
12750
|
+
const obj = {};
|
|
12751
|
+
if (message.name !== "") {
|
|
12752
|
+
obj.name = message.name;
|
|
12753
|
+
}
|
|
12754
|
+
if (message.gpuType !== "") {
|
|
12755
|
+
obj.gpuType = message.gpuType;
|
|
12756
|
+
}
|
|
12757
|
+
if (message.region !== "") {
|
|
12758
|
+
obj.region = message.region;
|
|
12759
|
+
}
|
|
12760
|
+
if (message.minReservedWorkers !== 0) {
|
|
12761
|
+
obj.minReservedWorkers = Math.round(message.minReservedWorkers);
|
|
12762
|
+
}
|
|
12763
|
+
if (message.reservedWorkers !== 0) {
|
|
12764
|
+
obj.reservedWorkers = Math.round(message.reservedWorkers);
|
|
12765
|
+
}
|
|
12766
|
+
if (message.activeWorkers !== 0) {
|
|
12767
|
+
obj.activeWorkers = Math.round(message.activeWorkers);
|
|
12768
|
+
}
|
|
12769
|
+
if (message.idleWorkers !== 0) {
|
|
12770
|
+
obj.idleWorkers = Math.round(message.idleWorkers);
|
|
12771
|
+
}
|
|
12772
|
+
if (message.unfulfilledWorkers !== 0) {
|
|
12773
|
+
obj.unfulfilledWorkers = Math.round(message.unfulfilledWorkers);
|
|
12774
|
+
}
|
|
12775
|
+
if (message.tasks?.length) {
|
|
12776
|
+
obj.tasks = message.tasks.map((e) => ClusterReservation_Task.toJSON(e));
|
|
12777
|
+
}
|
|
12778
|
+
return obj;
|
|
12779
|
+
},
|
|
12780
|
+
create(base) {
|
|
12781
|
+
return ClusterReservation.fromPartial(base ?? {});
|
|
12782
|
+
},
|
|
12783
|
+
fromPartial(object) {
|
|
12784
|
+
const message = createBaseClusterReservation();
|
|
12785
|
+
message.name = object.name ?? "";
|
|
12786
|
+
message.gpuType = object.gpuType ?? "";
|
|
12787
|
+
message.region = object.region ?? "";
|
|
12788
|
+
message.minReservedWorkers = object.minReservedWorkers ?? 0;
|
|
12789
|
+
message.reservedWorkers = object.reservedWorkers ?? 0;
|
|
12790
|
+
message.activeWorkers = object.activeWorkers ?? 0;
|
|
12791
|
+
message.idleWorkers = object.idleWorkers ?? 0;
|
|
12792
|
+
message.unfulfilledWorkers = object.unfulfilledWorkers ?? 0;
|
|
12793
|
+
message.tasks = object.tasks?.map((e) => ClusterReservation_Task.fromPartial(e)) || [];
|
|
12794
|
+
return message;
|
|
12795
|
+
}
|
|
12796
|
+
};
|
|
12797
|
+
function createBaseClusterReservation_Task() {
|
|
12798
|
+
return { taskId: "", clusterRank: 0, appId: "", functionId: "" };
|
|
12799
|
+
}
|
|
12800
|
+
var ClusterReservation_Task = {
|
|
12801
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12802
|
+
if (message.taskId !== "") {
|
|
12803
|
+
writer.uint32(10).string(message.taskId);
|
|
12804
|
+
}
|
|
12805
|
+
if (message.clusterRank !== 0) {
|
|
12806
|
+
writer.uint32(16).int32(message.clusterRank);
|
|
12807
|
+
}
|
|
12808
|
+
if (message.appId !== "") {
|
|
12809
|
+
writer.uint32(26).string(message.appId);
|
|
12810
|
+
}
|
|
12811
|
+
if (message.functionId !== "") {
|
|
12812
|
+
writer.uint32(34).string(message.functionId);
|
|
12813
|
+
}
|
|
12814
|
+
return writer;
|
|
12815
|
+
},
|
|
12816
|
+
decode(input, length) {
|
|
12817
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12818
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12819
|
+
const message = createBaseClusterReservation_Task();
|
|
12820
|
+
while (reader.pos < end) {
|
|
12821
|
+
const tag = reader.uint32();
|
|
12822
|
+
switch (tag >>> 3) {
|
|
12823
|
+
case 1: {
|
|
12824
|
+
if (tag !== 10) {
|
|
12825
|
+
break;
|
|
12826
|
+
}
|
|
12827
|
+
message.taskId = reader.string();
|
|
12828
|
+
continue;
|
|
12829
|
+
}
|
|
12830
|
+
case 2: {
|
|
12831
|
+
if (tag !== 16) {
|
|
12832
|
+
break;
|
|
12833
|
+
}
|
|
12834
|
+
message.clusterRank = reader.int32();
|
|
12835
|
+
continue;
|
|
12836
|
+
}
|
|
12837
|
+
case 3: {
|
|
12838
|
+
if (tag !== 26) {
|
|
12839
|
+
break;
|
|
12840
|
+
}
|
|
12841
|
+
message.appId = reader.string();
|
|
12842
|
+
continue;
|
|
12843
|
+
}
|
|
12844
|
+
case 4: {
|
|
12845
|
+
if (tag !== 34) {
|
|
12846
|
+
break;
|
|
12847
|
+
}
|
|
12848
|
+
message.functionId = reader.string();
|
|
12849
|
+
continue;
|
|
12850
|
+
}
|
|
12851
|
+
}
|
|
12852
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12853
|
+
break;
|
|
12854
|
+
}
|
|
12855
|
+
reader.skip(tag & 7);
|
|
12856
|
+
}
|
|
12857
|
+
return message;
|
|
12858
|
+
},
|
|
12859
|
+
fromJSON(object) {
|
|
12860
|
+
return {
|
|
12861
|
+
taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
|
|
12862
|
+
clusterRank: isSet5(object.clusterRank) ? globalThis.Number(object.clusterRank) : 0,
|
|
12863
|
+
appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
|
|
12864
|
+
functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
|
|
12865
|
+
};
|
|
12866
|
+
},
|
|
12867
|
+
toJSON(message) {
|
|
12868
|
+
const obj = {};
|
|
12869
|
+
if (message.taskId !== "") {
|
|
12870
|
+
obj.taskId = message.taskId;
|
|
12871
|
+
}
|
|
12872
|
+
if (message.clusterRank !== 0) {
|
|
12873
|
+
obj.clusterRank = Math.round(message.clusterRank);
|
|
12874
|
+
}
|
|
12875
|
+
if (message.appId !== "") {
|
|
12876
|
+
obj.appId = message.appId;
|
|
12877
|
+
}
|
|
12878
|
+
if (message.functionId !== "") {
|
|
12879
|
+
obj.functionId = message.functionId;
|
|
12880
|
+
}
|
|
12881
|
+
return obj;
|
|
12882
|
+
},
|
|
12883
|
+
create(base) {
|
|
12884
|
+
return ClusterReservation_Task.fromPartial(base ?? {});
|
|
12885
|
+
},
|
|
12886
|
+
fromPartial(object) {
|
|
12887
|
+
const message = createBaseClusterReservation_Task();
|
|
12888
|
+
message.taskId = object.taskId ?? "";
|
|
12889
|
+
message.clusterRank = object.clusterRank ?? 0;
|
|
12890
|
+
message.appId = object.appId ?? "";
|
|
12891
|
+
message.functionId = object.functionId ?? "";
|
|
12892
|
+
return message;
|
|
12893
|
+
}
|
|
12894
|
+
};
|
|
12895
|
+
function createBaseClusterReservationListRequest() {
|
|
12896
|
+
return {};
|
|
12897
|
+
}
|
|
12898
|
+
var ClusterReservationListRequest = {
|
|
12899
|
+
encode(_, writer = new BinaryWriter()) {
|
|
12900
|
+
return writer;
|
|
12901
|
+
},
|
|
12902
|
+
decode(input, length) {
|
|
12903
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12904
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12905
|
+
const message = createBaseClusterReservationListRequest();
|
|
12906
|
+
while (reader.pos < end) {
|
|
12907
|
+
const tag = reader.uint32();
|
|
12908
|
+
switch (tag >>> 3) {
|
|
12909
|
+
}
|
|
12910
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12911
|
+
break;
|
|
12912
|
+
}
|
|
12913
|
+
reader.skip(tag & 7);
|
|
12914
|
+
}
|
|
12915
|
+
return message;
|
|
12916
|
+
},
|
|
12917
|
+
fromJSON(_) {
|
|
12918
|
+
return {};
|
|
12919
|
+
},
|
|
12920
|
+
toJSON(_) {
|
|
12921
|
+
const obj = {};
|
|
12922
|
+
return obj;
|
|
12923
|
+
},
|
|
12924
|
+
create(base) {
|
|
12925
|
+
return ClusterReservationListRequest.fromPartial(base ?? {});
|
|
12926
|
+
},
|
|
12927
|
+
fromPartial(_) {
|
|
12928
|
+
const message = createBaseClusterReservationListRequest();
|
|
12929
|
+
return message;
|
|
12930
|
+
}
|
|
12931
|
+
};
|
|
12932
|
+
function createBaseClusterReservationListResponse() {
|
|
12933
|
+
return { reservations: [] };
|
|
12934
|
+
}
|
|
12935
|
+
var ClusterReservationListResponse = {
|
|
12936
|
+
encode(message, writer = new BinaryWriter()) {
|
|
12937
|
+
for (const v of message.reservations) {
|
|
12938
|
+
ClusterReservation.encode(v, writer.uint32(10).fork()).join();
|
|
12939
|
+
}
|
|
12940
|
+
return writer;
|
|
12941
|
+
},
|
|
12942
|
+
decode(input, length) {
|
|
12943
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12944
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
12945
|
+
const message = createBaseClusterReservationListResponse();
|
|
12946
|
+
while (reader.pos < end) {
|
|
12947
|
+
const tag = reader.uint32();
|
|
12948
|
+
switch (tag >>> 3) {
|
|
12949
|
+
case 1: {
|
|
12950
|
+
if (tag !== 10) {
|
|
12951
|
+
break;
|
|
12952
|
+
}
|
|
12953
|
+
message.reservations.push(ClusterReservation.decode(reader, reader.uint32()));
|
|
12954
|
+
continue;
|
|
12955
|
+
}
|
|
12956
|
+
}
|
|
12957
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
12958
|
+
break;
|
|
12959
|
+
}
|
|
12960
|
+
reader.skip(tag & 7);
|
|
12961
|
+
}
|
|
12962
|
+
return message;
|
|
12963
|
+
},
|
|
12964
|
+
fromJSON(object) {
|
|
12965
|
+
return {
|
|
12966
|
+
reservations: globalThis.Array.isArray(object?.reservations) ? object.reservations.map((e) => ClusterReservation.fromJSON(e)) : []
|
|
12967
|
+
};
|
|
12968
|
+
},
|
|
12969
|
+
toJSON(message) {
|
|
12970
|
+
const obj = {};
|
|
12971
|
+
if (message.reservations?.length) {
|
|
12972
|
+
obj.reservations = message.reservations.map((e) => ClusterReservation.toJSON(e));
|
|
12973
|
+
}
|
|
12974
|
+
return obj;
|
|
12975
|
+
},
|
|
12976
|
+
create(base) {
|
|
12977
|
+
return ClusterReservationListResponse.fromPartial(base ?? {});
|
|
12978
|
+
},
|
|
12979
|
+
fromPartial(object) {
|
|
12980
|
+
const message = createBaseClusterReservationListResponse();
|
|
12981
|
+
message.reservations = object.reservations?.map((e) => ClusterReservation.fromPartial(e)) || [];
|
|
12982
|
+
return message;
|
|
12983
|
+
}
|
|
12984
|
+
};
|
|
12604
12985
|
function createBaseClusterStats() {
|
|
12605
12986
|
return { appId: "", taskIds: [], clusterId: "", startedAt: 0 };
|
|
12606
12987
|
}
|
|
@@ -17804,7 +18185,8 @@ function createBaseEndpointCreateRequest() {
|
|
|
17804
18185
|
environmentName: "",
|
|
17805
18186
|
unauthenticated: false,
|
|
17806
18187
|
servingMode: 0,
|
|
17807
|
-
sharedEndpointNoticeAcknowledged: false
|
|
18188
|
+
sharedEndpointNoticeAcknowledged: false,
|
|
18189
|
+
recipeId: void 0
|
|
17808
18190
|
};
|
|
17809
18191
|
}
|
|
17810
18192
|
var EndpointCreateRequest = {
|
|
@@ -17846,6 +18228,9 @@ var EndpointCreateRequest = {
|
|
|
17846
18228
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
17847
18229
|
writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
|
|
17848
18230
|
}
|
|
18231
|
+
if (message.recipeId !== void 0) {
|
|
18232
|
+
writer.uint32(98).string(message.recipeId);
|
|
18233
|
+
}
|
|
17849
18234
|
return writer;
|
|
17850
18235
|
},
|
|
17851
18236
|
decode(input, length) {
|
|
@@ -17946,6 +18331,13 @@ var EndpointCreateRequest = {
|
|
|
17946
18331
|
message.sharedEndpointNoticeAcknowledged = reader.bool();
|
|
17947
18332
|
continue;
|
|
17948
18333
|
}
|
|
18334
|
+
case 12: {
|
|
18335
|
+
if (tag !== 98) {
|
|
18336
|
+
break;
|
|
18337
|
+
}
|
|
18338
|
+
message.recipeId = reader.string();
|
|
18339
|
+
continue;
|
|
18340
|
+
}
|
|
17949
18341
|
}
|
|
17950
18342
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17951
18343
|
break;
|
|
@@ -17966,7 +18358,8 @@ var EndpointCreateRequest = {
|
|
|
17966
18358
|
environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
|
|
17967
18359
|
unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
|
|
17968
18360
|
servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
|
|
17969
|
-
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
|
|
18361
|
+
sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false,
|
|
18362
|
+
recipeId: isSet5(object.recipeId) ? globalThis.String(object.recipeId) : void 0
|
|
17970
18363
|
};
|
|
17971
18364
|
},
|
|
17972
18365
|
toJSON(message) {
|
|
@@ -18004,6 +18397,9 @@ var EndpointCreateRequest = {
|
|
|
18004
18397
|
if (message.sharedEndpointNoticeAcknowledged !== false) {
|
|
18005
18398
|
obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
|
|
18006
18399
|
}
|
|
18400
|
+
if (message.recipeId !== void 0) {
|
|
18401
|
+
obj.recipeId = message.recipeId;
|
|
18402
|
+
}
|
|
18007
18403
|
return obj;
|
|
18008
18404
|
},
|
|
18009
18405
|
create(base) {
|
|
@@ -18022,6 +18418,7 @@ var EndpointCreateRequest = {
|
|
|
18022
18418
|
message.unauthenticated = object.unauthenticated ?? false;
|
|
18023
18419
|
message.servingMode = object.servingMode ?? 0;
|
|
18024
18420
|
message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
|
|
18421
|
+
message.recipeId = object.recipeId ?? void 0;
|
|
18025
18422
|
return message;
|
|
18026
18423
|
}
|
|
18027
18424
|
};
|
|
@@ -61603,6 +62000,14 @@ var ModalClientDefinition = {
|
|
|
61603
62000
|
responseStream: false,
|
|
61604
62001
|
options: {}
|
|
61605
62002
|
},
|
|
62003
|
+
clusterReservationList: {
|
|
62004
|
+
name: "ClusterReservationList",
|
|
62005
|
+
requestType: ClusterReservationListRequest,
|
|
62006
|
+
requestStream: false,
|
|
62007
|
+
responseType: ClusterReservationListResponse,
|
|
62008
|
+
responseStream: false,
|
|
62009
|
+
options: {}
|
|
62010
|
+
},
|
|
61606
62011
|
/** Container */
|
|
61607
62012
|
containerCheckpoint: {
|
|
61608
62013
|
name: "ContainerCheckpoint",
|
|
@@ -64092,7 +64497,7 @@ var SecretService = class {
|
|
|
64092
64497
|
"secret_name",
|
|
64093
64498
|
name
|
|
64094
64499
|
);
|
|
64095
|
-
return new Secret(resp.secretId, name
|
|
64500
|
+
return new Secret(resp.secretId, name);
|
|
64096
64501
|
} catch (err) {
|
|
64097
64502
|
if (err instanceof ClientError2 && err.code === Status2.NOT_FOUND)
|
|
64098
64503
|
throw new NotFoundError(err.details);
|
|
@@ -64191,20 +64596,16 @@ var Secret = class {
|
|
|
64191
64596
|
// constructed already-hydrated (e.g. from fromName), and not consulted again
|
|
64192
64597
|
// once secretId is set.
|
|
64193
64598
|
#hydrator;
|
|
64194
|
-
// Names of the env vars a server-side Secret defines, as reported by the
|
|
64195
|
-
// control plane on fromName. Undefined when unknown.
|
|
64196
|
-
#keys;
|
|
64197
64599
|
// Caches the single in-flight (or successfully completed) hydration so the
|
|
64198
64600
|
// ephemeral Secret is created at most once, even if multiple callers hydrate
|
|
64199
64601
|
// the same Secret concurrently. Cleared on failure so a transient error
|
|
64200
64602
|
// doesn't permanently break the Secret; subsequent calls can retry.
|
|
64201
64603
|
#hydratePromise;
|
|
64202
64604
|
/** @ignore */
|
|
64203
|
-
constructor(secretId, name, hydrator
|
|
64605
|
+
constructor(secretId, name, hydrator) {
|
|
64204
64606
|
this.#secretId = secretId;
|
|
64205
64607
|
this.name = name;
|
|
64206
64608
|
this.#hydrator = hydrator;
|
|
64207
|
-
this.#keys = keys !== void 0 ? new Set(keys) : void 0;
|
|
64208
64609
|
}
|
|
64209
64610
|
/** The ID of the server-side Secret, or an empty string if not yet hydrated. */
|
|
64210
64611
|
get secretId() {
|
|
@@ -64220,16 +64621,6 @@ var Secret = class {
|
|
|
64220
64621
|
get _hydrator() {
|
|
64221
64622
|
return this.#hydrator;
|
|
64222
64623
|
}
|
|
64223
|
-
/**
|
|
64224
|
-
* Names of the env vars this server-side Secret defines, or `undefined` if
|
|
64225
|
-
* unknown (e.g. for lazy fromObject Secrets or Secrets constructed by id).
|
|
64226
|
-
*
|
|
64227
|
-
* @internal
|
|
64228
|
-
* @hidden
|
|
64229
|
-
*/
|
|
64230
|
-
get _keys() {
|
|
64231
|
-
return this.#keys;
|
|
64232
|
-
}
|
|
64233
64624
|
/**
|
|
64234
64625
|
* Lazily create the ephemeral server-side Secret backing a fromObject Secret
|
|
64235
64626
|
* and populate {@link Secret#secretId secretId}. A no-op once secretId is set
|
|
@@ -64289,21 +64680,39 @@ function collectSecretIds(secrets) {
|
|
|
64289
64680
|
return secret.secretId;
|
|
64290
64681
|
});
|
|
64291
64682
|
}
|
|
64292
|
-
function
|
|
64293
|
-
|
|
64294
|
-
|
|
64295
|
-
|
|
64683
|
+
function resolvableSecrets(secrets) {
|
|
64684
|
+
return secrets.filter(
|
|
64685
|
+
(secret) => secret == null || secretEnvDictHydrator(secret) === void 0
|
|
64686
|
+
);
|
|
64687
|
+
}
|
|
64688
|
+
function secretSources(secrets, env) {
|
|
64689
|
+
const sources = [];
|
|
64690
|
+
secrets.forEach((secret, i) => {
|
|
64296
64691
|
const hydrator = secret != null ? secretEnvDictHydrator(secret) : void 0;
|
|
64297
64692
|
if (hydrator !== void 0) {
|
|
64298
|
-
Object.
|
|
64299
|
-
|
|
64300
|
-
|
|
64301
|
-
|
|
64693
|
+
if (Object.keys(hydrator.envDict).length > 0) {
|
|
64694
|
+
sources.push(
|
|
64695
|
+
SecretSource.create({
|
|
64696
|
+
env: StringMap.create({ contents: hydrator.envDict })
|
|
64697
|
+
})
|
|
64698
|
+
);
|
|
64302
64699
|
}
|
|
64303
|
-
|
|
64700
|
+
return;
|
|
64701
|
+
}
|
|
64702
|
+
if (secret == null) {
|
|
64703
|
+
throw new InvalidError(`secret at index ${i} must not be null`);
|
|
64704
|
+
}
|
|
64705
|
+
if (secret.secretId === "") {
|
|
64706
|
+
throw new InvalidError(`secret at index ${i} has not been hydrated`);
|
|
64304
64707
|
}
|
|
64708
|
+
sources.push(SecretSource.create({ secretId: secret.secretId }));
|
|
64709
|
+
});
|
|
64710
|
+
if (env && Object.keys(env).length > 0) {
|
|
64711
|
+
sources.push(
|
|
64712
|
+
SecretSource.create({ env: StringMap.create({ contents: env }) })
|
|
64713
|
+
);
|
|
64305
64714
|
}
|
|
64306
|
-
return
|
|
64715
|
+
return sources;
|
|
64307
64716
|
}
|
|
64308
64717
|
|
|
64309
64718
|
// src/image.ts
|
|
@@ -71744,16 +72153,14 @@ var SidecarService = class {
|
|
|
71744
72153
|
}
|
|
71745
72154
|
}
|
|
71746
72155
|
validateEnvVarKeys(params?.env ?? {});
|
|
71747
|
-
const
|
|
71748
|
-
params?.secrets ?? []
|
|
71749
|
-
);
|
|
71750
|
-
Object.assign(envDict, params?.env ?? {});
|
|
72156
|
+
const resolvable = resolvableSecrets(params?.secrets ?? []);
|
|
71751
72157
|
await hydrateSandboxSecrets(
|
|
71752
72158
|
this.#access.client,
|
|
71753
|
-
|
|
72159
|
+
resolvable,
|
|
71754
72160
|
params?.cloudBucketMounts
|
|
71755
72161
|
);
|
|
71756
|
-
const secretIds = collectSecretIds(
|
|
72162
|
+
const secretIds = collectSecretIds(resolvable);
|
|
72163
|
+
const sources = secretSources(params?.secrets ?? [], params?.env);
|
|
71757
72164
|
const volumeMounts = buildSidecarVolumeMounts(params?.volumes);
|
|
71758
72165
|
const cloudBucketMounts = buildCloudBucketMountProtos(
|
|
71759
72166
|
params?.cloudBucketMounts
|
|
@@ -71767,7 +72174,6 @@ var SidecarService = class {
|
|
|
71767
72174
|
let resp;
|
|
71768
72175
|
try {
|
|
71769
72176
|
if (viaControlPlane) {
|
|
71770
|
-
const ephemeralSecrets = Object.keys(envDict).length > 0 ? StringMap.create({ contents: envDict }) : void 0;
|
|
71771
72177
|
resp = await this.#access.client.cpClient.sandboxContainerCreateV2(
|
|
71772
72178
|
SandboxContainerCreateV2Request.create({
|
|
71773
72179
|
sandboxId: this.#access.sandboxId,
|
|
@@ -71787,7 +72193,7 @@ var SidecarService = class {
|
|
|
71787
72193
|
memoryMb: params.experimentalMemoryReserveConsumeMiB
|
|
71788
72194
|
}) : void 0
|
|
71789
72195
|
}),
|
|
71790
|
-
|
|
72196
|
+
secretSources: sources
|
|
71791
72197
|
})
|
|
71792
72198
|
);
|
|
71793
72199
|
} else {
|
|
@@ -71798,9 +72204,8 @@ var SidecarService = class {
|
|
|
71798
72204
|
containerName: name,
|
|
71799
72205
|
imageId: image.imageId,
|
|
71800
72206
|
args: command,
|
|
71801
|
-
env: envDict,
|
|
71802
72207
|
workdir: params?.workdir ?? "",
|
|
71803
|
-
|
|
72208
|
+
secretSources: sources,
|
|
71804
72209
|
volumeMounts,
|
|
71805
72210
|
networkAccess,
|
|
71806
72211
|
ptyInfo,
|
|
@@ -72595,16 +73000,15 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
|
|
|
72595
73000
|
}
|
|
72596
73001
|
});
|
|
72597
73002
|
}
|
|
72598
|
-
async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}) {
|
|
73003
|
+
async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}, secretSources2 = []) {
|
|
72599
73004
|
if (params.gpu) {
|
|
72600
73005
|
throw new Error("GPUs are not supported by experimentalCreate");
|
|
72601
73006
|
}
|
|
72602
73007
|
const req = await buildSandboxCreateRequestProto(appId, imageId, params);
|
|
72603
|
-
const ephemeralSecrets = params.env && Object.keys(params.env).length > 0 ? StringMap.create({ contents: params.env }) : void 0;
|
|
72604
73008
|
return SandboxCreateV2Request.create({
|
|
72605
73009
|
appId: req.appId,
|
|
72606
73010
|
definition: req.definition,
|
|
72607
|
-
|
|
73011
|
+
secretSources: secretSources2,
|
|
72608
73012
|
tags: req.tags
|
|
72609
73013
|
});
|
|
72610
73014
|
}
|
|
@@ -72688,27 +73092,17 @@ var SandboxService = class {
|
|
|
72688
73092
|
async experimentalCreate(app, image, params = {}) {
|
|
72689
73093
|
await image.build(app);
|
|
72690
73094
|
validateEnvVarKeys(params.env ?? {});
|
|
72691
|
-
const
|
|
72692
|
-
params.secrets ?? []
|
|
72693
|
-
);
|
|
72694
|
-
Object.assign(envDict, params.env ?? {});
|
|
73095
|
+
const resolvable = resolvableSecrets(params.secrets ?? []);
|
|
72695
73096
|
await hydrateSandboxSecrets(
|
|
72696
73097
|
this.#client,
|
|
72697
|
-
[
|
|
72698
|
-
...resolvableSecrets,
|
|
72699
|
-
...params.experimentalOutboundPolicy?._secrets() ?? []
|
|
72700
|
-
],
|
|
73098
|
+
[...resolvable, ...params.experimentalOutboundPolicy?._secrets() ?? []],
|
|
72701
73099
|
params.cloudBucketMounts
|
|
72702
73100
|
);
|
|
72703
|
-
const mergedParams = {
|
|
72704
|
-
...params,
|
|
72705
|
-
secrets: resolvableSecrets,
|
|
72706
|
-
env: envDict
|
|
72707
|
-
};
|
|
72708
73101
|
const createReq = await buildSandboxCreateV2RequestProto(
|
|
72709
73102
|
app.appId,
|
|
72710
73103
|
image.imageId,
|
|
72711
|
-
|
|
73104
|
+
{ ...params, secrets: resolvable },
|
|
73105
|
+
secretSources(params.secrets ?? [], params.env)
|
|
72712
73106
|
);
|
|
72713
73107
|
let createResp;
|
|
72714
73108
|
try {
|
|
@@ -73034,7 +73428,6 @@ function buildTaskExecStartRequestProto(taskId, execId, command, params, contain
|
|
|
73034
73428
|
);
|
|
73035
73429
|
}
|
|
73036
73430
|
validateWorkdir(params?.workdir);
|
|
73037
|
-
const secretIds = (params?.secrets || []).map((secret) => secret.secretId);
|
|
73038
73431
|
const stdout = params?.stdout ?? "pipe";
|
|
73039
73432
|
const stderr = params?.stderr ?? "pipe";
|
|
73040
73433
|
let stdoutConfig;
|
|
@@ -73065,8 +73458,7 @@ function buildTaskExecStartRequestProto(taskId, execId, command, params, contain
|
|
|
73065
73458
|
stderrConfig,
|
|
73066
73459
|
timeoutSecs: params?.timeoutMs ? params.timeoutMs / 1e3 : void 0,
|
|
73067
73460
|
workdir: params?.workdir,
|
|
73068
|
-
|
|
73069
|
-
env: params?.env ?? {},
|
|
73461
|
+
secretSources: secretSources(params?.secrets ?? [], params?.env),
|
|
73070
73462
|
ptyInfo,
|
|
73071
73463
|
runtimeDebug: false,
|
|
73072
73464
|
containerId: containerId ?? ""
|
|
@@ -73339,23 +73731,17 @@ var Sandbox2 = class {
|
|
|
73339
73731
|
this.#ensureAttached();
|
|
73340
73732
|
validateExecArgs(command);
|
|
73341
73733
|
validateEnvVarKeys(params?.env ?? {});
|
|
73342
|
-
|
|
73343
|
-
|
|
73734
|
+
await hydrateSecrets(
|
|
73735
|
+
this.#client,
|
|
73736
|
+
resolvableSecrets(params?.secrets ?? [])
|
|
73344
73737
|
);
|
|
73345
|
-
Object.assign(envDict, params?.env ?? {});
|
|
73346
|
-
await hydrateSecrets(this.#client, resolvableSecrets);
|
|
73347
|
-
const execParams = {
|
|
73348
|
-
...params,
|
|
73349
|
-
env: envDict,
|
|
73350
|
-
secrets: resolvableSecrets
|
|
73351
|
-
};
|
|
73352
73738
|
const [taskId, commandRouterClient] = await this.#getCommandRouter();
|
|
73353
73739
|
const execId = uuidv42();
|
|
73354
73740
|
const request = buildTaskExecStartRequestProto(
|
|
73355
73741
|
taskId,
|
|
73356
73742
|
execId,
|
|
73357
73743
|
command,
|
|
73358
|
-
|
|
73744
|
+
params,
|
|
73359
73745
|
containerId
|
|
73360
73746
|
);
|
|
73361
73747
|
await commandRouterClient.execStart(request);
|
|
@@ -74543,7 +74929,7 @@ var AuthTokenManager = class {
|
|
|
74543
74929
|
};
|
|
74544
74930
|
|
|
74545
74931
|
// src/version.ts
|
|
74546
|
-
var SDK_VERSION = "0.11.1-dev.
|
|
74932
|
+
var SDK_VERSION = "0.11.1-dev.9";
|
|
74547
74933
|
function getSDKVersion() {
|
|
74548
74934
|
return SDK_VERSION;
|
|
74549
74935
|
}
|