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.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
  };
@@ -24355,13 +24560,16 @@ var ListPagination = {
24355
24560
  }
24356
24561
  };
24357
24562
  function createBaseMapAwaitRequest() {
24358
- return { functionCallId: "", lastEntryId: "", requestedAt: 0, timeout: 0 };
24563
+ return { functionCallId: void 0, mapToken: void 0, lastEntryId: "", requestedAt: 0, timeout: 0 };
24359
24564
  }
24360
24565
  var MapAwaitRequest = {
24361
24566
  encode(message, writer = new BinaryWriter()) {
24362
- if (message.functionCallId !== "") {
24567
+ if (message.functionCallId !== void 0) {
24363
24568
  writer.uint32(10).string(message.functionCallId);
24364
24569
  }
24570
+ if (message.mapToken !== void 0) {
24571
+ writer.uint32(42).string(message.mapToken);
24572
+ }
24365
24573
  if (message.lastEntryId !== "") {
24366
24574
  writer.uint32(18).string(message.lastEntryId);
24367
24575
  }
@@ -24387,6 +24595,13 @@ var MapAwaitRequest = {
24387
24595
  message.functionCallId = reader.string();
24388
24596
  continue;
24389
24597
  }
24598
+ case 5: {
24599
+ if (tag !== 42) {
24600
+ break;
24601
+ }
24602
+ message.mapToken = reader.string();
24603
+ continue;
24604
+ }
24390
24605
  case 2: {
24391
24606
  if (tag !== 18) {
24392
24607
  break;
@@ -24418,7 +24633,8 @@ var MapAwaitRequest = {
24418
24633
  },
24419
24634
  fromJSON(object) {
24420
24635
  return {
24421
- functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
24636
+ functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : void 0,
24637
+ mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : void 0,
24422
24638
  lastEntryId: isSet3(object.lastEntryId) ? globalThis.String(object.lastEntryId) : "",
24423
24639
  requestedAt: isSet3(object.requestedAt) ? globalThis.Number(object.requestedAt) : 0,
24424
24640
  timeout: isSet3(object.timeout) ? globalThis.Number(object.timeout) : 0
@@ -24426,9 +24642,12 @@ var MapAwaitRequest = {
24426
24642
  },
24427
24643
  toJSON(message) {
24428
24644
  const obj = {};
24429
- if (message.functionCallId !== "") {
24645
+ if (message.functionCallId !== void 0) {
24430
24646
  obj.functionCallId = message.functionCallId;
24431
24647
  }
24648
+ if (message.mapToken !== void 0) {
24649
+ obj.mapToken = message.mapToken;
24650
+ }
24432
24651
  if (message.lastEntryId !== "") {
24433
24652
  obj.lastEntryId = message.lastEntryId;
24434
24653
  }
@@ -24445,7 +24664,8 @@ var MapAwaitRequest = {
24445
24664
  },
24446
24665
  fromPartial(object) {
24447
24666
  const message = createBaseMapAwaitRequest();
24448
- message.functionCallId = object.functionCallId ?? "";
24667
+ message.functionCallId = object.functionCallId ?? void 0;
24668
+ message.mapToken = object.mapToken ?? void 0;
24449
24669
  message.lastEntryId = object.lastEntryId ?? "";
24450
24670
  message.requestedAt = object.requestedAt ?? 0;
24451
24671
  message.timeout = object.timeout ?? 0;
@@ -24732,7 +24952,7 @@ var MapStartOrContinueItem = {
24732
24952
  }
24733
24953
  };
24734
24954
  function createBaseMapStartOrContinueRequest() {
24735
- return { functionId: "", parentInputId: "", functionCallId: void 0, items: [] };
24955
+ return { functionId: "", parentInputId: "", functionCallId: void 0, mapToken: void 0, items: [] };
24736
24956
  }
24737
24957
  var MapStartOrContinueRequest = {
24738
24958
  encode(message, writer = new BinaryWriter()) {
@@ -24745,6 +24965,9 @@ var MapStartOrContinueRequest = {
24745
24965
  if (message.functionCallId !== void 0) {
24746
24966
  writer.uint32(26).string(message.functionCallId);
24747
24967
  }
24968
+ if (message.mapToken !== void 0) {
24969
+ writer.uint32(42).string(message.mapToken);
24970
+ }
24748
24971
  for (const v of message.items) {
24749
24972
  MapStartOrContinueItem.encode(v, writer.uint32(34).fork()).join();
24750
24973
  }
@@ -24778,6 +25001,13 @@ var MapStartOrContinueRequest = {
24778
25001
  message.functionCallId = reader.string();
24779
25002
  continue;
24780
25003
  }
25004
+ case 5: {
25005
+ if (tag !== 42) {
25006
+ break;
25007
+ }
25008
+ message.mapToken = reader.string();
25009
+ continue;
25010
+ }
24781
25011
  case 4: {
24782
25012
  if (tag !== 34) {
24783
25013
  break;
@@ -24798,6 +25028,7 @@ var MapStartOrContinueRequest = {
24798
25028
  functionId: isSet3(object.functionId) ? globalThis.String(object.functionId) : "",
24799
25029
  parentInputId: isSet3(object.parentInputId) ? globalThis.String(object.parentInputId) : "",
24800
25030
  functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : void 0,
25031
+ mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : void 0,
24801
25032
  items: globalThis.Array.isArray(object?.items) ? object.items.map((e) => MapStartOrContinueItem.fromJSON(e)) : []
24802
25033
  };
24803
25034
  },
@@ -24812,6 +25043,9 @@ var MapStartOrContinueRequest = {
24812
25043
  if (message.functionCallId !== void 0) {
24813
25044
  obj.functionCallId = message.functionCallId;
24814
25045
  }
25046
+ if (message.mapToken !== void 0) {
25047
+ obj.mapToken = message.mapToken;
25048
+ }
24815
25049
  if (message.items?.length) {
24816
25050
  obj.items = message.items.map((e) => MapStartOrContinueItem.toJSON(e));
24817
25051
  }
@@ -24825,15 +25059,26 @@ var MapStartOrContinueRequest = {
24825
25059
  message.functionId = object.functionId ?? "";
24826
25060
  message.parentInputId = object.parentInputId ?? "";
24827
25061
  message.functionCallId = object.functionCallId ?? void 0;
25062
+ message.mapToken = object.mapToken ?? void 0;
24828
25063
  message.items = object.items?.map((e) => MapStartOrContinueItem.fromPartial(e)) || [];
24829
25064
  return message;
24830
25065
  }
24831
25066
  };
24832
25067
  function createBaseMapStartOrContinueResponse() {
24833
- return { functionId: "", functionCallId: "", maxInputsOutstanding: 0, attemptTokens: [], retryPolicy: void 0 };
25068
+ return {
25069
+ mapToken: "",
25070
+ functionId: "",
25071
+ functionCallId: "",
25072
+ maxInputsOutstanding: 0,
25073
+ attemptTokens: [],
25074
+ retryPolicy: void 0
25075
+ };
24834
25076
  }
24835
25077
  var MapStartOrContinueResponse = {
24836
25078
  encode(message, writer = new BinaryWriter()) {
25079
+ if (message.mapToken !== "") {
25080
+ writer.uint32(50).string(message.mapToken);
25081
+ }
24837
25082
  if (message.functionId !== "") {
24838
25083
  writer.uint32(10).string(message.functionId);
24839
25084
  }
@@ -24858,6 +25103,13 @@ var MapStartOrContinueResponse = {
24858
25103
  while (reader.pos < end) {
24859
25104
  const tag = reader.uint32();
24860
25105
  switch (tag >>> 3) {
25106
+ case 6: {
25107
+ if (tag !== 50) {
25108
+ break;
25109
+ }
25110
+ message.mapToken = reader.string();
25111
+ continue;
25112
+ }
24861
25113
  case 1: {
24862
25114
  if (tag !== 10) {
24863
25115
  break;
@@ -24903,6 +25155,7 @@ var MapStartOrContinueResponse = {
24903
25155
  },
24904
25156
  fromJSON(object) {
24905
25157
  return {
25158
+ mapToken: isSet3(object.mapToken) ? globalThis.String(object.mapToken) : "",
24906
25159
  functionId: isSet3(object.functionId) ? globalThis.String(object.functionId) : "",
24907
25160
  functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
24908
25161
  maxInputsOutstanding: isSet3(object.maxInputsOutstanding) ? globalThis.Number(object.maxInputsOutstanding) : 0,
@@ -24912,6 +25165,9 @@ var MapStartOrContinueResponse = {
24912
25165
  },
24913
25166
  toJSON(message) {
24914
25167
  const obj = {};
25168
+ if (message.mapToken !== "") {
25169
+ obj.mapToken = message.mapToken;
25170
+ }
24915
25171
  if (message.functionId !== "") {
24916
25172
  obj.functionId = message.functionId;
24917
25173
  }
@@ -24934,6 +25190,7 @@ var MapStartOrContinueResponse = {
24934
25190
  },
24935
25191
  fromPartial(object) {
24936
25192
  const message = createBaseMapStartOrContinueResponse();
25193
+ message.mapToken = object.mapToken ?? "";
24937
25194
  message.functionId = object.functionId ?? "";
24938
25195
  message.functionCallId = object.functionCallId ?? "";
24939
25196
  message.maxInputsOutstanding = object.maxInputsOutstanding ?? 0;
@@ -24950,7 +25207,9 @@ function createBaseMethodDefinition() {
24950
25207
  webUrl: "",
24951
25208
  webUrlInfo: void 0,
24952
25209
  customDomainInfo: [],
24953
- functionSchema: void 0
25210
+ functionSchema: void 0,
25211
+ supportedInputFormats: [],
25212
+ supportedOutputFormats: []
24954
25213
  };
24955
25214
  }
24956
25215
  var MethodDefinition = {
@@ -24976,6 +25235,16 @@ var MethodDefinition = {
24976
25235
  if (message.functionSchema !== void 0) {
24977
25236
  FunctionSchema.encode(message.functionSchema, writer.uint32(58).fork()).join();
24978
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();
24979
25248
  return writer;
24980
25249
  },
24981
25250
  decode(input, length) {
@@ -25034,6 +25303,34 @@ var MethodDefinition = {
25034
25303
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
25035
25304
  continue;
25036
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
+ }
25037
25334
  }
25038
25335
  if ((tag & 7) === 4 || tag === 0) {
25039
25336
  break;
@@ -25050,7 +25347,9 @@ var MethodDefinition = {
25050
25347
  webUrl: isSet3(object.webUrl) ? globalThis.String(object.webUrl) : "",
25051
25348
  webUrlInfo: isSet3(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
25052
25349
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
25053
- 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)) : []
25054
25353
  };
25055
25354
  },
25056
25355
  toJSON(message) {
@@ -25076,6 +25375,12 @@ var MethodDefinition = {
25076
25375
  if (message.functionSchema !== void 0) {
25077
25376
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
25078
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
+ }
25079
25384
  return obj;
25080
25385
  },
25081
25386
  create(base) {
@@ -25090,6 +25395,8 @@ var MethodDefinition = {
25090
25395
  message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
25091
25396
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
25092
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) || [];
25093
25400
  return message;
25094
25401
  }
25095
25402
  };
@@ -26629,7 +26936,16 @@ var ObjectDependency = {
26629
26936
  }
26630
26937
  };
26631
26938
  function createBasePTYInfo() {
26632
- return { enabled: false, winszRows: 0, winszCols: 0, envTerm: "", envColorterm: "", envTermProgram: "", ptyType: 0 };
26939
+ return {
26940
+ enabled: false,
26941
+ winszRows: 0,
26942
+ winszCols: 0,
26943
+ envTerm: "",
26944
+ envColorterm: "",
26945
+ envTermProgram: "",
26946
+ ptyType: 0,
26947
+ noTerminateOnIdleStdin: false
26948
+ };
26633
26949
  }
26634
26950
  var PTYInfo = {
26635
26951
  encode(message, writer = new BinaryWriter()) {
@@ -26654,6 +26970,9 @@ var PTYInfo = {
26654
26970
  if (message.ptyType !== 0) {
26655
26971
  writer.uint32(56).int32(message.ptyType);
26656
26972
  }
26973
+ if (message.noTerminateOnIdleStdin !== false) {
26974
+ writer.uint32(64).bool(message.noTerminateOnIdleStdin);
26975
+ }
26657
26976
  return writer;
26658
26977
  },
26659
26978
  decode(input, length) {
@@ -26712,6 +27031,13 @@ var PTYInfo = {
26712
27031
  message.ptyType = reader.int32();
26713
27032
  continue;
26714
27033
  }
27034
+ case 8: {
27035
+ if (tag !== 64) {
27036
+ break;
27037
+ }
27038
+ message.noTerminateOnIdleStdin = reader.bool();
27039
+ continue;
27040
+ }
26715
27041
  }
26716
27042
  if ((tag & 7) === 4 || tag === 0) {
26717
27043
  break;
@@ -26728,7 +27054,8 @@ var PTYInfo = {
26728
27054
  envTerm: isSet3(object.envTerm) ? globalThis.String(object.envTerm) : "",
26729
27055
  envColorterm: isSet3(object.envColorterm) ? globalThis.String(object.envColorterm) : "",
26730
27056
  envTermProgram: isSet3(object.envTermProgram) ? globalThis.String(object.envTermProgram) : "",
26731
- ptyType: isSet3(object.ptyType) ? pTYInfo_PTYTypeFromJSON(object.ptyType) : 0
27057
+ ptyType: isSet3(object.ptyType) ? pTYInfo_PTYTypeFromJSON(object.ptyType) : 0,
27058
+ noTerminateOnIdleStdin: isSet3(object.noTerminateOnIdleStdin) ? globalThis.Boolean(object.noTerminateOnIdleStdin) : false
26732
27059
  };
26733
27060
  },
26734
27061
  toJSON(message) {
@@ -26754,6 +27081,9 @@ var PTYInfo = {
26754
27081
  if (message.ptyType !== 0) {
26755
27082
  obj.ptyType = pTYInfo_PTYTypeToJSON(message.ptyType);
26756
27083
  }
27084
+ if (message.noTerminateOnIdleStdin !== false) {
27085
+ obj.noTerminateOnIdleStdin = message.noTerminateOnIdleStdin;
27086
+ }
26757
27087
  return obj;
26758
27088
  },
26759
27089
  create(base) {
@@ -26768,6 +27098,7 @@ var PTYInfo = {
26768
27098
  message.envColorterm = object.envColorterm ?? "";
26769
27099
  message.envTermProgram = object.envTermProgram ?? "";
26770
27100
  message.ptyType = object.ptyType ?? 0;
27101
+ message.noTerminateOnIdleStdin = object.noTerminateOnIdleStdin ?? false;
26771
27102
  return message;
26772
27103
  }
26773
27104
  };
@@ -30264,6 +30595,142 @@ var Sandbox_ExperimentalOptionsEntry = {
30264
30595
  return message;
30265
30596
  }
30266
30597
  };
30598
+ function createBaseSandboxCreateConnectTokenRequest() {
30599
+ return { sandboxId: "", metadata: "" };
30600
+ }
30601
+ var SandboxCreateConnectTokenRequest = {
30602
+ encode(message, writer = new BinaryWriter()) {
30603
+ if (message.sandboxId !== "") {
30604
+ writer.uint32(10).string(message.sandboxId);
30605
+ }
30606
+ if (message.metadata !== "") {
30607
+ writer.uint32(18).string(message.metadata);
30608
+ }
30609
+ return writer;
30610
+ },
30611
+ decode(input, length) {
30612
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
30613
+ let end = length === void 0 ? reader.len : reader.pos + length;
30614
+ const message = createBaseSandboxCreateConnectTokenRequest();
30615
+ while (reader.pos < end) {
30616
+ const tag = reader.uint32();
30617
+ switch (tag >>> 3) {
30618
+ case 1: {
30619
+ if (tag !== 10) {
30620
+ break;
30621
+ }
30622
+ message.sandboxId = reader.string();
30623
+ continue;
30624
+ }
30625
+ case 2: {
30626
+ if (tag !== 18) {
30627
+ break;
30628
+ }
30629
+ message.metadata = reader.string();
30630
+ continue;
30631
+ }
30632
+ }
30633
+ if ((tag & 7) === 4 || tag === 0) {
30634
+ break;
30635
+ }
30636
+ reader.skip(tag & 7);
30637
+ }
30638
+ return message;
30639
+ },
30640
+ fromJSON(object) {
30641
+ return {
30642
+ sandboxId: isSet3(object.sandboxId) ? globalThis.String(object.sandboxId) : "",
30643
+ metadata: isSet3(object.metadata) ? globalThis.String(object.metadata) : ""
30644
+ };
30645
+ },
30646
+ toJSON(message) {
30647
+ const obj = {};
30648
+ if (message.sandboxId !== "") {
30649
+ obj.sandboxId = message.sandboxId;
30650
+ }
30651
+ if (message.metadata !== "") {
30652
+ obj.metadata = message.metadata;
30653
+ }
30654
+ return obj;
30655
+ },
30656
+ create(base) {
30657
+ return SandboxCreateConnectTokenRequest.fromPartial(base ?? {});
30658
+ },
30659
+ fromPartial(object) {
30660
+ const message = createBaseSandboxCreateConnectTokenRequest();
30661
+ message.sandboxId = object.sandboxId ?? "";
30662
+ message.metadata = object.metadata ?? "";
30663
+ return message;
30664
+ }
30665
+ };
30666
+ function createBaseSandboxCreateConnectTokenResponse() {
30667
+ return { url: "", token: "" };
30668
+ }
30669
+ var SandboxCreateConnectTokenResponse = {
30670
+ encode(message, writer = new BinaryWriter()) {
30671
+ if (message.url !== "") {
30672
+ writer.uint32(10).string(message.url);
30673
+ }
30674
+ if (message.token !== "") {
30675
+ writer.uint32(18).string(message.token);
30676
+ }
30677
+ return writer;
30678
+ },
30679
+ decode(input, length) {
30680
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
30681
+ let end = length === void 0 ? reader.len : reader.pos + length;
30682
+ const message = createBaseSandboxCreateConnectTokenResponse();
30683
+ while (reader.pos < end) {
30684
+ const tag = reader.uint32();
30685
+ switch (tag >>> 3) {
30686
+ case 1: {
30687
+ if (tag !== 10) {
30688
+ break;
30689
+ }
30690
+ message.url = reader.string();
30691
+ continue;
30692
+ }
30693
+ case 2: {
30694
+ if (tag !== 18) {
30695
+ break;
30696
+ }
30697
+ message.token = reader.string();
30698
+ continue;
30699
+ }
30700
+ }
30701
+ if ((tag & 7) === 4 || tag === 0) {
30702
+ break;
30703
+ }
30704
+ reader.skip(tag & 7);
30705
+ }
30706
+ return message;
30707
+ },
30708
+ fromJSON(object) {
30709
+ return {
30710
+ url: isSet3(object.url) ? globalThis.String(object.url) : "",
30711
+ token: isSet3(object.token) ? globalThis.String(object.token) : ""
30712
+ };
30713
+ },
30714
+ toJSON(message) {
30715
+ const obj = {};
30716
+ if (message.url !== "") {
30717
+ obj.url = message.url;
30718
+ }
30719
+ if (message.token !== "") {
30720
+ obj.token = message.token;
30721
+ }
30722
+ return obj;
30723
+ },
30724
+ create(base) {
30725
+ return SandboxCreateConnectTokenResponse.fromPartial(base ?? {});
30726
+ },
30727
+ fromPartial(object) {
30728
+ const message = createBaseSandboxCreateConnectTokenResponse();
30729
+ message.url = object.url ?? "";
30730
+ message.token = object.token ?? "";
30731
+ return message;
30732
+ }
30733
+ };
30267
30734
  function createBaseSandboxCreateRequest() {
30268
30735
  return { appId: "", definition: void 0, environmentName: "" };
30269
30736
  }
@@ -32394,6 +32861,108 @@ var SandboxTag = {
32394
32861
  return message;
32395
32862
  }
32396
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
+ };
32397
32966
  function createBaseSandboxTagsSetRequest() {
32398
32967
  return { environmentName: "", sandboxId: "", tags: [] };
32399
32968
  }
@@ -40867,6 +41436,14 @@ var ModalClientDefinition = {
40867
41436
  responseStream: false,
40868
41437
  options: {}
40869
41438
  },
41439
+ sandboxCreateConnectToken: {
41440
+ name: "SandboxCreateConnectToken",
41441
+ requestType: SandboxCreateConnectTokenRequest,
41442
+ requestStream: false,
41443
+ responseType: SandboxCreateConnectTokenResponse,
41444
+ responseStream: false,
41445
+ options: {}
41446
+ },
40870
41447
  sandboxGetFromName: {
40871
41448
  name: "SandboxGetFromName",
40872
41449
  requestType: SandboxGetFromNameRequest,
@@ -40980,6 +41557,14 @@ var ModalClientDefinition = {
40980
41557
  responseStream: false,
40981
41558
  options: {}
40982
41559
  },
41560
+ sandboxTagsGet: {
41561
+ name: "SandboxTagsGet",
41562
+ requestType: SandboxTagsGetRequest,
41563
+ requestStream: false,
41564
+ responseType: SandboxTagsGetResponse,
41565
+ responseStream: false,
41566
+ options: {}
41567
+ },
40983
41568
  sandboxTagsSet: {
40984
41569
  name: "SandboxTagsSet",
40985
41570
  requestType: SandboxTagsSetRequest,
@@ -41710,6 +42295,13 @@ var Secret = class _Secret {
41710
42295
  }
41711
42296
  }
41712
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
+ }
41713
42305
 
41714
42306
  // src/image.ts
41715
42307
  import { ClientError as ClientError3 } from "nice-grpc";
@@ -41727,6 +42319,7 @@ var Image2 = class _Image {
41727
42319
  this.#layers = layers || [
41728
42320
  {
41729
42321
  commands: [],
42322
+ env: void 0,
41730
42323
  secrets: void 0,
41731
42324
  gpuConfig: void 0,
41732
42325
  forceBuild: false
@@ -41843,6 +42436,7 @@ var Image2 = class _Image {
41843
42436
  _Image.validateDockerfileCommands(commands);
41844
42437
  const newLayer = {
41845
42438
  commands: [...commands],
42439
+ env: options?.env,
41846
42440
  secrets: options?.secrets,
41847
42441
  gpuConfig: options?.gpu ? parseGpuConfig(options.gpu) : void 0,
41848
42442
  forceBuild: options?.forceBuild
@@ -41864,7 +42458,8 @@ var Image2 = class _Image {
41864
42458
  let baseImageId;
41865
42459
  for (let i = 0; i < this.#layers.length; i++) {
41866
42460
  const layer = this.#layers[i];
41867
- 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);
41868
42463
  const gpuConfig = layer.gpuConfig;
41869
42464
  let dockerfileCommands;
41870
42465
  let baseImages;
@@ -42183,6 +42778,37 @@ var Tunnel = class {
42183
42778
  return [this.unencryptedHost, this.unencryptedPort];
42184
42779
  }
42185
42780
  };
42781
+ function defaultSandboxPTYInfo() {
42782
+ return PTYInfo.create({
42783
+ enabled: true,
42784
+ winszRows: 24,
42785
+ winszCols: 80,
42786
+ envTerm: "xterm-256color",
42787
+ envColorterm: "truecolor",
42788
+ envTermProgram: "",
42789
+ ptyType: 2 /* PTY_TYPE_SHELL */,
42790
+ noTerminateOnIdleStdin: true
42791
+ });
42792
+ }
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);
42799
+ let ptyInfo;
42800
+ if (options?.pty) {
42801
+ ptyInfo = defaultSandboxPTYInfo();
42802
+ }
42803
+ return ContainerExecRequest.create({
42804
+ taskId,
42805
+ command,
42806
+ workdir: options?.workdir,
42807
+ timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0,
42808
+ secretIds,
42809
+ ptyInfo
42810
+ });
42811
+ }
42186
42812
  var Sandbox2 = class _Sandbox {
42187
42813
  sandboxId;
42188
42814
  stdin;
@@ -42224,6 +42850,23 @@ var Sandbox2 = class _Sandbox {
42224
42850
  throw err;
42225
42851
  }
42226
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
+ }
42227
42870
  /** Returns a running Sandbox object from an ID.
42228
42871
  *
42229
42872
  * @returns Sandbox with ID
@@ -42287,14 +42930,8 @@ var Sandbox2 = class _Sandbox {
42287
42930
  }
42288
42931
  async exec(command, options) {
42289
42932
  const taskId = await this.#getTaskId();
42290
- const secretIds = options?.secrets ? options.secrets.map((secret) => secret.secretId) : [];
42291
- const resp = await client.containerExec({
42292
- taskId,
42293
- command,
42294
- workdir: options?.workdir,
42295
- timeoutSecs: options?.timeout ? options.timeout / 1e3 : 0,
42296
- secretIds
42297
- });
42933
+ const req = await buildContainerExecRequestProto(taskId, command, options);
42934
+ const resp = await client.containerExec(req);
42298
42935
  return new ContainerProcess(resp.execId, options);
42299
42936
  }
42300
42937
  async #getTaskId() {
@@ -42681,6 +43318,118 @@ function parseGpuConfig(gpu) {
42681
43318
  gpuType: gpuType.toUpperCase()
42682
43319
  };
42683
43320
  }
43321
+ async function buildSandboxCreateRequestProto(appId, imageId, options = {}) {
43322
+ const gpuConfig = parseGpuConfig(options.gpu);
43323
+ if (options.timeout && options.timeout % 1e3 !== 0) {
43324
+ throw new Error(
43325
+ `timeout must be a multiple of 1000ms, got ${options.timeout}`
43326
+ );
43327
+ }
43328
+ if (options.idleTimeout && options.idleTimeout % 1e3 !== 0) {
43329
+ throw new Error(
43330
+ `idleTimeout must be a multiple of 1000ms, got ${options.idleTimeout}`
43331
+ );
43332
+ }
43333
+ if (options.workdir && !options.workdir.startsWith("/")) {
43334
+ throw new Error(
43335
+ `workdir must be an absolute path, got: ${options.workdir}`
43336
+ );
43337
+ }
43338
+ const volumeMounts = options.volumes ? Object.entries(options.volumes).map(([mountPath, volume]) => ({
43339
+ volumeId: volume.volumeId,
43340
+ mountPath,
43341
+ allowBackgroundCommits: true,
43342
+ readOnly: volume.isReadOnly
43343
+ })) : [];
43344
+ const cloudBucketMounts = options.cloudBucketMounts ? Object.entries(options.cloudBucketMounts).map(
43345
+ ([mountPath, mount]) => cloudBucketMountToProto(mount, mountPath)
43346
+ ) : [];
43347
+ const openPorts = [];
43348
+ if (options.encryptedPorts) {
43349
+ openPorts.push(
43350
+ ...options.encryptedPorts.map((port) => ({
43351
+ port,
43352
+ unencrypted: false
43353
+ }))
43354
+ );
43355
+ }
43356
+ if (options.h2Ports) {
43357
+ openPorts.push(
43358
+ ...options.h2Ports.map((port) => ({
43359
+ port,
43360
+ unencrypted: false,
43361
+ tunnelType: 1 /* TUNNEL_TYPE_H2 */
43362
+ }))
43363
+ );
43364
+ }
43365
+ if (options.unencryptedPorts) {
43366
+ openPorts.push(
43367
+ ...options.unencryptedPorts.map((port) => ({
43368
+ port,
43369
+ unencrypted: true
43370
+ }))
43371
+ );
43372
+ }
43373
+ const mergedSecrets = await mergeEnvAndSecrets(options.env, options.secrets);
43374
+ const secretIds = mergedSecrets.map((secret) => secret.secretId);
43375
+ let networkAccess;
43376
+ if (options.blockNetwork) {
43377
+ if (options.cidrAllowlist) {
43378
+ throw new Error(
43379
+ "cidrAllowlist cannot be used when blockNetwork is enabled"
43380
+ );
43381
+ }
43382
+ networkAccess = {
43383
+ networkAccessType: 2 /* BLOCKED */,
43384
+ allowedCidrs: []
43385
+ };
43386
+ } else if (options.cidrAllowlist) {
43387
+ networkAccess = {
43388
+ networkAccessType: 3 /* ALLOWLIST */,
43389
+ allowedCidrs: options.cidrAllowlist
43390
+ };
43391
+ } else {
43392
+ networkAccess = {
43393
+ networkAccessType: 1 /* OPEN */,
43394
+ allowedCidrs: []
43395
+ };
43396
+ }
43397
+ const schedulerPlacement = SchedulerPlacement.create({
43398
+ regions: options.regions ?? []
43399
+ });
43400
+ let ptyInfo;
43401
+ if (options.pty) {
43402
+ ptyInfo = defaultSandboxPTYInfo();
43403
+ }
43404
+ return SandboxCreateRequest.create({
43405
+ appId,
43406
+ definition: {
43407
+ // Sleep default is implicit in image builder version <=2024.10
43408
+ entrypointArgs: options.command ?? ["sleep", "48h"],
43409
+ imageId,
43410
+ timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
43411
+ idleTimeoutSecs: options.idleTimeout != void 0 ? options.idleTimeout / 1e3 : void 0,
43412
+ workdir: options.workdir ?? void 0,
43413
+ networkAccess,
43414
+ resources: {
43415
+ // https://modal.com/docs/guide/resources
43416
+ milliCpu: Math.round(1e3 * (options.cpu ?? 0.125)),
43417
+ memoryMb: options.memory ?? 128,
43418
+ gpuConfig
43419
+ },
43420
+ volumeMounts,
43421
+ cloudBucketMounts,
43422
+ ptyInfo,
43423
+ secretIds,
43424
+ openPorts: openPorts.length > 0 ? { ports: openPorts } : void 0,
43425
+ cloudProviderStr: options.cloud ?? "",
43426
+ schedulerPlacement,
43427
+ verbose: options.verbose ?? false,
43428
+ proxyId: options.proxy?.proxyId,
43429
+ name: options.name
43430
+ }
43431
+ });
43432
+ }
42684
43433
  var App2 = class _App {
42685
43434
  appId;
42686
43435
  name;
@@ -42705,113 +43454,15 @@ var App2 = class _App {
42705
43454
  }
42706
43455
  }
42707
43456
  async createSandbox(image, options = {}) {
42708
- const gpuConfig = parseGpuConfig(options.gpu);
42709
- if (options.timeout && options.timeout % 1e3 !== 0) {
42710
- throw new Error(
42711
- `timeout must be a multiple of 1000ms, got ${options.timeout}`
42712
- );
42713
- }
42714
- if (options.idleTimeout && options.idleTimeout % 1e3 !== 0) {
42715
- throw new Error(
42716
- `idleTimeout must be a multiple of 1000ms, got ${options.idleTimeout}`
42717
- );
42718
- }
42719
43457
  await image.build(this);
42720
- if (options.workdir && !options.workdir.startsWith("/")) {
42721
- throw new Error(
42722
- `workdir must be an absolute path, got: ${options.workdir}`
42723
- );
42724
- }
42725
- const volumeMounts = options.volumes ? Object.entries(options.volumes).map(([mountPath, volume]) => ({
42726
- volumeId: volume.volumeId,
42727
- mountPath,
42728
- allowBackgroundCommits: true,
42729
- readOnly: volume.isReadOnly
42730
- })) : [];
42731
- const cloudBucketMounts = options.cloudBucketMounts ? Object.entries(options.cloudBucketMounts).map(
42732
- ([mountPath, mount]) => cloudBucketMountToProto(mount, mountPath)
42733
- ) : [];
42734
- const openPorts = [];
42735
- if (options.encryptedPorts) {
42736
- openPorts.push(
42737
- ...options.encryptedPorts.map((port) => ({
42738
- port,
42739
- unencrypted: false
42740
- }))
42741
- );
42742
- }
42743
- if (options.h2Ports) {
42744
- openPorts.push(
42745
- ...options.h2Ports.map((port) => ({
42746
- port,
42747
- unencrypted: false,
42748
- tunnelType: 1 /* TUNNEL_TYPE_H2 */
42749
- }))
42750
- );
42751
- }
42752
- if (options.unencryptedPorts) {
42753
- openPorts.push(
42754
- ...options.unencryptedPorts.map((port) => ({
42755
- port,
42756
- unencrypted: true
42757
- }))
42758
- );
42759
- }
42760
- const secretIds = options.secrets ? options.secrets.map((secret) => secret.secretId) : [];
42761
- let networkAccess;
42762
- if (options.blockNetwork) {
42763
- if (options.cidrAllowlist) {
42764
- throw new Error(
42765
- "cidrAllowlist cannot be used when blockNetwork is enabled"
42766
- );
42767
- }
42768
- networkAccess = {
42769
- networkAccessType: 2 /* BLOCKED */,
42770
- allowedCidrs: []
42771
- };
42772
- } else if (options.cidrAllowlist) {
42773
- networkAccess = {
42774
- networkAccessType: 3 /* ALLOWLIST */,
42775
- allowedCidrs: options.cidrAllowlist
42776
- };
42777
- } else {
42778
- networkAccess = {
42779
- networkAccessType: 1 /* OPEN */,
42780
- allowedCidrs: []
42781
- };
42782
- }
42783
- const schedulerPlacement = SchedulerPlacement.create({
42784
- regions: options.regions ?? []
42785
- });
43458
+ const createReq = await buildSandboxCreateRequestProto(
43459
+ this.appId,
43460
+ image.imageId,
43461
+ options
43462
+ );
42786
43463
  let createResp;
42787
43464
  try {
42788
- createResp = await client.sandboxCreate({
42789
- appId: this.appId,
42790
- definition: {
42791
- // Sleep default is implicit in image builder version <=2024.10
42792
- entrypointArgs: options.command ?? ["sleep", "48h"],
42793
- imageId: image.imageId,
42794
- timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
42795
- idleTimeoutSecs: options.idleTimeout != void 0 ? options.idleTimeout / 1e3 : void 0,
42796
- workdir: options.workdir ?? void 0,
42797
- networkAccess,
42798
- resources: {
42799
- // https://modal.com/docs/guide/resources
42800
- milliCpu: Math.round(1e3 * (options.cpu ?? 0.125)),
42801
- memoryMb: options.memory ?? 128,
42802
- gpuConfig
42803
- },
42804
- volumeMounts,
42805
- cloudBucketMounts,
42806
- secretIds,
42807
- openPorts: openPorts.length > 0 ? { ports: openPorts } : void 0,
42808
- cloudProviderStr: options.cloud ?? "",
42809
- schedulerPlacement,
42810
- verbose: options.verbose ?? false,
42811
- proxyId: options.proxy?.proxyId,
42812
- name: options.name
42813
- }
42814
- });
43465
+ createResp = await client.sandboxCreate(createReq);
42815
43466
  } catch (err) {
42816
43467
  if (err instanceof ClientError5 && err.code === Status5.ALREADY_EXISTS) {
42817
43468
  throw new AlreadyExistsError(err.details || err.message);
@@ -43742,7 +44393,7 @@ var Cls = class _Cls {
43742
44393
  /** Bind parameters to the Cls function. */
43743
44394
  async #bindParameters(params) {
43744
44395
  const serializedParams = encodeParameterSet(this.#schema, params);
43745
- const functionOptions = buildFunctionOptionsProto(this.#options);
44396
+ const functionOptions = await buildFunctionOptionsProto(this.#options);
43746
44397
  const bindResp = await client.functionBindParams({
43747
44398
  functionId: this.#serviceFunctionId,
43748
44399
  serializedParams,
@@ -43767,7 +44418,7 @@ function mergeServiceOptions(base, diff) {
43767
44418
  const merged = { ...base ?? {}, ...filteredDiff };
43768
44419
  return Object.keys(merged).length === 0 ? void 0 : merged;
43769
44420
  }
43770
- function buildFunctionOptionsProto(options) {
44421
+ async function buildFunctionOptionsProto(options) {
43771
44422
  if (!options) return void 0;
43772
44423
  const o = options ?? {};
43773
44424
  const gpuConfig = parseGpuConfig(o.gpu);
@@ -43776,7 +44427,8 @@ function buildFunctionOptionsProto(options) {
43776
44427
  memoryMb: o.memory,
43777
44428
  gpuConfig
43778
44429
  } : void 0;
43779
- 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);
43780
44432
  const volumeMounts = o.volumes ? Object.entries(o.volumes).map(([mountPath, volume]) => ({
43781
44433
  volumeId: volume.volumeId,
43782
44434
  mountPath,