modal 0.3.4 → 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.
package/dist/index.js CHANGED
@@ -2263,6 +2263,31 @@ function taskStateToJSON(object) {
2263
2263
  return "UNRECOGNIZED";
2264
2264
  }
2265
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
+ }
2266
2291
  function volumeFsVersionFromJSON(object) {
2267
2292
  switch (object) {
2268
2293
  case 0:
@@ -2447,6 +2472,12 @@ function fileEntry_FileTypeFromJSON(object) {
2447
2472
  case 3:
2448
2473
  case "SYMLINK":
2449
2474
  return 3 /* SYMLINK */;
2475
+ case 4:
2476
+ case "FIFO":
2477
+ return 4 /* FIFO */;
2478
+ case 5:
2479
+ case "SOCKET":
2480
+ return 5 /* SOCKET */;
2450
2481
  case -1:
2451
2482
  case "UNRECOGNIZED":
2452
2483
  default:
@@ -2463,6 +2494,10 @@ function fileEntry_FileTypeToJSON(object) {
2463
2494
  return "DIRECTORY";
2464
2495
  case 3 /* SYMLINK */:
2465
2496
  return "SYMLINK";
2497
+ case 4 /* FIFO */:
2498
+ return "FIFO";
2499
+ case 5 /* SOCKET */:
2500
+ return "SOCKET";
2466
2501
  case -1 /* UNRECOGNIZED */:
2467
2502
  default:
2468
2503
  return "UNRECOGNIZED";
@@ -5862,6 +5897,155 @@ var AttemptAwaitResponse = {
5862
5897
  return message;
5863
5898
  }
5864
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
+ };
5865
6049
  function createBaseAttemptStartRequest() {
5866
6050
  return { functionId: "", parentInputId: "", input: void 0 };
5867
6051
  }
@@ -6953,14 +7137,7 @@ var ClassCreateResponse = {
6953
7137
  }
6954
7138
  };
6955
7139
  function createBaseClassGetRequest() {
6956
- return {
6957
- appName: "",
6958
- objectTag: "",
6959
- namespace: 0,
6960
- environmentName: "",
6961
- lookupPublished: false,
6962
- onlyClassFunction: false
6963
- };
7140
+ return { appName: "", objectTag: "", namespace: 0, environmentName: "", onlyClassFunction: false };
6964
7141
  }
6965
7142
  var ClassGetRequest = {
6966
7143
  encode(message, writer = new BinaryWriter()) {
@@ -6976,9 +7153,6 @@ var ClassGetRequest = {
6976
7153
  if (message.environmentName !== "") {
6977
7154
  writer.uint32(34).string(message.environmentName);
6978
7155
  }
6979
- if (message.lookupPublished !== false) {
6980
- writer.uint32(64).bool(message.lookupPublished);
6981
- }
6982
7156
  if (message.onlyClassFunction !== false) {
6983
7157
  writer.uint32(80).bool(message.onlyClassFunction);
6984
7158
  }
@@ -7019,13 +7193,6 @@ var ClassGetRequest = {
7019
7193
  message.environmentName = reader.string();
7020
7194
  continue;
7021
7195
  }
7022
- case 8: {
7023
- if (tag !== 64) {
7024
- break;
7025
- }
7026
- message.lookupPublished = reader.bool();
7027
- continue;
7028
- }
7029
7196
  case 10: {
7030
7197
  if (tag !== 80) {
7031
7198
  break;
@@ -7047,7 +7214,6 @@ var ClassGetRequest = {
7047
7214
  objectTag: isSet3(object.objectTag) ? globalThis.String(object.objectTag) : "",
7048
7215
  namespace: isSet3(object.namespace) ? deploymentNamespaceFromJSON(object.namespace) : 0,
7049
7216
  environmentName: isSet3(object.environmentName) ? globalThis.String(object.environmentName) : "",
7050
- lookupPublished: isSet3(object.lookupPublished) ? globalThis.Boolean(object.lookupPublished) : false,
7051
7217
  onlyClassFunction: isSet3(object.onlyClassFunction) ? globalThis.Boolean(object.onlyClassFunction) : false
7052
7218
  };
7053
7219
  },
@@ -7065,9 +7231,6 @@ var ClassGetRequest = {
7065
7231
  if (message.environmentName !== "") {
7066
7232
  obj.environmentName = message.environmentName;
7067
7233
  }
7068
- if (message.lookupPublished !== false) {
7069
- obj.lookupPublished = message.lookupPublished;
7070
- }
7071
7234
  if (message.onlyClassFunction !== false) {
7072
7235
  obj.onlyClassFunction = message.onlyClassFunction;
7073
7236
  }
@@ -7082,7 +7245,6 @@ var ClassGetRequest = {
7082
7245
  message.objectTag = object.objectTag ?? "";
7083
7246
  message.namespace = object.namespace ?? 0;
7084
7247
  message.environmentName = object.environmentName ?? "";
7085
- message.lookupPublished = object.lookupPublished ?? false;
7086
7248
  message.onlyClassFunction = object.onlyClassFunction ?? false;
7087
7249
  return message;
7088
7250
  }
@@ -12130,7 +12292,7 @@ var DictPopResponse = {
12130
12292
  }
12131
12293
  };
12132
12294
  function createBaseDictUpdateRequest() {
12133
- return { dictId: "", updates: [] };
12295
+ return { dictId: "", updates: [], ifNotExists: false };
12134
12296
  }
12135
12297
  var DictUpdateRequest = {
12136
12298
  encode(message, writer = new BinaryWriter()) {
@@ -12140,6 +12302,9 @@ var DictUpdateRequest = {
12140
12302
  for (const v of message.updates) {
12141
12303
  DictEntry.encode(v, writer.uint32(18).fork()).join();
12142
12304
  }
12305
+ if (message.ifNotExists !== false) {
12306
+ writer.uint32(24).bool(message.ifNotExists);
12307
+ }
12143
12308
  return writer;
12144
12309
  },
12145
12310
  decode(input, length) {
@@ -12163,6 +12328,13 @@ var DictUpdateRequest = {
12163
12328
  message.updates.push(DictEntry.decode(reader, reader.uint32()));
12164
12329
  continue;
12165
12330
  }
12331
+ case 3: {
12332
+ if (tag !== 24) {
12333
+ break;
12334
+ }
12335
+ message.ifNotExists = reader.bool();
12336
+ continue;
12337
+ }
12166
12338
  }
12167
12339
  if ((tag & 7) === 4 || tag === 0) {
12168
12340
  break;
@@ -12174,7 +12346,8 @@ var DictUpdateRequest = {
12174
12346
  fromJSON(object) {
12175
12347
  return {
12176
12348
  dictId: isSet3(object.dictId) ? globalThis.String(object.dictId) : "",
12177
- 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
12178
12351
  };
12179
12352
  },
12180
12353
  toJSON(message) {
@@ -12185,6 +12358,9 @@ var DictUpdateRequest = {
12185
12358
  if (message.updates?.length) {
12186
12359
  obj.updates = message.updates.map((e) => DictEntry.toJSON(e));
12187
12360
  }
12361
+ if (message.ifNotExists !== false) {
12362
+ obj.ifNotExists = message.ifNotExists;
12363
+ }
12188
12364
  return obj;
12189
12365
  },
12190
12366
  create(base) {
@@ -12194,14 +12370,18 @@ var DictUpdateRequest = {
12194
12370
  const message = createBaseDictUpdateRequest();
12195
12371
  message.dictId = object.dictId ?? "";
12196
12372
  message.updates = object.updates?.map((e) => DictEntry.fromPartial(e)) || [];
12373
+ message.ifNotExists = object.ifNotExists ?? false;
12197
12374
  return message;
12198
12375
  }
12199
12376
  };
12200
12377
  function createBaseDictUpdateResponse() {
12201
- return {};
12378
+ return { created: false };
12202
12379
  }
12203
12380
  var DictUpdateResponse = {
12204
- encode(_, writer = new BinaryWriter()) {
12381
+ encode(message, writer = new BinaryWriter()) {
12382
+ if (message.created !== false) {
12383
+ writer.uint32(8).bool(message.created);
12384
+ }
12205
12385
  return writer;
12206
12386
  },
12207
12387
  decode(input, length) {
@@ -12211,6 +12391,13 @@ var DictUpdateResponse = {
12211
12391
  while (reader.pos < end) {
12212
12392
  const tag = reader.uint32();
12213
12393
  switch (tag >>> 3) {
12394
+ case 1: {
12395
+ if (tag !== 8) {
12396
+ break;
12397
+ }
12398
+ message.created = reader.bool();
12399
+ continue;
12400
+ }
12214
12401
  }
12215
12402
  if ((tag & 7) === 4 || tag === 0) {
12216
12403
  break;
@@ -12219,18 +12406,22 @@ var DictUpdateResponse = {
12219
12406
  }
12220
12407
  return message;
12221
12408
  },
12222
- fromJSON(_) {
12223
- return {};
12409
+ fromJSON(object) {
12410
+ return { created: isSet3(object.created) ? globalThis.Boolean(object.created) : false };
12224
12411
  },
12225
- toJSON(_) {
12412
+ toJSON(message) {
12226
12413
  const obj = {};
12414
+ if (message.created !== false) {
12415
+ obj.created = message.created;
12416
+ }
12227
12417
  return obj;
12228
12418
  },
12229
12419
  create(base) {
12230
12420
  return DictUpdateResponse.fromPartial(base ?? {});
12231
12421
  },
12232
- fromPartial(_) {
12422
+ fromPartial(object) {
12233
12423
  const message = createBaseDictUpdateResponse();
12424
+ message.created = object.created ?? false;
12234
12425
  return message;
12235
12426
  }
12236
12427
  };
@@ -13531,7 +13722,8 @@ function createBaseFunctionMessage() {
13531
13722
  ExperimentalEnableGpuSnapshot: false,
13532
13723
  autoscalerSettings: void 0,
13533
13724
  functionSchema: void 0,
13534
- experimentalOptions: {}
13725
+ experimentalOptions: {},
13726
+ mountClientDependencies: false
13535
13727
  };
13536
13728
  }
13537
13729
  var FunctionMessage = {
@@ -13740,6 +13932,9 @@ var FunctionMessage = {
13740
13932
  Object.entries(message.experimentalOptions).forEach(([key, value]) => {
13741
13933
  Function_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(650).fork()).join();
13742
13934
  });
13935
+ if (message.mountClientDependencies !== false) {
13936
+ writer.uint32(656).bool(message.mountClientDependencies);
13937
+ }
13743
13938
  return writer;
13744
13939
  },
13745
13940
  decode(input, length) {
@@ -14231,6 +14426,13 @@ var FunctionMessage = {
14231
14426
  }
14232
14427
  continue;
14233
14428
  }
14429
+ case 82: {
14430
+ if (tag !== 656) {
14431
+ break;
14432
+ }
14433
+ message.mountClientDependencies = reader.bool();
14434
+ continue;
14435
+ }
14234
14436
  }
14235
14437
  if ((tag & 7) === 4 || tag === 0) {
14236
14438
  break;
@@ -14314,7 +14516,8 @@ var FunctionMessage = {
14314
14516
  experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
14315
14517
  acc[key] = String(value);
14316
14518
  return acc;
14317
- }, {}) : {}
14519
+ }, {}) : {},
14520
+ mountClientDependencies: isSet3(object.mountClientDependencies) ? globalThis.Boolean(object.mountClientDependencies) : false
14318
14521
  };
14319
14522
  },
14320
14523
  toJSON(message) {
@@ -14535,6 +14738,9 @@ var FunctionMessage = {
14535
14738
  });
14536
14739
  }
14537
14740
  }
14741
+ if (message.mountClientDependencies !== false) {
14742
+ obj.mountClientDependencies = message.mountClientDependencies;
14743
+ }
14538
14744
  return obj;
14539
14745
  },
14540
14746
  create(base) {
@@ -14623,6 +14829,7 @@ var FunctionMessage = {
14623
14829
  },
14624
14830
  {}
14625
14831
  );
14832
+ message.mountClientDependencies = object.mountClientDependencies ?? false;
14626
14833
  return message;
14627
14834
  }
14628
14835
  };
@@ -18089,7 +18296,8 @@ function createBaseFunctionHandleMetadata() {
18089
18296
  definitionId: "",
18090
18297
  classParameterInfo: void 0,
18091
18298
  methodHandleMetadata: {},
18092
- functionSchema: void 0
18299
+ functionSchema: void 0,
18300
+ inputPlaneUrl: void 0
18093
18301
  };
18094
18302
  }
18095
18303
  var FunctionHandleMetadata = {
@@ -18124,6 +18332,9 @@ var FunctionHandleMetadata = {
18124
18332
  if (message.functionSchema !== void 0) {
18125
18333
  FunctionSchema.encode(message.functionSchema, writer.uint32(362).fork()).join();
18126
18334
  }
18335
+ if (message.inputPlaneUrl !== void 0) {
18336
+ writer.uint32(370).string(message.inputPlaneUrl);
18337
+ }
18127
18338
  return writer;
18128
18339
  },
18129
18340
  decode(input, length) {
@@ -18206,6 +18417,13 @@ var FunctionHandleMetadata = {
18206
18417
  message.functionSchema = FunctionSchema.decode(reader, reader.uint32());
18207
18418
  continue;
18208
18419
  }
18420
+ case 46: {
18421
+ if (tag !== 370) {
18422
+ break;
18423
+ }
18424
+ message.inputPlaneUrl = reader.string();
18425
+ continue;
18426
+ }
18209
18427
  }
18210
18428
  if ((tag & 7) === 4 || tag === 0) {
18211
18429
  break;
@@ -18231,7 +18449,8 @@ var FunctionHandleMetadata = {
18231
18449
  },
18232
18450
  {}
18233
18451
  ) : {},
18234
- 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
18235
18454
  };
18236
18455
  },
18237
18456
  toJSON(message) {
@@ -18272,6 +18491,9 @@ var FunctionHandleMetadata = {
18272
18491
  if (message.functionSchema !== void 0) {
18273
18492
  obj.functionSchema = FunctionSchema.toJSON(message.functionSchema);
18274
18493
  }
18494
+ if (message.inputPlaneUrl !== void 0) {
18495
+ obj.inputPlaneUrl = message.inputPlaneUrl;
18496
+ }
18275
18497
  return obj;
18276
18498
  },
18277
18499
  create(base) {
@@ -18294,6 +18516,7 @@ var FunctionHandleMetadata = {
18294
18516
  return acc;
18295
18517
  }, {});
18296
18518
  message.functionSchema = object.functionSchema !== void 0 && object.functionSchema !== null ? FunctionSchema.fromPartial(object.functionSchema) : void 0;
18519
+ message.inputPlaneUrl = object.inputPlaneUrl ?? void 0;
18297
18520
  return message;
18298
18521
  }
18299
18522
  };
@@ -18485,7 +18708,8 @@ function createBaseFunctionMapRequest() {
18485
18708
  returnExceptions: false,
18486
18709
  functionCallType: 0,
18487
18710
  pipelinedInputs: [],
18488
- functionCallInvocationType: 0
18711
+ functionCallInvocationType: 0,
18712
+ fromSpawnMap: false
18489
18713
  };
18490
18714
  }
18491
18715
  var FunctionMapRequest = {
@@ -18508,6 +18732,9 @@ var FunctionMapRequest = {
18508
18732
  if (message.functionCallInvocationType !== 0) {
18509
18733
  writer.uint32(48).int32(message.functionCallInvocationType);
18510
18734
  }
18735
+ if (message.fromSpawnMap !== false) {
18736
+ writer.uint32(56).bool(message.fromSpawnMap);
18737
+ }
18511
18738
  return writer;
18512
18739
  },
18513
18740
  decode(input, length) {
@@ -18559,6 +18786,13 @@ var FunctionMapRequest = {
18559
18786
  message.functionCallInvocationType = reader.int32();
18560
18787
  continue;
18561
18788
  }
18789
+ case 7: {
18790
+ if (tag !== 56) {
18791
+ break;
18792
+ }
18793
+ message.fromSpawnMap = reader.bool();
18794
+ continue;
18795
+ }
18562
18796
  }
18563
18797
  if ((tag & 7) === 4 || tag === 0) {
18564
18798
  break;
@@ -18574,7 +18808,8 @@ var FunctionMapRequest = {
18574
18808
  returnExceptions: isSet3(object.returnExceptions) ? globalThis.Boolean(object.returnExceptions) : false,
18575
18809
  functionCallType: isSet3(object.functionCallType) ? functionCallTypeFromJSON(object.functionCallType) : 0,
18576
18810
  pipelinedInputs: globalThis.Array.isArray(object?.pipelinedInputs) ? object.pipelinedInputs.map((e) => FunctionPutInputsItem.fromJSON(e)) : [],
18577
- 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
18578
18813
  };
18579
18814
  },
18580
18815
  toJSON(message) {
@@ -18597,6 +18832,9 @@ var FunctionMapRequest = {
18597
18832
  if (message.functionCallInvocationType !== 0) {
18598
18833
  obj.functionCallInvocationType = functionCallInvocationTypeToJSON(message.functionCallInvocationType);
18599
18834
  }
18835
+ if (message.fromSpawnMap !== false) {
18836
+ obj.fromSpawnMap = message.fromSpawnMap;
18837
+ }
18600
18838
  return obj;
18601
18839
  },
18602
18840
  create(base) {
@@ -18610,6 +18848,7 @@ var FunctionMapRequest = {
18610
18848
  message.functionCallType = object.functionCallType ?? 0;
18611
18849
  message.pipelinedInputs = object.pipelinedInputs?.map((e) => FunctionPutInputsItem.fromPartial(e)) || [];
18612
18850
  message.functionCallInvocationType = object.functionCallInvocationType ?? 0;
18851
+ message.fromSpawnMap = object.fromSpawnMap ?? false;
18613
18852
  return message;
18614
18853
  }
18615
18854
  };
@@ -18761,7 +19000,11 @@ function createBaseFunctionOptions() {
18761
19000
  volumeMounts: [],
18762
19001
  targetConcurrentInputs: void 0,
18763
19002
  replaceVolumeMounts: false,
18764
- replaceSecretIds: false
19003
+ replaceSecretIds: false,
19004
+ bufferContainers: void 0,
19005
+ maxConcurrentInputs: void 0,
19006
+ batchMaxSize: void 0,
19007
+ batchLingerMs: void 0
18765
19008
  };
18766
19009
  }
18767
19010
  var FunctionOptions = {
@@ -18802,6 +19045,18 @@ var FunctionOptions = {
18802
19045
  if (message.replaceSecretIds !== false) {
18803
19046
  writer.uint32(96).bool(message.replaceSecretIds);
18804
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
+ }
18805
19060
  return writer;
18806
19061
  },
18807
19062
  decode(input, length) {
@@ -18895,6 +19150,34 @@ var FunctionOptions = {
18895
19150
  message.replaceSecretIds = reader.bool();
18896
19151
  continue;
18897
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
+ }
18898
19181
  }
18899
19182
  if ((tag & 7) === 4 || tag === 0) {
18900
19183
  break;
@@ -18916,7 +19199,11 @@ var FunctionOptions = {
18916
19199
  volumeMounts: globalThis.Array.isArray(object?.volumeMounts) ? object.volumeMounts.map((e) => VolumeMount.fromJSON(e)) : [],
18917
19200
  targetConcurrentInputs: isSet3(object.targetConcurrentInputs) ? globalThis.Number(object.targetConcurrentInputs) : void 0,
18918
19201
  replaceVolumeMounts: isSet3(object.replaceVolumeMounts) ? globalThis.Boolean(object.replaceVolumeMounts) : false,
18919
- 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
18920
19207
  };
18921
19208
  },
18922
19209
  toJSON(message) {
@@ -18957,6 +19244,18 @@ var FunctionOptions = {
18957
19244
  if (message.replaceSecretIds !== false) {
18958
19245
  obj.replaceSecretIds = message.replaceSecretIds;
18959
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
+ }
18960
19259
  return obj;
18961
19260
  },
18962
19261
  create(base) {
@@ -18976,6 +19275,10 @@ var FunctionOptions = {
18976
19275
  message.targetConcurrentInputs = object.targetConcurrentInputs ?? void 0;
18977
19276
  message.replaceVolumeMounts = object.replaceVolumeMounts ?? false;
18978
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;
18979
19282
  return message;
18980
19283
  }
18981
19284
  };
@@ -21668,7 +21971,13 @@ var ImageJoinStreamingResponse = {
21668
21971
  }
21669
21972
  };
21670
21973
  function createBaseImageMetadata() {
21671
- 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
+ };
21672
21981
  }
21673
21982
  var ImageMetadata = {
21674
21983
  encode(message, writer = new BinaryWriter()) {
@@ -21681,6 +21990,12 @@ var ImageMetadata = {
21681
21990
  if (message.workdir !== void 0) {
21682
21991
  writer.uint32(26).string(message.workdir);
21683
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
+ }
21684
21999
  return writer;
21685
22000
  },
21686
22001
  decode(input, length) {
@@ -21714,6 +22029,20 @@ var ImageMetadata = {
21714
22029
  message.workdir = reader.string();
21715
22030
  continue;
21716
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
+ }
21717
22046
  }
21718
22047
  if ((tag & 7) === 4 || tag === 0) {
21719
22048
  break;
@@ -21729,7 +22058,9 @@ var ImageMetadata = {
21729
22058
  acc[key] = String(value);
21730
22059
  return acc;
21731
22060
  }, {}) : {},
21732
- 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
21733
22064
  };
21734
22065
  },
21735
22066
  toJSON(message) {
@@ -21749,6 +22080,12 @@ var ImageMetadata = {
21749
22080
  if (message.workdir !== void 0) {
21750
22081
  obj.workdir = message.workdir;
21751
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
+ }
21752
22089
  return obj;
21753
22090
  },
21754
22091
  create(base) {
@@ -21767,6 +22104,8 @@ var ImageMetadata = {
21767
22104
  {}
21768
22105
  );
21769
22106
  message.workdir = object.workdir ?? void 0;
22107
+ message.libcVersionInfo = object.libcVersionInfo ?? void 0;
22108
+ message.imageBuilderVersion = object.imageBuilderVersion ?? void 0;
21770
22109
  return message;
21771
22110
  }
21772
22111
  };
@@ -23992,7 +24331,7 @@ var PTYInfo = {
23992
24331
  }
23993
24332
  };
23994
24333
  function createBasePortSpec() {
23995
- return { port: 0, unencrypted: false };
24334
+ return { port: 0, unencrypted: false, tunnelType: void 0 };
23996
24335
  }
23997
24336
  var PortSpec = {
23998
24337
  encode(message, writer = new BinaryWriter()) {
@@ -24002,6 +24341,9 @@ var PortSpec = {
24002
24341
  if (message.unencrypted !== false) {
24003
24342
  writer.uint32(16).bool(message.unencrypted);
24004
24343
  }
24344
+ if (message.tunnelType !== void 0) {
24345
+ writer.uint32(24).int32(message.tunnelType);
24346
+ }
24005
24347
  return writer;
24006
24348
  },
24007
24349
  decode(input, length) {
@@ -24025,6 +24367,13 @@ var PortSpec = {
24025
24367
  message.unencrypted = reader.bool();
24026
24368
  continue;
24027
24369
  }
24370
+ case 3: {
24371
+ if (tag !== 24) {
24372
+ break;
24373
+ }
24374
+ message.tunnelType = reader.int32();
24375
+ continue;
24376
+ }
24028
24377
  }
24029
24378
  if ((tag & 7) === 4 || tag === 0) {
24030
24379
  break;
@@ -24036,7 +24385,8 @@ var PortSpec = {
24036
24385
  fromJSON(object) {
24037
24386
  return {
24038
24387
  port: isSet3(object.port) ? globalThis.Number(object.port) : 0,
24039
- 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
24040
24390
  };
24041
24391
  },
24042
24392
  toJSON(message) {
@@ -24047,6 +24397,9 @@ var PortSpec = {
24047
24397
  if (message.unencrypted !== false) {
24048
24398
  obj.unencrypted = message.unencrypted;
24049
24399
  }
24400
+ if (message.tunnelType !== void 0) {
24401
+ obj.tunnelType = tunnelTypeToJSON(message.tunnelType);
24402
+ }
24050
24403
  return obj;
24051
24404
  },
24052
24405
  create(base) {
@@ -24056,6 +24409,7 @@ var PortSpec = {
24056
24409
  const message = createBasePortSpec();
24057
24410
  message.port = object.port ?? 0;
24058
24411
  message.unencrypted = object.unencrypted ?? false;
24412
+ message.tunnelType = object.tunnelType ?? void 0;
24059
24413
  return message;
24060
24414
  }
24061
24415
  };
@@ -29321,13 +29675,16 @@ var Schedule = {
29321
29675
  }
29322
29676
  };
29323
29677
  function createBaseSchedule_Cron() {
29324
- return { cronString: "" };
29678
+ return { cronString: "", timezone: "" };
29325
29679
  }
29326
29680
  var Schedule_Cron = {
29327
29681
  encode(message, writer = new BinaryWriter()) {
29328
29682
  if (message.cronString !== "") {
29329
29683
  writer.uint32(10).string(message.cronString);
29330
29684
  }
29685
+ if (message.timezone !== "") {
29686
+ writer.uint32(18).string(message.timezone);
29687
+ }
29331
29688
  return writer;
29332
29689
  },
29333
29690
  decode(input, length) {
@@ -29344,6 +29701,13 @@ var Schedule_Cron = {
29344
29701
  message.cronString = reader.string();
29345
29702
  continue;
29346
29703
  }
29704
+ case 2: {
29705
+ if (tag !== 18) {
29706
+ break;
29707
+ }
29708
+ message.timezone = reader.string();
29709
+ continue;
29710
+ }
29347
29711
  }
29348
29712
  if ((tag & 7) === 4 || tag === 0) {
29349
29713
  break;
@@ -29353,13 +29717,19 @@ var Schedule_Cron = {
29353
29717
  return message;
29354
29718
  },
29355
29719
  fromJSON(object) {
29356
- 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
+ };
29357
29724
  },
29358
29725
  toJSON(message) {
29359
29726
  const obj = {};
29360
29727
  if (message.cronString !== "") {
29361
29728
  obj.cronString = message.cronString;
29362
29729
  }
29730
+ if (message.timezone !== "") {
29731
+ obj.timezone = message.timezone;
29732
+ }
29363
29733
  return obj;
29364
29734
  },
29365
29735
  create(base) {
@@ -29368,6 +29738,7 @@ var Schedule_Cron = {
29368
29738
  fromPartial(object) {
29369
29739
  const message = createBaseSchedule_Cron();
29370
29740
  message.cronString = object.cronString ?? "";
29741
+ message.timezone = object.timezone ?? "";
29371
29742
  return message;
29372
29743
  }
29373
29744
  };
@@ -31794,7 +32165,8 @@ function createBaseTaskLogs() {
31794
32165
  fileDescriptor: 0,
31795
32166
  taskProgress: void 0,
31796
32167
  functionCallId: "",
31797
- inputId: ""
32168
+ inputId: "",
32169
+ timestampNs: 0
31798
32170
  };
31799
32171
  }
31800
32172
  var TaskLogs = {
@@ -31820,6 +32192,9 @@ var TaskLogs = {
31820
32192
  if (message.inputId !== "") {
31821
32193
  writer.uint32(90).string(message.inputId);
31822
32194
  }
32195
+ if (message.timestampNs !== 0) {
32196
+ writer.uint32(96).uint64(message.timestampNs);
32197
+ }
31823
32198
  return writer;
31824
32199
  },
31825
32200
  decode(input, length) {
@@ -31878,6 +32253,13 @@ var TaskLogs = {
31878
32253
  message.inputId = reader.string();
31879
32254
  continue;
31880
32255
  }
32256
+ case 12: {
32257
+ if (tag !== 96) {
32258
+ break;
32259
+ }
32260
+ message.timestampNs = longToNumber(reader.uint64());
32261
+ continue;
32262
+ }
31881
32263
  }
31882
32264
  if ((tag & 7) === 4 || tag === 0) {
31883
32265
  break;
@@ -31894,7 +32276,8 @@ var TaskLogs = {
31894
32276
  fileDescriptor: isSet3(object.fileDescriptor) ? fileDescriptorFromJSON(object.fileDescriptor) : 0,
31895
32277
  taskProgress: isSet3(object.taskProgress) ? TaskProgress.fromJSON(object.taskProgress) : void 0,
31896
32278
  functionCallId: isSet3(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
31897
- 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
31898
32281
  };
31899
32282
  },
31900
32283
  toJSON(message) {
@@ -31920,6 +32303,9 @@ var TaskLogs = {
31920
32303
  if (message.inputId !== "") {
31921
32304
  obj.inputId = message.inputId;
31922
32305
  }
32306
+ if (message.timestampNs !== 0) {
32307
+ obj.timestampNs = Math.round(message.timestampNs);
32308
+ }
31923
32309
  return obj;
31924
32310
  },
31925
32311
  create(base) {
@@ -31934,6 +32320,7 @@ var TaskLogs = {
31934
32320
  message.taskProgress = object.taskProgress !== void 0 && object.taskProgress !== null ? TaskProgress.fromPartial(object.taskProgress) : void 0;
31935
32321
  message.functionCallId = object.functionCallId ?? "";
31936
32322
  message.inputId = object.inputId ?? "";
32323
+ message.timestampNs = object.timestampNs ?? 0;
31937
32324
  return message;
31938
32325
  }
31939
32326
  };
@@ -32972,7 +33359,7 @@ var TunnelData = {
32972
33359
  }
32973
33360
  };
32974
33361
  function createBaseTunnelStartRequest() {
32975
- return { port: 0, unencrypted: false };
33362
+ return { port: 0, unencrypted: false, tunnelType: void 0 };
32976
33363
  }
32977
33364
  var TunnelStartRequest = {
32978
33365
  encode(message, writer = new BinaryWriter()) {
@@ -32982,6 +33369,9 @@ var TunnelStartRequest = {
32982
33369
  if (message.unencrypted !== false) {
32983
33370
  writer.uint32(16).bool(message.unencrypted);
32984
33371
  }
33372
+ if (message.tunnelType !== void 0) {
33373
+ writer.uint32(24).int32(message.tunnelType);
33374
+ }
32985
33375
  return writer;
32986
33376
  },
32987
33377
  decode(input, length) {
@@ -33005,6 +33395,13 @@ var TunnelStartRequest = {
33005
33395
  message.unencrypted = reader.bool();
33006
33396
  continue;
33007
33397
  }
33398
+ case 3: {
33399
+ if (tag !== 24) {
33400
+ break;
33401
+ }
33402
+ message.tunnelType = reader.int32();
33403
+ continue;
33404
+ }
33008
33405
  }
33009
33406
  if ((tag & 7) === 4 || tag === 0) {
33010
33407
  break;
@@ -33016,7 +33413,8 @@ var TunnelStartRequest = {
33016
33413
  fromJSON(object) {
33017
33414
  return {
33018
33415
  port: isSet3(object.port) ? globalThis.Number(object.port) : 0,
33019
- 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
33020
33418
  };
33021
33419
  },
33022
33420
  toJSON(message) {
@@ -33027,6 +33425,9 @@ var TunnelStartRequest = {
33027
33425
  if (message.unencrypted !== false) {
33028
33426
  obj.unencrypted = message.unencrypted;
33029
33427
  }
33428
+ if (message.tunnelType !== void 0) {
33429
+ obj.tunnelType = tunnelTypeToJSON(message.tunnelType);
33430
+ }
33030
33431
  return obj;
33031
33432
  },
33032
33433
  create(base) {
@@ -33036,6 +33437,7 @@ var TunnelStartRequest = {
33036
33437
  const message = createBaseTunnelStartRequest();
33037
33438
  message.port = object.port ?? 0;
33038
33439
  message.unencrypted = object.unencrypted ?? false;
33440
+ message.tunnelType = object.tunnelType ?? void 0;
33039
33441
  return message;
33040
33442
  }
33041
33443
  };
@@ -33341,6 +33743,104 @@ var VolumeCommitResponse = {
33341
33743
  return message;
33342
33744
  }
33343
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
+ };
33344
33844
  function createBaseVolumeCopyFilesRequest() {
33345
33845
  return { volumeId: "", srcPaths: [], dstPath: "", recursive: false };
33346
33846
  }
@@ -33507,6 +34007,202 @@ var VolumeDeleteRequest = {
33507
34007
  return message;
33508
34008
  }
33509
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
+ };
33510
34206
  function createBaseVolumeGetFileRequest() {
33511
34207
  return { volumeId: "", path: "", start: 0, len: 0 };
33512
34208
  }
@@ -33980,6 +34676,157 @@ var VolumeHeartbeatRequest = {
33980
34676
  return message;
33981
34677
  }
33982
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
+ };
33983
34830
  function createBaseVolumeListFilesRequest() {
33984
34831
  return { volumeId: "", path: "", recursive: false, maxEntries: void 0 };
33985
34832
  }
@@ -35001,6 +35848,89 @@ var VolumeReloadRequest = {
35001
35848
  return message;
35002
35849
  }
35003
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
+ };
35004
35934
  function createBaseVolumeRemoveFileRequest() {
35005
35935
  return { volumeId: "", path: "", recursive: false };
35006
35936
  }
@@ -35700,6 +36630,14 @@ var ModalClientDefinition = {
35700
36630
  responseStream: false,
35701
36631
  options: {}
35702
36632
  },
36633
+ attemptRetry: {
36634
+ name: "AttemptRetry",
36635
+ requestType: AttemptRetryRequest,
36636
+ requestStream: false,
36637
+ responseType: AttemptRetryResponse,
36638
+ responseStream: false,
36639
+ options: {}
36640
+ },
35703
36641
  attemptStart: {
35704
36642
  name: "AttemptStart",
35705
36643
  requestType: AttemptStartRequest,
@@ -36677,6 +37615,14 @@ var ModalClientDefinition = {
36677
37615
  responseStream: false,
36678
37616
  options: {}
36679
37617
  },
37618
+ volumeCopyFiles2: {
37619
+ name: "VolumeCopyFiles2",
37620
+ requestType: VolumeCopyFiles2Request,
37621
+ requestStream: false,
37622
+ responseType: Empty,
37623
+ responseStream: false,
37624
+ options: {}
37625
+ },
36680
37626
  volumeDelete: {
36681
37627
  name: "VolumeDelete",
36682
37628
  requestType: VolumeDeleteRequest,
@@ -36693,6 +37639,14 @@ var ModalClientDefinition = {
36693
37639
  responseStream: false,
36694
37640
  options: {}
36695
37641
  },
37642
+ volumeGetFile2: {
37643
+ name: "VolumeGetFile2",
37644
+ requestType: VolumeGetFile2Request,
37645
+ requestStream: false,
37646
+ responseType: VolumeGetFile2Response,
37647
+ responseStream: false,
37648
+ options: {}
37649
+ },
36696
37650
  volumeGetOrCreate: {
36697
37651
  name: "VolumeGetOrCreate",
36698
37652
  requestType: VolumeGetOrCreateRequest,
@@ -36725,6 +37679,14 @@ var ModalClientDefinition = {
36725
37679
  responseStream: true,
36726
37680
  options: {}
36727
37681
  },
37682
+ volumeListFiles2: {
37683
+ name: "VolumeListFiles2",
37684
+ requestType: VolumeListFiles2Request,
37685
+ requestStream: false,
37686
+ responseType: VolumeListFiles2Response,
37687
+ responseStream: true,
37688
+ options: {}
37689
+ },
36728
37690
  volumePutFiles: {
36729
37691
  name: "VolumePutFiles",
36730
37692
  requestType: VolumePutFilesRequest,
@@ -36757,6 +37719,14 @@ var ModalClientDefinition = {
36757
37719
  responseStream: false,
36758
37720
  options: {}
36759
37721
  },
37722
+ volumeRemoveFile2: {
37723
+ name: "VolumeRemoveFile2",
37724
+ requestType: VolumeRemoveFile2Request,
37725
+ requestStream: false,
37726
+ responseType: Empty,
37727
+ responseStream: false,
37728
+ options: {}
37729
+ },
36760
37730
  volumeRename: {
36761
37731
  name: "VolumeRename",
36762
37732
  requestType: VolumeRenameRequest,
@@ -36887,7 +37857,7 @@ function authMiddleware(profile2) {
36887
37857
  "x-modal-client-type",
36888
37858
  String(7 /* CLIENT_TYPE_LIBMODAL */)
36889
37859
  );
36890
- options.metadata.set("x-modal-client-version", "0.74.25");
37860
+ options.metadata.set("x-modal-client-version", "1.0.0");
36891
37861
  options.metadata.set("x-modal-token-id", profile2.tokenId);
36892
37862
  options.metadata.set("x-modal-token-secret", profile2.tokenSecret);
36893
37863
  return yield* call.next(call.request, options);
@@ -37387,10 +38357,10 @@ function encodeIfString(chunk) {
37387
38357
  }
37388
38358
 
37389
38359
  // src/errors.ts
37390
- var TimeoutError = class extends Error {
38360
+ var FunctionTimeoutError = class extends Error {
37391
38361
  constructor(message) {
37392
38362
  super(message);
37393
- this.name = "TimeoutError";
38363
+ this.name = "FunctionTimeoutError";
37394
38364
  }
37395
38365
  };
37396
38366
  var RemoteError = class extends Error {
@@ -37434,13 +38404,18 @@ var App = class _App {
37434
38404
  }
37435
38405
  }
37436
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
+ }
37437
38412
  const createResp = await client.sandboxCreate({
37438
38413
  appId: this.appId,
37439
38414
  definition: {
37440
38415
  // Sleep default is implicit in image builder version <=2024.10
37441
38416
  entrypointArgs: options.command ?? ["sleep", "48h"],
37442
38417
  imageId: image.imageId,
37443
- timeoutSecs: options.timeout ?? 600,
38418
+ timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
37444
38419
  networkAccess: {
37445
38420
  networkAccessType: 1 /* OPEN */
37446
38421
  },
@@ -37464,6 +38439,30 @@ import { ClientError as ClientError4, Status as Status4 } from "nice-grpc";
37464
38439
  // src/function.ts
37465
38440
  import { createHash } from "node:crypto";
37466
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
+
37467
38466
  // src/pickle.ts
37468
38467
  var PickleError = class extends Error {
37469
38468
  constructor(message) {
@@ -37768,7 +38767,8 @@ function loads(buf) {
37768
38767
  // src/function.ts
37769
38768
  import { ClientError as ClientError3, Status as Status3 } from "nice-grpc";
37770
38769
  var maxObjectSizeBytes = 2 * 1024 * 1024;
37771
- function timeNow() {
38770
+ var outputsTimeout = 55 * 1e3;
38771
+ function timeNowSeconds() {
37772
38772
  return Date.now() / 1e3;
37773
38773
  }
37774
38774
  var Function_ = class _Function_ {
@@ -37795,6 +38795,23 @@ var Function_ = class _Function_ {
37795
38795
  }
37796
38796
  // Execute a single input into a remote Function.
37797
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 */) {
37798
38815
  const payload = dumps([args, kwargs]);
37799
38816
  let argsBlobId = void 0;
37800
38817
  if (payload.length > maxObjectSizeBytes) {
@@ -37803,7 +38820,7 @@ var Function_ = class _Function_ {
37803
38820
  const functionMapResponse = await client.functionMap({
37804
38821
  functionId: this.functionId,
37805
38822
  functionCallType: 1 /* FUNCTION_CALL_TYPE_UNARY */,
37806
- functionCallInvocationType: 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */,
38823
+ functionCallInvocationType: invocationType,
37807
38824
  pipelinedInputs: [
37808
38825
  {
37809
38826
  idx: 0,
@@ -37816,22 +38833,44 @@ var Function_ = class _Function_ {
37816
38833
  }
37817
38834
  ]
37818
38835
  });
37819
- while (true) {
37820
- const response = await client.functionGetOutputs({
37821
- 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,
37822
38850
  maxValues: 1,
37823
- timeout: 55,
38851
+ timeout: pollTimeout / 1e3,
38852
+ // Backend needs seconds
37824
38853
  lastEntryId: "0-0",
37825
38854
  clearOnSuccess: true,
37826
- requestedAt: timeNow()
38855
+ requestedAt: timeNowSeconds()
37827
38856
  });
37828
- const outputs = response.outputs;
37829
- if (outputs.length > 0) {
37830
- 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);
37831
38869
  }
38870
+ pollTimeout = Math.min(outputsTimeout, remainingTime);
37832
38871
  }
37833
38872
  }
37834
- };
38873
+ }
37835
38874
  async function processResult(result, dataFormat) {
37836
38875
  if (!result) {
37837
38876
  throw new Error("Received null result from invocation");
@@ -37844,7 +38883,7 @@ async function processResult(result, dataFormat) {
37844
38883
  }
37845
38884
  switch (result.status) {
37846
38885
  case 4 /* GENERIC_STATUS_TIMEOUT */:
37847
- throw new TimeoutError(`Timeout: ${result.exception}`);
38886
+ throw new FunctionTimeoutError(`Timeout: ${result.exception}`);
37848
38887
  case 6 /* GENERIC_STATUS_INTERNAL_FAILURE */:
37849
38888
  throw new InternalFailure(`Internal failure: ${result.exception}`);
37850
38889
  case 1 /* GENERIC_STATUS_SUCCESS */:
@@ -38047,11 +39086,12 @@ export {
38047
39086
  App,
38048
39087
  Cls,
38049
39088
  ClsInstance,
39089
+ FunctionCall,
39090
+ FunctionTimeoutError,
38050
39091
  Function_,
38051
39092
  Image2 as Image,
38052
39093
  InternalFailure,
38053
39094
  NotFoundError,
38054
39095
  RemoteError,
38055
- Sandbox2 as Sandbox,
38056
- TimeoutError
39096
+ Sandbox2 as Sandbox
38057
39097
  };