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.js CHANGED
@@ -1572,6 +1572,9 @@ function dataFormatFromJSON(object) {
1572
1572
  case 3:
1573
1573
  case "DATA_FORMAT_GENERATOR_DONE":
1574
1574
  return 3 /* DATA_FORMAT_GENERATOR_DONE */;
1575
+ case 4:
1576
+ case "DATA_FORMAT_CBOR":
1577
+ return 4 /* DATA_FORMAT_CBOR */;
1575
1578
  case -1:
1576
1579
  case "UNRECOGNIZED":
1577
1580
  default:
@@ -1588,6 +1591,8 @@ function dataFormatToJSON(object) {
1588
1591
  return "DATA_FORMAT_ASGI";
1589
1592
  case 3 /* DATA_FORMAT_GENERATOR_DONE */:
1590
1593
  return "DATA_FORMAT_GENERATOR_DONE";
1594
+ case 4 /* DATA_FORMAT_CBOR */:
1595
+ return "DATA_FORMAT_CBOR";
1591
1596
  case -1 /* UNRECOGNIZED */:
1592
1597
  default:
1593
1598
  return "UNRECOGNIZED";
@@ -14726,7 +14731,9 @@ function createBaseFunctionMessage() {
14726
14731
  flashServiceUrls: [],
14727
14732
  flashServiceLabel: "",
14728
14733
  enableGpuSnapshot: false,
14729
- startupTimeoutSecs: 0
14734
+ startupTimeoutSecs: 0,
14735
+ supportedInputFormats: [],
14736
+ supportedOutputFormats: []
14730
14737
  };
14731
14738
  }
14732
14739
  var FunctionMessage = {
@@ -14950,6 +14957,16 @@ var FunctionMessage = {
14950
14957
  if (message.startupTimeoutSecs !== 0) {
14951
14958
  writer.uint32(688).uint32(message.startupTimeoutSecs);
14952
14959
  }
14960
+ writer.uint32(698).fork();
14961
+ for (const v of message.supportedInputFormats) {
14962
+ writer.int32(v);
14963
+ }
14964
+ writer.join();
14965
+ writer.uint32(706).fork();
14966
+ for (const v of message.supportedOutputFormats) {
14967
+ writer.int32(v);
14968
+ }
14969
+ writer.join();
14953
14970
  return writer;
14954
14971
  },
14955
14972
  decode(input, length) {
@@ -15476,6 +15493,34 @@ var FunctionMessage = {
15476
15493
  message.startupTimeoutSecs = reader.uint32();
15477
15494
  continue;
15478
15495
  }
15496
+ case 87: {
15497
+ if (tag === 696) {
15498
+ message.supportedInputFormats.push(reader.int32());
15499
+ continue;
15500
+ }
15501
+ if (tag === 698) {
15502
+ const end2 = reader.uint32() + reader.pos;
15503
+ while (reader.pos < end2) {
15504
+ message.supportedInputFormats.push(reader.int32());
15505
+ }
15506
+ continue;
15507
+ }
15508
+ break;
15509
+ }
15510
+ case 88: {
15511
+ if (tag === 704) {
15512
+ message.supportedOutputFormats.push(reader.int32());
15513
+ continue;
15514
+ }
15515
+ if (tag === 706) {
15516
+ const end2 = reader.uint32() + reader.pos;
15517
+ while (reader.pos < end2) {
15518
+ message.supportedOutputFormats.push(reader.int32());
15519
+ }
15520
+ continue;
15521
+ }
15522
+ break;
15523
+ }
15479
15524
  }
15480
15525
  if ((tag & 7) === 4 || tag === 0) {
15481
15526
  break;
@@ -15564,7 +15609,9 @@ var FunctionMessage = {
15564
15609
  flashServiceUrls: globalThis.Array.isArray(object?.flashServiceUrls) ? object.flashServiceUrls.map((e) => globalThis.String(e)) : [],
15565
15610
  flashServiceLabel: isSet3(object.flashServiceLabel) ? globalThis.String(object.flashServiceLabel) : "",
15566
15611
  enableGpuSnapshot: isSet3(object.enableGpuSnapshot) ? globalThis.Boolean(object.enableGpuSnapshot) : false,
15567
- startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0
15612
+ startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0,
15613
+ supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
15614
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
15568
15615
  };
15569
15616
  },
15570
15617
  toJSON(message) {
@@ -15800,6 +15847,12 @@ var FunctionMessage = {
15800
15847
  if (message.startupTimeoutSecs !== 0) {
15801
15848
  obj.startupTimeoutSecs = Math.round(message.startupTimeoutSecs);
15802
15849
  }
15850
+ if (message.supportedInputFormats?.length) {
15851
+ obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
15852
+ }
15853
+ if (message.supportedOutputFormats?.length) {
15854
+ obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
15855
+ }
15803
15856
  return obj;
15804
15857
  },
15805
15858
  create(base) {
@@ -15893,6 +15946,8 @@ var FunctionMessage = {
15893
15946
  message.flashServiceLabel = object.flashServiceLabel ?? "";
15894
15947
  message.enableGpuSnapshot = object.enableGpuSnapshot ?? false;
15895
15948
  message.startupTimeoutSecs = object.startupTimeoutSecs ?? 0;
15949
+ message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
15950
+ message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
15896
15951
  return message;
15897
15952
  }
15898
15953
  };
@@ -17401,7 +17456,9 @@ function createBaseFunctionData() {
17401
17456
  experimentalOptions: {},
17402
17457
  flashServiceUrls: [],
17403
17458
  flashServiceLabel: "",
17404
- startupTimeoutSecs: 0
17459
+ startupTimeoutSecs: 0,
17460
+ supportedInputFormats: [],
17461
+ supportedOutputFormats: []
17405
17462
  };
17406
17463
  }
17407
17464
  var FunctionData = {
@@ -17511,6 +17568,16 @@ var FunctionData = {
17511
17568
  if (message.startupTimeoutSecs !== 0) {
17512
17569
  writer.uint32(288).uint32(message.startupTimeoutSecs);
17513
17570
  }
17571
+ writer.uint32(298).fork();
17572
+ for (const v of message.supportedInputFormats) {
17573
+ writer.int32(v);
17574
+ }
17575
+ writer.join();
17576
+ writer.uint32(306).fork();
17577
+ for (const v of message.supportedOutputFormats) {
17578
+ writer.int32(v);
17579
+ }
17580
+ writer.join();
17514
17581
  return writer;
17515
17582
  },
17516
17583
  decode(input, length) {
@@ -17771,6 +17838,34 @@ var FunctionData = {
17771
17838
  message.startupTimeoutSecs = reader.uint32();
17772
17839
  continue;
17773
17840
  }
17841
+ case 37: {
17842
+ if (tag === 296) {
17843
+ message.supportedInputFormats.push(reader.int32());
17844
+ continue;
17845
+ }
17846
+ if (tag === 298) {
17847
+ const end2 = reader.uint32() + reader.pos;
17848
+ while (reader.pos < end2) {
17849
+ message.supportedInputFormats.push(reader.int32());
17850
+ }
17851
+ continue;
17852
+ }
17853
+ break;
17854
+ }
17855
+ case 38: {
17856
+ if (tag === 304) {
17857
+ message.supportedOutputFormats.push(reader.int32());
17858
+ continue;
17859
+ }
17860
+ if (tag === 306) {
17861
+ const end2 = reader.uint32() + reader.pos;
17862
+ while (reader.pos < end2) {
17863
+ message.supportedOutputFormats.push(reader.int32());
17864
+ }
17865
+ continue;
17866
+ }
17867
+ break;
17868
+ }
17774
17869
  }
17775
17870
  if ((tag & 7) === 4 || tag === 0) {
17776
17871
  break;
@@ -17821,7 +17916,9 @@ var FunctionData = {
17821
17916
  }, {}) : {},
17822
17917
  flashServiceUrls: globalThis.Array.isArray(object?.flashServiceUrls) ? object.flashServiceUrls.map((e) => globalThis.String(e)) : [],
17823
17918
  flashServiceLabel: isSet3(object.flashServiceLabel) ? globalThis.String(object.flashServiceLabel) : "",
17824
- startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0
17919
+ startupTimeoutSecs: isSet3(object.startupTimeoutSecs) ? globalThis.Number(object.startupTimeoutSecs) : 0,
17920
+ supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
17921
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
17825
17922
  };
17826
17923
  },
17827
17924
  toJSON(message) {
@@ -17943,6 +18040,12 @@ var FunctionData = {
17943
18040
  if (message.startupTimeoutSecs !== 0) {
17944
18041
  obj.startupTimeoutSecs = Math.round(message.startupTimeoutSecs);
17945
18042
  }
18043
+ if (message.supportedInputFormats?.length) {
18044
+ obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
18045
+ }
18046
+ if (message.supportedOutputFormats?.length) {
18047
+ obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
18048
+ }
17946
18049
  return obj;
17947
18050
  },
17948
18051
  create(base) {
@@ -17998,6 +18101,8 @@ var FunctionData = {
17998
18101
  message.flashServiceUrls = object.flashServiceUrls?.map((e) => e) || [];
17999
18102
  message.flashServiceLabel = object.flashServiceLabel ?? "";
18000
18103
  message.startupTimeoutSecs = object.startupTimeoutSecs ?? 0;
18104
+ message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
18105
+ message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
18001
18106
  return message;
18002
18107
  }
18003
18108
  };
@@ -19728,7 +19833,9 @@ function createBaseFunctionHandleMetadata() {
19728
19833
  inputPlaneUrl: void 0,
19729
19834
  inputPlaneRegion: void 0,
19730
19835
  maxObjectSizeBytes: void 0,
19731
- ExperimentalFlashUrls: []
19836
+ ExperimentalFlashUrls: [],
19837
+ supportedInputFormats: [],
19838
+ supportedOutputFormats: []
19732
19839
  };
19733
19840
  }
19734
19841
  var FunctionHandleMetadata = {
@@ -19775,6 +19882,16 @@ var FunctionHandleMetadata = {
19775
19882
  for (const v of message.ExperimentalFlashUrls) {
19776
19883
  writer.uint32(394).string(v);
19777
19884
  }
19885
+ writer.uint32(402).fork();
19886
+ for (const v of message.supportedInputFormats) {
19887
+ writer.int32(v);
19888
+ }
19889
+ writer.join();
19890
+ writer.uint32(410).fork();
19891
+ for (const v of message.supportedOutputFormats) {
19892
+ writer.int32(v);
19893
+ }
19894
+ writer.join();
19778
19895
  return writer;
19779
19896
  },
19780
19897
  decode(input, length) {
@@ -19885,6 +20002,34 @@ var FunctionHandleMetadata = {
19885
20002
  message.ExperimentalFlashUrls.push(reader.string());
19886
20003
  continue;
19887
20004
  }
20005
+ case 50: {
20006
+ if (tag === 400) {
20007
+ message.supportedInputFormats.push(reader.int32());
20008
+ continue;
20009
+ }
20010
+ if (tag === 402) {
20011
+ const end2 = reader.uint32() + reader.pos;
20012
+ while (reader.pos < end2) {
20013
+ message.supportedInputFormats.push(reader.int32());
20014
+ }
20015
+ continue;
20016
+ }
20017
+ break;
20018
+ }
20019
+ case 51: {
20020
+ if (tag === 408) {
20021
+ message.supportedOutputFormats.push(reader.int32());
20022
+ continue;
20023
+ }
20024
+ if (tag === 410) {
20025
+ const end2 = reader.uint32() + reader.pos;
20026
+ while (reader.pos < end2) {
20027
+ message.supportedOutputFormats.push(reader.int32());
20028
+ }
20029
+ continue;
20030
+ }
20031
+ break;
20032
+ }
19888
20033
  }
19889
20034
  if ((tag & 7) === 4 || tag === 0) {
19890
20035
  break;
@@ -19914,7 +20059,9 @@ var FunctionHandleMetadata = {
19914
20059
  inputPlaneUrl: isSet3(object.inputPlaneUrl) ? globalThis.String(object.inputPlaneUrl) : void 0,
19915
20060
  inputPlaneRegion: isSet3(object.inputPlaneRegion) ? globalThis.String(object.inputPlaneRegion) : void 0,
19916
20061
  maxObjectSizeBytes: isSet3(object.maxObjectSizeBytes) ? globalThis.Number(object.maxObjectSizeBytes) : void 0,
19917
- ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : []
20062
+ ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : [],
20063
+ supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
20064
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
19918
20065
  };
19919
20066
  },
19920
20067
  toJSON(message) {
@@ -19967,6 +20114,12 @@ var FunctionHandleMetadata = {
19967
20114
  if (message.ExperimentalFlashUrls?.length) {
19968
20115
  obj.ExperimentalFlashUrls = message.ExperimentalFlashUrls;
19969
20116
  }
20117
+ if (message.supportedInputFormats?.length) {
20118
+ obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
20119
+ }
20120
+ if (message.supportedOutputFormats?.length) {
20121
+ obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
20122
+ }
19970
20123
  return obj;
19971
20124
  },
19972
20125
  create(base) {
@@ -19993,6 +20146,8 @@ var FunctionHandleMetadata = {
19993
20146
  message.inputPlaneRegion = object.inputPlaneRegion ?? void 0;
19994
20147
  message.maxObjectSizeBytes = object.maxObjectSizeBytes ?? void 0;
19995
20148
  message.ExperimentalFlashUrls = object.ExperimentalFlashUrls?.map((e) => e) || [];
20149
+ message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
20150
+ message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
19996
20151
  return message;
19997
20152
  }
19998
20153
  };
@@ -20800,7 +20955,9 @@ function createBaseFunctionPrecreateRequest() {
20800
20955
  useFunctionId: "",
20801
20956
  useMethodName: "",
20802
20957
  methodDefinitions: {},
20803
- functionSchema: void 0
20958
+ functionSchema: void 0,
20959
+ supportedInputFormats: [],
20960
+ supportedOutputFormats: []
20804
20961
  };
20805
20962
  }
20806
20963
  var FunctionPrecreateRequest = {
@@ -20832,6 +20989,16 @@ var FunctionPrecreateRequest = {
20832
20989
  if (message.functionSchema !== void 0) {
20833
20990
  FunctionSchema.encode(message.functionSchema, writer.uint32(74).fork()).join();
20834
20991
  }
20992
+ writer.uint32(82).fork();
20993
+ for (const v of message.supportedInputFormats) {
20994
+ writer.int32(v);
20995
+ }
20996
+ writer.join();
20997
+ writer.uint32(90).fork();
20998
+ for (const v of message.supportedOutputFormats) {
20999
+ writer.int32(v);
21000
+ }
21001
+ writer.join();
20835
21002
  return writer;
20836
21003
  },
20837
21004
  decode(input, length) {
@@ -20907,6 +21074,34 @@ var FunctionPrecreateRequest = {
20907
21074
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
20908
21075
  continue;
20909
21076
  }
21077
+ case 10: {
21078
+ if (tag === 80) {
21079
+ message.supportedInputFormats.push(reader.int32());
21080
+ continue;
21081
+ }
21082
+ if (tag === 82) {
21083
+ const end2 = reader.uint32() + reader.pos;
21084
+ while (reader.pos < end2) {
21085
+ message.supportedInputFormats.push(reader.int32());
21086
+ }
21087
+ continue;
21088
+ }
21089
+ break;
21090
+ }
21091
+ case 11: {
21092
+ if (tag === 88) {
21093
+ message.supportedOutputFormats.push(reader.int32());
21094
+ continue;
21095
+ }
21096
+ if (tag === 90) {
21097
+ const end2 = reader.uint32() + reader.pos;
21098
+ while (reader.pos < end2) {
21099
+ message.supportedOutputFormats.push(reader.int32());
21100
+ }
21101
+ continue;
21102
+ }
21103
+ break;
21104
+ }
20910
21105
  }
20911
21106
  if ((tag & 7) === 4 || tag === 0) {
20912
21107
  break;
@@ -20928,7 +21123,9 @@ var FunctionPrecreateRequest = {
20928
21123
  acc[key] = MethodDefinition.fromJSON(value);
20929
21124
  return acc;
20930
21125
  }, {}) : {},
20931
- functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0
21126
+ functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
21127
+ supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
21128
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
20932
21129
  };
20933
21130
  },
20934
21131
  toJSON(message) {
@@ -20966,6 +21163,12 @@ var FunctionPrecreateRequest = {
20966
21163
  if (message.functionSchema !== void 0) {
20967
21164
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
20968
21165
  }
21166
+ if (message.supportedInputFormats?.length) {
21167
+ obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
21168
+ }
21169
+ if (message.supportedOutputFormats?.length) {
21170
+ obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
21171
+ }
20969
21172
  return obj;
20970
21173
  },
20971
21174
  create(base) {
@@ -20987,6 +21190,8 @@ var FunctionPrecreateRequest = {
20987
21190
  return acc;
20988
21191
  }, {});
20989
21192
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
21193
+ message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
21194
+ message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
20990
21195
  return message;
20991
21196
  }
20992
21197
  };
