modal 0.10.2-dev.0 → 0.10.2-dev.10

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
@@ -2257,6 +2257,76 @@ function fileDescriptorToJSON(object) {
2257
2257
  return "UNRECOGNIZED";
2258
2258
  }
2259
2259
  }
2260
+ function functionCallInputStatusFromJSON(object) {
2261
+ switch (object) {
2262
+ case 0:
2263
+ case "FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED":
2264
+ return 0 /* FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED */;
2265
+ case 1:
2266
+ case "FUNCTION_CALL_INPUT_STATUS_PENDING":
2267
+ return 1 /* FUNCTION_CALL_INPUT_STATUS_PENDING */;
2268
+ case 2:
2269
+ case "FUNCTION_CALL_INPUT_STATUS_RUNNING":
2270
+ return 2 /* FUNCTION_CALL_INPUT_STATUS_RUNNING */;
2271
+ case 3:
2272
+ case "FUNCTION_CALL_INPUT_STATUS_SUCCESS":
2273
+ return 3 /* FUNCTION_CALL_INPUT_STATUS_SUCCESS */;
2274
+ case 4:
2275
+ case "FUNCTION_CALL_INPUT_STATUS_FAILURE":
2276
+ return 4 /* FUNCTION_CALL_INPUT_STATUS_FAILURE */;
2277
+ case 5:
2278
+ case "FUNCTION_CALL_INPUT_STATUS_TIMEOUT":
2279
+ return 5 /* FUNCTION_CALL_INPUT_STATUS_TIMEOUT */;
2280
+ case 6:
2281
+ case "FUNCTION_CALL_INPUT_STATUS_TERMINATED":
2282
+ return 6 /* FUNCTION_CALL_INPUT_STATUS_TERMINATED */;
2283
+ case 7:
2284
+ case "FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE":
2285
+ return 7 /* FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE */;
2286
+ case 8:
2287
+ case "FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE":
2288
+ return 8 /* FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE */;
2289
+ case 9:
2290
+ case "FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT":
2291
+ return 9 /* FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT */;
2292
+ case 10:
2293
+ case "FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION":
2294
+ return 10 /* FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION */;
2295
+ case -1:
2296
+ case "UNRECOGNIZED":
2297
+ default:
2298
+ return -1 /* UNRECOGNIZED */;
2299
+ }
2300
+ }
2301
+ function functionCallInputStatusToJSON(object) {
2302
+ switch (object) {
2303
+ case 0 /* FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED */:
2304
+ return "FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED";
2305
+ case 1 /* FUNCTION_CALL_INPUT_STATUS_PENDING */:
2306
+ return "FUNCTION_CALL_INPUT_STATUS_PENDING";
2307
+ case 2 /* FUNCTION_CALL_INPUT_STATUS_RUNNING */:
2308
+ return "FUNCTION_CALL_INPUT_STATUS_RUNNING";
2309
+ case 3 /* FUNCTION_CALL_INPUT_STATUS_SUCCESS */:
2310
+ return "FUNCTION_CALL_INPUT_STATUS_SUCCESS";
2311
+ case 4 /* FUNCTION_CALL_INPUT_STATUS_FAILURE */:
2312
+ return "FUNCTION_CALL_INPUT_STATUS_FAILURE";
2313
+ case 5 /* FUNCTION_CALL_INPUT_STATUS_TIMEOUT */:
2314
+ return "FUNCTION_CALL_INPUT_STATUS_TIMEOUT";
2315
+ case 6 /* FUNCTION_CALL_INPUT_STATUS_TERMINATED */:
2316
+ return "FUNCTION_CALL_INPUT_STATUS_TERMINATED";
2317
+ case 7 /* FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE */:
2318
+ return "FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE";
2319
+ case 8 /* FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE */:
2320
+ return "FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE";
2321
+ case 9 /* FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT */:
2322
+ return "FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT";
2323
+ case 10 /* FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION */:
2324
+ return "FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION";
2325
+ case -1 /* UNRECOGNIZED */:
2326
+ default:
2327
+ return "UNRECOGNIZED";
2328
+ }
2329
+ }
2260
2330
  function functionCallInvocationTypeFromJSON(object) {
2261
2331
  switch (object) {
2262
2332
  case 0:
@@ -3518,6 +3588,9 @@ function sandboxGetExitSnapshotResponse_ErrorCodeFromJSON(object) {
3518
3588
  case 2:
3519
3589
  case "ERROR_CODE_INTERNAL":
3520
3590
  return 2 /* ERROR_CODE_INTERNAL */;
3591
+ case 3:
3592
+ case "ERROR_CODE_FILESYSTEM_INCONSISTENT":
3593
+ return 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */;
3521
3594
  case -1:
3522
3595
  case "UNRECOGNIZED":
3523
3596
  default:
@@ -3532,6 +3605,8 @@ function sandboxGetExitSnapshotResponse_ErrorCodeToJSON(object) {
3532
3605
  return "ERROR_CODE_TIMEOUT";
3533
3606
  case 2 /* ERROR_CODE_INTERNAL */:
3534
3607
  return "ERROR_CODE_INTERNAL";
3608
+ case 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */:
3609
+ return "ERROR_CODE_FILESYSTEM_INCONSISTENT";
3535
3610
  case -1 /* UNRECOGNIZED */:
3536
3611
  default:
3537
3612
  return "UNRECOGNIZED";
@@ -5416,7 +5491,7 @@ var AppGetInfoResponse = {
5416
5491
  }
5417
5492
  };
5418
5493
  function createBaseAppGetInfoResponse_FunctionInfoSummary() {
5419
- return { gpuConfig: [], schedule: void 0, webFunction: false, requiresProxyAuth: void 0 };
5494
+ return { gpuConfig: [], schedule: void 0, webFunction: false, requiresProxyAuth: void 0, isSessioned: false };
5420
5495
  }
5421
5496
  var AppGetInfoResponse_FunctionInfoSummary = {
5422
5497
  encode(message, writer = new BinaryWriter()) {
@@ -5432,6 +5507,9 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5432
5507
  if (message.requiresProxyAuth !== void 0) {
5433
5508
  writer.uint32(32).bool(message.requiresProxyAuth);
5434
5509
  }
5510
+ if (message.isSessioned !== false) {
5511
+ writer.uint32(40).bool(message.isSessioned);
5512
+ }
5435
5513
  return writer;
5436
5514
  },
5437
5515
  decode(input, length) {
@@ -5469,6 +5547,13 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5469
5547
  message.requiresProxyAuth = reader.bool();
5470
5548
  continue;
5471
5549
  }
5550
+ case 5: {
5551
+ if (tag !== 40) {
5552
+ break;
5553
+ }
5554
+ message.isSessioned = reader.bool();
5555
+ continue;
5556
+ }
5472
5557
  }
5473
5558
  if ((tag & 7) === 4 || tag === 0) {
5474
5559
  break;
@@ -5482,7 +5567,8 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5482
5567
  gpuConfig: globalThis.Array.isArray(object?.gpuConfig) ? object.gpuConfig.map((e) => GPUConfig.fromJSON(e)) : [],
5483
5568
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
5484
5569
  webFunction: isSet5(object.webFunction) ? globalThis.Boolean(object.webFunction) : false,
5485
- requiresProxyAuth: isSet5(object.requiresProxyAuth) ? globalThis.Boolean(object.requiresProxyAuth) : void 0
5570
+ requiresProxyAuth: isSet5(object.requiresProxyAuth) ? globalThis.Boolean(object.requiresProxyAuth) : void 0,
5571
+ isSessioned: isSet5(object.isSessioned) ? globalThis.Boolean(object.isSessioned) : false
5486
5572
  };
5487
5573
  },
5488
5574
  toJSON(message) {
@@ -5499,6 +5585,9 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5499
5585
  if (message.requiresProxyAuth !== void 0) {
5500
5586
  obj.requiresProxyAuth = message.requiresProxyAuth;
5501
5587
  }
5588
+ if (message.isSessioned !== false) {
5589
+ obj.isSessioned = message.isSessioned;
5590
+ }
5502
5591
  return obj;
5503
5592
  },
5504
5593
  create(base) {
@@ -5510,6 +5599,7 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5510
5599
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
5511
5600
  message.webFunction = object.webFunction ?? false;
5512
5601
  message.requiresProxyAuth = object.requiresProxyAuth ?? void 0;
5602
+ message.isSessioned = object.isSessioned ?? false;
5513
5603
  return message;
5514
5604
  }
5515
5605
  };
@@ -17639,7 +17729,8 @@ function createBaseEndpointCreateRequest() {
17639
17729
  inputModalities: [],
17640
17730
  environmentName: "",
17641
17731
  unauthenticated: false,
17642
- servingMode: 0
17732
+ servingMode: 0,
17733
+ sharedEndpointNoticeAcknowledged: false
17643
17734
  };
17644
17735
  }
17645
17736
  var EndpointCreateRequest = {
@@ -17678,6 +17769,9 @@ var EndpointCreateRequest = {
17678
17769
  if (message.servingMode !== 0) {
17679
17770
  writer.uint32(80).int32(message.servingMode);
17680
17771
  }
17772
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
17773
+ writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
17774
+ }
17681
17775
  return writer;
17682
17776
  },
17683
17777
  decode(input, length) {
@@ -17771,6 +17865,13 @@ var EndpointCreateRequest = {
17771
17865
  message.servingMode = reader.int32();
17772
17866
  continue;
17773
17867
  }
17868
+ case 11: {
17869
+ if (tag !== 88) {
17870
+ break;
17871
+ }
17872
+ message.sharedEndpointNoticeAcknowledged = reader.bool();
17873
+ continue;
17874
+ }
17774
17875
  }
17775
17876
  if ((tag & 7) === 4 || tag === 0) {
17776
17877
  break;
@@ -17790,7 +17891,8 @@ var EndpointCreateRequest = {
17790
17891
  inputModalities: globalThis.Array.isArray(object?.inputModalities) ? object.inputModalities.map((e) => endpointInputModalityFromJSON(e)) : [],
17791
17892
  environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
17792
17893
  unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
17793
- servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0
17894
+ servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
17895
+ sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
17794
17896
  };
17795
17897
  },
17796
17898
  toJSON(message) {
@@ -17825,6 +17927,9 @@ var EndpointCreateRequest = {
17825
17927
  if (message.servingMode !== 0) {
17826
17928
  obj.servingMode = endpointServingModeToJSON(message.servingMode);
17827
17929
  }
17930
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
17931
+ obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
17932
+ }
17828
17933
  return obj;
17829
17934
  },
17830
17935
  create(base) {
@@ -17842,6 +17947,7 @@ var EndpointCreateRequest = {
17842
17947
  message.environmentName = object.environmentName ?? "";
17843
17948
  message.unauthenticated = object.unauthenticated ?? false;
17844
17949
  message.servingMode = object.servingMode ?? 0;
17950
+ message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
17845
17951
  return message;
17846
17952
  }
17847
17953
  };
