modal 0.10.2-dev.0 → 0.10.2-dev.2

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
@@ -55,6 +55,7 @@ __export(index_exports, {
55
55
  InvalidError: () => InvalidError,
56
56
  ModalClient: () => ModalClient,
57
57
  NotFoundError: () => NotFoundError,
58
+ OutboundPolicy: () => OutboundPolicy2,
58
59
  Probe: () => Probe2,
59
60
  Proxy: () => Proxy3,
60
61
  ProxyService: () => ProxyService,
@@ -17731,7 +17732,8 @@ function createBaseEndpointCreateRequest() {
17731
17732
  inputModalities: [],
17732
17733
  environmentName: "",
17733
17734
  unauthenticated: false,
17734
- servingMode: 0
17735
+ servingMode: 0,
17736
+ sharedEndpointNoticeAcknowledged: false
17735
17737
  };
17736
17738
  }
17737
17739
  var EndpointCreateRequest = {
@@ -17770,6 +17772,9 @@ var EndpointCreateRequest = {
17770
17772
  if (message.servingMode !== 0) {
17771
17773
  writer.uint32(80).int32(message.servingMode);
17772
17774
  }
17775
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
17776
+ writer.uint32(88).bool(message.sharedEndpointNoticeAcknowledged);
17777
+ }
17773
17778
  return writer;
17774
17779
  },
17775
17780
  decode(input, length) {
@@ -17863,6 +17868,13 @@ var EndpointCreateRequest = {
17863
17868
  message.servingMode = reader.int32();
17864
17869
  continue;
17865
17870
  }
17871
+ case 11: {
17872
+ if (tag !== 88) {
17873
+ break;
17874
+ }
17875
+ message.sharedEndpointNoticeAcknowledged = reader.bool();
17876
+ continue;
17877
+ }
17866
17878
  }
17867
17879
  if ((tag & 7) === 4 || tag === 0) {
17868
17880
  break;
@@ -17882,7 +17894,8 @@ var EndpointCreateRequest = {
17882
17894
  inputModalities: globalThis.Array.isArray(object?.inputModalities) ? object.inputModalities.map((e) => endpointInputModalityFromJSON(e)) : [],
17883
17895
  environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
17884
17896
  unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
17885
- servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0
17897
+ servingMode: isSet5(object.servingMode) ? endpointServingModeFromJSON(object.servingMode) : 0,
17898
+ sharedEndpointNoticeAcknowledged: isSet5(object.sharedEndpointNoticeAcknowledged) ? globalThis.Boolean(object.sharedEndpointNoticeAcknowledged) : false
17886
17899
  };
17887
17900
  },
17888
17901
  toJSON(message) {
@@ -17917,6 +17930,9 @@ var EndpointCreateRequest = {
17917
17930
  if (message.servingMode !== 0) {
17918
17931
  obj.servingMode = endpointServingModeToJSON(message.servingMode);
17919
17932
  }
17933
+ if (message.sharedEndpointNoticeAcknowledged !== false) {
17934
+ obj.sharedEndpointNoticeAcknowledged = message.sharedEndpointNoticeAcknowledged;
17935
+ }
17920
17936
  return obj;
17921
17937
  },
17922
17938
  create(base) {
@@ -17934,6 +17950,7 @@ var EndpointCreateRequest = {
17934
17950
  message.environmentName = object.environmentName ?? "";
17935
17951
  message.unauthenticated = object.unauthenticated ?? false;
17936
17952
  message.servingMode = object.servingMode ?? 0;
17953
+ message.sharedEndpointNoticeAcknowledged = object.sharedEndpointNoticeAcknowledged ?? false;
17937
17954
  return message;
17938
17955
  }
17939
17956
  };
@@ -22492,8 +22509,6 @@ function createBaseFunctionMessage() {
22492
22509
  cloudBucketMounts: [],
22493
22510
  schedulerPlacement: void 0,
22494
22511
  isClass: false,
22495
- useFunctionId: "",
22496
- useMethodName: "",
22497
22512
  classParameterInfo: void 0,
22498
22513
  batchMaxSize: 0,
22499
22514
  batchLingerMs: 0,
@@ -22664,12 +22679,6 @@ var FunctionMessage = {
22664
22679
  if (message.isClass !== false) {
22665
22680
  writer.uint32(424).bool(message.isClass);
22666
22681
  }
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
22682
  if (message.classParameterInfo !== void 0) {
22674
22683
  ClassParameterInfo.encode(message.classParameterInfo, writer.uint32(450).fork()).join();
22675
22684
  }
@@ -23095,20 +23104,6 @@ var FunctionMessage = {
23095
23104
  message.isClass = reader.bool();
23096
23105
  continue;
23097
23106
  }
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
23107
  case 56: {
23113
23108
  if (tag !== 450) {
23114
23109
  break;
@@ -23441,8 +23436,6 @@ var FunctionMessage = {
23441
23436
  cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
23442
23437
  schedulerPlacement: isSet5(object.schedulerPlacement) ? SchedulerPlacement.fromJSON(object.schedulerPlacement) : void 0,
23443
23438
  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
23439
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
23447
23440
  batchMaxSize: isSet5(object.batchMaxSize) ? globalThis.Number(object.batchMaxSize) : 0,
23448
23441
  batchLingerMs: isSet5(object.batchLingerMs) ? globalThis.Number(object.batchLingerMs) : 0,
@@ -23619,12 +23612,6 @@ var FunctionMessage = {
23619
23612
  if (message.isClass !== false) {
23620
23613
  obj.isClass = message.isClass;
23621
23614
  }
23622
- if (message.useFunctionId !== "") {
23623
- obj.useFunctionId = message.useFunctionId;
23624
- }
23625
- if (message.useMethodName !== "") {
23626
- obj.useMethodName = message.useMethodName;
23627
- }
23628
23615
  if (message.classParameterInfo !== void 0) {
23629
23616
  obj.classParameterInfo = ClassParameterInfo.toJSON(message.classParameterInfo);
23630
23617
  }
@@ -23798,8 +23785,6 @@ var FunctionMessage = {
23798
23785
  message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
23799
23786
  message.schedulerPlacement = object.schedulerPlacement !== void 0 && object.schedulerPlacement !== null ? SchedulerPlacement.fromPartial(object.schedulerPlacement) : void 0;
23800
23787
  message.isClass = object.isClass ?? false;
23801
- message.useFunctionId = object.useFunctionId ?? "";
23802
- message.useMethodName = object.useMethodName ?? "";
23803
23788
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
23804
23789
  message.batchMaxSize = object.batchMaxSize ?? 0;
23805
23790
  message.batchLingerMs = object.batchLingerMs ?? 0;
@@ -25571,8 +25556,6 @@ function createBaseFunctionData() {
25571
25556
  isClass: false,
25572
25557
  classParameterInfo: void 0,
25573
25558
  isMethod: false,
25574
- useFunctionId: "",
25575
- useMethodName: "",
25576
25559
  rankedFunctions: [],
25577
25560
  schedule: void 0,
25578
25561
  untrusted: false,
@@ -25664,12 +25647,6 @@ var FunctionData = {
25664
25647
  if (message.isMethod !== false) {
25665
25648
  writer.uint32(120).bool(message.isMethod);
25666
25649
  }
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
25650
  for (const v of message.rankedFunctions) {
25674
25651
  FunctionData_RankedFunction.encode(v, writer.uint32(146).fork()).join();
25675
25652
  }
@@ -25901,20 +25878,6 @@ var FunctionData = {
25901
25878
  message.isMethod = reader.bool();
25902
25879
  continue;
25903
25880
  }
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
25881
  case 18: {
25919
25882
  if (tag !== 146) {
25920
25883
  break;
@@ -26094,8 +26057,6 @@ var FunctionData = {
26094
26057
  isClass: isSet5(object.isClass) ? globalThis.Boolean(object.isClass) : false,
26095
26058
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
26096
26059
  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
26060
  rankedFunctions: globalThis.Array.isArray(object?.rankedFunctions) ? object.rankedFunctions.map((e) => FunctionData_RankedFunction.fromJSON(e)) : [],
26100
26061
  schedule: isSet5(object.schedule) ? Schedule.fromJSON(object.schedule) : void 0,
26101
26062
  untrusted: isSet5(object.untrusted) ? globalThis.Boolean(object.untrusted) : false,
@@ -26196,12 +26157,6 @@ var FunctionData = {
26196
26157
  if (message.isMethod !== false) {
26197
26158
  obj.isMethod = message.isMethod;
26198
26159
  }
26199
- if (message.useFunctionId !== "") {
26200
- obj.useFunctionId = message.useFunctionId;
26201
- }
26202
- if (message.useMethodName !== "") {
26203
- obj.useMethodName = message.useMethodName;
26204
- }
26205
26160
  if (message.rankedFunctions?.length) {
26206
26161
  obj.rankedFunctions = message.rankedFunctions.map((e) => FunctionData_RankedFunction.toJSON(e));
26207
26162
  }
@@ -26297,8 +26252,6 @@ var FunctionData = {
26297
26252
  message.isClass = object.isClass ?? false;
26298
26253
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
26299
26254
  message.isMethod = object.isMethod ?? false;
26300
- message.useFunctionId = object.useFunctionId ?? "";
26301
- message.useMethodName = object.useMethodName ?? "";
26302
26255
  message.rankedFunctions = object.rankedFunctions?.map((e) => FunctionData_RankedFunction.fromPartial(e)) || [];
26303
26256
  message.schedule = object.schedule !== void 0 && object.schedule !== null ? Schedule.fromPartial(object.schedule) : void 0;
26304
26257
  message.untrusted = object.untrusted ?? false;
@@ -28931,7 +28884,6 @@ function createBaseFunctionHandleMetadata() {
28931
28884
  functionType: 0,
28932
28885
  webUrl: "",
28933
28886
  isMethod: false,
28934
- useFunctionId: "",
28935
28887
  useMethodName: "",
28936
28888
  definitionId: "",
28937
28889
  classParameterInfo: void 0,
@@ -28962,9 +28914,6 @@ var FunctionHandleMetadata = {
28962
28914
  if (message.isMethod !== false) {
28963
28915
  writer.uint32(312).bool(message.isMethod);
28964
28916
  }
28965
- if (message.useFunctionId !== "") {
28966
- writer.uint32(322).string(message.useFunctionId);
28967
- }
28968
28917
  if (message.useMethodName !== "") {
28969
28918
  writer.uint32(330).string(message.useMethodName);
28970
28919
  }
@@ -29048,13 +28997,6 @@ var FunctionHandleMetadata = {
29048
28997
  message.isMethod = reader.bool();
29049
28998
  continue;
29050
28999
  }
29051
- case 40: {
29052
- if (tag !== 322) {
29053
- break;
29054
- }
29055
- message.useFunctionId = reader.string();
29056
- continue;
29057
- }
29058
29000
  case 41: {
29059
29001
  if (tag !== 330) {
29060
29002
  break;
@@ -29184,7 +29126,6 @@ var FunctionHandleMetadata = {
29184
29126
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
29185
29127
  webUrl: isSet5(object.webUrl) ? globalThis.String(object.webUrl) : "",
29186
29128
  isMethod: isSet5(object.isMethod) ? globalThis.Boolean(object.isMethod) : false,
29187
- useFunctionId: isSet5(object.useFunctionId) ? globalThis.String(object.useFunctionId) : "",
29188
29129
  useMethodName: isSet5(object.useMethodName) ? globalThis.String(object.useMethodName) : "",
29189
29130
  definitionId: isSet5(object.definitionId) ? globalThis.String(object.definitionId) : "",
29190
29131
  classParameterInfo: isSet5(object.classParameterInfo) ? ClassParameterInfo.fromJSON(object.classParameterInfo) : void 0,
@@ -29221,9 +29162,6 @@ var FunctionHandleMetadata = {
29221
29162
  if (message.isMethod !== false) {
29222
29163
  obj.isMethod = message.isMethod;
29223
29164
  }
29224
- if (message.useFunctionId !== "") {
29225
- obj.useFunctionId = message.useFunctionId;
29226
- }
29227
29165
  if (message.useMethodName !== "") {
29228
29166
  obj.useMethodName = message.useMethodName;
29229
29167
  }
@@ -29283,7 +29221,6 @@ var FunctionHandleMetadata = {
29283
29221
  message.functionType = object.functionType ?? 0;
29284
29222
  message.webUrl = object.webUrl ?? "";
29285
29223
  message.isMethod = object.isMethod ?? false;
29286
- message.useFunctionId = object.useFunctionId ?? "";
29287
29224
  message.useMethodName = object.useMethodName ?? "";
29288
29225
  message.definitionId = object.definitionId ?? "";
29289
29226
  message.classParameterInfo = object.classParameterInfo !== void 0 && object.classParameterInfo !== null ? ClassParameterInfo.fromPartial(object.classParameterInfo) : void 0;
@@ -30171,8 +30108,6 @@ function createBaseFunctionPrecreateRequest() {
30171
30108
  existingFunctionId: "",
30172
30109
  functionType: 0,
30173
30110
  webhookConfig: void 0,
30174
- useFunctionId: "",
30175
- useMethodName: "",
30176
30111
  methodDefinitions: {},
30177
30112
  functionSchema: void 0,
30178
30113
  supportedInputFormats: [],
@@ -30196,12 +30131,6 @@ var FunctionPrecreateRequest = {
30196
30131
  if (message.webhookConfig !== void 0) {
30197
30132
  WebhookConfig.encode(message.webhookConfig, writer.uint32(42).fork()).join();
30198
30133
  }
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
30134
  Object.entries(message.methodDefinitions).forEach(([key, value]) => {
30206
30135
  FunctionPrecreateRequest_MethodDefinitionsEntry.encode({ key, value }, writer.uint32(66).fork()).join();
30207
30136
  });
@@ -30262,20 +30191,6 @@ var FunctionPrecreateRequest = {
30262
30191
  message.webhookConfig = WebhookConfig.decode(reader, reader.uint32());
30263
30192
  continue;
30264
30193
  }
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
30194
  case 8: {
30280
30195
  if (tag !== 66) {
30281
30196
  break;
@@ -30336,8 +30251,6 @@ var FunctionPrecreateRequest = {
30336
30251
  existingFunctionId: isSet5(object.existingFunctionId) ? globalThis.String(object.existingFunctionId) : "",
30337
30252
  functionType: isSet5(object.functionType) ? function_FunctionTypeFromJSON(object.functionType) : 0,
30338
30253
  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
30254
  methodDefinitions: isObject2(object.methodDefinitions) ? Object.entries(object.methodDefinitions).reduce((acc, [key, value]) => {
30342
30255
  acc[key] = MethodDefinition.fromJSON(value);
30343
30256
  return acc;
@@ -30364,12 +30277,6 @@ var FunctionPrecreateRequest = {
30364
30277
  if (message.webhookConfig !== void 0) {
30365
30278
  obj.webhookConfig = WebhookConfig.toJSON(message.webhookConfig);
30366
30279
  }
30367
- if (message.useFunctionId !== "") {
30368
- obj.useFunctionId = message.useFunctionId;
30369
- }
30370
- if (message.useMethodName !== "") {
30371
- obj.useMethodName = message.useMethodName;
30372
- }
30373
30280
  if (message.methodDefinitions) {
30374
30281
  const entries = Object.entries(message.methodDefinitions);
30375
30282
  if (entries.length > 0) {
@@ -30400,8 +30307,6 @@ var FunctionPrecreateRequest = {
30400
30307
  message.existingFunctionId = object.existingFunctionId ?? "";
30401
30308
  message.functionType = object.functionType ?? 0;
30402
30309
  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
30310
  message.methodDefinitions = Object.entries(object.methodDefinitions ?? {}).reduce((acc, [key, value]) => {
30406
30311
  if (value !== void 0) {
30407
30312
  acc[key] = MethodDefinition.fromPartial(value);
@@ -32145,7 +32050,8 @@ function createBaseHTTPConfig() {
32145
32050
  exitGracePeriod: 0,
32146
32051
  h2Enabled: false,
32147
32052
  targetConcurrency: 0,
32148
- unauthenticated: false
32053
+ unauthenticated: false,
32054
+ liftAndShiftConfig: void 0
32149
32055
  };
32150
32056
  }
32151
32057
  var HTTPConfig = {
@@ -32171,6 +32077,9 @@ var HTTPConfig = {
32171
32077
  if (message.unauthenticated !== false) {
32172
32078
  writer.uint32(56).bool(message.unauthenticated);
32173
32079
  }
32080
+ if (message.liftAndShiftConfig !== void 0) {
32081
+ LiftAndShiftConfig.encode(message.liftAndShiftConfig, writer.uint32(66).fork()).join();
32082
+ }
32174
32083
  return writer;
32175
32084
  },
32176
32085
  decode(input, length) {
@@ -32229,6 +32138,13 @@ var HTTPConfig = {
32229
32138
  message.unauthenticated = reader.bool();
32230
32139
  continue;
32231
32140
  }
32141
+ case 8: {
32142
+ if (tag !== 66) {
32143
+ break;
32144
+ }
32145
+ message.liftAndShiftConfig = LiftAndShiftConfig.decode(reader, reader.uint32());
32146
+ continue;
32147
+ }
32232
32148
  }
32233
32149
  if ((tag & 7) === 4 || tag === 0) {
32234
32150
  break;
@@ -32245,7 +32161,8 @@ var HTTPConfig = {
32245
32161
  exitGracePeriod: isSet5(object.exitGracePeriod) ? globalThis.Number(object.exitGracePeriod) : 0,
32246
32162
  h2Enabled: isSet5(object.h2Enabled) ? globalThis.Boolean(object.h2Enabled) : false,
32247
32163
  targetConcurrency: isSet5(object.targetConcurrency) ? globalThis.Number(object.targetConcurrency) : 0,
32248
- unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false
32164
+ unauthenticated: isSet5(object.unauthenticated) ? globalThis.Boolean(object.unauthenticated) : false,
32165
+ liftAndShiftConfig: isSet5(object.liftAndShiftConfig) ? LiftAndShiftConfig.fromJSON(object.liftAndShiftConfig) : void 0
32249
32166
  };
32250
32167
  },
32251
32168
  toJSON(message) {
@@ -32271,6 +32188,9 @@ var HTTPConfig = {
32271
32188
  if (message.unauthenticated !== false) {
32272
32189
  obj.unauthenticated = message.unauthenticated;
32273
32190
  }
32191
+ if (message.liftAndShiftConfig !== void 0) {
32192
+ obj.liftAndShiftConfig = LiftAndShiftConfig.toJSON(message.liftAndShiftConfig);
32193
+ }
32274
32194
  return obj;
32275
32195
  },
32276
32196
  create(base) {
@@ -32285,6 +32205,7 @@ var HTTPConfig = {
32285
32205
  message.h2Enabled = object.h2Enabled ?? false;
32286
32206
  message.targetConcurrency = object.targetConcurrency ?? 0;
32287
32207
  message.unauthenticated = object.unauthenticated ?? false;
32208
+ message.liftAndShiftConfig = object.liftAndShiftConfig !== void 0 && object.liftAndShiftConfig !== null ? LiftAndShiftConfig.fromPartial(object.liftAndShiftConfig) : void 0;
32288
32209
  return message;
32289
32210
  }
32290
32211
  };
@@ -35060,6 +34981,43 @@ var InputInfo = {
35060
34981
  return message;
35061
34982
  }
35062
34983
  };
34984
+ function createBaseLiftAndShiftConfig() {
34985
+ return {};
34986
+ }
34987
+ var LiftAndShiftConfig = {
34988
+ encode(_, writer = new BinaryWriter()) {
34989
+ return writer;
34990
+ },
34991
+ decode(input, length) {
34992
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
34993
+ let end = length === void 0 ? reader.len : reader.pos + length;
34994
+ const message = createBaseLiftAndShiftConfig();
34995
+ while (reader.pos < end) {
34996
+ const tag = reader.uint32();
34997
+ switch (tag >>> 3) {
34998
+ }
34999
+ if ((tag & 7) === 4 || tag === 0) {
35000
+ break;
35001
+ }
35002
+ reader.skip(tag & 7);
35003
+ }
35004
+ return message;
35005
+ },
35006
+ fromJSON(_) {
35007
+ return {};
35008
+ },
35009
+ toJSON(_) {
35010
+ const obj = {};
35011
+ return obj;
35012
+ },
35013
+ create(base) {
35014
+ return LiftAndShiftConfig.fromPartial(base ?? {});
35015
+ },
35016
+ fromPartial(_) {
35017
+ const message = createBaseLiftAndShiftConfig();
35018
+ return message;
35019
+ }
35020
+ };
35063
35021
  function createBaseListPagination() {
35064
35022
  return { maxObjects: 0, createdBefore: 0 };
35065
35023
  }
@@ -51685,7 +51643,8 @@ function createBaseTaskLogsBatch() {
51685
51643
  eof: false,
51686
51644
  ptyExecId: "",
51687
51645
  rootFunctionId: "",
51688
- ttlDays: 0
51646
+ ttlDays: 0,
51647
+ sandboxId: ""
51689
51648
  };
51690
51649
  }
51691
51650
  var TaskLogsBatch = {
@@ -51723,6 +51682,9 @@ var TaskLogsBatch = {
51723
51682
  if (message.ttlDays !== 0) {
51724
51683
  writer.uint32(136).uint32(message.ttlDays);
51725
51684
  }
51685
+ if (message.sandboxId !== "") {
51686
+ writer.uint32(146).string(message.sandboxId);
51687
+ }
51726
51688
  return writer;
51727
51689
  },
51728
51690
  decode(input, length) {
@@ -51809,6 +51771,13 @@ var TaskLogsBatch = {
51809
51771
  message.ttlDays = reader.uint32();
51810
51772
  continue;
51811
51773
  }
51774
+ case 18: {
51775
+ if (tag !== 146) {
51776
+ break;
51777
+ }
51778
+ message.sandboxId = reader.string();
51779
+ continue;
51780
+ }
51812
51781
  }
51813
51782
  if ((tag & 7) === 4 || tag === 0) {
51814
51783
  break;
@@ -51829,7 +51798,8 @@ var TaskLogsBatch = {
51829
51798
  eof: isSet5(object.eof) ? globalThis.Boolean(object.eof) : false,
51830
51799
  ptyExecId: isSet5(object.ptyExecId) ? globalThis.String(object.ptyExecId) : "",
51831
51800
  rootFunctionId: isSet5(object.rootFunctionId) ? globalThis.String(object.rootFunctionId) : "",
51832
- ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0
51801
+ ttlDays: isSet5(object.ttlDays) ? globalThis.Number(object.ttlDays) : 0,
51802
+ sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : ""
51833
51803
  };
51834
51804
  },
51835
51805
  toJSON(message) {
@@ -51867,6 +51837,9 @@ var TaskLogsBatch = {
51867
51837
  if (message.ttlDays !== 0) {
51868
51838
  obj.ttlDays = Math.round(message.ttlDays);
51869
51839
  }
51840
+ if (message.sandboxId !== "") {
51841
+ obj.sandboxId = message.sandboxId;
51842
+ }
51870
51843
  return obj;
51871
51844
  },
51872
51845
  create(base) {
@@ -51885,6 +51858,7 @@ var TaskLogsBatch = {
51885
51858
  message.ptyExecId = object.ptyExecId ?? "";
51886
51859
  message.rootFunctionId = object.rootFunctionId ?? "";
51887
51860
  message.ttlDays = object.ttlDays ?? 0;
51861
+ message.sandboxId = object.sandboxId ?? "";
51888
51862
  return message;
51889
51863
  }
51890
51864
  };
@@ -68311,6 +68285,9 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
68311
68285
  async setNetworkAccess(request) {
68312
68286
  await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
68313
68287
  }
68288
+ async setOutboundPolicy(request) {
68289
+ await this.callUnary(() => this.stub.taskSetOutboundPolicy(request));
68290
+ }
68314
68291
  /**
68315
68292
  * Reload all Volumes mounted in the task to reflect their latest committed state.
68316
68293
  *
@@ -70369,6 +70346,19 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70369
70346
  );
70370
70347
  }
70371
70348
  }
70349
+ if (params.outboundPolicy !== void 0) {
70350
+ params.outboundPolicy._validate();
70351
+ if (params.blockNetwork) {
70352
+ throw new InvalidError(
70353
+ "outboundPolicy cannot be used when blockNetwork is enabled"
70354
+ );
70355
+ }
70356
+ if (params.outboundDomainAllowlist && params.outboundDomainAllowlist.length > 0) {
70357
+ throw new InvalidError(
70358
+ "outboundPolicy cannot be used with outboundDomainAllowlist"
70359
+ );
70360
+ }
70361
+ }
70372
70362
  const networkAccess = buildOutboundNetworkAccess(
70373
70363
  params.blockNetwork,
70374
70364
  params.outboundCidrAllowlist,
@@ -70449,6 +70439,7 @@ async function buildSandboxCreateRequestProto(appId, imageId, params = {}) {
70449
70439
  idleTimeoutSecs: params.idleTimeoutMs != void 0 ? params.idleTimeoutMs / 1e3 : void 0,
70450
70440
  workdir: params.workdir ?? void 0,
70451
70441
  networkAccess,
70442
+ outboundPolicy: params.outboundPolicy?._toProto(),
70452
70443
  resources: Resources.create({
70453
70444
  milliCpu,
70454
70445
  milliCpuMax,
@@ -70509,7 +70500,7 @@ var SandboxService = class {
70509
70500
  );
70510
70501
  await hydrateSandboxSecrets(
70511
70502
  this.#client,
70512
- mergedSecrets,
70503
+ [...mergedSecrets, ...params.outboundPolicy?._secrets() ?? []],
70513
70504
  params.cloudBucketMounts
70514
70505
  );
70515
70506
  const mergedParams = {
@@ -70570,7 +70561,7 @@ var SandboxService = class {
70570
70561
  Object.assign(envDict, params.env ?? {});
70571
70562
  await hydrateSandboxSecrets(
70572
70563
  this.#client,
70573
- resolvableSecrets,
70564
+ [...resolvableSecrets, ...params.outboundPolicy?._secrets() ?? []],
70574
70565
  params.cloudBucketMounts
70575
70566
  );
70576
70567
  const mergedParams = {
@@ -71716,6 +71707,29 @@ var Sandbox2 = class _Sandbox {
71716
71707
  });
71717
71708
  await commandRouterClient.setNetworkAccess(request);
71718
71709
  }
71710
+ /**
71711
+ * Replace the outbound policy of a running Sandbox.
71712
+ *
71713
+ * The new policy replaces all existing policy configuration on the
71714
+ * Sandbox; build a policy including any existing rules you want to keep.
71715
+ *
71716
+ * Only Sandboxes created with an `outboundPolicy` can be updated this
71717
+ * way; for Sandboxes created without one this fails, since header
71718
+ * replacement is only set up at creation time.
71719
+ */
71720
+ async updateOutboundPolicy(outboundPolicy) {
71721
+ this.#ensureAttached();
71722
+ outboundPolicy._validate();
71723
+ const [, [taskId, commandRouterClient]] = await Promise.all([
71724
+ hydrateSecrets(this.#client, outboundPolicy._secrets()),
71725
+ this.#getCommandRouter()
71726
+ ]);
71727
+ const request = TaskSetOutboundPolicyRequest.create({
71728
+ taskId,
71729
+ outboundPolicy: outboundPolicy._toProto()
71730
+ });
71731
+ await commandRouterClient.setOutboundPolicy(request);
71732
+ }
71719
71733
  /**
71720
71734
  * Reload all Volumes mounted in the Sandbox.
71721
71735
  *
@@ -72273,7 +72287,7 @@ var AuthTokenManager = class {
72273
72287
  };
72274
72288
 
72275
72289
  // src/version.ts
72276
- var SDK_VERSION = "0.10.2-dev.0";
72290
+ var SDK_VERSION = "0.10.2-dev.2";
72277
72291
  function getSDKVersion() {
72278
72292
  return SDK_VERSION;
72279
72293
  }
@@ -74599,6 +74613,129 @@ var ClsInstance = class {
74599
74613
  return method;
74600
74614
  }
74601
74615
  };
74616
+
74617
+ // src/outbound_policy.ts
74618
+ 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])?$/;
74619
+ var HEADER_NAME_RE = /^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/;
74620
+ var MAX_HEADER_REPLACEMENTS = 25;
74621
+ function hasInvalidHeaderValueChar(value) {
74622
+ for (const c of value) {
74623
+ const code = c.codePointAt(0);
74624
+ if (code < 32 && c !== " " || code === 127) {
74625
+ return true;
74626
+ }
74627
+ }
74628
+ return false;
74629
+ }
74630
+ function templateReferencesKey(template) {
74631
+ const isKeyStart = (c) => /[a-zA-Z_]/.test(c);
74632
+ let i = template.indexOf("$");
74633
+ while (i !== -1 && i + 1 < template.length) {
74634
+ const c = template[i + 1];
74635
+ if (c === "$") {
74636
+ i = template.indexOf("$", i + 2);
74637
+ continue;
74638
+ }
74639
+ if (isKeyStart(c)) {
74640
+ return true;
74641
+ }
74642
+ i = template.indexOf("$", i + 1);
74643
+ }
74644
+ return false;
74645
+ }
74646
+ var OutboundPolicy2 = class _OutboundPolicy {
74647
+ /** @internal */
74648
+ _replacements;
74649
+ /** @internal */
74650
+ constructor(_replacements = []) {
74651
+ this._replacements = _replacements;
74652
+ }
74653
+ /**
74654
+ * Return a new {@link OutboundPolicy} with an added header replacement.
74655
+ *
74656
+ * @param params.domain Domain the replacements are scoped to. Supports `*.` wildcard
74657
+ * prefixes (matching the apex domain and subdomains) and a bare `"*"`.
74658
+ * @param params.headers Header name -> header value. Values support `$KEY` templates
74659
+ * referencing keys in the replacement's `secret`.
74660
+ * @param params.secret Named {@link Secret} (e.g. from `client.secrets.fromName`) whose
74661
+ * keys may be referenced in the header value templates. Static replacements pass no secret.
74662
+ */
74663
+ withHeaderReplacement(params) {
74664
+ const { domain, headers, secret } = params;
74665
+ return new _OutboundPolicy([
74666
+ ...this._replacements,
74667
+ { domain, headers: { ...headers }, secret }
74668
+ ]);
74669
+ }
74670
+ /** Check all replacements, throwing `InvalidError` on the first violation found.
74671
+ * @internal
74672
+ */
74673
+ _validate() {
74674
+ let total = 0;
74675
+ for (const replacement of this._replacements) {
74676
+ const { domain, headers, secret } = replacement;
74677
+ if (domain !== "*" && !DOMAIN_RE.test(domain)) {
74678
+ throw new InvalidError(`Invalid domain: ${JSON.stringify(domain)}`);
74679
+ }
74680
+ const entries = Object.entries(headers);
74681
+ if (entries.length === 0) {
74682
+ throw new InvalidError("`headers` must contain at least one header");
74683
+ }
74684
+ for (const [name, value] of entries) {
74685
+ if (!HEADER_NAME_RE.test(name)) {
74686
+ throw new InvalidError(
74687
+ `Invalid header name: ${JSON.stringify(name)}`
74688
+ );
74689
+ }
74690
+ if (hasInvalidHeaderValueChar(value)) {
74691
+ throw new InvalidError(
74692
+ `Header value for ${JSON.stringify(name)} must not contain control characters (except tab)`
74693
+ );
74694
+ }
74695
+ if (secret === void 0 && templateReferencesKey(value)) {
74696
+ throw new InvalidError(
74697
+ `Header value for ${JSON.stringify(name)} references a secret key, but no \`secret\` was passed`
74698
+ );
74699
+ }
74700
+ }
74701
+ if (secret !== void 0 && secretEnvDictHydrator(secret) !== void 0) {
74702
+ throw new InvalidError(
74703
+ "Outbound policies only support named secrets (e.g. `client.secrets.fromName`); ephemeral secrets (e.g. `client.secrets.fromObject`) are not yet supported"
74704
+ );
74705
+ }
74706
+ total += entries.length;
74707
+ }
74708
+ if (total > MAX_HEADER_REPLACEMENTS) {
74709
+ throw new InvalidError(
74710
+ `Outbound policy cannot have more than ${MAX_HEADER_REPLACEMENTS} header replacements`
74711
+ );
74712
+ }
74713
+ }
74714
+ /** Deduplicated list of secrets referenced by the policy's replacements.
74715
+ * @internal
74716
+ */
74717
+ _secrets() {
74718
+ return [
74719
+ ...new Set(
74720
+ this._replacements.map((s) => s.secret).filter((s) => s !== void 0)
74721
+ )
74722
+ ];
74723
+ }
74724
+ /** Convert to the wire format. Referenced secrets must be hydrated first.
74725
+ * @internal
74726
+ */
74727
+ _toProto() {
74728
+ return OutboundPolicy.create({
74729
+ headerReplacements: this._replacements.map(
74730
+ (replacement) => OutboundPolicy_HeaderReplacement.create({
74731
+ domain: replacement.domain,
74732
+ secretId: replacement.secret?.secretId ?? "",
74733
+ headers: replacement.headers
74734
+ })
74735
+ )
74736
+ });
74737
+ }
74738
+ };
74602
74739
  // Annotate the CommonJS export names for ESM import in node:
74603
74740
  0 && (module.exports = {
74604
74741
  AlreadyExistsError,
@@ -74626,6 +74763,7 @@ var ClsInstance = class {
74626
74763
  InvalidError,
74627
74764
  ModalClient,
74628
74765
  NotFoundError,
74766
+ OutboundPolicy,
74629
74767
  Probe,
74630
74768
  Proxy,
74631
74769
  ProxyService,