@@ -25002,7 +25207,9 @@ function createBaseMethodDefinition() {
25002
25207
  webUrl: "",
25003
25208
  webUrlInfo: void 0,
25004
25209
  customDomainInfo: [],
25005
- functionSchema: void 0
25210
+ functionSchema: void 0,
25211
+ supportedInputFormats: [],
25212
+ supportedOutputFormats: []
25006
25213
  };
25007
25214
  }
25008
25215
  var MethodDefinition = {
@@ -25028,6 +25235,16 @@ var MethodDefinition = {
25028
25235
  if (message.functionSchema !== void 0) {
25029
25236
  FunctionSchema.encode(message.functionSchema, writer.uint32(58).fork()).join();
25030
25237
  }
25238
+ writer.uint32(66).fork();
25239
+ for (const v of message.supportedInputFormats) {
25240
+ writer.int32(v);
25241
+ }
25242
+ writer.join();
25243
+ writer.uint32(74).fork();
25244
+ for (const v of message.supportedOutputFormats) {
25245
+ writer.int32(v);
25246
+ }
25247
+ writer.join();
25031
25248
  return writer;
25032
25249
  },
25033
25250
  decode(input, length) {
@@ -25086,6 +25303,34 @@ var MethodDefinition = {
25086
25303
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
25087
25304
  continue;
25088
25305
  }
25306
+ case 8: {
25307
+ if (tag === 64) {
25308
+ message.supportedInputFormats.push(reader.int32());
25309
+ continue;
25310
+ }
25311
+ if (tag === 66) {
25312
+ const end2 = reader.uint32() + reader.pos;
25313
+ while (reader.pos < end2) {
25314
+ message.supportedInputFormats.push(reader.int32());
25315
+ }
25316
+ continue;
25317
+ }
25318
+ break;
25319
+ }
25320
+ case 9: {
25321
+ if (tag === 72) {
25322
+ message.supportedOutputFormats.push(reader.int32());
25323
+ continue;
25324
+ }
25325
+ if (tag === 74) {
25326
+ const end2 = reader.uint32() + reader.pos;
25327
+ while (reader.pos < end2) {
25328
+ message.supportedOutputFormats.push(reader.int32());
25329
+ }
25330
+ continue;
25331
+ }
25332
+ break;
25333
+ }
25089
25334
  }
25090
25335
  if ((tag & 7) === 4 || tag === 0) {
25091
25336
  break;
@@ -25102,7 +25347,9 @@ var MethodDefinition = {
25102
25347
  webUrl: isSet3(object.webUrl) ? globalThis.String(object.webUrl) : "",
25103
25348
  webUrlInfo: isSet3(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
25104
25349
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
25105
- functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0
25350
+ functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
25351
+ supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
25352
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
25106
25353
  };
25107
25354
  },
25108
25355
  toJSON(message) {
@@ -25128,6 +25375,12 @@ var MethodDefinition = {
25128
25375
  if (message.functionSchema !== void 0) {
25129
25376
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
25130
25377
  }
25378
+ if (message.supportedInputFormats?.length) {
25379
+ obj.supportedInputFormats = message.supportedInputFormats.map((e) => dataFormatToJSON(e));
25380
+ }
25381
+ if (message.supportedOutputFormats?.length) {
25382
+ obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
25383
+ }
25131
25384
  return obj;
25132
25385
  },
25133
25386
  create(base) {
@@ -25142,6 +25395,8 @@ var MethodDefinition = {
25142
25395
  message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
25143
25396
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
25144
25397
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
25398
+ message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
25399
+ message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
25145
25400
  return message;
25146
25401
  }
25147
25402
  };
@@ -32606,6 +32861,108 @@ var SandboxTag = {
32606
32861
  return message;
32607
32862
  }
32608
32863
  };
32864
+ function createBaseSandboxTagsGetRequest() {
32865
+ return { sandboxId: "" };
32866
+ }
32867
+ var SandboxTagsGetRequest = {
32868
+ encode(message, writer = new BinaryWriter()) {
32869
+ if (message.sandboxId !== "") {
32870
+ writer.uint32(10).string(message.sandboxId);
32871
+ }
32872
+ return writer;
32873
+ },
32874
+ decode(input, length) {
32875
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32876
+ let end = length === void 0 ? reader.len : reader.pos + length;
32877
+ const message = createBaseSandboxTagsGetRequest();
32878
+ while (reader.pos < end) {
32879
+ const tag = reader.uint32();
32880
+ switch (tag >>> 3) {
32881
+ case 1: {
32882
+ if (tag !== 10) {
32883
+ break;
32884
+ }
32885
+ message.sandboxId = reader.string();
32886
+ continue;
32887
+ }
32888
+ }
32889
+ if ((tag & 7) === 4 || tag === 0) {
32890
+ break;
32891
+ }
32892
+ reader.skip(tag & 7);
32893
+ }
32894
+ return message;
32895
+ },
32896
+ fromJSON(object) {
32897
+ return { sandboxId: isSet3(object.sandboxId) ? globalThis.String(object.sandboxId) : "" };
32898
+ },
32899
+ toJSON(message) {
32900
+ const obj = {};
32901
+ if (message.sandboxId !== "") {
32902
+ obj.sandboxId = message.sandboxId;
32903
+ }
32904
+ return obj;
32905
+ },
32906
+ create(base) {
32907
+ return SandboxTagsGetRequest.fromPartial(base ?? {});
32908
+ },
32909
+ fromPartial(object) {
32910
+ const message = createBaseSandboxTagsGetRequest();
32911
+ message.sandboxId = object.sandboxId ?? "";
32912
+ return message;
32913
+ }
32914
+ };
32915
+ function createBaseSandboxTagsGetResponse() {
32916
+ return { tags: [] };
32917
+ }
32918
+ var SandboxTagsGetResponse = {
32919
+ encode(message, writer = new BinaryWriter()) {
32920
+ for (const v of message.tags) {
32921
+ SandboxTag.encode(v, writer.uint32(10).fork()).join();
32922
+ }
32923
+ return writer;
32924
+ },
32925
+ decode(input, length) {
32926
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32927
+ let end = length === void 0 ? reader.len : reader.pos + length;
32928
+ const message = createBaseSandboxTagsGetResponse();
32929
+ while (reader.pos < end) {
32930
+ const tag = reader.uint32();
32931
+ switch (tag >>> 3) {
32932
+ case 1: {
32933
+ if (tag !== 10) {
32934
+ break;
32935
+ }
32936
+ message.tags.push(SandboxTag.decode(reader, reader.uint32()));
32937
+ continue;
32938
+ }
32939
+ }
32940
+ if ((tag & 7) === 4 || tag === 0) {
32941
+ break;
32942
+ }
32943
+ reader.skip(tag & 7);
32944
+ }
32945
+ return message;
32946
+ },
32947
+ fromJSON(object) {
32948
+ return { tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e) => SandboxTag.fromJSON(e)) : [] };
32949
+ },
32950
+ toJSON(message) {
32951
+ const obj = {};
32952
+ if (message.tags?.length) {
32953
+ obj.tags = message.tags.map((e) => SandboxTag.toJSON(e));
32954
+ }
32955
+ return obj;
32956
+ },
32957
+ create(base) {
32958
+ return SandboxTagsGetResponse.fromPartial(base ?? {});
32959
+ },
32960
+ fromPartial(object) {
32961
+ const message = createBaseSandboxTagsGetResponse();
32962
+ message.tags = object.tags?.map((e) => SandboxTag.fromPartial(e)) || [];
32963
+ return message;
32964
+ }
32965
+ };
32609
32966
  function createBaseSandboxTagsSetRequest() {
32610
32967
  return { environmentName: "", sandboxId: "", tags: [] };
32611
32968
  }
