modal 0.3.4 → 0.3.6

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,
@@ -36861,7 +37831,7 @@ function getProfile(profileName) {
36861
37831
  );
36862
37832
  }
36863
37833
  const profileData = profileName ? config[profileName] : {};
36864
- let profile2 = {
37834
+ const profile2 = {
36865
37835
  serverUrl: process.env["MODAL_SERVER_URL"] || profileData.server_url || "https://api.modal.com:443",
36866
37836
  tokenId: process.env["MODAL_TOKEN_ID"] || profileData.token_id,
36867
37837
  tokenSecret: process.env["MODAL_TOKEN_SECRET"] || profileData.token_secret,
@@ -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);
@@ -37005,6 +37975,7 @@ var client = createClientFactory().use(authMiddleware(profile)).use(retryMiddlew
37005
37975
  // src/image.ts
37006
37976
  var Image2 = class {
37007
37977
  imageId;
37978
+ /** @ignore */
37008
37979
  constructor(imageId) {
37009
37980
  this.imageId = imageId;
37010
37981
  }
@@ -37043,6 +38014,7 @@ async function fromRegistryInternal(appId, tag) {
37043
38014
  }
37044
38015
  result = resultJoined;
37045
38016
  }
38017
+ void metadata;
37046
38018
  if (result.status === 2 /* GENERIC_STATUS_FAILURE */) {
37047
38019
  throw new Error(
37048
38020
  `Image build for ${resp.imageId} failed with the exception:
@@ -37181,6 +38153,7 @@ var Sandbox2 = class {
37181
38153
  stdout;
37182
38154
  stderr;
37183
38155
  #taskId;
38156
+ /** @ignore */
37184
38157
  constructor(sandboxId) {
37185
38158
  this.sandboxId = sandboxId;
37186
38159
  this.stdin = toModalWriteStream(inputStreamSb(sandboxId));
@@ -37387,10 +38360,10 @@ function encodeIfString(chunk) {
37387
38360
  }
37388
38361
 
37389
38362
  // src/errors.ts
37390
- var TimeoutError = class extends Error {
38363
+ var FunctionTimeoutError = class extends Error {
37391
38364
  constructor(message) {
37392
38365
  super(message);
37393
- this.name = "TimeoutError";
38366
+ this.name = "FunctionTimeoutError";
37394
38367
  }
37395
38368
  };
37396
38369
  var RemoteError = class extends Error {
@@ -37411,10 +38384,29 @@ var NotFoundError = class extends Error {
37411
38384
  this.name = "NotFoundError";
37412
38385
  }
37413
38386
  };
38387
+ var InvalidError = class extends Error {
38388
+ constructor(message) {
38389
+ super(message);
38390
+ this.name = "InvalidError";
38391
+ }
38392
+ };
38393
+ var QueueEmptyError = class extends Error {
38394
+ constructor(message) {
38395
+ super(message);
38396
+ this.name = "QueueEmptyError";
38397
+ }
38398
+ };
38399
+ var QueueFullError = class extends Error {
38400
+ constructor(message) {
38401
+ super(message);
38402
+ this.name = "QueueFullError";
38403
+ }
38404
+ };
37414
38405
 
37415
38406
  // src/app.ts
37416
38407
  var App = class _App {
37417
38408
  appId;
38409
+ /** @ignore */
37418
38410
  constructor(appId) {
37419
38411
  this.appId = appId;
37420
38412
  }
@@ -37434,13 +38426,18 @@ var App = class _App {
37434
38426
  }
37435
38427
  }
37436
38428
  async createSandbox(image, options = {}) {
38429
+ if (options.timeout && options.timeout % 1e3 !== 0) {
38430
+ throw new Error(
38431
+ `Timeout must be a multiple of 1000ms, got ${options.timeout}`
38432
+ );
38433
+ }
37437
38434
  const createResp = await client.sandboxCreate({
37438
38435
  appId: this.appId,
37439
38436
  definition: {
37440
38437
  // Sleep default is implicit in image builder version <=2024.10
37441
38438
  entrypointArgs: options.command ?? ["sleep", "48h"],
37442
38439
  imageId: image.imageId,
37443
- timeoutSecs: options.timeout ?? 600,
38440
+ timeoutSecs: options.timeout != void 0 ? options.timeout / 1e3 : 600,
37444
38441
  networkAccess: {
37445
38442
  networkAccessType: 1 /* OPEN */
37446
38443
  },
@@ -37464,6 +38461,31 @@ import { ClientError as ClientError4, Status as Status4 } from "nice-grpc";
37464
38461
  // src/function.ts
37465
38462
  import { createHash } from "node:crypto";
37466
38463
 
38464
+ // src/function_call.ts
38465
+ var FunctionCall = class _FunctionCall {
38466
+ functionCallId;
38467
+ /** @ignore */
38468
+ constructor(functionCallId) {
38469
+ this.functionCallId = functionCallId;
38470
+ }
38471
+ /** Create a new function call from ID. */
38472
+ fromId(functionCallId) {
38473
+ return new _FunctionCall(functionCallId);
38474
+ }
38475
+ /** Get the result of a function call, optionally waiting with a timeout. */
38476
+ async get(options = {}) {
38477
+ const timeout = options.timeout;
38478
+ return await pollFunctionOutput(this.functionCallId, timeout);
38479
+ }
38480
+ /** Cancel a running function call. */
38481
+ async cancel(options = {}) {
38482
+ await client.functionCallCancel({
38483
+ functionCallId: this.functionCallId,
38484
+ terminateContainers: options.terminateContainers
38485
+ });
38486
+ }
38487
+ };
38488
+
37467
38489
  // src/pickle.ts
37468
38490
  var PickleError = class extends Error {
37469
38491
  constructor(message) {
@@ -37571,7 +38593,7 @@ function encodeValue(val, w, proto) {
37571
38593
  w.byte(140 /* SHORT_BINUNICODE */);
37572
38594
  w.byte(utf8.length);
37573
38595
  } else if (proto >= 4 && utf8.length > 4294967295) {
37574
- w.byte(138 /* BINUNICODE8 */);
38596
+ w.byte(141 /* BINUNICODE8 */);
37575
38597
  w.uint64LE(utf8.length);
37576
38598
  } else {
37577
38599
  w.byte(88 /* BINUNICODE */);
@@ -37584,10 +38606,10 @@ function encodeValue(val, w, proto) {
37584
38606
  if (val instanceof Uint8Array) {
37585
38607
  const len = val.length;
37586
38608
  if (proto >= 4 && len < 256) {
37587
- w.byte(142 /* SHORT_BINBYTES */);
38609
+ w.byte(67 /* SHORT_BINBYTES */);
37588
38610
  w.byte(len);
37589
38611
  } else if (proto >= 4 && len > 4294967295) {
37590
- w.byte(141 /* BINBYTES8 */);
38612
+ w.byte(142 /* BINBYTES8 */);
37591
38613
  w.uint64LE(len);
37592
38614
  } else {
37593
38615
  w.byte(66 /* BINBYTES */);
@@ -37699,12 +38721,12 @@ function loads(buf) {
37699
38721
  push(tdec.decode(r.take(n)));
37700
38722
  break;
37701
38723
  }
37702
- case 138 /* BINUNICODE8 */: {
38724
+ case 141 /* BINUNICODE8 */: {
37703
38725
  const n = r.uint64LE();
37704
38726
  push(tdec.decode(r.take(n)));
37705
38727
  break;
37706
38728
  }
37707
- case 142 /* SHORT_BINBYTES */: {
38729
+ case 67 /* SHORT_BINBYTES */: {
37708
38730
  const n = r.byte();
37709
38731
  push(r.take(n));
37710
38732
  break;
@@ -37714,7 +38736,7 @@ function loads(buf) {
37714
38736
  push(r.take(n));
37715
38737
  break;
37716
38738
  }
37717
- case 141 /* BINBYTES8 */: {
38739
+ case 142 /* BINBYTES8 */: {
37718
38740
  const n = r.uint64LE();
37719
38741
  push(r.take(n));
37720
38742
  break;
@@ -37768,12 +38790,14 @@ function loads(buf) {
37768
38790
  // src/function.ts
37769
38791
  import { ClientError as ClientError3, Status as Status3 } from "nice-grpc";
37770
38792
  var maxObjectSizeBytes = 2 * 1024 * 1024;
37771
- function timeNow() {
38793
+ var outputsTimeout = 55 * 1e3;
38794
+ function timeNowSeconds() {
37772
38795
  return Date.now() / 1e3;
37773
38796
  }
37774
38797
  var Function_ = class _Function_ {
37775
38798
  functionId;
37776
38799
  methodName;
38800
+ /** @ignore */
37777
38801
  constructor(functionId, methodName) {
37778
38802
  this.functionId = functionId;
37779
38803
  this.methodName = methodName;
@@ -37795,6 +38819,23 @@ var Function_ = class _Function_ {
37795
38819
  }
37796
38820
  // Execute a single input into a remote Function.
37797
38821
  async remote(args = [], kwargs = {}) {
38822
+ const functionCallId = await this.#execFunctionCall(
38823
+ args,
38824
+ kwargs,
38825
+ 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */
38826
+ );
38827
+ return await pollFunctionOutput(functionCallId);
38828
+ }
38829
+ // Spawn a single input into a remote function.
38830
+ async spawn(args = [], kwargs = {}) {
38831
+ const functionCallId = await this.#execFunctionCall(
38832
+ args,
38833
+ kwargs,
38834
+ 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */
38835
+ );
38836
+ return new FunctionCall(functionCallId);
38837
+ }
38838
+ async #execFunctionCall(args = [], kwargs = {}, invocationType = 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */) {
37798
38839
  const payload = dumps([args, kwargs]);
37799
38840
  let argsBlobId = void 0;
37800
38841
  if (payload.length > maxObjectSizeBytes) {
@@ -37803,7 +38844,7 @@ var Function_ = class _Function_ {
37803
38844
  const functionMapResponse = await client.functionMap({
37804
38845
  functionId: this.functionId,
37805
38846
  functionCallType: 1 /* FUNCTION_CALL_TYPE_UNARY */,
37806
- functionCallInvocationType: 4 /* FUNCTION_CALL_INVOCATION_TYPE_SYNC */,
38847
+ functionCallInvocationType: invocationType,
37807
38848
  pipelinedInputs: [
37808
38849
  {
37809
38850
  idx: 0,
@@ -37816,22 +38857,44 @@ var Function_ = class _Function_ {
37816
38857
  }
37817
38858
  ]
37818
38859
  });
37819
- while (true) {
37820
- const response = await client.functionGetOutputs({
37821
- functionCallId: functionMapResponse.functionCallId,
38860
+ return functionMapResponse.functionCallId;
38861
+ }
38862
+ };
38863
+ async function pollFunctionOutput(functionCallId, timeout) {
38864
+ const startTime = Date.now();
38865
+ let pollTimeout = outputsTimeout;
38866
+ if (timeout !== void 0) {
38867
+ pollTimeout = Math.min(timeout, outputsTimeout);
38868
+ }
38869
+ while (true) {
38870
+ let response;
38871
+ try {
38872
+ response = await client.functionGetOutputs({
38873
+ functionCallId,
37822
38874
  maxValues: 1,
37823
- timeout: 55,
38875
+ timeout: pollTimeout / 1e3,
38876
+ // Backend needs seconds
37824
38877
  lastEntryId: "0-0",
37825
38878
  clearOnSuccess: true,
37826
- requestedAt: timeNow()
38879
+ requestedAt: timeNowSeconds()
37827
38880
  });
37828
- const outputs = response.outputs;
37829
- if (outputs.length > 0) {
37830
- return await processResult(outputs[0].result, outputs[0].dataFormat);
38881
+ } catch (err) {
38882
+ throw new Error(`FunctionGetOutputs failed: ${err}`);
38883
+ }
38884
+ const outputs = response.outputs;
38885
+ if (outputs.length > 0) {
38886
+ return await processResult(outputs[0].result, outputs[0].dataFormat);
38887
+ }
38888
+ if (timeout !== void 0) {
38889
+ const remainingTime = timeout - (Date.now() - startTime);
38890
+ if (remainingTime <= 0) {
38891
+ const message = `Timeout exceeded: ${(timeout / 1e3).toFixed(1)}s`;
38892
+ throw new FunctionTimeoutError(message);
37831
38893
  }
38894
+ pollTimeout = Math.min(outputsTimeout, remainingTime);
37832
38895
  }
37833
38896
  }
37834
- };
38897
+ }
37835
38898
  async function processResult(result, dataFormat) {
37836
38899
  if (!result) {
37837
38900
  throw new Error("Received null result from invocation");
@@ -37844,7 +38907,7 @@ async function processResult(result, dataFormat) {
37844
38907
  }
37845
38908
  switch (result.status) {
37846
38909
  case 4 /* GENERIC_STATUS_TIMEOUT */:
37847
- throw new TimeoutError(`Timeout: ${result.exception}`);
38910
+ throw new FunctionTimeoutError(`Timeout: ${result.exception}`);
37848
38911
  case 6 /* GENERIC_STATUS_INTERNAL_FAILURE */:
37849
38912
  throw new InternalFailure(`Internal failure: ${result.exception}`);
37850
38913
  case 1 /* GENERIC_STATUS_SUCCESS */:
@@ -37913,6 +38976,7 @@ var Cls = class _Cls {
37913
38976
  #serviceFunctionId;
37914
38977
  #schema;
37915
38978
  #methodNames;
38979
+ /** @ignore */
37916
38980
  constructor(serviceFunctionId, schema, methodNames) {
37917
38981
  this.#serviceFunctionId = serviceFunctionId;
37918
38982
  this.#schema = schema;
@@ -38043,15 +39107,268 @@ var ClsInstance = class {
38043
39107
  return method;
38044
39108
  }
38045
39109
  };
39110
+
39111
+ // src/queue.ts
39112
+ import { ClientError as ClientError5, Status as Status5 } from "nice-grpc";
39113
+ var ephemeralObjectHeartbeatSleep = 3e5;
39114
+ var queueInitialPutBackoff = 100;
39115
+ var queueDefaultPartitionTtl = 24 * 3600 * 1e3;
39116
+ var Queue = class _Queue {
39117
+ queueId;
39118
+ #ephemeral;
39119
+ #abortController;
39120
+ /** @ignore */
39121
+ constructor(queueId, ephemeral = false) {
39122
+ this.queueId = queueId;
39123
+ this.#ephemeral = ephemeral;
39124
+ this.#abortController = ephemeral ? new AbortController() : void 0;
39125
+ }
39126
+ static #validatePartitionKey(partition) {
39127
+ if (partition) {
39128
+ const partitionKey = new TextEncoder().encode(partition);
39129
+ if (partitionKey.length === 0 || partitionKey.length > 64) {
39130
+ throw new InvalidError(
39131
+ "Queue partition key must be between 1 and 64 bytes."
39132
+ );
39133
+ }
39134
+ return partitionKey;
39135
+ }
39136
+ return new Uint8Array();
39137
+ }
39138
+ /**
39139
+ * Create a nameless, temporary queue.
39140
+ * You will need to call `closeEphemeral()` to delete the queue.
39141
+ */
39142
+ static async ephemeral(options = {}) {
39143
+ const resp = await client.queueGetOrCreate({
39144
+ objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
39145
+ environmentName: environmentName(options.environment)
39146
+ });
39147
+ const queue = new _Queue(resp.queueId, true);
39148
+ const signal = queue.#abortController.signal;
39149
+ (async () => {
39150
+ while (true) {
39151
+ await client.queueHeartbeat({ queueId: resp.queueId });
39152
+ await Promise.race([
39153
+ new Promise(
39154
+ (resolve) => setTimeout(resolve, ephemeralObjectHeartbeatSleep)
39155
+ ),
39156
+ new Promise((resolve) => {
39157
+ signal.addEventListener("abort", resolve, { once: true });
39158
+ })
39159
+ ]);
39160
+ }
39161
+ })();
39162
+ return queue;
39163
+ }
39164
+ /** Delete the ephemeral queue. Only usable with `Queue.ephemeral()`. */
39165
+ closeEphemeral() {
39166
+ if (this.#ephemeral) {
39167
+ this.#abortController.abort();
39168
+ } else {
39169
+ throw new InvalidError("Queue is not ephemeral.");
39170
+ }
39171
+ }
39172
+ /**
39173
+ * Lookup a queue by name.
39174
+ */
39175
+ static async lookup(name, options = {}) {
39176
+ const resp = await client.queueGetOrCreate({
39177
+ deploymentName: name,
39178
+ objectCreationType: options.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : void 0,
39179
+ namespace: 1 /* DEPLOYMENT_NAMESPACE_WORKSPACE */,
39180
+ environmentName: environmentName(options.environment)
39181
+ });
39182
+ return new _Queue(resp.queueId);
39183
+ }
39184
+ /** Delete a queue by name. */
39185
+ static async delete(name, options = {}) {
39186
+ const queue = await _Queue.lookup(name, options);
39187
+ await client.queueDelete({ queueId: queue.queueId });
39188
+ }
39189
+ /**
39190
+ * Remove all objects from a queue partition.
39191
+ */
39192
+ async clear(options = {}) {
39193
+ if (options.partition && options.all) {
39194
+ throw new InvalidError(
39195
+ "Partition must be null when requesting to clear all."
39196
+ );
39197
+ }
39198
+ await client.queueClear({
39199
+ queueId: this.queueId,
39200
+ partitionKey: _Queue.#validatePartitionKey(options.partition),
39201
+ allPartitions: options.all
39202
+ });
39203
+ }
39204
+ async #get(n, partition, timeout) {
39205
+ const partitionKey = _Queue.#validatePartitionKey(partition);
39206
+ const startTime = Date.now();
39207
+ let pollTimeout = 5e4;
39208
+ if (timeout !== void 0) {
39209
+ pollTimeout = Math.min(pollTimeout, timeout);
39210
+ }
39211
+ while (true) {
39212
+ const response = await client.queueGet({
39213
+ queueId: this.queueId,
39214
+ partitionKey,
39215
+ timeout: pollTimeout / 1e3,
39216
+ nValues: n
39217
+ });
39218
+ if (response.values && response.values.length > 0) {
39219
+ return response.values.map((value) => loads(value));
39220
+ }
39221
+ if (timeout !== void 0) {
39222
+ const remaining = timeout - (Date.now() - startTime);
39223
+ if (remaining <= 0) {
39224
+ const message = `Queue ${this.queueId} did not return values within ${timeout}ms.`;
39225
+ throw new QueueEmptyError(message);
39226
+ }
39227
+ pollTimeout = Math.min(pollTimeout, remaining);
39228
+ }
39229
+ }
39230
+ }
39231
+ /**
39232
+ * Remove and return the next object from the queue.
39233
+ *
39234
+ * By default, this will wait until at least one item is present in the queue.
39235
+ * If `timeout` is set, raises `QueueEmptyError` if no items are available
39236
+ * within that timeout in milliseconds.
39237
+ */
39238
+ async get(options = {}) {
39239
+ const values = await this.#get(1, options.partition, options.timeout);
39240
+ return values[0];
39241
+ }
39242
+ /**
39243
+ * Remove and return up to `n` objects from the queue.
39244
+ *
39245
+ * By default, this will wait until at least one item is present in the queue.
39246
+ * If `timeout` is set, raises `QueueEmptyError` if no items are available
39247
+ * within that timeout in milliseconds.
39248
+ */
39249
+ async getMany(n, options = {}) {
39250
+ return await this.#get(n, options.partition, options.timeout);
39251
+ }
39252
+ async #put(values, timeout, partition, partitionTtl) {
39253
+ const valuesEncoded = values.map((v) => dumps(v));
39254
+ const partitionKey = _Queue.#validatePartitionKey(partition);
39255
+ let delay = queueInitialPutBackoff;
39256
+ const deadline = timeout ? Date.now() + timeout : void 0;
39257
+ while (true) {
39258
+ try {
39259
+ await client.queuePut({
39260
+ queueId: this.queueId,
39261
+ values: valuesEncoded,
39262
+ partitionKey,
39263
+ partitionTtlSeconds: (partitionTtl || queueDefaultPartitionTtl) / 1e3
39264
+ });
39265
+ break;
39266
+ } catch (e) {
39267
+ if (e instanceof ClientError5 && e.code === Status5.RESOURCE_EXHAUSTED) {
39268
+ delay = Math.min(delay * 2, 3e4);
39269
+ if (deadline !== void 0) {
39270
+ const remaining = deadline - Date.now();
39271
+ if (remaining <= 0)
39272
+ throw new QueueFullError(`Put failed on ${this.queueId}.`);
39273
+ delay = Math.min(delay, remaining);
39274
+ }
39275
+ await new Promise((resolve) => setTimeout(resolve, delay));
39276
+ } else {
39277
+ throw e;
39278
+ }
39279
+ }
39280
+ }
39281
+ }
39282
+ /**
39283
+ * Add an item to the end of the queue.
39284
+ *
39285
+ * If the queue is full, this will retry with exponential backoff until the
39286
+ * provided `timeout` is reached, or indefinitely if `timeout` is not set.
39287
+ * Raises `QueueFullError` if the queue is still full after the timeout.
39288
+ */
39289
+ async put(v, options = {}) {
39290
+ await this.#put(
39291
+ [v],
39292
+ options.timeout,
39293
+ options.partition,
39294
+ options.partitionTtl
39295
+ );
39296
+ }
39297
+ /**
39298
+ * Add several items to the end of the queue.
39299
+ *
39300
+ * If the queue is full, this will retry with exponential backoff until the
39301
+ * provided `timeout` is reached, or indefinitely if `timeout` is not set.
39302
+ * Raises `QueueFullError` if the queue is still full after the timeout.
39303
+ */
39304
+ async putMany(values, options = {}) {
39305
+ await this.#put(
39306
+ values,
39307
+ options.timeout,
39308
+ options.partition,
39309
+ options.partitionTtl
39310
+ );
39311
+ }
39312
+ /** Return the number of objects in the queue. */
39313
+ async len(options = {}) {
39314
+ if (options.partition && options.total) {
39315
+ throw new InvalidError(
39316
+ "Partition must be null when requesting total length."
39317
+ );
39318
+ }
39319
+ const resp = await client.queueLen({
39320
+ queueId: this.queueId,
39321
+ partitionKey: _Queue.#validatePartitionKey(options.partition),
39322
+ total: options.total
39323
+ });
39324
+ return resp.len;
39325
+ }
39326
+ /** Iterate through items in a queue without mutation. */
39327
+ async *iterate(options = {}) {
39328
+ const { partition, itemPollTimeout = 0 } = options;
39329
+ let lastEntryId = void 0;
39330
+ const validatedPartitionKey = _Queue.#validatePartitionKey(partition);
39331
+ let fetchDeadline = Date.now() + itemPollTimeout;
39332
+ const maxPollDuration = 3e4;
39333
+ while (true) {
39334
+ const pollDuration = Math.max(
39335
+ 0,
39336
+ Math.min(maxPollDuration, fetchDeadline - Date.now())
39337
+ );
39338
+ const request = {
39339
+ queueId: this.queueId,
39340
+ partitionKey: validatedPartitionKey,
39341
+ itemPollTimeout: pollDuration / 1e3,
39342
+ lastEntryId: lastEntryId || ""
39343
+ };
39344
+ const response = await client.queueNextItems(request);
39345
+ if (response.items && response.items.length > 0) {
39346
+ for (const item of response.items) {
39347
+ yield loads(item.value);
39348
+ lastEntryId = item.entryId;
39349
+ }
39350
+ fetchDeadline = Date.now() + itemPollTimeout;
39351
+ } else if (Date.now() > fetchDeadline) {
39352
+ break;
39353
+ }
39354
+ }
39355
+ }
39356
+ };
38046
39357
  export {
38047
39358
  App,
38048
39359
  Cls,
38049
39360
  ClsInstance,
39361
+ ContainerProcess,
39362
+ FunctionCall,
39363
+ FunctionTimeoutError,
38050
39364
  Function_,
38051
39365
  Image2 as Image,
38052
39366
  InternalFailure,
39367
+ InvalidError,
38053
39368
  NotFoundError,
39369
+ Queue,
39370
+ QueueEmptyError,
39371
+ QueueFullError,
38054
39372
  RemoteError,
38055
- Sandbox2 as Sandbox,
38056
- TimeoutError
39373
+ Sandbox2 as Sandbox
38057
39374
  };