modal 0.3.22 → 0.3.24
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 +787 -135
- package/dist/index.d.cts +17 -3
- package/dist/index.d.ts +17 -3
- package/dist/index.js +787 -135
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1632,6 +1632,9 @@ function dataFormatFromJSON(object) {
|
|
|
1632
1632
|
case 3:
|
|
1633
1633
|
case "DATA_FORMAT_GENERATOR_DONE":
|
|
1634
1634
|
return 3 /* DATA_FORMAT_GENERATOR_DONE */;
|
|
1635
|
+
case 4:
|
|
1636
|
+
case "DATA_FORMAT_CBOR":
|
|
1637
|
+
return 4 /* DATA_FORMAT_CBOR */;
|
|
1635
1638
|
case -1:
|
|
1636
1639
|
case "UNRECOGNIZED":
|
|
1637
1640
|
default:
|
|
@@ -1648,6 +1651,8 @@ function dataFormatToJSON(object) {
|
|
|
1648
1651
|
return "DATA_FORMAT_ASGI";
|
|
1649
1652
|
case 3 /* DATA_FORMAT_GENERATOR_DONE */:
|
|
1650
1653
|
return "DATA_FORMAT_GENERATOR_DONE";
|
|
1654
|
+
case 4 /* DATA_FORMAT_CBOR */:
|
|
1655
|
+
return "DATA_FORMAT_CBOR";
|
|
1651
1656
|
case -1 /* UNRECOGNIZED */:
|
|
1652
1657
|
default:
|
|
1653
1658
|
return "UNRECOGNIZED";
|
|
@@ -14786,7 +14791,9 @@ function createBaseFunctionMessage() {
|
|
|
14786
14791
|
flashServiceUrls: [],
|
|
14787
14792
|
flashServiceLabel: "",
|
|
14788
14793
|
enableGpuSnapshot: false,
|
|
14789
|
-
startupTimeoutSecs: 0
|
|
14794
|
+
startupTimeoutSecs: 0,
|
|
14795
|
+
supportedInputFormats: [],
|
|
14796
|
+
supportedOutputFormats: []
|
|
14790
14797
|
};
|
|
14791
14798
|
}
|
|
14792
14799
|
var FunctionMessage = {
|
|
@@ -15010,6 +15017,16 @@ var FunctionMessage = {
|
|
|
15010
15017
|
if (message.startupTimeoutSecs !== 0) {
|
|
15011
15018
|
writer.uint32(688).uint32(message.startupTimeoutSecs);
|
|
15012
15019
|
}
|
|
15020
|
+
writer.uint32(698).fork();
|
|
15021
|
+
for (const v of message.supportedInputFormats) {
|
|
15022
|
+
writer.int32(v);
|
|
15023
|
+
}
|
|
15024
|
+
writer.join();
|
|
15025
|
+
writer.uint32(706).fork();
|
|
15026
|
+
for (const v of message.supportedOutputFormats) {
|
|
15027
|
+
writer.int32(v);
|
|
15028
|
+
}
|
|
15029
|
+
writer.join();
|
|
15013
15030
|
return writer;
|
|
15014
15031
|
},
|
|
15015
15032
|
decode(input, length) {
|
|
@@ -15536,6 +15553,34 @@ var FunctionMessage = {
|
|
|
15536
15553
|
message.startupTimeoutSecs = reader.uint32();
|
|
15537
15554
|
continue;
|
|
15538
15555
|
}
|
|
15556
|
+
case 87: {
|
|
15557
|
+
if (tag === 696) {
|
|
15558
|
+
message.supportedInputFormats.push(reader.int32());
|
|
15559
|
+
continue;
|
|
15560
|
+
}
|
|
15561
|
+
if (tag === 698) {
|
|
15562
|
+
const end2 = reader.uint32() + reader.pos;
|
|
15563
|
+
while (reader.pos < end2) {
|
|
15564
|
+
message.supportedInputFormats.push(reader.int32());
|
|
15565
|
+
}
|
|
15566
|
+
continue;
|
|
15567
|
+
}
|
|
15568
|
+
break;
|
|
15569
|
+
}
|
|
15570
|
+
case 88: {
|
|
15571
|
+
if (tag === 704) {
|
|
15572
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
15573
|
+
continue;
|
|
15574
|
+
}
|
|
15575
|
+
if (tag === 706) {
|
|
15576
|
+
const end2 = reader.uint32() + reader.pos;
|
|
15577
|
+
while (reader.pos < end2) {
|
|
15578
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
15579
|
+
}
|
|
15580
|
+
continue;
|
|
15581
|
+
}
|
|
15582
|
+
break;
|
|
15583
|
+
}
|
|
15539
15584
|
}
|
|
15540
15585
|
if ((tag & 7) === 4 || tag === 0) {
|
|
15541
15586
|
break;
|
|
@@ -15624,7 +15669,9 @@ var FunctionMessage = {
|
|
|
15624
15669
|
flashServiceUrls: globalThis.Array.isArray(object?.flashServiceUrls) ? object.flashServiceUrls.map((e) => globalThis.String(e)) : [],
|
|
15625
15670
|
flashServiceLabel: isSet3(object.flashServiceLabel) ? globalThis.String(object.flashServiceLabel) : "",
|
|
15626
15671
|
enableGpuSnapshot: isSet3(object.enableGpuSnapshot) ? globalThis.Boolean(object.enableGpuSnapshot) : false,
|
|
15627
|
-
startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0
|
|
15672
|
+
startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0,
|
|
15673
|
+
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
15674
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
15628
15675
|
};
|
|
15629
15676
|
},
|
|
15630
15677
|
toJSON(message) {
|
|
@@ -15860,6 +15907,12 @@ var FunctionMessage = {
|
|
|
15860
15907
|
if (message.startupTimeoutSecs !== 0) {
|
|
15861
15908
|
obj.startupTimeoutSecs = Math.round(message.startupTimeoutSecs);
|
|
15862
15909
|
}
|
|
15910
|
+
if (message.supportedInputFormats?.length) {
|
|
15911
|
+
obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
|
|
15912
|
+
}
|
|
15913
|
+
if (message.supportedOutputFormats?.length) {
|
|
15914
|
+
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
15915
|
+
}
|
|
15863
15916
|
return obj;
|
|
15864
15917
|
},
|
|
15865
15918
|
create(base) {
|
|
@@ -15953,6 +16006,8 @@ var FunctionMessage = {
|
|
|
15953
16006
|
message.flashServiceLabel = object.flashServiceLabel ?? "";
|
|
15954
16007
|
message.enableGpuSnapshot = object.enableGpuSnapshot ?? false;
|
|
15955
16008
|
message.startupTimeoutSecs = object.startupTimeoutSecs ?? 0;
|
|
16009
|
+
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
16010
|
+
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
15956
16011
|
return message;
|
|
15957
16012
|
}
|
|
15958
16013
|
};
|
|
@@ -17461,7 +17516,9 @@ function createBaseFunctionData() {
|
|
|
17461
17516
|
experimentalOptions: {},
|
|
17462
17517
|
flashServiceUrls: [],
|
|
17463
17518
|
flashServiceLabel: "",
|
|
17464
|
-
startupTimeoutSecs: 0
|
|
17519
|
+
startupTimeoutSecs: 0,
|
|
17520
|
+
supportedInputFormats: [],
|
|
17521
|
+
supportedOutputFormats: []
|
|
17465
17522
|
};
|
|
17466
17523
|
}
|
|
17467
17524
|
var FunctionData = {
|
|
@@ -17571,6 +17628,16 @@ var FunctionData = {
|
|
|
17571
17628
|
if (message.startupTimeoutSecs !== 0) {
|
|
17572
17629
|
writer.uint32(288).uint32(message.startupTimeoutSecs);
|
|
17573
17630
|
}
|
|
17631
|
+
writer.uint32(298).fork();
|
|
17632
|
+
for (const v of message.supportedInputFormats) {
|
|
17633
|
+
writer.int32(v);
|
|
17634
|
+
}
|
|
17635
|
+
writer.join();
|
|
17636
|
+
writer.uint32(306).fork();
|
|
17637
|
+
for (const v of message.supportedOutputFormats) {
|
|
17638
|
+
writer.int32(v);
|
|
17639
|
+
}
|
|
17640
|
+
writer.join();
|
|
17574
17641
|
return writer;
|
|
17575
17642
|
},
|
|
17576
17643
|
decode(input, length) {
|
|
@@ -17831,6 +17898,34 @@ var FunctionData = {
|
|
|
17831
17898
|
message.startupTimeoutSecs = reader.uint32();
|
|
17832
17899
|
continue;
|
|
17833
17900
|
}
|
|
17901
|
+
case 37: {
|
|
17902
|
+
if (tag === 296) {
|
|
17903
|
+
message.supportedInputFormats.push(reader.int32());
|
|
17904
|
+
continue;
|
|
17905
|
+
}
|
|
17906
|
+
if (tag === 298) {
|
|
17907
|
+
const end2 = reader.uint32() + reader.pos;
|
|
17908
|
+
while (reader.pos < end2) {
|
|
17909
|
+
message.supportedInputFormats.push(reader.int32());
|
|
17910
|
+
}
|
|
17911
|
+
continue;
|
|
17912
|
+
}
|
|
17913
|
+
break;
|
|
17914
|
+
}
|
|
17915
|
+
case 38: {
|
|
17916
|
+
if (tag === 304) {
|
|
17917
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
17918
|
+
continue;
|
|
17919
|
+
}
|
|
17920
|
+
if (tag === 306) {
|
|
17921
|
+
const end2 = reader.uint32() + reader.pos;
|
|
17922
|
+
while (reader.pos < end2) {
|
|
17923
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
17924
|
+
}
|
|
17925
|
+
continue;
|
|
17926
|
+
}
|
|
17927
|
+
break;
|
|
17928
|
+
}
|
|
17834
17929
|
}
|
|
17835
17930
|
if ((tag & 7) === 4 || tag === 0) {
|
|
17836
17931
|
break;
|
|
@@ -17881,7 +17976,9 @@ var FunctionData = {
|
|
|
17881
17976
|
}, {}) : {},
|
|
17882
17977
|
flashServiceUrls: globalThis.Array.isArray(object?.flashServiceUrls) ? object.flashServiceUrls.map((e) => globalThis.String(e)) : [],
|
|
17883
17978
|
flashServiceLabel: isSet3(object.flashServiceLabel) ? globalThis.String(object.flashServiceLabel) : "",
|
|
17884
|
-
startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0
|
|
17979
|
+
startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0,
|
|
17980
|
+
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
17981
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
17885
17982
|
};
|
|
17886
17983
|
},
|
|
17887
17984
|
toJSON(message) {
|
|
@@ -18003,6 +18100,12 @@ var FunctionData = {
|
|
|
18003
18100
|
if (message.startupTimeoutSecs !== 0) {
|
|
18004
18101
|
obj.startupTimeoutSecs = Math.round(message.startupTimeoutSecs);
|
|
18005
18102
|
}
|
|
18103
|
+
if (message.supportedInputFormats?.length) {
|
|
18104
|
+
obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
|
|
18105
|
+
}
|
|
18106
|
+
if (message.supportedOutputFormats?.length) {
|
|
18107
|
+
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
18108
|
+
}
|
|
18006
18109
|
return obj;
|
|
18007
18110
|
},
|
|
18008
18111
|
create(base) {
|
|
@@ -18058,6 +18161,8 @@ var FunctionData = {
|
|
|
18058
18161
|
message.flashServiceUrls = object.flashServiceUrls?.map((e) => e) || [];
|
|
18059
18162
|
message.flashServiceLabel = object.flashServiceLabel ?? "";
|
|
18060
18163
|
message.startupTimeoutSecs = object.startupTimeoutSecs ?? 0;
|
|
18164
|
+
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
18165
|
+
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
18061
18166
|
return message;
|
|
18062
18167
|
}
|
|
18063
18168
|
};
|
|
@@ -19788,7 +19893,9 @@ function createBaseFunctionHandleMetadata() {
|
|
|
19788
19893
|
inputPlaneUrl: void 0,
|
|
19789
19894
|
inputPlaneRegion: void 0,
|
|
19790
19895
|
maxObjectSizeBytes: void 0,
|
|
19791
|
-
ExperimentalFlashUrls: []
|
|
19896
|
+
ExperimentalFlashUrls: [],
|
|
19897
|
+
supportedInputFormats: [],
|
|
19898
|
+
supportedOutputFormats: []
|
|
19792
19899
|
};
|
|
19793
19900
|
}
|
|
19794
19901
|
var FunctionHandleMetadata = {
|
|
@@ -19835,6 +19942,16 @@ var FunctionHandleMetadata = {
|
|
|
19835
19942
|
for (const v of message.ExperimentalFlashUrls) {
|
|
19836
19943
|
writer.uint32(394).string(v);
|
|
19837
19944
|
}
|
|
19945
|
+
writer.uint32(402).fork();
|
|
19946
|
+
for (const v of message.supportedInputFormats) {
|
|
19947
|
+
writer.int32(v);
|
|
19948
|
+
}
|
|
19949
|
+
writer.join();
|
|
19950
|
+
writer.uint32(410).fork();
|
|
19951
|
+
for (const v of message.supportedOutputFormats) {
|
|
19952
|
+
writer.int32(v);
|
|
19953
|
+
}
|
|
19954
|
+
writer.join();
|
|
19838
19955
|
return writer;
|
|
19839
19956
|
},
|
|
19840
19957
|
decode(input, length) {
|
|
@@ -19945,6 +20062,34 @@ var FunctionHandleMetadata = {
|
|
|
19945
20062
|
message.ExperimentalFlashUrls.push(reader.string());
|
|
19946
20063
|
continue;
|
|
19947
20064
|
}
|
|
20065
|
+
case 50: {
|
|
20066
|
+
if (tag === 400) {
|
|
20067
|
+
message.supportedInputFormats.push(reader.int32());
|
|
20068
|
+
continue;
|
|
20069
|
+
}
|
|
20070
|
+
if (tag === 402) {
|
|
20071
|
+
const end2 = reader.uint32() + reader.pos;
|
|
20072
|
+
while (reader.pos < end2) {
|
|
20073
|
+
message.supportedInputFormats.push(reader.int32());
|
|
20074
|
+
}
|
|
20075
|
+
continue;
|
|
20076
|
+
}
|
|
20077
|
+
break;
|
|
20078
|
+
}
|
|
20079
|
+
case 51: {
|
|
20080
|
+
if (tag === 408) {
|
|
20081
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
20082
|
+
continue;
|
|
20083
|
+
}
|
|
20084
|
+
if (tag === 410) {
|
|
20085
|
+
const end2 = reader.uint32() + reader.pos;
|
|
20086
|
+
while (reader.pos < end2) {
|
|
20087
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
20088
|
+
}
|
|
20089
|
+
continue;
|
|
20090
|
+
}
|
|
20091
|
+
break;
|
|
20092
|
+
}
|
|
19948
20093
|
}
|
|
19949
20094
|
if ((tag & 7) === 4 || tag === 0) {
|
|
19950
20095
|
break;
|
|
@@ -19974,7 +20119,9 @@ var FunctionHandleMetadata = {
|
|
|
19974
20119
|
inputPlaneUrl: isSet3(object.inputPlaneUrl) ? globalThis.String(object.inputPlaneUrl) : void 0,
|
|
19975
20120
|
inputPlaneRegion: isSet3(object.inputPlaneRegion) ? globalThis.String(object.inputPlaneRegion) : void 0,
|
|
19976
20121
|
maxObjectSizeBytes: isSet3(object.maxObjectSizeBytes) ? globalThis.Number(object.maxObjectSizeBytes) : void 0,
|
|
19977
|
-
ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : []
|
|
20122
|
+
ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : [],
|
|
20123
|
+
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
20124
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
19978
20125
|
};
|
|
19979
20126
|
},
|
|
19980
20127
|
toJSON(message) {
|
|
@@ -20027,6 +20174,12 @@ var FunctionHandleMetadata = {
|
|
|
20027
20174
|
if (message.ExperimentalFlashUrls?.length) {
|
|
20028
20175
|
obj.ExperimentalFlashUrls = message.ExperimentalFlashUrls;
|
|
20029
20176
|
}
|
|
20177
|
+
if (message.supportedInputFormats?.length) {
|
|
20178
|
+
obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
|
|
20179
|
+
}
|
|
20180
|
+
if (message.supportedOutputFormats?.length) {
|
|
20181
|
+
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
20182
|
+
}
|
|
20030
20183
|
return obj;
|
|
20031
20184
|
},
|
|
20032
20185
|
create(base) {
|
|
@@ -20053,6 +20206,8 @@ var FunctionHandleMetadata = {
|
|
|
20053
20206
|
message.inputPlaneRegion = object.inputPlaneRegion ?? void 0;
|
|
20054
20207
|
message.maxObjectSizeBytes = object.maxObjectSizeBytes ?? void 0;
|
|
20055
20208
|
message.ExperimentalFlashUrls = object.ExperimentalFlashUrls?.map((e) => e) || [];
|
|
20209
|
+
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
20210
|
+
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
20056
20211
|
return message;
|
|
20057
20212
|
}
|
|
20058
20213
|
};
|
|
@@ -20860,7 +21015,9 @@ function createBaseFunctionPrecreateRequest() {
|
|
|
20860
21015
|
useFunctionId: "",
|
|
20861
21016
|
useMethodName: "",
|
|
20862
21017
|
methodDefinitions: {},
|
|
20863
|
-
functionSchema: void 0
|
|
21018
|
+
functionSchema: void 0,
|
|
21019
|
+
supportedInputFormats: [],
|
|
21020
|
+
supportedOutputFormats: []
|
|
20864
21021
|
};
|
|
20865
21022
|
}
|
|
20866
21023
|
var FunctionPrecreateRequest = {
|
|
@@ -20892,6 +21049,16 @@ var FunctionPrecreateRequest = {
|
|
|
20892
21049
|
if (message.functionSchema !== void 0) {
|
|
20893
21050
|
FunctionSchema.encode(message.functionSchema, writer.uint32(74).fork()).join();
|
|
20894
21051
|
}
|
|
21052
|
+
writer.uint32(82).fork();
|
|
21053
|
+
for (const v of message.supportedInputFormats) {
|
|
21054
|
+
writer.int32(v);
|
|
21055
|
+
}
|
|
21056
|
+
writer.join();
|
|
21057
|
+
writer.uint32(90).fork();
|
|
21058
|
+
for (const v of message.supportedOutputFormats) {
|
|
21059
|
+
writer.int32(v);
|
|
21060
|
+
}
|
|
21061
|
+
writer.join();
|
|
20895
21062
|
return writer;
|
|
20896
21063
|
},
|
|
20897
21064
|
decode(input, length) {
|
|
@@ -20967,6 +21134,34 @@ var FunctionPrecreateRequest = {
|
|
|
20967
21134
|
message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
|
|
20968
21135
|
continue;
|
|
20969
21136
|
}
|
|
21137
|
+
case 10: {
|
|
21138
|
+
if (tag === 80) {
|
|
21139
|
+
message.supportedInputFormats.push(reader.int32());
|
|
21140
|
+
continue;
|
|
21141
|
+
}
|
|
21142
|
+
if (tag === 82) {
|
|
21143
|
+
const end2 = reader.uint32() + reader.pos;
|
|
21144
|
+
while (reader.pos < end2) {
|
|
21145
|
+
message.supportedInputFormats.push(reader.int32());
|
|
21146
|
+
}
|
|
21147
|
+
continue;
|
|
21148
|
+
}
|
|
21149
|
+
break;
|
|
21150
|
+
}
|
|
21151
|
+
case 11: {
|
|
21152
|
+
if (tag === 88) {
|
|
21153
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
21154
|
+
continue;
|
|
21155
|
+
}
|
|
21156
|
+
if (tag === 90) {
|
|
21157
|
+
const end2 = reader.uint32() + reader.pos;
|
|
21158
|
+
while (reader.pos < end2) {
|
|
21159
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
21160
|
+
}
|
|
21161
|
+
continue;
|
|
21162
|
+
}
|
|
21163
|
+
break;
|
|
21164
|
+
}
|
|
20970
21165
|
}
|
|
20971
21166
|
if ((tag & 7) === 4 || tag === 0) {
|
|
20972
21167
|
break;
|
|
@@ -20988,7 +21183,9 @@ var FunctionPrecreateRequest = {
|
|
|
20988
21183
|
acc[key] = MethodDefinition.fromJSON(value);
|
|
20989
21184
|
return acc;
|
|
20990
21185
|
}, {}) : {},
|
|
20991
|
-
functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0
|
|
21186
|
+
functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
|
|
21187
|
+
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
21188
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
20992
21189
|
};
|
|
20993
21190
|
},
|
|
20994
21191
|
toJSON(message) {
|
|
@@ -21026,6 +21223,12 @@ var FunctionPrecreateRequest = {
|
|
|
21026
21223
|
if (message.functionSchema !== void 0) {
|
|
21027
21224
|
obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
|
|
21028
21225
|
}
|
|
21226
|
+
if (message.supportedInputFormats?.length) {
|
|
21227
|
+
obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
|
|
21228
|
+
}
|
|
21229
|
+
if (message.supportedOutputFormats?.length) {
|
|
21230
|
+
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
21231
|
+
}
|
|
21029
21232
|
return obj;
|
|
21030
21233
|
},
|
|
21031
21234
|
create(base) {
|
|
@@ -21047,6 +21250,8 @@ var FunctionPrecreateRequest = {
|
|
|
21047
21250
|
return acc;
|
|
21048
21251
|
}, {});
|
|
21049
21252
|
message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
|
|
21253
|
+
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
21254
|
+
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
21050
21255
|
return message;
|
|
21051
21256
|
}
|
|
21052
21257
|
};
|
|
@@ -24415,13 +24620,16 @@ var ListPagination = {
|
|
|
24415
24620
|
}
|
|
24416
24621
|
};
|
|
24417
24622
|
function createBaseMapAwaitRequest() {
|
|
24418
|
-
return { functionCallId:
|
|
24623
|
+
return { functionCallId: void 0, mapToken: void 0, lastEntryId: "", requestedAt: 0, timeout: 0 };
|
|
24419
24624
|
}
|
|
24420
24625
|
var MapAwaitRequest = {
|
|
24421
24626
|
encode(message, writer = new BinaryWriter()) {
|
|
24422
|
-
if (message.functionCallId !==
|
|
24627
|
+
if (message.functionCallId !== void 0) {
|
|
24423
24628
|
writer.uint32(10).string(message.functionCallId);
|
|
24424
24629
|
}
|
|
24630
|
+
if (message.mapToken !== void 0) {
|
|
24631
|
+
writer.uint32(42).string(message.mapToken);
|
|
24632
|
+
}
|
|
24425
24633
|
if (message.lastEntryId !== "") {
|
|
24426
24634
|
writer.uint32(18).string(message.lastEntryId);
|
|
24427
24635
|
}
|
|
@@ -24447,6 +24655,13 @@ var MapAwaitRequest = {
|
|
|
24447
24655
|
message.functionCallId = reader.string();
|
|
24448
24656
|
continue;
|
|
24449
24657
|
}
|
|
24658
|
+
case 5: {
|
|
24659
|
+
if (tag !== 42) {
|
|
24660
|
+
break;
|
|
24661
|
+
}
|
|
24662
|
+
message.mapToken = reader.string();
|
|
24663
|
+
continue;
|
|
24664
|
+
}
|
|
24450
24665
|
case 2: {
|
|
24451
24666
|
if (tag !== 18) {
|
|
24452
24667
|
break;
|
|
@@ -24478,7 +24693,8 @@ var MapAwaitRequest = {
|
|
|
24478
24693
|
},
|
|
24479
24694
|
fromJSON(object) {
|
|
24480
24695
|
return {
|
|
24481
|
-
functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) :
|
|
24696
|
+
functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : void 0,
|
|
24697
|
+
mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : void 0,
|
|
24482
24698
|
lastEntryId: isSet3(object.lastEntryId) ? globalThis.String(object.lastEntryId) : "",
|
|
24483
24699
|
requestedAt: isSet3(object.requestedAt) ? globalThis.Number(object.requestedAt) : 0,
|
|
24484
24700
|
timeout: isSet3(object.timeout) ? globalThis.Number(object.timeout) : 0
|
|
@@ -24486,9 +24702,12 @@ var MapAwaitRequest = {
|
|
|
24486
24702
|
},
|
|
24487
24703
|
toJSON(message) {
|
|
24488
24704
|
const obj = {};
|
|
24489
|
-
if (message.functionCallId !==
|
|
24705
|
+
if (message.functionCallId !== void 0) {
|
|
24490
24706
|
obj.functionCallId = message.functionCallId;
|
|
24491
24707
|
}
|
|
24708
|
+
if (message.mapToken !== void 0) {
|
|
24709
|
+
obj.mapToken = message.mapToken;
|
|
24710
|
+
}
|
|
24492
24711
|
if (message.lastEntryId !== "") {
|
|
24493
24712
|
obj.lastEntryId = message.lastEntryId;
|
|
24494
24713
|
}
|
|
@@ -24505,7 +24724,8 @@ var MapAwaitRequest = {
|
|
|
24505
24724
|
},
|
|
24506
24725
|
fromPartial(object) {
|
|
24507
24726
|
const message = createBaseMapAwaitRequest();
|
|
24508
|
-
message.functionCallId = object.functionCallId ??
|
|
24727
|
+
message.functionCallId = object.functionCallId ?? void 0;
|
|
24728
|
+
message.mapToken = object.mapToken ?? void 0;
|
|
24509
24729
|
message.lastEntryId = object.lastEntryId ?? "";
|
|
24510
24730
|
message.requestedAt = object.requestedAt ?? 0;
|
|
24511
24731
|
message.timeout = object.timeout ?? 0;
|
|
@@ -24792,7 +25012,7 @@ var MapStartOrContinueItem = {
|
|
|
24792
25012
|
}
|
|
24793
25013
|
};
|
|
24794
25014
|
function createBaseMapStartOrContinueRequest() {
|
|
24795
|
-
return { functionId: "", parentInputId: "", functionCallId: void 0, items: [] };
|
|
25015
|
+
return { functionId: "", parentInputId: "", functionCallId: void 0, mapToken: void 0, items: [] };
|
|
24796
25016
|
}
|
|
24797
25017
|
var MapStartOrContinueRequest = {
|
|
24798
25018
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -24805,6 +25025,9 @@ var MapStartOrContinueRequest = {
|
|
|
24805
25025
|
if (message.functionCallId !== void 0) {
|
|
24806
25026
|
writer.uint32(26).string(message.functionCallId);
|
|
24807
25027
|
}
|
|
25028
|
+
if (message.mapToken !== void 0) {
|
|
25029
|
+
writer.uint32(42).string(message.mapToken);
|
|
25030
|
+
}
|
|
24808
25031
|
for (const v of message.items) {
|
|
24809
25032
|
MapStartOrContinueItem.encode(v, writer.uint32(34).fork()).join();
|
|
24810
25033
|
}
|
|
@@ -24838,6 +25061,13 @@ var MapStartOrContinueRequest = {
|
|
|
24838
25061
|
message.functionCallId = reader.string();
|
|
24839
25062
|
continue;
|
|
24840
25063
|
}
|
|
25064
|
+
case 5: {
|
|
25065
|
+
if (tag !== 42) {
|
|
25066
|
+
break;
|
|
25067
|
+
}
|
|
25068
|
+
message.mapToken = reader.string();
|
|
25069
|
+
continue;
|
|
25070
|
+
}
|
|
24841
25071
|
case 4: {
|
|
24842
25072
|
if (tag !== 34) {
|
|
24843
25073
|
break;
|
|
@@ -24858,6 +25088,7 @@ var MapStartOrContinueRequest = {
|
|
|
24858
25088
|
functionId: isSet3(object.functionId) ? globalThis.String(object.functionId) : "",
|
|
24859
25089
|
parentInputId: isSet3(object.parentInputId) ? globalThis.String(object.parentInputId) : "",
|
|
24860
25090
|
functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : void 0,
|
|
25091
|
+
mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : void 0,
|
|
24861
25092
|
items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => MapStartOrContinueItem.fromJSON(e)) : []
|
|
24862
25093
|
};
|
|
24863
25094
|
},
|
|
@@ -24872,6 +25103,9 @@ var MapStartOrContinueRequest = {
|
|
|
24872
25103
|
if (message.functionCallId !== void 0) {
|
|
24873
25104
|
obj.functionCallId = message.functionCallId;
|
|
24874
25105
|
}
|
|
25106
|
+
if (message.mapToken !== void 0) {
|
|
25107
|
+
obj.mapToken = message.mapToken;
|
|
25108
|
+
}
|
|
24875
25109
|
if (message.items?.length) {
|
|
24876
25110
|
obj.items = message.items.map((e) => MapStartOrContinueItem.toJSON(e));
|
|
24877
25111
|
}
|
|
@@ -24885,15 +25119,26 @@ var MapStartOrContinueRequest = {
|
|
|
24885
25119
|
message.functionId = object.functionId ?? "";
|
|
24886
25120
|
message.parentInputId = object.parentInputId ?? "";
|
|
24887
25121
|
message.functionCallId = object.functionCallId ?? void 0;
|
|
25122
|
+
message.mapToken = object.mapToken ?? void 0;
|
|
24888
25123
|
message.items = object.items?.map((e) => MapStartOrContinueItem.fromPartial(e)) || [];
|
|
24889
25124
|
return message;
|
|
24890
25125
|
}
|
|
24891
25126
|
};
|
|
24892
25127
|
function createBaseMapStartOrContinueResponse() {
|
|
24893
|
-
return {
|
|
25128
|
+
return {
|
|
25129
|
+
mapToken: "",
|
|
25130
|
+
functionId: "",
|
|
25131
|
+
functionCallId: "",
|
|
25132
|
+
maxInputsOutstanding: 0,
|
|
25133
|
+
attemptTokens: [],
|
|
25134
|
+
retryPolicy: void 0
|
|
25135
|
+
};
|
|
24894
25136
|
}
|
|
24895
25137
|
var MapStartOrContinueResponse = {
|
|
24896
25138
|
encode(message, writer = new BinaryWriter()) {
|
|
25139
|
+
if (message.mapToken !== "") {
|
|
25140
|
+
writer.uint32(50).string(message.mapToken);
|
|
25141
|
+
}
|
|
24897
25142
|
if (message.functionId !== "") {
|
|
24898
25143
|
writer.uint32(10).string(message.functionId);
|
|
24899
25144
|
}
|
|
@@ -24918,6 +25163,13 @@ var MapStartOrContinueResponse = {
|
|
|
24918
25163
|
while (reader.pos < end) {
|
|
24919
25164
|
const tag = reader.uint32();
|
|
24920
25165
|
switch (tag >>> 3) {
|
|
25166
|
+
case 6: {
|
|
25167
|
+
if (tag !== 50) {
|
|
25168
|
+
break;
|
|
25169
|
+
}
|
|
25170
|
+
message.mapToken = reader.string();
|
|
25171
|
+
continue;
|
|
25172
|
+
}
|
|
24921
25173
|
case 1: {
|
|
24922
25174
|
if (tag !== 10) {
|
|
24923
25175
|
break;
|
|
@@ -24963,6 +25215,7 @@ var MapStartOrContinueResponse = {
|
|
|
24963
25215
|
},
|
|
24964
25216
|
fromJSON(object) {
|
|
24965
25217
|
return {
|
|
25218
|
+
mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : "",
|
|
24966
25219
|
functionId: isSet3(object.functionId) ? globalThis.String(object.functionId) : "",
|
|
24967
25220
|
functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
|
|
24968
25221
|
maxInputsOutstanding: isSet3(object.maxInputsOutstanding) ? globalThis.Number(object.maxInputsOutstanding) : 0,
|
|
@@ -24972,6 +25225,9 @@ var MapStartOrContinueResponse = {
|
|
|
24972
25225
|
},
|
|
24973
25226
|
toJSON(message) {
|
|
24974
25227
|
const obj = {};
|
|
25228
|
+
if (message.mapToken !== "") {
|
|
25229
|
+
obj.mapToken = message.mapToken;
|
|
25230
|
+
}
|
|
24975
25231
|
if (message.functionId !== "") {
|
|
24976
25232
|
obj.functionId = message.functionId;
|
|
24977
25233
|
}
|
|
@@ -24994,6 +25250,7 @@ var MapStartOrContinueResponse = {
|
|
|
24994
25250
|
},
|
|
24995
25251
|
fromPartial(object) {
|
|
24996
25252
|
const message = createBaseMapStartOrContinueResponse();
|
|
25253
|
+
message.mapToken = object.mapToken ?? "";
|
|
24997
25254
|
message.functionId = object.functionId ?? "";
|
|
24998
25255
|
message.functionCallId = object.functionCallId ?? "";
|
|
24999
25256
|
message.maxInputsOutstanding = object.maxInputsOutstanding ?? 0;
|
|
@@ -25010,7 +25267,9 @@ function createBaseMethodDefinition() {
|
|
|
25010
25267
|
webUrl: "",
|
|
25011
25268
|
webUrlInfo: void 0,
|
|
25012
25269
|
customDomainInfo: [],
|
|
25013
|
-
functionSchema: void 0
|
|
25270
|
+
functionSchema: void 0,
|
|
25271
|
+
supportedInputFormats: [],
|
|
25272
|
+
supportedOutputFormats: []
|
|
25014
25273
|
};
|
|
25015
25274
|
}
|
|
25016
25275
|
var MethodDefinition = {
|
|
@@ -25036,6 +25295,16 @@ var MethodDefinition = {
|
|
|
25036
25295
|
if (message.functionSchema !== void 0) {
|
|
25037
25296
|
FunctionSchema.encode(message.functionSchema, writer.uint32(58).fork()).join();
|
|
25038
25297
|
}
|
|
25298
|
+
writer.uint32(66).fork();
|
|
25299
|
+
for (const v of message.supportedInputFormats) {
|
|
25300
|
+
writer.int32(v);
|
|
25301
|
+
}
|
|
25302
|
+
writer.join();
|
|
25303
|
+
writer.uint32(74).fork();
|
|
25304
|
+
for (const v of message.supportedOutputFormats) {
|
|
25305
|
+
writer.int32(v);
|
|
25306
|
+
}
|
|
25307
|
+
writer.join();
|
|
25039
25308
|
return writer;
|
|
25040
25309
|
},
|
|
25041
25310
|
decode(input, length) {
|
|
@@ -25094,6 +25363,34 @@ var MethodDefinition = {
|
|
|
25094
25363
|
message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
|
|
25095
25364
|
continue;
|
|
25096
25365
|
}
|
|
25366
|
+
case 8: {
|
|
25367
|
+
if (tag === 64) {
|
|
25368
|
+
message.supportedInputFormats.push(reader.int32());
|
|
25369
|
+
continue;
|
|
25370
|
+
}
|
|
25371
|
+
if (tag === 66) {
|
|
25372
|
+
const end2 = reader.uint32() + reader.pos;
|
|
25373
|
+
while (reader.pos < end2) {
|
|
25374
|
+
message.supportedInputFormats.push(reader.int32());
|
|
25375
|
+
}
|
|
25376
|
+
continue;
|
|
25377
|
+
}
|
|
25378
|
+
break;
|
|
25379
|
+
}
|
|
25380
|
+
case 9: {
|
|
25381
|
+
if (tag === 72) {
|
|
25382
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
25383
|
+
continue;
|
|
25384
|
+
}
|
|
25385
|
+
if (tag === 74) {
|
|
25386
|
+
const end2 = reader.uint32() + reader.pos;
|
|
25387
|
+
while (reader.pos < end2) {
|
|
25388
|
+
message.supportedOutputFormats.push(reader.int32());
|
|
25389
|
+
}
|
|
25390
|
+
continue;
|
|
25391
|
+
}
|
|
25392
|
+
break;
|
|
25393
|
+
}
|
|
25097
25394
|
}
|
|
25098
25395
|
if ((tag & 7) === 4 || tag === 0) {
|
|
25099
25396
|
break;
|
|
@@ -25110,7 +25407,9 @@ var MethodDefinition = {
|
|
|
25110
25407
|
webUrl: isSet3(object.webUrl) ? globalThis.String(object.webUrl) : "",
|
|
25111
25408
|
webUrlInfo: isSet3(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
|
|
25112
25409
|
customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
|
|
25113
|
-
functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0
|
|
25410
|
+
functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
|
|
25411
|
+
supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
|
|
25412
|
+
supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
|
|
25114
25413
|
};
|
|
25115
25414
|
},
|
|
25116
25415
|
toJSON(message) {
|
|
@@ -25136,6 +25435,12 @@ var MethodDefinition = {
|
|
|
25136
25435
|
if (message.functionSchema !== void 0) {
|
|
25137
25436
|
obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
|
|
25138
25437
|
}
|
|
25438
|
+
if (message.supportedInputFormats?.length) {
|
|
25439
|
+
obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
|
|
25440
|
+
}
|
|
25441
|
+
if (message.supportedOutputFormats?.length) {
|
|
25442
|
+
obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
|
|
25443
|
+
}
|
|
25139
25444
|
return obj;
|
|
25140
25445
|
},
|
|
25141
25446
|
create(base) {
|
|
@@ -25150,6 +25455,8 @@ var MethodDefinition = {
|
|
|
25150
25455
|
message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
|
|
25151
25456
|
message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
|
|
25152
25457
|
message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
|
|
25458
|
+
message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
|
|
25459
|
+
message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
|
|
25153
25460
|
return message;
|
|
25154
25461
|
}
|
|
25155
25462
|
};
|
|
@@ -26689,7 +26996,16 @@ var ObjectDependency = {
|
|
|
26689
26996
|
}
|
|
26690
26997
|
};
|
|
26691
26998
|
function createBasePTYInfo() {
|
|
26692
|
-
return {
|
|
26999
|
+
return {
|
|
27000
|
+
enabled: false,
|
|
27001
|
+
winszRows: 0,
|
|
27002
|
+
winszCols: 0,
|
|
27003
|
+
envTerm: "",
|
|
27004
|
+
envColorterm: "",
|
|
27005
|
+
envTermProgram: "",
|
|
27006
|
+
ptyType: 0,
|
|
27007
|
+
noTerminateOnIdleStdin: false
|
|
27008
|
+
};
|
|
26693
27009
|
}
|
|
26694
27010
|
var PTYInfo = {
|
|
26695
27011
|
encode(message, writer = new BinaryWriter()) {
|
|
@@ -26714,6 +27030,9 @@ var PTYInfo = {
|
|
|
26714
27030
|
if (message.ptyType !== 0) {
|
|
26715
27031
|
writer.uint32(56).int32(message.ptyType);
|
|
26716
27032
|
}
|
|
27033
|
+
if (message.noTerminateOnIdleStdin !== false) {
|
|
27034
|
+
writer.uint32(64).bool(message.noTerminateOnIdleStdin);
|
|
27035
|
+
}
|
|
26717
27036
|
return writer;
|
|
26718
27037
|
},
|
|
26719
27038
|
decode(input, length) {
|
|
@@ -26772,6 +27091,13 @@ var PTYInfo = {
|
|
|
26772
27091
|
message.ptyType = reader.int32();
|
|
26773
27092
|
continue;
|
|
26774
27093
|
}
|
|
27094
|
+
case 8: {
|
|
27095
|
+
if (tag !== 64) {
|
|
27096
|
+
break;
|
|
27097
|
+
}
|
|
27098
|
+
message.noTerminateOnIdleStdin = reader.bool();
|
|
27099
|
+
continue;
|
|
27100
|
+
}
|
|
26775
27101
|
}
|
|
26776
27102
|
if ((tag & 7) === 4 || tag === 0) {
|
|
26777
27103
|
break;
|
|
@@ -26788,7 +27114,8 @@ var PTYInfo = {
|
|
|
26788
27114
|
envTerm: isSet3(object.envTerm) ? globalThis.String(object.envTerm) : "",
|
|
26789
27115
|
envColorterm: isSet3(object.envColorterm) ? globalThis.String(object.envColorterm) : "",
|
|
26790
27116
|
envTermProgram: isSet3(object.envTermProgram) ? globalThis.String(object.envTermProgram) : "",
|
|
26791
|
-
ptyType: isSet3(object.ptyType) ? pTYInfo_PTYTypeFromJSON(object.ptyType) : 0
|
|
27117
|
+
ptyType: isSet3(object.ptyType) ? pTYInfo_PTYTypeFromJSON(object.ptyType) : 0,
|
|
27118
|
+
noTerminateOnIdleStdin: isSet3(object.noTerminateOnIdleStdin) ? globalThis.Boolean(object.noTerminateOnIdleStdin) : false
|
|
26792
27119
|
};
|
|
26793
27120
|
},
|
|
26794
27121
|
toJSON(message) {
|
|
@@ -26814,6 +27141,9 @@ var PTYInfo = {
|
|
|
26814
27141
|
if (message.ptyType !== 0) {
|
|
26815
27142
|
obj.ptyType = pTYInfo_PTYTypeToJSON(message.ptyType);
|
|
26816
27143
|
}
|
|
27144
|
+
if (message.noTerminateOnIdleStdin !== false) {
|
|
27145
|
+
obj.noTerminateOnIdleStdin = message.noTerminateOnIdleStdin;
|
|
27146
|
+
}
|
|
26817
27147
|
return obj;
|
|
26818
27148
|
},
|
|
26819
27149
|
create(base) {
|
|
@@ -26828,6 +27158,7 @@ var PTYInfo = {
|
|
|
26828
27158
|
message.envColorterm = object.envColorterm ?? "";
|
|
26829
27159
|
message.envTermProgram = object.envTermProgram ?? "";
|
|
26830
27160
|
message.ptyType = object.ptyType ?? 0;
|
|
27161
|
+
message.noTerminateOnIdleStdin = object.noTerminateOnIdleStdin ?? false;
|
|
26831
27162
|
return message;
|
|
26832
27163
|
}
|
|
26833
27164
|
};
|
|
@@ -30324,6 +30655,142 @@ var Sandbox_ExperimentalOptionsEntry = {
|
|
|
30324
30655
|
return message;
|
|
30325
30656
|
}
|
|
30326
30657
|
};
|
|
30658
|
+
function createBaseSandboxCreateConnectTokenRequest() {
|
|
30659
|
+
return { sandboxId: "", metadata: "" };
|
|
30660
|
+
}
|
|
30661
|
+
var SandboxCreateConnectTokenRequest = {
|
|
30662
|
+
encode(message, writer = new BinaryWriter()) {
|
|
30663
|
+
if (message.sandboxId !== "") {
|
|
30664
|
+
writer.uint32(10).string(message.sandboxId);
|
|
30665
|
+
}
|
|
30666
|
+
if (message.metadata !== "") {
|
|
30667
|
+
writer.uint32(18).string(message.metadata);
|
|
30668
|
+
}
|
|
30669
|
+
return writer;
|
|
30670
|
+
},
|
|
30671
|
+
decode(input, length) {
|
|
30672
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
30673
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
30674
|
+
const message = createBaseSandboxCreateConnectTokenRequest();
|
|
30675
|
+
while (reader.pos < end) {
|
|
30676
|
+
const tag = reader.uint32();
|
|
30677
|
+
switch (tag >>> 3) {
|
|
30678
|
+
case 1: {
|
|
30679
|
+
if (tag !== 10) {
|
|
30680
|
+
break;
|
|
30681
|
+
}
|
|
30682
|
+
message.sandboxId = reader.string();
|
|
30683
|
+
continue;
|
|
30684
|
+
}
|
|
30685
|
+
case 2: {
|
|
30686
|
+
if (tag !== 18) {
|
|
30687
|
+
break;
|
|
30688
|
+
}
|
|
30689
|
+
message.metadata = reader.string();
|
|
30690
|
+
continue;
|
|
30691
|
+
}
|
|
30692
|
+
}
|
|
30693
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
30694
|
+
break;
|
|
30695
|
+
}
|
|
30696
|
+
reader.skip(tag & 7);
|
|
30697
|
+
}
|
|
30698
|
+
return message;
|
|
30699
|
+
},
|
|
30700
|
+
fromJSON(object) {
|
|
30701
|
+
return {
|
|
30702
|
+
sandboxId: isSet3(object.sandboxId) ? globalThis.String(object.sandboxId) : "",
|
|
30703
|
+
metadata: isSet3(object.metadata) ? globalThis.String(object.metadata) : ""
|
|
30704
|
+
};
|
|
30705
|
+
},
|
|
30706
|
+
toJSON(message) {
|
|
30707
|
+
const obj = {};
|
|
30708
|
+
if (message.sandboxId !== "") {
|
|
30709
|
+
obj.sandboxId = message.sandboxId;
|
|
30710
|
+
}
|
|
30711
|
+
if (message.metadata !== "") {
|
|
30712
|
+
obj.metadata = message.metadata;
|
|
30713
|
+
}
|
|
30714
|
+
return obj;
|
|
30715
|
+
},
|
|
30716
|
+
create(base) {
|
|
30717
|
+
return SandboxCreateConnectTokenRequest.fromPartial(base ?? {});
|
|
30718
|
+
},
|
|
30719
|
+
fromPartial(object) {
|
|
30720
|
+
const message = createBaseSandboxCreateConnectTokenRequest();
|
|
30721
|
+
message.sandboxId = object.sandboxId ?? "";
|
|
30722
|
+
message.metadata = object.metadata ?? "";
|
|
30723
|
+
return message;
|
|
30724
|
+
}
|
|
30725
|
+
};
|
|
30726
|
+
function createBaseSandboxCreateConnectTokenResponse() {
|
|
30727
|
+
return { url: "", token: "" };
|
|
30728
|
+
}
|
|
30729
|
+
var SandboxCreateConnectTokenResponse = {
|
|
30730
|
+
encode(message, writer = new BinaryWriter()) {
|
|
30731
|
+
if (message.url !== "") {
|
|
30732
|
+
writer.uint32(10).string(message.url);
|
|
30733
|
+
}
|
|
30734
|
+
if (message.token !== "") {
|
|
30735
|
+
writer.uint32(18).string(message.token);
|
|
30736
|
+
}
|
|
30737
|
+
return writer;
|
|
30738
|
+
},
|
|
30739
|
+
decode(input, length) {
|
|
30740
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
30741
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
30742
|
+
const message = createBaseSandboxCreateConnectTokenResponse();
|
|
30743
|
+
while (reader.pos < end) {
|
|
30744
|
+
const tag = reader.uint32();
|
|
30745
|
+
switch (tag >>> 3) {
|
|
30746
|
+
case 1: {
|
|
30747
|
+
if (tag !== 10) {
|
|
30748
|
+
break;
|
|
30749
|
+
}
|
|
30750
|
+
message.url = reader.string();
|
|
30751
|
+
continue;
|
|
30752
|
+
}
|
|
30753
|
+
case 2: {
|
|
30754
|
+
if (tag !== 18) {
|
|
30755
|
+
break;
|
|
30756
|
+
}
|
|
30757
|
+
message.token = reader.string();
|
|
30758
|
+
continue;
|
|
30759
|
+
}
|
|
30760
|
+
}
|
|
30761
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
30762
|
+
break;
|
|
30763
|
+
}
|
|
30764
|
+
reader.skip(tag & 7);
|
|
30765
|
+
}
|
|
30766
|
+
return message;
|
|
30767
|
+
},
|
|
30768
|
+
fromJSON(object) {
|
|
30769
|
+
return {
|
|
30770
|
+
url: isSet3(object.url) ? globalThis.String(object.url) : "",
|
|
30771
|
+
token: isSet3(object.token) ? globalThis.String(object.token) : ""
|
|
30772
|
+
};
|
|
30773
|
+
},
|
|
30774
|
+
toJSON(message) {
|
|
30775
|
+
const obj = {};
|
|
30776
|
+
if (message.url !== "") {
|
|
30777
|
+
obj.url = message.url;
|
|
30778
|
+
}
|
|
30779
|
+
if (message.token !== "") {
|
|
30780
|
+
obj.token = message.token;
|
|
30781
|
+
}
|
|
30782
|
+
return obj;
|
|
30783
|
+
},
|
|
30784
|
+
create(base) {
|
|
30785
|
+
return SandboxCreateConnectTokenResponse.fromPartial(base ?? {});
|
|
30786
|
+
},
|
|
30787
|
+
fromPartial(object) {
|
|
30788
|
+
const message = createBaseSandboxCreateConnectTokenResponse();
|
|
30789
|
+
message.url = object.url ?? "";
|
|
30790
|
+
message.token = object.token ?? "";
|
|
30791
|
+
return message;
|
|
30792
|
+
}
|
|
30793
|
+
};
|
|
30327
30794
|
function createBaseSandboxCreateRequest() {
|
|
30328
30795
|
return { appId: "", definition: void 0, environmentName: "" };
|
|
30329
30796
|
}
|
|
@@ -32454,6 +32921,108 @@ var SandboxTag = {
|
|
|
32454
32921
|
return message;
|
|
32455
32922
|
}
|
|
32456
32923
|
};
|
|
32924
|
+
function createBaseSandboxTagsGetRequest() {
|
|
32925
|
+
return { sandboxId: "" };
|
|
32926
|
+
}
|
|
32927
|
+
var SandboxTagsGetRequest = {
|
|
32928
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32929
|
+
if (message.sandboxId !== "") {
|
|
32930
|
+
writer.uint32(10).string(message.sandboxId);
|
|
32931
|
+
}
|
|
32932
|
+
return writer;
|
|
32933
|
+
},
|
|
32934
|
+
decode(input, length) {
|
|
32935
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32936
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32937
|
+
const message = createBaseSandboxTagsGetRequest();
|
|
32938
|
+
while (reader.pos < end) {
|
|
32939
|
+
const tag = reader.uint32();
|
|
32940
|
+
switch (tag >>> 3) {
|
|
32941
|
+
case 1: {
|
|
32942
|
+
if (tag !== 10) {
|
|
32943
|
+
break;
|
|
32944
|
+
}
|
|
32945
|
+
message.sandboxId = reader.string();
|
|
32946
|
+
continue;
|
|
32947
|
+
}
|
|
32948
|
+
}
|
|
32949
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
32950
|
+
break;
|
|
32951
|
+
}
|
|
32952
|
+
reader.skip(tag & 7);
|
|
32953
|
+
}
|
|
32954
|
+
return message;
|
|
32955
|
+
},
|
|
32956
|
+
fromJSON(object) {
|
|
32957
|
+
return { sandboxId: isSet3(object.sandboxId) ? globalThis.String(object.sandboxId) : "" };
|
|
32958
|
+
},
|
|
32959
|
+
toJSON(message) {
|
|
32960
|
+
const obj = {};
|
|
32961
|
+
if (message.sandboxId !== "") {
|
|
32962
|
+
obj.sandboxId = message.sandboxId;
|
|
32963
|
+
}
|
|
32964
|
+
return obj;
|
|
32965
|
+
},
|
|
32966
|
+
create(base) {
|
|
32967
|
+
return SandboxTagsGetRequest.fromPartial(base ?? {});
|
|
32968
|
+
},
|
|
32969
|
+
fromPartial(object) {
|
|
32970
|
+
const message = createBaseSandboxTagsGetRequest();
|
|
32971
|
+
message.sandboxId = object.sandboxId ?? "";
|
|
32972
|
+
return message;
|
|
32973
|
+
}
|
|
32974
|
+
};
|
|
32975
|
+
function createBaseSandboxTagsGetResponse() {
|
|
32976
|
+
return { tags: [] };
|
|
32977
|
+
}
|
|
32978
|
+
var SandboxTagsGetResponse = {
|
|
32979
|
+
encode(message, writer = new BinaryWriter()) {
|
|
32980
|
+
for (const v of message.tags) {
|
|
32981
|
+
SandboxTag.encode(v, writer.uint32(10).fork()).join();
|
|
32982
|
+
}
|
|
32983
|
+
return writer;
|
|
32984
|
+
},
|
|
32985
|
+
decode(input, length) {
|
|
32986
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
32987
|
+
let end = length === void 0 ? reader.len : reader.pos + length;
|
|
32988
|
+
const message = createBaseSandboxTagsGetResponse();
|
|
32989
|
+
while (reader.pos < end) {
|
|
32990
|
+
const tag = reader.uint32();
|
|
32991
|
+
switch (tag >>> 3) {
|
|
32992
|
+
case 1: {
|
|
32993
|
+
if (tag !== 10) {
|
|
32994
|
+
break;
|
|
32995
|
+
}
|
|
32996
|
+
message.tags.push(SandboxTag.decode(reader, reader.uint32()));
|
|
32997
|
+
continue;
|
|
32998
|
+
}
|
|
32999
|
+
}
|
|
33000
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
33001
|
+
break;
|
|
33002
|
+
}
|
|
33003
|
+
reader.skip(tag & 7);
|
|
33004
|
+
}
|
|
33005
|
+
return message;
|
|
33006
|
+
},
|
|
33007
|
+
fromJSON(object) {
|
|
33008
|
+
return { tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e) => SandboxTag.fromJSON(e)) : [] };
|
|
33009
|
+
},
|
|
33010
|
+
toJSON(message) {
|
|
33011
|
+
const obj = {};
|
|
33012
|
+
if (message.tags?.length) {
|
|
33013
|
+
obj.tags = message.tags.map((e) => SandboxTag.toJSON(e));
|
|
33014
|
+
}
|
|
33015
|
+
return obj;
|
|
33016
|
+
},
|
|
33017
|
+
create(base) {
|
|
33018
|
+
return SandboxTagsGetResponse.fromPartial(base ?? {});
|
|
33019
|
+
},
|
|
33020
|
+
fromPartial(object) {
|
|
33021
|
+
const message = createBaseSandboxTagsGetResponse();
|
|
33022
|
+
message.tags = object.tags?.map((e) => SandboxTag.fromPartial(e)) || [];
|
|
33023
|
+
return message;
|
|
33024
|
+
}
|
|
33025
|
+
};
|
|
32457
33026
|
function createBaseSandboxTagsSetRequest() {
|
|
32458
33027
|
return { environmentName: "", sandboxId: "", tags: [] };
|
|
32459
33028
|
}
|
|
@@ -40927,6 +41496,14 @@ var ModalClientDefinition = {
|
|
|
40927
41496
|
responseStream: false,
|
|
40928
41497
|
options: {}
|
|
40929
41498
|
},
|
|
41499
|
+
sandboxCreateConnectToken: {
|
|
41500
|
+
name: "SandboxCreateConnectToken",
|
|
41501
|
+
requestType: SandboxCreateConnectTokenRequest,
|
|
41502
|
+
requestStream: false,
|
|
41503
|
+
responseType: SandboxCreateConnectTokenResponse,
|
|
41504
|
+
responseStream: false,
|
|
41505
|
+
options: {}
|
|
41506
|
+
},
|
|
40930
41507
|
sandboxGetFromName: {
|
|
40931
41508
|
name: "SandboxGetFromName",
|
|
40932
41509
|
requestType: SandboxGetFromNameRequest,
|
|
@@ -41040,6 +41617,14 @@ var ModalClientDefinition = {
|
|
|
41040
41617
|
responseStream: false,
|
|
41041
41618
|
options: {}
|
|
41042
41619
|
},
|
|
41620
|
+
sandboxTagsGet: {
|
|
41621
|
+
name: "SandboxTagsGet",
|
|
41622
|
+
requestType: SandboxTagsGetRequest,
|
|
41623
|
+
requestStream: false,
|
|
41624
|
+
responseType: SandboxTagsGetResponse,
|
|
41625
|
+
responseStream: false,
|
|
41626
|
+
options: {}
|
|
41627
|
+
},
|
|
41043
41628
|
sandboxTagsSet: {
|
|
41044
41629
|
name: "SandboxTagsSet",
|
|
41045
41630
|
requestType: SandboxTagsSetRequest,
|
|
@@ -41764,6 +42349,13 @@ var Secret = class _Secret {
|
|
|
41764
42349
|
}
|
|
41765
42350
|
}
|
|
41766
42351
|
};
|
|
42352
|
+
async function mergeEnvAndSecrets(env, secrets) {
|
|
42353
|
+
const result = [...secrets || []];
|
|
42354
|
+
if (env && Object.keys(env).length > 0) {
|
|
42355
|
+
result.push(await Secret.fromObject(env));
|
|
42356
|
+
}
|
|
42357
|
+
return result;
|
|
42358
|
+
}
|
|
41767
42359
|
|
|
41768
42360
|
// src/image.ts
|
|
41769
42361
|
var import_nice_grpc3 = require("nice-grpc");
|
|
@@ -41781,6 +42373,7 @@ var Image2 = class _Image {
|
|
|
41781
42373
|
this.#layers = layers || [
|
|
41782
42374
|
{
|
|
41783
42375
|
commands: [],
|
|
42376
|
+
env: void 0,
|
|
41784
42377
|
secrets: void 0,
|
|
41785
42378
|
gpuConfig: void 0,
|
|
41786
42379
|
forceBuild: false
|
|
@@ -41897,6 +42490,7 @@ var Image2 = class _Image {
|
|
|
41897
42490
|
_Image.validateDockerfileCommands(commands);
|
|
41898
42491
|
const newLayer = {
|
|
41899
42492
|
commands: [...commands],
|
|
42493
|
+
env: options?.env,
|
|
41900
42494
|
secrets: options?.secrets,
|
|
41901
42495
|
gpuConfig: options?.gpu ? parseGpuConfig(options.gpu) : void 0,
|
|
41902
42496
|
forceBuild: options?.forceBuild
|
|
@@ -41918,7 +42512,8 @@ var Image2 = class _Image {
|
|
|
41918
42512
|
let baseImageId;
|
|
41919
42513
|
for (let i = 0; i < this.#layers.length; i++) {
|
|
41920
42514
|
const layer = this.#layers[i];
|
|
41921
|
-
const
|
|
42515
|
+
const mergedSecrets = await mergeEnvAndSecrets(layer.env, layer.secrets);
|
|
42516
|
+
const secretIds = mergedSecrets.map((secret) => secret.secretId);
|
|
41922
42517
|
const gpuConfig = layer.gpuConfig;
|
|
41923
42518
|
let dockerfileCommands;
|
|
41924
42519
|
let baseImages;
|
|
@@ -42237,6 +42832,37 @@ var Tunnel = class {
|
|
|
42237
42832
|
return [this.unencryptedHost, this.unencryptedPort];
|
|
42238
42833
|
}
|
|
42239
42834
|
};
|
|
42835
|
+
function defaultSandboxPTYInfo() {
|
|
42836
|
+
return PTYInfo.create({
|
|
42837
|
+
enabled: true,
|
|
42838
|
+
winszRows: 24,
|
|
42839
|
+
winszCols: 80,
|
|
42840
|
+
envTerm: "xterm-256color",
|
|
42841
|
+
envColorterm: "truecolor",
|
|
42842
|
+
envTermProgram: "",
|
|
42843
|
+
ptyType: 2 /* PTY_TYPE_SHELL */,
|
|
42844
|
+
noTerminateOnIdleStdin: true
|
|
42845
|
+
});
|
|
42846
|
+
}
|
|
42847
|
+
async function buildContainerExecRequestProto(taskId, command, options) {
|
|
42848
|
+
const mergedSecrets = await mergeEnvAndSecrets(
|
|
42849
|
+
options?.env,
|
|
42850
|
+
options?.secrets
|
|
42851
|
+
);
|
|
42852
|
+
const secretIds = mergedSecrets.map((secret) => secret.secretId);
|
|
42853
|
+
let ptyInfo;
|
|
42854
|
+
if (options?.pty) {
|
|
42855
|
+
ptyInfo = defaultSandboxPTYInfo();
|
|
42856
|
+
}
|
|
42857
|
+
return ContainerExecRequest.create({
|
|
42858
|
+
taskId,
|
|
42859
|
+
command,
|
|
42860
|
+
workdir: options?.workdir,
|
|
42861
|
+
timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0,
|
|
42862
|
+
secretIds,
|
|
42863
|
+
ptyInfo
|
|
42864
|
+
});
|
|
42865
|
+
}
|
|
42240
42866
|
var Sandbox2 = class _Sandbox {
|
|
42241
42867
|
sandboxId;
|
|
42242
42868
|
stdin;
|
|
@@ -42278,6 +42904,23 @@ var Sandbox2 = class _Sandbox {
|
|
|
42278
42904
|
throw err;
|
|
42279
42905
|
}
|
|
42280
42906
|
}
|
|
42907
|
+
/** Get tags (key-value pairs) currently attached to this Sandbox from the server. */
|
|
42908
|
+
async getTags() {
|
|
42909
|
+
let resp;
|
|
42910
|
+
try {
|
|
42911
|
+
resp = await client.sandboxTagsGet({ sandboxId: this.sandboxId });
|
|
42912
|
+
} catch (err) {
|
|
42913
|
+
if (err instanceof import_nice_grpc5.ClientError && err.code === import_nice_grpc5.Status.INVALID_ARGUMENT) {
|
|
42914
|
+
throw new InvalidError(err.details || err.message);
|
|
42915
|
+
}
|
|
42916
|
+
throw err;
|
|
42917
|
+
}
|
|
42918
|
+
const tags = {};
|
|
42919
|
+
for (const tag of resp.tags) {
|
|
42920
|
+
tags[tag.tagName] = tag.tagValue;
|
|
42921
|
+
}
|
|
42922
|
+
return tags;
|
|
42923
|
+
}
|
|
42281
42924
|
/** Returns a running Sandbox object from an ID.
|
|
42282
42925
|
*
|
|
42283
42926
|
* @returns Sandbox with ID
|
|
@@ -42341,14 +42984,8 @@ var Sandbox2 = class _Sandbox {
|
|
|
42341
42984
|
}
|
|
42342
42985
|
async exec(command, options) {
|
|
42343
42986
|
const taskId = await this.#getTaskId();
|
|
42344
|
-
const
|
|
42345
|
-
const resp = await client.containerExec(
|
|
42346
|
-
taskId,
|
|
42347
|
-
command,
|
|
42348
|
-
workdir: options?.workdir,
|
|
42349
|
-
timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0,
|
|
42350
|
-
secretIds
|
|
42351
|
-
});
|
|
42987
|
+
const req = await buildContainerExecRequestProto(taskId, command, options);
|
|
42988
|
+
const resp = await client.containerExec(req);
|
|
42352
42989
|
return new ContainerProcess(resp.execId, options);
|
|
42353
42990
|
}
|
|
42354
42991
|
async #getTaskId() {
|
|
@@ -42735,6 +43372,118 @@ function parseGpuConfig(gpu) {
|
|
|
42735
43372
|
gpuType: gpuType.toUpperCase()
|
|
42736
43373
|
};
|
|
42737
43374
|
}
|
|
43375
|
+
async function buildSandboxCreateRequestProto(appId, imageId, options = {}) {
|
|
43376
|
+
const gpuConfig = parseGpuConfig(options.gpu);
|
|
43377
|
+
if (options.timeout && options.timeout % 1e3 !== 0) {
|
|
43378
|
+
throw new Error(
|
|
43379
|
+
`timeout must be a multiple of 1000ms, got ${options.timeout}`
|
|
43380
|
+
);
|
|
43381
|
+
}
|
|
43382
|
+
if (options.idleTimeout && options.idleTimeout % 1e3 !== 0) {
|
|
43383
|
+
throw new Error(
|
|
43384
|
+
`idleTimeout must be a multiple of 1000ms, got ${options.idleTimeout}`
|
|
43385
|
+
);
|
|
43386
|
+
}
|
|
43387
|
+
if (options.workdir && !options.workdir.startsWith("/")) {
|
|
43388
|
+
throw new Error(
|
|
43389
|
+
`workdir must be an absolute path, got: ${options.workdir}`
|
|
43390
|
+
);
|
|
43391
|
+
}
|
|
43392
|
+
const volumeMounts = options.volumes ? Object.entries(options.volumes).map(([mountPath, volume]) => ({
|
|
43393
|
+
volumeId: volume.volumeId,
|
|
43394
|
+
mountPath,
|
|
43395
|
+
allowBackgroundCommits: true,
|
|
43396
|
+
readOnly: volume.isReadOnly
|
|
43397
|
+
})) : [];
|
|
43398
|
+
const cloudBucketMounts = options.cloudBucketMounts ? Object.entries(options.cloudBucketMounts).map(
|
|
43399
|
+
([mountPath, mount]) => cloudBucketMountToProto(mount, mountPath)
|
|
43400
|
+
) : [];
|
|
43401
|
+
const openPorts = [];
|
|
43402
|
+
if (options.encryptedPorts) {
|
|
43403
|
+
openPorts.push(
|
|
43404
|
+
...options.encryptedPorts.map((port) => ({
|
|
43405
|
+
port,
|
|
43406
|
+
unencrypted: false
|
|
43407
|
+
}))
|
|
43408
|
+
);
|
|
43409
|
+
}
|
|
43410
|
+
if (options.h2Ports) {
|
|
43411
|
+
openPorts.push(
|
|
43412
|
+
...options.h2Ports.map((port) => ({
|
|
43413
|
+
port,
|
|
43414
|
+
unencrypted: false,
|
|
43415
|
+
tunnelType: 1 /* TUNNEL_TYPE_H2 */
|
|
43416
|
+
}))
|
|
43417
|
+
);
|
|
43418
|
+
}
|
|
43419
|
+
if (options.unencryptedPorts) {
|
|
43420
|
+
openPorts.push(
|
|
43421
|
+
...options.unencryptedPorts.map((port) => ({
|
|
43422
|
+
port,
|
|
43423
|
+
unencrypted: true
|
|
43424
|
+
}))
|
|
43425
|
+
);
|
|
43426
|
+
}
|
|
43427
|
+
const mergedSecrets = await mergeEnvAndSecrets(options.env, options.secrets);
|
|
43428
|
+
const secretIds = mergedSecrets.map((secret) => secret.secretId);
|
|
43429
|
+
let networkAccess;
|
|
43430
|
+
if (options.blockNetwork) {
|
|
43431
|
+
if (options.cidrAllowlist) {
|
|
43432
|
+
throw new Error(
|
|
43433
|
+
"cidrAllowlist cannot be used when blockNetwork is enabled"
|
|
43434
|
+
);
|
|
43435
|
+
}
|
|
43436
|
+
networkAccess = {
|
|
43437
|
+
networkAccessType: 2 /* BLOCKED */,
|
|
43438
|
+
allowedCidrs: []
|
|
43439
|
+
};
|
|
43440
|
+
} else if (options.cidrAllowlist) {
|
|
43441
|
+
networkAccess = {
|
|
43442
|
+
networkAccessType: 3 /* ALLOWLIST */,
|
|
43443
|
+
allowedCidrs: options.cidrAllowlist
|
|
43444
|
+
};
|
|
43445
|
+
} else {
|
|
43446
|
+
networkAccess = {
|
|
43447
|
+
networkAccessType: 1 /* OPEN */,
|
|
43448
|
+
allowedCidrs: []
|
|
43449
|
+
};
|
|
43450
|
+
}
|
|
43451
|
+
const schedulerPlacement = SchedulerPlacement.create({
|
|
43452
|
+
regions: options.regions ?? []
|
|
43453
|
+
});
|
|
43454
|
+
let ptyInfo;
|
|
43455
|
+
if (options.pty) {
|
|
43456
|
+
ptyInfo = defaultSandboxPTYInfo();
|
|
43457
|
+
}
|
|
43458
|
+
return SandboxCreateRequest.create({
|
|
43459
|
+
appId,
|
|
43460
|
+
definition: {
|
|
43461
|
+
// Sleep default is implicit in image builder version <=2024.10
|
|
43462
|
+
entrypointArgs: options.command ?? ["sleep", "48h"],
|
|
43463
|
+
imageId,
|
|
43464
|
+
timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
|
|
43465
|
+
idleTimeoutSecs: options.idleTimeout != void 0 ? options.idleTimeout / 1e3 : void 0,
|
|
43466
|
+
workdir: options.workdir ?? void 0,
|
|
43467
|
+
networkAccess,
|
|
43468
|
+
resources: {
|
|
43469
|
+
// https://modal.com/docs/guide/resources
|
|
43470
|
+
milliCpu: Math.round(1e3 * (options.cpu ?? 0.125)),
|
|
43471
|
+
memoryMb: options.memory ?? 128,
|
|
43472
|
+
gpuConfig
|
|
43473
|
+
},
|
|
43474
|
+
volumeMounts,
|
|
43475
|
+
cloudBucketMounts,
|
|
43476
|
+
ptyInfo,
|
|
43477
|
+
secretIds,
|
|
43478
|
+
openPorts: openPorts.length > 0 ? { ports: openPorts } : void 0,
|
|
43479
|
+
cloudProviderStr: options.cloud ?? "",
|
|
43480
|
+
schedulerPlacement,
|
|
43481
|
+
verbose: options.verbose ?? false,
|
|
43482
|
+
proxyId: options.proxy?.proxyId,
|
|
43483
|
+
name: options.name
|
|
43484
|
+
}
|
|
43485
|
+
});
|
|
43486
|
+
}
|
|
42738
43487
|
var App2 = class _App {
|
|
42739
43488
|
appId;
|
|
42740
43489
|
name;
|
|
@@ -42759,113 +43508,15 @@ var App2 = class _App {
|
|
|
42759
43508
|
}
|
|
42760
43509
|
}
|
|
42761
43510
|
async createSandbox(image, options = {}) {
|
|
42762
|
-
const gpuConfig = parseGpuConfig(options.gpu);
|
|
42763
|
-
if (options.timeout && options.timeout % 1e3 !== 0) {
|
|
42764
|
-
throw new Error(
|
|
42765
|
-
`timeout must be a multiple of 1000ms, got ${options.timeout}`
|
|
42766
|
-
);
|
|
42767
|
-
}
|
|
42768
|
-
if (options.idleTimeout && options.idleTimeout % 1e3 !== 0) {
|
|
42769
|
-
throw new Error(
|
|
42770
|
-
`idleTimeout must be a multiple of 1000ms, got ${options.idleTimeout}`
|
|
42771
|
-
);
|
|
42772
|
-
}
|
|
42773
43511
|
await image.build(this);
|
|
42774
|
-
|
|
42775
|
-
|
|
42776
|
-
|
|
42777
|
-
|
|
42778
|
-
|
|
42779
|
-
const volumeMounts = options.volumes ? Object.entries(options.volumes).map(([mountPath, volume]) => ({
|
|
42780
|
-
volumeId: volume.volumeId,
|
|
42781
|
-
mountPath,
|
|
42782
|
-
allowBackgroundCommits: true,
|
|
42783
|
-
readOnly: volume.isReadOnly
|
|
42784
|
-
})) : [];
|
|
42785
|
-
const cloudBucketMounts = options.cloudBucketMounts ? Object.entries(options.cloudBucketMounts).map(
|
|
42786
|
-
([mountPath, mount]) => cloudBucketMountToProto(mount, mountPath)
|
|
42787
|
-
) : [];
|
|
42788
|
-
const openPorts = [];
|
|
42789
|
-
if (options.encryptedPorts) {
|
|
42790
|
-
openPorts.push(
|
|
42791
|
-
...options.encryptedPorts.map((port) => ({
|
|
42792
|
-
port,
|
|
42793
|
-
unencrypted: false
|
|
42794
|
-
}))
|
|
42795
|
-
);
|
|
42796
|
-
}
|
|
42797
|
-
if (options.h2Ports) {
|
|
42798
|
-
openPorts.push(
|
|
42799
|
-
...options.h2Ports.map((port) => ({
|
|
42800
|
-
port,
|
|
42801
|
-
unencrypted: false,
|
|
42802
|
-
tunnelType: 1 /* TUNNEL_TYPE_H2 */
|
|
42803
|
-
}))
|
|
42804
|
-
);
|
|
42805
|
-
}
|
|
42806
|
-
if (options.unencryptedPorts) {
|
|
42807
|
-
openPorts.push(
|
|
42808
|
-
...options.unencryptedPorts.map((port) => ({
|
|
42809
|
-
port,
|
|
42810
|
-
unencrypted: true
|
|
42811
|
-
}))
|
|
42812
|
-
);
|
|
42813
|
-
}
|
|
42814
|
-
const secretIds = options.secrets ? options.secrets.map((secret) => secret.secretId) : [];
|
|
42815
|
-
let networkAccess;
|
|
42816
|
-
if (options.blockNetwork) {
|
|
42817
|
-
if (options.cidrAllowlist) {
|
|
42818
|
-
throw new Error(
|
|
42819
|
-
"cidrAllowlist cannot be used when blockNetwork is enabled"
|
|
42820
|
-
);
|
|
42821
|
-
}
|
|
42822
|
-
networkAccess = {
|
|
42823
|
-
networkAccessType: 2 /* BLOCKED */,
|
|
42824
|
-
allowedCidrs: []
|
|
42825
|
-
};
|
|
42826
|
-
} else if (options.cidrAllowlist) {
|
|
42827
|
-
networkAccess = {
|
|
42828
|
-
networkAccessType: 3 /* ALLOWLIST */,
|
|
42829
|
-
allowedCidrs: options.cidrAllowlist
|
|
42830
|
-
};
|
|
42831
|
-
} else {
|
|
42832
|
-
networkAccess = {
|
|
42833
|
-
networkAccessType: 1 /* OPEN */,
|
|
42834
|
-
allowedCidrs: []
|
|
42835
|
-
};
|
|
42836
|
-
}
|
|
42837
|
-
const schedulerPlacement = SchedulerPlacement.create({
|
|
42838
|
-
regions: options.regions ?? []
|
|
42839
|
-
});
|
|
43512
|
+
const createReq = await buildSandboxCreateRequestProto(
|
|
43513
|
+
this.appId,
|
|
43514
|
+
image.imageId,
|
|
43515
|
+
options
|
|
43516
|
+
);
|
|
42840
43517
|
let createResp;
|
|
42841
43518
|
try {
|
|
42842
|
-
createResp = await client.sandboxCreate(
|
|
42843
|
-
appId: this.appId,
|
|
42844
|
-
definition: {
|
|
42845
|
-
// Sleep default is implicit in image builder version <=2024.10
|
|
42846
|
-
entrypointArgs: options.command ?? ["sleep", "48h"],
|
|
42847
|
-
imageId: image.imageId,
|
|
42848
|
-
timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
|
|
42849
|
-
idleTimeoutSecs: options.idleTimeout != void 0 ? options.idleTimeout / 1e3 : void 0,
|
|
42850
|
-
workdir: options.workdir ?? void 0,
|
|
42851
|
-
networkAccess,
|
|
42852
|
-
resources: {
|
|
42853
|
-
// https://modal.com/docs/guide/resources
|
|
42854
|
-
milliCpu: Math.round(1e3 * (options.cpu ?? 0.125)),
|
|
42855
|
-
memoryMb: options.memory ?? 128,
|
|
42856
|
-
gpuConfig
|
|
42857
|
-
},
|
|
42858
|
-
volumeMounts,
|
|
42859
|
-
cloudBucketMounts,
|
|
42860
|
-
secretIds,
|
|
42861
|
-
openPorts: openPorts.length > 0 ? { ports: openPorts } : void 0,
|
|
42862
|
-
cloudProviderStr: options.cloud ?? "",
|
|
42863
|
-
schedulerPlacement,
|
|
42864
|
-
verbose: options.verbose ?? false,
|
|
42865
|
-
proxyId: options.proxy?.proxyId,
|
|
42866
|
-
name: options.name
|
|
42867
|
-
}
|
|
42868
|
-
});
|
|
43519
|
+
createResp = await client.sandboxCreate(createReq);
|
|
42869
43520
|
} catch (err) {
|
|
42870
43521
|
if (err instanceof import_nice_grpc6.ClientError && err.code === import_nice_grpc6.Status.ALREADY_EXISTS) {
|
|
42871
43522
|
throw new AlreadyExistsError(err.details || err.message);
|
|
@@ -43796,7 +44447,7 @@ var Cls = class _Cls {
|
|
|
43796
44447
|
/** Bind parameters to the Cls function. */
|
|
43797
44448
|
async #bindParameters(params) {
|
|
43798
44449
|
const serializedParams = encodeParameterSet(this.#schema, params);
|
|
43799
|
-
const functionOptions = buildFunctionOptionsProto(this.#options);
|
|
44450
|
+
const functionOptions = await buildFunctionOptionsProto(this.#options);
|
|
43800
44451
|
const bindResp = await client.functionBindParams({
|
|
43801
44452
|
functionId: this.#serviceFunctionId,
|
|
43802
44453
|
serializedParams,
|
|
@@ -43821,7 +44472,7 @@ function mergeServiceOptions(base, diff) {
|
|
|
43821
44472
|
const merged = { ...base ?? {}, ...filteredDiff };
|
|
43822
44473
|
return Object.keys(merged).length === 0 ? void 0 : merged;
|
|
43823
44474
|
}
|
|
43824
|
-
function buildFunctionOptionsProto(options) {
|
|
44475
|
+
async function buildFunctionOptionsProto(options) {
|
|
43825
44476
|
if (!options) return void 0;
|
|
43826
44477
|
const o = options ?? {};
|
|
43827
44478
|
const gpuConfig = parseGpuConfig(o.gpu);
|
|
@@ -43830,7 +44481,8 @@ function buildFunctionOptionsProto(options) {
|
|
|
43830
44481
|
memoryMb: o.memory,
|
|
43831
44482
|
gpuConfig
|
|
43832
44483
|
} : void 0;
|
|
43833
|
-
const
|
|
44484
|
+
const mergedSecrets = await mergeEnvAndSecrets(o.env, o.secrets);
|
|
44485
|
+
const secretIds = mergedSecrets.map((s) => s.secretId);
|
|
43834
44486
|
const volumeMounts = o.volumes ? Object.entries(o.volumes).map(([mountPath, volume]) => ({
|
|
43835
44487
|
volumeId: volume.volumeId,
|
|
43836
44488
|
mountPath,
|