modal 0.3.23 → 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 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
  };
@@ -25062,7 +25267,9 @@ function createBaseMethodDefinition() {
25062
25267
  webUrl: "",
25063
25268
  webUrlInfo: void 0,
25064
25269
  customDomainInfo: [],
25065
- functionSchema: void 0
25270
+ functionSchema: void 0,
25271
+ supportedInputFormats: [],
25272
+ supportedOutputFormats: []
25066
25273
  };
25067
25274
  }
25068
25275
  var MethodDefinition = {
@@ -25088,6 +25295,16 @@ var MethodDefinition = {
25088
25295
  if (message.functionSchema !== void 0) {
25089
25296
  FunctionSchema.encode(message.functionSchema, writer.uint32(58).fork()).join();
25090
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();
25091
25308
  return writer;
25092
25309
  },
25093
25310
  decode(input, length) {
@@ -25146,6 +25363,34 @@ var MethodDefinition = {
25146
25363
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
25147
25364
  continue;
25148
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
+ }
25149
25394
  }
25150
25395
  if ((tag & 7) === 4 || tag === 0) {
25151
25396
  break;
@@ -25162,7 +25407,9 @@ var MethodDefinition = {
25162
25407
  webUrl: isSet3(object.webUrl) ? globalThis.String(object.webUrl) : "",
25163
25408
  webUrlInfo: isSet3(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
25164
25409
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
25165
- 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)) : []
25166
25413
  };
25167
25414
  },
25168
25415
  toJSON(message) {
@@ -25188,6 +25435,12 @@ var MethodDefinition = {
25188
25435
  if (message.functionSchema !== void 0) {
25189
25436
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
25190
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
+ }
25191
25444
  return obj;
25192
25445
  },
25193
25446
  create(base) {
@@ -25202,6 +25455,8 @@ var MethodDefinition = {
25202
25455
  message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
25203
25456
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
25204
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) || [];
25205
25460
  return message;
25206
25461
  }
25207
25462
  };
@@ -32666,6 +32921,108 @@ var SandboxTag = {
32666
32921
  return message;
32667
32922
  }
32668
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
+ };
32669
33026
  function createBaseSandboxTagsSetRequest() {
32670
33027
  return { environmentName: "", sandboxId: "", tags: [] };
32671
33028
  }
@@ -41260,6 +41617,14 @@ var ModalClientDefinition = {
41260
41617
  responseStream: false,
41261
41618
  options: {}
41262
41619
  },
41620
+ sandboxTagsGet: {
41621
+ name: "SandboxTagsGet",
41622
+ requestType: SandboxTagsGetRequest,
41623
+ requestStream: false,
41624
+ responseType: SandboxTagsGetResponse,
41625
+ responseStream: false,
41626
+ options: {}
41627
+ },
41263
41628
  sandboxTagsSet: {
41264
41629
  name: "SandboxTagsSet",
41265
41630
  requestType: SandboxTagsSetRequest,
@@ -41984,6 +42349,13 @@ var Secret = class _Secret {
41984
42349
  }
41985
42350
  }
41986
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
+ }
41987
42359
 
41988
42360
  // src/image.ts
41989
42361
  var import_nice_grpc3 = require("nice-grpc");