@@ -41200,6 +41557,14 @@ var ModalClientDefinition = {
41200
41557
  responseStream: false,
41201
41558
  options: {}
41202
41559
  },
41560
+ sandboxTagsGet: {
41561
+ name: "SandboxTagsGet",
41562
+ requestType: SandboxTagsGetRequest,
41563
+ requestStream: false,
41564
+ responseType: SandboxTagsGetResponse,
41565
+ responseStream: false,
41566
+ options: {}
41567
+ },
41203
41568
  sandboxTagsSet: {
41204
41569
  name: "SandboxTagsSet",
41205
41570
  requestType: SandboxTagsSetRequest,
@@ -41930,6 +42295,13 @@ var Secret = class _Secret {
41930
42295
  }
41931
42296
  }
41932
42297
  };
42298
+ async function mergeEnvAndSecrets(env, secrets) {
42299
+ const result = [...secrets || []];
42300
+ if (env && Object.keys(env).length > 0) {
42301
+ result.push(await Secret.fromObject(env));
42302
+ }
42303
+ return result;
42304
+ }
41933
42305
 
41934
42306
  // src/image.ts
41935
42307
  import { ClientError as ClientError3 } from "nice-grpc";
@@ -41947,6 +42319,7 @@ var Image2 = class _Image {
41947
42319
  this.#layers = layers || [
41948
42320
  {
41949
42321
  commands: [],
42322
+ env: void 0,
41950
42323
  secrets: void 0,
41951
42324
  gpuConfig: void 0,
41952
42325
  forceBuild: false
@@ -42063,6 +42436,7 @@ var Image2 = class _Image {
42063
42436
  _Image.validateDockerfileCommands(commands);
42064
42437
  const newLayer = {
42065
42438
  commands: [...commands],
42439
+ env: options?.env,
42066
42440
  secrets: options?.secrets,
42067
42441
  gpuConfig: options?.gpu ? parseGpuConfig(options.gpu) : void 0,
42068
42442
  forceBuild: options?.forceBuild
@@ -42084,7 +42458,8 @@ var Image2 = class _Image {
42084
42458
  let baseImageId;
42085
42459
  for (let i = 0; i < this.#layers.length; i++) {
42086
42460
  const layer = this.#layers[i];
42087
- const secretIds = layer.secrets?.map((secret) => secret.secretId) || [];
42461
+ const mergedSecrets = await mergeEnvAndSecrets(layer.env, layer.secrets);
42462
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
42088
42463
  const gpuConfig = layer.gpuConfig;
42089
42464
  let dockerfileCommands;
42090
42465
  let baseImages;
@@ -42415,8 +42790,12 @@ function defaultSandboxPTYInfo() {
42415
42790
  noTerminateOnIdleStdin: true
42416
42791
  });
42417
42792
  }
42418
- function containerExecRequestProto(taskId, command, options) {
42419
- const secretIds = options?.secrets ? options.secrets.map((secret) => secret.secretId) : [];
42793
+ async function buildContainerExecRequestProto(taskId, command, options) {
42794
+ const mergedSecrets = await mergeEnvAndSecrets(
42795
+ options?.env,
42796
+ options?.secrets
42797
+ );
42798
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
42420
42799
  let ptyInfo;
42421
42800
  if (options?.pty) {
42422
42801
  ptyInfo = defaultSandboxPTYInfo();
@@ -42471,6 +42850,23 @@ var Sandbox2 = class _Sandbox {
42471
42850
  throw err;
42472
42851
  }
42473
42852
  }
42853
+ /** Get tags (key-value pairs) currently attached to this Sandbox from the server. */
42854
+ async getTags() {
42855
+ let resp;
42856
+ try {
42857
+ resp = await client.sandboxTagsGet({ sandboxId: this.sandboxId });
42858
+ } catch (err) {
42859
+ if (err instanceof ClientError4 && err.code === Status4.INVALID_ARGUMENT) {
42860
+ throw new InvalidError(err.details || err.message);
42861
+ }
42862
+ throw err;
42863
+ }
42864
+ const tags = {};
42865
+ for (const tag of resp.tags) {
42866
+ tags[tag.tagName] = tag.tagValue;
42867
+ }
42868
+ return tags;
42869
+ }
42474
42870
  /** Returns a running Sandbox object from an ID.
42475
42871
  *
42476
42872
  * @returns Sandbox with ID
@@ -42534,7 +42930,7 @@ var Sandbox2 = class _Sandbox {
42534
42930
  }
42535
42931
  async exec(command, options) {
42536
42932
  const taskId = await this.#getTaskId();
42537
- const req = containerExecRequestProto(taskId, command, options);
42933
+ const req = await buildContainerExecRequestProto(taskId, command, options);
42538
42934
  const resp = await client.containerExec(req);
42539
42935
  return new ContainerProcess(resp.execId, options);
42540
42936
  }
@@ -42922,7 +43318,7 @@ function parseGpuConfig(gpu) {
42922
43318
  gpuType: gpuType.toUpperCase()
42923
43319
  };
42924
43320
  }
42925
- function sandboxCreateRequestProto(appId, imageId, options = {}) {
43321
+ async function buildSandboxCreateRequestProto(appId, imageId, options = {}) {
42926
43322
  const gpuConfig = parseGpuConfig(options.gpu);
42927
43323
  if (options.timeout && options.timeout % 1e3 !== 0) {
42928
43324
  throw new Error(
@@ -42974,7 +43370,8 @@ function sandboxCreateRequestProto(appId, imageId, options = {}) {
42974
43370
  }))
42975
43371
  );
42976
43372
  }
42977
- const secretIds = options.secrets ? options.secrets.map((secret) => secret.secretId) : [];
43373
+ const mergedSecrets = await mergeEnvAndSecrets(options.env, options.secrets);
43374
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
42978
43375
  let networkAccess;
42979
43376
  if (options.blockNetwork) {
42980
43377
  if (options.cidrAllowlist) {
@@ -43058,7 +43455,7 @@ var App2 = class _App {
43058
43455
  }
43059
43456
  async createSandbox(image, options = {}) {
43060
43457
  await image.build(this);
43061
- const createReq = sandboxCreateRequestProto(
43458
+ const createReq = await buildSandboxCreateRequestProto(
43062
43459
  this.appId,
43063
43460
  image.imageId,
43064
43461
  options
@@ -43996,7 +44393,7 @@ var Cls = class _Cls {
43996
44393
  /** Bind parameters to the Cls function. */
43997
44394
  async #bindParameters(params) {
43998
44395
  const serializedParams = encodeParameterSet(this.#schema, params);
43999
- const functionOptions = buildFunctionOptionsProto(this.#options);
44396
+ const functionOptions = await buildFunctionOptionsProto(this.#options);
44000
44397
  const bindResp = await client.functionBindParams({
44001
44398
  functionId: this.#serviceFunctionId,
44002
44399
  serializedParams,
@@ -44021,7 +44418,7 @@ function mergeServiceOptions(base, diff) {
44021
44418
  const merged = { ...base ?? {}, ...filteredDiff };
44022
44419
  return Object.keys(merged).length === 0 ? void 0 : merged;
44023
44420
  }
44024
- function buildFunctionOptionsProto(options) {
44421
+ async function buildFunctionOptionsProto(options) {
44025
44422
  if (!options) return void 0;
44026
44423
  const o = options ?? {};
44027
44424
  const gpuConfig = parseGpuConfig(o.gpu);
@@ -44030,7 +44427,8 @@ function buildFunctionOptionsProto(options) {
44030
44427
  memoryMb: o.memory,
44031
44428
  gpuConfig
44032
44429
  } : void 0;
44033
- const secretIds = o.secrets ? o.secrets.map((s) => s.secretId) : [];
44430
+ const mergedSecrets = await mergeEnvAndSecrets(o.env, o.secrets);
44431
+ const secretIds = mergedSecrets.map((s) => s.secretId);
44034
44432
  const volumeMounts = o.volumes ? Object.entries(o.volumes).map(([mountPath, volume]) => ({
44035
44433
  volumeId: volume.volumeId,
44036
44434
  mountPath,