@@ -22400,8 +22506,6 @@ function createBaseFunctionMessage() {
22400
22506
  cloudBucketMounts: [],
22401
22507
  schedulerPlacement: void 0,
22402
22508
  isClass: false,
22403
- useFunctionId: "",
22404
- useMethodName: "",
22405
22509
  classParameterInfo: void 0,
22406
22510
  batchMaxSize: 0,
22407
22511
  batchLingerMs: 0,
@@ -22414,7 +22518,6 @@ function createBaseFunctionMessage() {
22414
22518
  ExperimentalFabricSize: 0,
22415
22519
  untrusted: false,
22416
22520
  ExperimentalBufferContainers: 0,
22417
- ExperimentalProxyIp: void 0,
22418
22521
  runtimePerfRecord: false,
22419
22522
  schedule: void 0,
22420
22523
  snapshotDebug: false,
@@ -22572,12 +22675,6 @@ var FunctionMessage = {
22572
22675
  if (message.isClass !== false) {
22573
22676
  writer.uint32(424).bool(message.isClass);
22574
22677
  }
22575
- if (message.useFunctionId !== "") {
22576
- writer.uint32(434).string(message.useFunctionId);
22577
- }
22578
- if (message.useMethodName !== "") {
22579
- writer.uint32(442).string(message.useMethodName);
22580
- }
22581
22678
  if (message.classParameterInfo !== void 0) {
22582
22679
  ClassParameterInfo.encode(message.classParameterInfo, writer.uint32(450).fork()).join();
22583
22680
  }
@@ -22614,9 +22711,6 @@ var FunctionMessage = {
22614
22711
  if (message.ExperimentalBufferContainers !== 0) {
22615
22712
  writer.uint32(552).uint32(message.ExperimentalBufferContainers);
22616
22713
  }
22617
- if (message.ExperimentalProxyIp !== void 0) {
22618
- writer.uint32(562).string(message.ExperimentalProxyIp);
22619
- }
22620
22714
  if (message.runtimePerfRecord !== false) {
22621
22715
  writer.uint32(568).bool(message.runtimePerfRecord);
22622
22716
  }
@@ -23003,20 +23097,6 @@ var FunctionMessage = {
23003
23097
  message.isClass = reader.bool();
23004
23098
  continue;
23005
23099
  }
23006
- case 54: {
23007
- if (tag !== 434) {
23008
- break;
23009
- }
23010
- message.useFunctionId = reader.string();
23011
- continue;
23012
- }
23013
- case 55: {
23014
- if (tag !== 442) {
23015
- break;
23016
- }
23017
- message.useMethodName = reader.string();
23018
- continue;
23019
- }
23020
23100
  case 56: {
23021
23101
  if (tag !== 450) {
23022
23102
  break;
@@ -23101,13 +23181,6 @@ var FunctionMessage = {
23101
23181
  message.ExperimentalBufferContainers = reader.uint32();
23102
23182
  continue;
23103
23183
  }
23104
- case 70: {
23105
- if (tag !== 562) {
23106
- break;
23107
- }
23108
- message.ExperimentalProxyIp = reader.string();
23109
- continue;
23110
- }
23111
23184
  case 71: {
23112
23185
  if (tag !== 568) {
23113
23186
  break;
@@ -23349,8 +23422,6 @@ var FunctionMessage = {
23349
23422
  cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
23350
23423
  schedulerPlacement: isSet5(object.schedulerPlacement) ? SchedulerPlacement.fromJSON(object.schedulerPlacement) : void 0,
23351
23424
  isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
23352
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
23353
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
23354
23425
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
23355
23426
  batchMaxSize: isSet5(object.batchMaxSize) ? globalThis.Number(object.batchMaxSize) : 0,
23356
23427
  batchLingerMs: isSet5(object.batchLingerMs) ? globalThis.Number(object.batchLingerMs) : 0,
@@ -23363,7 +23434,6 @@ var FunctionMessage = {
23363
23434
  ExperimentalFabricSize: isSet5(object.ExperimentalFabricSize) ? globalThis.Number(object.ExperimentalFabricSize) : 0,
23364
23435
  untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
23365
23436
  ExperimentalBufferContainers: isSet5(object.ExperimentalBufferContainers) ? globalThis.Number(object.ExperimentalBufferContainers) : 0,
23366
- ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
23367
23437
  runtimePerfRecord: isSet5(object.runtimePerfRecord) ? globalThis.Boolean(object.runtimePerfRecord) : false,
23368
23438
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
23369
23439
  snapshotDebug: isSet5(object.snapshotDebug) ? globalThis.Boolean(object.snapshotDebug) : false,
@@ -23527,12 +23597,6 @@ var FunctionMessage = {
23527
23597
  if (message.isClass !== false) {
23528
23598
  obj.isClass = message.isClass;
23529
23599
  }
23530
- if (message.useFunctionId !== "") {
23531
- obj.useFunctionId = message.useFunctionId;
23532
- }
23533
- if (message.useMethodName !== "") {
23534
- obj.useMethodName = message.useMethodName;
23535
- }
23536
23600
  if (message.classParameterInfo !== void 0) {
23537
23601
  obj.classParameterInfo = ClassParameterInfo.toJSON(message.classParameterInfo);
23538
23602
  }
@@ -23569,9 +23633,6 @@ var FunctionMessage = {
23569
23633
  if (message.ExperimentalBufferContainers !== 0) {
23570
23634
  obj.ExperimentalBufferContainers = Math.round(message.ExperimentalBufferContainers);
23571
23635
  }
23572
- if (message.ExperimentalProxyIp !== void 0) {
23573
- obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
23574
- }
23575
23636
  if (message.runtimePerfRecord !== false) {
23576
23637
  obj.runtimePerfRecord = message.runtimePerfRecord;
23577
23638
  }
@@ -23706,8 +23767,6 @@ var FunctionMessage = {
23706
23767
  message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
23707
23768
  message.schedulerPlacement = object.schedulerPlacement !== void 0 && object.schedulerPlacement !== null ? SchedulerPlacement.fromPartial(object.schedulerPlacement) : void 0;
23708
23769
  message.isClass = object.isClass ?? false;
23709
- message.useFunctionId = object.useFunctionId ?? "";
23710
- message.useMethodName = object.useMethodName ?? "";
23711
23770
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
23712
23771
  message.batchMaxSize = object.batchMaxSize ?? 0;
23713
23772
  message.batchLingerMs = object.batchLingerMs ?? 0;
@@ -23720,7 +23779,6 @@ var FunctionMessage = {
23720
23779
  message.ExperimentalFabricSize = object.ExperimentalFabricSize ?? 0;
23721
23780
  message.untrusted = object.untrusted ?? false;
23722
23781
  message.ExperimentalBufferContainers = object.ExperimentalBufferContainers ?? 0;
23723
- message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
23724
23782
  message.runtimePerfRecord = object.runtimePerfRecord ?? false;
23725
23783
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
23726
23784
  message.snapshotDebug = object.snapshotDebug ?? false;
@@ -24416,6 +24474,193 @@ var FunctionCallCancelRequest = {
24416
24474
  return message;
24417
24475
  }
24418
24476
  };
24477
+ function createBaseFunctionCallFetchRequest() {
24478
+ return { functionId: "", tail: void 0, allVariants: false };
24479
+ }
24480
+ var FunctionCallFetchRequest = {
24481
+ encode(message, writer = new BinaryWriter()) {
24482
+ if (message.functionId !== "") {
24483
+ writer.uint32(10).string(message.functionId);
24484
+ }
24485
+ if (message.tail !== void 0) {
24486
+ FunctionCallFetchRequest_Tail.encode(message.tail, writer.uint32(26).fork()).join();
24487
+ }
24488
+ if (message.allVariants !== false) {
24489
+ writer.uint32(32).bool(message.allVariants);
24490
+ }
24491
+ return writer;
24492
+ },
24493
+ decode(input, length) {
24494
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24495
+ let end = length === void 0 ? reader.len : reader.pos + length;
24496
+ const message = createBaseFunctionCallFetchRequest();
24497
+ while (reader.pos < end) {
24498
+ const tag = reader.uint32();
24499
+ switch (tag >>> 3) {
24500
+ case 1: {
24501
+ if (tag !== 10) {
24502
+ break;
24503
+ }
24504
+ message.functionId = reader.string();
24505
+ continue;
24506
+ }
24507
+ case 3: {
24508
+ if (tag !== 26) {
24509
+ break;
24510
+ }
24511
+ message.tail = FunctionCallFetchRequest_Tail.decode(reader, reader.uint32());
24512
+ continue;
24513
+ }
24514
+ case 4: {
24515
+ if (tag !== 32) {
24516
+ break;
24517
+ }
24518
+ message.allVariants = reader.bool();
24519
+ continue;
24520
+ }
24521
+ }
24522
+ if ((tag & 7) === 4 || tag === 0) {
24523
+ break;
24524
+ }
24525
+ reader.skip(tag & 7);
24526
+ }
24527
+ return message;
24528
+ },
24529
+ fromJSON(object) {
24530
+ return {
24531
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
24532
+ tail: isSet5(object.tail) ? FunctionCallFetchRequest_Tail.fromJSON(object.tail) : void 0,
24533
+ allVariants: isSet5(object.allVariants) ? globalThis.Boolean(object.allVariants) : false
24534
+ };
24535
+ },
24536
+ toJSON(message) {
24537
+ const obj = {};
24538
+ if (message.functionId !== "") {
24539
+ obj.functionId = message.functionId;
24540
+ }
24541
+ if (message.tail !== void 0) {
24542
+ obj.tail = FunctionCallFetchRequest_Tail.toJSON(message.tail);
24543
+ }
24544
+ if (message.allVariants !== false) {
24545
+ obj.allVariants = message.allVariants;
24546
+ }
24547
+ return obj;
24548
+ },
24549
+ create(base) {
24550
+ return FunctionCallFetchRequest.fromPartial(base ?? {});
24551
+ },
24552
+ fromPartial(object) {
24553
+ const message = createBaseFunctionCallFetchRequest();
24554
+ message.functionId = object.functionId ?? "";
24555
+ message.tail = object.tail !== void 0 && object.tail !== null ? FunctionCallFetchRequest_Tail.fromPartial(object.tail) : void 0;
24556
+ message.allVariants = object.allVariants ?? false;
24557
+ return message;
24558
+ }
24559
+ };
24560
+ function createBaseFunctionCallFetchRequest_Tail() {
24561
+ return { count: 0 };
24562
+ }
24563
+ var FunctionCallFetchRequest_Tail = {
24564
+ encode(message, writer = new BinaryWriter()) {
24565
+ if (message.count !== 0) {
24566
+ writer.uint32(8).uint32(message.count);
24567
+ }
24568
+ return writer;
24569
+ },
24570
+ decode(input, length) {
24571
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24572
+ let end = length === void 0 ? reader.len : reader.pos + length;
24573
+ const message = createBaseFunctionCallFetchRequest_Tail();
24574
+ while (reader.pos < end) {
24575
+ const tag = reader.uint32();
24576
+ switch (tag >>> 3) {
24577
+ case 1: {
24578
+ if (tag !== 8) {
24579
+ break;
24580
+ }
24581
+ message.count = reader.uint32();
24582
+ continue;
24583
+ }
24584
+ }
24585
+ if ((tag & 7) === 4 || tag === 0) {
24586
+ break;
24587
+ }
24588
+ reader.skip(tag & 7);
24589
+ }
24590
+ return message;
24591
+ },
24592
+ fromJSON(object) {
24593
+ return { count: isSet5(object.count) ? globalThis.Number(object.count) : 0 };
24594
+ },
24595
+ toJSON(message) {
24596
+ const obj = {};
24597
+ if (message.count !== 0) {
24598
+ obj.count = Math.round(message.count);
24599
+ }
24600
+ return obj;
24601
+ },
24602
+ create(base) {
24603
+ return FunctionCallFetchRequest_Tail.fromPartial(base ?? {});
24604
+ },
24605
+ fromPartial(object) {
24606
+ const message = createBaseFunctionCallFetchRequest_Tail();
24607
+ message.count = object.count ?? 0;
24608
+ return message;
24609
+ }
24610
+ };
24611
+ function createBaseFunctionCallFetchResponse() {
24612
+ return { functionCallInputs: [] };
24613
+ }
24614
+ var FunctionCallFetchResponse = {
24615
+ encode(message, writer = new BinaryWriter()) {
24616
+ for (const v of message.functionCallInputs) {
24617
+ FunctionCallInputInfo.encode(v, writer.uint32(10).fork()).join();
24618
+ }
24619
+ return writer;
24620
+ },
24621
+ decode(input, length) {
24622
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24623
+ let end = length === void 0 ? reader.len : reader.pos + length;
24624
+ const message = createBaseFunctionCallFetchResponse();
24625
+ while (reader.pos < end) {
24626
+ const tag = reader.uint32();
24627
+ switch (tag >>> 3) {
24628
+ case 1: {
24629
+ if (tag !== 10) {
24630
+ break;
24631
+ }
24632
+ message.functionCallInputs.push(FunctionCallInputInfo.decode(reader, reader.uint32()));
24633
+ continue;
24634
+ }
24635
+ }
24636
+ if ((tag & 7) === 4 || tag === 0) {
24637
+ break;
24638
+ }
24639
+ reader.skip(tag & 7);
24640
+ }
24641
+ return message;
24642
+ },
24643
+ fromJSON(object) {
24644
+ return {
24645
+ functionCallInputs: globalThis.Array.isArray(object?.functionCallInputs) ? object.functionCallInputs.map((e) => FunctionCallInputInfo.fromJSON(e)) : []
24646
+ };
24647
+ },
24648
+ toJSON(message) {
24649
+ const obj = {};
24650
+ if (message.functionCallInputs?.length) {
24651
+ obj.functionCallInputs = message.functionCallInputs.map((e) => FunctionCallInputInfo.toJSON(e));
24652
+ }
24653
+ return obj;
24654
+ },
24655
+ create(base) {
24656
+ return FunctionCallFetchResponse.fromPartial(base ?? {});
24657
+ },
24658
+ fromPartial(object) {
24659
+ const message = createBaseFunctionCallFetchResponse();
24660
+ message.functionCallInputs = object.functionCallInputs?.map((e) => FunctionCallInputInfo.fromPartial(e)) || [];
24661
+ return message;
24662
+ }
24663
+ };
24419
24664
  function createBaseFunctionCallFromIdRequest() {
24420
24665
  return { functionCallId: "" };
24421
24666
  }
@@ -25019,6 +25264,173 @@ var FunctionCallInfo = {
25019
25264
  return message;
25020
25265
  }
25021
25266
  };
25267
+ function createBaseFunctionCallInputInfo() {
25268
+ return {
25269
+ enqueuedAt: void 0,
25270
+ startedAt: void 0,
25271
+ containerId: void 0,
25272
+ startupTimeSeconds: void 0,
25273
+ executionTimeSeconds: void 0,
25274
+ status: 0,
25275
+ functionCallId: "",
25276
+ serviceMethodName: void 0
25277
+ };
25278
+ }
25279
+ var FunctionCallInputInfo = {
25280
+ encode(message, writer = new BinaryWriter()) {
25281
+ if (message.enqueuedAt !== void 0) {
25282
+ Timestamp.encode(toTimestamp(message.enqueuedAt), writer.uint32(10).fork()).join();
25283
+ }
25284
+ if (message.startedAt !== void 0) {
25285
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(18).fork()).join();
25286
+ }
25287
+ if (message.containerId !== void 0) {
25288
+ writer.uint32(26).string(message.containerId);
25289
+ }
25290
+ if (message.startupTimeSeconds !== void 0) {
25291
+ writer.uint32(33).double(message.startupTimeSeconds);
25292
+ }
25293
+ if (message.executionTimeSeconds !== void 0) {
25294
+ writer.uint32(41).double(message.executionTimeSeconds);
25295
+ }
25296
+ if (message.status !== 0) {
25297
+ writer.uint32(48).int32(message.status);
25298
+ }
25299
+ if (message.functionCallId !== "") {
25300
+ writer.uint32(58).string(message.functionCallId);
25301
+ }
25302
+ if (message.serviceMethodName !== void 0) {
25303
+ writer.uint32(66).string(message.serviceMethodName);
25304
+ }
25305
+ return writer;
25306
+ },
25307
+ decode(input, length) {
25308
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25309
+ let end = length === void 0 ? reader.len : reader.pos + length;
25310
+ const message = createBaseFunctionCallInputInfo();
25311
+ while (reader.pos < end) {
25312
+ const tag = reader.uint32();
25313
+ switch (tag >>> 3) {
25314
+ case 1: {
25315
+ if (tag !== 10) {
25316
+ break;
25317
+ }
25318
+ message.enqueuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
25319
+ continue;
25320
+ }
25321
+ case 2: {
25322
+ if (tag !== 18) {
25323
+ break;
25324
+ }
25325
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
25326
+ continue;
25327
+ }
25328
+ case 3: {
25329
+ if (tag !== 26) {
25330
+ break;
25331
+ }
25332
+ message.containerId = reader.string();
25333
+ continue;
25334
+ }
25335
+ case 4: {
25336
+ if (tag !== 33) {
25337
+ break;
25338
+ }
25339
+ message.startupTimeSeconds = reader.double();
25340
+ continue;
25341
+ }
25342
+ case 5: {
25343
+ if (tag !== 41) {
25344
+ break;
25345
+ }
25346
+ message.executionTimeSeconds = reader.double();
25347
+ continue;
25348
+ }
25349
+ case 6: {
25350
+ if (tag !== 48) {
25351
+ break;
25352
+ }
25353
+ message.status = reader.int32();
25354
+ continue;
25355
+ }
25356
+ case 7: {
25357
+ if (tag !== 58) {
25358
+ break;
25359
+ }
25360
+ message.functionCallId = reader.string();
25361
+ continue;
25362
+ }
25363
+ case 8: {
25364
+ if (tag !== 66) {
25365
+ break;
25366
+ }
25367
+ message.serviceMethodName = reader.string();
25368
+ continue;
25369
+ }
25370
+ }
25371
+ if ((tag & 7) === 4 || tag === 0) {
25372
+ break;
25373
+ }
25374
+ reader.skip(tag & 7);
25375
+ }
25376
+ return message;
25377
+ },
25378
+ fromJSON(object) {
25379
+ return {
25380
+ enqueuedAt: isSet5(object.enqueuedAt) ? fromJsonTimestamp(object.enqueuedAt) : void 0,
25381
+ startedAt: isSet5(object.startedAt) ? fromJsonTimestamp(object.startedAt) : void 0,
25382
+ containerId: isSet5(object.containerId) ? globalThis.String(object.containerId) : void 0,
25383
+ startupTimeSeconds: isSet5(object.startupTimeSeconds) ? globalThis.Number(object.startupTimeSeconds) : void 0,
25384
+ executionTimeSeconds: isSet5(object.executionTimeSeconds) ? globalThis.Number(object.executionTimeSeconds) : void 0,
25385
+ status: isSet5(object.status) ? functionCallInputStatusFromJSON(object.status) : 0,
25386
+ functionCallId: isSet5(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
25387
+ serviceMethodName: isSet5(object.serviceMethodName) ? globalThis.String(object.serviceMethodName) : void 0
25388
+ };
25389
+ },
25390
+ toJSON(message) {
25391
+ const obj = {};
25392
+ if (message.enqueuedAt !== void 0) {
25393
+ obj.enqueuedAt = message.enqueuedAt.toISOString();
25394
+ }
25395
+ if (message.startedAt !== void 0) {
25396
+ obj.startedAt = message.startedAt.toISOString();
25397
+ }
25398
+ if (message.containerId !== void 0) {
25399
+ obj.containerId = message.containerId;
25400
+ }
25401
+ if (message.startupTimeSeconds !== void 0) {
25402
+ obj.startupTimeSeconds = message.startupTimeSeconds;
25403
+ }
25404
+ if (message.executionTimeSeconds !== void 0) {
25405
+ obj.executionTimeSeconds = message.executionTimeSeconds;
25406
+ }
25407
+ if (message.status !== 0) {
25408
+ obj.status = functionCallInputStatusToJSON(message.status);
25409
+ }
25410
+ if (message.functionCallId !== "") {
25411
+ obj.functionCallId = message.functionCallId;
25412
+ }
25413
+ if (message.serviceMethodName !== void 0) {
25414
+ obj.serviceMethodName = message.serviceMethodName;
25415
+ }
25416
+ return obj;
25417
+ },
25418
+ create(base) {
25419
+ return FunctionCallInputInfo.fromPartial(base ?? {});
25420
+ },
25421
+ fromPartial(object) {
25422
+ const message = createBaseFunctionCallInputInfo();
25423
+ message.enqueuedAt = object.enqueuedAt ?? void 0;
25424
+ message.startedAt = object.startedAt ?? void 0;
25425
+ message.containerId = object.containerId ?? void 0;
25426
+ message.startupTimeSeconds = object.startupTimeSeconds ?? void 0;
25427
+ message.executionTimeSeconds = object.executionTimeSeconds ?? void 0;
25428
+ message.status = object.status ?? 0;
25429
+ message.functionCallId = object.functionCallId ?? "";
25430
+ message.serviceMethodName = object.serviceMethodName ?? void 0;
25431
+ return message;
25432
+ }
25433
+ };
25022
25434
  function createBaseFunctionCallListRequest() {
25023
25435
  return { functionId: "" };
25024
25436
  }
@@ -25473,14 +25885,11 @@ function createBaseFunctionData() {
25473
25885
  webUrlInfo: void 0,
25474
25886
  webhookConfig: void 0,
25475
25887
  customDomainInfo: [],
25476
- ExperimentalProxyIp: void 0,
25477
25888
  methodDefinitions: {},
25478
25889
  methodDefinitionsSet: false,
25479
25890
  isClass: false,
25480
25891
  classParameterInfo: void 0,
25481
25892
  isMethod: false,
25482
- useFunctionId: "",
25483
- useMethodName: "",
25484
25893
  rankedFunctions: [],
25485
25894
  schedule: void 0,
25486
25895
  untrusted: false,
@@ -25554,9 +25963,6 @@ var FunctionData = {
25554
25963
  for (const v of message.customDomainInfo) {
25555
25964
  CustomDomainInfo.encode(v, writer.uint32(98).fork()).join();
25556
25965
  }
25557
- if (message.ExperimentalProxyIp !== void 0) {
25558
- writer.uint32(194).string(message.ExperimentalProxyIp);
25559
- }
25560
25966
  Object.entries(message.methodDefinitions).forEach(([key, value]) => {
25561
25967
  FunctionData_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(202).fork()).join();
25562
25968
  });
@@ -25572,12 +25978,6 @@ var FunctionData = {
25572
25978
  if (message.isMethod !== false) {
25573
25979
  writer.uint32(120).bool(message.isMethod);
25574
25980
  }
25575
- if (message.useFunctionId !== "") {
25576
- writer.uint32(130).string(message.useFunctionId);
25577
- }
25578
- if (message.useMethodName !== "") {
25579
- writer.uint32(138).string(message.useMethodName);
25580
- }
25581
25981
  for (const v of message.rankedFunctions) {
25582
25982
  FunctionData_RankedFunction.encode(v, writer.uint32(146).fork()).join();
25583
25983
  }
@@ -25764,13 +26164,6 @@ var FunctionData = {
25764
26164
  message.customDomainInfo.push(CustomDomainInfo.decode(reader, reader.uint32()));
25765
26165
  continue;
25766
26166
  }
25767
- case 24: {
25768
- if (tag !== 194) {
25769
- break;
25770
- }
25771
- message.ExperimentalProxyIp = reader.string();
25772
- continue;
25773
- }
25774
26167
  case 25: {
25775
26168
  if (tag !== 202) {
25776
26169
  break;
@@ -25809,20 +26202,6 @@ var FunctionData = {
25809
26202
  message.isMethod = reader.bool();
25810
26203
  continue;
25811
26204
  }
25812
- case 16: {
25813
- if (tag !== 130) {
25814
- break;
25815
- }
25816
- message.useFunctionId = reader.string();
25817
- continue;
25818
- }
25819
- case 17: {
25820
- if (tag !== 138) {
25821
- break;
25822
- }
25823
- message.useMethodName = reader.string();
25824
- continue;
25825
- }
25826
26205
  case 18: {
25827
26206
  if (tag !== 146) {
25828
26207
  break;
@@ -25993,7 +26372,6 @@ var FunctionData = {
25993
26372
  webUrlInfo: isSet5(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
25994
26373
  webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
25995
26374
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
25996
- ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
25997
26375
  methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
25998
26376
  acc[key] = MethodDefinition.fromJSON(value);
25999
26377
  return acc;
@@ -26002,8 +26380,6 @@ var FunctionData = {
26002
26380
  isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
26003
26381
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
26004
26382
  isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
26005
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
26006
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
26007
26383
  rankedFunctions: globalThis.Array.isArray(object?.rankedFunctions) ? object.rankedFunctions.map((e) => FunctionData_RankedFunction.fromJSON(e)) : [],
26008
26384
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
26009
26385
  untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
@@ -26080,9 +26456,6 @@ var FunctionData = {
26080
26456
  if (message.customDomainInfo?.length) {
26081
26457
  obj.customDomainInfo = message.customDomainInfo.map((e) => CustomDomainInfo.toJSON(e));
26082
26458
  }
26083
- if (message.ExperimentalProxyIp !== void 0) {
26084
- obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
26085
- }
26086
26459
  if (message.methodDefinitions) {
26087
26460
  const entries = Object.entries(message.methodDefinitions);
26088
26461
  if (entries.length > 0) {
@@ -26104,12 +26477,6 @@ var FunctionData = {
26104
26477
  if (message.isMethod !== false) {
26105
26478
  obj.isMethod = message.isMethod;
26106
26479
  }
26107
- if (message.useFunctionId !== "") {
26108
- obj.useFunctionId = message.useFunctionId;
26109
- }
26110
- if (message.useMethodName !== "") {
26111
- obj.useMethodName = message.useMethodName;
26112
- }
26113
26480
  if (message.rankedFunctions?.length) {
26114
26481
  obj.rankedFunctions = message.rankedFunctions.map((e) => FunctionData_RankedFunction.toJSON(e));
26115
26482
  }
@@ -26194,7 +26561,6 @@ var FunctionData = {
26194
26561
  message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
26195
26562
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
26196
26563
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
26197
- message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
26198
26564
  message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
26199
26565
  if (value !== void 0) {
26200
26566
  acc[key] = MethodDefinition.fromPartial(value);
@@ -26205,8 +26571,6 @@ var FunctionData = {
26205
26571
  message.isClass = object.isClass ?? false;
26206
26572
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
26207
26573
  message.isMethod = object.isMethod ?? false;
26208
- message.useFunctionId = object.useFunctionId ?? "";
26209
- message.useMethodName = object.useMethodName ?? "";
26210
26574
  message.rankedFunctions = object.rankedFunctions?.map((e) => FunctionData_RankedFunction.fromPartial(e)) || [];
26211
26575
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
26212
26576
  message.untrusted = object.untrusted ?? false;
@@ -28839,7 +29203,6 @@ function createBaseFunctionHandleMetadata() {
28839
29203
  functionType: 0,
28840
29204
  webUrl: "",
28841
29205
  isMethod: false,
28842
- useFunctionId: "",
28843
29206
  useMethodName: "",
28844
29207
  definitionId: "",
28845
29208
  classParameterInfo: void 0,
@@ -28870,9 +29233,6 @@ var FunctionHandleMetadata = {
28870
29233
  if (message.isMethod !== false) {
28871
29234
  writer.uint32(312).bool(message.isMethod);
28872
29235
  }
28873
- if (message.useFunctionId !== "") {
28874
- writer.uint32(322).string(message.useFunctionId);
28875
- }
28876
29236
  if (message.useMethodName !== "") {
28877
29237
  writer.uint32(330).string(message.useMethodName);
28878
29238
  }
@@ -28956,13 +29316,6 @@ var FunctionHandleMetadata = {
28956
29316
  message.isMethod = reader.bool();
28957
29317
  continue;
28958
29318
  }
28959
- case 40: {
28960
- if (tag !== 322) {
28961
- break;
28962
- }
28963
- message.useFunctionId = reader.string();
28964
- continue;
28965
- }
28966
29319
  case 41: {
28967
29320
  if (tag !== 330) {
28968
29321
  break;
@@ -29092,7 +29445,6 @@ var FunctionHandleMetadata = {
29092
29445
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
29093
29446
  webUrl: isSet5(object.webUrl) ? globalThis.String(object.webUrl) : "",
29094
29447
  isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
29095
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
29096
29448
  useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
29097
29449
  definitionId: isSet5(object.definitionId) ? globalThis.String(object.definitionId) : "",
29098
29450
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
@@ -29129,9 +29481,6 @@ var FunctionHandleMetadata = {
29129
29481
  if (message.isMethod !== false) {
29130
29482
  obj.isMethod = message.isMethod;
29131
29483
  }
29132
- if (message.useFunctionId !== "") {
29133
- obj.useFunctionId = message.useFunctionId;
29134
- }
29135
29484
  if (message.useMethodName !== "") {
29136
29485
  obj.useMethodName = message.useMethodName;
29137
29486
  }
@@ -29191,7 +29540,6 @@ var FunctionHandleMetadata = {
29191
29540
  message.functionType = object.functionType ?? 0;
29192
29541
  message.webUrl = object.webUrl ?? "";
29193
29542
  message.isMethod = object.isMethod ?? false;
29194
- message.useFunctionId = object.useFunctionId ?? "";
29195
29543
  message.useMethodName = object.useMethodName ?? "";
29196
29544
  message.definitionId = object.definitionId ?? "";
29197
29545
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
@@ -29395,6 +29743,172 @@ var FunctionInput = {
29395
29743
  return message;
29396
29744
  }
29397
29745
  };
29746
+ function createBaseFunctionListVariantsRequest() {
29747
+ return { functionId: "", cursor: void 0, limit: 0 };
29748
+ }
29749
+ var FunctionListVariantsRequest = {
29750
+ encode(message, writer = new BinaryWriter()) {
29751
+ if (message.functionId !== "") {
29752
+ writer.uint32(10).string(message.functionId);
29753
+ }
29754
+ if (message.cursor !== void 0) {
29755
+ FunctionVariantCursor.encode(message.cursor, writer.uint32(18).fork()).join();
29756
+ }
29757
+ if (message.limit !== 0) {
29758
+ writer.uint32(24).uint32(message.limit);
29759
+ }
29760
+ return writer;
29761
+ },
29762
+ decode(input, length) {
29763
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29764
+ let end = length === void 0 ? reader.len : reader.pos + length;
29765
+ const message = createBaseFunctionListVariantsRequest();
29766
+ while (reader.pos < end) {
29767
+ const tag = reader.uint32();
29768
+ switch (tag >>> 3) {
29769
+ case 1: {
29770
+ if (tag !== 10) {
29771
+ break;
29772
+ }
29773
+ message.functionId = reader.string();
29774
+ continue;
29775
+ }
29776
+ case 2: {
29777
+ if (tag !== 18) {
29778
+ break;
29779
+ }
29780
+ message.cursor = FunctionVariantCursor.decode(reader, reader.uint32());
29781
+ continue;
29782
+ }
29783
+ case 3: {
29784
+ if (tag !== 24) {
29785
+ break;
29786
+ }
29787
+ message.limit = reader.uint32();
29788
+ continue;
29789
+ }
29790
+ }
29791
+ if ((tag & 7) === 4 || tag === 0) {
29792
+ break;
29793
+ }
29794
+ reader.skip(tag & 7);
29795
+ }
29796
+ return message;
29797
+ },
29798
+ fromJSON(object) {
29799
+ return {
29800
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
29801
+ cursor: isSet5(object.cursor) ? FunctionVariantCursor.fromJSON(object.cursor) : void 0,
29802
+ limit: isSet5(object.limit) ? globalThis.Number(object.limit) : 0
29803
+ };
29804
+ },
29805
+ toJSON(message) {
29806
+ const obj = {};
29807
+ if (message.functionId !== "") {
29808
+ obj.functionId = message.functionId;
29809
+ }
29810
+ if (message.cursor !== void 0) {
29811
+ obj.cursor = FunctionVariantCursor.toJSON(message.cursor);
29812
+ }
29813
+ if (message.limit !== 0) {
29814
+ obj.limit = Math.round(message.limit);
29815
+ }
29816
+ return obj;
29817
+ },
29818
+ create(base) {
29819
+ return FunctionListVariantsRequest.fromPartial(base ?? {});
29820
+ },
29821
+ fromPartial(object) {
29822
+ const message = createBaseFunctionListVariantsRequest();
29823
+ message.functionId = object.functionId ?? "";
29824
+ message.cursor = object.cursor !== void 0 && object.cursor !== null ? FunctionVariantCursor.fromPartial(object.cursor) : void 0;
29825
+ message.limit = object.limit ?? 0;
29826
+ return message;
29827
+ }
29828
+ };
29829
+ function createBaseFunctionListVariantsResponse() {
29830
+ return { infos: [], nextCursor: void 0, orderedByTaskCount: false };
29831
+ }
29832
+ var FunctionListVariantsResponse = {
29833
+ encode(message, writer = new BinaryWriter()) {
29834
+ for (const v of message.infos) {
29835
+ FunctionVariantInfo.encode(v, writer.uint32(10).fork()).join();
29836
+ }
29837
+ if (message.nextCursor !== void 0) {
29838
+ FunctionVariantCursor.encode(message.nextCursor, writer.uint32(18).fork()).join();
29839
+ }
29840
+ if (message.orderedByTaskCount !== false) {
29841
+ writer.uint32(24).bool(message.orderedByTaskCount);
29842
+ }
29843
+ return writer;
29844
+ },
29845
+ decode(input, length) {
29846
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29847
+ let end = length === void 0 ? reader.len : reader.pos + length;
29848
+ const message = createBaseFunctionListVariantsResponse();
29849
+ while (reader.pos < end) {
29850
+ const tag = reader.uint32();
29851
+ switch (tag >>> 3) {
29852
+ case 1: {
29853
+ if (tag !== 10) {
29854
+ break;
29855
+ }
29856
+ message.infos.push(FunctionVariantInfo.decode(reader, reader.uint32()));
29857
+ continue;
29858
+ }
29859
+ case 2: {
29860
+ if (tag !== 18) {
29861
+ break;
29862
+ }
29863
+ message.nextCursor = FunctionVariantCursor.decode(reader, reader.uint32());
29864
+ continue;
29865
+ }
29866
+ case 3: {
29867
+ if (tag !== 24) {
29868
+ break;
29869
+ }
29870
+ message.orderedByTaskCount = reader.bool();
29871
+ continue;
29872
+ }
29873
+ }
29874
+ if ((tag & 7) === 4 || tag === 0) {
29875
+ break;
29876
+ }
29877
+ reader.skip(tag & 7);
29878
+ }
29879
+ return message;
29880
+ },
29881
+ fromJSON(object) {
29882
+ return {
29883
+ infos: globalThis.Array.isArray(object?.infos) ? object.infos.map((e) => FunctionVariantInfo.fromJSON(e)) : [],
29884
+ nextCursor: isSet5(object.nextCursor) ? FunctionVariantCursor.fromJSON(object.nextCursor) : void 0,
29885
+ orderedByTaskCount: isSet5(object.orderedByTaskCount) ? globalThis.Boolean(object.orderedByTaskCount) : false
29886
+ };
29887
+ },
29888
+ toJSON(message) {
29889
+ const obj = {};
29890
+ if (message.infos?.length) {
29891
+ obj.infos = message.infos.map((e) => FunctionVariantInfo.toJSON(e));
29892
+ }
29893
+ if (message.nextCursor !== void 0) {
29894
+ obj.nextCursor = FunctionVariantCursor.toJSON(message.nextCursor);
29895
+ }
29896
+ if (message.orderedByTaskCount !== false) {
29897
+ obj.orderedByTaskCount = message.orderedByTaskCount;
29898
+ }
29899
+ return obj;
29900
+ },
29901
+ create(base) {
29902
+ return FunctionListVariantsResponse.fromPartial(base ?? {});
29903
+ },
29904
+ fromPartial(object) {
29905
+ const message = createBaseFunctionListVariantsResponse();
29906
+ message.infos = object.infos?.map((e) => FunctionVariantInfo.fromPartial(e)) || [];
29907
+ message.nextCursor = object.nextCursor !== void 0 && object.nextCursor !== null ? FunctionVariantCursor.fromPartial(object.nextCursor) : void 0;
29908
+ message.orderedByTaskCount = object.orderedByTaskCount ?? false;
29909
+ return message;
29910
+ }
29911
+ };
29398
29912
  function createBaseFunctionMapRequest() {
29399
29913
  return {
29400
29914
  functionId: "",
@@ -30079,8 +30593,6 @@ function createBaseFunctionPrecreateRequest() {
30079
30593
  existingFunctionId: "",
30080
30594
  functionType: 0,
30081
30595
  webhookConfig: void 0,
30082
- useFunctionId: "",
30083
- useMethodName: "",
30084
30596
  methodDefinitions: {},
30085
30597
  functionSchema: void 0,
30086
30598
  supportedInputFormats: [],
@@ -30104,12 +30616,6 @@ var FunctionPrecreateRequest = {
30104
30616
  if (message.webhookConfig !== void 0) {
30105
30617
  WebhookConfig.encode(message.webhookConfig, writer.uint32(42).fork()).join();
30106
30618
  }
30107
- if (message.useFunctionId !== "") {
30108
- writer.uint32(50).string(message.useFunctionId);
30109
- }
30110
- if (message.useMethodName !== "") {
30111
- writer.uint32(58).string(message.useMethodName);
30112
- }
30113
30619
  Object.entries(message.methodDefinitions).forEach(([key, value]) => {
30114
30620
  FunctionPrecreateRequest_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(66).fork()).join();
30115
30621
  });
@@ -30170,20 +30676,6 @@ var FunctionPrecreateRequest = {
30170
30676
  message.webhookConfig = WebhookConfig.decode(reader, reader.uint32());
30171
30677
  continue;
30172
30678
  }
30173
- case 6: {
30174
- if (tag !== 50) {
30175
- break;
30176
- }
30177
- message.useFunctionId = reader.string();
30178
- continue;
30179
- }
30180
- case 7: {
30181
- if (tag !== 58) {
30182
- break;
30183
- }
30184
- message.useMethodName = reader.string();
30185
- continue;
30186
- }
30187
30679
  case 8: {
30188
30680
  if (tag !== 66) {
30189
30681
  break;
@@ -30244,8 +30736,6 @@ var FunctionPrecreateRequest = {
30244
30736
  existingFunctionId: isSet5(object.existingFunctionId) ? globalThis.String(object.existingFunctionId) : "",
30245
30737
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
30246
30738
  webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
30247
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
30248
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
30249
30739
  methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
30250
30740
  acc[key] = MethodDefinition.fromJSON(value);
30251
30741
  return acc;
@@ -30272,12 +30762,6 @@ var FunctionPrecreateRequest = {
30272
30762
  if (message.webhookConfig !== void 0) {
30273
30763
  obj.webhookConfig = WebhookConfig.toJSON(message.webhookConfig);
30274
30764
  }
30275
- if (message.useFunctionId !== "") {
30276
- obj.useFunctionId = message.useFunctionId;
30277
- }
30278
- if (message.useMethodName !== "") {
30279
- obj.useMethodName = message.useMethodName;
30280
- }
30281
30765
  if (message.methodDefinitions) {
30282
30766
  const entries = Object.entries(message.methodDefinitions);
30283
30767
  if (entries.length > 0) {
@@ -30308,8 +30792,6 @@ var FunctionPrecreateRequest = {
30308
30792
  message.existingFunctionId = object.existingFunctionId ?? "";
30309
30793
  message.functionType = object.functionType ?? 0;
30310
30794
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
30311
- message.useFunctionId = object.useFunctionId ?? "";
30312
- message.useMethodName = object.useMethodName ?? "";
30313
30795
  message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
30314
30796
  if (value !== void 0) {
30315
30797
  acc[key] = MethodDefinition.fromPartial(value);
@@ -31660,6 +32142,157 @@ var FunctionUpdateSchedulingParamsResponse = {
31660
32142
  return message;
31661
32143
  }
31662
32144
  };
32145
+ function createBaseFunctionVariantCursor() {
32146
+ return { createdBefore: 0, functionId: "" };
32147
+ }
32148
+ var FunctionVariantCursor = {
32149
+ encode(message, writer = new BinaryWriter()) {
32150
+ if (message.createdBefore !== 0) {
32151
+ writer.uint32(9).double(message.createdBefore);
32152
+ }
32153
+ if (message.functionId !== "") {
32154
+ writer.uint32(18).string(message.functionId);
32155
+ }
32156
+ return writer;
32157
+ },
32158
+ decode(input, length) {
32159
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32160
+ let end = length === void 0 ? reader.len : reader.pos + length;
32161
+ const message = createBaseFunctionVariantCursor();
32162
+ while (reader.pos < end) {
32163
+ const tag = reader.uint32();
32164
+ switch (tag >>> 3) {
32165
+ case 1: {
32166
+ if (tag !== 9) {
32167
+ break;
32168
+ }
32169
+ message.createdBefore = reader.double();
32170
+ continue;
32171
+ }
32172
+ case 2: {
32173
+ if (tag !== 18) {
32174
+ break;
32175
+ }
32176
+ message.functionId = reader.string();
32177
+ continue;
32178
+ }
32179
+ }
32180
+ if ((tag & 7) === 4 || tag === 0) {
32181
+ break;
32182
+ }
32183
+ reader.skip(tag & 7);
32184
+ }
32185
+ return message;
32186
+ },
32187
+ fromJSON(object) {
32188
+ return {
32189
+ createdBefore: isSet5(object.createdBefore) ? globalThis.Number(object.createdBefore) : 0,
32190
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
32191
+ };
32192
+ },
32193
+ toJSON(message) {
32194
+ const obj = {};
32195
+ if (message.createdBefore !== 0) {
32196
+ obj.createdBefore = message.createdBefore;
32197
+ }
32198
+ if (message.functionId !== "") {
32199
+ obj.functionId = message.functionId;
32200
+ }
32201
+ return obj;
32202
+ },
32203
+ create(base) {
32204
+ return FunctionVariantCursor.fromPartial(base ?? {});
32205
+ },
32206
+ fromPartial(object) {
32207
+ const message = createBaseFunctionVariantCursor();
32208
+ message.createdBefore = object.createdBefore ?? 0;
32209
+ message.functionId = object.functionId ?? "";
32210
+ return message;
32211
+ }
32212
+ };
32213
+ function createBaseFunctionVariantInfo() {
32214
+ return { functionId: "", serializedParams: new Uint8Array(0), functionOptions: void 0 };
32215
+ }
32216
+ var FunctionVariantInfo = {
32217
+ encode(message, writer = new BinaryWriter()) {
32218
+ if (message.functionId !== "") {
32219
+ writer.uint32(10).string(message.functionId);
32220
+ }
32221
+ if (message.serializedParams.length !== 0) {
32222
+ writer.uint32(18).bytes(message.serializedParams);
32223
+ }
32224
+ if (message.functionOptions !== void 0) {
32225
+ FunctionOptions.encode(message.functionOptions, writer.uint32(26).fork()).join();
32226
+ }
32227
+ return writer;
32228
+ },
32229
+ decode(input, length) {
32230
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32231
+ let end = length === void 0 ? reader.len : reader.pos + length;
32232
+ const message = createBaseFunctionVariantInfo();
32233
+ while (reader.pos < end) {
32234
+ const tag = reader.uint32();
32235
+ switch (tag >>> 3) {
32236
+ case 1: {
32237
+ if (tag !== 10) {
32238
+ break;
32239
+ }
32240
+ message.functionId = reader.string();
32241
+ continue;
32242
+ }
32243
+ case 2: {
32244
+ if (tag !== 18) {
32245
+ break;
32246
+ }
32247
+ message.serializedParams = reader.bytes();
32248
+ continue;
32249
+ }
32250
+ case 3: {
32251
+ if (tag !== 26) {
32252
+ break;
32253
+ }
32254
+ message.functionOptions = FunctionOptions.decode(reader, reader.uint32());
32255
+ continue;
32256
+ }
32257
+ }
32258
+ if ((tag & 7) === 4 || tag === 0) {
32259
+ break;
32260
+ }
32261
+ reader.skip(tag & 7);
32262
+ }
32263
+ return message;
32264
+ },
32265
+ fromJSON(object) {
32266
+ return {
32267
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
32268
+ serializedParams: isSet5(object.serializedParams) ? bytesFromBase642(object.serializedParams) : new Uint8Array(0),
32269
+ functionOptions: isSet5(object.functionOptions) ? FunctionOptions.fromJSON(object.functionOptions) : void 0
32270
+ };
32271
+ },
32272
+ toJSON(message) {
32273
+ const obj = {};
32274
+ if (message.functionId !== "") {
32275
+ obj.functionId = message.functionId;
32276
+ }
32277
+ if (message.serializedParams.length !== 0) {
32278
+ obj.serializedParams = base64FromBytes2(message.serializedParams);
32279
+ }
32280
+ if (message.functionOptions !== void 0) {
32281
+ obj.functionOptions = FunctionOptions.toJSON(message.functionOptions);
32282
+ }
32283
+ return obj;
32284
+ },
32285
+ create(base) {
32286
+ return FunctionVariantInfo.fromPartial(base ?? {});
32287
+ },
32288
+ fromPartial(object) {
32289
+ const message = createBaseFunctionVariantInfo();
32290
+ message.functionId = object.functionId ?? "";
32291
+ message.serializedParams = object.serializedParams ?? new Uint8Array(0);
32292
+ message.functionOptions = object.functionOptions !== void 0 && object.functionOptions !== null ? FunctionOptions.fromPartial(object.functionOptions) : void 0;
32293
+ return message;
32294
+ }
32295
+ };
31663
32296
  function createBaseGPUConfig() {
31664
32297
  return { type: 0, count: 0, gpuType: "" };
31665
32298
  }
@@ -32053,7 +32686,8 @@ function createBaseHTTPConfig() {
32053
32686
  exitGracePeriod: 0,
32054
32687
  h2Enabled: false,
32055
32688
  targetConcurrency: 0,
32056
- unauthenticated: false
32689
+ unauthenticated: false,
32690
+ liftAndShiftConfig: void 0
32057
32691
  };
32058
32692
  }
32059
32693
  var HTTPConfig = {
@@ -32079,6 +32713,9 @@ var HTTPConfig = {
32079
32713
  if (message.unauthenticated !== false) {
32080
32714
  writer.uint32(56).bool(message.unauthenticated);
32081
32715
  }
32716
+ if (message.liftAndShiftConfig !== void 0) {
32717
+ LiftAndShiftConfig.encode(message.liftAndShiftConfig, writer.uint32(66).fork()).join();
32718
+ }
32082
32719
  return writer;
32083
32720
  },
32084
32721
  decode(input, length) {
@@ -32137,6 +32774,13 @@ var HTTPConfig = {
32137
32774
  message.unauthenticated = reader.bool();
32138
32775
  continue;
32139
32776
  }
32777
+ case 8: {
32778
+ if (tag !== 66) {
32779
+ break;
32780
+ }
32781
+ message.liftAndShiftConfig = LiftAndShiftConfig.decode(reader, reader.uint32());
32782
+ continue;
32783
+ }
32140
32784
  }
32141
32785
  if ((tag & 7) === 4 || tag === 0) {
32142
32786
  break;
@@ -32153,7 +32797,8 @@ var HTTPConfig = {
32153
32797
  exitGracePeriod: isSet5(object.exitGracePeriod) ? globalThis.Number(object.exitGracePeriod) : 0,
32154
32798
  h2Enabled: isSet5(object.h2Enabled) ? globalThis.Boolean(object.h2Enabled) : false,
32155
32799
  targetConcurrency: isSet5(object.targetConcurrency) ? globalThis.Number(object.targetConcurrency) : 0,
32156
- unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false
32800
+ unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
32801
+ liftAndShiftConfig: isSet5(object.liftAndShiftConfig) ? LiftAndShiftConfig.fromJSON(object.liftAndShiftConfig) : void 0
32157
32802
  };
32158
32803
  },
32159
32804
  toJSON(message) {
@@ -32179,6 +32824,9 @@ var HTTPConfig = {
32179
32824
  if (message.unauthenticated !== false) {
32180
32825
  obj.unauthenticated = message.unauthenticated;
32181
32826
  }
32827
+ if (message.liftAndShiftConfig !== void 0) {
32828
+ obj.liftAndShiftConfig = LiftAndShiftConfig.toJSON(message.liftAndShiftConfig);
32829
+ }
32182
32830
  return obj;
32183
32831
  },
32184
32832
  create(base) {
@@ -32193,6 +32841,7 @@ var HTTPConfig = {
32193
32841
  message.h2Enabled = object.h2Enabled ?? false;
32194
32842
  message.targetConcurrency = object.targetConcurrency ?? 0;
32195
32843
  message.unauthenticated = object.unauthenticated ?? false;
32844
+ message.liftAndShiftConfig = object.liftAndShiftConfig !== void 0 && object.liftAndShiftConfig !== null ? LiftAndShiftConfig.fromPartial(object.liftAndShiftConfig) : void 0;
32196
32845
  return message;
32197
32846
  }
32198
32847
  };
@@ -34968,6 +35617,43 @@ var InputInfo = {
34968
35617
  return message;
34969
35618
  }
34970
35619
  };
35620
+ function createBaseLiftAndShiftConfig() {
35621
+ return {};
35622
+ }
35623
+ var LiftAndShiftConfig = {
35624
+ encode(_, writer = new BinaryWriter()) {
35625
+ return writer;
35626
+ },
35627
+ decode(input, length) {
35628
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
35629
+ let end = length === void 0 ? reader.len : reader.pos + length;
35630
+ const message = createBaseLiftAndShiftConfig();
35631
+ while (reader.pos < end) {
35632
+ const tag = reader.uint32();
35633
+ switch (tag >>> 3) {
35634
+ }
35635
+ if ((tag & 7) === 4 || tag === 0) {
35636
+ break;
35637
+ }
35638
+ reader.skip(tag & 7);
35639
+ }
35640
+ return message;
35641
+ },
35642
+ fromJSON(_) {
35643
+ return {};
35644
+ },
35645
+ toJSON(_) {
35646
+ const obj = {};
35647
+ return obj;
35648
+ },
35649
+ create(base) {
35650
+ return LiftAndShiftConfig.fromPartial(base ?? {});
35651
+ },
35652
+ fromPartial(_) {
35653
+ const message = createBaseLiftAndShiftConfig();
35654
+ return message;
35655
+ }
35656
+ };
34971
35657
  function createBaseListPagination() {
34972
35658
  return { maxObjects: 0, createdBefore: 0 };
34973
35659
  }
@@ -47271,6 +47957,108 @@ var SecretDeleteRequest = {
47271
47957
  return message;
47272
47958
  }
47273
47959
  };
47960
+ function createBaseSecretGetInfoRequest() {
47961
+ return { secretId: "" };
47962
+ }
47963
+ var SecretGetInfoRequest = {
47964
+ encode(message, writer = new BinaryWriter()) {
47965
+ if (message.secretId !== "") {
47966
+ writer.uint32(10).string(message.secretId);
47967
+ }
47968
+ return writer;
47969
+ },
47970
+ decode(input, length) {
47971
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
47972
+ let end = length === void 0 ? reader.len : reader.pos + length;
47973
+ const message = createBaseSecretGetInfoRequest();
47974
+ while (reader.pos < end) {
47975
+ const tag = reader.uint32();
47976
+ switch (tag >>> 3) {
47977
+ case 1: {
47978
+ if (tag !== 10) {
47979
+ break;
47980
+ }
47981
+ message.secretId = reader.string();
47982
+ continue;
47983
+ }
47984
+ }
47985
+ if ((tag & 7) === 4 || tag === 0) {
47986
+ break;
47987
+ }
47988
+ reader.skip(tag & 7);
47989
+ }
47990
+ return message;
47991
+ },
47992
+ fromJSON(object) {
47993
+ return { secretId: isSet5(object.secretId) ? globalThis.String(object.secretId) : "" };
47994
+ },
47995
+ toJSON(message) {
47996
+ const obj = {};
47997
+ if (message.secretId !== "") {
47998
+ obj.secretId = message.secretId;
47999
+ }
48000
+ return obj;
48001
+ },
48002
+ create(base) {
48003
+ return SecretGetInfoRequest.fromPartial(base ?? {});
48004
+ },
48005
+ fromPartial(object) {
48006
+ const message = createBaseSecretGetInfoRequest();
48007
+ message.secretId = object.secretId ?? "";
48008
+ return message;
48009
+ }
48010
+ };
48011
+ function createBaseSecretGetInfoResponse() {
48012
+ return { metadata: void 0 };
48013
+ }
48014
+ var SecretGetInfoResponse = {
48015
+ encode(message, writer = new BinaryWriter()) {
48016
+ if (message.metadata !== void 0) {
48017
+ SecretMetadata.encode(message.metadata, writer.uint32(10).fork()).join();
48018
+ }
48019
+ return writer;
48020
+ },
48021
+ decode(input, length) {
48022
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
48023
+ let end = length === void 0 ? reader.len : reader.pos + length;
48024
+ const message = createBaseSecretGetInfoResponse();
48025
+ while (reader.pos < end) {
48026
+ const tag = reader.uint32();
48027
+ switch (tag >>> 3) {
48028
+ case 1: {
48029
+ if (tag !== 10) {
48030
+ break;
48031
+ }
48032
+ message.metadata = SecretMetadata.decode(reader, reader.uint32());
48033
+ continue;
48034
+ }
48035
+ }
48036
+ if ((tag & 7) === 4 || tag === 0) {
48037
+ break;
48038
+ }
48039
+ reader.skip(tag & 7);
48040
+ }
48041
+ return message;
48042
+ },
48043
+ fromJSON(object) {
48044
+ return { metadata: isSet5(object.metadata) ? SecretMetadata.fromJSON(object.metadata) : void 0 };
48045
+ },
48046
+ toJSON(message) {
48047
+ const obj = {};
48048
+ if (message.metadata !== void 0) {
48049
+ obj.metadata = SecretMetadata.toJSON(message.metadata);
48050
+ }
48051
+ return obj;
48052
+ },
48053
+ create(base) {
48054
+ return SecretGetInfoResponse.fromPartial(base ?? {});
48055
+ },
48056
+ fromPartial(object) {
48057
+ const message = createBaseSecretGetInfoResponse();
48058
+ message.metadata = object.metadata !== void 0 && object.metadata !== null ? SecretMetadata.fromPartial(object.metadata) : void 0;
48059
+ return message;
48060
+ }
48061
+ };
47274
48062
  function createBaseSecretGetOrCreateRequest() {
47275
48063
  return { deploymentName: "", environmentName: "", objectCreationType: 0, envDict: {}, appId: "", requiredKeys: [] };
47276
48064
  }
@@ -47817,7 +48605,7 @@ var SecretListResponse = {
47817
48605
  }
47818
48606
  };
47819
48607
  function createBaseSecretMetadata() {
47820
- return { name: "", creationInfo: void 0 };
48608
+ return { name: "", creationInfo: void 0, keys: [], environmentName: "" };
47821
48609
  }
47822
48610
  var SecretMetadata = {
47823
48611
  encode(message, writer = new BinaryWriter()) {
@@ -47827,6 +48615,12 @@ var SecretMetadata = {
47827
48615
  if (message.creationInfo !== void 0) {
47828
48616
  CreationInfo.encode(message.creationInfo, writer.uint32(18).fork()).join();
47829
48617
  }
48618
+ for (const v of message.keys) {
48619
+ writer.uint32(26).string(v);
48620
+ }
48621
+ if (message.environmentName !== "") {
48622
+ writer.uint32(34).string(message.environmentName);
48623
+ }
47830
48624
  return writer;
47831
48625
  },
47832
48626
  decode(input, length) {
@@ -47850,6 +48644,20 @@ var SecretMetadata = {
47850
48644
  message.creationInfo = CreationInfo.decode(reader, reader.uint32());
47851
48645
  continue;
47852
48646
  }
48647
+ case 3: {
48648
+ if (tag !== 26) {
48649
+ break;
48650
+ }
48651
+ message.keys.push(reader.string());
48652
+ continue;
48653
+ }
48654
+ case 4: {
48655
+ if (tag !== 34) {
48656
+ break;
48657
+ }
48658
+ message.environmentName = reader.string();
48659
+ continue;
48660
+ }
47853
48661
  }
47854
48662
  if ((tag & 7) === 4 || tag === 0) {
47855
48663
  break;
@@ -47861,7 +48669,9 @@ var SecretMetadata = {
47861
48669
  fromJSON(object) {
47862
48670
  return {
47863
48671
  name: isSet5(object.name) ? globalThis.String(object.name) : "",
47864
- creationInfo: isSet5(object.creationInfo) ? CreationInfo.fromJSON(object.creationInfo) : void 0
48672
+ creationInfo: isSet5(object.creationInfo) ? CreationInfo.fromJSON(object.creationInfo) : void 0,
48673
+ keys: globalThis.Array.isArray(object?.keys) ? object.keys.map((e) => globalThis.String(e)) : [],
48674
+ environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : ""
47865
48675
  };
47866
48676
  },
47867
48677
  toJSON(message) {
@@ -47872,6 +48682,12 @@ var SecretMetadata = {
47872
48682
  if (message.creationInfo !== void 0) {
47873
48683
  obj.creationInfo = CreationInfo.toJSON(message.creationInfo);
47874
48684
  }
48685
+ if (message.keys?.length) {
48686
+ obj.keys = message.keys;
48687
+ }
48688
+ if (message.environmentName !== "") {
48689
+ obj.environmentName = message.environmentName;
48690
+ }
47875
48691
  return obj;
47876
48692
  },
47877
48693
  create(base) {
@@ -47881,6 +48697,8 @@ var SecretMetadata = {
47881
48697
  const message = createBaseSecretMetadata();
47882
48698
  message.name = object.name ?? "";
47883
48699
  message.creationInfo = object.creationInfo !== void 0 && object.creationInfo !== null ? CreationInfo.fromPartial(object.creationInfo) : void 0;
48700
+ message.keys = object.keys?.map((e) => e) || [];
48701
+ message.environmentName = object.environmentName ?? "";
47884
48702
  return message;
47885
48703
  }
47886
48704
  };
@@ -48877,6 +49695,291 @@ var ServerGetTimeRangeStatsResponse_ContainerPercentileStatsEntry = {
48877
49695
  return message;
48878
49696
  }
48879
49697
  };
49698
+ function createBaseServerRequestFetchRequest() {
49699
+ return { functionId: "", tail: void 0 };
49700
+ }
49701
+ var ServerRequestFetchRequest = {
49702
+ encode(message, writer = new BinaryWriter()) {
49703
+ if (message.functionId !== "") {
49704
+ writer.uint32(10).string(message.functionId);
49705
+ }
49706
+ if (message.tail !== void 0) {
49707
+ ServerRequestFetchRequest_Tail.encode(message.tail, writer.uint32(26).fork()).join();
49708
+ }
49709
+ return writer;
49710
+ },
49711
+ decode(input, length) {
49712
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49713
+ let end = length === void 0 ? reader.len : reader.pos + length;
49714
+ const message = createBaseServerRequestFetchRequest();
49715
+ while (reader.pos < end) {
49716
+ const tag = reader.uint32();
49717
+ switch (tag >>> 3) {
49718
+ case 1: {
49719
+ if (tag !== 10) {
49720
+ break;
49721
+ }
49722
+ message.functionId = reader.string();
49723
+ continue;
49724
+ }
49725
+ case 3: {
49726
+ if (tag !== 26) {
49727
+ break;
49728
+ }
49729
+ message.tail = ServerRequestFetchRequest_Tail.decode(reader, reader.uint32());
49730
+ continue;
49731
+ }
49732
+ }
49733
+ if ((tag & 7) === 4 || tag === 0) {
49734
+ break;
49735
+ }
49736
+ reader.skip(tag & 7);
49737
+ }
49738
+ return message;
49739
+ },
49740
+ fromJSON(object) {
49741
+ return {
49742
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
49743
+ tail: isSet5(object.tail) ? ServerRequestFetchRequest_Tail.fromJSON(object.tail) : void 0
49744
+ };
49745
+ },
49746
+ toJSON(message) {
49747
+ const obj = {};
49748
+ if (message.functionId !== "") {
49749
+ obj.functionId = message.functionId;
49750
+ }
49751
+ if (message.tail !== void 0) {
49752
+ obj.tail = ServerRequestFetchRequest_Tail.toJSON(message.tail);
49753
+ }
49754
+ return obj;
49755
+ },
49756
+ create(base) {
49757
+ return ServerRequestFetchRequest.fromPartial(base ?? {});
49758
+ },
49759
+ fromPartial(object) {
49760
+ const message = createBaseServerRequestFetchRequest();
49761
+ message.functionId = object.functionId ?? "";
49762
+ message.tail = object.tail !== void 0 && object.tail !== null ? ServerRequestFetchRequest_Tail.fromPartial(object.tail) : void 0;
49763
+ return message;
49764
+ }
49765
+ };
49766
+ function createBaseServerRequestFetchRequest_Tail() {
49767
+ return { count: 0 };
49768
+ }
49769
+ var ServerRequestFetchRequest_Tail = {
49770
+ encode(message, writer = new BinaryWriter()) {
49771
+ if (message.count !== 0) {
49772
+ writer.uint32(8).uint32(message.count);
49773
+ }
49774
+ return writer;
49775
+ },
49776
+ decode(input, length) {
49777
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49778
+ let end = length === void 0 ? reader.len : reader.pos + length;
49779
+ const message = createBaseServerRequestFetchRequest_Tail();
49780
+ while (reader.pos < end) {
49781
+ const tag = reader.uint32();
49782
+ switch (tag >>> 3) {
49783
+ case 1: {
49784
+ if (tag !== 8) {
49785
+ break;
49786
+ }
49787
+ message.count = reader.uint32();
49788
+ continue;
49789
+ }
49790
+ }
49791
+ if ((tag & 7) === 4 || tag === 0) {
49792
+ break;
49793
+ }
49794
+ reader.skip(tag & 7);
49795
+ }
49796
+ return message;
49797
+ },
49798
+ fromJSON(object) {
49799
+ return { count: isSet5(object.count) ? globalThis.Number(object.count) : 0 };
49800
+ },
49801
+ toJSON(message) {
49802
+ const obj = {};
49803
+ if (message.count !== 0) {
49804
+ obj.count = Math.round(message.count);
49805
+ }
49806
+ return obj;
49807
+ },
49808
+ create(base) {
49809
+ return ServerRequestFetchRequest_Tail.fromPartial(base ?? {});
49810
+ },
49811
+ fromPartial(object) {
49812
+ const message = createBaseServerRequestFetchRequest_Tail();
49813
+ message.count = object.count ?? 0;
49814
+ return message;
49815
+ }
49816
+ };
49817
+ function createBaseServerRequestFetchResponse() {
49818
+ return { requests: [] };
49819
+ }
49820
+ var ServerRequestFetchResponse = {
49821
+ encode(message, writer = new BinaryWriter()) {
49822
+ for (const v of message.requests) {
49823
+ ServerRequestInfo.encode(v, writer.uint32(10).fork()).join();
49824
+ }
49825
+ return writer;
49826
+ },
49827
+ decode(input, length) {
49828
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49829
+ let end = length === void 0 ? reader.len : reader.pos + length;
49830
+ const message = createBaseServerRequestFetchResponse();
49831
+ while (reader.pos < end) {
49832
+ const tag = reader.uint32();
49833
+ switch (tag >>> 3) {
49834
+ case 1: {
49835
+ if (tag !== 10) {
49836
+ break;
49837
+ }
49838
+ message.requests.push(ServerRequestInfo.decode(reader, reader.uint32()));
49839
+ continue;
49840
+ }
49841
+ }
49842
+ if ((tag & 7) === 4 || tag === 0) {
49843
+ break;
49844
+ }
49845
+ reader.skip(tag & 7);
49846
+ }
49847
+ return message;
49848
+ },
49849
+ fromJSON(object) {
49850
+ return {
49851
+ requests: globalThis.Array.isArray(object?.requests) ? object.requests.map((e) => ServerRequestInfo.fromJSON(e)) : []
49852
+ };
49853
+ },
49854
+ toJSON(message) {
49855
+ const obj = {};
49856
+ if (message.requests?.length) {
49857
+ obj.requests = message.requests.map((e) => ServerRequestInfo.toJSON(e));
49858
+ }
49859
+ return obj;
49860
+ },
49861
+ create(base) {
49862
+ return ServerRequestFetchResponse.fromPartial(base ?? {});
49863
+ },
49864
+ fromPartial(object) {
49865
+ const message = createBaseServerRequestFetchResponse();
49866
+ message.requests = object.requests?.map((e) => ServerRequestInfo.fromPartial(e)) || [];
49867
+ return message;
49868
+ }
49869
+ };
49870
+ function createBaseServerRequestInfo() {
49871
+ return { route: "", timestamp: void 0, containerId: "", durationSeconds: 0, status: 0 };
49872
+ }
49873
+ var ServerRequestInfo = {
49874
+ encode(message, writer = new BinaryWriter()) {
49875
+ if (message.route !== "") {
49876
+ writer.uint32(10).string(message.route);
49877
+ }
49878
+ if (message.timestamp !== void 0) {
49879
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).join();
49880
+ }
49881
+ if (message.containerId !== "") {
49882
+ writer.uint32(26).string(message.containerId);
49883
+ }
49884
+ if (message.durationSeconds !== 0) {
49885
+ writer.uint32(33).double(message.durationSeconds);
49886
+ }
49887
+ if (message.status !== 0) {
49888
+ writer.uint32(40).int32(message.status);
49889
+ }
49890
+ return writer;
49891
+ },
49892
+ decode(input, length) {
49893
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49894
+ let end = length === void 0 ? reader.len : reader.pos + length;
49895
+ const message = createBaseServerRequestInfo();
49896
+ while (reader.pos < end) {
49897
+ const tag = reader.uint32();
49898
+ switch (tag >>> 3) {
49899
+ case 1: {
49900
+ if (tag !== 10) {
49901
+ break;
49902
+ }
49903
+ message.route = reader.string();
49904
+ continue;
49905
+ }
49906
+ case 2: {
49907
+ if (tag !== 18) {
49908
+ break;
49909
+ }
49910
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
49911
+ continue;
49912
+ }
49913
+ case 3: {
49914
+ if (tag !== 26) {
49915
+ break;
49916
+ }
49917
+ message.containerId = reader.string();
49918
+ continue;
49919
+ }
49920
+ case 4: {
49921
+ if (tag !== 33) {
49922
+ break;
49923
+ }
49924
+ message.durationSeconds = reader.double();
49925
+ continue;
49926
+ }
49927
+ case 5: {
49928
+ if (tag !== 40) {
49929
+ break;
49930
+ }
49931
+ message.status = reader.int32();
49932
+ continue;
49933
+ }
49934
+ }
49935
+ if ((tag & 7) === 4 || tag === 0) {
49936
+ break;
49937
+ }
49938
+ reader.skip(tag & 7);
49939
+ }
49940
+ return message;
49941
+ },
49942
+ fromJSON(object) {
49943
+ return {
49944
+ route: isSet5(object.route) ? globalThis.String(object.route) : "",
49945
+ timestamp: isSet5(object.timestamp) ? fromJsonTimestamp(object.timestamp) : void 0,
49946
+ containerId: isSet5(object.containerId) ? globalThis.String(object.containerId) : "",
49947
+ durationSeconds: isSet5(object.durationSeconds) ? globalThis.Number(object.durationSeconds) : 0,
49948
+ status: isSet5(object.status) ? globalThis.Number(object.status) : 0
49949
+ };
49950
+ },
49951
+ toJSON(message) {
49952
+ const obj = {};
49953
+ if (message.route !== "") {
49954
+ obj.route = message.route;
49955
+ }
49956
+ if (message.timestamp !== void 0) {
49957
+ obj.timestamp = message.timestamp.toISOString();
49958
+ }
49959
+ if (message.containerId !== "") {
49960
+ obj.containerId = message.containerId;
49961
+ }
49962
+ if (message.durationSeconds !== 0) {
49963
+ obj.durationSeconds = message.durationSeconds;
49964
+ }
49965
+ if (message.status !== 0) {
49966
+ obj.status = Math.round(message.status);
49967
+ }
49968
+ return obj;
49969
+ },
49970
+ create(base) {
49971
+ return ServerRequestInfo.fromPartial(base ?? {});
49972
+ },
49973
+ fromPartial(object) {
49974
+ const message = createBaseServerRequestInfo();
49975
+ message.route = object.route ?? "";
49976
+ message.timestamp = object.timestamp ?? void 0;
49977
+ message.containerId = object.containerId ?? "";
49978
+ message.durationSeconds = object.durationSeconds ?? 0;
49979
+ message.status = object.status ?? 0;
49980
+ return message;
49981
+ }
49982
+ };
48880
49983
  function createBaseServiceUser() {
48881
49984
  return {
48882
49985
  name: "",
@@ -51593,7 +52696,8 @@ function createBaseTaskLogsBatch() {
51593
52696
  eof: false,
51594
52697
  ptyExecId: "",
51595
52698
  rootFunctionId: "",
51596
- ttlDays: 0
52699
+ ttlDays: 0,
52700
+ sandboxId: ""
51597
52701
  };
51598
52702
  }
51599
52703
  var TaskLogsBatch = {
@@ -51631,6 +52735,9 @@ var TaskLogsBatch = {
51631
52735
  if (message.ttlDays !== 0) {
51632
52736
  writer.uint32(136).uint32(message.ttlDays);
51633
52737
  }
52738
+ if (message.sandboxId !== "") {
52739
+ writer.uint32(146).string(message.sandboxId);
52740
+ }
51634
52741
  return writer;
51635
52742
  },
51636
52743
  decode(input, length) {
@@ -51717,6 +52824,13 @@ var TaskLogsBatch = {
51717
52824
  message.ttlDays = reader.uint32();
51718
52825
  continue;
51719
52826
  }
52827
+ case 18: {
52828
+ if (tag !== 146) {
52829
+ break;
52830
+ }
52831
+ message.sandboxId = reader.string();
52832
+ continue;
52833
+ }
51720
52834
  }
51721
52835
  if ((tag & 7) === 4 || tag === 0) {
51722
52836
  break;
@@ -51737,7 +52851,8 @@ var TaskLogsBatch = {
51737
52851
  eof: isSet5(object.eof) ? globalThis.Boolean(object.eof) : false,
51738
52852
  ptyExecId: isSet5(object.ptyExecId) ? globalThis.String(object.ptyExecId) : "",
51739
52853
  rootFunctionId: isSet5(object.rootFunctionId) ? globalThis.String(object.rootFunctionId) : "",
51740
- ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0
52854
+ ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0,
52855
+ sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : ""
51741
52856
  };
51742
52857
  },
51743
52858
  toJSON(message) {
@@ -51775,6 +52890,9 @@ var TaskLogsBatch = {
51775
52890
  if (message.ttlDays !== 0) {
51776
52891
  obj.ttlDays = Math.round(message.ttlDays);
51777
52892
  }
52893
+ if (message.sandboxId !== "") {
52894
+ obj.sandboxId = message.sandboxId;
52895
+ }
51778
52896
  return obj;
51779
52897
  },
51780
52898
  create(base) {
@@ -51793,6 +52911,7 @@ var TaskLogsBatch = {
51793
52911
  message.ptyExecId = object.ptyExecId ?? "";
51794
52912
  message.rootFunctionId = object.rootFunctionId ?? "";
51795
52913
  message.ttlDays = object.ttlDays ?? 0;
52914
+ message.sandboxId = object.sandboxId ?? "";
51796
52915
  return message;
51797
52916
  }
51798
52917
  };
@@ -52464,7 +53583,7 @@ var TokenDeleteRequest = {
52464
53583
  }
52465
53584
  };
52466
53585
  function createBaseTokenFlowCreateRequest() {
52467
- return { utmSource: "", localhostPort: 0, nextUrl: "" };
53586
+ return { utmSource: "", localhostPort: 0, nextUrl: "", expiresInSeconds: 0 };
52468
53587
  }
52469
53588
  var TokenFlowCreateRequest = {
52470
53589
  encode(message, writer = new BinaryWriter()) {
@@ -52477,6 +53596,9 @@ var TokenFlowCreateRequest = {
52477
53596
  if (message.nextUrl !== "") {
52478
53597
  writer.uint32(42).string(message.nextUrl);
52479
53598
  }
53599
+ if (message.expiresInSeconds !== 0) {
53600
+ writer.uint32(48).uint32(message.expiresInSeconds);
53601
+ }
52480
53602
  return writer;
52481
53603
  },
52482
53604
  decode(input, length) {
@@ -52507,6 +53629,13 @@ var TokenFlowCreateRequest = {
52507
53629
  message.nextUrl = reader.string();
52508
53630
  continue;
52509
53631
  }
53632
+ case 6: {
53633
+ if (tag !== 48) {
53634
+ break;
53635
+ }
53636
+ message.expiresInSeconds = reader.uint32();
53637
+ continue;
53638
+ }
52510
53639
  }
52511
53640
  if ((tag & 7) === 4 || tag === 0) {
52512
53641
  break;
@@ -52519,7 +53648,8 @@ var TokenFlowCreateRequest = {
52519
53648
  return {
52520
53649
  utmSource: isSet5(object.utmSource) ? globalThis.String(object.utmSource) : "",
52521
53650
  localhostPort: isSet5(object.localhostPort) ? globalThis.Number(object.localhostPort) : 0,
52522
- nextUrl: isSet5(object.nextUrl) ? globalThis.String(object.nextUrl) : ""
53651
+ nextUrl: isSet5(object.nextUrl) ? globalThis.String(object.nextUrl) : "",
53652
+ expiresInSeconds: isSet5(object.expiresInSeconds) ? globalThis.Number(object.expiresInSeconds) : 0
52523
53653
  };
52524
53654
  },
52525
53655
  toJSON(message) {
@@ -52533,6 +53663,9 @@ var TokenFlowCreateRequest = {
52533
53663
  if (message.nextUrl !== "") {
52534
53664
  obj.nextUrl = message.nextUrl;
52535
53665
  }
53666
+ if (message.expiresInSeconds !== 0) {
53667
+ obj.expiresInSeconds = Math.round(message.expiresInSeconds);
53668
+ }
52536
53669
  return obj;
52537
53670
  },
52538
53671
  create(base) {
@@ -52543,6 +53676,7 @@ var TokenFlowCreateRequest = {
52543
53676
  message.utmSource = object.utmSource ?? "";
52544
53677
  message.localhostPort = object.localhostPort ?? 0;
52545
53678
  message.nextUrl = object.nextUrl ?? "";
53679
+ message.expiresInSeconds = object.expiresInSeconds ?? 0;
52546
53680
  return message;
52547
53681
  }
52548
53682
  };
@@ -57419,6 +58553,74 @@ var WebhookTokenListResponse = {
57419
58553
  return message;
57420
58554
  }
57421
58555
  };
58556
+ function createBaseWebhookTokenUpdateRequest() {
58557
+ return { tokenId: "", name: void 0 };
58558
+ }
58559
+ var WebhookTokenUpdateRequest = {
58560
+ encode(message, writer = new BinaryWriter()) {
58561
+ if (message.tokenId !== "") {
58562
+ writer.uint32(10).string(message.tokenId);
58563
+ }
58564
+ if (message.name !== void 0) {
58565
+ writer.uint32(18).string(message.name);
58566
+ }
58567
+ return writer;
58568
+ },
58569
+ decode(input, length) {
58570
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
58571
+ let end = length === void 0 ? reader.len : reader.pos + length;
58572
+ const message = createBaseWebhookTokenUpdateRequest();
58573
+ while (reader.pos < end) {
58574
+ const tag = reader.uint32();
58575
+ switch (tag >>> 3) {
58576
+ case 1: {
58577
+ if (tag !== 10) {
58578
+ break;
58579
+ }
58580
+ message.tokenId = reader.string();
58581
+ continue;
58582
+ }
58583
+ case 2: {
58584
+ if (tag !== 18) {
58585
+ break;
58586
+ }
58587
+ message.name = reader.string();
58588
+ continue;
58589
+ }
58590
+ }
58591
+ if ((tag & 7) === 4 || tag === 0) {
58592
+ break;
58593
+ }
58594
+ reader.skip(tag & 7);
58595
+ }
58596
+ return message;
58597
+ },
58598
+ fromJSON(object) {
58599
+ return {
58600
+ tokenId: isSet5(object.tokenId) ? globalThis.String(object.tokenId) : "",
58601
+ name: isSet5(object.name) ? globalThis.String(object.name) : void 0
58602
+ };
58603
+ },
58604
+ toJSON(message) {
58605
+ const obj = {};
58606
+ if (message.tokenId !== "") {
58607
+ obj.tokenId = message.tokenId;
58608
+ }
58609
+ if (message.name !== void 0) {
58610
+ obj.name = message.name;
58611
+ }
58612
+ return obj;
58613
+ },
58614
+ create(base) {
58615
+ return WebhookTokenUpdateRequest.fromPartial(base ?? {});
58616
+ },
58617
+ fromPartial(object) {
58618
+ const message = createBaseWebhookTokenUpdateRequest();
58619
+ message.tokenId = object.tokenId ?? "";
58620
+ message.name = object.name ?? void 0;
58621
+ return message;
58622
+ }
58623
+ };
57422
58624
  function createBaseWorkspaceBillingRatesRequest() {
57423
58625
  return {};
57424
58626
  }
@@ -60144,6 +61346,14 @@ var ModalClientDefinition = {
60144
61346
  responseStream: false,
60145
61347
  options: {}
60146
61348
  },
61349
+ functionCallFetch: {
61350
+ name: "FunctionCallFetch",
61351
+ requestType: FunctionCallFetchRequest,
61352
+ requestStream: false,
61353
+ responseType: FunctionCallFetchResponse,
61354
+ responseStream: false,
61355
+ options: {}
61356
+ },
60147
61357
  functionCallFromId: {
60148
61358
  name: "FunctionCallFromId",
60149
61359
  requestType: FunctionCallFromIdRequest,
@@ -60299,6 +61509,14 @@ var ModalClientDefinition = {
60299
61509
  responseStream: false,
60300
61510
  options: {}
60301
61511
  },
61512
+ functionListVariants: {
61513
+ name: "FunctionListVariants",
61514
+ requestType: FunctionListVariantsRequest,
61515
+ requestStream: false,
61516
+ responseType: FunctionListVariantsResponse,
61517
+ responseStream: false,
61518
+ options: {}
61519
+ },
60302
61520
  functionMap: {
60303
61521
  name: "FunctionMap",
60304
61522
  requestType: FunctionMapRequest,
@@ -60933,6 +62151,14 @@ var ModalClientDefinition = {
60933
62151
  responseStream: false,
60934
62152
  options: {}
60935
62153
  },
62154
+ secretGetInfo: {
62155
+ name: "SecretGetInfo",
62156
+ requestType: SecretGetInfoRequest,
62157
+ requestStream: false,
62158
+ responseType: SecretGetInfoResponse,
62159
+ responseStream: false,
62160
+ options: {}
62161
+ },
60936
62162
  secretGetOrCreate: {
60937
62163
  name: "SecretGetOrCreate",
60938
62164
  requestType: SecretGetOrCreateRequest,
@@ -60966,6 +62192,14 @@ var ModalClientDefinition = {
60966
62192
  responseStream: false,
60967
62193
  options: {}
60968
62194
  },
62195
+ serverRequestFetch: {
62196
+ name: "ServerRequestFetch",
62197
+ requestType: ServerRequestFetchRequest,
62198
+ requestStream: false,
62199
+ responseType: ServerRequestFetchResponse,
62200
+ responseStream: false,
62201
+ options: {}
62202
+ },
60969
62203
  /** Service users */
60970
62204
  serviceUserList: {
60971
62205
  name: "ServiceUserList",
@@ -61359,6 +62593,14 @@ var ModalClientDefinition = {
61359
62593
  responseStream: false,
61360
62594
  options: {}
61361
62595
  },
62596
+ webhookTokenUpdate: {
62597
+ name: "WebhookTokenUpdate",
62598
+ requestType: WebhookTokenUpdateRequest,
62599
+ requestStream: false,
62600
+ responseType: WebhookToken,
62601
+ responseStream: false,
62602
+ options: {}
62603
+ },
61362
62604
  /** Workspaces */
61363
62605
  workspaceBillingRates: {
61364
62606
  name: "WorkspaceBillingRates",
@@ -61568,6 +62810,12 @@ var QueueFullError = class extends Error {
61568
62810
  this.name = "QueueFullError";
61569
62811
  }
61570
62812
  };
62813
+ var ResourceExhaustedError = class extends Error {
62814
+ constructor(message) {
62815
+ super(message);
62816
+ this.name = "ResourceExhaustedError";
62817
+ }
62818
+ };
61571
62819
  var SandboxFilesystemError = class extends Error {
61572
62820
  constructor(message) {
61573
62821
  super(message);
@@ -64015,7 +65263,8 @@ function createBaseTaskContainerCreateRequest() {
64015
65263
  secretIds: [],
64016
65264
  volumeMounts: [],
64017
65265
  networkAccess: void 0,
64018
- ptyInfo: void 0
65266
+ ptyInfo: void 0,
65267
+ memoryReserveConsumeMib: void 0
64019
65268
  };
64020
65269
  }
64021
65270
  var TaskContainerCreateRequest = {
@@ -64050,6 +65299,9 @@ var TaskContainerCreateRequest = {
64050
65299
  if (message.ptyInfo !== void 0) {
64051
65300
  PTYInfo.encode(message.ptyInfo, writer.uint32(90).fork()).join();
64052
65301
  }
65302
+ if (message.memoryReserveConsumeMib !== void 0) {
65303
+ writer.uint32(96).uint32(message.memoryReserveConsumeMib);
65304
+ }
64053
65305
  return writer;
64054
65306
  },
64055
65307
  decode(input, length) {
@@ -64132,6 +65384,13 @@ var TaskContainerCreateRequest = {
64132
65384
  message.ptyInfo = PTYInfo.decode(reader, reader.uint32());
64133
65385
  continue;
64134
65386
  }
65387
+ case 12: {
65388
+ if (tag !== 96) {
65389
+ break;
65390
+ }
65391
+ message.memoryReserveConsumeMib = reader.uint32();
65392
+ continue;
65393
+ }
64135
65394
  }
64136
65395
  if ((tag & 7) === 4 || tag === 0) {
64137
65396
  break;
@@ -64154,7 +65413,8 @@ var TaskContainerCreateRequest = {
64154
65413
  secretIds: globalThis.Array.isArray(object?.secretIds) ? object.secretIds.map((e) => globalThis.String(e)) : [],
64155
65414
  volumeMounts: globalThis.Array.isArray(object?.volumeMounts) ? object.volumeMounts.map((e) => VolumeMount.fromJSON(e)) : [],
64156
65415
  networkAccess: isSet6(object.networkAccess) ? NetworkAccess.fromJSON(object.networkAccess) : void 0,
64157
- ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0
65416
+ ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0,
65417
+ memoryReserveConsumeMib: isSet6(object.memoryReserveConsumeMib) ? globalThis.Number(object.memoryReserveConsumeMib) : void 0
64158
65418
  };
64159
65419
  },
64160
65420
  toJSON(message) {
@@ -64195,6 +65455,9 @@ var TaskContainerCreateRequest = {
64195
65455
  if (message.ptyInfo !== void 0) {
64196
65456
  obj.ptyInfo = PTYInfo.toJSON(message.ptyInfo);
64197
65457
  }
65458
+ if (message.memoryReserveConsumeMib !== void 0) {
65459
+ obj.memoryReserveConsumeMib = Math.round(message.memoryReserveConsumeMib);
65460
+ }
64198
65461
  return obj;
64199
65462
  },
64200
65463
  create(base) {
@@ -64217,6 +65480,7 @@ var TaskContainerCreateRequest = {
64217
65480
  message.volumeMounts = object.volumeMounts?.map((e) => VolumeMount.fromPartial(e)) || [];
64218
65481
  message.networkAccess = object.networkAccess !== void 0 && object.networkAccess !== null ? NetworkAccess.fromPartial(object.networkAccess) : void 0;
64219
65482
  message.ptyInfo = object.ptyInfo !== void 0 && object.ptyInfo !== null ? PTYInfo.fromPartial(object.ptyInfo) : void 0;
65483
+ message.memoryReserveConsumeMib = object.memoryReserveConsumeMib ?? void 0;
64220
65484
  return message;
64221
65485
  }
64222
65486
  };
@@ -67514,6 +68778,41 @@ import {
67514
68778
  Status as Status6
67515
68779
  } from "nice-grpc";
67516
68780
 
68781
+ // src/server_warnings.ts
68782
+ var SERVER_WARNING_HEADER = "x-modal-warning";
68783
+ var SERVER_WARNING_REGISTRY_LIMIT = 2048;
68784
+ function logServerWarnings(logger2, trailer, seen) {
68785
+ const joined = trailer.get(SERVER_WARNING_HEADER);
68786
+ if (typeof joined !== "string") return;
68787
+ for (const encoded of joined.split(",")) {
68788
+ let message;
68789
+ try {
68790
+ message = decodeURIComponent(encoded.trim());
68791
+ } catch {
68792
+ message = encoded.trim();
68793
+ }
68794
+ if (seen.size > SERVER_WARNING_REGISTRY_LIMIT) {
68795
+ seen.clear();
68796
+ }
68797
+ if (seen.has(message)) continue;
68798
+ seen.add(message);
68799
+ logger2.warn(message);
68800
+ }
68801
+ }
68802
+ function serverWarningMiddleware(logger2) {
68803
+ const seen = /* @__PURE__ */ new Set();
68804
+ return async function* serverWarningMiddleware2(call, options) {
68805
+ const { onTrailer, ...restOptions } = options;
68806
+ return yield* call.next(call.request, {
68807
+ ...restOptions,
68808
+ onTrailer: (trailer) => {
68809
+ logServerWarnings(logger2, trailer, seen);
68810
+ onTrailer?.(trailer);
68811
+ }
68812
+ });
68813
+ };
68814
+ }
68815
+
67517
68816
  // src/config.ts
67518
68817
  import { warn } from "node:console";
67519
68818
  import { readFileSync } from "node:fs";
@@ -67605,7 +68904,7 @@ function getProfile(profileName) {
67605
68904
  const ms = Math.round(parsed * 1e3);
67606
68905
  return parsed > 0 && ms === 0 ? 1 : ms;
67607
68906
  })(),
67608
- sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : parseBooleanFlag(profileData.sandbox_v2)
68907
+ sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : profileData.sandbox_v2 !== void 0 ? parseBooleanFlag(profileData.sandbox_v2) : true
67609
68908
  };
67610
68909
  return profile;
67611
68910
  }
@@ -67827,7 +69126,7 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
67827
69126
  options.metadata ??= new Metadata();
67828
69127
  options.metadata.set("authorization", `Bearer ${self.jwt}`);
67829
69128
  return yield* call.next(call.request, options);
67830
- });
69129
+ }).use(serverWarningMiddleware(logger2));
67831
69130
  this.factory = factory;
67832
69131
  this.stub = factory.create(TaskCommandRouterDefinition, this.channel);
67833
69132
  this.armIdleTimer();
@@ -68232,6 +69531,9 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
68232
69531
  async setNetworkAccess(request) {
68233
69532
  await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
68234
69533
  }
69534
+ async setOutboundPolicy(request) {
69535
+ await this.callUnary(() => this.stub.taskSetOutboundPolicy(request));
69536
+ }
68235
69537
  /**
68236
69538
  * Reload all Volumes mounted in the task to reflect their latest committed state.
68237
69539
  *
@@ -69414,8 +70716,151 @@ var SandboxFilesystem = class {
69414
70716
  };
69415
70717
 
69416
70718
  // src/sandbox_sidecar.ts
69417
- import { ClientError as ClientError9, Status as Status9 } from "nice-grpc";
70719
+ import { ClientError as ClientError10, Status as Status10 } from "nice-grpc";
69418
70720
  import { v4 as uuidv4 } from "uuid";
70721
+
70722
+ // src/volume.ts
70723
+ import { ClientError as ClientError9, Status as Status9 } from "nice-grpc";
70724
+ var VolumeService = class {
70725
+ #client;
70726
+ constructor(client) {
70727
+ this.#client = client;
70728
+ }
70729
+ /**
70730
+ * Reference a {@link Volume} by its name.
70731
+ */
70732
+ async fromName(name, params) {
70733
+ try {
70734
+ const resp = await this.#client.cpClient.volumeGetOrCreate({
70735
+ deploymentName: name,
70736
+ environmentName: this.#client.environmentName(params?.environment),
70737
+ objectCreationType: params?.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
70738
+ });
70739
+ this.#client.logger.debug(
70740
+ "Retrieved Volume",
70741
+ "volume_id",
70742
+ resp.volumeId,
70743
+ "volume_name",
70744
+ name
70745
+ );
70746
+ return new Volume(resp.volumeId, name);
70747
+ } catch (err) {
70748
+ if (err instanceof ClientError9 && err.code === Status9.NOT_FOUND)
70749
+ throw new NotFoundError(err.details);
70750
+ throw err;
70751
+ }
70752
+ }
70753
+ /**
70754
+ * Create a nameless, temporary {@link Volume}.
70755
+ * It persists until closeEphemeral() is called, or the process exits.
70756
+ */
70757
+ async ephemeral(params = {}) {
70758
+ const resp = await this.#client.cpClient.volumeGetOrCreate({
70759
+ objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
70760
+ environmentName: this.#client.environmentName(params.environment)
70761
+ });
70762
+ this.#client.logger.debug(
70763
+ "Created ephemeral Volume",
70764
+ "volume_id",
70765
+ resp.volumeId
70766
+ );
70767
+ const ephemeralHbManager = new EphemeralHeartbeatManager(
70768
+ () => this.#client.cpClient.volumeHeartbeat({ volumeId: resp.volumeId })
70769
+ );
70770
+ return new Volume(resp.volumeId, void 0, void 0, ephemeralHbManager);
70771
+ }
70772
+ /**
70773
+ * Delete a named {@link Volume}.
70774
+ *
70775
+ * Warning: Deletion is irreversible and will affect any Apps currently using the Volume.
70776
+ */
70777
+ async delete(name, params) {
70778
+ try {
70779
+ const volume = await this.fromName(name, {
70780
+ environment: params?.environment,
70781
+ createIfMissing: false
70782
+ });
70783
+ await this.#client.cpClient.volumeDelete({
70784
+ volumeId: volume.volumeId
70785
+ });
70786
+ this.#client.logger.debug(
70787
+ "Deleted Volume",
70788
+ "volume_name",
70789
+ name,
70790
+ "volume_id",
70791
+ volume.volumeId
70792
+ );
70793
+ } catch (err) {
70794
+ const isNotFound = err instanceof NotFoundError || err instanceof ClientError9 && err.code === Status9.NOT_FOUND;
70795
+ if (isNotFound && params?.allowMissing) {
70796
+ return;
70797
+ }
70798
+ throw err;
70799
+ }
70800
+ }
70801
+ };
70802
+ var DEFAULT_MOUNT_OPTIONS = {
70803
+ readOnly: false,
70804
+ subPath: void 0
70805
+ };
70806
+ var Volume = class _Volume {
70807
+ volumeId;
70808
+ name;
70809
+ /**
70810
+ * @hidden
70811
+ * @internal
70812
+ */
70813
+ _mountOptions = DEFAULT_MOUNT_OPTIONS;
70814
+ #ephemeralHbManager;
70815
+ /** @ignore */
70816
+ constructor(volumeId, name, mountOptions, ephemeralHbManager) {
70817
+ this.volumeId = volumeId;
70818
+ this.name = name;
70819
+ if (mountOptions) {
70820
+ this._mountOptions = mountOptions;
70821
+ }
70822
+ this.#ephemeralHbManager = ephemeralHbManager;
70823
+ }
70824
+ /**
70825
+ * Configure options used when mounting this Volume. Fields left undefined preserve their value
70826
+ * from any previous withMountOptions call on the same Volume (stacking).
70827
+ */
70828
+ withMountOptions(params = {}) {
70829
+ let subPath = this._mountOptions.subPath;
70830
+ if (params.subPath !== void 0) {
70831
+ subPath = params.subPath === "/" ? void 0 : params.subPath;
70832
+ }
70833
+ return new _Volume(
70834
+ this.volumeId,
70835
+ this.name,
70836
+ {
70837
+ readOnly: params.readOnly ?? this._mountOptions.readOnly,
70838
+ subPath
70839
+ },
70840
+ this.#ephemeralHbManager
70841
+ );
70842
+ }
70843
+ /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
70844
+ closeEphemeral() {
70845
+ if (this.#ephemeralHbManager) {
70846
+ this.#ephemeralHbManager.stop();
70847
+ } else {
70848
+ throw new InvalidError("Volume is not ephemeral.");
70849
+ }
70850
+ }
70851
+ };
70852
+ function volumeToMountProto(mountPath, volume) {
70853
+ const opts = volume._mountOptions ?? DEFAULT_MOUNT_OPTIONS;
70854
+ return {
70855
+ volumeId: volume.volumeId,
70856
+ mountPath,
70857
+ allowBackgroundCommits: true,
70858
+ readOnly: opts.readOnly,
70859
+ subPath: opts.subPath
70860
+ };
70861
+ }
70862
+
70863
+ // src/sandbox_sidecar.ts
69419
70864
  var MAIN_CONTAINER_NAME = "main";
69420
70865
  var CONTAINER_WAIT_POLL_TIMEOUT_SECONDS = 10;
69421
70866
  var CONTROL_PLANE_SIDECAR_CREATE_ENV_VAR = "MODAL_USE_CONTROL_PLANE_SIDECAR_CREATE";
@@ -69432,6 +70877,29 @@ function validateSidecarName(name) {
69432
70877
  );
69433
70878
  }
69434
70879
  }
70880
+ function buildSidecarVolumeMounts(volumes) {
70881
+ const mountPathsByVolumeId = /* @__PURE__ */ new Map();
70882
+ const volumeMounts = [];
70883
+ for (const [mountPath, volume] of Object.entries(volumes ?? {})) {
70884
+ if (!volume) {
70885
+ throw new InvalidError(
70886
+ `Volume mounted at "${mountPath}" must not be null or undefined`
70887
+ );
70888
+ }
70889
+ const mountPaths = mountPathsByVolumeId.get(volume.volumeId) ?? [];
70890
+ mountPaths.push(mountPath);
70891
+ mountPathsByVolumeId.set(volume.volumeId, mountPaths);
70892
+ volumeMounts.push(volumeToMountProto(mountPath, volume));
70893
+ }
70894
+ for (const mountPaths of mountPathsByVolumeId.values()) {
70895
+ if (mountPaths.length > 1) {
70896
+ throw new InvalidError(
70897
+ "The same Volume cannot be mounted at multiple paths in a sidecar: " + mountPaths.sort().join(", ")
70898
+ );
70899
+ }
70900
+ }
70901
+ return volumeMounts;
70902
+ }
69435
70903
  function sidecarContainerFromProto(access, info) {
69436
70904
  return new SidecarContainer(
69437
70905
  access,
@@ -69462,6 +70930,11 @@ var SidecarService = class {
69462
70930
  const command = params?.command ?? [];
69463
70931
  validateExecArgs(command);
69464
70932
  validateWorkdir(params?.workdir);
70933
+ if (params?.experimentalMemoryReserveConsumeMiB !== void 0 && (!Number.isInteger(params.experimentalMemoryReserveConsumeMiB) || params.experimentalMemoryReserveConsumeMiB <= 0)) {
70934
+ throw new InvalidError(
70935
+ `experimentalMemoryReserveConsumeMiB must be a positive integer number of MiB, got: ${params.experimentalMemoryReserveConsumeMiB}`
70936
+ );
70937
+ }
69465
70938
  validateEnvVarKeys(params?.env ?? {});
69466
70939
  const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
69467
70940
  params?.secrets ?? []
@@ -69469,6 +70942,7 @@ var SidecarService = class {
69469
70942
  Object.assign(envDict, params?.env ?? {});
69470
70943
  await hydrateSecrets(this.#access.client, resolvableSecrets);
69471
70944
  const secretIds = collectSecretIds(resolvableSecrets);
70945
+ const volumeMounts = buildSidecarVolumeMounts(params?.volumes);
69472
70946
  const ptyInfo = params?.pty ? defaultSandboxPTYInfo() : void 0;
69473
70947
  const networkAccess = buildOutboundNetworkAccess(
69474
70948
  false,
@@ -69488,8 +70962,12 @@ var SidecarService = class {
69488
70962
  entrypointArgs: command,
69489
70963
  workdir: params?.workdir ?? void 0,
69490
70964
  secretIds,
70965
+ volumeMounts,
69491
70966
  networkAccess,
69492
- ptyInfo
70967
+ ptyInfo,
70968
+ resources: params?.experimentalMemoryReserveConsumeMiB !== void 0 ? Resources.create({
70969
+ memoryMb: params.experimentalMemoryReserveConsumeMiB
70970
+ }) : void 0
69493
70971
  }),
69494
70972
  ephemeralSecrets
69495
70973
  })
@@ -69505,17 +70983,19 @@ var SidecarService = class {
69505
70983
  env: envDict,
69506
70984
  workdir: params?.workdir ?? "",
69507
70985
  secretIds,
70986
+ volumeMounts,
69508
70987
  networkAccess,
69509
- ptyInfo
70988
+ ptyInfo,
70989
+ memoryReserveConsumeMib: params?.experimentalMemoryReserveConsumeMiB
69510
70990
  })
69511
70991
  );
69512
70992
  }
69513
70993
  } catch (err) {
69514
- if (err instanceof ClientError9) {
69515
- if (err.code === Status9.ALREADY_EXISTS) {
70994
+ if (err instanceof ClientError10) {
70995
+ if (err.code === Status10.ALREADY_EXISTS) {
69516
70996
  throw new AlreadyExistsError(err.details || err.message);
69517
70997
  }
69518
- if (err.code === Status9.INVALID_ARGUMENT) {
70998
+ if (err.code === Status10.INVALID_ARGUMENT) {
69519
70999
  throw new InvalidError(err.details || err.message);
69520
71000
  }
69521
71001
  }
@@ -69541,7 +71021,7 @@ var SidecarService = class {
69541
71021
  })
69542
71022
  );
69543
71023
  } catch (err) {
69544
- if (err instanceof ClientError9 && err.code === Status9.NOT_FOUND) {
71024
+ if (err instanceof ClientError10 && err.code === Status10.NOT_FOUND) {
69545
71025
  throw new NotFoundError(`Sidecar container "${name}" not found`);
69546
71026
  }
69547
71027
  throw err;
@@ -69912,151 +71392,19 @@ var SandboxSnapshotService = class {
69912
71392
  }
69913
71393
  };
69914
71394
 
69915
- // src/volume.ts
69916
- import { ClientError as ClientError10, Status as Status10 } from "nice-grpc";
69917
- var VolumeService = class {
69918
- #client;
69919
- constructor(client) {
69920
- this.#client = client;
69921
- }
69922
- /**
69923
- * Reference a {@link Volume} by its name.
69924
- */
69925
- async fromName(name, params) {
69926
- try {
69927
- const resp = await this.#client.cpClient.volumeGetOrCreate({
69928
- deploymentName: name,
69929
- environmentName: this.#client.environmentName(params?.environment),
69930
- objectCreationType: params?.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
69931
- });
69932
- this.#client.logger.debug(
69933
- "Retrieved Volume",
69934
- "volume_id",
69935
- resp.volumeId,
69936
- "volume_name",
69937
- name
69938
- );
69939
- return new Volume(resp.volumeId, name);
69940
- } catch (err) {
69941
- if (err instanceof ClientError10 && err.code === Status10.NOT_FOUND)
69942
- throw new NotFoundError(err.details);
69943
- throw err;
69944
- }
69945
- }
69946
- /**
69947
- * Create a nameless, temporary {@link Volume}.
69948
- * It persists until closeEphemeral() is called, or the process exits.
69949
- */
69950
- async ephemeral(params = {}) {
69951
- const resp = await this.#client.cpClient.volumeGetOrCreate({
69952
- objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
69953
- environmentName: this.#client.environmentName(params.environment)
69954
- });
69955
- this.#client.logger.debug(
69956
- "Created ephemeral Volume",
69957
- "volume_id",
69958
- resp.volumeId
69959
- );
69960
- const ephemeralHbManager = new EphemeralHeartbeatManager(
69961
- () => this.#client.cpClient.volumeHeartbeat({ volumeId: resp.volumeId })
69962
- );
69963
- return new Volume(resp.volumeId, void 0, void 0, ephemeralHbManager);
69964
- }
69965
- /**
69966
- * Delete a named {@link Volume}.
69967
- *
69968
- * Warning: Deletion is irreversible and will affect any Apps currently using the Volume.
69969
- */
69970
- async delete(name, params) {
69971
- try {
69972
- const volume = await this.fromName(name, {
69973
- environment: params?.environment,
69974
- createIfMissing: false
69975
- });
69976
- await this.#client.cpClient.volumeDelete({
69977
- volumeId: volume.volumeId
69978
- });
69979
- this.#client.logger.debug(
69980
- "Deleted Volume",
69981
- "volume_name",
69982
- name,
69983
- "volume_id",
69984
- volume.volumeId
69985
- );
69986
- } catch (err) {
69987
- const isNotFound = err instanceof NotFoundError || err instanceof ClientError10 && err.code === Status10.NOT_FOUND;
69988
- if (isNotFound && params?.allowMissing) {
69989
- return;
69990
- }
69991
- throw err;
69992
- }
69993
- }
69994
- };
69995
- var DEFAULT_MOUNT_OPTIONS = {
69996
- readOnly: false,
69997
- subPath: void 0
69998
- };
69999
- var Volume = class _Volume {
70000
- volumeId;
70001
- name;
70002
- /**
70003
- * @hidden
70004
- * @internal
70005
- */
70006
- _mountOptions = DEFAULT_MOUNT_OPTIONS;
70007
- #ephemeralHbManager;
70008
- /** @ignore */
70009
- constructor(volumeId, name, mountOptions, ephemeralHbManager) {
70010
- this.volumeId = volumeId;
70011
- this.name = name;
70012
- if (mountOptions) {
70013
- this._mountOptions = mountOptions;
70014
- }
70015
- this.#ephemeralHbManager = ephemeralHbManager;
70016
- }
70017
- /**
70018
- * Configure options used when mounting this Volume. Fields left undefined preserve their value
70019
- * from any previous withMountOptions call on the same Volume (stacking).
70020
- */
70021
- withMountOptions(params = {}) {
70022
- let subPath = this._mountOptions.subPath;
70023
- if (params.subPath !== void 0) {
70024
- subPath = params.subPath === "/" ? void 0 : params.subPath;
70025
- }
70026
- return new _Volume(
70027
- this.volumeId,
70028
- this.name,
70029
- {
70030
- readOnly: params.readOnly ?? this._mountOptions.readOnly,
70031
- subPath
70032
- },
70033
- this.#ephemeralHbManager
70034
- );
70035
- }
70036
- /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
70037
- closeEphemeral() {
70038
- if (this.#ephemeralHbManager) {
70039
- this.#ephemeralHbManager.stop();
70040
- } else {
70041
- throw new InvalidError("Volume is not ephemeral.");
70042
- }
70043
- }
70044
- };
70045
- function volumeToMountProto(mountPath, volume) {
70046
- const opts = volume._mountOptions ?? DEFAULT_MOUNT_OPTIONS;
70047
- return {
70048
- volumeId: volume.volumeId,
70049
- mountPath,
70050
- allowBackgroundCommits: true,
70051
- readOnly: opts.readOnly,
70052
- subPath: opts.subPath
70053
- };
70054
- }
70055
-
70056
71395
  // src/sandbox.ts
70057
71396
  var SB_LOGS_INITIAL_DELAY_MS = 10;
70058
71397
  var SB_LOGS_DELAY_FACTOR = 2;
70059
71398
  var SB_LOGS_MAX_RETRIES = 10;
71399
+ var SB_LOGS_TASK_ID_TIMEOUT_SECONDS = 0.5;
71400
+ var SANDBOX_SCHEDULING_TIMEOUT_MS = 21 * 60 * 1e3;
71401
+ var GET_TASK_ID_TIMEOUT_MS = 5 * 60 * 1e3;
71402
+ function isTransientTaskIDLookupError(err) {
71403
+ if (!(err instanceof ClientError11)) {
71404
+ return false;
71405
+ }
71406
+ return err.code === Status11.UNAVAILABLE || err.code === Status11.DEADLINE_EXCEEDED || err.code === Status11.INTERNAL;
71407
+ }
70060
71408
  var TTL_NO_EXPIRY_SENTINEL = -1;
70061
71409
  var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MIN_LENGTH = 16;
70062
71410
  var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MAX_LENGTH = 512;
@@ -70106,6 +71454,19 @@ function getSandboxVersion(sandboxId) {
70106
71454
  }
70107
71455
  return "V2" /* V2 */;
70108
71456
  }
71457
+ function sandboxRuntimeToProto(runtime) {
71458
+ switch (runtime) {
71459
+ case void 0:
71460
+ return void 0;
71461
+ case "gvisor":
71462
+ case "vm":
71463
+ return runtime;
71464
+ default:
71465
+ throw new Error(
71466
+ `runtime must be "gvisor" or "vm", got ${JSON.stringify(runtime)}`
71467
+ );
71468
+ }
71469
+ }
70109
71470
  var Probe2 = class _Probe {
70110
71471
  #tcpPort;
70111
71472
  #execArgv;
@@ -70239,6 +71600,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70239
71600
  if (params.workdir && !params.workdir.startsWith("/")) {
70240
71601
  throw new Error(`workdir must be an absolute path, got: ${params.workdir}`);
70241
71602
  }
71603
+ const runtime = sandboxRuntimeToProto(params.runtime);
70242
71604
  const volumeMounts = params.volumes ? Object.entries(params.volumes).map(
70243
71605
  ([mountPath, volume]) => volumeToMountProto(mountPath, volume)
70244
71606
  ) : [];
@@ -70290,6 +71652,19 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70290
71652
  );
70291
71653
  }
70292
71654
  }
71655
+ if (params.experimentalOutboundPolicy !== void 0) {
71656
+ params.experimentalOutboundPolicy._validate();
71657
+ if (params.blockNetwork) {
71658
+ throw new InvalidError(
71659
+ "experimentalOutboundPolicy cannot be used when blockNetwork is enabled"
71660
+ );
71661
+ }
71662
+ if (params.outboundDomainAllowlist && params.outboundDomainAllowlist.length > 0) {
71663
+ throw new InvalidError(
71664
+ "experimentalOutboundPolicy cannot be used with outboundDomainAllowlist"
71665
+ );
71666
+ }
71667
+ }
70293
71668
  const networkAccess = buildOutboundNetworkAccess(
70294
71669
  params.blockNetwork,
70295
71670
  params.outboundCidrAllowlist,
@@ -70370,6 +71745,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70370
71745
  idleTimeoutSecs: params.idleTimeoutMs != void 0 ? params.idleTimeoutMs / 1e3 : void 0,
70371
71746
  workdir: params.workdir ?? void 0,
70372
71747
  networkAccess,
71748
+ outboundPolicy: params.experimentalOutboundPolicy?._toProto(),
70373
71749
  resources: Resources.create({
70374
71750
  milliCpu,
70375
71751
  milliCpuMax,
@@ -70393,7 +71769,8 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70393
71769
  includeOidcIdentityToken: params.includeOidcIdentityToken ?? false,
70394
71770
  inboundCidrAllowlist: params.inboundCidrAllowlist ?? [],
70395
71771
  i6pnEnabled: params.i6pn ?? false,
70396
- enableSnapshot: params.experimentalEnableSnapshot ?? false
71772
+ enableSnapshot: params.experimentalEnableSnapshot ?? false,
71773
+ runtime
70397
71774
  }
70398
71775
  });
70399
71776
  }
@@ -70430,7 +71807,10 @@ var SandboxService = class {
70430
71807
  );
70431
71808
  await hydrateSandboxSecrets(
70432
71809
  this.#client,
70433
- mergedSecrets,
71810
+ [
71811
+ ...mergedSecrets,
71812
+ ...params.experimentalOutboundPolicy?._secrets() ?? []
71813
+ ],
70434
71814
  params.cloudBucketMounts
70435
71815
  );
70436
71816
  const mergedParams = {
@@ -70458,7 +71838,9 @@ var SandboxService = class {
70458
71838
  "sandbox_id",
70459
71839
  createResp.sandboxId
70460
71840
  );
70461
- return new Sandbox2(this.#client, createResp.sandboxId);
71841
+ const sb = new Sandbox2(this.#client, createResp.sandboxId);
71842
+ await sb._waitForScheduling(SANDBOX_SCHEDULING_TIMEOUT_MS);
71843
+ return sb;
70462
71844
  }
70463
71845
  /**
70464
71846
  * Create a new {@link Sandbox} using the experimental V2 backend.
@@ -70491,7 +71873,10 @@ var SandboxService = class {
70491
71873
  Object.assign(envDict, params.env ?? {});
70492
71874
  await hydrateSandboxSecrets(
70493
71875
  this.#client,
70494
- resolvableSecrets,
71876
+ [
71877
+ ...resolvableSecrets,
71878
+ ...params.experimentalOutboundPolicy?._secrets() ?? []
71879
+ ],
70495
71880
  params.cloudBucketMounts
70496
71881
  );
70497
71882
  const mergedParams = {
@@ -70897,9 +72282,10 @@ function buildTaskSnapshotDirectoryRequestProto(taskId, path2, snapshotId, ttlSe
70897
72282
  containerId
70898
72283
  });
70899
72284
  }
70900
- var Sandbox2 = class _Sandbox {
72285
+ var Sandbox2 = class {
70901
72286
  #client;
70902
72287
  sandboxId;
72288
+ #appId;
70903
72289
  #stdin;
70904
72290
  #stdout;
70905
72291
  #stderr;
@@ -70946,6 +72332,25 @@ var Sandbox2 = class _Sandbox {
70946
72332
  }
70947
72333
  return this.#stderr;
70948
72334
  }
72335
+ /**
72336
+ * Access persisted entrypoint logs emitted by this Sandbox.
72337
+ *
72338
+ * Use {@link SandboxLogsManager#fetch fetch()} to read logs from a UTC time
72339
+ * range and {@link SandboxLogsManager#tail tail()} to read the most recent
72340
+ * logs.
72341
+ *
72342
+ * This is separate from {@link Sandbox#stdout stdout} and
72343
+ * {@link Sandbox#stderr stderr}, which expose the Sandbox's live output
72344
+ * streams.
72345
+ */
72346
+ get logs() {
72347
+ return new SandboxLogsManager(
72348
+ this.#client,
72349
+ this.sandboxId,
72350
+ () => this.#getAppId(),
72351
+ () => this.#resolveTaskIdForLogs()
72352
+ );
72353
+ }
70949
72354
  #outputStream(fileDescriptor) {
70950
72355
  if (this.#isV2) {
70951
72356
  this.#ensureAttached();
@@ -71178,12 +72583,15 @@ var Sandbox2 = class _Sandbox {
71178
72583
  }
71179
72584
  return this.#client.cpClient.sandboxWait(req);
71180
72585
  }
71181
- #sandboxGetTaskId(signal) {
71182
- const req = { sandboxId: this.sandboxId };
72586
+ #sandboxGetTaskId(timeoutSecs, options) {
72587
+ const req = SandboxGetTaskIdRequest.create({
72588
+ sandboxId: this.sandboxId,
72589
+ timeout: timeoutSecs
72590
+ });
71183
72591
  if (this.#isV2) {
71184
- return this.#client.cpClient.sandboxGetTaskIdV2(req, { signal });
72592
+ return this.#client.cpClient.sandboxGetTaskIdV2(req, options);
71185
72593
  }
71186
- return this.#client.cpClient.sandboxGetTaskId(req, { signal });
72594
+ return this.#client.cpClient.sandboxGetTaskId(req, options);
71187
72595
  }
71188
72596
  #sandboxGetTunnels(timeoutMs) {
71189
72597
  const req = { sandboxId: this.sandboxId, timeout: timeoutMs / 1e3 };
@@ -71207,31 +72615,127 @@ var Sandbox2 = class _Sandbox {
71207
72615
  }
71208
72616
  await this.#client.cpClient.sandboxTerminate(req);
71209
72617
  }
71210
- static #maxGetTaskIdAttempts = 600;
71211
- // 5 minutes at 500ms intervals
72618
+ async #getAppId() {
72619
+ if (this.#appId !== void 0) {
72620
+ return this.#appId;
72621
+ }
72622
+ const resp = await this.#sandboxWait(0);
72623
+ const appId = resp.metadata?.appId;
72624
+ if (!appId) {
72625
+ throw new ExecutionError(
72626
+ "Sandbox app ID should have been set during hydration"
72627
+ );
72628
+ }
72629
+ this.#appId = appId;
72630
+ return appId;
72631
+ }
72632
+ async #resolveTaskIdForLogs() {
72633
+ if (this.#taskId !== void 0) {
72634
+ return this.#taskId;
72635
+ }
72636
+ let resp;
72637
+ try {
72638
+ resp = await this.#sandboxGetTaskId(SB_LOGS_TASK_ID_TIMEOUT_SECONDS);
72639
+ } catch (error) {
72640
+ if (error instanceof ClientError11 && error.code === Status11.DEADLINE_EXCEEDED) {
72641
+ throw new ExecutionError("Sandbox task ID is not available yet.");
72642
+ }
72643
+ throw error;
72644
+ }
72645
+ if (!resp.taskId) {
72646
+ throw new ExecutionError("Sandbox task ID is not available.");
72647
+ }
72648
+ this.#taskId = resp.taskId;
72649
+ return this.#taskId;
72650
+ }
71212
72651
  async #getTaskId(signal) {
72652
+ return await this.#waitForTaskId(GET_TASK_ID_TIMEOUT_MS, false, signal);
72653
+ }
72654
+ /**
72655
+ * Blocks until the Sandbox has a task. If the wait fails, the Sandbox is
72656
+ * terminated so a queued one cannot start later with no caller. A timeout
72657
+ * surfaces as a ResourceExhaustedError.
72658
+ *
72659
+ * @internal
72660
+ * @hidden
72661
+ */
72662
+ async _waitForScheduling(timeoutMs) {
72663
+ try {
72664
+ await this.#waitForTaskId(timeoutMs, true);
72665
+ } catch (err) {
72666
+ if (err instanceof ConflictError) {
72667
+ throw err;
72668
+ }
72669
+ try {
72670
+ await this.#sandboxTerminate();
72671
+ } catch (terminateErr) {
72672
+ this.#client.logger.debug(
72673
+ "Failed to terminate unscheduled Sandbox",
72674
+ "sandbox_id",
72675
+ this.sandboxId,
72676
+ "error",
72677
+ terminateErr
72678
+ );
72679
+ }
72680
+ if (err instanceof TimeoutError) {
72681
+ throw new ResourceExhaustedError(
72682
+ "Insufficient capacity to create sandbox."
72683
+ );
72684
+ }
72685
+ throw err;
72686
+ }
72687
+ }
72688
+ /**
72689
+ * Polls until the Sandbox has been assigned a task. Throws a ConflictError
72690
+ * if the Sandbox finished before that happened and a TimeoutError once
72691
+ * timeoutMs elapses. With retryTransient, lookups that fail with a
72692
+ * transient error keep polling until the deadline instead of failing.
72693
+ */
72694
+ async #waitForTaskId(timeoutMs, retryTransient, signal) {
71213
72695
  if (this.#taskId !== void 0) {
71214
72696
  return this.#taskId;
71215
72697
  }
71216
- for (let i = 0; i < _Sandbox.#maxGetTaskIdAttempts; i++) {
71217
- const resp = await this.#sandboxGetTaskId(signal);
72698
+ const deadline = Date.now() + timeoutMs;
72699
+ const timedOut = () => new TimeoutError(
72700
+ `Timed out waiting for task ID for Sandbox ${this.sandboxId}`
72701
+ );
72702
+ const backoff = () => setTimeout3(Math.max(0, Math.min(500, deadline - Date.now())), void 0, {
72703
+ signal
72704
+ });
72705
+ while (true) {
72706
+ if (Date.now() >= deadline) {
72707
+ throw timedOut();
72708
+ }
72709
+ let resp;
72710
+ try {
72711
+ resp = await this.#sandboxGetTaskId(void 0, { signal });
72712
+ } catch (err) {
72713
+ if (signal?.aborted || !isTransientTaskIDLookupError(err)) {
72714
+ throw err;
72715
+ }
72716
+ if (Date.now() >= deadline) {
72717
+ if (err instanceof ClientError11 && err.code === Status11.INTERNAL) {
72718
+ throw err;
72719
+ }
72720
+ throw timedOut();
72721
+ }
72722
+ if (!retryTransient) {
72723
+ throw err;
72724
+ }
72725
+ await backoff();
72726
+ continue;
72727
+ }
71218
72728
  if (resp.taskId) {
71219
72729
  this.#taskId = resp.taskId;
71220
72730
  return this.#taskId;
71221
72731
  }
71222
72732
  if (resp.taskResult) {
71223
- if (resp.taskResult.status === 1 /* GENERIC_STATUS_SUCCESS */ || !resp.taskResult.exception) {
71224
- throw new Error(`Sandbox ${this.sandboxId} has already completed`);
71225
- }
71226
- throw new Error(
71227
- `Sandbox ${this.sandboxId} has already completed with result: exception:"${resp.taskResult.exception}"`
72733
+ throw new ConflictError(
72734
+ resp.taskResult.exception || `Sandbox ${this.sandboxId} has already finished`
71228
72735
  );
71229
72736
  }
71230
- await setTimeout3(500, void 0, { signal });
72737
+ await backoff();
71231
72738
  }
71232
- throw new Error(
71233
- `Timed out waiting for task ID for Sandbox ${this.sandboxId}`
71234
- );
71235
72739
  }
71236
72740
  async #getOrCreateCommandRouterClient(taskId) {
71237
72741
  if (this.#commandRouterClient !== void 0) {
@@ -71523,7 +73027,7 @@ var Sandbox2 = class _Sandbox {
71523
73027
  return new Image2(this.#client, resp.success.imageId, "");
71524
73028
  }
71525
73029
  if (resp.error) {
71526
- if (resp.error.errorCode === 1 /* ERROR_CODE_TIMEOUT */) {
73030
+ if (resp.error.errorCode === 1 /* ERROR_CODE_TIMEOUT */ || resp.error.errorCode === 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */) {
71527
73031
  throw new SnapshotCreationError(
71528
73032
  resp.error.message || "No exit snapshot image will be produced"
71529
73033
  );
@@ -71637,6 +73141,31 @@ var Sandbox2 = class _Sandbox {
71637
73141
  });
71638
73142
  await commandRouterClient.setNetworkAccess(request);
71639
73143
  }
73144
+ /**
73145
+ * Replace the outbound policy of a running Sandbox.
73146
+ *
73147
+ * EXPERIMENTAL: the API is subject to change.
73148
+ *
73149
+ * The new policy replaces all existing policy configuration on the
73150
+ * Sandbox; build a policy including any existing rules you want to keep.
73151
+ *
73152
+ * Only Sandboxes created with an `experimentalOutboundPolicy` can be updated this
73153
+ * way; for Sandboxes created without one this fails, since header
73154
+ * replacement is only set up at creation time.
73155
+ */
73156
+ async experimentalUpdateOutboundPolicy(outboundPolicy) {
73157
+ this.#ensureAttached();
73158
+ outboundPolicy._validate();
73159
+ const [, [taskId, commandRouterClient]] = await Promise.all([
73160
+ hydrateSecrets(this.#client, outboundPolicy._secrets()),
73161
+ this.#getCommandRouter()
73162
+ ]);
73163
+ const request = TaskSetOutboundPolicyRequest.create({
73164
+ taskId,
73165
+ outboundPolicy: outboundPolicy._toProto()
73166
+ });
73167
+ await commandRouterClient.setOutboundPolicy(request);
73168
+ }
71640
73169
  /**
71641
73170
  * Reload all Volumes mounted in the Sandbox.
71642
73171
  *
@@ -72194,7 +73723,7 @@ var AuthTokenManager = class {
72194
73723
  };
72195
73724
 
72196
73725
  // src/version.ts
72197
- var SDK_VERSION = "0.10.2-dev.0";
73726
+ var SDK_VERSION = "0.10.2-dev.10";
72198
73727
  function getSDKVersion() {
72199
73728
  return SDK_VERSION;
72200
73729
  }
@@ -72466,7 +73995,7 @@ var ModalClient = class {
72466
73995
  "grpc.keepalive_timeout_ms": 1e4,
72467
73996
  "grpc.keepalive_permit_without_calls": 1
72468
73997
  });
72469
- let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(timeoutMiddleware);
73998
+ let factory = createClientFactory2().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(serverWarningMiddleware(this.logger)).use(timeoutMiddleware);
72470
73999
  for (const middleware of this.customMiddleware) {
72471
74000
  factory = factory.use(middleware);
72472
74001
  }
@@ -72639,6 +74168,7 @@ var ModalClient = class {
72639
74168
  return this.authTokenManager;
72640
74169
  };
72641
74170
  const oauthJwtKey = this.oauthJwtKey;
74171
+ const host = new URL(profile.serverUrl).hostname;
72642
74172
  return async function* authMiddleware(call, options) {
72643
74173
  const hasOAuthCredentials = Boolean(
72644
74174
  profile.oauthRefreshToken && profile.oauthClientId && (profile.oauthClientSecret || oauthJwtKey)
@@ -72679,6 +74209,7 @@ var ModalClient = class {
72679
74209
  options.metadata.set("x-modal-token-id", profile.tokenId);
72680
74210
  options.metadata.set("x-modal-token-secret", profile.tokenSecret);
72681
74211
  }
74212
+ options.metadata.set("x-modal-host", host);
72682
74213
  if (call.method.path !== "/modal.client.ModalClient/AuthTokenGet") {
72683
74214
  const tokenManager = getOrCreateAuthTokenManager();
72684
74215
  const token = await tokenManager.getToken();
@@ -72938,6 +74469,8 @@ function contextIds(batch, item, ObjectId) {
72938
74469
  item.inputId || batch.inputId,
72939
74470
  item.containerId || batch.taskId
72940
74471
  ].filter((id) => id);
74472
+ case "sb":
74473
+ return [item.containerId || batch.taskId].filter((id) => id);
72941
74474
  default:
72942
74475
  return [];
72943
74476
  }
@@ -73758,6 +75291,97 @@ var FunctionCallLogsManager = class extends LogsManager {
73758
75291
  );
73759
75292
  }
73760
75293
  };
75294
+ var SandboxLogsManager = class {
75295
+ /** @ignore */
75296
+ constructor(client, sandboxId, getAppId, getTaskId) {
75297
+ this.client = client;
75298
+ this.sandboxId = sandboxId;
75299
+ this.getAppId = getAppId;
75300
+ this.getTaskId = getTaskId;
75301
+ }
75302
+ /**
75303
+ * Fetch Sandbox entrypoint logs corresponding to a UTC time range and
75304
+ * optional filters.
75305
+ *
75306
+ * Entries are returned in chronological order.
75307
+ *
75308
+ * @returns An async iterable of {@link LogEntry} objects.
75309
+ *
75310
+ * @example
75311
+ * ```typescript
75312
+ * import { ModalClient } from "modal";
75313
+ *
75314
+ * const modal = new ModalClient();
75315
+ * const sandbox = await modal.sandboxes.fromId("sb-...");
75316
+ *
75317
+ * for await (const entry of sandbox.logs.fetch({
75318
+ * since: new Date(Date.now() - 60 * 60 * 1_000),
75319
+ * source: "stdout",
75320
+ * })) {
75321
+ * process.stdout.write(entry.message);
75322
+ * }
75323
+ * ```
75324
+ */
75325
+ async *fetch(params) {
75326
+ const [appId, taskId] = await Promise.all([
75327
+ this.getAppId(),
75328
+ this.getTaskId()
75329
+ ]);
75330
+ if (!taskId) {
75331
+ throw new ExecutionError(
75332
+ "Cannot resolve Sandbox metadata needed for fetching logs. Wait for the Sandbox to be scheduled."
75333
+ );
75334
+ }
75335
+ yield* fetchLogs(
75336
+ this.client,
75337
+ {
75338
+ appId,
75339
+ objectId: this.sandboxId,
75340
+ taskId,
75341
+ source: sourceToFileDescriptor(params.source),
75342
+ searchText: params.searchText
75343
+ },
75344
+ params.since,
75345
+ params.until
75346
+ );
75347
+ }
75348
+ /**
75349
+ * Fetch the most recent Sandbox entrypoint logs.
75350
+ *
75351
+ * Entries are returned in chronological order.
75352
+ *
75353
+ * @returns An async iterable of {@link LogEntry} objects.
75354
+ *
75355
+ * @example
75356
+ * ```typescript
75357
+ * import { ModalClient } from "modal";
75358
+ *
75359
+ * const modal = new ModalClient();
75360
+ * const sandbox = await modal.sandboxes.fromId("sb-...");
75361
+ *
75362
+ * for await (const entry of sandbox.logs.tail({ entries: 20 })) {
75363
+ * process.stdout.write(entry.message);
75364
+ * }
75365
+ * ```
75366
+ */
75367
+ async *tail(params = {}) {
75368
+ const [appId, taskId] = await Promise.all([
75369
+ this.getAppId(),
75370
+ this.getTaskId()
75371
+ ]);
75372
+ if (!taskId) {
75373
+ throw new ExecutionError(
75374
+ "Sandbox task ID cannot be empty when fetching logs. Wait for the Sandbox to be scheduled."
75375
+ );
75376
+ }
75377
+ yield* tailLogs(this.client, params.entries ?? 100, {
75378
+ appId,
75379
+ objectId: this.sandboxId,
75380
+ taskId,
75381
+ source: sourceToFileDescriptor(params.source)
75382
+ });
75383
+ }
75384
+ };
73761
75385
 
73762
75386
  // src/function_call.ts
73763
75387
  var FunctionCallService = class {
@@ -74525,6 +76149,129 @@ var ClsInstance = class {
74525
76149
  return method;
74526
76150
  }
74527
76151
  };
76152
+
76153
+ // src/outbound_policy.ts
76154
+ var DOMAIN_RE = /^(\*\.)?([a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?$/;
76155
+ var HEADER_NAME_RE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;
76156
+ var MAX_HEADER_REPLACEMENTS = 25;
76157
+ function hasInvalidHeaderValueChar(value) {
76158
+ for (const c of value) {
76159
+ const code = c.codePointAt(0);
76160
+ if (code < 32 && c !== " " || code === 127) {
76161
+ return true;
76162
+ }
76163
+ }
76164
+ return false;
76165
+ }
76166
+ function templateReferencesKey(template) {
76167
+ const isKeyStart = (c) => /[a-zA-Z_]/.test(c);
76168
+ let i = template.indexOf("$");
76169
+ while (i !== -1 && i + 1 < template.length) {
76170
+ const c = template[i + 1];
76171
+ if (c === "$") {
76172
+ i = template.indexOf("$", i + 2);
76173
+ continue;
76174
+ }
76175
+ if (isKeyStart(c)) {
76176
+ return true;
76177
+ }
76178
+ i = template.indexOf("$", i + 1);
76179
+ }
76180
+ return false;
76181
+ }
76182
+ var ExperimentalOutboundPolicy = class _ExperimentalOutboundPolicy {
76183
+ /** @internal */
76184
+ _replacements;
76185
+ /** @internal */
76186
+ constructor(_replacements = []) {
76187
+ this._replacements = _replacements;
76188
+ }
76189
+ /**
76190
+ * Return a new {@link ExperimentalOutboundPolicy} with an added header replacement.
76191
+ *
76192
+ * @param params.domain Domain the replacements are scoped to. Supports `*.` wildcard
76193
+ * prefixes (matching the apex domain and subdomains) and a bare `"*"`.
76194
+ * @param params.headers Header name -> header value. Values support `$KEY` templates
76195
+ * referencing keys in the replacement's `secret`.
76196
+ * @param params.secret Named {@link Secret} (e.g. from `client.secrets.fromName`) whose
76197
+ * keys may be referenced in the header value templates. Static replacements pass no secret.
76198
+ */
76199
+ withHeaderReplacement(params) {
76200
+ const { domain, headers, secret } = params;
76201
+ return new _ExperimentalOutboundPolicy([
76202
+ ...this._replacements,
76203
+ { domain, headers: { ...headers }, secret }
76204
+ ]);
76205
+ }
76206
+ /** Check all replacements, throwing `InvalidError` on the first violation found.
76207
+ * @internal
76208
+ */
76209
+ _validate() {
76210
+ let total = 0;
76211
+ for (const replacement of this._replacements) {
76212
+ const { domain, headers, secret } = replacement;
76213
+ if (domain !== "*" && !DOMAIN_RE.test(domain)) {
76214
+ throw new InvalidError(`Invalid domain: ${JSON.stringify(domain)}`);
76215
+ }
76216
+ const entries = Object.entries(headers);
76217
+ if (entries.length === 0) {
76218
+ throw new InvalidError("`headers` must contain at least one header");
76219
+ }
76220
+ for (const [name, value] of entries) {
76221
+ if (!HEADER_NAME_RE.test(name)) {
76222
+ throw new InvalidError(
76223
+ `Invalid header name: ${JSON.stringify(name)}`
76224
+ );
76225
+ }
76226
+ if (hasInvalidHeaderValueChar(value)) {
76227
+ throw new InvalidError(
76228
+ `Header value for ${JSON.stringify(name)} must not contain control characters (except tab)`
76229
+ );
76230
+ }
76231
+ if (secret === void 0 && templateReferencesKey(value)) {
76232
+ throw new InvalidError(
76233
+ `Header value for ${JSON.stringify(name)} references a secret key, but no \`secret\` was passed`
76234
+ );
76235
+ }
76236
+ }
76237
+ if (secret !== void 0 && secretEnvDictHydrator(secret) !== void 0) {
76238
+ throw new InvalidError(
76239
+ "Outbound policies only support named secrets (e.g. `client.secrets.fromName`); ephemeral secrets (e.g. `client.secrets.fromObject`) are not yet supported"
76240
+ );
76241
+ }
76242
+ total += entries.length;
76243
+ }
76244
+ if (total > MAX_HEADER_REPLACEMENTS) {
76245
+ throw new InvalidError(
76246
+ `Outbound policy cannot have more than ${MAX_HEADER_REPLACEMENTS} header replacements`
76247
+ );
76248
+ }
76249
+ }
76250
+ /** Deduplicated list of secrets referenced by the policy's replacements.
76251
+ * @internal
76252
+ */
76253
+ _secrets() {
76254
+ return [
76255
+ ...new Set(
76256
+ this._replacements.map((s) => s.secret).filter((s) => s !== void 0)
76257
+ )
76258
+ ];
76259
+ }
76260
+ /** Convert to the wire format. Referenced secrets must be hydrated first.
76261
+ * @internal
76262
+ */
76263
+ _toProto() {
76264
+ return OutboundPolicy.create({
76265
+ headerReplacements: this._replacements.map(
76266
+ (replacement) => OutboundPolicy_HeaderReplacement.create({
76267
+ domain: replacement.domain,
76268
+ secretId: replacement.secret?.secretId ?? "",
76269
+ headers: replacement.headers
76270
+ })
76271
+ )
76272
+ });
76273
+ }
76274
+ };
74528
76275
  export {
74529
76276
  AlreadyExistsError,
74530
76277
  App,
@@ -74538,6 +76285,7 @@ export {
74538
76285
  ConflictError,
74539
76286
  ContainerProcess2 as ContainerProcess,
74540
76287
  ExecutionError,
76288
+ ExperimentalOutboundPolicy,
74541
76289
  FunctionCall,
74542
76290
  FunctionCallLogsManager,
74543
76291
  FunctionCallService,
@@ -74559,6 +76307,7 @@ export {
74559
76307
  QueueFullError,
74560
76308
  QueueService,
74561
76309
  RemoteError,
76310
+ ResourceExhaustedError,
74562
76311
  Retries,
74563
76312
  Sandbox2 as Sandbox,
74564
76313
  SandboxFilesystem,
@@ -74570,6 +76319,7 @@ export {
74570
76319
  SandboxFilesystemNotFoundError,
74571
76320
  SandboxFilesystemPathAlreadyExistsError,
74572
76321
  SandboxFilesystemPermissionError,
76322
+ SandboxLogsManager,
74573
76323
  SandboxService,
74574
76324
  SandboxSnapshot,
74575
76325
  SandboxSnapshotService,