modal 0.3.3 → 0.3.5

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.
Files changed (3) hide show
  1. package/dist/index.d.ts +113 -9
  2. package/dist/index.js +1590 -179
  3. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ // src/app.ts
2
+ import { ClientError as ClientError2, Status as Status2 } from "nice-grpc";
3
+
1
4
  // node_modules/@bufbuild/protobuf/dist/esm/wire/varint.js
2
5
  function varint64read() {
3
6
  let lowBits = 0;
@@ -2260,6 +2263,31 @@ function taskStateToJSON(object) {
2260
2263
  return "UNRECOGNIZED";
2261
2264
  }
2262
2265
  }
2266
+ function tunnelTypeFromJSON(object) {
2267
+ switch (object) {
2268
+ case 0:
2269
+ case "TUNNEL_TYPE_UNSPECIFIED":
2270
+ return 0 /* TUNNEL_TYPE_UNSPECIFIED */;
2271
+ case 1:
2272
+ case "TUNNEL_TYPE_H2":
2273
+ return 1 /* TUNNEL_TYPE_H2 */;
2274
+ case -1:
2275
+ case "UNRECOGNIZED":
2276
+ default:
2277
+ return -1 /* UNRECOGNIZED */;
2278
+ }
2279
+ }
2280
+ function tunnelTypeToJSON(object) {
2281
+ switch (object) {
2282
+ case 0 /* TUNNEL_TYPE_UNSPECIFIED */:
2283
+ return "TUNNEL_TYPE_UNSPECIFIED";
2284
+ case 1 /* TUNNEL_TYPE_H2 */:
2285
+ return "TUNNEL_TYPE_H2";
2286
+ case -1 /* UNRECOGNIZED */:
2287
+ default:
2288
+ return "UNRECOGNIZED";
2289
+ }
2290
+ }
2263
2291
  function volumeFsVersionFromJSON(object) {
2264
2292
  switch (object) {
2265
2293
  case 0:
@@ -2444,6 +2472,12 @@ function fileEntry_FileTypeFromJSON(object) {
2444
2472
  case 3:
2445
2473
  case "SYMLINK":
2446
2474
  return 3 /* SYMLINK */;
2475
+ case 4:
2476
+ case "FIFO":
2477
+ return 4 /* FIFO */;
2478
+ case 5:
2479
+ case "SOCKET":
2480
+ return 5 /* SOCKET */;
2447
2481
  case -1:
2448
2482
  case "UNRECOGNIZED":
2449
2483
  default:
@@ -2460,6 +2494,10 @@ function fileEntry_FileTypeToJSON(object) {
2460
2494
  return "DIRECTORY";
2461
2495
  case 3 /* SYMLINK */:
2462
2496
  return "SYMLINK";
2497
+ case 4 /* FIFO */:
2498
+ return "FIFO";
2499
+ case 5 /* SOCKET */:
2500
+ return "SOCKET";
2463
2501
  case -1 /* UNRECOGNIZED */:
2464
2502
  default:
2465
2503
  return "UNRECOGNIZED";
@@ -3858,7 +3896,7 @@ var AppGetObjectsItem = {
3858
3896
  writer.uint32(10).string(message.tag);
3859
3897
  }
3860
3898
  if (message.object !== void 0) {
3861
- Object2.encode(message.object, writer.uint32(50).fork()).join();
3899
+ Object_.encode(message.object, writer.uint32(50).fork()).join();
3862
3900
  }
3863
3901
  return writer;
3864
3902
  },
@@ -3880,7 +3918,7 @@ var AppGetObjectsItem = {
3880
3918
  if (tag !== 50) {
3881
3919
  break;
3882
3920
  }
3883
- message.object = Object2.decode(reader, reader.uint32());
3921
+ message.object = Object_.decode(reader, reader.uint32());
3884
3922
  continue;
3885
3923
  }
3886
3924
  }
@@ -3894,7 +3932,7 @@ var AppGetObjectsItem = {
3894
3932
  fromJSON(object) {
3895
3933
  return {
3896
3934
  tag: isSet3(object.tag) ? globalThis.String(object.tag) : "",
3897
- object: isSet3(object.object) ? Object2.fromJSON(object.object) : void 0
3935
+ object: isSet3(object.object) ? Object_.fromJSON(object.object) : void 0
3898
3936
  };
3899
3937
  },
3900
3938
  toJSON(message) {
@@ -3903,7 +3941,7 @@ var AppGetObjectsItem = {
3903
3941
  obj.tag = message.tag;
3904
3942
  }
3905
3943
  if (message.object !== void 0) {
3906
- obj.object = Object2.toJSON(message.object);
3944
+ obj.object = Object_.toJSON(message.object);
3907
3945
  }
3908
3946
  return obj;
3909
3947
  },
@@ -3913,7 +3951,7 @@ var AppGetObjectsItem = {
3913
3951
  fromPartial(object) {
3914
3952
  const message = createBaseAppGetObjectsItem();
3915
3953
  message.tag = object.tag ?? "";
3916
- message.object = object.object !== void 0 && object.object !== null ? Object2.fromPartial(object.object) : void 0;
3954
+ message.object = object.object !== void 0 && object.object !== null ? Object_.fromPartial(object.object) : void 0;
3917
3955
  return message;
3918
3956
  }
3919
3957
  };
@@ -4244,12 +4282,12 @@ function createBaseAppLayout() {
4244
4282
  var AppLayout = {
4245
4283
  encode(message, writer = new BinaryWriter()) {
4246
4284
  for (const v of message.objects) {
4247
- Object2.encode(v, writer.uint32(10).fork()).join();
4285
+ Object_.encode(v, writer.uint32(10).fork()).join();
4248
4286
  }
4249
- Object2.entries(message.functionIds).forEach(([key, value]) => {
4287
+ Object.entries(message.functionIds).forEach(([key, value]) => {
4250
4288
  AppLayout_FunctionIdsEntry.encode({ key, value }, writer.uint32(18).fork()).join();
4251
4289
  });
4252
- Object2.entries(message.classIds).forEach(([key, value]) => {
4290
+ Object.entries(message.classIds).forEach(([key, value]) => {
4253
4291
  AppLayout_ClassIdsEntry.encode({ key, value }, writer.uint32(26).fork()).join();
4254
4292
  });
4255
4293
  return writer;
@@ -4265,7 +4303,7 @@ var AppLayout = {
4265
4303
  if (tag !== 10) {
4266
4304
  break;
4267
4305
  }
4268
- message.objects.push(Object2.decode(reader, reader.uint32()));
4306
+ message.objects.push(Object_.decode(reader, reader.uint32()));
4269
4307
  continue;
4270
4308
  }
4271
4309
  case 2: {
@@ -4298,12 +4336,12 @@ var AppLayout = {
4298
4336
  },
4299
4337
  fromJSON(object) {
4300
4338
  return {
4301
- objects: globalThis.Array.isArray(object?.objects) ? object.objects.map((e) => Object2.fromJSON(e)) : [],
4302
- functionIds: isObject2(object.functionIds) ? Object2.entries(object.functionIds).reduce((acc, [key, value]) => {
4339
+ objects: globalThis.Array.isArray(object?.objects) ? object.objects.map((e) => Object_.fromJSON(e)) : [],
4340
+ functionIds: isObject2(object.functionIds) ? Object.entries(object.functionIds).reduce((acc, [key, value]) => {
4303
4341
  acc[key] = String(value);
4304
4342
  return acc;
4305
4343
  }, {}) : {},
4306
- classIds: isObject2(object.classIds) ? Object2.entries(object.classIds).reduce((acc, [key, value]) => {
4344
+ classIds: isObject2(object.classIds) ? Object.entries(object.classIds).reduce((acc, [key, value]) => {
4307
4345
  acc[key] = String(value);
4308
4346
  return acc;
4309
4347
  }, {}) : {}
@@ -4312,10 +4350,10 @@ var AppLayout = {
4312
4350
  toJSON(message) {
4313
4351
  const obj = {};
4314
4352
  if (message.objects?.length) {
4315
- obj.objects = message.objects.map((e) => Object2.toJSON(e));
4353
+ obj.objects = message.objects.map((e) => Object_.toJSON(e));
4316
4354
  }
4317
4355
  if (message.functionIds) {
4318
- const entries = Object2.entries(message.functionIds);
4356
+ const entries = Object.entries(message.functionIds);
4319
4357
  if (entries.length > 0) {
4320
4358
  obj.functionIds = {};
4321
4359
  entries.forEach(([k, v]) => {
@@ -4324,7 +4362,7 @@ var AppLayout = {
4324
4362
  }
4325
4363
  }
4326
4364
  if (message.classIds) {
4327
- const entries = Object2.entries(message.classIds);
4365
+ const entries = Object.entries(message.classIds);
4328
4366
  if (entries.length > 0) {
4329
4367
  obj.classIds = {};
4330
4368
  entries.forEach(([k, v]) => {
@@ -4339,8 +4377,8 @@ var AppLayout = {
4339
4377
  },
4340
4378
  fromPartial(object) {
4341
4379
  const message = createBaseAppLayout();
4342
- message.objects = object.objects?.map((e) => Object2.fromPartial(e)) || [];
4343
- message.functionIds = Object2.entries(object.functionIds ?? {}).reduce(
4380
+ message.objects = object.objects?.map((e) => Object_.fromPartial(e)) || [];
4381
+ message.functionIds = Object.entries(object.functionIds ?? {}).reduce(
4344
4382
  (acc, [key, value]) => {
4345
4383
  if (value !== void 0) {
4346
4384
  acc[key] = globalThis.String(value);
@@ -4349,7 +4387,7 @@ var AppLayout = {
4349
4387
  },
4350
4388
  {}
4351
4389
  );
4352
- message.classIds = Object2.entries(object.classIds ?? {}).reduce((acc, [key, value]) => {
4390
+ message.classIds = Object.entries(object.classIds ?? {}).reduce((acc, [key, value]) => {
4353
4391
  if (value !== void 0) {
4354
4392
  acc[key] = globalThis.String(value);
4355
4393
  }
@@ -4888,13 +4926,13 @@ var AppPublishRequest = {
4888
4926
  if (message.appState !== 0) {
4889
4927
  writer.uint32(32).int32(message.appState);
4890
4928
  }
4891
- Object2.entries(message.functionIds).forEach(([key, value]) => {
4929
+ Object.entries(message.functionIds).forEach(([key, value]) => {
4892
4930
  AppPublishRequest_FunctionIdsEntry.encode({ key, value }, writer.uint32(42).fork()).join();
4893
4931
  });
4894
- Object2.entries(message.classIds).forEach(([key, value]) => {
4932
+ Object.entries(message.classIds).forEach(([key, value]) => {
4895
4933
  AppPublishRequest_ClassIdsEntry.encode({ key, value }, writer.uint32(50).fork()).join();
4896
4934
  });
4897
- Object2.entries(message.definitionIds).forEach(([key, value]) => {
4935
+ Object.entries(message.definitionIds).forEach(([key, value]) => {
4898
4936
  AppPublishRequest_DefinitionIdsEntry.encode({ key, value }, writer.uint32(58).fork()).join();
4899
4937
  });
4900
4938
  if (message.rollbackVersion !== 0) {
@@ -5008,15 +5046,15 @@ var AppPublishRequest = {
5008
5046
  name: isSet3(object.name) ? globalThis.String(object.name) : "",
5009
5047
  deploymentTag: isSet3(object.deploymentTag) ? globalThis.String(object.deploymentTag) : "",
5010
5048
  appState: isSet3(object.appState) ? appStateFromJSON(object.appState) : 0,
5011
- functionIds: isObject2(object.functionIds) ? Object2.entries(object.functionIds).reduce((acc, [key, value]) => {
5049
+ functionIds: isObject2(object.functionIds) ? Object.entries(object.functionIds).reduce((acc, [key, value]) => {
5012
5050
  acc[key] = String(value);
5013
5051
  return acc;
5014
5052
  }, {}) : {},
5015
- classIds: isObject2(object.classIds) ? Object2.entries(object.classIds).reduce((acc, [key, value]) => {
5053
+ classIds: isObject2(object.classIds) ? Object.entries(object.classIds).reduce((acc, [key, value]) => {
5016
5054
  acc[key] = String(value);
5017
5055
  return acc;
5018
5056
  }, {}) : {},
5019
- definitionIds: isObject2(object.definitionIds) ? Object2.entries(object.definitionIds).reduce((acc, [key, value]) => {
5057
+ definitionIds: isObject2(object.definitionIds) ? Object.entries(object.definitionIds).reduce((acc, [key, value]) => {
5020
5058
  acc[key] = String(value);
5021
5059
  return acc;
5022
5060
  }, {}) : {},
@@ -5040,7 +5078,7 @@ var AppPublishRequest = {
5040
5078
  obj.appState = appStateToJSON(message.appState);
5041
5079
  }
5042
5080
  if (message.functionIds) {
5043
- const entries = Object2.entries(message.functionIds);
5081
+ const entries = Object.entries(message.functionIds);
5044
5082
  if (entries.length > 0) {
5045
5083
  obj.functionIds = {};
5046
5084
  entries.forEach(([k, v]) => {
@@ -5049,7 +5087,7 @@ var AppPublishRequest = {
5049
5087
  }
5050
5088
  }
5051
5089
  if (message.classIds) {
5052
- const entries = Object2.entries(message.classIds);
5090
+ const entries = Object.entries(message.classIds);
5053
5091
  if (entries.length > 0) {
5054
5092
  obj.classIds = {};
5055
5093
  entries.forEach(([k, v]) => {
@@ -5058,7 +5096,7 @@ var AppPublishRequest = {
5058
5096
  }
5059
5097
  }
5060
5098
  if (message.definitionIds) {
5061
- const entries = Object2.entries(message.definitionIds);
5099
+ const entries = Object.entries(message.definitionIds);
5062
5100
  if (entries.length > 0) {
5063
5101
  obj.definitionIds = {};
5064
5102
  entries.forEach(([k, v]) => {
@@ -5086,7 +5124,7 @@ var AppPublishRequest = {
5086
5124
  message.name = object.name ?? "";
5087
5125
  message.deploymentTag = object.deploymentTag ?? "";
5088
5126
  message.appState = object.appState ?? 0;
5089
- message.functionIds = Object2.entries(object.functionIds ?? {}).reduce(
5127
+ message.functionIds = Object.entries(object.functionIds ?? {}).reduce(
5090
5128
  (acc, [key, value]) => {
5091
5129
  if (value !== void 0) {
5092
5130
  acc[key] = globalThis.String(value);
@@ -5095,13 +5133,13 @@ var AppPublishRequest = {
5095
5133
  },
5096
5134
  {}
5097
5135
  );
5098
- message.classIds = Object2.entries(object.classIds ?? {}).reduce((acc, [key, value]) => {
5136
+ message.classIds = Object.entries(object.classIds ?? {}).reduce((acc, [key, value]) => {
5099
5137
  if (value !== void 0) {
5100
5138
  acc[key] = globalThis.String(value);
5101
5139
  }
5102
5140
  return acc;
5103
5141
  }, {});
5104
- message.definitionIds = Object2.entries(object.definitionIds ?? {}).reduce(
5142
+ message.definitionIds = Object.entries(object.definitionIds ?? {}).reduce(
5105
5143
  (acc, [key, value]) => {
5106
5144
  if (value !== void 0) {
5107
5145
  acc[key] = globalThis.String(value);
@@ -5464,7 +5502,7 @@ var AppSetObjectsRequest = {
5464
5502
  if (message.appId !== "") {
5465
5503
  writer.uint32(10).string(message.appId);
5466
5504
  }
5467
- Object2.entries(message.indexedObjectIds).forEach(([key, value]) => {
5505
+ Object.entries(message.indexedObjectIds).forEach(([key, value]) => {
5468
5506
  AppSetObjectsRequest_IndexedObjectIdsEntry.encode({ key, value }, writer.uint32(18).fork()).join();
5469
5507
  });
5470
5508
  if (message.clientId !== "") {
@@ -5534,7 +5572,7 @@ var AppSetObjectsRequest = {
5534
5572
  fromJSON(object) {
5535
5573
  return {
5536
5574
  appId: isSet3(object.appId) ? globalThis.String(object.appId) : "",
5537
- indexedObjectIds: isObject2(object.indexedObjectIds) ? Object2.entries(object.indexedObjectIds).reduce((acc, [key, value]) => {
5575
+ indexedObjectIds: isObject2(object.indexedObjectIds) ? Object.entries(object.indexedObjectIds).reduce((acc, [key, value]) => {
5538
5576
  acc[key] = String(value);
5539
5577
  return acc;
5540
5578
  }, {}) : {},
@@ -5549,7 +5587,7 @@ var AppSetObjectsRequest = {
5549
5587
  obj.appId = message.appId;
5550
5588
  }
5551
5589
  if (message.indexedObjectIds) {
5552
- const entries = Object2.entries(message.indexedObjectIds);
5590
+ const entries = Object.entries(message.indexedObjectIds);
5553
5591
  if (entries.length > 0) {
5554
5592
  obj.indexedObjectIds = {};
5555
5593
  entries.forEach(([k, v]) => {
@@ -5574,7 +5612,7 @@ var AppSetObjectsRequest = {
5574
5612
  fromPartial(object) {
5575
5613
  const message = createBaseAppSetObjectsRequest();
5576
5614
  message.appId = object.appId ?? "";
5577
- message.indexedObjectIds = Object2.entries(object.indexedObjectIds ?? {}).reduce(
5615
+ message.indexedObjectIds = Object.entries(object.indexedObjectIds ?? {}).reduce(
5578
5616
  (acc, [key, value]) => {
5579
5617
  if (value !== void 0) {
5580
5618
  acc[key] = globalThis.String(value);
@@ -5859,6 +5897,155 @@ var AttemptAwaitResponse = {
5859
5897
  return message;
5860
5898
  }
5861
5899
  };
5900
+ function createBaseAttemptRetryRequest() {
5901
+ return { functionId: "", parentInputId: "", input: void 0, attemptToken: "" };
5902
+ }
5903
+ var AttemptRetryRequest = {
5904
+ encode(message, writer = new BinaryWriter()) {
5905
+ if (message.functionId !== "") {
5906
+ writer.uint32(10).string(message.functionId);
5907
+ }
5908
+ if (message.parentInputId !== "") {
5909
+ writer.uint32(18).string(message.parentInputId);
5910
+ }
5911
+ if (message.input !== void 0) {
5912
+ FunctionPutInputsItem.encode(message.input, writer.uint32(26).fork()).join();
5913
+ }
5914
+ if (message.attemptToken !== "") {
5915
+ writer.uint32(34).string(message.attemptToken);
5916
+ }
5917
+ return writer;
5918
+ },
5919
+ decode(input, length) {
5920
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
5921
+ let end = length === void 0 ? reader.len : reader.pos + length;
5922
+ const message = createBaseAttemptRetryRequest();
5923
+ while (reader.pos < end) {
5924
+ const tag = reader.uint32();
5925
+ switch (tag >>> 3) {
5926
+ case 1: {
5927
+ if (tag !== 10) {
5928
+ break;
5929
+ }
5930
+ message.functionId = reader.string();
5931
+ continue;
5932
+ }
5933
+ case 2: {
5934
+ if (tag !== 18) {
5935
+ break;
5936
+ }
5937
+ message.parentInputId = reader.string();
5938
+ continue;
5939
+ }
5940
+ case 3: {
5941
+ if (tag !== 26) {
5942
+ break;
5943
+ }
5944
+ message.input = FunctionPutInputsItem.decode(reader, reader.uint32());
5945
+ continue;
5946
+ }
5947
+ case 4: {
5948
+ if (tag !== 34) {
5949
+ break;
5950
+ }
5951
+ message.attemptToken = reader.string();
5952
+ continue;
5953
+ }
5954
+ }
5955
+ if ((tag & 7) === 4 || tag === 0) {
5956
+ break;
5957
+ }
5958
+ reader.skip(tag & 7);
5959
+ }
5960
+ return message;
5961
+ },
5962
+ fromJSON(object) {
5963
+ return {
5964
+ functionId: isSet3(object.functionId) ? globalThis.String(object.functionId) : "",
5965
+ parentInputId: isSet3(object.parentInputId) ? globalThis.String(object.parentInputId) : "",
5966
+ input: isSet3(object.input) ? FunctionPutInputsItem.fromJSON(object.input) : void 0,
5967
+ attemptToken: isSet3(object.attemptToken) ? globalThis.String(object.attemptToken) : ""
5968
+ };
5969
+ },
5970
+ toJSON(message) {
5971
+ const obj = {};
5972
+ if (message.functionId !== "") {
5973
+ obj.functionId = message.functionId;
5974
+ }
5975
+ if (message.parentInputId !== "") {
5976
+ obj.parentInputId = message.parentInputId;
5977
+ }
5978
+ if (message.input !== void 0) {
5979
+ obj.input = FunctionPutInputsItem.toJSON(message.input);
5980
+ }
5981
+ if (message.attemptToken !== "") {
5982
+ obj.attemptToken = message.attemptToken;
5983
+ }
5984
+ return obj;
5985
+ },
5986
+ create(base) {
5987
+ return AttemptRetryRequest.fromPartial(base ?? {});
5988
+ },
5989
+ fromPartial(object) {
5990
+ const message = createBaseAttemptRetryRequest();
5991
+ message.functionId = object.functionId ?? "";
5992
+ message.parentInputId = object.parentInputId ?? "";
5993
+ message.input = object.input !== void 0 && object.input !== null ? FunctionPutInputsItem.fromPartial(object.input) : void 0;
5994
+ message.attemptToken = object.attemptToken ?? "";
5995
+ return message;
5996
+ }
5997
+ };
5998
+ function createBaseAttemptRetryResponse() {
5999
+ return { attemptToken: "" };
6000
+ }
6001
+ var AttemptRetryResponse = {
6002
+ encode(message, writer = new BinaryWriter()) {
6003
+ if (message.attemptToken !== "") {
6004
+ writer.uint32(10).string(message.attemptToken);
6005
+ }
6006
+ return writer;
6007
+ },
6008
+ decode(input, length) {
6009
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
6010
+ let end = length === void 0 ? reader.len : reader.pos + length;
6011
+ const message = createBaseAttemptRetryResponse();
6012
+ while (reader.pos < end) {
6013
+ const tag = reader.uint32();
6014
+ switch (tag >>> 3) {
6015
+ case 1: {
6016
+ if (tag !== 10) {
6017
+ break;
6018
+ }
6019
+ message.attemptToken = reader.string();
6020
+ continue;
6021
+ }
6022
+ }
6023
+ if ((tag & 7) === 4 || tag === 0) {
6024
+ break;
6025
+ }
6026
+ reader.skip(tag & 7);
6027
+ }
6028
+ return message;
6029
+ },
6030
+ fromJSON(object) {
6031
+ return { attemptToken: isSet3(object.attemptToken) ? globalThis.String(object.attemptToken) : "" };
6032
+ },
6033
+ toJSON(message) {
6034
+ const obj = {};
6035
+ if (message.attemptToken !== "") {
6036
+ obj.attemptToken = message.attemptToken;
6037
+ }
6038
+ return obj;
6039
+ },
6040
+ create(base) {
6041
+ return AttemptRetryResponse.fromPartial(base ?? {});
6042
+ },
6043
+ fromPartial(object) {
6044
+ const message = createBaseAttemptRetryResponse();
6045
+ message.attemptToken = object.attemptToken ?? "";
6046
+ return message;
6047
+ }
6048
+ };
5862
6049
  function createBaseAttemptStartRequest() {
5863
6050
  return { functionId: "", parentInputId: "", input: void 0 };
5864
6051
  }
@@ -6950,14 +7137,7 @@ var ClassCreateResponse = {
6950
7137
  }
6951
7138
  };
6952
7139
  function createBaseClassGetRequest() {
6953
- return {
6954
- appName: "",
6955
- objectTag: "",
6956
- namespace: 0,
6957
- environmentName: "",
6958
- lookupPublished: false,
6959
- onlyClassFunction: false
6960
- };
7140
+ return { appName: "", objectTag: "", namespace: 0, environmentName: "", onlyClassFunction: false };
6961
7141
  }
6962
7142
  var ClassGetRequest = {
6963
7143
  encode(message, writer = new BinaryWriter()) {
@@ -6973,9 +7153,6 @@ var ClassGetRequest = {
6973
7153
  if (message.environmentName !== "") {
6974
7154
  writer.uint32(34).string(message.environmentName);
6975
7155
  }
6976
- if (message.lookupPublished !== false) {
6977
- writer.uint32(64).bool(message.lookupPublished);
6978
- }
6979
7156
  if (message.onlyClassFunction !== false) {
6980
7157
  writer.uint32(80).bool(message.onlyClassFunction);
6981
7158
  }
@@ -7016,13 +7193,6 @@ var ClassGetRequest = {
7016
7193
  message.environmentName = reader.string();
7017
7194
  continue;
7018
7195
  }
7019
- case 8: {
7020
- if (tag !== 64) {
7021
- break;
7022
- }
7023
- message.lookupPublished = reader.bool();
7024
- continue;
7025
- }
7026
7196
  case 10: {
7027
7197
  if (tag !== 80) {
7028
7198
  break;
@@ -7044,7 +7214,6 @@ var ClassGetRequest = {
7044
7214
  objectTag: isSet3(object.objectTag) ? globalThis.String(object.objectTag) : "",
7045
7215
  namespace: isSet3(object.namespace) ? deploymentNamespaceFromJSON(object.namespace) : 0,
7046
7216
  environmentName: isSet3(object.environmentName) ? globalThis.String(object.environmentName) : "",
7047
- lookupPublished: isSet3(object.lookupPublished) ? globalThis.Boolean(object.lookupPublished) : false,
7048
7217
  onlyClassFunction: isSet3(object.onlyClassFunction) ? globalThis.Boolean(object.onlyClassFunction) : false
7049
7218
  };
7050
7219
  },
@@ -7062,9 +7231,6 @@ var ClassGetRequest = {
7062
7231
  if (message.environmentName !== "") {
7063
7232
  obj.environmentName = message.environmentName;
7064
7233
  }
7065
- if (message.lookupPublished !== false) {
7066
- obj.lookupPublished = message.lookupPublished;
7067
- }
7068
7234
  if (message.onlyClassFunction !== false) {
7069
7235
  obj.onlyClassFunction = message.onlyClassFunction;
7070
7236
  }
@@ -7079,7 +7245,6 @@ var ClassGetRequest = {
7079
7245
  message.objectTag = object.objectTag ?? "";
7080
7246
  message.namespace = object.namespace ?? 0;
7081
7247
  message.environmentName = object.environmentName ?? "";
7082
- message.lookupPublished = object.lookupPublished ?? false;
7083
7248
  message.onlyClassFunction = object.onlyClassFunction ?? false;
7084
7249
  return message;
7085
7250
  }
@@ -7401,6 +7566,59 @@ var ClassParameterInfo = {
7401
7566
  return message;
7402
7567
  }
7403
7568
  };
7569
+ function createBaseClassParameterSet() {
7570
+ return { parameters: [] };
7571
+ }
7572
+ var ClassParameterSet = {
7573
+ encode(message, writer = new BinaryWriter()) {
7574
+ for (const v of message.parameters) {
7575
+ ClassParameterValue.encode(v, writer.uint32(10).fork()).join();
7576
+ }
7577
+ return writer;
7578
+ },
7579
+ decode(input, length) {
7580
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7581
+ let end = length === void 0 ? reader.len : reader.pos + length;
7582
+ const message = createBaseClassParameterSet();
7583
+ while (reader.pos < end) {
7584
+ const tag = reader.uint32();
7585
+ switch (tag >>> 3) {
7586
+ case 1: {
7587
+ if (tag !== 10) {
7588
+ break;
7589
+ }
7590
+ message.parameters.push(ClassParameterValue.decode(reader, reader.uint32()));
7591
+ continue;
7592
+ }
7593
+ }
7594
+ if ((tag & 7) === 4 || tag === 0) {
7595
+ break;
7596
+ }
7597
+ reader.skip(tag & 7);
7598
+ }
7599
+ return message;
7600
+ },
7601
+ fromJSON(object) {
7602
+ return {
7603
+ parameters: globalThis.Array.isArray(object?.parameters) ? object.parameters.map((e) => ClassParameterValue.fromJSON(e)) : []
7604
+ };
7605
+ },
7606
+ toJSON(message) {
7607
+ const obj = {};
7608
+ if (message.parameters?.length) {
7609
+ obj.parameters = message.parameters.map((e) => ClassParameterValue.toJSON(e));
7610
+ }
7611
+ return obj;
7612
+ },
7613
+ create(base) {
7614
+ return ClassParameterSet.fromPartial(base ?? {});
7615
+ },
7616
+ fromPartial(object) {
7617
+ const message = createBaseClassParameterSet();
7618
+ message.parameters = object.parameters?.map((e) => ClassParameterValue.fromPartial(e)) || [];
7619
+ return message;
7620
+ }
7621
+ };
7404
7622
  function createBaseClassParameterSpec() {
7405
7623
  return {
7406
7624
  name: "",
@@ -7584,6 +7802,157 @@ var ClassParameterSpec = {
7584
7802
  return message;
7585
7803
  }
7586
7804
  };
7805
+ function createBaseClassParameterValue() {
7806
+ return {
7807
+ name: "",
7808
+ type: 0,
7809
+ stringValue: void 0,
7810
+ intValue: void 0,
7811
+ pickleValue: void 0,
7812
+ bytesValue: void 0,
7813
+ boolValue: void 0
7814
+ };
7815
+ }
7816
+ var ClassParameterValue = {
7817
+ encode(message, writer = new BinaryWriter()) {
7818
+ if (message.name !== "") {
7819
+ writer.uint32(10).string(message.name);
7820
+ }
7821
+ if (message.type !== 0) {
7822
+ writer.uint32(16).int32(message.type);
7823
+ }
7824
+ if (message.stringValue !== void 0) {
7825
+ writer.uint32(26).string(message.stringValue);
7826
+ }
7827
+ if (message.intValue !== void 0) {
7828
+ writer.uint32(32).int64(message.intValue);
7829
+ }
7830
+ if (message.pickleValue !== void 0) {
7831
+ writer.uint32(42).bytes(message.pickleValue);
7832
+ }
7833
+ if (message.bytesValue !== void 0) {
7834
+ writer.uint32(50).bytes(message.bytesValue);
7835
+ }
7836
+ if (message.boolValue !== void 0) {
7837
+ writer.uint32(56).bool(message.boolValue);
7838
+ }
7839
+ return writer;
7840
+ },
7841
+ decode(input, length) {
7842
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
7843
+ let end = length === void 0 ? reader.len : reader.pos + length;
7844
+ const message = createBaseClassParameterValue();
7845
+ while (reader.pos < end) {
7846
+ const tag = reader.uint32();
7847
+ switch (tag >>> 3) {
7848
+ case 1: {
7849
+ if (tag !== 10) {
7850
+ break;
7851
+ }
7852
+ message.name = reader.string();
7853
+ continue;
7854
+ }
7855
+ case 2: {
7856
+ if (tag !== 16) {
7857
+ break;
7858
+ }
7859
+ message.type = reader.int32();
7860
+ continue;
7861
+ }
7862
+ case 3: {
7863
+ if (tag !== 26) {
7864
+ break;
7865
+ }
7866
+ message.stringValue = reader.string();
7867
+ continue;
7868
+ }
7869
+ case 4: {
7870
+ if (tag !== 32) {
7871
+ break;
7872
+ }
7873
+ message.intValue = longToNumber(reader.int64());
7874
+ continue;
7875
+ }
7876
+ case 5: {
7877
+ if (tag !== 42) {
7878
+ break;
7879
+ }
7880
+ message.pickleValue = reader.bytes();
7881
+ continue;
7882
+ }
7883
+ case 6: {
7884
+ if (tag !== 50) {
7885
+ break;
7886
+ }
7887
+ message.bytesValue = reader.bytes();
7888
+ continue;
7889
+ }
7890
+ case 7: {
7891
+ if (tag !== 56) {
7892
+ break;
7893
+ }
7894
+ message.boolValue = reader.bool();
7895
+ continue;
7896
+ }
7897
+ }
7898
+ if ((tag & 7) === 4 || tag === 0) {
7899
+ break;
7900
+ }
7901
+ reader.skip(tag & 7);
7902
+ }
7903
+ return message;
7904
+ },
7905
+ fromJSON(object) {
7906
+ return {
7907
+ name: isSet3(object.name) ? globalThis.String(object.name) : "",
7908
+ type: isSet3(object.type) ? parameterTypeFromJSON(object.type) : 0,
7909
+ stringValue: isSet3(object.stringValue) ? globalThis.String(object.stringValue) : void 0,
7910
+ intValue: isSet3(object.intValue) ? globalThis.Number(object.intValue) : void 0,
7911
+ pickleValue: isSet3(object.pickleValue) ? bytesFromBase64(object.pickleValue) : void 0,
7912
+ bytesValue: isSet3(object.bytesValue) ? bytesFromBase64(object.bytesValue) : void 0,
7913
+ boolValue: isSet3(object.boolValue) ? globalThis.Boolean(object.boolValue) : void 0
7914
+ };
7915
+ },
7916
+ toJSON(message) {
7917
+ const obj = {};
7918
+ if (message.name !== "") {
7919
+ obj.name = message.name;
7920
+ }
7921
+ if (message.type !== 0) {
7922
+ obj.type = parameterTypeToJSON(message.type);
7923
+ }
7924
+ if (message.stringValue !== void 0) {
7925
+ obj.stringValue = message.stringValue;
7926
+ }
7927
+ if (message.intValue !== void 0) {
7928
+ obj.intValue = Math.round(message.intValue);
7929
+ }
7930
+ if (message.pickleValue !== void 0) {
7931
+ obj.pickleValue = base64FromBytes(message.pickleValue);
7932
+ }
7933
+ if (message.bytesValue !== void 0) {
7934
+ obj.bytesValue = base64FromBytes(message.bytesValue);
7935
+ }
7936
+ if (message.boolValue !== void 0) {
7937
+ obj.boolValue = message.boolValue;
7938
+ }
7939
+ return obj;
7940
+ },
7941
+ create(base) {
7942
+ return ClassParameterValue.fromPartial(base ?? {});
7943
+ },
7944
+ fromPartial(object) {
7945
+ const message = createBaseClassParameterValue();
7946
+ message.name = object.name ?? "";
7947
+ message.type = object.type ?? 0;
7948
+ message.stringValue = object.stringValue ?? void 0;
7949
+ message.intValue = object.intValue ?? void 0;
7950
+ message.pickleValue = object.pickleValue ?? void 0;
7951
+ message.bytesValue = object.bytesValue ?? void 0;
7952
+ message.boolValue = object.boolValue ?? void 0;
7953
+ return message;
7954
+ }
7955
+ };
7587
7956
  function createBaseClientHelloResponse() {
7588
7957
  return { warning: "", imageBuilderVersion: "", serverWarnings: [] };
7589
7958
  }
@@ -11923,7 +12292,7 @@ var DictPopResponse = {
11923
12292
  }
11924
12293
  };
11925
12294
  function createBaseDictUpdateRequest() {
11926
- return { dictId: "", updates: [] };
12295
+ return { dictId: "", updates: [], ifNotExists: false };
11927
12296
  }
11928
12297
  var DictUpdateRequest = {
11929
12298
  encode(message, writer = new BinaryWriter()) {
@@ -11933,6 +12302,9 @@ var DictUpdateRequest = {
11933
12302
  for (const v of message.updates) {
11934
12303
  DictEntry.encode(v, writer.uint32(18).fork()).join();
11935
12304
  }
12305
+ if (message.ifNotExists !== false) {
12306
+ writer.uint32(24).bool(message.ifNotExists);
12307
+ }
11936
12308
  return writer;
11937
12309
  },
11938
12310
  decode(input, length) {
@@ -11956,6 +12328,13 @@ var DictUpdateRequest = {
11956
12328
  message.updates.push(DictEntry.decode(reader, reader.uint32()));
11957
12329
  continue;
11958
12330
  }
12331
+ case 3: {
12332
+ if (tag !== 24) {
12333
+ break;
12334
+ }
12335
+ message.ifNotExists = reader.bool();
12336
+ continue;
12337
+ }
11959
12338
  }
11960
12339
  if ((tag & 7) === 4 || tag === 0) {
11961
12340
  break;
@@ -11967,7 +12346,8 @@ var DictUpdateRequest = {
11967
12346
  fromJSON(object) {
11968
12347
  return {
11969
12348
  dictId: isSet3(object.dictId) ? globalThis.String(object.dictId) : "",
11970
- updates: globalThis.Array.isArray(object?.updates) ? object.updates.map((e) => DictEntry.fromJSON(e)) : []
12349
+ updates: globalThis.Array.isArray(object?.updates) ? object.updates.map((e) => DictEntry.fromJSON(e)) : [],
12350
+ ifNotExists: isSet3(object.ifNotExists) ? globalThis.Boolean(object.ifNotExists) : false
11971
12351
  };
11972
12352
  },
11973
12353
  toJSON(message) {
@@ -11978,6 +12358,9 @@ var DictUpdateRequest = {
11978
12358
  if (message.updates?.length) {
11979
12359
  obj.updates = message.updates.map((e) => DictEntry.toJSON(e));
11980
12360
  }
12361
+ if (message.ifNotExists !== false) {
12362
+ obj.ifNotExists = message.ifNotExists;
12363
+ }
11981
12364
  return obj;
11982
12365
  },
11983
12366
  create(base) {
@@ -11987,14 +12370,18 @@ var DictUpdateRequest = {
11987
12370
  const message = createBaseDictUpdateRequest();
11988
12371
  message.dictId = object.dictId ?? "";
11989
12372
  message.updates = object.updates?.map((e) => DictEntry.fromPartial(e)) || [];
12373
+ message.ifNotExists = object.ifNotExists ?? false;
11990
12374
  return message;
11991
12375
  }
11992
12376
  };
11993
12377
  function createBaseDictUpdateResponse() {
11994
- return {};
12378
+ return { created: false };
11995
12379
  }
11996
12380
  var DictUpdateResponse = {
11997
- encode(_, writer = new BinaryWriter()) {
12381
+ encode(message, writer = new BinaryWriter()) {
12382
+ if (message.created !== false) {
12383
+ writer.uint32(8).bool(message.created);
12384
+ }
11998
12385
  return writer;
11999
12386
  },
12000
12387
  decode(input, length) {
@@ -12004,6 +12391,13 @@ var DictUpdateResponse = {
12004
12391
  while (reader.pos < end) {
12005
12392
  const tag = reader.uint32();
12006
12393
  switch (tag >>> 3) {
12394
+ case 1: {
12395
+ if (tag !== 8) {
12396
+ break;
12397
+ }
12398
+ message.created = reader.bool();
12399
+ continue;
12400
+ }
12007
12401
  }
12008
12402
  if ((tag & 7) === 4 || tag === 0) {
12009
12403
  break;
@@ -12012,18 +12406,22 @@ var DictUpdateResponse = {
12012
12406
  }
12013
12407
  return message;
12014
12408
  },
12015
- fromJSON(_) {
12016
- return {};
12409
+ fromJSON(object) {
12410
+ return { created: isSet3(object.created) ? globalThis.Boolean(object.created) : false };
12017
12411
  },
12018
- toJSON(_) {
12412
+ toJSON(message) {
12019
12413
  const obj = {};
12414
+ if (message.created !== false) {
12415
+ obj.created = message.created;
12416
+ }
12020
12417
  return obj;
12021
12418
  },
12022
12419
  create(base) {
12023
12420
  return DictUpdateResponse.fromPartial(base ?? {});
12024
12421
  },
12025
- fromPartial(_) {
12422
+ fromPartial(object) {
12026
12423
  const message = createBaseDictUpdateResponse();
12424
+ message.created = object.created ?? false;
12027
12425
  return message;
12028
12426
  }
12029
12427
  };
@@ -13324,7 +13722,8 @@ function createBaseFunctionMessage() {
13324
13722
  ExperimentalEnableGpuSnapshot: false,
13325
13723
  autoscalerSettings: void 0,
13326
13724
  functionSchema: void 0,
13327
- experimentalOptions: {}
13725
+ experimentalOptions: {},
13726
+ mountClientDependencies: false
13328
13727
  };
13329
13728
  }
13330
13729
  var FunctionMessage = {
@@ -13509,7 +13908,7 @@ var FunctionMessage = {
13509
13908
  if (message.snapshotDebug !== false) {
13510
13909
  writer.uint32(584).bool(message.snapshotDebug);
13511
13910
  }
13512
- Object2.entries(message.methodDefinitions).forEach(([key, value]) => {
13911
+ Object.entries(message.methodDefinitions).forEach(([key, value]) => {
13513
13912
  Function_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(594).fork()).join();
13514
13913
  });
13515
13914
  if (message.methodDefinitionsSet !== false) {
@@ -13530,9 +13929,12 @@ var FunctionMessage = {
13530
13929
  if (message.functionSchema !== void 0) {
13531
13930
  FunctionSchema.encode(message.functionSchema, writer.uint32(642).fork()).join();
13532
13931
  }
13533
- Object2.entries(message.experimentalOptions).forEach(([key, value]) => {
13932
+ Object.entries(message.experimentalOptions).forEach(([key, value]) => {
13534
13933
  Function_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(650).fork()).join();
13535
13934
  });
13935
+ if (message.mountClientDependencies !== false) {
13936
+ writer.uint32(656).bool(message.mountClientDependencies);
13937
+ }
13536
13938
  return writer;
13537
13939
  },
13538
13940
  decode(input, length) {
@@ -14024,6 +14426,13 @@ var FunctionMessage = {
14024
14426
  }
14025
14427
  continue;
14026
14428
  }
14429
+ case 82: {
14430
+ if (tag !== 656) {
14431
+ break;
14432
+ }
14433
+ message.mountClientDependencies = reader.bool();
14434
+ continue;
14435
+ }
14027
14436
  }
14028
14437
  if ((tag & 7) === 4 || tag === 0) {
14029
14438
  break;
@@ -14094,7 +14503,7 @@ var FunctionMessage = {
14094
14503
  runtimePerfRecord: isSet3(object.runtimePerfRecord) ? globalThis.Boolean(object.runtimePerfRecord) : false,
14095
14504
  schedule: isSet3(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
14096
14505
  snapshotDebug: isSet3(object.snapshotDebug) ? globalThis.Boolean(object.snapshotDebug) : false,
14097
- methodDefinitions: isObject2(object.methodDefinitions) ? Object2.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
14506
+ methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
14098
14507
  acc[key] = MethodDefinition.fromJSON(value);
14099
14508
  return acc;
14100
14509
  }, {}) : {},
@@ -14104,10 +14513,11 @@ var FunctionMessage = {
14104
14513
  ExperimentalEnableGpuSnapshot: isSet3(object.ExperimentalEnableGpuSnapshot) ? globalThis.Boolean(object.ExperimentalEnableGpuSnapshot) : false,
14105
14514
  autoscalerSettings: isSet3(object.autoscalerSettings) ? AutoscalerSettings.fromJSON(object.autoscalerSettings) : void 0,
14106
14515
  functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
14107
- experimentalOptions: isObject2(object.experimentalOptions) ? Object2.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
14516
+ experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
14108
14517
  acc[key] = String(value);
14109
14518
  return acc;
14110
- }, {}) : {}
14519
+ }, {}) : {},
14520
+ mountClientDependencies: isSet3(object.mountClientDependencies) ? globalThis.Boolean(object.mountClientDependencies) : false
14111
14521
  };
14112
14522
  },
14113
14523
  toJSON(message) {
@@ -14293,7 +14703,7 @@ var FunctionMessage = {
14293
14703
  obj.snapshotDebug = message.snapshotDebug;
14294
14704
  }
14295
14705
  if (message.methodDefinitions) {
14296
- const entries = Object2.entries(message.methodDefinitions);
14706
+ const entries = Object.entries(message.methodDefinitions);
14297
14707
  if (entries.length > 0) {
14298
14708
  obj.methodDefinitions = {};
14299
14709
  entries.forEach(([k, v]) => {
@@ -14320,7 +14730,7 @@ var FunctionMessage = {
14320
14730
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
14321
14731
  }
14322
14732
  if (message.experimentalOptions) {
14323
- const entries = Object2.entries(message.experimentalOptions);
14733
+ const entries = Object.entries(message.experimentalOptions);
14324
14734
  if (entries.length > 0) {
14325
14735
  obj.experimentalOptions = {};
14326
14736
  entries.forEach(([k, v]) => {
@@ -14328,6 +14738,9 @@ var FunctionMessage = {
14328
14738
  });
14329
14739
  }
14330
14740
  }
14741
+ if (message.mountClientDependencies !== false) {
14742
+ obj.mountClientDependencies = message.mountClientDependencies;
14743
+ }
14331
14744
  return obj;
14332
14745
  },
14333
14746
  create(base) {
@@ -14395,7 +14808,7 @@ var FunctionMessage = {
14395
14808
  message.runtimePerfRecord = object.runtimePerfRecord ?? false;
14396
14809
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
14397
14810
  message.snapshotDebug = object.snapshotDebug ?? false;
14398
- message.methodDefinitions = Object2.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
14811
+ message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
14399
14812
  if (value !== void 0) {
14400
14813
  acc[key] = MethodDefinition.fromPartial(value);
14401
14814
  }
@@ -14407,7 +14820,7 @@ var FunctionMessage = {
14407
14820
  message.ExperimentalEnableGpuSnapshot = object.ExperimentalEnableGpuSnapshot ?? false;
14408
14821
  message.autoscalerSettings = object.autoscalerSettings !== void 0 && object.autoscalerSettings !== null ? AutoscalerSettings.fromPartial(object.autoscalerSettings) : void 0;
14409
14822
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
14410
- message.experimentalOptions = Object2.entries(object.experimentalOptions ?? {}).reduce(
14823
+ message.experimentalOptions = Object.entries(object.experimentalOptions ?? {}).reduce(
14411
14824
  (acc, [key, value]) => {
14412
14825
  if (value !== void 0) {
14413
14826
  acc[key] = globalThis.String(value);
@@ -14416,6 +14829,7 @@ var FunctionMessage = {
14416
14829
  },
14417
14830
  {}
14418
14831
  );
14832
+ message.mountClientDependencies = object.mountClientDependencies ?? false;
14419
14833
  return message;
14420
14834
  }
14421
14835
  };
@@ -15792,7 +16206,7 @@ var FunctionData = {
15792
16206
  if (message.ExperimentalProxyIp !== void 0) {
15793
16207
  writer.uint32(194).string(message.ExperimentalProxyIp);
15794
16208
  }
15795
- Object2.entries(message.methodDefinitions).forEach(([key, value]) => {
16209
+ Object.entries(message.methodDefinitions).forEach(([key, value]) => {
15796
16210
  FunctionData_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(202).fork()).join();
15797
16211
  });
15798
16212
  if (message.methodDefinitionsSet !== false) {
@@ -15834,7 +16248,7 @@ var FunctionData = {
15834
16248
  if (message.functionSchema !== void 0) {
15835
16249
  FunctionSchema.encode(message.functionSchema, writer.uint32(258).fork()).join();
15836
16250
  }
15837
- Object2.entries(message.experimentalOptions).forEach(([key, value]) => {
16251
+ Object.entries(message.experimentalOptions).forEach(([key, value]) => {
15838
16252
  FunctionData_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(266).fork()).join();
15839
16253
  });
15840
16254
  return writer;
@@ -16103,7 +16517,7 @@ var FunctionData = {
16103
16517
  webhookConfig: isSet3(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
16104
16518
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
16105
16519
  ExperimentalProxyIp: isSet3(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
16106
- methodDefinitions: isObject2(object.methodDefinitions) ? Object2.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
16520
+ methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
16107
16521
  acc[key] = MethodDefinition.fromJSON(value);
16108
16522
  return acc;
16109
16523
  }, {}) : {},
@@ -16120,7 +16534,7 @@ var FunctionData = {
16120
16534
  runtimePerfRecord: isSet3(object.runtimePerfRecord) ? globalThis.Boolean(object.runtimePerfRecord) : false,
16121
16535
  autoscalerSettings: isSet3(object.autoscalerSettings) ? AutoscalerSettings.fromJSON(object.autoscalerSettings) : void 0,
16122
16536
  functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
16123
- experimentalOptions: isObject2(object.experimentalOptions) ? Object2.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
16537
+ experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
16124
16538
  acc[key] = String(value);
16125
16539
  return acc;
16126
16540
  }, {}) : {}
@@ -16180,7 +16594,7 @@ var FunctionData = {
16180
16594
  obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
16181
16595
  }
16182
16596
  if (message.methodDefinitions) {
16183
- const entries = Object2.entries(message.methodDefinitions);
16597
+ const entries = Object.entries(message.methodDefinitions);
16184
16598
  if (entries.length > 0) {
16185
16599
  obj.methodDefinitions = {};
16186
16600
  entries.forEach(([k, v]) => {
@@ -16228,7 +16642,7 @@ var FunctionData = {
16228
16642
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
16229
16643
  }
16230
16644
  if (message.experimentalOptions) {
16231
- const entries = Object2.entries(message.experimentalOptions);
16645
+ const entries = Object.entries(message.experimentalOptions);
16232
16646
  if (entries.length > 0) {
16233
16647
  obj.experimentalOptions = {};
16234
16648
  entries.forEach(([k, v]) => {
@@ -16260,7 +16674,7 @@ var FunctionData = {
16260
16674
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
16261
16675
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
16262
16676
  message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
16263
- message.methodDefinitions = Object2.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
16677
+ message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
16264
16678
  if (value !== void 0) {
16265
16679
  acc[key] = MethodDefinition.fromPartial(value);
16266
16680
  }
@@ -16279,7 +16693,7 @@ var FunctionData = {
16279
16693
  message.runtimePerfRecord = object.runtimePerfRecord ?? false;
16280
16694
  message.autoscalerSettings = object.autoscalerSettings !== void 0 && object.autoscalerSettings !== null ? AutoscalerSettings.fromPartial(object.autoscalerSettings) : void 0;
16281
16695
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
16282
- message.experimentalOptions = Object2.entries(object.experimentalOptions ?? {}).reduce(
16696
+ message.experimentalOptions = Object.entries(object.experimentalOptions ?? {}).reduce(
16283
16697
  (acc, [key, value]) => {
16284
16698
  if (value !== void 0) {
16285
16699
  acc[key] = globalThis.String(value);
@@ -17882,7 +18296,8 @@ function createBaseFunctionHandleMetadata() {
17882
18296
  definitionId: "",
17883
18297
  classParameterInfo: void 0,
17884
18298
  methodHandleMetadata: {},
17885
- functionSchema: void 0
18299
+ functionSchema: void 0,
18300
+ inputPlaneUrl: void 0
17886
18301
  };
17887
18302
  }
17888
18303
  var FunctionHandleMetadata = {
@@ -17911,12 +18326,15 @@ var FunctionHandleMetadata = {
17911
18326
  if (message.classParameterInfo !== void 0) {
17912
18327
  ClassParameterInfo.encode(message.classParameterInfo, writer.uint32(346).fork()).join();
17913
18328
  }
17914
- Object2.entries(message.methodHandleMetadata).forEach(([key, value]) => {
18329
+ Object.entries(message.methodHandleMetadata).forEach(([key, value]) => {
17915
18330
  FunctionHandleMetadata_MethodHandleMetadataEntry.encode({ key, value }, writer.uint32(354).fork()).join();
17916
18331
  });
17917
18332
  if (message.functionSchema !== void 0) {
17918
18333
  FunctionSchema.encode(message.functionSchema, writer.uint32(362).fork()).join();
17919
18334
  }
18335
+ if (message.inputPlaneUrl !== void 0) {
18336
+ writer.uint32(370).string(message.inputPlaneUrl);
18337
+ }
17920
18338
  return writer;
17921
18339
  },
17922
18340
  decode(input, length) {
@@ -17999,6 +18417,13 @@ var FunctionHandleMetadata = {
17999
18417
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
18000
18418
  continue;
18001
18419
  }
18420
+ case 46: {
18421
+ if (tag !== 370) {
18422
+ break;
18423
+ }
18424
+ message.inputPlaneUrl = reader.string();
18425
+ continue;
18426
+ }
18002
18427
  }
18003
18428
  if ((tag & 7) === 4 || tag === 0) {
18004
18429
  break;
@@ -18017,14 +18442,15 @@ var FunctionHandleMetadata = {
18017
18442
  useMethodName: isSet3(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
18018
18443
  definitionId: isSet3(object.definitionId) ? globalThis.String(object.definitionId) : "",
18019
18444
  classParameterInfo: isSet3(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
18020
- methodHandleMetadata: isObject2(object.methodHandleMetadata) ? Object2.entries(object.methodHandleMetadata).reduce(
18445
+ methodHandleMetadata: isObject2(object.methodHandleMetadata) ? Object.entries(object.methodHandleMetadata).reduce(
18021
18446
  (acc, [key, value]) => {
18022
18447
  acc[key] = FunctionHandleMetadata.fromJSON(value);
18023
18448
  return acc;
18024
18449
  },
18025
18450
  {}
18026
18451
  ) : {},
18027
- functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0
18452
+ functionSchema: isSet3(object.functionSchema) ? FunctionSchema.fromJSON(object.functionSchema) : void 0,
18453
+ inputPlaneUrl: isSet3(object.inputPlaneUrl) ? globalThis.String(object.inputPlaneUrl) : void 0
18028
18454
  };
18029
18455
  },
18030
18456
  toJSON(message) {
@@ -18054,7 +18480,7 @@ var FunctionHandleMetadata = {
18054
18480
  obj.classParameterInfo = ClassParameterInfo.toJSON(message.classParameterInfo);
18055
18481
  }
18056
18482
  if (message.methodHandleMetadata) {
18057
- const entries = Object2.entries(message.methodHandleMetadata);
18483
+ const entries = Object.entries(message.methodHandleMetadata);
18058
18484
  if (entries.length > 0) {
18059
18485
  obj.methodHandleMetadata = {};
18060
18486
  entries.forEach(([k, v]) => {
@@ -18065,6 +18491,9 @@ var FunctionHandleMetadata = {
18065
18491
  if (message.functionSchema !== void 0) {
18066
18492
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
18067
18493
  }
18494
+ if (message.inputPlaneUrl !== void 0) {
18495
+ obj.inputPlaneUrl = message.inputPlaneUrl;
18496
+ }
18068
18497
  return obj;
18069
18498
  },
18070
18499
  create(base) {
@@ -18080,13 +18509,14 @@ var FunctionHandleMetadata = {
18080
18509
  message.useMethodName = object.useMethodName ?? "";
18081
18510
  message.definitionId = object.definitionId ?? "";
18082
18511
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
18083
- message.methodHandleMetadata = Object2.entries(object.methodHandleMetadata ?? {}).reduce((acc, [key, value]) => {
18512
+ message.methodHandleMetadata = Object.entries(object.methodHandleMetadata ?? {}).reduce((acc, [key, value]) => {
18084
18513
  if (value !== void 0) {
18085
18514
  acc[key] = FunctionHandleMetadata.fromPartial(value);
18086
18515
  }
18087
18516
  return acc;
18088
18517
  }, {});
18089
18518
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
18519
+ message.inputPlaneUrl = object.inputPlaneUrl ?? void 0;
18090
18520
  return message;
18091
18521
  }
18092
18522
  };
@@ -18278,7 +18708,8 @@ function createBaseFunctionMapRequest() {
18278
18708
  returnExceptions: false,
18279
18709
  functionCallType: 0,
18280
18710
  pipelinedInputs: [],
18281
- functionCallInvocationType: 0
18711
+ functionCallInvocationType: 0,
18712
+ fromSpawnMap: false
18282
18713
  };
18283
18714
  }
18284
18715
  var FunctionMapRequest = {
@@ -18301,6 +18732,9 @@ var FunctionMapRequest = {
18301
18732
  if (message.functionCallInvocationType !== 0) {
18302
18733
  writer.uint32(48).int32(message.functionCallInvocationType);
18303
18734
  }
18735
+ if (message.fromSpawnMap !== false) {
18736
+ writer.uint32(56).bool(message.fromSpawnMap);
18737
+ }
18304
18738
  return writer;
18305
18739
  },
18306
18740
  decode(input, length) {
@@ -18352,6 +18786,13 @@ var FunctionMapRequest = {
18352
18786
  message.functionCallInvocationType = reader.int32();
18353
18787
  continue;
18354
18788
  }
18789
+ case 7: {
18790
+ if (tag !== 56) {
18791
+ break;
18792
+ }
18793
+ message.fromSpawnMap = reader.bool();
18794
+ continue;
18795
+ }
18355
18796
  }
18356
18797
  if ((tag & 7) === 4 || tag === 0) {
18357
18798
  break;
@@ -18367,7 +18808,8 @@ var FunctionMapRequest = {
18367
18808
  returnExceptions: isSet3(object.returnExceptions) ? globalThis.Boolean(object.returnExceptions) : false,
18368
18809
  functionCallType: isSet3(object.functionCallType) ? functionCallTypeFromJSON(object.functionCallType) : 0,
18369
18810
  pipelinedInputs: globalThis.Array.isArray(object?.pipelinedInputs) ? object.pipelinedInputs.map((e) => FunctionPutInputsItem.fromJSON(e)) : [],
18370
- functionCallInvocationType: isSet3(object.functionCallInvocationType) ? functionCallInvocationTypeFromJSON(object.functionCallInvocationType) : 0
18811
+ functionCallInvocationType: isSet3(object.functionCallInvocationType) ? functionCallInvocationTypeFromJSON(object.functionCallInvocationType) : 0,
18812
+ fromSpawnMap: isSet3(object.fromSpawnMap) ? globalThis.Boolean(object.fromSpawnMap) : false
18371
18813
  };
18372
18814
  },
18373
18815
  toJSON(message) {
@@ -18390,6 +18832,9 @@ var FunctionMapRequest = {
18390
18832
  if (message.functionCallInvocationType !== 0) {
18391
18833
  obj.functionCallInvocationType = functionCallInvocationTypeToJSON(message.functionCallInvocationType);
18392
18834
  }
18835
+ if (message.fromSpawnMap !== false) {
18836
+ obj.fromSpawnMap = message.fromSpawnMap;
18837
+ }
18393
18838
  return obj;
18394
18839
  },
18395
18840
  create(base) {
@@ -18403,6 +18848,7 @@ var FunctionMapRequest = {
18403
18848
  message.functionCallType = object.functionCallType ?? 0;
18404
18849
  message.pipelinedInputs = object.pipelinedInputs?.map((e) => FunctionPutInputsItem.fromPartial(e)) || [];
18405
18850
  message.functionCallInvocationType = object.functionCallInvocationType ?? 0;
18851
+ message.fromSpawnMap = object.fromSpawnMap ?? false;
18406
18852
  return message;
18407
18853
  }
18408
18854
  };
@@ -18554,7 +19000,11 @@ function createBaseFunctionOptions() {
18554
19000
  volumeMounts: [],
18555
19001
  targetConcurrentInputs: void 0,
18556
19002
  replaceVolumeMounts: false,
18557
- replaceSecretIds: false
19003
+ replaceSecretIds: false,
19004
+ bufferContainers: void 0,
19005
+ maxConcurrentInputs: void 0,
19006
+ batchMaxSize: void 0,
19007
+ batchLingerMs: void 0
18558
19008
  };
18559
19009
  }
18560
19010
  var FunctionOptions = {
@@ -18595,6 +19045,18 @@ var FunctionOptions = {
18595
19045
  if (message.replaceSecretIds !== false) {
18596
19046
  writer.uint32(96).bool(message.replaceSecretIds);
18597
19047
  }
19048
+ if (message.bufferContainers !== void 0) {
19049
+ writer.uint32(104).uint32(message.bufferContainers);
19050
+ }
19051
+ if (message.maxConcurrentInputs !== void 0) {
19052
+ writer.uint32(112).uint32(message.maxConcurrentInputs);
19053
+ }
19054
+ if (message.batchMaxSize !== void 0) {
19055
+ writer.uint32(120).uint32(message.batchMaxSize);
19056
+ }
19057
+ if (message.batchLingerMs !== void 0) {
19058
+ writer.uint32(128).uint64(message.batchLingerMs);
19059
+ }
18598
19060
  return writer;
18599
19061
  },
18600
19062
  decode(input, length) {
@@ -18688,6 +19150,34 @@ var FunctionOptions = {
18688
19150
  message.replaceSecretIds = reader.bool();
18689
19151
  continue;
18690
19152
  }
19153
+ case 13: {
19154
+ if (tag !== 104) {
19155
+ break;
19156
+ }
19157
+ message.bufferContainers = reader.uint32();
19158
+ continue;
19159
+ }
19160
+ case 14: {
19161
+ if (tag !== 112) {
19162
+ break;
19163
+ }
19164
+ message.maxConcurrentInputs = reader.uint32();
19165
+ continue;
19166
+ }
19167
+ case 15: {
19168
+ if (tag !== 120) {
19169
+ break;
19170
+ }
19171
+ message.batchMaxSize = reader.uint32();
19172
+ continue;
19173
+ }
19174
+ case 16: {
19175
+ if (tag !== 128) {
19176
+ break;
19177
+ }
19178
+ message.batchLingerMs = longToNumber(reader.uint64());
19179
+ continue;
19180
+ }
18691
19181
  }
18692
19182
  if ((tag & 7) === 4 || tag === 0) {
18693
19183
  break;
@@ -18709,7 +19199,11 @@ var FunctionOptions = {
18709
19199
  volumeMounts: globalThis.Array.isArray(object?.volumeMounts) ? object.volumeMounts.map((e) => VolumeMount.fromJSON(e)) : [],
18710
19200
  targetConcurrentInputs: isSet3(object.targetConcurrentInputs) ? globalThis.Number(object.targetConcurrentInputs) : void 0,
18711
19201
  replaceVolumeMounts: isSet3(object.replaceVolumeMounts) ? globalThis.Boolean(object.replaceVolumeMounts) : false,
18712
- replaceSecretIds: isSet3(object.replaceSecretIds) ? globalThis.Boolean(object.replaceSecretIds) : false
19202
+ replaceSecretIds: isSet3(object.replaceSecretIds) ? globalThis.Boolean(object.replaceSecretIds) : false,
19203
+ bufferContainers: isSet3(object.bufferContainers) ? globalThis.Number(object.bufferContainers) : void 0,
19204
+ maxConcurrentInputs: isSet3(object.maxConcurrentInputs) ? globalThis.Number(object.maxConcurrentInputs) : void 0,
19205
+ batchMaxSize: isSet3(object.batchMaxSize) ? globalThis.Number(object.batchMaxSize) : void 0,
19206
+ batchLingerMs: isSet3(object.batchLingerMs) ? globalThis.Number(object.batchLingerMs) : void 0
18713
19207
  };
18714
19208
  },
18715
19209
  toJSON(message) {
@@ -18750,6 +19244,18 @@ var FunctionOptions = {
18750
19244
  if (message.replaceSecretIds !== false) {
18751
19245
  obj.replaceSecretIds = message.replaceSecretIds;
18752
19246
  }
19247
+ if (message.bufferContainers !== void 0) {
19248
+ obj.bufferContainers = Math.round(message.bufferContainers);
19249
+ }
19250
+ if (message.maxConcurrentInputs !== void 0) {
19251
+ obj.maxConcurrentInputs = Math.round(message.maxConcurrentInputs);
19252
+ }
19253
+ if (message.batchMaxSize !== void 0) {
19254
+ obj.batchMaxSize = Math.round(message.batchMaxSize);
19255
+ }
19256
+ if (message.batchLingerMs !== void 0) {
19257
+ obj.batchLingerMs = Math.round(message.batchLingerMs);
19258
+ }
18753
19259
  return obj;
18754
19260
  },
18755
19261
  create(base) {
@@ -18769,6 +19275,10 @@ var FunctionOptions = {
18769
19275
  message.targetConcurrentInputs = object.targetConcurrentInputs ?? void 0;
18770
19276
  message.replaceVolumeMounts = object.replaceVolumeMounts ?? false;
18771
19277
  message.replaceSecretIds = object.replaceSecretIds ?? false;
19278
+ message.bufferContainers = object.bufferContainers ?? void 0;
19279
+ message.maxConcurrentInputs = object.maxConcurrentInputs ?? void 0;
19280
+ message.batchMaxSize = object.batchMaxSize ?? void 0;
19281
+ message.batchLingerMs = object.batchLingerMs ?? void 0;
18772
19282
  return message;
18773
19283
  }
18774
19284
  };
@@ -18808,7 +19318,7 @@ var FunctionPrecreateRequest = {
18808
19318
  if (message.useMethodName !== "") {
18809
19319
  writer.uint32(58).string(message.useMethodName);
18810
19320
  }
18811
- Object2.entries(message.methodDefinitions).forEach(([key, value]) => {
19321
+ Object.entries(message.methodDefinitions).forEach(([key, value]) => {
18812
19322
  FunctionPrecreateRequest_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(66).fork()).join();
18813
19323
  });
18814
19324
  if (message.functionSchema !== void 0) {
@@ -18906,7 +19416,7 @@ var FunctionPrecreateRequest = {
18906
19416
  webhookConfig: isSet3(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
18907
19417
  useFunctionId: isSet3(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
18908
19418
  useMethodName: isSet3(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
18909
- methodDefinitions: isObject2(object.methodDefinitions) ? Object2.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
19419
+ methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
18910
19420
  acc[key] = MethodDefinition.fromJSON(value);
18911
19421
  return acc;
18912
19422
  }, {}) : {},
@@ -18937,7 +19447,7 @@ var FunctionPrecreateRequest = {
18937
19447
  obj.useMethodName = message.useMethodName;
18938
19448
  }
18939
19449
  if (message.methodDefinitions) {
18940
- const entries = Object2.entries(message.methodDefinitions);
19450
+ const entries = Object.entries(message.methodDefinitions);
18941
19451
  if (entries.length > 0) {
18942
19452
  obj.methodDefinitions = {};
18943
19453
  entries.forEach(([k, v]) => {
@@ -18962,7 +19472,7 @@ var FunctionPrecreateRequest = {
18962
19472
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
18963
19473
  message.useFunctionId = object.useFunctionId ?? "";
18964
19474
  message.useMethodName = object.useMethodName ?? "";
18965
- message.methodDefinitions = Object2.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
19475
+ message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
18966
19476
  if (value !== void 0) {
18967
19477
  acc[key] = MethodDefinition.fromPartial(value);
18968
19478
  }
@@ -21461,19 +21971,31 @@ var ImageJoinStreamingResponse = {
21461
21971
  }
21462
21972
  };
21463
21973
  function createBaseImageMetadata() {
21464
- return { pythonVersionInfo: void 0, pythonPackages: {}, workdir: void 0 };
21974
+ return {
21975
+ pythonVersionInfo: void 0,
21976
+ pythonPackages: {},
21977
+ workdir: void 0,
21978
+ libcVersionInfo: void 0,
21979
+ imageBuilderVersion: void 0
21980
+ };
21465
21981
  }
21466
21982
  var ImageMetadata = {
21467
21983
  encode(message, writer = new BinaryWriter()) {
21468
21984
  if (message.pythonVersionInfo !== void 0) {
21469
21985
  writer.uint32(10).string(message.pythonVersionInfo);
21470
21986
  }
21471
- Object2.entries(message.pythonPackages).forEach(([key, value]) => {
21987
+ Object.entries(message.pythonPackages).forEach(([key, value]) => {
21472
21988
  ImageMetadata_PythonPackagesEntry.encode({ key, value }, writer.uint32(18).fork()).join();
21473
21989
  });
21474
21990
  if (message.workdir !== void 0) {
21475
21991
  writer.uint32(26).string(message.workdir);
21476
21992
  }
21993
+ if (message.libcVersionInfo !== void 0) {
21994
+ writer.uint32(34).string(message.libcVersionInfo);
21995
+ }
21996
+ if (message.imageBuilderVersion !== void 0) {
21997
+ writer.uint32(42).string(message.imageBuilderVersion);
21998
+ }
21477
21999
  return writer;
21478
22000
  },
21479
22001
  decode(input, length) {
@@ -21507,6 +22029,20 @@ var ImageMetadata = {
21507
22029
  message.workdir = reader.string();
21508
22030
  continue;
21509
22031
  }
22032
+ case 4: {
22033
+ if (tag !== 34) {
22034
+ break;
22035
+ }
22036
+ message.libcVersionInfo = reader.string();
22037
+ continue;
22038
+ }
22039
+ case 5: {
22040
+ if (tag !== 42) {
22041
+ break;
22042
+ }
22043
+ message.imageBuilderVersion = reader.string();
22044
+ continue;
22045
+ }
21510
22046
  }
21511
22047
  if ((tag & 7) === 4 || tag === 0) {
21512
22048
  break;
@@ -21518,11 +22054,13 @@ var ImageMetadata = {
21518
22054
  fromJSON(object) {
21519
22055
  return {
21520
22056
  pythonVersionInfo: isSet3(object.pythonVersionInfo) ? globalThis.String(object.pythonVersionInfo) : void 0,
21521
- pythonPackages: isObject2(object.pythonPackages) ? Object2.entries(object.pythonPackages).reduce((acc, [key, value]) => {
22057
+ pythonPackages: isObject2(object.pythonPackages) ? Object.entries(object.pythonPackages).reduce((acc, [key, value]) => {
21522
22058
  acc[key] = String(value);
21523
22059
  return acc;
21524
22060
  }, {}) : {},
21525
- workdir: isSet3(object.workdir) ? globalThis.String(object.workdir) : void 0
22061
+ workdir: isSet3(object.workdir) ? globalThis.String(object.workdir) : void 0,
22062
+ libcVersionInfo: isSet3(object.libcVersionInfo) ? globalThis.String(object.libcVersionInfo) : void 0,
22063
+ imageBuilderVersion: isSet3(object.imageBuilderVersion) ? globalThis.String(object.imageBuilderVersion) : void 0
21526
22064
  };
21527
22065
  },
21528
22066
  toJSON(message) {
@@ -21531,7 +22069,7 @@ var ImageMetadata = {
21531
22069
  obj.pythonVersionInfo = message.pythonVersionInfo;
21532
22070
  }
21533
22071
  if (message.pythonPackages) {
21534
- const entries = Object2.entries(message.pythonPackages);
22072
+ const entries = Object.entries(message.pythonPackages);
21535
22073
  if (entries.length > 0) {
21536
22074
  obj.pythonPackages = {};
21537
22075
  entries.forEach(([k, v]) => {
@@ -21542,6 +22080,12 @@ var ImageMetadata = {
21542
22080
  if (message.workdir !== void 0) {
21543
22081
  obj.workdir = message.workdir;
21544
22082
  }
22083
+ if (message.libcVersionInfo !== void 0) {
22084
+ obj.libcVersionInfo = message.libcVersionInfo;
22085
+ }
22086
+ if (message.imageBuilderVersion !== void 0) {
22087
+ obj.imageBuilderVersion = message.imageBuilderVersion;
22088
+ }
21545
22089
  return obj;
21546
22090
  },
21547
22091
  create(base) {
@@ -21550,7 +22094,7 @@ var ImageMetadata = {
21550
22094
  fromPartial(object) {
21551
22095
  const message = createBaseImageMetadata();
21552
22096
  message.pythonVersionInfo = object.pythonVersionInfo ?? void 0;
21553
- message.pythonPackages = Object2.entries(object.pythonPackages ?? {}).reduce(
22097
+ message.pythonPackages = Object.entries(object.pythonPackages ?? {}).reduce(
21554
22098
  (acc, [key, value]) => {
21555
22099
  if (value !== void 0) {
21556
22100
  acc[key] = globalThis.String(value);
@@ -21560,6 +22104,8 @@ var ImageMetadata = {
21560
22104
  {}
21561
22105
  );
21562
22106
  message.workdir = object.workdir ?? void 0;
22107
+ message.libcVersionInfo = object.libcVersionInfo ?? void 0;
22108
+ message.imageBuilderVersion = object.imageBuilderVersion ?? void 0;
21563
22109
  return message;
21564
22110
  }
21565
22111
  };
@@ -23465,7 +24011,7 @@ function createBaseObject() {
23465
24011
  volumeMetadata: void 0
23466
24012
  };
23467
24013
  }
23468
- var Object2 = {
24014
+ var Object_ = {
23469
24015
  encode(message, writer = new BinaryWriter()) {
23470
24016
  if (message.objectId !== "") {
23471
24017
  writer.uint32(10).string(message.objectId);
@@ -23577,7 +24123,7 @@ var Object2 = {
23577
24123
  return obj;
23578
24124
  },
23579
24125
  create(base) {
23580
- return Object2.fromPartial(base ?? {});
24126
+ return Object_.fromPartial(base ?? {});
23581
24127
  },
23582
24128
  fromPartial(object) {
23583
24129
  const message = createBaseObject();
@@ -23785,7 +24331,7 @@ var PTYInfo = {
23785
24331
  }
23786
24332
  };
23787
24333
  function createBasePortSpec() {
23788
- return { port: 0, unencrypted: false };
24334
+ return { port: 0, unencrypted: false, tunnelType: void 0 };
23789
24335
  }
23790
24336
  var PortSpec = {
23791
24337
  encode(message, writer = new BinaryWriter()) {
@@ -23795,6 +24341,9 @@ var PortSpec = {
23795
24341
  if (message.unencrypted !== false) {
23796
24342
  writer.uint32(16).bool(message.unencrypted);
23797
24343
  }
24344
+ if (message.tunnelType !== void 0) {
24345
+ writer.uint32(24).int32(message.tunnelType);
24346
+ }
23798
24347
  return writer;
23799
24348
  },
23800
24349
  decode(input, length) {
@@ -23818,6 +24367,13 @@ var PortSpec = {
23818
24367
  message.unencrypted = reader.bool();
23819
24368
  continue;
23820
24369
  }
24370
+ case 3: {
24371
+ if (tag !== 24) {
24372
+ break;
24373
+ }
24374
+ message.tunnelType = reader.int32();
24375
+ continue;
24376
+ }
23821
24377
  }
23822
24378
  if ((tag & 7) === 4 || tag === 0) {
23823
24379
  break;
@@ -23829,7 +24385,8 @@ var PortSpec = {
23829
24385
  fromJSON(object) {
23830
24386
  return {
23831
24387
  port: isSet3(object.port) ? globalThis.Number(object.port) : 0,
23832
- unencrypted: isSet3(object.unencrypted) ? globalThis.Boolean(object.unencrypted) : false
24388
+ unencrypted: isSet3(object.unencrypted) ? globalThis.Boolean(object.unencrypted) : false,
24389
+ tunnelType: isSet3(object.tunnelType) ? tunnelTypeFromJSON(object.tunnelType) : void 0
23833
24390
  };
23834
24391
  },
23835
24392
  toJSON(message) {
@@ -23840,6 +24397,9 @@ var PortSpec = {
23840
24397
  if (message.unencrypted !== false) {
23841
24398
  obj.unencrypted = message.unencrypted;
23842
24399
  }
24400
+ if (message.tunnelType !== void 0) {
24401
+ obj.tunnelType = tunnelTypeToJSON(message.tunnelType);
24402
+ }
23843
24403
  return obj;
23844
24404
  },
23845
24405
  create(base) {
@@ -23849,6 +24409,7 @@ var PortSpec = {
23849
24409
  const message = createBasePortSpec();
23850
24410
  message.port = object.port ?? 0;
23851
24411
  message.unencrypted = object.unencrypted ?? false;
24412
+ message.tunnelType = object.tunnelType ?? void 0;
23852
24413
  return message;
23853
24414
  }
23854
24415
  };
@@ -29114,13 +29675,16 @@ var Schedule = {
29114
29675
  }
29115
29676
  };
29116
29677
  function createBaseSchedule_Cron() {
29117
- return { cronString: "" };
29678
+ return { cronString: "", timezone: "" };
29118
29679
  }
29119
29680
  var Schedule_Cron = {
29120
29681
  encode(message, writer = new BinaryWriter()) {
29121
29682
  if (message.cronString !== "") {
29122
29683
  writer.uint32(10).string(message.cronString);
29123
29684
  }
29685
+ if (message.timezone !== "") {
29686
+ writer.uint32(18).string(message.timezone);
29687
+ }
29124
29688
  return writer;
29125
29689
  },
29126
29690
  decode(input, length) {
@@ -29137,6 +29701,13 @@ var Schedule_Cron = {
29137
29701
  message.cronString = reader.string();
29138
29702
  continue;
29139
29703
  }
29704
+ case 2: {
29705
+ if (tag !== 18) {
29706
+ break;
29707
+ }
29708
+ message.timezone = reader.string();
29709
+ continue;
29710
+ }
29140
29711
  }
29141
29712
  if ((tag & 7) === 4 || tag === 0) {
29142
29713
  break;
@@ -29146,13 +29717,19 @@ var Schedule_Cron = {
29146
29717
  return message;
29147
29718
  },
29148
29719
  fromJSON(object) {
29149
- return { cronString: isSet3(object.cronString) ? globalThis.String(object.cronString) : "" };
29720
+ return {
29721
+ cronString: isSet3(object.cronString) ? globalThis.String(object.cronString) : "",
29722
+ timezone: isSet3(object.timezone) ? globalThis.String(object.timezone) : ""
29723
+ };
29150
29724
  },
29151
29725
  toJSON(message) {
29152
29726
  const obj = {};
29153
29727
  if (message.cronString !== "") {
29154
29728
  obj.cronString = message.cronString;
29155
29729
  }
29730
+ if (message.timezone !== "") {
29731
+ obj.timezone = message.timezone;
29732
+ }
29156
29733
  return obj;
29157
29734
  },
29158
29735
  create(base) {
@@ -29161,6 +29738,7 @@ var Schedule_Cron = {
29161
29738
  fromPartial(object) {
29162
29739
  const message = createBaseSchedule_Cron();
29163
29740
  message.cronString = object.cronString ?? "";
29741
+ message.timezone = object.timezone ?? "";
29164
29742
  return message;
29165
29743
  }
29166
29744
  };
@@ -29481,7 +30059,7 @@ var SecretGetOrCreateRequest = {
29481
30059
  if (message.objectCreationType !== 0) {
29482
30060
  writer.uint32(32).int32(message.objectCreationType);
29483
30061
  }
29484
- Object2.entries(message.envDict).forEach(([key, value]) => {
30062
+ Object.entries(message.envDict).forEach(([key, value]) => {
29485
30063
  SecretGetOrCreateRequest_EnvDictEntry.encode({ key, value }, writer.uint32(42).fork()).join();
29486
30064
  });
29487
30065
  if (message.appId !== "") {
@@ -29565,7 +30143,7 @@ var SecretGetOrCreateRequest = {
29565
30143
  namespace: isSet3(object.namespace) ? deploymentNamespaceFromJSON(object.namespace) : 0,
29566
30144
  environmentName: isSet3(object.environmentName) ? globalThis.String(object.environmentName) : "",
29567
30145
  objectCreationType: isSet3(object.objectCreationType) ? objectCreationTypeFromJSON(object.objectCreationType) : 0,
29568
- envDict: isObject2(object.envDict) ? Object2.entries(object.envDict).reduce((acc, [key, value]) => {
30146
+ envDict: isObject2(object.envDict) ? Object.entries(object.envDict).reduce((acc, [key, value]) => {
29569
30147
  acc[key] = String(value);
29570
30148
  return acc;
29571
30149
  }, {}) : {},
@@ -29588,7 +30166,7 @@ var SecretGetOrCreateRequest = {
29588
30166
  obj.objectCreationType = objectCreationTypeToJSON(message.objectCreationType);
29589
30167
  }
29590
30168
  if (message.envDict) {
29591
- const entries = Object2.entries(message.envDict);
30169
+ const entries = Object.entries(message.envDict);
29592
30170
  if (entries.length > 0) {
29593
30171
  obj.envDict = {};
29594
30172
  entries.forEach(([k, v]) => {
@@ -29613,7 +30191,7 @@ var SecretGetOrCreateRequest = {
29613
30191
  message.namespace = object.namespace ?? 0;
29614
30192
  message.environmentName = object.environmentName ?? "";
29615
30193
  message.objectCreationType = object.objectCreationType ?? 0;
29616
- message.envDict = Object2.entries(object.envDict ?? {}).reduce((acc, [key, value]) => {
30194
+ message.envDict = Object.entries(object.envDict ?? {}).reduce((acc, [key, value]) => {
29617
30195
  if (value !== void 0) {
29618
30196
  acc[key] = globalThis.String(value);
29619
30197
  }
@@ -31587,7 +32165,8 @@ function createBaseTaskLogs() {
31587
32165
  fileDescriptor: 0,
31588
32166
  taskProgress: void 0,
31589
32167
  functionCallId: "",
31590
- inputId: ""
32168
+ inputId: "",
32169
+ timestampNs: 0
31591
32170
  };
31592
32171
  }
31593
32172
  var TaskLogs = {
@@ -31613,6 +32192,9 @@ var TaskLogs = {
31613
32192
  if (message.inputId !== "") {
31614
32193
  writer.uint32(90).string(message.inputId);
31615
32194
  }
32195
+ if (message.timestampNs !== 0) {
32196
+ writer.uint32(96).uint64(message.timestampNs);
32197
+ }
31616
32198
  return writer;
31617
32199
  },
31618
32200
  decode(input, length) {
@@ -31671,6 +32253,13 @@ var TaskLogs = {
31671
32253
  message.inputId = reader.string();
31672
32254
  continue;
31673
32255
  }
32256
+ case 12: {
32257
+ if (tag !== 96) {
32258
+ break;
32259
+ }
32260
+ message.timestampNs = longToNumber(reader.uint64());
32261
+ continue;
32262
+ }
31674
32263
  }
31675
32264
  if ((tag & 7) === 4 || tag === 0) {
31676
32265
  break;
@@ -31687,7 +32276,8 @@ var TaskLogs = {
31687
32276
  fileDescriptor: isSet3(object.fileDescriptor) ? fileDescriptorFromJSON(object.fileDescriptor) : 0,
31688
32277
  taskProgress: isSet3(object.taskProgress) ? TaskProgress.fromJSON(object.taskProgress) : void 0,
31689
32278
  functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
31690
- inputId: isSet3(object.inputId) ? globalThis.String(object.inputId) : ""
32279
+ inputId: isSet3(object.inputId) ? globalThis.String(object.inputId) : "",
32280
+ timestampNs: isSet3(object.timestampNs) ? globalThis.Number(object.timestampNs) : 0
31691
32281
  };
31692
32282
  },
31693
32283
  toJSON(message) {
@@ -31713,6 +32303,9 @@ var TaskLogs = {
31713
32303
  if (message.inputId !== "") {
31714
32304
  obj.inputId = message.inputId;
31715
32305
  }
32306
+ if (message.timestampNs !== 0) {
32307
+ obj.timestampNs = Math.round(message.timestampNs);
32308
+ }
31716
32309
  return obj;
31717
32310
  },
31718
32311
  create(base) {
@@ -31727,6 +32320,7 @@ var TaskLogs = {
31727
32320
  message.taskProgress = object.taskProgress !== void 0 && object.taskProgress !== null ? TaskProgress.fromPartial(object.taskProgress) : void 0;
31728
32321
  message.functionCallId = object.functionCallId ?? "";
31729
32322
  message.inputId = object.inputId ?? "";
32323
+ message.timestampNs = object.timestampNs ?? 0;
31730
32324
  return message;
31731
32325
  }
31732
32326
  };
@@ -32765,7 +33359,7 @@ var TunnelData = {
32765
33359
  }
32766
33360
  };
32767
33361
  function createBaseTunnelStartRequest() {
32768
- return { port: 0, unencrypted: false };
33362
+ return { port: 0, unencrypted: false, tunnelType: void 0 };
32769
33363
  }
32770
33364
  var TunnelStartRequest = {
32771
33365
  encode(message, writer = new BinaryWriter()) {
@@ -32775,6 +33369,9 @@ var TunnelStartRequest = {
32775
33369
  if (message.unencrypted !== false) {
32776
33370
  writer.uint32(16).bool(message.unencrypted);
32777
33371
  }
33372
+ if (message.tunnelType !== void 0) {
33373
+ writer.uint32(24).int32(message.tunnelType);
33374
+ }
32778
33375
  return writer;
32779
33376
  },
32780
33377
  decode(input, length) {
@@ -32798,6 +33395,13 @@ var TunnelStartRequest = {
32798
33395
  message.unencrypted = reader.bool();
32799
33396
  continue;
32800
33397
  }
33398
+ case 3: {
33399
+ if (tag !== 24) {
33400
+ break;
33401
+ }
33402
+ message.tunnelType = reader.int32();
33403
+ continue;
33404
+ }
32801
33405
  }
32802
33406
  if ((tag & 7) === 4 || tag === 0) {
32803
33407
  break;
@@ -32809,7 +33413,8 @@ var TunnelStartRequest = {
32809
33413
  fromJSON(object) {
32810
33414
  return {
32811
33415
  port: isSet3(object.port) ? globalThis.Number(object.port) : 0,
32812
- unencrypted: isSet3(object.unencrypted) ? globalThis.Boolean(object.unencrypted) : false
33416
+ unencrypted: isSet3(object.unencrypted) ? globalThis.Boolean(object.unencrypted) : false,
33417
+ tunnelType: isSet3(object.tunnelType) ? tunnelTypeFromJSON(object.tunnelType) : void 0
32813
33418
  };
32814
33419
  },
32815
33420
  toJSON(message) {
@@ -32820,6 +33425,9 @@ var TunnelStartRequest = {
32820
33425
  if (message.unencrypted !== false) {
32821
33426
  obj.unencrypted = message.unencrypted;
32822
33427
  }
33428
+ if (message.tunnelType !== void 0) {
33429
+ obj.tunnelType = tunnelTypeToJSON(message.tunnelType);
33430
+ }
32823
33431
  return obj;
32824
33432
  },
32825
33433
  create(base) {
@@ -32829,6 +33437,7 @@ var TunnelStartRequest = {
32829
33437
  const message = createBaseTunnelStartRequest();
32830
33438
  message.port = object.port ?? 0;
32831
33439
  message.unencrypted = object.unencrypted ?? false;
33440
+ message.tunnelType = object.tunnelType ?? void 0;
32832
33441
  return message;
32833
33442
  }
32834
33443
  };
@@ -33134,6 +33743,104 @@ var VolumeCommitResponse = {
33134
33743
  return message;
33135
33744
  }
33136
33745
  };
33746
+ function createBaseVolumeCopyFiles2Request() {
33747
+ return { volumeId: "", srcPaths: [], dstPath: "", recursive: false };
33748
+ }
33749
+ var VolumeCopyFiles2Request = {
33750
+ encode(message, writer = new BinaryWriter()) {
33751
+ if (message.volumeId !== "") {
33752
+ writer.uint32(10).string(message.volumeId);
33753
+ }
33754
+ for (const v of message.srcPaths) {
33755
+ writer.uint32(18).string(v);
33756
+ }
33757
+ if (message.dstPath !== "") {
33758
+ writer.uint32(26).string(message.dstPath);
33759
+ }
33760
+ if (message.recursive !== false) {
33761
+ writer.uint32(32).bool(message.recursive);
33762
+ }
33763
+ return writer;
33764
+ },
33765
+ decode(input, length) {
33766
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
33767
+ let end = length === void 0 ? reader.len : reader.pos + length;
33768
+ const message = createBaseVolumeCopyFiles2Request();
33769
+ while (reader.pos < end) {
33770
+ const tag = reader.uint32();
33771
+ switch (tag >>> 3) {
33772
+ case 1: {
33773
+ if (tag !== 10) {
33774
+ break;
33775
+ }
33776
+ message.volumeId = reader.string();
33777
+ continue;
33778
+ }
33779
+ case 2: {
33780
+ if (tag !== 18) {
33781
+ break;
33782
+ }
33783
+ message.srcPaths.push(reader.string());
33784
+ continue;
33785
+ }
33786
+ case 3: {
33787
+ if (tag !== 26) {
33788
+ break;
33789
+ }
33790
+ message.dstPath = reader.string();
33791
+ continue;
33792
+ }
33793
+ case 4: {
33794
+ if (tag !== 32) {
33795
+ break;
33796
+ }
33797
+ message.recursive = reader.bool();
33798
+ continue;
33799
+ }
33800
+ }
33801
+ if ((tag & 7) === 4 || tag === 0) {
33802
+ break;
33803
+ }
33804
+ reader.skip(tag & 7);
33805
+ }
33806
+ return message;
33807
+ },
33808
+ fromJSON(object) {
33809
+ return {
33810
+ volumeId: isSet3(object.volumeId) ? globalThis.String(object.volumeId) : "",
33811
+ srcPaths: globalThis.Array.isArray(object?.srcPaths) ? object.srcPaths.map((e) => globalThis.String(e)) : [],
33812
+ dstPath: isSet3(object.dstPath) ? globalThis.String(object.dstPath) : "",
33813
+ recursive: isSet3(object.recursive) ? globalThis.Boolean(object.recursive) : false
33814
+ };
33815
+ },
33816
+ toJSON(message) {
33817
+ const obj = {};
33818
+ if (message.volumeId !== "") {
33819
+ obj.volumeId = message.volumeId;
33820
+ }
33821
+ if (message.srcPaths?.length) {
33822
+ obj.srcPaths = message.srcPaths;
33823
+ }
33824
+ if (message.dstPath !== "") {
33825
+ obj.dstPath = message.dstPath;
33826
+ }
33827
+ if (message.recursive !== false) {
33828
+ obj.recursive = message.recursive;
33829
+ }
33830
+ return obj;
33831
+ },
33832
+ create(base) {
33833
+ return VolumeCopyFiles2Request.fromPartial(base ?? {});
33834
+ },
33835
+ fromPartial(object) {
33836
+ const message = createBaseVolumeCopyFiles2Request();
33837
+ message.volumeId = object.volumeId ?? "";
33838
+ message.srcPaths = object.srcPaths?.map((e) => e) || [];
33839
+ message.dstPath = object.dstPath ?? "";
33840
+ message.recursive = object.recursive ?? false;
33841
+ return message;
33842
+ }
33843
+ };
33137
33844
  function createBaseVolumeCopyFilesRequest() {
33138
33845
  return { volumeId: "", srcPaths: [], dstPath: "", recursive: false };
33139
33846
  }
@@ -33300,6 +34007,202 @@ var VolumeDeleteRequest = {
33300
34007
  return message;
33301
34008
  }
33302
34009
  };
34010
+ function createBaseVolumeGetFile2Request() {
34011
+ return { volumeId: "", path: "", start: 0, len: 0 };
34012
+ }
34013
+ var VolumeGetFile2Request = {
34014
+ encode(message, writer = new BinaryWriter()) {
34015
+ if (message.volumeId !== "") {
34016
+ writer.uint32(10).string(message.volumeId);
34017
+ }
34018
+ if (message.path !== "") {
34019
+ writer.uint32(18).string(message.path);
34020
+ }
34021
+ if (message.start !== 0) {
34022
+ writer.uint32(24).uint64(message.start);
34023
+ }
34024
+ if (message.len !== 0) {
34025
+ writer.uint32(32).uint64(message.len);
34026
+ }
34027
+ return writer;
34028
+ },
34029
+ decode(input, length) {
34030
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34031
+ let end = length === void 0 ? reader.len : reader.pos + length;
34032
+ const message = createBaseVolumeGetFile2Request();
34033
+ while (reader.pos < end) {
34034
+ const tag = reader.uint32();
34035
+ switch (tag >>> 3) {
34036
+ case 1: {
34037
+ if (tag !== 10) {
34038
+ break;
34039
+ }
34040
+ message.volumeId = reader.string();
34041
+ continue;
34042
+ }
34043
+ case 2: {
34044
+ if (tag !== 18) {
34045
+ break;
34046
+ }
34047
+ message.path = reader.string();
34048
+ continue;
34049
+ }
34050
+ case 3: {
34051
+ if (tag !== 24) {
34052
+ break;
34053
+ }
34054
+ message.start = longToNumber(reader.uint64());
34055
+ continue;
34056
+ }
34057
+ case 4: {
34058
+ if (tag !== 32) {
34059
+ break;
34060
+ }
34061
+ message.len = longToNumber(reader.uint64());
34062
+ continue;
34063
+ }
34064
+ }
34065
+ if ((tag & 7) === 4 || tag === 0) {
34066
+ break;
34067
+ }
34068
+ reader.skip(tag & 7);
34069
+ }
34070
+ return message;
34071
+ },
34072
+ fromJSON(object) {
34073
+ return {
34074
+ volumeId: isSet3(object.volumeId) ? globalThis.String(object.volumeId) : "",
34075
+ path: isSet3(object.path) ? globalThis.String(object.path) : "",
34076
+ start: isSet3(object.start) ? globalThis.Number(object.start) : 0,
34077
+ len: isSet3(object.len) ? globalThis.Number(object.len) : 0
34078
+ };
34079
+ },
34080
+ toJSON(message) {
34081
+ const obj = {};
34082
+ if (message.volumeId !== "") {
34083
+ obj.volumeId = message.volumeId;
34084
+ }
34085
+ if (message.path !== "") {
34086
+ obj.path = message.path;
34087
+ }
34088
+ if (message.start !== 0) {
34089
+ obj.start = Math.round(message.start);
34090
+ }
34091
+ if (message.len !== 0) {
34092
+ obj.len = Math.round(message.len);
34093
+ }
34094
+ return obj;
34095
+ },
34096
+ create(base) {
34097
+ return VolumeGetFile2Request.fromPartial(base ?? {});
34098
+ },
34099
+ fromPartial(object) {
34100
+ const message = createBaseVolumeGetFile2Request();
34101
+ message.volumeId = object.volumeId ?? "";
34102
+ message.path = object.path ?? "";
34103
+ message.start = object.start ?? 0;
34104
+ message.len = object.len ?? 0;
34105
+ return message;
34106
+ }
34107
+ };
34108
+ function createBaseVolumeGetFile2Response() {
34109
+ return { getUrls: [], size: 0, start: 0, len: 0 };
34110
+ }
34111
+ var VolumeGetFile2Response = {
34112
+ encode(message, writer = new BinaryWriter()) {
34113
+ for (const v of message.getUrls) {
34114
+ writer.uint32(10).string(v);
34115
+ }
34116
+ if (message.size !== 0) {
34117
+ writer.uint32(16).uint64(message.size);
34118
+ }
34119
+ if (message.start !== 0) {
34120
+ writer.uint32(24).uint64(message.start);
34121
+ }
34122
+ if (message.len !== 0) {
34123
+ writer.uint32(32).uint64(message.len);
34124
+ }
34125
+ return writer;
34126
+ },
34127
+ decode(input, length) {
34128
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34129
+ let end = length === void 0 ? reader.len : reader.pos + length;
34130
+ const message = createBaseVolumeGetFile2Response();
34131
+ while (reader.pos < end) {
34132
+ const tag = reader.uint32();
34133
+ switch (tag >>> 3) {
34134
+ case 1: {
34135
+ if (tag !== 10) {
34136
+ break;
34137
+ }
34138
+ message.getUrls.push(reader.string());
34139
+ continue;
34140
+ }
34141
+ case 2: {
34142
+ if (tag !== 16) {
34143
+ break;
34144
+ }
34145
+ message.size = longToNumber(reader.uint64());
34146
+ continue;
34147
+ }
34148
+ case 3: {
34149
+ if (tag !== 24) {
34150
+ break;
34151
+ }
34152
+ message.start = longToNumber(reader.uint64());
34153
+ continue;
34154
+ }
34155
+ case 4: {
34156
+ if (tag !== 32) {
34157
+ break;
34158
+ }
34159
+ message.len = longToNumber(reader.uint64());
34160
+ continue;
34161
+ }
34162
+ }
34163
+ if ((tag & 7) === 4 || tag === 0) {
34164
+ break;
34165
+ }
34166
+ reader.skip(tag & 7);
34167
+ }
34168
+ return message;
34169
+ },
34170
+ fromJSON(object) {
34171
+ return {
34172
+ getUrls: globalThis.Array.isArray(object?.getUrls) ? object.getUrls.map((e) => globalThis.String(e)) : [],
34173
+ size: isSet3(object.size) ? globalThis.Number(object.size) : 0,
34174
+ start: isSet3(object.start) ? globalThis.Number(object.start) : 0,
34175
+ len: isSet3(object.len) ? globalThis.Number(object.len) : 0
34176
+ };
34177
+ },
34178
+ toJSON(message) {
34179
+ const obj = {};
34180
+ if (message.getUrls?.length) {
34181
+ obj.getUrls = message.getUrls;
34182
+ }
34183
+ if (message.size !== 0) {
34184
+ obj.size = Math.round(message.size);
34185
+ }
34186
+ if (message.start !== 0) {
34187
+ obj.start = Math.round(message.start);
34188
+ }
34189
+ if (message.len !== 0) {
34190
+ obj.len = Math.round(message.len);
34191
+ }
34192
+ return obj;
34193
+ },
34194
+ create(base) {
34195
+ return VolumeGetFile2Response.fromPartial(base ?? {});
34196
+ },
34197
+ fromPartial(object) {
34198
+ const message = createBaseVolumeGetFile2Response();
34199
+ message.getUrls = object.getUrls?.map((e) => e) || [];
34200
+ message.size = object.size ?? 0;
34201
+ message.start = object.start ?? 0;
34202
+ message.len = object.len ?? 0;
34203
+ return message;
34204
+ }
34205
+ };
33303
34206
  function createBaseVolumeGetFileRequest() {
33304
34207
  return { volumeId: "", path: "", start: 0, len: 0 };
33305
34208
  }
@@ -33773,6 +34676,157 @@ var VolumeHeartbeatRequest = {
33773
34676
  return message;
33774
34677
  }
33775
34678
  };
34679
+ function createBaseVolumeListFiles2Request() {
34680
+ return { volumeId: "", path: "", recursive: false, maxEntries: void 0 };
34681
+ }
34682
+ var VolumeListFiles2Request = {
34683
+ encode(message, writer = new BinaryWriter()) {
34684
+ if (message.volumeId !== "") {
34685
+ writer.uint32(10).string(message.volumeId);
34686
+ }
34687
+ if (message.path !== "") {
34688
+ writer.uint32(18).string(message.path);
34689
+ }
34690
+ if (message.recursive !== false) {
34691
+ writer.uint32(32).bool(message.recursive);
34692
+ }
34693
+ if (message.maxEntries !== void 0) {
34694
+ writer.uint32(24).uint32(message.maxEntries);
34695
+ }
34696
+ return writer;
34697
+ },
34698
+ decode(input, length) {
34699
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34700
+ let end = length === void 0 ? reader.len : reader.pos + length;
34701
+ const message = createBaseVolumeListFiles2Request();
34702
+ while (reader.pos < end) {
34703
+ const tag = reader.uint32();
34704
+ switch (tag >>> 3) {
34705
+ case 1: {
34706
+ if (tag !== 10) {
34707
+ break;
34708
+ }
34709
+ message.volumeId = reader.string();
34710
+ continue;
34711
+ }
34712
+ case 2: {
34713
+ if (tag !== 18) {
34714
+ break;
34715
+ }
34716
+ message.path = reader.string();
34717
+ continue;
34718
+ }
34719
+ case 4: {
34720
+ if (tag !== 32) {
34721
+ break;
34722
+ }
34723
+ message.recursive = reader.bool();
34724
+ continue;
34725
+ }
34726
+ case 3: {
34727
+ if (tag !== 24) {
34728
+ break;
34729
+ }
34730
+ message.maxEntries = reader.uint32();
34731
+ continue;
34732
+ }
34733
+ }
34734
+ if ((tag & 7) === 4 || tag === 0) {
34735
+ break;
34736
+ }
34737
+ reader.skip(tag & 7);
34738
+ }
34739
+ return message;
34740
+ },
34741
+ fromJSON(object) {
34742
+ return {
34743
+ volumeId: isSet3(object.volumeId) ? globalThis.String(object.volumeId) : "",
34744
+ path: isSet3(object.path) ? globalThis.String(object.path) : "",
34745
+ recursive: isSet3(object.recursive) ? globalThis.Boolean(object.recursive) : false,
34746
+ maxEntries: isSet3(object.maxEntries) ? globalThis.Number(object.maxEntries) : void 0
34747
+ };
34748
+ },
34749
+ toJSON(message) {
34750
+ const obj = {};
34751
+ if (message.volumeId !== "") {
34752
+ obj.volumeId = message.volumeId;
34753
+ }
34754
+ if (message.path !== "") {
34755
+ obj.path = message.path;
34756
+ }
34757
+ if (message.recursive !== false) {
34758
+ obj.recursive = message.recursive;
34759
+ }
34760
+ if (message.maxEntries !== void 0) {
34761
+ obj.maxEntries = Math.round(message.maxEntries);
34762
+ }
34763
+ return obj;
34764
+ },
34765
+ create(base) {
34766
+ return VolumeListFiles2Request.fromPartial(base ?? {});
34767
+ },
34768
+ fromPartial(object) {
34769
+ const message = createBaseVolumeListFiles2Request();
34770
+ message.volumeId = object.volumeId ?? "";
34771
+ message.path = object.path ?? "";
34772
+ message.recursive = object.recursive ?? false;
34773
+ message.maxEntries = object.maxEntries ?? void 0;
34774
+ return message;
34775
+ }
34776
+ };
34777
+ function createBaseVolumeListFiles2Response() {
34778
+ return { entries: [] };
34779
+ }
34780
+ var VolumeListFiles2Response = {
34781
+ encode(message, writer = new BinaryWriter()) {
34782
+ for (const v of message.entries) {
34783
+ FileEntry.encode(v, writer.uint32(10).fork()).join();
34784
+ }
34785
+ return writer;
34786
+ },
34787
+ decode(input, length) {
34788
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34789
+ let end = length === void 0 ? reader.len : reader.pos + length;
34790
+ const message = createBaseVolumeListFiles2Response();
34791
+ while (reader.pos < end) {
34792
+ const tag = reader.uint32();
34793
+ switch (tag >>> 3) {
34794
+ case 1: {
34795
+ if (tag !== 10) {
34796
+ break;
34797
+ }
34798
+ message.entries.push(FileEntry.decode(reader, reader.uint32()));
34799
+ continue;
34800
+ }
34801
+ }
34802
+ if ((tag & 7) === 4 || tag === 0) {
34803
+ break;
34804
+ }
34805
+ reader.skip(tag & 7);
34806
+ }
34807
+ return message;
34808
+ },
34809
+ fromJSON(object) {
34810
+ return {
34811
+ entries: globalThis.Array.isArray(object?.entries) ? object.entries.map((e) => FileEntry.fromJSON(e)) : []
34812
+ };
34813
+ },
34814
+ toJSON(message) {
34815
+ const obj = {};
34816
+ if (message.entries?.length) {
34817
+ obj.entries = message.entries.map((e) => FileEntry.toJSON(e));
34818
+ }
34819
+ return obj;
34820
+ },
34821
+ create(base) {
34822
+ return VolumeListFiles2Response.fromPartial(base ?? {});
34823
+ },
34824
+ fromPartial(object) {
34825
+ const message = createBaseVolumeListFiles2Response();
34826
+ message.entries = object.entries?.map((e) => FileEntry.fromPartial(e)) || [];
34827
+ return message;
34828
+ }
34829
+ };
33776
34830
  function createBaseVolumeListFilesRequest() {
33777
34831
  return { volumeId: "", path: "", recursive: false, maxEntries: void 0 };
33778
34832
  }
@@ -34794,6 +35848,89 @@ var VolumeReloadRequest = {
34794
35848
  return message;
34795
35849
  }
34796
35850
  };
35851
+ function createBaseVolumeRemoveFile2Request() {
35852
+ return { volumeId: "", path: "", recursive: false };
35853
+ }
35854
+ var VolumeRemoveFile2Request = {
35855
+ encode(message, writer = new BinaryWriter()) {
35856
+ if (message.volumeId !== "") {
35857
+ writer.uint32(10).string(message.volumeId);
35858
+ }
35859
+ if (message.path !== "") {
35860
+ writer.uint32(18).string(message.path);
35861
+ }
35862
+ if (message.recursive !== false) {
35863
+ writer.uint32(24).bool(message.recursive);
35864
+ }
35865
+ return writer;
35866
+ },
35867
+ decode(input, length) {
35868
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
35869
+ let end = length === void 0 ? reader.len : reader.pos + length;
35870
+ const message = createBaseVolumeRemoveFile2Request();
35871
+ while (reader.pos < end) {
35872
+ const tag = reader.uint32();
35873
+ switch (tag >>> 3) {
35874
+ case 1: {
35875
+ if (tag !== 10) {
35876
+ break;
35877
+ }
35878
+ message.volumeId = reader.string();
35879
+ continue;
35880
+ }
35881
+ case 2: {
35882
+ if (tag !== 18) {
35883
+ break;
35884
+ }
35885
+ message.path = reader.string();
35886
+ continue;
35887
+ }
35888
+ case 3: {
35889
+ if (tag !== 24) {
35890
+ break;
35891
+ }
35892
+ message.recursive = reader.bool();
35893
+ continue;
35894
+ }
35895
+ }
35896
+ if ((tag & 7) === 4 || tag === 0) {
35897
+ break;
35898
+ }
35899
+ reader.skip(tag & 7);
35900
+ }
35901
+ return message;
35902
+ },
35903
+ fromJSON(object) {
35904
+ return {
35905
+ volumeId: isSet3(object.volumeId) ? globalThis.String(object.volumeId) : "",
35906
+ path: isSet3(object.path) ? globalThis.String(object.path) : "",
35907
+ recursive: isSet3(object.recursive) ? globalThis.Boolean(object.recursive) : false
35908
+ };
35909
+ },
35910
+ toJSON(message) {
35911
+ const obj = {};
35912
+ if (message.volumeId !== "") {
35913
+ obj.volumeId = message.volumeId;
35914
+ }
35915
+ if (message.path !== "") {
35916
+ obj.path = message.path;
35917
+ }
35918
+ if (message.recursive !== false) {
35919
+ obj.recursive = message.recursive;
35920
+ }
35921
+ return obj;
35922
+ },
35923
+ create(base) {
35924
+ return VolumeRemoveFile2Request.fromPartial(base ?? {});
35925
+ },
35926
+ fromPartial(object) {
35927
+ const message = createBaseVolumeRemoveFile2Request();
35928
+ message.volumeId = object.volumeId ?? "";
35929
+ message.path = object.path ?? "";
35930
+ message.recursive = object.recursive ?? false;
35931
+ return message;
35932
+ }
35933
+ };
34797
35934
  function createBaseVolumeRemoveFileRequest() {
34798
35935
  return { volumeId: "", path: "", recursive: false };
34799
35936
  }
@@ -35493,6 +36630,14 @@ var ModalClientDefinition = {
35493
36630
  responseStream: false,
35494
36631
  options: {}
35495
36632
  },
36633
+ attemptRetry: {
36634
+ name: "AttemptRetry",
36635
+ requestType: AttemptRetryRequest,
36636
+ requestStream: false,
36637
+ responseType: AttemptRetryResponse,
36638
+ responseStream: false,
36639
+ options: {}
36640
+ },
35496
36641
  attemptStart: {
35497
36642
  name: "AttemptStart",
35498
36643
  requestType: AttemptStartRequest,
@@ -36470,6 +37615,14 @@ var ModalClientDefinition = {
36470
37615
  responseStream: false,
36471
37616
  options: {}
36472
37617
  },
37618
+ volumeCopyFiles2: {
37619
+ name: "VolumeCopyFiles2",
37620
+ requestType: VolumeCopyFiles2Request,
37621
+ requestStream: false,
37622
+ responseType: Empty,
37623
+ responseStream: false,
37624
+ options: {}
37625
+ },
36473
37626
  volumeDelete: {
36474
37627
  name: "VolumeDelete",
36475
37628
  requestType: VolumeDeleteRequest,
@@ -36486,6 +37639,14 @@ var ModalClientDefinition = {
36486
37639
  responseStream: false,
36487
37640
  options: {}
36488
37641
  },
37642
+ volumeGetFile2: {
37643
+ name: "VolumeGetFile2",
37644
+ requestType: VolumeGetFile2Request,
37645
+ requestStream: false,
37646
+ responseType: VolumeGetFile2Response,
37647
+ responseStream: false,
37648
+ options: {}
37649
+ },
36489
37650
  volumeGetOrCreate: {
36490
37651
  name: "VolumeGetOrCreate",
36491
37652
  requestType: VolumeGetOrCreateRequest,
@@ -36518,6 +37679,14 @@ var ModalClientDefinition = {
36518
37679
  responseStream: true,
36519
37680
  options: {}
36520
37681
  },
37682
+ volumeListFiles2: {
37683
+ name: "VolumeListFiles2",
37684
+ requestType: VolumeListFiles2Request,
37685
+ requestStream: false,
37686
+ responseType: VolumeListFiles2Response,
37687
+ responseStream: true,
37688
+ options: {}
37689
+ },
36521
37690
  volumePutFiles: {
36522
37691
  name: "VolumePutFiles",
36523
37692
  requestType: VolumePutFilesRequest,
@@ -36550,6 +37719,14 @@ var ModalClientDefinition = {
36550
37719
  responseStream: false,
36551
37720
  options: {}
36552
37721
  },
37722
+ volumeRemoveFile2: {
37723
+ name: "VolumeRemoveFile2",
37724
+ requestType: VolumeRemoveFile2Request,
37725
+ requestStream: false,
37726
+ responseType: Empty,
37727
+ responseStream: false,
37728
+ options: {}
37729
+ },
36553
37730
  volumeRename: {
36554
37731
  name: "VolumeRename",
36555
37732
  requestType: VolumeRenameRequest,
@@ -36630,11 +37807,11 @@ async function readConfigFile() {
36630
37807
  encoding: "utf-8"
36631
37808
  });
36632
37809
  return parseToml(configContent);
36633
- } catch (error) {
36634
- if (error.code === "ENOENT") {
37810
+ } catch (err) {
37811
+ if (err.code === "ENOENT") {
36635
37812
  return {};
36636
37813
  }
36637
- throw new Error(`Failed to read or parse .modal.toml: ${error.message}`);
37814
+ throw new Error(`Failed to read or parse .modal.toml: ${err.message}`);
36638
37815
  }
36639
37816
  }
36640
37817
  var config = await readConfigFile();
@@ -36680,7 +37857,7 @@ function authMiddleware(profile2) {
36680
37857
  "x-modal-client-type",
36681
37858
  String(7 /* CLIENT_TYPE_LIBMODAL */)
36682
37859
  );
36683
- options.metadata.set("x-modal-client-version", "0.74.25");
37860
+ options.metadata.set("x-modal-client-version", "1.0.0");
36684
37861
  options.metadata.set("x-modal-token-id", profile2.tokenId);
36685
37862
  options.metadata.set("x-modal-token-secret", profile2.tokenSecret);
36686
37863
  return yield* call.next(call.request, options);
@@ -36723,9 +37900,9 @@ var retryableGrpcStatusCodes = /* @__PURE__ */ new Set([
36723
37900
  Status.INTERNAL,
36724
37901
  Status.UNKNOWN
36725
37902
  ]);
36726
- function isRetryableGrpc(error) {
36727
- if (error instanceof ClientError) {
36728
- return retryableGrpcStatusCodes.has(error.code);
37903
+ function isRetryableGrpc(err) {
37904
+ if (err instanceof ClientError) {
37905
+ return retryableGrpcStatusCodes.has(err.code);
36729
37906
  }
36730
37907
  return false;
36731
37908
  }
@@ -37098,9 +38275,9 @@ async function* outputStreamSb(sandboxId, fileDescriptor) {
37098
38275
  break;
37099
38276
  }
37100
38277
  }
37101
- } catch (error) {
37102
- if (isRetryableGrpc(error) && retries > 0) retries--;
37103
- else throw error;
38278
+ } catch (err) {
38279
+ if (isRetryableGrpc(err) && retries > 0) retries--;
38280
+ else throw err;
37104
38281
  }
37105
38282
  }
37106
38283
  }
@@ -37125,9 +38302,9 @@ async function* outputStreamCp(execId, fileDescriptor) {
37125
38302
  break;
37126
38303
  }
37127
38304
  }
37128
- } catch (error) {
37129
- if (isRetryableGrpc(error) && retries > 0) retries--;
37130
- else throw error;
38305
+ } catch (err) {
38306
+ if (isRetryableGrpc(err) && retries > 0) retries--;
38307
+ else throw err;
37131
38308
  }
37132
38309
  }
37133
38310
  }
@@ -37179,6 +38356,32 @@ function encodeIfString(chunk) {
37179
38356
  return typeof chunk === "string" ? new TextEncoder().encode(chunk) : chunk;
37180
38357
  }
37181
38358
 
38359
+ // src/errors.ts
38360
+ var FunctionTimeoutError = class extends Error {
38361
+ constructor(message) {
38362
+ super(message);
38363
+ this.name = "FunctionTimeoutError";
38364
+ }
38365
+ };
38366
+ var RemoteError = class extends Error {
38367
+ constructor(message) {
38368
+ super(message);
38369
+ this.name = "RemoteError";
38370
+ }
38371
+ };
38372
+ var InternalFailure = class extends Error {
38373
+ constructor(message) {
38374
+ super(message);
38375
+ this.name = "InternalFailure";
38376
+ }
38377
+ };
38378
+ var NotFoundError = class extends Error {
38379
+ constructor(message) {
38380
+ super(message);
38381
+ this.name = "NotFoundError";
38382
+ }
38383
+ };
38384
+
37182
38385
  // src/app.ts
37183
38386
  var App = class _App {
37184
38387
  appId;
@@ -37187,21 +38390,32 @@ var App = class _App {
37187
38390
  }
37188
38391
  /** Lookup a deployed app by name, or create if it does not exist. */
37189
38392
  static async lookup(name, options = {}) {
37190
- const resp = await client.appGetOrCreate({
37191
- appName: name,
37192
- environmentName: environmentName(options.environment),
37193
- objectCreationType: options.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
37194
- });
37195
- return new _App(resp.appId);
38393
+ try {
38394
+ const resp = await client.appGetOrCreate({
38395
+ appName: name,
38396
+ environmentName: environmentName(options.environment),
38397
+ objectCreationType: options.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
38398
+ });
38399
+ return new _App(resp.appId);
38400
+ } catch (err) {
38401
+ if (err instanceof ClientError2 && err.code === Status2.NOT_FOUND)
38402
+ throw new NotFoundError(`App '${name}' not found`);
38403
+ throw err;
38404
+ }
37196
38405
  }
37197
38406
  async createSandbox(image, options = {}) {
38407
+ if (options.timeout && options.timeout % 1e3 !== 0) {
38408
+ throw new Error(
38409
+ `Timeout must be a multiple of 1000ms, got ${options.timeout}`
38410
+ );
38411
+ }
37198
38412
  const createResp = await client.sandboxCreate({
37199
38413
  appId: this.appId,
37200
38414
  definition: {
37201
38415
  // Sleep default is implicit in image builder version <=2024.10
37202
38416
  entrypointArgs: options.command ?? ["sleep", "48h"],
37203
38417
  imageId: image.imageId,
37204
- timeoutSecs: options.timeout ?? 600,
38418
+ timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
37205
38419
  networkAccess: {
37206
38420
  networkAccessType: 1 /* OPEN */
37207
38421
  },
@@ -37219,29 +38433,36 @@ var App = class _App {
37219
38433
  }
37220
38434
  };
37221
38435
 
37222
- // src/errors.ts
37223
- var TimeoutError = class extends Error {
37224
- constructor(message) {
37225
- super(message);
37226
- this.name = "TimeoutError";
37227
- }
37228
- };
37229
- var RemoteError = class extends Error {
37230
- constructor(message) {
37231
- super(message);
37232
- this.name = "RemoteError";
37233
- }
37234
- };
37235
- var InternalFailure = class extends Error {
37236
- constructor(message) {
37237
- super(message);
37238
- this.name = "InternalFailure";
37239
- }
37240
- };
38436
+ // src/cls.ts
38437
+ import { ClientError as ClientError4, Status as Status4 } from "nice-grpc";
37241
38438
 
37242
38439
  // src/function.ts
37243
38440
  import { createHash } from "node:crypto";
37244
38441
 
38442
+ // src/function_call.ts
38443
+ var FunctionCall = class _FunctionCall {
38444
+ functionCallId;
38445
+ constructor(functionCallId) {
38446
+ this.functionCallId = functionCallId;
38447
+ }
38448
+ /** Create a new function call from ID. */
38449
+ fromId(functionCallId) {
38450
+ return new _FunctionCall(functionCallId);
38451
+ }
38452
+ /** Get the result of a function call, optionally waiting with a timeout. */
38453
+ async get(options = {}) {
38454
+ const timeout = options.timeout;
38455
+ return await pollFunctionOutput(this.functionCallId, timeout);
38456
+ }
38457
+ /** Cancel a running function call. */
38458
+ async cancel(options = {}) {
38459
+ await client.functionCallCancel({
38460
+ functionCallId: this.functionCallId,
38461
+ terminateContainers: options.terminateContainers
38462
+ });
38463
+ }
38464
+ };
38465
+
37245
38466
  // src/pickle.ts
37246
38467
  var PickleError = class extends Error {
37247
38468
  constructor(message) {
@@ -37544,26 +38765,53 @@ function loads(buf) {
37544
38765
  }
37545
38766
 
37546
38767
  // src/function.ts
38768
+ import { ClientError as ClientError3, Status as Status3 } from "nice-grpc";
37547
38769
  var maxObjectSizeBytes = 2 * 1024 * 1024;
37548
- function timeNow() {
38770
+ var outputsTimeout = 55 * 1e3;
38771
+ function timeNowSeconds() {
37549
38772
  return Date.now() / 1e3;
37550
38773
  }
37551
38774
  var Function_ = class _Function_ {
37552
38775
  functionId;
37553
- constructor(functionId) {
38776
+ methodName;
38777
+ constructor(functionId, methodName) {
37554
38778
  this.functionId = functionId;
38779
+ this.methodName = methodName;
37555
38780
  }
37556
38781
  static async lookup(appName, name, options = {}) {
37557
- const resp = await client.functionGet({
37558
- appName,
37559
- objectTag: name,
37560
- namespace: 1 /* DEPLOYMENT_NAMESPACE_WORKSPACE */,
37561
- environmentName: environmentName(options.environment)
37562
- });
37563
- return new _Function_(resp.functionId);
38782
+ try {
38783
+ const resp = await client.functionGet({
38784
+ appName,
38785
+ objectTag: name,
38786
+ namespace: 1 /* DEPLOYMENT_NAMESPACE_WORKSPACE */,
38787
+ environmentName: environmentName(options.environment)
38788
+ });
38789
+ return new _Function_(resp.functionId);
38790
+ } catch (err) {
38791
+ if (err instanceof ClientError3 && err.code === Status3.NOT_FOUND)
38792
+ throw new NotFoundError(`Function '${appName}/${name}' not found`);
38793
+ throw err;
38794
+ }
37564
38795
  }
37565
38796
  // Execute a single input into a remote Function.
37566
38797
  async remote(args = [], kwargs = {}) {
38798
+ const functionCallId = await this.execFunctionCall(
38799
+ args,
38800
+ kwargs,
38801
+ 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */
38802
+ );
38803
+ return await pollFunctionOutput(functionCallId);
38804
+ }
38805
+ // Spawn a single input into a remote function.
38806
+ async spawn(args = [], kwargs = {}) {
38807
+ const functionCallId = await this.execFunctionCall(
38808
+ args,
38809
+ kwargs,
38810
+ 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */
38811
+ );
38812
+ return new FunctionCall(functionCallId);
38813
+ }
38814
+ async execFunctionCall(args = [], kwargs = {}, invocationType = 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */) {
37567
38815
  const payload = dumps([args, kwargs]);
37568
38816
  let argsBlobId = void 0;
37569
38817
  if (payload.length > maxObjectSizeBytes) {
@@ -37572,34 +38820,57 @@ var Function_ = class _Function_ {
37572
38820
  const functionMapResponse = await client.functionMap({
37573
38821
  functionId: this.functionId,
37574
38822
  functionCallType: 1 /* FUNCTION_CALL_TYPE_UNARY */,
37575
- functionCallInvocationType: 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */,
38823
+ functionCallInvocationType: invocationType,
37576
38824
  pipelinedInputs: [
37577
38825
  {
37578
38826
  idx: 0,
37579
38827
  input: {
37580
38828
  args: argsBlobId ? void 0 : payload,
37581
38829
  argsBlobId,
37582
- dataFormat: 1 /* DATA_FORMAT_PICKLE */
38830
+ dataFormat: 1 /* DATA_FORMAT_PICKLE */,
38831
+ methodName: this.methodName
37583
38832
  }
37584
38833
  }
37585
38834
  ]
37586
38835
  });
37587
- while (true) {
37588
- const response = await client.functionGetOutputs({
37589
- functionCallId: functionMapResponse.functionCallId,
38836
+ return functionMapResponse.functionCallId;
38837
+ }
38838
+ };
38839
+ async function pollFunctionOutput(functionCallId, timeout) {
38840
+ const startTime = Date.now();
38841
+ let pollTimeout = outputsTimeout;
38842
+ if (timeout !== void 0) {
38843
+ pollTimeout = Math.min(timeout, outputsTimeout);
38844
+ }
38845
+ while (true) {
38846
+ let response;
38847
+ try {
38848
+ response = await client.functionGetOutputs({
38849
+ functionCallId,
37590
38850
  maxValues: 1,
37591
- timeout: 55,
38851
+ timeout: pollTimeout / 1e3,
38852
+ // Backend needs seconds
37592
38853
  lastEntryId: "0-0",
37593
38854
  clearOnSuccess: true,
37594
- requestedAt: timeNow()
38855
+ requestedAt: timeNowSeconds()
37595
38856
  });
37596
- const outputs = response.outputs;
37597
- if (outputs.length > 0) {
37598
- return await processResult(outputs[0].result, outputs[0].dataFormat);
38857
+ } catch (err) {
38858
+ throw new Error(`FunctionGetOutputs failed: ${err}`);
38859
+ }
38860
+ const outputs = response.outputs;
38861
+ if (outputs.length > 0) {
38862
+ return await processResult(outputs[0].result, outputs[0].dataFormat);
38863
+ }
38864
+ if (timeout !== void 0) {
38865
+ const remainingTime = timeout - (Date.now() - startTime);
38866
+ if (remainingTime <= 0) {
38867
+ const message = `Timeout exceeded: ${(timeout / 1e3).toFixed(1)}s`;
38868
+ throw new FunctionTimeoutError(message);
37599
38869
  }
38870
+ pollTimeout = Math.min(outputsTimeout, remainingTime);
37600
38871
  }
37601
38872
  }
37602
- };
38873
+ }
37603
38874
  async function processResult(result, dataFormat) {
37604
38875
  if (!result) {
37605
38876
  throw new Error("Received null result from invocation");
@@ -37612,7 +38883,7 @@ async function processResult(result, dataFormat) {
37612
38883
  }
37613
38884
  switch (result.status) {
37614
38885
  case 4 /* GENERIC_STATUS_TIMEOUT */:
37615
- throw new TimeoutError(`Timeout: ${result.exception}`);
38886
+ throw new FunctionTimeoutError(`Timeout: ${result.exception}`);
37616
38887
  case 6 /* GENERIC_STATUS_INTERNAL_FAILURE */:
37617
38888
  throw new InternalFailure(`Internal failure: ${result.exception}`);
37618
38889
  case 1 /* GENERIC_STATUS_SUCCESS */:
@@ -37675,12 +38946,152 @@ function deserializeDataFormat(data, dataFormat) {
37675
38946
  throw new Error(`Unsupported data format: ${dataFormat}`);
37676
38947
  }
37677
38948
  }
38949
+
38950
+ // src/cls.ts
38951
+ var Cls = class _Cls {
38952
+ #serviceFunctionId;
38953
+ #schema;
38954
+ #methodNames;
38955
+ constructor(serviceFunctionId, schema, methodNames) {
38956
+ this.#serviceFunctionId = serviceFunctionId;
38957
+ this.#schema = schema;
38958
+ this.#methodNames = methodNames;
38959
+ }
38960
+ static async lookup(appName, name, options = {}) {
38961
+ try {
38962
+ const serviceFunctionName = `${name}.*`;
38963
+ const serviceFunction = await client.functionGet({
38964
+ appName,
38965
+ objectTag: serviceFunctionName,
38966
+ namespace: 1 /* DEPLOYMENT_NAMESPACE_WORKSPACE */,
38967
+ environmentName: environmentName(options.environment)
38968
+ });
38969
+ const parameterInfo = serviceFunction.handleMetadata?.classParameterInfo;
38970
+ const schema = parameterInfo?.schema ?? [];
38971
+ if (schema.length > 0 && parameterInfo?.format !== 2 /* PARAM_SERIALIZATION_FORMAT_PROTO */) {
38972
+ throw new Error(
38973
+ `Unsupported parameter format: ${parameterInfo?.format}`
38974
+ );
38975
+ }
38976
+ let methodNames;
38977
+ if (serviceFunction.handleMetadata?.methodHandleMetadata) {
38978
+ methodNames = Object.keys(
38979
+ serviceFunction.handleMetadata.methodHandleMetadata
38980
+ );
38981
+ } else {
38982
+ throw new Error(
38983
+ "Cls requires Modal deployments using client v0.67 or later."
38984
+ );
38985
+ }
38986
+ return new _Cls(serviceFunction.functionId, schema, methodNames);
38987
+ } catch (err) {
38988
+ if (err instanceof ClientError4 && err.code === Status4.NOT_FOUND)
38989
+ throw new NotFoundError(`Class '${appName}/${name}' not found`);
38990
+ throw err;
38991
+ }
38992
+ }
38993
+ /** Create a new instance of the Cls with parameters. */
38994
+ async instance(params = {}) {
38995
+ let functionId;
38996
+ if (this.#schema.length === 0) {
38997
+ functionId = this.#serviceFunctionId;
38998
+ } else {
38999
+ functionId = await this.#bindParameters(params);
39000
+ }
39001
+ const methods = /* @__PURE__ */ new Map();
39002
+ for (const name of this.#methodNames) {
39003
+ methods.set(name, new Function_(functionId, name));
39004
+ }
39005
+ return new ClsInstance(methods);
39006
+ }
39007
+ /** Bind parameters to the Cls function. */
39008
+ async #bindParameters(params) {
39009
+ const serializedParams = encodeParameterSet(this.#schema, params);
39010
+ const bindResp = await client.functionBindParams({
39011
+ functionId: this.#serviceFunctionId,
39012
+ serializedParams
39013
+ });
39014
+ return bindResp.boundFunctionId;
39015
+ }
39016
+ };
39017
+ function encodeParameterSet(schema, params) {
39018
+ const encoded = [];
39019
+ for (const paramSpec of schema) {
39020
+ const paramValue = encodeParameter(paramSpec, params[paramSpec.name]);
39021
+ encoded.push(paramValue);
39022
+ }
39023
+ encoded.sort((a, b) => a.name.localeCompare(b.name));
39024
+ return ClassParameterSet.encode({ parameters: encoded }).finish();
39025
+ }
39026
+ function encodeParameter(paramSpec, value) {
39027
+ const name = paramSpec.name;
39028
+ const paramType = paramSpec.type;
39029
+ const paramValue = { name, type: paramType };
39030
+ switch (paramType) {
39031
+ case 1 /* PARAM_TYPE_STRING */:
39032
+ if (value == null && paramSpec.hasDefault) {
39033
+ value = paramSpec.stringDefault ?? "";
39034
+ }
39035
+ if (typeof value !== "string") {
39036
+ throw new Error(`Parameter '${name}' must be a string`);
39037
+ }
39038
+ paramValue.stringValue = value;
39039
+ break;
39040
+ case 2 /* PARAM_TYPE_INT */:
39041
+ if (value == null && paramSpec.hasDefault) {
39042
+ value = paramSpec.intDefault ?? 0;
39043
+ }
39044
+ if (typeof value !== "number") {
39045
+ throw new Error(`Parameter '${name}' must be an integer`);
39046
+ }
39047
+ paramValue.intValue = value;
39048
+ break;
39049
+ case 9 /* PARAM_TYPE_BOOL */:
39050
+ if (value == null && paramSpec.hasDefault) {
39051
+ value = paramSpec.boolDefault ?? false;
39052
+ }
39053
+ if (typeof value !== "boolean") {
39054
+ throw new Error(`Parameter '${name}' must be a boolean`);
39055
+ }
39056
+ paramValue.boolValue = value;
39057
+ break;
39058
+ case 4 /* PARAM_TYPE_BYTES */:
39059
+ if (value == null && paramSpec.hasDefault) {
39060
+ value = paramSpec.bytesDefault ?? new Uint8Array();
39061
+ }
39062
+ if (!(value instanceof Uint8Array)) {
39063
+ throw new Error(`Parameter '${name}' must be a byte array`);
39064
+ }
39065
+ paramValue.bytesValue = value;
39066
+ break;
39067
+ default:
39068
+ throw new Error(`Unsupported parameter type: ${paramType}`);
39069
+ }
39070
+ return paramValue;
39071
+ }
39072
+ var ClsInstance = class {
39073
+ #methods;
39074
+ constructor(methods) {
39075
+ this.#methods = methods;
39076
+ }
39077
+ method(name) {
39078
+ const method = this.#methods.get(name);
39079
+ if (!method) {
39080
+ throw new NotFoundError(`Method '${name}' not found on class`);
39081
+ }
39082
+ return method;
39083
+ }
39084
+ };
37678
39085
  export {
37679
39086
  App,
39087
+ Cls,
39088
+ ClsInstance,
39089
+ FunctionCall,
39090
+ FunctionTimeoutError,
37680
39091
  Function_,
37681
39092
  Image2 as Image,
37682
39093
  InternalFailure,
39094
+ NotFoundError,
37683
39095
  RemoteError,
37684
- Sandbox2 as Sandbox,
37685
- TimeoutError
39096
+ Sandbox2 as Sandbox
37686
39097
  };