modal 0.10.2-dev.1 → 0.10.2-dev.11

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.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  ConflictError: () => ConflictError,
43
43
  ContainerProcess: () => ContainerProcess2,
44
44
  ExecutionError: () => ExecutionError,
45
+ ExperimentalOutboundPolicy: () => ExperimentalOutboundPolicy,
45
46
  FunctionCall: () => FunctionCall,
46
47
  FunctionCallLogsManager: () => FunctionCallLogsManager,
47
48
  FunctionCallService: () => FunctionCallService,
@@ -63,6 +64,7 @@ __export(index_exports, {
63
64
  QueueFullError: () => QueueFullError,
64
65
  QueueService: () => QueueService,
65
66
  RemoteError: () => RemoteError,
67
+ ResourceExhaustedError: () => ResourceExhaustedError,
66
68
  Retries: () => Retries,
67
69
  Sandbox: () => Sandbox2,
68
70
  SandboxFilesystem: () => SandboxFilesystem,
@@ -74,6 +76,7 @@ __export(index_exports, {
74
76
  SandboxFilesystemNotFoundError: () => SandboxFilesystemNotFoundError,
75
77
  SandboxFilesystemPathAlreadyExistsError: () => SandboxFilesystemPathAlreadyExistsError,
76
78
  SandboxFilesystemPermissionError: () => SandboxFilesystemPermissionError,
79
+ SandboxLogsManager: () => SandboxLogsManager,
77
80
  SandboxService: () => SandboxService,
78
81
  SandboxSnapshot: () => SandboxSnapshot,
79
82
  SandboxSnapshotService: () => SandboxSnapshotService,
@@ -2349,6 +2352,76 @@ function fileDescriptorToJSON(object) {
2349
2352
  return "UNRECOGNIZED";
2350
2353
  }
2351
2354
  }
2355
+ function functionCallInputStatusFromJSON(object) {
2356
+ switch (object) {
2357
+ case 0:
2358
+ case "FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED":
2359
+ return 0 /* FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED */;
2360
+ case 1:
2361
+ case "FUNCTION_CALL_INPUT_STATUS_PENDING":
2362
+ return 1 /* FUNCTION_CALL_INPUT_STATUS_PENDING */;
2363
+ case 2:
2364
+ case "FUNCTION_CALL_INPUT_STATUS_RUNNING":
2365
+ return 2 /* FUNCTION_CALL_INPUT_STATUS_RUNNING */;
2366
+ case 3:
2367
+ case "FUNCTION_CALL_INPUT_STATUS_SUCCESS":
2368
+ return 3 /* FUNCTION_CALL_INPUT_STATUS_SUCCESS */;
2369
+ case 4:
2370
+ case "FUNCTION_CALL_INPUT_STATUS_FAILURE":
2371
+ return 4 /* FUNCTION_CALL_INPUT_STATUS_FAILURE */;
2372
+ case 5:
2373
+ case "FUNCTION_CALL_INPUT_STATUS_TIMEOUT":
2374
+ return 5 /* FUNCTION_CALL_INPUT_STATUS_TIMEOUT */;
2375
+ case 6:
2376
+ case "FUNCTION_CALL_INPUT_STATUS_TERMINATED":
2377
+ return 6 /* FUNCTION_CALL_INPUT_STATUS_TERMINATED */;
2378
+ case 7:
2379
+ case "FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE":
2380
+ return 7 /* FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE */;
2381
+ case 8:
2382
+ case "FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE":
2383
+ return 8 /* FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE */;
2384
+ case 9:
2385
+ case "FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT":
2386
+ return 9 /* FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT */;
2387
+ case 10:
2388
+ case "FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION":
2389
+ return 10 /* FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION */;
2390
+ case -1:
2391
+ case "UNRECOGNIZED":
2392
+ default:
2393
+ return -1 /* UNRECOGNIZED */;
2394
+ }
2395
+ }
2396
+ function functionCallInputStatusToJSON(object) {
2397
+ switch (object) {
2398
+ case 0 /* FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED */:
2399
+ return "FUNCTION_CALL_INPUT_STATUS_UNSPECIFIED";
2400
+ case 1 /* FUNCTION_CALL_INPUT_STATUS_PENDING */:
2401
+ return "FUNCTION_CALL_INPUT_STATUS_PENDING";
2402
+ case 2 /* FUNCTION_CALL_INPUT_STATUS_RUNNING */:
2403
+ return "FUNCTION_CALL_INPUT_STATUS_RUNNING";
2404
+ case 3 /* FUNCTION_CALL_INPUT_STATUS_SUCCESS */:
2405
+ return "FUNCTION_CALL_INPUT_STATUS_SUCCESS";
2406
+ case 4 /* FUNCTION_CALL_INPUT_STATUS_FAILURE */:
2407
+ return "FUNCTION_CALL_INPUT_STATUS_FAILURE";
2408
+ case 5 /* FUNCTION_CALL_INPUT_STATUS_TIMEOUT */:
2409
+ return "FUNCTION_CALL_INPUT_STATUS_TIMEOUT";
2410
+ case 6 /* FUNCTION_CALL_INPUT_STATUS_TERMINATED */:
2411
+ return "FUNCTION_CALL_INPUT_STATUS_TERMINATED";
2412
+ case 7 /* FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE */:
2413
+ return "FUNCTION_CALL_INPUT_STATUS_INIT_FAILURE";
2414
+ case 8 /* FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE */:
2415
+ return "FUNCTION_CALL_INPUT_STATUS_INTERNAL_FAILURE";
2416
+ case 9 /* FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT */:
2417
+ return "FUNCTION_CALL_INPUT_STATUS_IDLE_TIMEOUT";
2418
+ case 10 /* FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION */:
2419
+ return "FUNCTION_CALL_INPUT_STATUS_MEMORY_MANAGER_EVICTION";
2420
+ case -1 /* UNRECOGNIZED */:
2421
+ default:
2422
+ return "UNRECOGNIZED";
2423
+ }
2424
+ }
2352
2425
  function functionCallInvocationTypeFromJSON(object) {
2353
2426
  switch (object) {
2354
2427
  case 0:
@@ -3610,6 +3683,9 @@ function sandboxGetExitSnapshotResponse_ErrorCodeFromJSON(object) {
3610
3683
  case 2:
3611
3684
  case "ERROR_CODE_INTERNAL":
3612
3685
  return 2 /* ERROR_CODE_INTERNAL */;
3686
+ case 3:
3687
+ case "ERROR_CODE_FILESYSTEM_INCONSISTENT":
3688
+ return 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */;
3613
3689
  case -1:
3614
3690
  case "UNRECOGNIZED":
3615
3691
  default:
@@ -3624,6 +3700,8 @@ function sandboxGetExitSnapshotResponse_ErrorCodeToJSON(object) {
3624
3700
  return "ERROR_CODE_TIMEOUT";
3625
3701
  case 2 /* ERROR_CODE_INTERNAL */:
3626
3702
  return "ERROR_CODE_INTERNAL";
3703
+ case 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */:
3704
+ return "ERROR_CODE_FILESYSTEM_INCONSISTENT";
3627
3705
  case -1 /* UNRECOGNIZED */:
3628
3706
  default:
3629
3707
  return "UNRECOGNIZED";
@@ -5508,7 +5586,7 @@ var AppGetInfoResponse = {
5508
5586
  }
5509
5587
  };
5510
5588
  function createBaseAppGetInfoResponse_FunctionInfoSummary() {
5511
- return { gpuConfig: [], schedule: void 0, webFunction: false, requiresProxyAuth: void 0 };
5589
+ return { gpuConfig: [], schedule: void 0, webFunction: false, requiresProxyAuth: void 0, isSessioned: false };
5512
5590
  }
5513
5591
  var AppGetInfoResponse_FunctionInfoSummary = {
5514
5592
  encode(message, writer = new BinaryWriter()) {
@@ -5524,6 +5602,9 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5524
5602
  if (message.requiresProxyAuth !== void 0) {
5525
5603
  writer.uint32(32).bool(message.requiresProxyAuth);
5526
5604
  }
5605
+ if (message.isSessioned !== false) {
5606
+ writer.uint32(40).bool(message.isSessioned);
5607
+ }
5527
5608
  return writer;
5528
5609
  },
5529
5610
  decode(input, length) {
@@ -5561,6 +5642,13 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5561
5642
  message.requiresProxyAuth = reader.bool();
5562
5643
  continue;
5563
5644
  }
5645
+ case 5: {
5646
+ if (tag !== 40) {
5647
+ break;
5648
+ }
5649
+ message.isSessioned = reader.bool();
5650
+ continue;
5651
+ }
5564
5652
  }
5565
5653
  if ((tag & 7) === 4 || tag === 0) {
5566
5654
  break;
@@ -5574,7 +5662,8 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5574
5662
  gpuConfig: globalThis.Array.isArray(object?.gpuConfig) ? object.gpuConfig.map((e) => GPUConfig.fromJSON(e)) : [],
5575
5663
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
5576
5664
  webFunction: isSet5(object.webFunction) ? globalThis.Boolean(object.webFunction) : false,
5577
- requiresProxyAuth: isSet5(object.requiresProxyAuth) ? globalThis.Boolean(object.requiresProxyAuth) : void 0
5665
+ requiresProxyAuth: isSet5(object.requiresProxyAuth) ? globalThis.Boolean(object.requiresProxyAuth) : void 0,
5666
+ isSessioned: isSet5(object.isSessioned) ? globalThis.Boolean(object.isSessioned) : false
5578
5667
  };
5579
5668
  },
5580
5669
  toJSON(message) {
@@ -5591,6 +5680,9 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5591
5680
  if (message.requiresProxyAuth !== void 0) {
5592
5681
  obj.requiresProxyAuth = message.requiresProxyAuth;
5593
5682
  }
5683
+ if (message.isSessioned !== false) {
5684
+ obj.isSessioned = message.isSessioned;
5685
+ }
5594
5686
  return obj;
5595
5687
  },
5596
5688
  create(base) {
@@ -5602,6 +5694,7 @@ var AppGetInfoResponse_FunctionInfoSummary = {
5602
5694
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
5603
5695
  message.webFunction = object.webFunction ?? false;
5604
5696
  message.requiresProxyAuth = object.requiresProxyAuth ?? void 0;
5697
+ message.isSessioned = object.isSessioned ?? false;
5605
5698
  return message;
5606
5699
  }
5607
5700
  };
@@ -17731,7 +17824,8 @@ function createBaseEndpointCreateRequest() {
17731
17824
  inputModalities: [],
17732
17825
  environmentName: "",
17733
17826
  unauthenticated: false,
17734
- servingMode: 0
17827
+ servingMode: 0,
17828
+ sharedEndpointNoticeAcknowledged: false
17735
17829
  };
17736
17830
  }
17737
17831
  var EndpointCreateRequest = {
@@ -17770,6 +17864,9 @@ var EndpointCreateRequest = {
17770
17864
  if (message.servingMode !== 0) {
17771
17865
  writer.uint32(80).int32(message.servingMode);
17772
17866
  }
17867
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
17868
+ writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
17869
+ }
17773
17870
  return writer;
17774
17871
  },
17775
17872
  decode(input, length) {
@@ -17863,6 +17960,13 @@ var EndpointCreateRequest = {
17863
17960
  message.servingMode = reader.int32();
17864
17961
  continue;
17865
17962
  }
17963
+ case 11: {
17964
+ if (tag !== 88) {
17965
+ break;
17966
+ }
17967
+ message.sharedEndpointNoticeAcknowledged = reader.bool();
17968
+ continue;
17969
+ }
17866
17970
  }
17867
17971
  if ((tag & 7) === 4 || tag === 0) {
17868
17972
  break;
@@ -17882,7 +17986,8 @@ var EndpointCreateRequest = {
17882
17986
  inputModalities: globalThis.Array.isArray(object?.inputModalities) ? object.inputModalities.map((e) => endpointInputModalityFromJSON(e)) : [],
17883
17987
  environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
17884
17988
  unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
17885
- servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0
17989
+ servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
17990
+ sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
17886
17991
  };
17887
17992
  },
17888
17993
  toJSON(message) {
@@ -17917,6 +18022,9 @@ var EndpointCreateRequest = {
17917
18022
  if (message.servingMode !== 0) {
17918
18023
  obj.servingMode = endpointServingModeToJSON(message.servingMode);
17919
18024
  }
18025
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
18026
+ obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
18027
+ }
17920
18028
  return obj;
17921
18029
  },
17922
18030
  create(base) {
@@ -17934,6 +18042,7 @@ var EndpointCreateRequest = {
17934
18042
  message.environmentName = object.environmentName ?? "";
17935
18043
  message.unauthenticated = object.unauthenticated ?? false;
17936
18044
  message.servingMode = object.servingMode ?? 0;
18045
+ message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
17937
18046
  return message;
17938
18047
  }
17939
18048
  };
@@ -22492,8 +22601,6 @@ function createBaseFunctionMessage() {
22492
22601
  cloudBucketMounts: [],
22493
22602
  schedulerPlacement: void 0,
22494
22603
  isClass: false,
22495
- useFunctionId: "",
22496
- useMethodName: "",
22497
22604
  classParameterInfo: void 0,
22498
22605
  batchMaxSize: 0,
22499
22606
  batchLingerMs: 0,
@@ -22506,7 +22613,6 @@ function createBaseFunctionMessage() {
22506
22613
  ExperimentalFabricSize: 0,
22507
22614
  untrusted: false,
22508
22615
  ExperimentalBufferContainers: 0,
22509
- ExperimentalProxyIp: void 0,
22510
22616
  runtimePerfRecord: false,
22511
22617
  schedule: void 0,
22512
22618
  snapshotDebug: false,
@@ -22664,12 +22770,6 @@ var FunctionMessage = {
22664
22770
  if (message.isClass !== false) {
22665
22771
  writer.uint32(424).bool(message.isClass);
22666
22772
  }
22667
- if (message.useFunctionId !== "") {
22668
- writer.uint32(434).string(message.useFunctionId);
22669
- }
22670
- if (message.useMethodName !== "") {
22671
- writer.uint32(442).string(message.useMethodName);
22672
- }
22673
22773
  if (message.classParameterInfo !== void 0) {
22674
22774
  ClassParameterInfo.encode(message.classParameterInfo, writer.uint32(450).fork()).join();
22675
22775
  }
@@ -22706,9 +22806,6 @@ var FunctionMessage = {
22706
22806
  if (message.ExperimentalBufferContainers !== 0) {
22707
22807
  writer.uint32(552).uint32(message.ExperimentalBufferContainers);
22708
22808
  }
22709
- if (message.ExperimentalProxyIp !== void 0) {
22710
- writer.uint32(562).string(message.ExperimentalProxyIp);
22711
- }
22712
22809
  if (message.runtimePerfRecord !== false) {
22713
22810
  writer.uint32(568).bool(message.runtimePerfRecord);
22714
22811
  }
@@ -23095,20 +23192,6 @@ var FunctionMessage = {
23095
23192
  message.isClass = reader.bool();
23096
23193
  continue;
23097
23194
  }
23098
- case 54: {
23099
- if (tag !== 434) {
23100
- break;
23101
- }
23102
- message.useFunctionId = reader.string();
23103
- continue;
23104
- }
23105
- case 55: {
23106
- if (tag !== 442) {
23107
- break;
23108
- }
23109
- message.useMethodName = reader.string();
23110
- continue;
23111
- }
23112
23195
  case 56: {
23113
23196
  if (tag !== 450) {
23114
23197
  break;
@@ -23193,13 +23276,6 @@ var FunctionMessage = {
23193
23276
  message.ExperimentalBufferContainers = reader.uint32();
23194
23277
  continue;
23195
23278
  }
23196
- case 70: {
23197
- if (tag !== 562) {
23198
- break;
23199
- }
23200
- message.ExperimentalProxyIp = reader.string();
23201
- continue;
23202
- }
23203
23279
  case 71: {
23204
23280
  if (tag !== 568) {
23205
23281
  break;
@@ -23441,8 +23517,6 @@ var FunctionMessage = {
23441
23517
  cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
23442
23518
  schedulerPlacement: isSet5(object.schedulerPlacement) ? SchedulerPlacement.fromJSON(object.schedulerPlacement) : void 0,
23443
23519
  isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
23444
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
23445
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
23446
23520
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
23447
23521
  batchMaxSize: isSet5(object.batchMaxSize) ? globalThis.Number(object.batchMaxSize) : 0,
23448
23522
  batchLingerMs: isSet5(object.batchLingerMs) ? globalThis.Number(object.batchLingerMs) : 0,
@@ -23455,7 +23529,6 @@ var FunctionMessage = {
23455
23529
  ExperimentalFabricSize: isSet5(object.ExperimentalFabricSize) ? globalThis.Number(object.ExperimentalFabricSize) : 0,
23456
23530
  untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
23457
23531
  ExperimentalBufferContainers: isSet5(object.ExperimentalBufferContainers) ? globalThis.Number(object.ExperimentalBufferContainers) : 0,
23458
- ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
23459
23532
  runtimePerfRecord: isSet5(object.runtimePerfRecord) ? globalThis.Boolean(object.runtimePerfRecord) : false,
23460
23533
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
23461
23534
  snapshotDebug: isSet5(object.snapshotDebug) ? globalThis.Boolean(object.snapshotDebug) : false,
@@ -23619,12 +23692,6 @@ var FunctionMessage = {
23619
23692
  if (message.isClass !== false) {
23620
23693
  obj.isClass = message.isClass;
23621
23694
  }
23622
- if (message.useFunctionId !== "") {
23623
- obj.useFunctionId = message.useFunctionId;
23624
- }
23625
- if (message.useMethodName !== "") {
23626
- obj.useMethodName = message.useMethodName;
23627
- }
23628
23695
  if (message.classParameterInfo !== void 0) {
23629
23696
  obj.classParameterInfo = ClassParameterInfo.toJSON(message.classParameterInfo);
23630
23697
  }
@@ -23661,9 +23728,6 @@ var FunctionMessage = {
23661
23728
  if (message.ExperimentalBufferContainers !== 0) {
23662
23729
  obj.ExperimentalBufferContainers = Math.round(message.ExperimentalBufferContainers);
23663
23730
  }
23664
- if (message.ExperimentalProxyIp !== void 0) {
23665
- obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
23666
- }
23667
23731
  if (message.runtimePerfRecord !== false) {
23668
23732
  obj.runtimePerfRecord = message.runtimePerfRecord;
23669
23733
  }
@@ -23798,8 +23862,6 @@ var FunctionMessage = {
23798
23862
  message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
23799
23863
  message.schedulerPlacement = object.schedulerPlacement !== void 0 && object.schedulerPlacement !== null ? SchedulerPlacement.fromPartial(object.schedulerPlacement) : void 0;
23800
23864
  message.isClass = object.isClass ?? false;
23801
- message.useFunctionId = object.useFunctionId ?? "";
23802
- message.useMethodName = object.useMethodName ?? "";
23803
23865
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
23804
23866
  message.batchMaxSize = object.batchMaxSize ?? 0;
23805
23867
  message.batchLingerMs = object.batchLingerMs ?? 0;
@@ -23812,7 +23874,6 @@ var FunctionMessage = {
23812
23874
  message.ExperimentalFabricSize = object.ExperimentalFabricSize ?? 0;
23813
23875
  message.untrusted = object.untrusted ?? false;
23814
23876
  message.ExperimentalBufferContainers = object.ExperimentalBufferContainers ?? 0;
23815
- message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
23816
23877
  message.runtimePerfRecord = object.runtimePerfRecord ?? false;
23817
23878
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
23818
23879
  message.snapshotDebug = object.snapshotDebug ?? false;
@@ -24508,6 +24569,193 @@ var FunctionCallCancelRequest = {
24508
24569
  return message;
24509
24570
  }
24510
24571
  };
24572
+ function createBaseFunctionCallFetchRequest() {
24573
+ return { functionId: "", tail: void 0, allVariants: false };
24574
+ }
24575
+ var FunctionCallFetchRequest = {
24576
+ encode(message, writer = new BinaryWriter()) {
24577
+ if (message.functionId !== "") {
24578
+ writer.uint32(10).string(message.functionId);
24579
+ }
24580
+ if (message.tail !== void 0) {
24581
+ FunctionCallFetchRequest_Tail.encode(message.tail, writer.uint32(26).fork()).join();
24582
+ }
24583
+ if (message.allVariants !== false) {
24584
+ writer.uint32(32).bool(message.allVariants);
24585
+ }
24586
+ return writer;
24587
+ },
24588
+ decode(input, length) {
24589
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24590
+ let end = length === void 0 ? reader.len : reader.pos + length;
24591
+ const message = createBaseFunctionCallFetchRequest();
24592
+ while (reader.pos < end) {
24593
+ const tag = reader.uint32();
24594
+ switch (tag >>> 3) {
24595
+ case 1: {
24596
+ if (tag !== 10) {
24597
+ break;
24598
+ }
24599
+ message.functionId = reader.string();
24600
+ continue;
24601
+ }
24602
+ case 3: {
24603
+ if (tag !== 26) {
24604
+ break;
24605
+ }
24606
+ message.tail = FunctionCallFetchRequest_Tail.decode(reader, reader.uint32());
24607
+ continue;
24608
+ }
24609
+ case 4: {
24610
+ if (tag !== 32) {
24611
+ break;
24612
+ }
24613
+ message.allVariants = reader.bool();
24614
+ continue;
24615
+ }
24616
+ }
24617
+ if ((tag & 7) === 4 || tag === 0) {
24618
+ break;
24619
+ }
24620
+ reader.skip(tag & 7);
24621
+ }
24622
+ return message;
24623
+ },
24624
+ fromJSON(object) {
24625
+ return {
24626
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
24627
+ tail: isSet5(object.tail) ? FunctionCallFetchRequest_Tail.fromJSON(object.tail) : void 0,
24628
+ allVariants: isSet5(object.allVariants) ? globalThis.Boolean(object.allVariants) : false
24629
+ };
24630
+ },
24631
+ toJSON(message) {
24632
+ const obj = {};
24633
+ if (message.functionId !== "") {
24634
+ obj.functionId = message.functionId;
24635
+ }
24636
+ if (message.tail !== void 0) {
24637
+ obj.tail = FunctionCallFetchRequest_Tail.toJSON(message.tail);
24638
+ }
24639
+ if (message.allVariants !== false) {
24640
+ obj.allVariants = message.allVariants;
24641
+ }
24642
+ return obj;
24643
+ },
24644
+ create(base) {
24645
+ return FunctionCallFetchRequest.fromPartial(base ?? {});
24646
+ },
24647
+ fromPartial(object) {
24648
+ const message = createBaseFunctionCallFetchRequest();
24649
+ message.functionId = object.functionId ?? "";
24650
+ message.tail = object.tail !== void 0 && object.tail !== null ? FunctionCallFetchRequest_Tail.fromPartial(object.tail) : void 0;
24651
+ message.allVariants = object.allVariants ?? false;
24652
+ return message;
24653
+ }
24654
+ };
24655
+ function createBaseFunctionCallFetchRequest_Tail() {
24656
+ return { count: 0 };
24657
+ }
24658
+ var FunctionCallFetchRequest_Tail = {
24659
+ encode(message, writer = new BinaryWriter()) {
24660
+ if (message.count !== 0) {
24661
+ writer.uint32(8).uint32(message.count);
24662
+ }
24663
+ return writer;
24664
+ },
24665
+ decode(input, length) {
24666
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24667
+ let end = length === void 0 ? reader.len : reader.pos + length;
24668
+ const message = createBaseFunctionCallFetchRequest_Tail();
24669
+ while (reader.pos < end) {
24670
+ const tag = reader.uint32();
24671
+ switch (tag >>> 3) {
24672
+ case 1: {
24673
+ if (tag !== 8) {
24674
+ break;
24675
+ }
24676
+ message.count = reader.uint32();
24677
+ continue;
24678
+ }
24679
+ }
24680
+ if ((tag & 7) === 4 || tag === 0) {
24681
+ break;
24682
+ }
24683
+ reader.skip(tag & 7);
24684
+ }
24685
+ return message;
24686
+ },
24687
+ fromJSON(object) {
24688
+ return { count: isSet5(object.count) ? globalThis.Number(object.count) : 0 };
24689
+ },
24690
+ toJSON(message) {
24691
+ const obj = {};
24692
+ if (message.count !== 0) {
24693
+ obj.count = Math.round(message.count);
24694
+ }
24695
+ return obj;
24696
+ },
24697
+ create(base) {
24698
+ return FunctionCallFetchRequest_Tail.fromPartial(base ?? {});
24699
+ },
24700
+ fromPartial(object) {
24701
+ const message = createBaseFunctionCallFetchRequest_Tail();
24702
+ message.count = object.count ?? 0;
24703
+ return message;
24704
+ }
24705
+ };
24706
+ function createBaseFunctionCallFetchResponse() {
24707
+ return { functionCallInputs: [] };
24708
+ }
24709
+ var FunctionCallFetchResponse = {
24710
+ encode(message, writer = new BinaryWriter()) {
24711
+ for (const v of message.functionCallInputs) {
24712
+ FunctionCallInputInfo.encode(v, writer.uint32(10).fork()).join();
24713
+ }
24714
+ return writer;
24715
+ },
24716
+ decode(input, length) {
24717
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24718
+ let end = length === void 0 ? reader.len : reader.pos + length;
24719
+ const message = createBaseFunctionCallFetchResponse();
24720
+ while (reader.pos < end) {
24721
+ const tag = reader.uint32();
24722
+ switch (tag >>> 3) {
24723
+ case 1: {
24724
+ if (tag !== 10) {
24725
+ break;
24726
+ }
24727
+ message.functionCallInputs.push(FunctionCallInputInfo.decode(reader, reader.uint32()));
24728
+ continue;
24729
+ }
24730
+ }
24731
+ if ((tag & 7) === 4 || tag === 0) {
24732
+ break;
24733
+ }
24734
+ reader.skip(tag & 7);
24735
+ }
24736
+ return message;
24737
+ },
24738
+ fromJSON(object) {
24739
+ return {
24740
+ functionCallInputs: globalThis.Array.isArray(object?.functionCallInputs) ? object.functionCallInputs.map((e) => FunctionCallInputInfo.fromJSON(e)) : []
24741
+ };
24742
+ },
24743
+ toJSON(message) {
24744
+ const obj = {};
24745
+ if (message.functionCallInputs?.length) {
24746
+ obj.functionCallInputs = message.functionCallInputs.map((e) => FunctionCallInputInfo.toJSON(e));
24747
+ }
24748
+ return obj;
24749
+ },
24750
+ create(base) {
24751
+ return FunctionCallFetchResponse.fromPartial(base ?? {});
24752
+ },
24753
+ fromPartial(object) {
24754
+ const message = createBaseFunctionCallFetchResponse();
24755
+ message.functionCallInputs = object.functionCallInputs?.map((e) => FunctionCallInputInfo.fromPartial(e)) || [];
24756
+ return message;
24757
+ }
24758
+ };
24511
24759
  function createBaseFunctionCallFromIdRequest() {
24512
24760
  return { functionCallId: "" };
24513
24761
  }
@@ -25111,6 +25359,173 @@ var FunctionCallInfo = {
25111
25359
  return message;
25112
25360
  }
25113
25361
  };
25362
+ function createBaseFunctionCallInputInfo() {
25363
+ return {
25364
+ enqueuedAt: void 0,
25365
+ startedAt: void 0,
25366
+ containerId: void 0,
25367
+ startupTimeSeconds: void 0,
25368
+ executionTimeSeconds: void 0,
25369
+ status: 0,
25370
+ functionCallId: "",
25371
+ serviceMethodName: void 0
25372
+ };
25373
+ }
25374
+ var FunctionCallInputInfo = {
25375
+ encode(message, writer = new BinaryWriter()) {
25376
+ if (message.enqueuedAt !== void 0) {
25377
+ Timestamp.encode(toTimestamp(message.enqueuedAt), writer.uint32(10).fork()).join();
25378
+ }
25379
+ if (message.startedAt !== void 0) {
25380
+ Timestamp.encode(toTimestamp(message.startedAt), writer.uint32(18).fork()).join();
25381
+ }
25382
+ if (message.containerId !== void 0) {
25383
+ writer.uint32(26).string(message.containerId);
25384
+ }
25385
+ if (message.startupTimeSeconds !== void 0) {
25386
+ writer.uint32(33).double(message.startupTimeSeconds);
25387
+ }
25388
+ if (message.executionTimeSeconds !== void 0) {
25389
+ writer.uint32(41).double(message.executionTimeSeconds);
25390
+ }
25391
+ if (message.status !== 0) {
25392
+ writer.uint32(48).int32(message.status);
25393
+ }
25394
+ if (message.functionCallId !== "") {
25395
+ writer.uint32(58).string(message.functionCallId);
25396
+ }
25397
+ if (message.serviceMethodName !== void 0) {
25398
+ writer.uint32(66).string(message.serviceMethodName);
25399
+ }
25400
+ return writer;
25401
+ },
25402
+ decode(input, length) {
25403
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25404
+ let end = length === void 0 ? reader.len : reader.pos + length;
25405
+ const message = createBaseFunctionCallInputInfo();
25406
+ while (reader.pos < end) {
25407
+ const tag = reader.uint32();
25408
+ switch (tag >>> 3) {
25409
+ case 1: {
25410
+ if (tag !== 10) {
25411
+ break;
25412
+ }
25413
+ message.enqueuedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
25414
+ continue;
25415
+ }
25416
+ case 2: {
25417
+ if (tag !== 18) {
25418
+ break;
25419
+ }
25420
+ message.startedAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
25421
+ continue;
25422
+ }
25423
+ case 3: {
25424
+ if (tag !== 26) {
25425
+ break;
25426
+ }
25427
+ message.containerId = reader.string();
25428
+ continue;
25429
+ }
25430
+ case 4: {
25431
+ if (tag !== 33) {
25432
+ break;
25433
+ }
25434
+ message.startupTimeSeconds = reader.double();
25435
+ continue;
25436
+ }
25437
+ case 5: {
25438
+ if (tag !== 41) {
25439
+ break;
25440
+ }
25441
+ message.executionTimeSeconds = reader.double();
25442
+ continue;
25443
+ }
25444
+ case 6: {
25445
+ if (tag !== 48) {
25446
+ break;
25447
+ }
25448
+ message.status = reader.int32();
25449
+ continue;
25450
+ }
25451
+ case 7: {
25452
+ if (tag !== 58) {
25453
+ break;
25454
+ }
25455
+ message.functionCallId = reader.string();
25456
+ continue;
25457
+ }
25458
+ case 8: {
25459
+ if (tag !== 66) {
25460
+ break;
25461
+ }
25462
+ message.serviceMethodName = reader.string();
25463
+ continue;
25464
+ }
25465
+ }
25466
+ if ((tag & 7) === 4 || tag === 0) {
25467
+ break;
25468
+ }
25469
+ reader.skip(tag & 7);
25470
+ }
25471
+ return message;
25472
+ },
25473
+ fromJSON(object) {
25474
+ return {
25475
+ enqueuedAt: isSet5(object.enqueuedAt) ? fromJsonTimestamp(object.enqueuedAt) : void 0,
25476
+ startedAt: isSet5(object.startedAt) ? fromJsonTimestamp(object.startedAt) : void 0,
25477
+ containerId: isSet5(object.containerId) ? globalThis.String(object.containerId) : void 0,
25478
+ startupTimeSeconds: isSet5(object.startupTimeSeconds) ? globalThis.Number(object.startupTimeSeconds) : void 0,
25479
+ executionTimeSeconds: isSet5(object.executionTimeSeconds) ? globalThis.Number(object.executionTimeSeconds) : void 0,
25480
+ status: isSet5(object.status) ? functionCallInputStatusFromJSON(object.status) : 0,
25481
+ functionCallId: isSet5(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
25482
+ serviceMethodName: isSet5(object.serviceMethodName) ? globalThis.String(object.serviceMethodName) : void 0
25483
+ };
25484
+ },
25485
+ toJSON(message) {
25486
+ const obj = {};
25487
+ if (message.enqueuedAt !== void 0) {
25488
+ obj.enqueuedAt = message.enqueuedAt.toISOString();
25489
+ }
25490
+ if (message.startedAt !== void 0) {
25491
+ obj.startedAt = message.startedAt.toISOString();
25492
+ }
25493
+ if (message.containerId !== void 0) {
25494
+ obj.containerId = message.containerId;
25495
+ }
25496
+ if (message.startupTimeSeconds !== void 0) {
25497
+ obj.startupTimeSeconds = message.startupTimeSeconds;
25498
+ }
25499
+ if (message.executionTimeSeconds !== void 0) {
25500
+ obj.executionTimeSeconds = message.executionTimeSeconds;
25501
+ }
25502
+ if (message.status !== 0) {
25503
+ obj.status = functionCallInputStatusToJSON(message.status);
25504
+ }
25505
+ if (message.functionCallId !== "") {
25506
+ obj.functionCallId = message.functionCallId;
25507
+ }
25508
+ if (message.serviceMethodName !== void 0) {
25509
+ obj.serviceMethodName = message.serviceMethodName;
25510
+ }
25511
+ return obj;
25512
+ },
25513
+ create(base) {
25514
+ return FunctionCallInputInfo.fromPartial(base ?? {});
25515
+ },
25516
+ fromPartial(object) {
25517
+ const message = createBaseFunctionCallInputInfo();
25518
+ message.enqueuedAt = object.enqueuedAt ?? void 0;
25519
+ message.startedAt = object.startedAt ?? void 0;
25520
+ message.containerId = object.containerId ?? void 0;
25521
+ message.startupTimeSeconds = object.startupTimeSeconds ?? void 0;
25522
+ message.executionTimeSeconds = object.executionTimeSeconds ?? void 0;
25523
+ message.status = object.status ?? 0;
25524
+ message.functionCallId = object.functionCallId ?? "";
25525
+ message.serviceMethodName = object.serviceMethodName ?? void 0;
25526
+ return message;
25527
+ }
25528
+ };
25114
25529
  function createBaseFunctionCallListRequest() {
25115
25530
  return { functionId: "" };
25116
25531
  }
@@ -25565,14 +25980,11 @@ function createBaseFunctionData() {
25565
25980
  webUrlInfo: void 0,
25566
25981
  webhookConfig: void 0,
25567
25982
  customDomainInfo: [],
25568
- ExperimentalProxyIp: void 0,
25569
25983
  methodDefinitions: {},
25570
25984
  methodDefinitionsSet: false,
25571
25985
  isClass: false,
25572
25986
  classParameterInfo: void 0,
25573
25987
  isMethod: false,
25574
- useFunctionId: "",
25575
- useMethodName: "",
25576
25988
  rankedFunctions: [],
25577
25989
  schedule: void 0,
25578
25990
  untrusted: false,
@@ -25646,9 +26058,6 @@ var FunctionData = {
25646
26058
  for (const v of message.customDomainInfo) {
25647
26059
  CustomDomainInfo.encode(v, writer.uint32(98).fork()).join();
25648
26060
  }
25649
- if (message.ExperimentalProxyIp !== void 0) {
25650
- writer.uint32(194).string(message.ExperimentalProxyIp);
25651
- }
25652
26061
  Object.entries(message.methodDefinitions).forEach(([key, value]) => {
25653
26062
  FunctionData_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(202).fork()).join();
25654
26063
  });
@@ -25664,12 +26073,6 @@ var FunctionData = {
25664
26073
  if (message.isMethod !== false) {
25665
26074
  writer.uint32(120).bool(message.isMethod);
25666
26075
  }
25667
- if (message.useFunctionId !== "") {
25668
- writer.uint32(130).string(message.useFunctionId);
25669
- }
25670
- if (message.useMethodName !== "") {
25671
- writer.uint32(138).string(message.useMethodName);
25672
- }
25673
26076
  for (const v of message.rankedFunctions) {
25674
26077
  FunctionData_RankedFunction.encode(v, writer.uint32(146).fork()).join();
25675
26078
  }
@@ -25856,13 +26259,6 @@ var FunctionData = {
25856
26259
  message.customDomainInfo.push(CustomDomainInfo.decode(reader, reader.uint32()));
25857
26260
  continue;
25858
26261
  }
25859
- case 24: {
25860
- if (tag !== 194) {
25861
- break;
25862
- }
25863
- message.ExperimentalProxyIp = reader.string();
25864
- continue;
25865
- }
25866
26262
  case 25: {
25867
26263
  if (tag !== 202) {
25868
26264
  break;
@@ -25901,20 +26297,6 @@ var FunctionData = {
25901
26297
  message.isMethod = reader.bool();
25902
26298
  continue;
25903
26299
  }
25904
- case 16: {
25905
- if (tag !== 130) {
25906
- break;
25907
- }
25908
- message.useFunctionId = reader.string();
25909
- continue;
25910
- }
25911
- case 17: {
25912
- if (tag !== 138) {
25913
- break;
25914
- }
25915
- message.useMethodName = reader.string();
25916
- continue;
25917
- }
25918
26300
  case 18: {
25919
26301
  if (tag !== 146) {
25920
26302
  break;
@@ -26085,7 +26467,6 @@ var FunctionData = {
26085
26467
  webUrlInfo: isSet5(object.webUrlInfo) ? WebUrlInfo.fromJSON(object.webUrlInfo) : void 0,
26086
26468
  webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
26087
26469
  customDomainInfo: globalThis.Array.isArray(object?.customDomainInfo) ? object.customDomainInfo.map((e) => CustomDomainInfo.fromJSON(e)) : [],
26088
- ExperimentalProxyIp: isSet5(object.ExperimentalProxyIp) ? globalThis.String(object.ExperimentalProxyIp) : void 0,
26089
26470
  methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
26090
26471
  acc[key] = MethodDefinition.fromJSON(value);
26091
26472
  return acc;
@@ -26094,8 +26475,6 @@ var FunctionData = {
26094
26475
  isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
26095
26476
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
26096
26477
  isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
26097
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
26098
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
26099
26478
  rankedFunctions: globalThis.Array.isArray(object?.rankedFunctions) ? object.rankedFunctions.map((e) => FunctionData_RankedFunction.fromJSON(e)) : [],
26100
26479
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
26101
26480
  untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
@@ -26172,9 +26551,6 @@ var FunctionData = {
26172
26551
  if (message.customDomainInfo?.length) {
26173
26552
  obj.customDomainInfo = message.customDomainInfo.map((e) => CustomDomainInfo.toJSON(e));
26174
26553
  }
26175
- if (message.ExperimentalProxyIp !== void 0) {
26176
- obj.ExperimentalProxyIp = message.ExperimentalProxyIp;
26177
- }
26178
26554
  if (message.methodDefinitions) {
26179
26555
  const entries = Object.entries(message.methodDefinitions);
26180
26556
  if (entries.length > 0) {
@@ -26196,12 +26572,6 @@ var FunctionData = {
26196
26572
  if (message.isMethod !== false) {
26197
26573
  obj.isMethod = message.isMethod;
26198
26574
  }
26199
- if (message.useFunctionId !== "") {
26200
- obj.useFunctionId = message.useFunctionId;
26201
- }
26202
- if (message.useMethodName !== "") {
26203
- obj.useMethodName = message.useMethodName;
26204
- }
26205
26575
  if (message.rankedFunctions?.length) {
26206
26576
  obj.rankedFunctions = message.rankedFunctions.map((e) => FunctionData_RankedFunction.toJSON(e));
26207
26577
  }
@@ -26286,7 +26656,6 @@ var FunctionData = {
26286
26656
  message.webUrlInfo = object.webUrlInfo !== void 0 && object.webUrlInfo !== null ? WebUrlInfo.fromPartial(object.webUrlInfo) : void 0;
26287
26657
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
26288
26658
  message.customDomainInfo = object.customDomainInfo?.map((e) => CustomDomainInfo.fromPartial(e)) || [];
26289
- message.ExperimentalProxyIp = object.ExperimentalProxyIp ?? void 0;
26290
26659
  message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
26291
26660
  if (value !== void 0) {
26292
26661
  acc[key] = MethodDefinition.fromPartial(value);
@@ -26297,8 +26666,6 @@ var FunctionData = {
26297
26666
  message.isClass = object.isClass ?? false;
26298
26667
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
26299
26668
  message.isMethod = object.isMethod ?? false;
26300
- message.useFunctionId = object.useFunctionId ?? "";
26301
- message.useMethodName = object.useMethodName ?? "";
26302
26669
  message.rankedFunctions = object.rankedFunctions?.map((e) => FunctionData_RankedFunction.fromPartial(e)) || [];
26303
26670
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
26304
26671
  message.untrusted = object.untrusted ?? false;
@@ -28931,7 +29298,6 @@ function createBaseFunctionHandleMetadata() {
28931
29298
  functionType: 0,
28932
29299
  webUrl: "",
28933
29300
  isMethod: false,
28934
- useFunctionId: "",
28935
29301
  useMethodName: "",
28936
29302
  definitionId: "",
28937
29303
  classParameterInfo: void 0,
@@ -28962,9 +29328,6 @@ var FunctionHandleMetadata = {
28962
29328
  if (message.isMethod !== false) {
28963
29329
  writer.uint32(312).bool(message.isMethod);
28964
29330
  }
28965
- if (message.useFunctionId !== "") {
28966
- writer.uint32(322).string(message.useFunctionId);
28967
- }
28968
29331
  if (message.useMethodName !== "") {
28969
29332
  writer.uint32(330).string(message.useMethodName);
28970
29333
  }
@@ -29048,13 +29411,6 @@ var FunctionHandleMetadata = {
29048
29411
  message.isMethod = reader.bool();
29049
29412
  continue;
29050
29413
  }
29051
- case 40: {
29052
- if (tag !== 322) {
29053
- break;
29054
- }
29055
- message.useFunctionId = reader.string();
29056
- continue;
29057
- }
29058
29414
  case 41: {
29059
29415
  if (tag !== 330) {
29060
29416
  break;
@@ -29184,7 +29540,6 @@ var FunctionHandleMetadata = {
29184
29540
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
29185
29541
  webUrl: isSet5(object.webUrl) ? globalThis.String(object.webUrl) : "",
29186
29542
  isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
29187
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
29188
29543
  useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
29189
29544
  definitionId: isSet5(object.definitionId) ? globalThis.String(object.definitionId) : "",
29190
29545
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
@@ -29221,9 +29576,6 @@ var FunctionHandleMetadata = {
29221
29576
  if (message.isMethod !== false) {
29222
29577
  obj.isMethod = message.isMethod;
29223
29578
  }
29224
- if (message.useFunctionId !== "") {
29225
- obj.useFunctionId = message.useFunctionId;
29226
- }
29227
29579
  if (message.useMethodName !== "") {
29228
29580
  obj.useMethodName = message.useMethodName;
29229
29581
  }
@@ -29283,7 +29635,6 @@ var FunctionHandleMetadata = {
29283
29635
  message.functionType = object.functionType ?? 0;
29284
29636
  message.webUrl = object.webUrl ?? "";
29285
29637
  message.isMethod = object.isMethod ?? false;
29286
- message.useFunctionId = object.useFunctionId ?? "";
29287
29638
  message.useMethodName = object.useMethodName ?? "";
29288
29639
  message.definitionId = object.definitionId ?? "";
29289
29640
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
@@ -29487,6 +29838,172 @@ var FunctionInput = {
29487
29838
  return message;
29488
29839
  }
29489
29840
  };
29841
+ function createBaseFunctionListVariantsRequest() {
29842
+ return { functionId: "", cursor: void 0, limit: 0 };
29843
+ }
29844
+ var FunctionListVariantsRequest = {
29845
+ encode(message, writer = new BinaryWriter()) {
29846
+ if (message.functionId !== "") {
29847
+ writer.uint32(10).string(message.functionId);
29848
+ }
29849
+ if (message.cursor !== void 0) {
29850
+ FunctionVariantCursor.encode(message.cursor, writer.uint32(18).fork()).join();
29851
+ }
29852
+ if (message.limit !== 0) {
29853
+ writer.uint32(24).uint32(message.limit);
29854
+ }
29855
+ return writer;
29856
+ },
29857
+ decode(input, length) {
29858
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29859
+ let end = length === void 0 ? reader.len : reader.pos + length;
29860
+ const message = createBaseFunctionListVariantsRequest();
29861
+ while (reader.pos < end) {
29862
+ const tag = reader.uint32();
29863
+ switch (tag >>> 3) {
29864
+ case 1: {
29865
+ if (tag !== 10) {
29866
+ break;
29867
+ }
29868
+ message.functionId = reader.string();
29869
+ continue;
29870
+ }
29871
+ case 2: {
29872
+ if (tag !== 18) {
29873
+ break;
29874
+ }
29875
+ message.cursor = FunctionVariantCursor.decode(reader, reader.uint32());
29876
+ continue;
29877
+ }
29878
+ case 3: {
29879
+ if (tag !== 24) {
29880
+ break;
29881
+ }
29882
+ message.limit = reader.uint32();
29883
+ continue;
29884
+ }
29885
+ }
29886
+ if ((tag & 7) === 4 || tag === 0) {
29887
+ break;
29888
+ }
29889
+ reader.skip(tag & 7);
29890
+ }
29891
+ return message;
29892
+ },
29893
+ fromJSON(object) {
29894
+ return {
29895
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
29896
+ cursor: isSet5(object.cursor) ? FunctionVariantCursor.fromJSON(object.cursor) : void 0,
29897
+ limit: isSet5(object.limit) ? globalThis.Number(object.limit) : 0
29898
+ };
29899
+ },
29900
+ toJSON(message) {
29901
+ const obj = {};
29902
+ if (message.functionId !== "") {
29903
+ obj.functionId = message.functionId;
29904
+ }
29905
+ if (message.cursor !== void 0) {
29906
+ obj.cursor = FunctionVariantCursor.toJSON(message.cursor);
29907
+ }
29908
+ if (message.limit !== 0) {
29909
+ obj.limit = Math.round(message.limit);
29910
+ }
29911
+ return obj;
29912
+ },
29913
+ create(base) {
29914
+ return FunctionListVariantsRequest.fromPartial(base ?? {});
29915
+ },
29916
+ fromPartial(object) {
29917
+ const message = createBaseFunctionListVariantsRequest();
29918
+ message.functionId = object.functionId ?? "";
29919
+ message.cursor = object.cursor !== void 0 && object.cursor !== null ? FunctionVariantCursor.fromPartial(object.cursor) : void 0;
29920
+ message.limit = object.limit ?? 0;
29921
+ return message;
29922
+ }
29923
+ };
29924
+ function createBaseFunctionListVariantsResponse() {
29925
+ return { infos: [], nextCursor: void 0, orderedByTaskCount: false };
29926
+ }
29927
+ var FunctionListVariantsResponse = {
29928
+ encode(message, writer = new BinaryWriter()) {
29929
+ for (const v of message.infos) {
29930
+ FunctionVariantInfo.encode(v, writer.uint32(10).fork()).join();
29931
+ }
29932
+ if (message.nextCursor !== void 0) {
29933
+ FunctionVariantCursor.encode(message.nextCursor, writer.uint32(18).fork()).join();
29934
+ }
29935
+ if (message.orderedByTaskCount !== false) {
29936
+ writer.uint32(24).bool(message.orderedByTaskCount);
29937
+ }
29938
+ return writer;
29939
+ },
29940
+ decode(input, length) {
29941
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
29942
+ let end = length === void 0 ? reader.len : reader.pos + length;
29943
+ const message = createBaseFunctionListVariantsResponse();
29944
+ while (reader.pos < end) {
29945
+ const tag = reader.uint32();
29946
+ switch (tag >>> 3) {
29947
+ case 1: {
29948
+ if (tag !== 10) {
29949
+ break;
29950
+ }
29951
+ message.infos.push(FunctionVariantInfo.decode(reader, reader.uint32()));
29952
+ continue;
29953
+ }
29954
+ case 2: {
29955
+ if (tag !== 18) {
29956
+ break;
29957
+ }
29958
+ message.nextCursor = FunctionVariantCursor.decode(reader, reader.uint32());
29959
+ continue;
29960
+ }
29961
+ case 3: {
29962
+ if (tag !== 24) {
29963
+ break;
29964
+ }
29965
+ message.orderedByTaskCount = reader.bool();
29966
+ continue;
29967
+ }
29968
+ }
29969
+ if ((tag & 7) === 4 || tag === 0) {
29970
+ break;
29971
+ }
29972
+ reader.skip(tag & 7);
29973
+ }
29974
+ return message;
29975
+ },
29976
+ fromJSON(object) {
29977
+ return {
29978
+ infos: globalThis.Array.isArray(object?.infos) ? object.infos.map((e) => FunctionVariantInfo.fromJSON(e)) : [],
29979
+ nextCursor: isSet5(object.nextCursor) ? FunctionVariantCursor.fromJSON(object.nextCursor) : void 0,
29980
+ orderedByTaskCount: isSet5(object.orderedByTaskCount) ? globalThis.Boolean(object.orderedByTaskCount) : false
29981
+ };
29982
+ },
29983
+ toJSON(message) {
29984
+ const obj = {};
29985
+ if (message.infos?.length) {
29986
+ obj.infos = message.infos.map((e) => FunctionVariantInfo.toJSON(e));
29987
+ }
29988
+ if (message.nextCursor !== void 0) {
29989
+ obj.nextCursor = FunctionVariantCursor.toJSON(message.nextCursor);
29990
+ }
29991
+ if (message.orderedByTaskCount !== false) {
29992
+ obj.orderedByTaskCount = message.orderedByTaskCount;
29993
+ }
29994
+ return obj;
29995
+ },
29996
+ create(base) {
29997
+ return FunctionListVariantsResponse.fromPartial(base ?? {});
29998
+ },
29999
+ fromPartial(object) {
30000
+ const message = createBaseFunctionListVariantsResponse();
30001
+ message.infos = object.infos?.map((e) => FunctionVariantInfo.fromPartial(e)) || [];
30002
+ message.nextCursor = object.nextCursor !== void 0 && object.nextCursor !== null ? FunctionVariantCursor.fromPartial(object.nextCursor) : void 0;
30003
+ message.orderedByTaskCount = object.orderedByTaskCount ?? false;
30004
+ return message;
30005
+ }
30006
+ };
29490
30007
  function createBaseFunctionMapRequest() {
29491
30008
  return {
29492
30009
  functionId: "",
@@ -30171,8 +30688,6 @@ function createBaseFunctionPrecreateRequest() {
30171
30688
  existingFunctionId: "",
30172
30689
  functionType: 0,
30173
30690
  webhookConfig: void 0,
30174
- useFunctionId: "",
30175
- useMethodName: "",
30176
30691
  methodDefinitions: {},
30177
30692
  functionSchema: void 0,
30178
30693
  supportedInputFormats: [],
@@ -30196,12 +30711,6 @@ var FunctionPrecreateRequest = {
30196
30711
  if (message.webhookConfig !== void 0) {
30197
30712
  WebhookConfig.encode(message.webhookConfig, writer.uint32(42).fork()).join();
30198
30713
  }
30199
- if (message.useFunctionId !== "") {
30200
- writer.uint32(50).string(message.useFunctionId);
30201
- }
30202
- if (message.useMethodName !== "") {
30203
- writer.uint32(58).string(message.useMethodName);
30204
- }
30205
30714
  Object.entries(message.methodDefinitions).forEach(([key, value]) => {
30206
30715
  FunctionPrecreateRequest_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(66).fork()).join();
30207
30716
  });
@@ -30262,20 +30771,6 @@ var FunctionPrecreateRequest = {
30262
30771
  message.webhookConfig = WebhookConfig.decode(reader, reader.uint32());
30263
30772
  continue;
30264
30773
  }
30265
- case 6: {
30266
- if (tag !== 50) {
30267
- break;
30268
- }
30269
- message.useFunctionId = reader.string();
30270
- continue;
30271
- }
30272
- case 7: {
30273
- if (tag !== 58) {
30274
- break;
30275
- }
30276
- message.useMethodName = reader.string();
30277
- continue;
30278
- }
30279
30774
  case 8: {
30280
30775
  if (tag !== 66) {
30281
30776
  break;
@@ -30336,8 +30831,6 @@ var FunctionPrecreateRequest = {
30336
30831
  existingFunctionId: isSet5(object.existingFunctionId) ? globalThis.String(object.existingFunctionId) : "",
30337
30832
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
30338
30833
  webhookConfig: isSet5(object.webhookConfig) ? WebhookConfig.fromJSON(object.webhookConfig) : void 0,
30339
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
30340
- useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
30341
30834
  methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
30342
30835
  acc[key] = MethodDefinition.fromJSON(value);
30343
30836
  return acc;
@@ -30364,12 +30857,6 @@ var FunctionPrecreateRequest = {
30364
30857
  if (message.webhookConfig !== void 0) {
30365
30858
  obj.webhookConfig = WebhookConfig.toJSON(message.webhookConfig);
30366
30859
  }
30367
- if (message.useFunctionId !== "") {
30368
- obj.useFunctionId = message.useFunctionId;
30369
- }
30370
- if (message.useMethodName !== "") {
30371
- obj.useMethodName = message.useMethodName;
30372
- }
30373
30860
  if (message.methodDefinitions) {
30374
30861
  const entries = Object.entries(message.methodDefinitions);
30375
30862
  if (entries.length > 0) {
@@ -30400,8 +30887,6 @@ var FunctionPrecreateRequest = {
30400
30887
  message.existingFunctionId = object.existingFunctionId ?? "";
30401
30888
  message.functionType = object.functionType ?? 0;
30402
30889
  message.webhookConfig = object.webhookConfig !== void 0 && object.webhookConfig !== null ? WebhookConfig.fromPartial(object.webhookConfig) : void 0;
30403
- message.useFunctionId = object.useFunctionId ?? "";
30404
- message.useMethodName = object.useMethodName ?? "";
30405
30890
  message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
30406
30891
  if (value !== void 0) {
30407
30892
  acc[key] = MethodDefinition.fromPartial(value);
@@ -31752,6 +32237,157 @@ var FunctionUpdateSchedulingParamsResponse = {
31752
32237
  return message;
31753
32238
  }
31754
32239
  };
32240
+ function createBaseFunctionVariantCursor() {
32241
+ return { createdBefore: 0, functionId: "" };
32242
+ }
32243
+ var FunctionVariantCursor = {
32244
+ encode(message, writer = new BinaryWriter()) {
32245
+ if (message.createdBefore !== 0) {
32246
+ writer.uint32(9).double(message.createdBefore);
32247
+ }
32248
+ if (message.functionId !== "") {
32249
+ writer.uint32(18).string(message.functionId);
32250
+ }
32251
+ return writer;
32252
+ },
32253
+ decode(input, length) {
32254
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32255
+ let end = length === void 0 ? reader.len : reader.pos + length;
32256
+ const message = createBaseFunctionVariantCursor();
32257
+ while (reader.pos < end) {
32258
+ const tag = reader.uint32();
32259
+ switch (tag >>> 3) {
32260
+ case 1: {
32261
+ if (tag !== 9) {
32262
+ break;
32263
+ }
32264
+ message.createdBefore = reader.double();
32265
+ continue;
32266
+ }
32267
+ case 2: {
32268
+ if (tag !== 18) {
32269
+ break;
32270
+ }
32271
+ message.functionId = reader.string();
32272
+ continue;
32273
+ }
32274
+ }
32275
+ if ((tag & 7) === 4 || tag === 0) {
32276
+ break;
32277
+ }
32278
+ reader.skip(tag & 7);
32279
+ }
32280
+ return message;
32281
+ },
32282
+ fromJSON(object) {
32283
+ return {
32284
+ createdBefore: isSet5(object.createdBefore) ? globalThis.Number(object.createdBefore) : 0,
32285
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
32286
+ };
32287
+ },
32288
+ toJSON(message) {
32289
+ const obj = {};
32290
+ if (message.createdBefore !== 0) {
32291
+ obj.createdBefore = message.createdBefore;
32292
+ }
32293
+ if (message.functionId !== "") {
32294
+ obj.functionId = message.functionId;
32295
+ }
32296
+ return obj;
32297
+ },
32298
+ create(base) {
32299
+ return FunctionVariantCursor.fromPartial(base ?? {});
32300
+ },
32301
+ fromPartial(object) {
32302
+ const message = createBaseFunctionVariantCursor();
32303
+ message.createdBefore = object.createdBefore ?? 0;
32304
+ message.functionId = object.functionId ?? "";
32305
+ return message;
32306
+ }
32307
+ };
32308
+ function createBaseFunctionVariantInfo() {
32309
+ return { functionId: "", serializedParams: new Uint8Array(0), functionOptions: void 0 };
32310
+ }
32311
+ var FunctionVariantInfo = {
32312
+ encode(message, writer = new BinaryWriter()) {
32313
+ if (message.functionId !== "") {
32314
+ writer.uint32(10).string(message.functionId);
32315
+ }
32316
+ if (message.serializedParams.length !== 0) {
32317
+ writer.uint32(18).bytes(message.serializedParams);
32318
+ }
32319
+ if (message.functionOptions !== void 0) {
32320
+ FunctionOptions.encode(message.functionOptions, writer.uint32(26).fork()).join();
32321
+ }
32322
+ return writer;
32323
+ },
32324
+ decode(input, length) {
32325
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32326
+ let end = length === void 0 ? reader.len : reader.pos + length;
32327
+ const message = createBaseFunctionVariantInfo();
32328
+ while (reader.pos < end) {
32329
+ const tag = reader.uint32();
32330
+ switch (tag >>> 3) {
32331
+ case 1: {
32332
+ if (tag !== 10) {
32333
+ break;
32334
+ }
32335
+ message.functionId = reader.string();
32336
+ continue;
32337
+ }
32338
+ case 2: {
32339
+ if (tag !== 18) {
32340
+ break;
32341
+ }
32342
+ message.serializedParams = reader.bytes();
32343
+ continue;
32344
+ }
32345
+ case 3: {
32346
+ if (tag !== 26) {
32347
+ break;
32348
+ }
32349
+ message.functionOptions = FunctionOptions.decode(reader, reader.uint32());
32350
+ continue;
32351
+ }
32352
+ }
32353
+ if ((tag & 7) === 4 || tag === 0) {
32354
+ break;
32355
+ }
32356
+ reader.skip(tag & 7);
32357
+ }
32358
+ return message;
32359
+ },
32360
+ fromJSON(object) {
32361
+ return {
32362
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
32363
+ serializedParams: isSet5(object.serializedParams) ? bytesFromBase642(object.serializedParams) : new Uint8Array(0),
32364
+ functionOptions: isSet5(object.functionOptions) ? FunctionOptions.fromJSON(object.functionOptions) : void 0
32365
+ };
32366
+ },
32367
+ toJSON(message) {
32368
+ const obj = {};
32369
+ if (message.functionId !== "") {
32370
+ obj.functionId = message.functionId;
32371
+ }
32372
+ if (message.serializedParams.length !== 0) {
32373
+ obj.serializedParams = base64FromBytes2(message.serializedParams);
32374
+ }
32375
+ if (message.functionOptions !== void 0) {
32376
+ obj.functionOptions = FunctionOptions.toJSON(message.functionOptions);
32377
+ }
32378
+ return obj;
32379
+ },
32380
+ create(base) {
32381
+ return FunctionVariantInfo.fromPartial(base ?? {});
32382
+ },
32383
+ fromPartial(object) {
32384
+ const message = createBaseFunctionVariantInfo();
32385
+ message.functionId = object.functionId ?? "";
32386
+ message.serializedParams = object.serializedParams ?? new Uint8Array(0);
32387
+ message.functionOptions = object.functionOptions !== void 0 && object.functionOptions !== null ? FunctionOptions.fromPartial(object.functionOptions) : void 0;
32388
+ return message;
32389
+ }
32390
+ };
31755
32391
  function createBaseGPUConfig() {
31756
32392
  return { type: 0, count: 0, gpuType: "" };
31757
32393
  }
@@ -32145,7 +32781,8 @@ function createBaseHTTPConfig() {
32145
32781
  exitGracePeriod: 0,
32146
32782
  h2Enabled: false,
32147
32783
  targetConcurrency: 0,
32148
- unauthenticated: false
32784
+ unauthenticated: false,
32785
+ liftAndShiftConfig: void 0
32149
32786
  };
32150
32787
  }
32151
32788
  var HTTPConfig = {
@@ -32171,6 +32808,9 @@ var HTTPConfig = {
32171
32808
  if (message.unauthenticated !== false) {
32172
32809
  writer.uint32(56).bool(message.unauthenticated);
32173
32810
  }
32811
+ if (message.liftAndShiftConfig !== void 0) {
32812
+ LiftAndShiftConfig.encode(message.liftAndShiftConfig, writer.uint32(66).fork()).join();
32813
+ }
32174
32814
  return writer;
32175
32815
  },
32176
32816
  decode(input, length) {
@@ -32229,6 +32869,13 @@ var HTTPConfig = {
32229
32869
  message.unauthenticated = reader.bool();
32230
32870
  continue;
32231
32871
  }
32872
+ case 8: {
32873
+ if (tag !== 66) {
32874
+ break;
32875
+ }
32876
+ message.liftAndShiftConfig = LiftAndShiftConfig.decode(reader, reader.uint32());
32877
+ continue;
32878
+ }
32232
32879
  }
32233
32880
  if ((tag & 7) === 4 || tag === 0) {
32234
32881
  break;
@@ -32245,7 +32892,8 @@ var HTTPConfig = {
32245
32892
  exitGracePeriod: isSet5(object.exitGracePeriod) ? globalThis.Number(object.exitGracePeriod) : 0,
32246
32893
  h2Enabled: isSet5(object.h2Enabled) ? globalThis.Boolean(object.h2Enabled) : false,
32247
32894
  targetConcurrency: isSet5(object.targetConcurrency) ? globalThis.Number(object.targetConcurrency) : 0,
32248
- unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false
32895
+ unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
32896
+ liftAndShiftConfig: isSet5(object.liftAndShiftConfig) ? LiftAndShiftConfig.fromJSON(object.liftAndShiftConfig) : void 0
32249
32897
  };
32250
32898
  },
32251
32899
  toJSON(message) {
@@ -32271,6 +32919,9 @@ var HTTPConfig = {
32271
32919
  if (message.unauthenticated !== false) {
32272
32920
  obj.unauthenticated = message.unauthenticated;
32273
32921
  }
32922
+ if (message.liftAndShiftConfig !== void 0) {
32923
+ obj.liftAndShiftConfig = LiftAndShiftConfig.toJSON(message.liftAndShiftConfig);
32924
+ }
32274
32925
  return obj;
32275
32926
  },
32276
32927
  create(base) {
@@ -32285,6 +32936,7 @@ var HTTPConfig = {
32285
32936
  message.h2Enabled = object.h2Enabled ?? false;
32286
32937
  message.targetConcurrency = object.targetConcurrency ?? 0;
32287
32938
  message.unauthenticated = object.unauthenticated ?? false;
32939
+ message.liftAndShiftConfig = object.liftAndShiftConfig !== void 0 && object.liftAndShiftConfig !== null ? LiftAndShiftConfig.fromPartial(object.liftAndShiftConfig) : void 0;
32288
32940
  return message;
32289
32941
  }
32290
32942
  };
@@ -35060,6 +35712,43 @@ var InputInfo = {
35060
35712
  return message;
35061
35713
  }
35062
35714
  };
35715
+ function createBaseLiftAndShiftConfig() {
35716
+ return {};
35717
+ }
35718
+ var LiftAndShiftConfig = {
35719
+ encode(_, writer = new BinaryWriter()) {
35720
+ return writer;
35721
+ },
35722
+ decode(input, length) {
35723
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
35724
+ let end = length === void 0 ? reader.len : reader.pos + length;
35725
+ const message = createBaseLiftAndShiftConfig();
35726
+ while (reader.pos < end) {
35727
+ const tag = reader.uint32();
35728
+ switch (tag >>> 3) {
35729
+ }
35730
+ if ((tag & 7) === 4 || tag === 0) {
35731
+ break;
35732
+ }
35733
+ reader.skip(tag & 7);
35734
+ }
35735
+ return message;
35736
+ },
35737
+ fromJSON(_) {
35738
+ return {};
35739
+ },
35740
+ toJSON(_) {
35741
+ const obj = {};
35742
+ return obj;
35743
+ },
35744
+ create(base) {
35745
+ return LiftAndShiftConfig.fromPartial(base ?? {});
35746
+ },
35747
+ fromPartial(_) {
35748
+ const message = createBaseLiftAndShiftConfig();
35749
+ return message;
35750
+ }
35751
+ };
35063
35752
  function createBaseListPagination() {
35064
35753
  return { maxObjects: 0, createdBefore: 0 };
35065
35754
  }
@@ -47363,6 +48052,108 @@ var SecretDeleteRequest = {
47363
48052
  return message;
47364
48053
  }
47365
48054
  };
48055
+ function createBaseSecretGetInfoRequest() {
48056
+ return { secretId: "" };
48057
+ }
48058
+ var SecretGetInfoRequest = {
48059
+ encode(message, writer = new BinaryWriter()) {
48060
+ if (message.secretId !== "") {
48061
+ writer.uint32(10).string(message.secretId);
48062
+ }
48063
+ return writer;
48064
+ },
48065
+ decode(input, length) {
48066
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
48067
+ let end = length === void 0 ? reader.len : reader.pos + length;
48068
+ const message = createBaseSecretGetInfoRequest();
48069
+ while (reader.pos < end) {
48070
+ const tag = reader.uint32();
48071
+ switch (tag >>> 3) {
48072
+ case 1: {
48073
+ if (tag !== 10) {
48074
+ break;
48075
+ }
48076
+ message.secretId = reader.string();
48077
+ continue;
48078
+ }
48079
+ }
48080
+ if ((tag & 7) === 4 || tag === 0) {
48081
+ break;
48082
+ }
48083
+ reader.skip(tag & 7);
48084
+ }
48085
+ return message;
48086
+ },
48087
+ fromJSON(object) {
48088
+ return { secretId: isSet5(object.secretId) ? globalThis.String(object.secretId) : "" };
48089
+ },
48090
+ toJSON(message) {
48091
+ const obj = {};
48092
+ if (message.secretId !== "") {
48093
+ obj.secretId = message.secretId;
48094
+ }
48095
+ return obj;
48096
+ },
48097
+ create(base) {
48098
+ return SecretGetInfoRequest.fromPartial(base ?? {});
48099
+ },
48100
+ fromPartial(object) {
48101
+ const message = createBaseSecretGetInfoRequest();
48102
+ message.secretId = object.secretId ?? "";
48103
+ return message;
48104
+ }
48105
+ };
48106
+ function createBaseSecretGetInfoResponse() {
48107
+ return { metadata: void 0 };
48108
+ }
48109
+ var SecretGetInfoResponse = {
48110
+ encode(message, writer = new BinaryWriter()) {
48111
+ if (message.metadata !== void 0) {
48112
+ SecretMetadata.encode(message.metadata, writer.uint32(10).fork()).join();
48113
+ }
48114
+ return writer;
48115
+ },
48116
+ decode(input, length) {
48117
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
48118
+ let end = length === void 0 ? reader.len : reader.pos + length;
48119
+ const message = createBaseSecretGetInfoResponse();
48120
+ while (reader.pos < end) {
48121
+ const tag = reader.uint32();
48122
+ switch (tag >>> 3) {
48123
+ case 1: {
48124
+ if (tag !== 10) {
48125
+ break;
48126
+ }
48127
+ message.metadata = SecretMetadata.decode(reader, reader.uint32());
48128
+ continue;
48129
+ }
48130
+ }
48131
+ if ((tag & 7) === 4 || tag === 0) {
48132
+ break;
48133
+ }
48134
+ reader.skip(tag & 7);
48135
+ }
48136
+ return message;
48137
+ },
48138
+ fromJSON(object) {
48139
+ return { metadata: isSet5(object.metadata) ? SecretMetadata.fromJSON(object.metadata) : void 0 };
48140
+ },
48141
+ toJSON(message) {
48142
+ const obj = {};
48143
+ if (message.metadata !== void 0) {
48144
+ obj.metadata = SecretMetadata.toJSON(message.metadata);
48145
+ }
48146
+ return obj;
48147
+ },
48148
+ create(base) {
48149
+ return SecretGetInfoResponse.fromPartial(base ?? {});
48150
+ },
48151
+ fromPartial(object) {
48152
+ const message = createBaseSecretGetInfoResponse();
48153
+ message.metadata = object.metadata !== void 0 && object.metadata !== null ? SecretMetadata.fromPartial(object.metadata) : void 0;
48154
+ return message;
48155
+ }
48156
+ };
47366
48157
  function createBaseSecretGetOrCreateRequest() {
47367
48158
  return { deploymentName: "", environmentName: "", objectCreationType: 0, envDict: {}, appId: "", requiredKeys: [] };
47368
48159
  }
@@ -47909,7 +48700,7 @@ var SecretListResponse = {
47909
48700
  }
47910
48701
  };
47911
48702
  function createBaseSecretMetadata() {
47912
- return { name: "", creationInfo: void 0 };
48703
+ return { name: "", creationInfo: void 0, keys: [], environmentName: "" };
47913
48704
  }
47914
48705
  var SecretMetadata = {
47915
48706
  encode(message, writer = new BinaryWriter()) {
@@ -47919,6 +48710,12 @@ var SecretMetadata = {
47919
48710
  if (message.creationInfo !== void 0) {
47920
48711
  CreationInfo.encode(message.creationInfo, writer.uint32(18).fork()).join();
47921
48712
  }
48713
+ for (const v of message.keys) {
48714
+ writer.uint32(26).string(v);
48715
+ }
48716
+ if (message.environmentName !== "") {
48717
+ writer.uint32(34).string(message.environmentName);
48718
+ }
47922
48719
  return writer;
47923
48720
  },
47924
48721
  decode(input, length) {
@@ -47942,6 +48739,20 @@ var SecretMetadata = {
47942
48739
  message.creationInfo = CreationInfo.decode(reader, reader.uint32());
47943
48740
  continue;
47944
48741
  }
48742
+ case 3: {
48743
+ if (tag !== 26) {
48744
+ break;
48745
+ }
48746
+ message.keys.push(reader.string());
48747
+ continue;
48748
+ }
48749
+ case 4: {
48750
+ if (tag !== 34) {
48751
+ break;
48752
+ }
48753
+ message.environmentName = reader.string();
48754
+ continue;
48755
+ }
47945
48756
  }
47946
48757
  if ((tag & 7) === 4 || tag === 0) {
47947
48758
  break;
@@ -47953,7 +48764,9 @@ var SecretMetadata = {
47953
48764
  fromJSON(object) {
47954
48765
  return {
47955
48766
  name: isSet5(object.name) ? globalThis.String(object.name) : "",
47956
- creationInfo: isSet5(object.creationInfo) ? CreationInfo.fromJSON(object.creationInfo) : void 0
48767
+ creationInfo: isSet5(object.creationInfo) ? CreationInfo.fromJSON(object.creationInfo) : void 0,
48768
+ keys: globalThis.Array.isArray(object?.keys) ? object.keys.map((e) => globalThis.String(e)) : [],
48769
+ environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : ""
47957
48770
  };
47958
48771
  },
47959
48772
  toJSON(message) {
@@ -47964,6 +48777,12 @@ var SecretMetadata = {
47964
48777
  if (message.creationInfo !== void 0) {
47965
48778
  obj.creationInfo = CreationInfo.toJSON(message.creationInfo);
47966
48779
  }
48780
+ if (message.keys?.length) {
48781
+ obj.keys = message.keys;
48782
+ }
48783
+ if (message.environmentName !== "") {
48784
+ obj.environmentName = message.environmentName;
48785
+ }
47967
48786
  return obj;
47968
48787
  },
47969
48788
  create(base) {
@@ -47973,6 +48792,8 @@ var SecretMetadata = {
47973
48792
  const message = createBaseSecretMetadata();
47974
48793
  message.name = object.name ?? "";
47975
48794
  message.creationInfo = object.creationInfo !== void 0 && object.creationInfo !== null ? CreationInfo.fromPartial(object.creationInfo) : void 0;
48795
+ message.keys = object.keys?.map((e) => e) || [];
48796
+ message.environmentName = object.environmentName ?? "";
47976
48797
  return message;
47977
48798
  }
47978
48799
  };
@@ -48969,6 +49790,291 @@ var ServerGetTimeRangeStatsResponse_ContainerPercentileStatsEntry = {
48969
49790
  return message;
48970
49791
  }
48971
49792
  };
49793
+ function createBaseServerRequestFetchRequest() {
49794
+ return { functionId: "", tail: void 0 };
49795
+ }
49796
+ var ServerRequestFetchRequest = {
49797
+ encode(message, writer = new BinaryWriter()) {
49798
+ if (message.functionId !== "") {
49799
+ writer.uint32(10).string(message.functionId);
49800
+ }
49801
+ if (message.tail !== void 0) {
49802
+ ServerRequestFetchRequest_Tail.encode(message.tail, writer.uint32(26).fork()).join();
49803
+ }
49804
+ return writer;
49805
+ },
49806
+ decode(input, length) {
49807
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49808
+ let end = length === void 0 ? reader.len : reader.pos + length;
49809
+ const message = createBaseServerRequestFetchRequest();
49810
+ while (reader.pos < end) {
49811
+ const tag = reader.uint32();
49812
+ switch (tag >>> 3) {
49813
+ case 1: {
49814
+ if (tag !== 10) {
49815
+ break;
49816
+ }
49817
+ message.functionId = reader.string();
49818
+ continue;
49819
+ }
49820
+ case 3: {
49821
+ if (tag !== 26) {
49822
+ break;
49823
+ }
49824
+ message.tail = ServerRequestFetchRequest_Tail.decode(reader, reader.uint32());
49825
+ continue;
49826
+ }
49827
+ }
49828
+ if ((tag & 7) === 4 || tag === 0) {
49829
+ break;
49830
+ }
49831
+ reader.skip(tag & 7);
49832
+ }
49833
+ return message;
49834
+ },
49835
+ fromJSON(object) {
49836
+ return {
49837
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : "",
49838
+ tail: isSet5(object.tail) ? ServerRequestFetchRequest_Tail.fromJSON(object.tail) : void 0
49839
+ };
49840
+ },
49841
+ toJSON(message) {
49842
+ const obj = {};
49843
+ if (message.functionId !== "") {
49844
+ obj.functionId = message.functionId;
49845
+ }
49846
+ if (message.tail !== void 0) {
49847
+ obj.tail = ServerRequestFetchRequest_Tail.toJSON(message.tail);
49848
+ }
49849
+ return obj;
49850
+ },
49851
+ create(base) {
49852
+ return ServerRequestFetchRequest.fromPartial(base ?? {});
49853
+ },
49854
+ fromPartial(object) {
49855
+ const message = createBaseServerRequestFetchRequest();
49856
+ message.functionId = object.functionId ?? "";
49857
+ message.tail = object.tail !== void 0 && object.tail !== null ? ServerRequestFetchRequest_Tail.fromPartial(object.tail) : void 0;
49858
+ return message;
49859
+ }
49860
+ };
49861
+ function createBaseServerRequestFetchRequest_Tail() {
49862
+ return { count: 0 };
49863
+ }
49864
+ var ServerRequestFetchRequest_Tail = {
49865
+ encode(message, writer = new BinaryWriter()) {
49866
+ if (message.count !== 0) {
49867
+ writer.uint32(8).uint32(message.count);
49868
+ }
49869
+ return writer;
49870
+ },
49871
+ decode(input, length) {
49872
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49873
+ let end = length === void 0 ? reader.len : reader.pos + length;
49874
+ const message = createBaseServerRequestFetchRequest_Tail();
49875
+ while (reader.pos < end) {
49876
+ const tag = reader.uint32();
49877
+ switch (tag >>> 3) {
49878
+ case 1: {
49879
+ if (tag !== 8) {
49880
+ break;
49881
+ }
49882
+ message.count = reader.uint32();
49883
+ continue;
49884
+ }
49885
+ }
49886
+ if ((tag & 7) === 4 || tag === 0) {
49887
+ break;
49888
+ }
49889
+ reader.skip(tag & 7);
49890
+ }
49891
+ return message;
49892
+ },
49893
+ fromJSON(object) {
49894
+ return { count: isSet5(object.count) ? globalThis.Number(object.count) : 0 };
49895
+ },
49896
+ toJSON(message) {
49897
+ const obj = {};
49898
+ if (message.count !== 0) {
49899
+ obj.count = Math.round(message.count);
49900
+ }
49901
+ return obj;
49902
+ },
49903
+ create(base) {
49904
+ return ServerRequestFetchRequest_Tail.fromPartial(base ?? {});
49905
+ },
49906
+ fromPartial(object) {
49907
+ const message = createBaseServerRequestFetchRequest_Tail();
49908
+ message.count = object.count ?? 0;
49909
+ return message;
49910
+ }
49911
+ };
49912
+ function createBaseServerRequestFetchResponse() {
49913
+ return { requests: [] };
49914
+ }
49915
+ var ServerRequestFetchResponse = {
49916
+ encode(message, writer = new BinaryWriter()) {
49917
+ for (const v of message.requests) {
49918
+ ServerRequestInfo.encode(v, writer.uint32(10).fork()).join();
49919
+ }
49920
+ return writer;
49921
+ },
49922
+ decode(input, length) {
49923
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49924
+ let end = length === void 0 ? reader.len : reader.pos + length;
49925
+ const message = createBaseServerRequestFetchResponse();
49926
+ while (reader.pos < end) {
49927
+ const tag = reader.uint32();
49928
+ switch (tag >>> 3) {
49929
+ case 1: {
49930
+ if (tag !== 10) {
49931
+ break;
49932
+ }
49933
+ message.requests.push(ServerRequestInfo.decode(reader, reader.uint32()));
49934
+ continue;
49935
+ }
49936
+ }
49937
+ if ((tag & 7) === 4 || tag === 0) {
49938
+ break;
49939
+ }
49940
+ reader.skip(tag & 7);
49941
+ }
49942
+ return message;
49943
+ },
49944
+ fromJSON(object) {
49945
+ return {
49946
+ requests: globalThis.Array.isArray(object?.requests) ? object.requests.map((e) => ServerRequestInfo.fromJSON(e)) : []
49947
+ };
49948
+ },
49949
+ toJSON(message) {
49950
+ const obj = {};
49951
+ if (message.requests?.length) {
49952
+ obj.requests = message.requests.map((e) => ServerRequestInfo.toJSON(e));
49953
+ }
49954
+ return obj;
49955
+ },
49956
+ create(base) {
49957
+ return ServerRequestFetchResponse.fromPartial(base ?? {});
49958
+ },
49959
+ fromPartial(object) {
49960
+ const message = createBaseServerRequestFetchResponse();
49961
+ message.requests = object.requests?.map((e) => ServerRequestInfo.fromPartial(e)) || [];
49962
+ return message;
49963
+ }
49964
+ };
49965
+ function createBaseServerRequestInfo() {
49966
+ return { route: "", timestamp: void 0, containerId: "", durationSeconds: 0, status: 0 };
49967
+ }
49968
+ var ServerRequestInfo = {
49969
+ encode(message, writer = new BinaryWriter()) {
49970
+ if (message.route !== "") {
49971
+ writer.uint32(10).string(message.route);
49972
+ }
49973
+ if (message.timestamp !== void 0) {
49974
+ Timestamp.encode(toTimestamp(message.timestamp), writer.uint32(18).fork()).join();
49975
+ }
49976
+ if (message.containerId !== "") {
49977
+ writer.uint32(26).string(message.containerId);
49978
+ }
49979
+ if (message.durationSeconds !== 0) {
49980
+ writer.uint32(33).double(message.durationSeconds);
49981
+ }
49982
+ if (message.status !== 0) {
49983
+ writer.uint32(40).int32(message.status);
49984
+ }
49985
+ return writer;
49986
+ },
49987
+ decode(input, length) {
49988
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
49989
+ let end = length === void 0 ? reader.len : reader.pos + length;
49990
+ const message = createBaseServerRequestInfo();
49991
+ while (reader.pos < end) {
49992
+ const tag = reader.uint32();
49993
+ switch (tag >>> 3) {
49994
+ case 1: {
49995
+ if (tag !== 10) {
49996
+ break;
49997
+ }
49998
+ message.route = reader.string();
49999
+ continue;
50000
+ }
50001
+ case 2: {
50002
+ if (tag !== 18) {
50003
+ break;
50004
+ }
50005
+ message.timestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
50006
+ continue;
50007
+ }
50008
+ case 3: {
50009
+ if (tag !== 26) {
50010
+ break;
50011
+ }
50012
+ message.containerId = reader.string();
50013
+ continue;
50014
+ }
50015
+ case 4: {
50016
+ if (tag !== 33) {
50017
+ break;
50018
+ }
50019
+ message.durationSeconds = reader.double();
50020
+ continue;
50021
+ }
50022
+ case 5: {
50023
+ if (tag !== 40) {
50024
+ break;
50025
+ }
50026
+ message.status = reader.int32();
50027
+ continue;
50028
+ }
50029
+ }
50030
+ if ((tag & 7) === 4 || tag === 0) {
50031
+ break;
50032
+ }
50033
+ reader.skip(tag & 7);
50034
+ }
50035
+ return message;
50036
+ },
50037
+ fromJSON(object) {
50038
+ return {
50039
+ route: isSet5(object.route) ? globalThis.String(object.route) : "",
50040
+ timestamp: isSet5(object.timestamp) ? fromJsonTimestamp(object.timestamp) : void 0,
50041
+ containerId: isSet5(object.containerId) ? globalThis.String(object.containerId) : "",
50042
+ durationSeconds: isSet5(object.durationSeconds) ? globalThis.Number(object.durationSeconds) : 0,
50043
+ status: isSet5(object.status) ? globalThis.Number(object.status) : 0
50044
+ };
50045
+ },
50046
+ toJSON(message) {
50047
+ const obj = {};
50048
+ if (message.route !== "") {
50049
+ obj.route = message.route;
50050
+ }
50051
+ if (message.timestamp !== void 0) {
50052
+ obj.timestamp = message.timestamp.toISOString();
50053
+ }
50054
+ if (message.containerId !== "") {
50055
+ obj.containerId = message.containerId;
50056
+ }
50057
+ if (message.durationSeconds !== 0) {
50058
+ obj.durationSeconds = message.durationSeconds;
50059
+ }
50060
+ if (message.status !== 0) {
50061
+ obj.status = Math.round(message.status);
50062
+ }
50063
+ return obj;
50064
+ },
50065
+ create(base) {
50066
+ return ServerRequestInfo.fromPartial(base ?? {});
50067
+ },
50068
+ fromPartial(object) {
50069
+ const message = createBaseServerRequestInfo();
50070
+ message.route = object.route ?? "";
50071
+ message.timestamp = object.timestamp ?? void 0;
50072
+ message.containerId = object.containerId ?? "";
50073
+ message.durationSeconds = object.durationSeconds ?? 0;
50074
+ message.status = object.status ?? 0;
50075
+ return message;
50076
+ }
50077
+ };
48972
50078
  function createBaseServiceUser() {
48973
50079
  return {
48974
50080
  name: "",
@@ -51685,7 +52791,8 @@ function createBaseTaskLogsBatch() {
51685
52791
  eof: false,
51686
52792
  ptyExecId: "",
51687
52793
  rootFunctionId: "",
51688
- ttlDays: 0
52794
+ ttlDays: 0,
52795
+ sandboxId: ""
51689
52796
  };
51690
52797
  }
51691
52798
  var TaskLogsBatch = {
@@ -51723,6 +52830,9 @@ var TaskLogsBatch = {
51723
52830
  if (message.ttlDays !== 0) {
51724
52831
  writer.uint32(136).uint32(message.ttlDays);
51725
52832
  }
52833
+ if (message.sandboxId !== "") {
52834
+ writer.uint32(146).string(message.sandboxId);
52835
+ }
51726
52836
  return writer;
51727
52837
  },
51728
52838
  decode(input, length) {
@@ -51809,6 +52919,13 @@ var TaskLogsBatch = {
51809
52919
  message.ttlDays = reader.uint32();
51810
52920
  continue;
51811
52921
  }
52922
+ case 18: {
52923
+ if (tag !== 146) {
52924
+ break;
52925
+ }
52926
+ message.sandboxId = reader.string();
52927
+ continue;
52928
+ }
51812
52929
  }
51813
52930
  if ((tag & 7) === 4 || tag === 0) {
51814
52931
  break;
@@ -51829,7 +52946,8 @@ var TaskLogsBatch = {
51829
52946
  eof: isSet5(object.eof) ? globalThis.Boolean(object.eof) : false,
51830
52947
  ptyExecId: isSet5(object.ptyExecId) ? globalThis.String(object.ptyExecId) : "",
51831
52948
  rootFunctionId: isSet5(object.rootFunctionId) ? globalThis.String(object.rootFunctionId) : "",
51832
- ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0
52949
+ ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0,
52950
+ sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : ""
51833
52951
  };
51834
52952
  },
51835
52953
  toJSON(message) {
@@ -51867,6 +52985,9 @@ var TaskLogsBatch = {
51867
52985
  if (message.ttlDays !== 0) {
51868
52986
  obj.ttlDays = Math.round(message.ttlDays);
51869
52987
  }
52988
+ if (message.sandboxId !== "") {
52989
+ obj.sandboxId = message.sandboxId;
52990
+ }
51870
52991
  return obj;
51871
52992
  },
51872
52993
  create(base) {
@@ -51885,6 +53006,7 @@ var TaskLogsBatch = {
51885
53006
  message.ptyExecId = object.ptyExecId ?? "";
51886
53007
  message.rootFunctionId = object.rootFunctionId ?? "";
51887
53008
  message.ttlDays = object.ttlDays ?? 0;
53009
+ message.sandboxId = object.sandboxId ?? "";
51888
53010
  return message;
51889
53011
  }
51890
53012
  };
@@ -52556,7 +53678,7 @@ var TokenDeleteRequest = {
52556
53678
  }
52557
53679
  };
52558
53680
  function createBaseTokenFlowCreateRequest() {
52559
- return { utmSource: "", localhostPort: 0, nextUrl: "" };
53681
+ return { utmSource: "", localhostPort: 0, nextUrl: "", expiresInSeconds: 0 };
52560
53682
  }
52561
53683
  var TokenFlowCreateRequest = {
52562
53684
  encode(message, writer = new BinaryWriter()) {
@@ -52569,6 +53691,9 @@ var TokenFlowCreateRequest = {
52569
53691
  if (message.nextUrl !== "") {
52570
53692
  writer.uint32(42).string(message.nextUrl);
52571
53693
  }
53694
+ if (message.expiresInSeconds !== 0) {
53695
+ writer.uint32(48).uint32(message.expiresInSeconds);
53696
+ }
52572
53697
  return writer;
52573
53698
  },
52574
53699
  decode(input, length) {
@@ -52599,6 +53724,13 @@ var TokenFlowCreateRequest = {
52599
53724
  message.nextUrl = reader.string();
52600
53725
  continue;
52601
53726
  }
53727
+ case 6: {
53728
+ if (tag !== 48) {
53729
+ break;
53730
+ }
53731
+ message.expiresInSeconds = reader.uint32();
53732
+ continue;
53733
+ }
52602
53734
  }
52603
53735
  if ((tag & 7) === 4 || tag === 0) {
52604
53736
  break;
@@ -52611,7 +53743,8 @@ var TokenFlowCreateRequest = {
52611
53743
  return {
52612
53744
  utmSource: isSet5(object.utmSource) ? globalThis.String(object.utmSource) : "",
52613
53745
  localhostPort: isSet5(object.localhostPort) ? globalThis.Number(object.localhostPort) : 0,
52614
- nextUrl: isSet5(object.nextUrl) ? globalThis.String(object.nextUrl) : ""
53746
+ nextUrl: isSet5(object.nextUrl) ? globalThis.String(object.nextUrl) : "",
53747
+ expiresInSeconds: isSet5(object.expiresInSeconds) ? globalThis.Number(object.expiresInSeconds) : 0
52615
53748
  };
52616
53749
  },
52617
53750
  toJSON(message) {
@@ -52625,6 +53758,9 @@ var TokenFlowCreateRequest = {
52625
53758
  if (message.nextUrl !== "") {
52626
53759
  obj.nextUrl = message.nextUrl;
52627
53760
  }
53761
+ if (message.expiresInSeconds !== 0) {
53762
+ obj.expiresInSeconds = Math.round(message.expiresInSeconds);
53763
+ }
52628
53764
  return obj;
52629
53765
  },
52630
53766
  create(base) {
@@ -52635,6 +53771,7 @@ var TokenFlowCreateRequest = {
52635
53771
  message.utmSource = object.utmSource ?? "";
52636
53772
  message.localhostPort = object.localhostPort ?? 0;
52637
53773
  message.nextUrl = object.nextUrl ?? "";
53774
+ message.expiresInSeconds = object.expiresInSeconds ?? 0;
52638
53775
  return message;
52639
53776
  }
52640
53777
  };
@@ -57511,6 +58648,74 @@ var WebhookTokenListResponse = {
57511
58648
  return message;
57512
58649
  }
57513
58650
  };
58651
+ function createBaseWebhookTokenUpdateRequest() {
58652
+ return { tokenId: "", name: void 0 };
58653
+ }
58654
+ var WebhookTokenUpdateRequest = {
58655
+ encode(message, writer = new BinaryWriter()) {
58656
+ if (message.tokenId !== "") {
58657
+ writer.uint32(10).string(message.tokenId);
58658
+ }
58659
+ if (message.name !== void 0) {
58660
+ writer.uint32(18).string(message.name);
58661
+ }
58662
+ return writer;
58663
+ },
58664
+ decode(input, length) {
58665
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
58666
+ let end = length === void 0 ? reader.len : reader.pos + length;
58667
+ const message = createBaseWebhookTokenUpdateRequest();
58668
+ while (reader.pos < end) {
58669
+ const tag = reader.uint32();
58670
+ switch (tag >>> 3) {
58671
+ case 1: {
58672
+ if (tag !== 10) {
58673
+ break;
58674
+ }
58675
+ message.tokenId = reader.string();
58676
+ continue;
58677
+ }
58678
+ case 2: {
58679
+ if (tag !== 18) {
58680
+ break;
58681
+ }
58682
+ message.name = reader.string();
58683
+ continue;
58684
+ }
58685
+ }
58686
+ if ((tag & 7) === 4 || tag === 0) {
58687
+ break;
58688
+ }
58689
+ reader.skip(tag & 7);
58690
+ }
58691
+ return message;
58692
+ },
58693
+ fromJSON(object) {
58694
+ return {
58695
+ tokenId: isSet5(object.tokenId) ? globalThis.String(object.tokenId) : "",
58696
+ name: isSet5(object.name) ? globalThis.String(object.name) : void 0
58697
+ };
58698
+ },
58699
+ toJSON(message) {
58700
+ const obj = {};
58701
+ if (message.tokenId !== "") {
58702
+ obj.tokenId = message.tokenId;
58703
+ }
58704
+ if (message.name !== void 0) {
58705
+ obj.name = message.name;
58706
+ }
58707
+ return obj;
58708
+ },
58709
+ create(base) {
58710
+ return WebhookTokenUpdateRequest.fromPartial(base ?? {});
58711
+ },
58712
+ fromPartial(object) {
58713
+ const message = createBaseWebhookTokenUpdateRequest();
58714
+ message.tokenId = object.tokenId ?? "";
58715
+ message.name = object.name ?? void 0;
58716
+ return message;
58717
+ }
58718
+ };
57514
58719
  function createBaseWorkspaceBillingRatesRequest() {
57515
58720
  return {};
57516
58721
  }
@@ -60236,6 +61441,14 @@ var ModalClientDefinition = {
60236
61441
  responseStream: false,
60237
61442
  options: {}
60238
61443
  },
61444
+ functionCallFetch: {
61445
+ name: "FunctionCallFetch",
61446
+ requestType: FunctionCallFetchRequest,
61447
+ requestStream: false,
61448
+ responseType: FunctionCallFetchResponse,
61449
+ responseStream: false,
61450
+ options: {}
61451
+ },
60239
61452
  functionCallFromId: {
60240
61453
  name: "FunctionCallFromId",
60241
61454
  requestType: FunctionCallFromIdRequest,
@@ -60391,6 +61604,14 @@ var ModalClientDefinition = {
60391
61604
  responseStream: false,
60392
61605
  options: {}
60393
61606
  },
61607
+ functionListVariants: {
61608
+ name: "FunctionListVariants",
61609
+ requestType: FunctionListVariantsRequest,
61610
+ requestStream: false,
61611
+ responseType: FunctionListVariantsResponse,
61612
+ responseStream: false,
61613
+ options: {}
61614
+ },
60394
61615
  functionMap: {
60395
61616
  name: "FunctionMap",
60396
61617
  requestType: FunctionMapRequest,
@@ -61025,6 +62246,14 @@ var ModalClientDefinition = {
61025
62246
  responseStream: false,
61026
62247
  options: {}
61027
62248
  },
62249
+ secretGetInfo: {
62250
+ name: "SecretGetInfo",
62251
+ requestType: SecretGetInfoRequest,
62252
+ requestStream: false,
62253
+ responseType: SecretGetInfoResponse,
62254
+ responseStream: false,
62255
+ options: {}
62256
+ },
61028
62257
  secretGetOrCreate: {
61029
62258
  name: "SecretGetOrCreate",
61030
62259
  requestType: SecretGetOrCreateRequest,
@@ -61058,6 +62287,14 @@ var ModalClientDefinition = {
61058
62287
  responseStream: false,
61059
62288
  options: {}
61060
62289
  },
62290
+ serverRequestFetch: {
62291
+ name: "ServerRequestFetch",
62292
+ requestType: ServerRequestFetchRequest,
62293
+ requestStream: false,
62294
+ responseType: ServerRequestFetchResponse,
62295
+ responseStream: false,
62296
+ options: {}
62297
+ },
61061
62298
  /** Service users */
61062
62299
  serviceUserList: {
61063
62300
  name: "ServiceUserList",
@@ -61451,6 +62688,14 @@ var ModalClientDefinition = {
61451
62688
  responseStream: false,
61452
62689
  options: {}
61453
62690
  },
62691
+ webhookTokenUpdate: {
62692
+ name: "WebhookTokenUpdate",
62693
+ requestType: WebhookTokenUpdateRequest,
62694
+ requestStream: false,
62695
+ responseType: WebhookToken,
62696
+ responseStream: false,
62697
+ options: {}
62698
+ },
61454
62699
  /** Workspaces */
61455
62700
  workspaceBillingRates: {
61456
62701
  name: "WorkspaceBillingRates",
@@ -61660,6 +62905,12 @@ var QueueFullError = class extends Error {
61660
62905
  this.name = "QueueFullError";
61661
62906
  }
61662
62907
  };
62908
+ var ResourceExhaustedError = class extends Error {
62909
+ constructor(message) {
62910
+ super(message);
62911
+ this.name = "ResourceExhaustedError";
62912
+ }
62913
+ };
61663
62914
  var SandboxFilesystemError = class extends Error {
61664
62915
  constructor(message) {
61665
62916
  super(message);
@@ -64101,7 +65352,8 @@ function createBaseTaskContainerCreateRequest() {
64101
65352
  secretIds: [],
64102
65353
  volumeMounts: [],
64103
65354
  networkAccess: void 0,
64104
- ptyInfo: void 0
65355
+ ptyInfo: void 0,
65356
+ memoryReserveConsumeMib: void 0
64105
65357
  };
64106
65358
  }
64107
65359
  var TaskContainerCreateRequest = {
@@ -64136,6 +65388,9 @@ var TaskContainerCreateRequest = {
64136
65388
  if (message.ptyInfo !== void 0) {
64137
65389
  PTYInfo.encode(message.ptyInfo, writer.uint32(90).fork()).join();
64138
65390
  }
65391
+ if (message.memoryReserveConsumeMib !== void 0) {
65392
+ writer.uint32(96).uint32(message.memoryReserveConsumeMib);
65393
+ }
64139
65394
  return writer;
64140
65395
  },
64141
65396
  decode(input, length) {
@@ -64218,6 +65473,13 @@ var TaskContainerCreateRequest = {
64218
65473
  message.ptyInfo = PTYInfo.decode(reader, reader.uint32());
64219
65474
  continue;
64220
65475
  }
65476
+ case 12: {
65477
+ if (tag !== 96) {
65478
+ break;
65479
+ }
65480
+ message.memoryReserveConsumeMib = reader.uint32();
65481
+ continue;
65482
+ }
64221
65483
  }
64222
65484
  if ((tag & 7) === 4 || tag === 0) {
64223
65485
  break;
@@ -64240,7 +65502,8 @@ var TaskContainerCreateRequest = {
64240
65502
  secretIds: globalThis.Array.isArray(object?.secretIds) ? object.secretIds.map((e) => globalThis.String(e)) : [],
64241
65503
  volumeMounts: globalThis.Array.isArray(object?.volumeMounts) ? object.volumeMounts.map((e) => VolumeMount.fromJSON(e)) : [],
64242
65504
  networkAccess: isSet6(object.networkAccess) ? NetworkAccess.fromJSON(object.networkAccess) : void 0,
64243
- ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0
65505
+ ptyInfo: isSet6(object.ptyInfo) ? PTYInfo.fromJSON(object.ptyInfo) : void 0,
65506
+ memoryReserveConsumeMib: isSet6(object.memoryReserveConsumeMib) ? globalThis.Number(object.memoryReserveConsumeMib) : void 0
64244
65507
  };
64245
65508
  },
64246
65509
  toJSON(message) {
@@ -64281,6 +65544,9 @@ var TaskContainerCreateRequest = {
64281
65544
  if (message.ptyInfo !== void 0) {
64282
65545
  obj.ptyInfo = PTYInfo.toJSON(message.ptyInfo);
64283
65546
  }
65547
+ if (message.memoryReserveConsumeMib !== void 0) {
65548
+ obj.memoryReserveConsumeMib = Math.round(message.memoryReserveConsumeMib);
65549
+ }
64284
65550
  return obj;
64285
65551
  },
64286
65552
  create(base) {
@@ -64303,6 +65569,7 @@ var TaskContainerCreateRequest = {
64303
65569
  message.volumeMounts = object.volumeMounts?.map((e) => VolumeMount.fromPartial(e)) || [];
64304
65570
  message.networkAccess = object.networkAccess !== void 0 && object.networkAccess !== null ? NetworkAccess.fromPartial(object.networkAccess) : void 0;
64305
65571
  message.ptyInfo = object.ptyInfo !== void 0 && object.ptyInfo !== null ? PTYInfo.fromPartial(object.ptyInfo) : void 0;
65572
+ message.memoryReserveConsumeMib = object.memoryReserveConsumeMib ?? void 0;
64306
65573
  return message;
64307
65574
  }
64308
65575
  };
@@ -67593,6 +68860,41 @@ function isSet6(value) {
67593
68860
  var import_promises = require("timers/promises");
67594
68861
  var import_nice_grpc7 = require("nice-grpc");
67595
68862
 
68863
+ // src/server_warnings.ts
68864
+ var SERVER_WARNING_HEADER = "x-modal-warning";
68865
+ var SERVER_WARNING_REGISTRY_LIMIT = 2048;
68866
+ function logServerWarnings(logger2, trailer, seen) {
68867
+ const joined = trailer.get(SERVER_WARNING_HEADER);
68868
+ if (typeof joined !== "string") return;
68869
+ for (const encoded of joined.split(",")) {
68870
+ let message;
68871
+ try {
68872
+ message = decodeURIComponent(encoded.trim());
68873
+ } catch {
68874
+ message = encoded.trim();
68875
+ }
68876
+ if (seen.size > SERVER_WARNING_REGISTRY_LIMIT) {
68877
+ seen.clear();
68878
+ }
68879
+ if (seen.has(message)) continue;
68880
+ seen.add(message);
68881
+ logger2.warn(message);
68882
+ }
68883
+ }
68884
+ function serverWarningMiddleware(logger2) {
68885
+ const seen = /* @__PURE__ */ new Set();
68886
+ return async function* serverWarningMiddleware2(call, options) {
68887
+ const { onTrailer, ...restOptions } = options;
68888
+ return yield* call.next(call.request, {
68889
+ ...restOptions,
68890
+ onTrailer: (trailer) => {
68891
+ logServerWarnings(logger2, trailer, seen);
68892
+ onTrailer?.(trailer);
68893
+ }
68894
+ });
68895
+ };
68896
+ }
68897
+
67596
68898
  // src/config.ts
67597
68899
  var import_node_console = require("console");
67598
68900
  var import_node_fs = require("fs");
@@ -67684,7 +68986,7 @@ function getProfile(profileName) {
67684
68986
  const ms = Math.round(parsed * 1e3);
67685
68987
  return parsed > 0 && ms === 0 ? 1 : ms;
67686
68988
  })(),
67687
- sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : parseBooleanFlag(profileData.sandbox_v2)
68989
+ sandboxV2: process.env["MODAL_SANDBOX_V2"] ? parseBooleanFlag(process.env["MODAL_SANDBOX_V2"]) : profileData.sandbox_v2 !== void 0 ? parseBooleanFlag(profileData.sandbox_v2) : true
67688
68990
  };
67689
68991
  return profile;
67690
68992
  }
@@ -67906,7 +69208,7 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
67906
69208
  options.metadata ??= new import_nice_grpc7.Metadata();
67907
69209
  options.metadata.set("authorization", `Bearer ${self.jwt}`);
67908
69210
  return yield* call.next(call.request, options);
67909
- });
69211
+ }).use(serverWarningMiddleware(logger2));
67910
69212
  this.factory = factory;
67911
69213
  this.stub = factory.create(TaskCommandRouterDefinition, this.channel);
67912
69214
  this.armIdleTimer();
@@ -68311,6 +69613,9 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
68311
69613
  async setNetworkAccess(request) {
68312
69614
  await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
68313
69615
  }
69616
+ async setOutboundPolicy(request) {
69617
+ await this.callUnary(() => this.stub.taskSetOutboundPolicy(request));
69618
+ }
68314
69619
  /**
68315
69620
  * Reload all Volumes mounted in the task to reflect their latest committed state.
68316
69621
  *
@@ -69493,8 +70798,151 @@ var SandboxFilesystem = class {
69493
70798
  };
69494
70799
 
69495
70800
  // src/sandbox_sidecar.ts
69496
- var import_nice_grpc10 = require("nice-grpc");
70801
+ var import_nice_grpc11 = require("nice-grpc");
69497
70802
  var import_uuid = require("uuid");
70803
+
70804
+ // src/volume.ts
70805
+ var import_nice_grpc10 = require("nice-grpc");
70806
+ var VolumeService = class {
70807
+ #client;
70808
+ constructor(client) {
70809
+ this.#client = client;
70810
+ }
70811
+ /**
70812
+ * Reference a {@link Volume} by its name.
70813
+ */
70814
+ async fromName(name, params) {
70815
+ try {
70816
+ const resp = await this.#client.cpClient.volumeGetOrCreate({
70817
+ deploymentName: name,
70818
+ environmentName: this.#client.environmentName(params?.environment),
70819
+ objectCreationType: params?.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
70820
+ });
70821
+ this.#client.logger.debug(
70822
+ "Retrieved Volume",
70823
+ "volume_id",
70824
+ resp.volumeId,
70825
+ "volume_name",
70826
+ name
70827
+ );
70828
+ return new Volume(resp.volumeId, name);
70829
+ } catch (err) {
70830
+ if (err instanceof import_nice_grpc10.ClientError && err.code === import_nice_grpc10.Status.NOT_FOUND)
70831
+ throw new NotFoundError(err.details);
70832
+ throw err;
70833
+ }
70834
+ }
70835
+ /**
70836
+ * Create a nameless, temporary {@link Volume}.
70837
+ * It persists until closeEphemeral() is called, or the process exits.
70838
+ */
70839
+ async ephemeral(params = {}) {
70840
+ const resp = await this.#client.cpClient.volumeGetOrCreate({
70841
+ objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
70842
+ environmentName: this.#client.environmentName(params.environment)
70843
+ });
70844
+ this.#client.logger.debug(
70845
+ "Created ephemeral Volume",
70846
+ "volume_id",
70847
+ resp.volumeId
70848
+ );
70849
+ const ephemeralHbManager = new EphemeralHeartbeatManager(
70850
+ () => this.#client.cpClient.volumeHeartbeat({ volumeId: resp.volumeId })
70851
+ );
70852
+ return new Volume(resp.volumeId, void 0, void 0, ephemeralHbManager);
70853
+ }
70854
+ /**
70855
+ * Delete a named {@link Volume}.
70856
+ *
70857
+ * Warning: Deletion is irreversible and will affect any Apps currently using the Volume.
70858
+ */
70859
+ async delete(name, params) {
70860
+ try {
70861
+ const volume = await this.fromName(name, {
70862
+ environment: params?.environment,
70863
+ createIfMissing: false
70864
+ });
70865
+ await this.#client.cpClient.volumeDelete({
70866
+ volumeId: volume.volumeId
70867
+ });
70868
+ this.#client.logger.debug(
70869
+ "Deleted Volume",
70870
+ "volume_name",
70871
+ name,
70872
+ "volume_id",
70873
+ volume.volumeId
70874
+ );
70875
+ } catch (err) {
70876
+ const isNotFound = err instanceof NotFoundError || err instanceof import_nice_grpc10.ClientError && err.code === import_nice_grpc10.Status.NOT_FOUND;
70877
+ if (isNotFound && params?.allowMissing) {
70878
+ return;
70879
+ }
70880
+ throw err;
70881
+ }
70882
+ }
70883
+ };
70884
+ var DEFAULT_MOUNT_OPTIONS = {
70885
+ readOnly: false,
70886
+ subPath: void 0
70887
+ };
70888
+ var Volume = class _Volume {
70889
+ volumeId;
70890
+ name;
70891
+ /**
70892
+ * @hidden
70893
+ * @internal
70894
+ */
70895
+ _mountOptions = DEFAULT_MOUNT_OPTIONS;
70896
+ #ephemeralHbManager;
70897
+ /** @ignore */
70898
+ constructor(volumeId, name, mountOptions, ephemeralHbManager) {
70899
+ this.volumeId = volumeId;
70900
+ this.name = name;
70901
+ if (mountOptions) {
70902
+ this._mountOptions = mountOptions;
70903
+ }
70904
+ this.#ephemeralHbManager = ephemeralHbManager;
70905
+ }
70906
+ /**
70907
+ * Configure options used when mounting this Volume. Fields left undefined preserve their value
70908
+ * from any previous withMountOptions call on the same Volume (stacking).
70909
+ */
70910
+ withMountOptions(params = {}) {
70911
+ let subPath = this._mountOptions.subPath;
70912
+ if (params.subPath !== void 0) {
70913
+ subPath = params.subPath === "/" ? void 0 : params.subPath;
70914
+ }
70915
+ return new _Volume(
70916
+ this.volumeId,
70917
+ this.name,
70918
+ {
70919
+ readOnly: params.readOnly ?? this._mountOptions.readOnly,
70920
+ subPath
70921
+ },
70922
+ this.#ephemeralHbManager
70923
+ );
70924
+ }
70925
+ /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
70926
+ closeEphemeral() {
70927
+ if (this.#ephemeralHbManager) {
70928
+ this.#ephemeralHbManager.stop();
70929
+ } else {
70930
+ throw new InvalidError("Volume is not ephemeral.");
70931
+ }
70932
+ }
70933
+ };
70934
+ function volumeToMountProto(mountPath, volume) {
70935
+ const opts = volume._mountOptions ?? DEFAULT_MOUNT_OPTIONS;
70936
+ return {
70937
+ volumeId: volume.volumeId,
70938
+ mountPath,
70939
+ allowBackgroundCommits: true,
70940
+ readOnly: opts.readOnly,
70941
+ subPath: opts.subPath
70942
+ };
70943
+ }
70944
+
70945
+ // src/sandbox_sidecar.ts
69498
70946
  var MAIN_CONTAINER_NAME = "main";
69499
70947
  var CONTAINER_WAIT_POLL_TIMEOUT_SECONDS = 10;
69500
70948
  var CONTROL_PLANE_SIDECAR_CREATE_ENV_VAR = "MODAL_USE_CONTROL_PLANE_SIDECAR_CREATE";
@@ -69511,6 +70959,29 @@ function validateSidecarName(name) {
69511
70959
  );
69512
70960
  }
69513
70961
  }
70962
+ function buildSidecarVolumeMounts(volumes) {
70963
+ const mountPathsByVolumeId = /* @__PURE__ */ new Map();
70964
+ const volumeMounts = [];
70965
+ for (const [mountPath, volume] of Object.entries(volumes ?? {})) {
70966
+ if (!volume) {
70967
+ throw new InvalidError(
70968
+ `Volume mounted at "${mountPath}" must not be null or undefined`
70969
+ );
70970
+ }
70971
+ const mountPaths = mountPathsByVolumeId.get(volume.volumeId) ?? [];
70972
+ mountPaths.push(mountPath);
70973
+ mountPathsByVolumeId.set(volume.volumeId, mountPaths);
70974
+ volumeMounts.push(volumeToMountProto(mountPath, volume));
70975
+ }
70976
+ for (const mountPaths of mountPathsByVolumeId.values()) {
70977
+ if (mountPaths.length > 1) {
70978
+ throw new InvalidError(
70979
+ "The same Volume cannot be mounted at multiple paths in a sidecar: " + mountPaths.sort().join(", ")
70980
+ );
70981
+ }
70982
+ }
70983
+ return volumeMounts;
70984
+ }
69514
70985
  function sidecarContainerFromProto(access, info) {
69515
70986
  return new SidecarContainer(
69516
70987
  access,
@@ -69541,6 +71012,11 @@ var SidecarService = class {
69541
71012
  const command = params?.command ?? [];
69542
71013
  validateExecArgs(command);
69543
71014
  validateWorkdir(params?.workdir);
71015
+ if (params?.experimentalMemoryReserveConsumeMiB !== void 0 && (!Number.isInteger(params.experimentalMemoryReserveConsumeMiB) || params.experimentalMemoryReserveConsumeMiB <= 0)) {
71016
+ throw new InvalidError(
71017
+ `experimentalMemoryReserveConsumeMiB must be a positive integer number of MiB, got: ${params.experimentalMemoryReserveConsumeMiB}`
71018
+ );
71019
+ }
69544
71020
  validateEnvVarKeys(params?.env ?? {});
69545
71021
  const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
69546
71022
  params?.secrets ?? []
@@ -69548,6 +71024,7 @@ var SidecarService = class {
69548
71024
  Object.assign(envDict, params?.env ?? {});
69549
71025
  await hydrateSecrets(this.#access.client, resolvableSecrets);
69550
71026
  const secretIds = collectSecretIds(resolvableSecrets);
71027
+ const volumeMounts = buildSidecarVolumeMounts(params?.volumes);
69551
71028
  const ptyInfo = params?.pty ? defaultSandboxPTYInfo() : void 0;
69552
71029
  const networkAccess = buildOutboundNetworkAccess(
69553
71030
  false,
@@ -69567,8 +71044,12 @@ var SidecarService = class {
69567
71044
  entrypointArgs: command,
69568
71045
  workdir: params?.workdir ?? void 0,
69569
71046
  secretIds,
71047
+ volumeMounts,
69570
71048
  networkAccess,
69571
- ptyInfo
71049
+ ptyInfo,
71050
+ resources: params?.experimentalMemoryReserveConsumeMiB !== void 0 ? Resources.create({
71051
+ memoryMb: params.experimentalMemoryReserveConsumeMiB
71052
+ }) : void 0
69572
71053
  }),
69573
71054
  ephemeralSecrets
69574
71055
  })
@@ -69584,17 +71065,19 @@ var SidecarService = class {
69584
71065
  env: envDict,
69585
71066
  workdir: params?.workdir ?? "",
69586
71067
  secretIds,
71068
+ volumeMounts,
69587
71069
  networkAccess,
69588
- ptyInfo
71070
+ ptyInfo,
71071
+ memoryReserveConsumeMib: params?.experimentalMemoryReserveConsumeMiB
69589
71072
  })
69590
71073
  );
69591
71074
  }
69592
71075
  } catch (err) {
69593
- if (err instanceof import_nice_grpc10.ClientError) {
69594
- if (err.code === import_nice_grpc10.Status.ALREADY_EXISTS) {
71076
+ if (err instanceof import_nice_grpc11.ClientError) {
71077
+ if (err.code === import_nice_grpc11.Status.ALREADY_EXISTS) {
69595
71078
  throw new AlreadyExistsError(err.details || err.message);
69596
71079
  }
69597
- if (err.code === import_nice_grpc10.Status.INVALID_ARGUMENT) {
71080
+ if (err.code === import_nice_grpc11.Status.INVALID_ARGUMENT) {
69598
71081
  throw new InvalidError(err.details || err.message);
69599
71082
  }
69600
71083
  }
@@ -69620,7 +71103,7 @@ var SidecarService = class {
69620
71103
  })
69621
71104
  );
69622
71105
  } catch (err) {
69623
- if (err instanceof import_nice_grpc10.ClientError && err.code === import_nice_grpc10.Status.NOT_FOUND) {
71106
+ if (err instanceof import_nice_grpc11.ClientError && err.code === import_nice_grpc11.Status.NOT_FOUND) {
69624
71107
  throw new NotFoundError(`Sidecar container "${name}" not found`);
69625
71108
  }
69626
71109
  throw err;
@@ -69991,151 +71474,19 @@ var SandboxSnapshotService = class {
69991
71474
  }
69992
71475
  };
69993
71476
 
69994
- // src/volume.ts
69995
- var import_nice_grpc11 = require("nice-grpc");
69996
- var VolumeService = class {
69997
- #client;
69998
- constructor(client) {
69999
- this.#client = client;
70000
- }
70001
- /**
70002
- * Reference a {@link Volume} by its name.
70003
- */
70004
- async fromName(name, params) {
70005
- try {
70006
- const resp = await this.#client.cpClient.volumeGetOrCreate({
70007
- deploymentName: name,
70008
- environmentName: this.#client.environmentName(params?.environment),
70009
- objectCreationType: params?.createIfMissing ? 1 /* OBJECT_CREATION_TYPE_CREATE_IF_MISSING */ : 0 /* OBJECT_CREATION_TYPE_UNSPECIFIED */
70010
- });
70011
- this.#client.logger.debug(
70012
- "Retrieved Volume",
70013
- "volume_id",
70014
- resp.volumeId,
70015
- "volume_name",
70016
- name
70017
- );
70018
- return new Volume(resp.volumeId, name);
70019
- } catch (err) {
70020
- if (err instanceof import_nice_grpc11.ClientError && err.code === import_nice_grpc11.Status.NOT_FOUND)
70021
- throw new NotFoundError(err.details);
70022
- throw err;
70023
- }
70024
- }
70025
- /**
70026
- * Create a nameless, temporary {@link Volume}.
70027
- * It persists until closeEphemeral() is called, or the process exits.
70028
- */
70029
- async ephemeral(params = {}) {
70030
- const resp = await this.#client.cpClient.volumeGetOrCreate({
70031
- objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
70032
- environmentName: this.#client.environmentName(params.environment)
70033
- });
70034
- this.#client.logger.debug(
70035
- "Created ephemeral Volume",
70036
- "volume_id",
70037
- resp.volumeId
70038
- );
70039
- const ephemeralHbManager = new EphemeralHeartbeatManager(
70040
- () => this.#client.cpClient.volumeHeartbeat({ volumeId: resp.volumeId })
70041
- );
70042
- return new Volume(resp.volumeId, void 0, void 0, ephemeralHbManager);
70043
- }
70044
- /**
70045
- * Delete a named {@link Volume}.
70046
- *
70047
- * Warning: Deletion is irreversible and will affect any Apps currently using the Volume.
70048
- */
70049
- async delete(name, params) {
70050
- try {
70051
- const volume = await this.fromName(name, {
70052
- environment: params?.environment,
70053
- createIfMissing: false
70054
- });
70055
- await this.#client.cpClient.volumeDelete({
70056
- volumeId: volume.volumeId
70057
- });
70058
- this.#client.logger.debug(
70059
- "Deleted Volume",
70060
- "volume_name",
70061
- name,
70062
- "volume_id",
70063
- volume.volumeId
70064
- );
70065
- } catch (err) {
70066
- const isNotFound = err instanceof NotFoundError || err instanceof import_nice_grpc11.ClientError && err.code === import_nice_grpc11.Status.NOT_FOUND;
70067
- if (isNotFound && params?.allowMissing) {
70068
- return;
70069
- }
70070
- throw err;
70071
- }
70072
- }
70073
- };
70074
- var DEFAULT_MOUNT_OPTIONS = {
70075
- readOnly: false,
70076
- subPath: void 0
70077
- };
70078
- var Volume = class _Volume {
70079
- volumeId;
70080
- name;
70081
- /**
70082
- * @hidden
70083
- * @internal
70084
- */
70085
- _mountOptions = DEFAULT_MOUNT_OPTIONS;
70086
- #ephemeralHbManager;
70087
- /** @ignore */
70088
- constructor(volumeId, name, mountOptions, ephemeralHbManager) {
70089
- this.volumeId = volumeId;
70090
- this.name = name;
70091
- if (mountOptions) {
70092
- this._mountOptions = mountOptions;
70093
- }
70094
- this.#ephemeralHbManager = ephemeralHbManager;
70095
- }
70096
- /**
70097
- * Configure options used when mounting this Volume. Fields left undefined preserve their value
70098
- * from any previous withMountOptions call on the same Volume (stacking).
70099
- */
70100
- withMountOptions(params = {}) {
70101
- let subPath = this._mountOptions.subPath;
70102
- if (params.subPath !== void 0) {
70103
- subPath = params.subPath === "/" ? void 0 : params.subPath;
70104
- }
70105
- return new _Volume(
70106
- this.volumeId,
70107
- this.name,
70108
- {
70109
- readOnly: params.readOnly ?? this._mountOptions.readOnly,
70110
- subPath
70111
- },
70112
- this.#ephemeralHbManager
70113
- );
70114
- }
70115
- /** Delete the ephemeral Volume. Only usable with emphemeral Volumes. */
70116
- closeEphemeral() {
70117
- if (this.#ephemeralHbManager) {
70118
- this.#ephemeralHbManager.stop();
70119
- } else {
70120
- throw new InvalidError("Volume is not ephemeral.");
70121
- }
70122
- }
70123
- };
70124
- function volumeToMountProto(mountPath, volume) {
70125
- const opts = volume._mountOptions ?? DEFAULT_MOUNT_OPTIONS;
70126
- return {
70127
- volumeId: volume.volumeId,
70128
- mountPath,
70129
- allowBackgroundCommits: true,
70130
- readOnly: opts.readOnly,
70131
- subPath: opts.subPath
70132
- };
70133
- }
70134
-
70135
71477
  // src/sandbox.ts
70136
71478
  var SB_LOGS_INITIAL_DELAY_MS = 10;
70137
71479
  var SB_LOGS_DELAY_FACTOR = 2;
70138
71480
  var SB_LOGS_MAX_RETRIES = 10;
71481
+ var SB_LOGS_TASK_ID_TIMEOUT_SECONDS = 0.5;
71482
+ var SANDBOX_SCHEDULING_TIMEOUT_MS = 21 * 60 * 1e3;
71483
+ var GET_TASK_ID_TIMEOUT_MS = 5 * 60 * 1e3;
71484
+ function isTransientTaskIDLookupError(err) {
71485
+ if (!(err instanceof import_nice_grpc12.ClientError)) {
71486
+ return false;
71487
+ }
71488
+ return err.code === import_nice_grpc12.Status.UNAVAILABLE || err.code === import_nice_grpc12.Status.DEADLINE_EXCEEDED || err.code === import_nice_grpc12.Status.INTERNAL;
71489
+ }
70139
71490
  var TTL_NO_EXPIRY_SENTINEL = -1;
70140
71491
  var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MIN_LENGTH = 16;
70141
71492
  var CUSTOMER_SUPPLIED_ENCRYPTION_KEY_MAX_LENGTH = 512;
@@ -70185,6 +71536,19 @@ function getSandboxVersion(sandboxId) {
70185
71536
  }
70186
71537
  return "V2" /* V2 */;
70187
71538
  }
71539
+ function sandboxRuntimeToProto(runtime) {
71540
+ switch (runtime) {
71541
+ case void 0:
71542
+ return void 0;
71543
+ case "gvisor":
71544
+ case "vm":
71545
+ return runtime;
71546
+ default:
71547
+ throw new Error(
71548
+ `runtime must be "gvisor" or "vm", got ${JSON.stringify(runtime)}`
71549
+ );
71550
+ }
71551
+ }
70188
71552
  var Probe2 = class _Probe {
70189
71553
  #tcpPort;
70190
71554
  #execArgv;
@@ -70318,6 +71682,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70318
71682
  if (params.workdir && !params.workdir.startsWith("/")) {
70319
71683
  throw new Error(`workdir must be an absolute path, got: ${params.workdir}`);
70320
71684
  }
71685
+ const runtime = sandboxRuntimeToProto(params.runtime);
70321
71686
  const volumeMounts = params.volumes ? Object.entries(params.volumes).map(
70322
71687
  ([mountPath, volume]) => volumeToMountProto(mountPath, volume)
70323
71688
  ) : [];
@@ -70369,6 +71734,19 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70369
71734
  );
70370
71735
  }
70371
71736
  }
71737
+ if (params.experimentalOutboundPolicy !== void 0) {
71738
+ params.experimentalOutboundPolicy._validate();
71739
+ if (params.blockNetwork) {
71740
+ throw new InvalidError(
71741
+ "experimentalOutboundPolicy cannot be used when blockNetwork is enabled"
71742
+ );
71743
+ }
71744
+ if (params.outboundDomainAllowlist && params.outboundDomainAllowlist.length > 0) {
71745
+ throw new InvalidError(
71746
+ "experimentalOutboundPolicy cannot be used with outboundDomainAllowlist"
71747
+ );
71748
+ }
71749
+ }
70372
71750
  const networkAccess = buildOutboundNetworkAccess(
70373
71751
  params.blockNetwork,
70374
71752
  params.outboundCidrAllowlist,
@@ -70449,6 +71827,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70449
71827
  idleTimeoutSecs: params.idleTimeoutMs != void 0 ? params.idleTimeoutMs / 1e3 : void 0,
70450
71828
  workdir: params.workdir ?? void 0,
70451
71829
  networkAccess,
71830
+ outboundPolicy: params.experimentalOutboundPolicy?._toProto(),
70452
71831
  resources: Resources.create({
70453
71832
  milliCpu,
70454
71833
  milliCpuMax,
@@ -70472,7 +71851,8 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70472
71851
  includeOidcIdentityToken: params.includeOidcIdentityToken ?? false,
70473
71852
  inboundCidrAllowlist: params.inboundCidrAllowlist ?? [],
70474
71853
  i6pnEnabled: params.i6pn ?? false,
70475
- enableSnapshot: params.experimentalEnableSnapshot ?? false
71854
+ enableSnapshot: params.experimentalEnableSnapshot ?? false,
71855
+ runtime
70476
71856
  }
70477
71857
  });
70478
71858
  }
@@ -70509,7 +71889,10 @@ var SandboxService = class {
70509
71889
  );
70510
71890
  await hydrateSandboxSecrets(
70511
71891
  this.#client,
70512
- mergedSecrets,
71892
+ [
71893
+ ...mergedSecrets,
71894
+ ...params.experimentalOutboundPolicy?._secrets() ?? []
71895
+ ],
70513
71896
  params.cloudBucketMounts
70514
71897
  );
70515
71898
  const mergedParams = {
@@ -70537,7 +71920,9 @@ var SandboxService = class {
70537
71920
  "sandbox_id",
70538
71921
  createResp.sandboxId
70539
71922
  );
70540
- return new Sandbox2(this.#client, createResp.sandboxId);
71923
+ const sb = new Sandbox2(this.#client, createResp.sandboxId);
71924
+ await sb._waitForScheduling(SANDBOX_SCHEDULING_TIMEOUT_MS);
71925
+ return sb;
70541
71926
  }
70542
71927
  /**
70543
71928
  * Create a new {@link Sandbox} using the experimental V2 backend.
@@ -70570,7 +71955,10 @@ var SandboxService = class {
70570
71955
  Object.assign(envDict, params.env ?? {});
70571
71956
  await hydrateSandboxSecrets(
70572
71957
  this.#client,
70573
- resolvableSecrets,
71958
+ [
71959
+ ...resolvableSecrets,
71960
+ ...params.experimentalOutboundPolicy?._secrets() ?? []
71961
+ ],
70574
71962
  params.cloudBucketMounts
70575
71963
  );
70576
71964
  const mergedParams = {
@@ -70976,9 +72364,10 @@ function buildTaskSnapshotDirectoryRequestProto(taskId, path2, snapshotId, ttlSe
70976
72364
  containerId
70977
72365
  });
70978
72366
  }
70979
- var Sandbox2 = class _Sandbox {
72367
+ var Sandbox2 = class {
70980
72368
  #client;
70981
72369
  sandboxId;
72370
+ #appId;
70982
72371
  #stdin;
70983
72372
  #stdout;
70984
72373
  #stderr;
@@ -71025,6 +72414,25 @@ var Sandbox2 = class _Sandbox {
71025
72414
  }
71026
72415
  return this.#stderr;
71027
72416
  }
72417
+ /**
72418
+ * Access persisted entrypoint logs emitted by this Sandbox.
72419
+ *
72420
+ * Use {@link SandboxLogsManager#fetch fetch()} to read logs from a UTC time
72421
+ * range and {@link SandboxLogsManager#tail tail()} to read the most recent
72422
+ * logs.
72423
+ *
72424
+ * This is separate from {@link Sandbox#stdout stdout} and
72425
+ * {@link Sandbox#stderr stderr}, which expose the Sandbox's live output
72426
+ * streams.
72427
+ */
72428
+ get logs() {
72429
+ return new SandboxLogsManager(
72430
+ this.#client,
72431
+ this.sandboxId,
72432
+ () => this.#getAppId(),
72433
+ () => this.#resolveTaskIdForLogs()
72434
+ );
72435
+ }
71028
72436
  #outputStream(fileDescriptor) {
71029
72437
  if (this.#isV2) {
71030
72438
  this.#ensureAttached();
@@ -71257,12 +72665,15 @@ var Sandbox2 = class _Sandbox {
71257
72665
  }
71258
72666
  return this.#client.cpClient.sandboxWait(req);
71259
72667
  }
71260
- #sandboxGetTaskId(signal) {
71261
- const req = { sandboxId: this.sandboxId };
72668
+ #sandboxGetTaskId(timeoutSecs, options) {
72669
+ const req = SandboxGetTaskIdRequest.create({
72670
+ sandboxId: this.sandboxId,
72671
+ timeout: timeoutSecs
72672
+ });
71262
72673
  if (this.#isV2) {
71263
- return this.#client.cpClient.sandboxGetTaskIdV2(req, { signal });
72674
+ return this.#client.cpClient.sandboxGetTaskIdV2(req, options);
71264
72675
  }
71265
- return this.#client.cpClient.sandboxGetTaskId(req, { signal });
72676
+ return this.#client.cpClient.sandboxGetTaskId(req, options);
71266
72677
  }
71267
72678
  #sandboxGetTunnels(timeoutMs) {
71268
72679
  const req = { sandboxId: this.sandboxId, timeout: timeoutMs / 1e3 };
@@ -71286,31 +72697,127 @@ var Sandbox2 = class _Sandbox {
71286
72697
  }
71287
72698
  await this.#client.cpClient.sandboxTerminate(req);
71288
72699
  }
71289
- static #maxGetTaskIdAttempts = 600;
71290
- // 5 minutes at 500ms intervals
72700
+ async #getAppId() {
72701
+ if (this.#appId !== void 0) {
72702
+ return this.#appId;
72703
+ }
72704
+ const resp = await this.#sandboxWait(0);
72705
+ const appId = resp.metadata?.appId;
72706
+ if (!appId) {
72707
+ throw new ExecutionError(
72708
+ "Sandbox app ID should have been set during hydration"
72709
+ );
72710
+ }
72711
+ this.#appId = appId;
72712
+ return appId;
72713
+ }
72714
+ async #resolveTaskIdForLogs() {
72715
+ if (this.#taskId !== void 0) {
72716
+ return this.#taskId;
72717
+ }
72718
+ let resp;
72719
+ try {
72720
+ resp = await this.#sandboxGetTaskId(SB_LOGS_TASK_ID_TIMEOUT_SECONDS);
72721
+ } catch (error) {
72722
+ if (error instanceof import_nice_grpc12.ClientError && error.code === import_nice_grpc12.Status.DEADLINE_EXCEEDED) {
72723
+ throw new ExecutionError("Sandbox task ID is not available yet.");
72724
+ }
72725
+ throw error;
72726
+ }
72727
+ if (!resp.taskId) {
72728
+ throw new ExecutionError("Sandbox task ID is not available.");
72729
+ }
72730
+ this.#taskId = resp.taskId;
72731
+ return this.#taskId;
72732
+ }
71291
72733
  async #getTaskId(signal) {
72734
+ return await this.#waitForTaskId(GET_TASK_ID_TIMEOUT_MS, false, signal);
72735
+ }
72736
+ /**
72737
+ * Blocks until the Sandbox has a task. If the wait fails, the Sandbox is
72738
+ * terminated so a queued one cannot start later with no caller. A timeout
72739
+ * surfaces as a ResourceExhaustedError.
72740
+ *
72741
+ * @internal
72742
+ * @hidden
72743
+ */
72744
+ async _waitForScheduling(timeoutMs) {
72745
+ try {
72746
+ await this.#waitForTaskId(timeoutMs, true);
72747
+ } catch (err) {
72748
+ if (err instanceof ConflictError) {
72749
+ throw err;
72750
+ }
72751
+ try {
72752
+ await this.#sandboxTerminate();
72753
+ } catch (terminateErr) {
72754
+ this.#client.logger.debug(
72755
+ "Failed to terminate unscheduled Sandbox",
72756
+ "sandbox_id",
72757
+ this.sandboxId,
72758
+ "error",
72759
+ terminateErr
72760
+ );
72761
+ }
72762
+ if (err instanceof TimeoutError) {
72763
+ throw new ResourceExhaustedError(
72764
+ "Insufficient capacity to create sandbox."
72765
+ );
72766
+ }
72767
+ throw err;
72768
+ }
72769
+ }
72770
+ /**
72771
+ * Polls until the Sandbox has been assigned a task. Throws a ConflictError
72772
+ * if the Sandbox finished before that happened and a TimeoutError once
72773
+ * timeoutMs elapses. With retryTransient, lookups that fail with a
72774
+ * transient error keep polling until the deadline instead of failing.
72775
+ */
72776
+ async #waitForTaskId(timeoutMs, retryTransient, signal) {
71292
72777
  if (this.#taskId !== void 0) {
71293
72778
  return this.#taskId;
71294
72779
  }
71295
- for (let i = 0; i < _Sandbox.#maxGetTaskIdAttempts; i++) {
71296
- const resp = await this.#sandboxGetTaskId(signal);
72780
+ const deadline = Date.now() + timeoutMs;
72781
+ const timedOut = () => new TimeoutError(
72782
+ `Timed out waiting for task ID for Sandbox ${this.sandboxId}`
72783
+ );
72784
+ const backoff = () => (0, import_promises3.setTimeout)(Math.max(0, Math.min(500, deadline - Date.now())), void 0, {
72785
+ signal
72786
+ });
72787
+ while (true) {
72788
+ if (Date.now() >= deadline) {
72789
+ throw timedOut();
72790
+ }
72791
+ let resp;
72792
+ try {
72793
+ resp = await this.#sandboxGetTaskId(void 0, { signal });
72794
+ } catch (err) {
72795
+ if (signal?.aborted || !isTransientTaskIDLookupError(err)) {
72796
+ throw err;
72797
+ }
72798
+ if (Date.now() >= deadline) {
72799
+ if (err instanceof import_nice_grpc12.ClientError && err.code === import_nice_grpc12.Status.INTERNAL) {
72800
+ throw err;
72801
+ }
72802
+ throw timedOut();
72803
+ }
72804
+ if (!retryTransient) {
72805
+ throw err;
72806
+ }
72807
+ await backoff();
72808
+ continue;
72809
+ }
71297
72810
  if (resp.taskId) {
71298
72811
  this.#taskId = resp.taskId;
71299
72812
  return this.#taskId;
71300
72813
  }
71301
72814
  if (resp.taskResult) {
71302
- if (resp.taskResult.status === 1 /* GENERIC_STATUS_SUCCESS */ || !resp.taskResult.exception) {
71303
- throw new Error(`Sandbox ${this.sandboxId} has already completed`);
71304
- }
71305
- throw new Error(
71306
- `Sandbox ${this.sandboxId} has already completed with result: exception:"${resp.taskResult.exception}"`
72815
+ throw new ConflictError(
72816
+ resp.taskResult.exception || `Sandbox ${this.sandboxId} has already finished`
71307
72817
  );
71308
72818
  }
71309
- await (0, import_promises3.setTimeout)(500, void 0, { signal });
72819
+ await backoff();
71310
72820
  }
71311
- throw new Error(
71312
- `Timed out waiting for task ID for Sandbox ${this.sandboxId}`
71313
- );
71314
72821
  }
71315
72822
  async #getOrCreateCommandRouterClient(taskId) {
71316
72823
  if (this.#commandRouterClient !== void 0) {
@@ -71602,7 +73109,7 @@ var Sandbox2 = class _Sandbox {
71602
73109
  return new Image2(this.#client, resp.success.imageId, "");
71603
73110
  }
71604
73111
  if (resp.error) {
71605
- if (resp.error.errorCode === 1 /* ERROR_CODE_TIMEOUT */) {
73112
+ if (resp.error.errorCode === 1 /* ERROR_CODE_TIMEOUT */ || resp.error.errorCode === 3 /* ERROR_CODE_FILESYSTEM_INCONSISTENT */) {
71606
73113
  throw new SnapshotCreationError(
71607
73114
  resp.error.message || "No exit snapshot image will be produced"
71608
73115
  );
@@ -71716,6 +73223,31 @@ var Sandbox2 = class _Sandbox {
71716
73223
  });
71717
73224
  await commandRouterClient.setNetworkAccess(request);
71718
73225
  }
73226
+ /**
73227
+ * Replace the outbound policy of a running Sandbox.
73228
+ *
73229
+ * EXPERIMENTAL: the API is subject to change.
73230
+ *
73231
+ * The new policy replaces all existing policy configuration on the
73232
+ * Sandbox; build a policy including any existing rules you want to keep.
73233
+ *
73234
+ * Only Sandboxes created with an `experimentalOutboundPolicy` can be updated this
73235
+ * way; for Sandboxes created without one this fails, since header
73236
+ * replacement is only set up at creation time.
73237
+ */
73238
+ async experimentalUpdateOutboundPolicy(outboundPolicy) {
73239
+ this.#ensureAttached();
73240
+ outboundPolicy._validate();
73241
+ const [, [taskId, commandRouterClient]] = await Promise.all([
73242
+ hydrateSecrets(this.#client, outboundPolicy._secrets()),
73243
+ this.#getCommandRouter()
73244
+ ]);
73245
+ const request = TaskSetOutboundPolicyRequest.create({
73246
+ taskId,
73247
+ outboundPolicy: outboundPolicy._toProto()
73248
+ });
73249
+ await commandRouterClient.setOutboundPolicy(request);
73250
+ }
71719
73251
  /**
71720
73252
  * Reload all Volumes mounted in the Sandbox.
71721
73253
  *
@@ -72273,7 +73805,7 @@ var AuthTokenManager = class {
72273
73805
  };
72274
73806
 
72275
73807
  // src/version.ts
72276
- var SDK_VERSION = "0.10.2-dev.1";
73808
+ var SDK_VERSION = "0.10.2-dev.11";
72277
73809
  function getSDKVersion() {
72278
73810
  return SDK_VERSION;
72279
73811
  }
@@ -72540,7 +74072,7 @@ var ModalClient = class {
72540
74072
  "grpc.keepalive_timeout_ms": 1e4,
72541
74073
  "grpc.keepalive_permit_without_calls": 1
72542
74074
  });
72543
- let factory = (0, import_nice_grpc14.createClientFactory)().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(timeoutMiddleware);
74075
+ let factory = (0, import_nice_grpc14.createClientFactory)().use(this.authMiddleware(profile)).use(this.retryMiddleware()).use(serverWarningMiddleware(this.logger)).use(timeoutMiddleware);
72544
74076
  for (const middleware of this.customMiddleware) {
72545
74077
  factory = factory.use(middleware);
72546
74078
  }
@@ -72713,6 +74245,7 @@ var ModalClient = class {
72713
74245
  return this.authTokenManager;
72714
74246
  };
72715
74247
  const oauthJwtKey = this.oauthJwtKey;
74248
+ const host = new URL(profile.serverUrl).hostname;
72716
74249
  return async function* authMiddleware(call, options) {
72717
74250
  const hasOAuthCredentials = Boolean(
72718
74251
  profile.oauthRefreshToken && profile.oauthClientId && (profile.oauthClientSecret || oauthJwtKey)
@@ -72753,6 +74286,7 @@ var ModalClient = class {
72753
74286
  options.metadata.set("x-modal-token-id", profile.tokenId);
72754
74287
  options.metadata.set("x-modal-token-secret", profile.tokenSecret);
72755
74288
  }
74289
+ options.metadata.set("x-modal-host", host);
72756
74290
  if (call.method.path !== "/modal.client.ModalClient/AuthTokenGet") {
72757
74291
  const tokenManager = getOrCreateAuthTokenManager();
72758
74292
  const token = await tokenManager.getToken();
@@ -73012,6 +74546,8 @@ function contextIds(batch, item, ObjectId) {
73012
74546
  item.inputId || batch.inputId,
73013
74547
  item.containerId || batch.taskId
73014
74548
  ].filter((id) => id);
74549
+ case "sb":
74550
+ return [item.containerId || batch.taskId].filter((id) => id);
73015
74551
  default:
73016
74552
  return [];
73017
74553
  }
@@ -73832,6 +75368,97 @@ var FunctionCallLogsManager = class extends LogsManager {
73832
75368
  );
73833
75369
  }
73834
75370
  };
75371
+ var SandboxLogsManager = class {
75372
+ /** @ignore */
75373
+ constructor(client, sandboxId, getAppId, getTaskId) {
75374
+ this.client = client;
75375
+ this.sandboxId = sandboxId;
75376
+ this.getAppId = getAppId;
75377
+ this.getTaskId = getTaskId;
75378
+ }
75379
+ /**
75380
+ * Fetch Sandbox entrypoint logs corresponding to a UTC time range and
75381
+ * optional filters.
75382
+ *
75383
+ * Entries are returned in chronological order.
75384
+ *
75385
+ * @returns An async iterable of {@link LogEntry} objects.
75386
+ *
75387
+ * @example
75388
+ * ```typescript
75389
+ * import { ModalClient } from "modal";
75390
+ *
75391
+ * const modal = new ModalClient();
75392
+ * const sandbox = await modal.sandboxes.fromId("sb-...");
75393
+ *
75394
+ * for await (const entry of sandbox.logs.fetch({
75395
+ * since: new Date(Date.now() - 60 * 60 * 1_000),
75396
+ * source: "stdout",
75397
+ * })) {
75398
+ * process.stdout.write(entry.message);
75399
+ * }
75400
+ * ```
75401
+ */
75402
+ async *fetch(params) {
75403
+ const [appId, taskId] = await Promise.all([
75404
+ this.getAppId(),
75405
+ this.getTaskId()
75406
+ ]);
75407
+ if (!taskId) {
75408
+ throw new ExecutionError(
75409
+ "Cannot resolve Sandbox metadata needed for fetching logs. Wait for the Sandbox to be scheduled."
75410
+ );
75411
+ }
75412
+ yield* fetchLogs(
75413
+ this.client,
75414
+ {
75415
+ appId,
75416
+ objectId: this.sandboxId,
75417
+ taskId,
75418
+ source: sourceToFileDescriptor(params.source),
75419
+ searchText: params.searchText
75420
+ },
75421
+ params.since,
75422
+ params.until
75423
+ );
75424
+ }
75425
+ /**
75426
+ * Fetch the most recent Sandbox entrypoint logs.
75427
+ *
75428
+ * Entries are returned in chronological order.
75429
+ *
75430
+ * @returns An async iterable of {@link LogEntry} objects.
75431
+ *
75432
+ * @example
75433
+ * ```typescript
75434
+ * import { ModalClient } from "modal";
75435
+ *
75436
+ * const modal = new ModalClient();
75437
+ * const sandbox = await modal.sandboxes.fromId("sb-...");
75438
+ *
75439
+ * for await (const entry of sandbox.logs.tail({ entries: 20 })) {
75440
+ * process.stdout.write(entry.message);
75441
+ * }
75442
+ * ```
75443
+ */
75444
+ async *tail(params = {}) {
75445
+ const [appId, taskId] = await Promise.all([
75446
+ this.getAppId(),
75447
+ this.getTaskId()
75448
+ ]);
75449
+ if (!taskId) {
75450
+ throw new ExecutionError(
75451
+ "Sandbox task ID cannot be empty when fetching logs. Wait for the Sandbox to be scheduled."
75452
+ );
75453
+ }
75454
+ yield* tailLogs(this.client, params.entries ?? 100, {
75455
+ appId,
75456
+ objectId: this.sandboxId,
75457
+ taskId,
75458
+ source: sourceToFileDescriptor(params.source)
75459
+ });
75460
+ }
75461
+ };
73835
75462
 
73836
75463
  // src/function_call.ts
73837
75464
  var FunctionCallService = class {
@@ -74599,6 +76226,129 @@ var ClsInstance = class {
74599
76226
  return method;
74600
76227
  }
74601
76228
  };
76229
+
76230
+ // src/outbound_policy.ts
76231
+ 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])?$/;
76232
+ var HEADER_NAME_RE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;
76233
+ var MAX_HEADER_REPLACEMENTS = 25;
76234
+ function hasInvalidHeaderValueChar(value) {
76235
+ for (const c of value) {
76236
+ const code = c.codePointAt(0);
76237
+ if (code < 32 && c !== " " || code === 127) {
76238
+ return true;
76239
+ }
76240
+ }
76241
+ return false;
76242
+ }
76243
+ function templateReferencesKey(template) {
76244
+ const isKeyStart = (c) => /[a-zA-Z_]/.test(c);
76245
+ let i = template.indexOf("$");
76246
+ while (i !== -1 && i + 1 < template.length) {
76247
+ const c = template[i + 1];
76248
+ if (c === "$") {
76249
+ i = template.indexOf("$", i + 2);
76250
+ continue;
76251
+ }
76252
+ if (isKeyStart(c)) {
76253
+ return true;
76254
+ }
76255
+ i = template.indexOf("$", i + 1);
76256
+ }
76257
+ return false;
76258
+ }
76259
+ var ExperimentalOutboundPolicy = class _ExperimentalOutboundPolicy {
76260
+ /** @internal */
76261
+ _replacements;
76262
+ /** @internal */
76263
+ constructor(_replacements = []) {
76264
+ this._replacements = _replacements;
76265
+ }
76266
+ /**
76267
+ * Return a new {@link ExperimentalOutboundPolicy} with an added header replacement.
76268
+ *
76269
+ * @param params.domain Domain the replacements are scoped to. Supports `*.` wildcard
76270
+ * prefixes (matching the apex domain and subdomains) and a bare `"*"`.
76271
+ * @param params.headers Header name -> header value. Values support `$KEY` templates
76272
+ * referencing keys in the replacement's `secret`.
76273
+ * @param params.secret Named {@link Secret} (e.g. from `client.secrets.fromName`) whose
76274
+ * keys may be referenced in the header value templates. Static replacements pass no secret.
76275
+ */
76276
+ withHeaderReplacement(params) {
76277
+ const { domain, headers, secret } = params;
76278
+ return new _ExperimentalOutboundPolicy([
76279
+ ...this._replacements,
76280
+ { domain, headers: { ...headers }, secret }
76281
+ ]);
76282
+ }
76283
+ /** Check all replacements, throwing `InvalidError` on the first violation found.
76284
+ * @internal
76285
+ */
76286
+ _validate() {
76287
+ let total = 0;
76288
+ for (const replacement of this._replacements) {
76289
+ const { domain, headers, secret } = replacement;
76290
+ if (domain !== "*" && !DOMAIN_RE.test(domain)) {
76291
+ throw new InvalidError(`Invalid domain: ${JSON.stringify(domain)}`);
76292
+ }
76293
+ const entries = Object.entries(headers);
76294
+ if (entries.length === 0) {
76295
+ throw new InvalidError("`headers` must contain at least one header");
76296
+ }
76297
+ for (const [name, value] of entries) {
76298
+ if (!HEADER_NAME_RE.test(name)) {
76299
+ throw new InvalidError(
76300
+ `Invalid header name: ${JSON.stringify(name)}`
76301
+ );
76302
+ }
76303
+ if (hasInvalidHeaderValueChar(value)) {
76304
+ throw new InvalidError(
76305
+ `Header value for ${JSON.stringify(name)} must not contain control characters (except tab)`
76306
+ );
76307
+ }
76308
+ if (secret === void 0 && templateReferencesKey(value)) {
76309
+ throw new InvalidError(
76310
+ `Header value for ${JSON.stringify(name)} references a secret key, but no \`secret\` was passed`
76311
+ );
76312
+ }
76313
+ }
76314
+ if (secret !== void 0 && secretEnvDictHydrator(secret) !== void 0) {
76315
+ throw new InvalidError(
76316
+ "Outbound policies only support named secrets (e.g. `client.secrets.fromName`); ephemeral secrets (e.g. `client.secrets.fromObject`) are not yet supported"
76317
+ );
76318
+ }
76319
+ total += entries.length;
76320
+ }
76321
+ if (total > MAX_HEADER_REPLACEMENTS) {
76322
+ throw new InvalidError(
76323
+ `Outbound policy cannot have more than ${MAX_HEADER_REPLACEMENTS} header replacements`
76324
+ );
76325
+ }
76326
+ }
76327
+ /** Deduplicated list of secrets referenced by the policy's replacements.
76328
+ * @internal
76329
+ */
76330
+ _secrets() {
76331
+ return [
76332
+ ...new Set(
76333
+ this._replacements.map((s) => s.secret).filter((s) => s !== void 0)
76334
+ )
76335
+ ];
76336
+ }
76337
+ /** Convert to the wire format. Referenced secrets must be hydrated first.
76338
+ * @internal
76339
+ */
76340
+ _toProto() {
76341
+ return OutboundPolicy.create({
76342
+ headerReplacements: this._replacements.map(
76343
+ (replacement) => OutboundPolicy_HeaderReplacement.create({
76344
+ domain: replacement.domain,
76345
+ secretId: replacement.secret?.secretId ?? "",
76346
+ headers: replacement.headers
76347
+ })
76348
+ )
76349
+ });
76350
+ }
76351
+ };
74602
76352
  // Annotate the CommonJS export names for ESM import in node:
74603
76353
  0 && (module.exports = {
74604
76354
  AlreadyExistsError,
@@ -74613,6 +76363,7 @@ var ClsInstance = class {
74613
76363
  ConflictError,
74614
76364
  ContainerProcess,
74615
76365
  ExecutionError,
76366
+ ExperimentalOutboundPolicy,
74616
76367
  FunctionCall,
74617
76368
  FunctionCallLogsManager,
74618
76369
  FunctionCallService,
@@ -74634,6 +76385,7 @@ var ClsInstance = class {
74634
76385
  QueueFullError,
74635
76386
  QueueService,
74636
76387
  RemoteError,
76388
+ ResourceExhaustedError,
74637
76389
  Retries,
74638
76390
  Sandbox,
74639
76391
  SandboxFilesystem,
@@ -74645,6 +76397,7 @@ var ClsInstance = class {
74645
76397
  SandboxFilesystemNotFoundError,
74646
76398
  SandboxFilesystemPathAlreadyExistsError,
74647
76399
  SandboxFilesystemPermissionError,
76400
+ SandboxLogsManager,
74648
76401
  SandboxService,
74649
76402
  SandboxSnapshot,
74650
76403
  SandboxSnapshotService,