@@ -42001,6 +42373,7 @@ var Image2 = class _Image {
42001
42373
  this.#layers = layers || [
42002
42374
  {
42003
42375
  commands: [],
42376
+ env: void 0,
42004
42377
  secrets: void 0,
42005
42378
  gpuConfig: void 0,
42006
42379
  forceBuild: false
@@ -42117,6 +42490,7 @@ var Image2 = class _Image {
42117
42490
  _Image.validateDockerfileCommands(commands);
42118
42491
  const newLayer = {
42119
42492
  commands: [...commands],
42493
+ env: options?.env,
42120
42494
  secrets: options?.secrets,
42121
42495
  gpuConfig: options?.gpu ? parseGpuConfig(options.gpu) : void 0,
42122
42496
  forceBuild: options?.forceBuild
@@ -42138,7 +42512,8 @@ var Image2 = class _Image {
42138
42512
  let baseImageId;
42139
42513
  for (let i = 0; i < this.#layers.length; i++) {
42140
42514
  const layer = this.#layers[i];
42141
- const secretIds = layer.secrets?.map((secret) => secret.secretId) || [];
42515
+ const mergedSecrets = await mergeEnvAndSecrets(layer.env, layer.secrets);
42516
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
42142
42517
  const gpuConfig = layer.gpuConfig;
42143
42518
  let dockerfileCommands;
42144
42519
  let baseImages;
@@ -42469,8 +42844,12 @@ function defaultSandboxPTYInfo() {
42469
42844
  noTerminateOnIdleStdin: true
42470
42845
  });
42471
42846
  }
42472
- function containerExecRequestProto(taskId, command, options) {
42473
- const secretIds = options?.secrets ? options.secrets.map((secret) => secret.secretId) : [];
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);
42474
42853
  let ptyInfo;
42475
42854
  if (options?.pty) {
42476
42855
  ptyInfo = defaultSandboxPTYInfo();
@@ -42525,6 +42904,23 @@ var Sandbox2 = class _Sandbox {
42525
42904
  throw err;
42526
42905
  }
42527
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
+ }
42528
42924
  /** Returns a running Sandbox object from an ID.
42529
42925
  *
42530
42926
  * @returns Sandbox with ID
@@ -42588,7 +42984,7 @@ var Sandbox2 = class _Sandbox {
42588
42984
  }
42589
42985
  async exec(command, options) {
42590
42986
  const taskId = await this.#getTaskId();
42591
- const req = containerExecRequestProto(taskId, command, options);
42987
+ const req = await buildContainerExecRequestProto(taskId, command, options);
42592
42988
  const resp = await client.containerExec(req);
42593
42989
  return new ContainerProcess(resp.execId, options);
42594
42990
  }
@@ -42976,7 +43372,7 @@ function parseGpuConfig(gpu) {
42976
43372
  gpuType: gpuType.toUpperCase()
42977
43373
  };
42978
43374
  }
42979
- function sandboxCreateRequestProto(appId, imageId, options = {}) {
43375
+ async function buildSandboxCreateRequestProto(appId, imageId, options = {}) {
42980
43376
  const gpuConfig = parseGpuConfig(options.gpu);
42981
43377
  if (options.timeout && options.timeout % 1e3 !== 0) {
42982
43378
  throw new Error(
@@ -43028,7 +43424,8 @@ function sandboxCreateRequestProto(appId, imageId, options = {}) {
43028
43424
  }))
43029
43425
  );
43030
43426
  }
43031
- const secretIds = options.secrets ? options.secrets.map((secret) => secret.secretId) : [];
43427
+ const mergedSecrets = await mergeEnvAndSecrets(options.env, options.secrets);
43428
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
43032
43429
  let networkAccess;
43033
43430
  if (options.blockNetwork) {
43034
43431
  if (options.cidrAllowlist) {
@@ -43112,7 +43509,7 @@ var App2 = class _App {
43112
43509
  }
43113
43510
  async createSandbox(image, options = {}) {
43114
43511
  await image.build(this);
43115
- const createReq = sandboxCreateRequestProto(
43512
+ const createReq = await buildSandboxCreateRequestProto(
43116
43513
  this.appId,
43117
43514
  image.imageId,
43118
43515
  options
@@ -44050,7 +44447,7 @@ var Cls = class _Cls {
44050
44447
  /** Bind parameters to the Cls function. */
44051
44448
  async #bindParameters(params) {
44052
44449
  const serializedParams = encodeParameterSet(this.#schema, params);
44053
- const functionOptions = buildFunctionOptionsProto(this.#options);
44450
+ const functionOptions = await buildFunctionOptionsProto(this.#options);
44054
44451
  const bindResp = await client.functionBindParams({
44055
44452
  functionId: this.#serviceFunctionId,
44056
44453
  serializedParams,
@@ -44075,7 +44472,7 @@ function mergeServiceOptions(base, diff) {
44075
44472
  const merged = { ...base ?? {}, ...filteredDiff };
44076
44473
  return Object.keys(merged).length === 0 ? void 0 : merged;
44077
44474
  }
44078
- function buildFunctionOptionsProto(options) {
44475
+ async function buildFunctionOptionsProto(options) {
44079
44476
  if (!options) return void 0;
44080
44477
  const o = options ?? {};
44081
44478
  const gpuConfig = parseGpuConfig(o.gpu);
@@ -44084,7 +44481,8 @@ function buildFunctionOptionsProto(options) {
44084
44481
  memoryMb: o.memory,
44085
44482
  gpuConfig
44086
44483
  } : void 0;
44087
- const secretIds = o.secrets ? o.secrets.map((s) => s.secretId) : [];
44484
+ const mergedSecrets = await mergeEnvAndSecrets(o.env, o.secrets);
44485
+ const secretIds = mergedSecrets.map((s) => s.secretId);
44088
44486
  const volumeMounts = o.volumes ? Object.entries(o.volumes).map(([mountPath, volume]) => ({
44089
44487
  volumeId: volume.volumeId,
44090
44488
  mountPath,