modal 0.8.1 → 0.9.0

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
@@ -2102,6 +2102,31 @@ function environmentRoleToJSON(object) {
2102
2102
  return "UNRECOGNIZED";
2103
2103
  }
2104
2104
  }
2105
+ function environmentTypeFromJSON(object) {
2106
+ switch (object) {
2107
+ case 0:
2108
+ case "ENVIRONMENT_TYPE_UNSPECIFIED":
2109
+ return 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */;
2110
+ case 1:
2111
+ case "ENVIRONMENT_TYPE_PUBLIC":
2112
+ return 1 /* ENVIRONMENT_TYPE_PUBLIC */;
2113
+ case -1:
2114
+ case "UNRECOGNIZED":
2115
+ default:
2116
+ return -1 /* UNRECOGNIZED */;
2117
+ }
2118
+ }
2119
+ function environmentTypeToJSON(object) {
2120
+ switch (object) {
2121
+ case 0 /* ENVIRONMENT_TYPE_UNSPECIFIED */:
2122
+ return "ENVIRONMENT_TYPE_UNSPECIFIED";
2123
+ case 1 /* ENVIRONMENT_TYPE_PUBLIC */:
2124
+ return "ENVIRONMENT_TYPE_PUBLIC";
2125
+ case -1 /* UNRECOGNIZED */:
2126
+ default:
2127
+ return "UNRECOGNIZED";
2128
+ }
2129
+ }
2105
2130
  function execOutputOptionFromJSON(object) {
2106
2131
  switch (object) {
2107
2132
  case 0:
@@ -13485,14 +13510,54 @@ var ContainerReloadVolumesResponse = {
13485
13510
  return message;
13486
13511
  }
13487
13512
  };
13513
+ function createBaseContainerServerLifecycleReadyRequest() {
13514
+ return {};
13515
+ }
13516
+ var ContainerServerLifecycleReadyRequest = {
13517
+ encode(_, writer = new BinaryWriter()) {
13518
+ return writer;
13519
+ },
13520
+ decode(input, length) {
13521
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
13522
+ let end = length === void 0 ? reader.len : reader.pos + length;
13523
+ const message = createBaseContainerServerLifecycleReadyRequest();
13524
+ while (reader.pos < end) {
13525
+ const tag = reader.uint32();
13526
+ switch (tag >>> 3) {
13527
+ }
13528
+ if ((tag & 7) === 4 || tag === 0) {
13529
+ break;
13530
+ }
13531
+ reader.skip(tag & 7);
13532
+ }
13533
+ return message;
13534
+ },
13535
+ fromJSON(_) {
13536
+ return {};
13537
+ },
13538
+ toJSON(_) {
13539
+ const obj = {};
13540
+ return obj;
13541
+ },
13542
+ create(base) {
13543
+ return ContainerServerLifecycleReadyRequest.fromPartial(base ?? {});
13544
+ },
13545
+ fromPartial(_) {
13546
+ const message = createBaseContainerServerLifecycleReadyRequest();
13547
+ return message;
13548
+ }
13549
+ };
13488
13550
  function createBaseContainerStopRequest() {
13489
- return { taskId: "" };
13551
+ return { taskId: "", graceful: false };
13490
13552
  }
13491
13553
  var ContainerStopRequest = {
13492
13554
  encode(message, writer = new BinaryWriter()) {
13493
13555
  if (message.taskId !== "") {
13494
13556
  writer.uint32(10).string(message.taskId);
13495
13557
  }
13558
+ if (message.graceful !== false) {
13559
+ writer.uint32(16).bool(message.graceful);
13560
+ }
13496
13561
  return writer;
13497
13562
  },
13498
13563
  decode(input, length) {
@@ -13509,6 +13574,13 @@ var ContainerStopRequest = {
13509
13574
  message.taskId = reader.string();
13510
13575
  continue;
13511
13576
  }
13577
+ case 2: {
13578
+ if (tag !== 16) {
13579
+ break;
13580
+ }
13581
+ message.graceful = reader.bool();
13582
+ continue;
13583
+ }
13512
13584
  }
13513
13585
  if ((tag & 7) === 4 || tag === 0) {
13514
13586
  break;
@@ -13518,13 +13590,19 @@ var ContainerStopRequest = {
13518
13590
  return message;
13519
13591
  },
13520
13592
  fromJSON(object) {
13521
- return { taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "" };
13593
+ return {
13594
+ taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
13595
+ graceful: isSet5(object.graceful) ? globalThis.Boolean(object.graceful) : false
13596
+ };
13522
13597
  },
13523
13598
  toJSON(message) {
13524
13599
  const obj = {};
13525
13600
  if (message.taskId !== "") {
13526
13601
  obj.taskId = message.taskId;
13527
13602
  }
13603
+ if (message.graceful !== false) {
13604
+ obj.graceful = message.graceful;
13605
+ }
13528
13606
  return obj;
13529
13607
  },
13530
13608
  create(base) {
@@ -13533,6 +13611,7 @@ var ContainerStopRequest = {
13533
13611
  fromPartial(object) {
13534
13612
  const message = createBaseContainerStopRequest();
13535
13613
  message.taskId = object.taskId ?? "";
13614
+ message.graceful = object.graceful ?? false;
13536
13615
  return message;
13537
13616
  }
13538
13617
  };
@@ -17580,8 +17659,280 @@ var EndpointStopResponse = {
17580
17659
  return message;
17581
17660
  }
17582
17661
  };
17662
+ function createBaseEnvironmentBillingSummaryRequest() {
17663
+ return { startTimestamp: void 0, endTimestamp: void 0, environmentId: "" };
17664
+ }
17665
+ var EnvironmentBillingSummaryRequest = {
17666
+ encode(message, writer = new BinaryWriter()) {
17667
+ if (message.startTimestamp !== void 0) {
17668
+ Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
17669
+ }
17670
+ if (message.endTimestamp !== void 0) {
17671
+ Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
17672
+ }
17673
+ if (message.environmentId !== "") {
17674
+ writer.uint32(26).string(message.environmentId);
17675
+ }
17676
+ return writer;
17677
+ },
17678
+ decode(input, length) {
17679
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
17680
+ let end = length === void 0 ? reader.len : reader.pos + length;
17681
+ const message = createBaseEnvironmentBillingSummaryRequest();
17682
+ while (reader.pos < end) {
17683
+ const tag = reader.uint32();
17684
+ switch (tag >>> 3) {
17685
+ case 1: {
17686
+ if (tag !== 10) {
17687
+ break;
17688
+ }
17689
+ message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
17690
+ continue;
17691
+ }
17692
+ case 2: {
17693
+ if (tag !== 18) {
17694
+ break;
17695
+ }
17696
+ message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
17697
+ continue;
17698
+ }
17699
+ case 3: {
17700
+ if (tag !== 26) {
17701
+ break;
17702
+ }
17703
+ message.environmentId = reader.string();
17704
+ continue;
17705
+ }
17706
+ }
17707
+ if ((tag & 7) === 4 || tag === 0) {
17708
+ break;
17709
+ }
17710
+ reader.skip(tag & 7);
17711
+ }
17712
+ return message;
17713
+ },
17714
+ fromJSON(object) {
17715
+ return {
17716
+ startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
17717
+ endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
17718
+ environmentId: isSet5(object.environmentId) ? globalThis.String(object.environmentId) : ""
17719
+ };
17720
+ },
17721
+ toJSON(message) {
17722
+ const obj = {};
17723
+ if (message.startTimestamp !== void 0) {
17724
+ obj.startTimestamp = message.startTimestamp.toISOString();
17725
+ }
17726
+ if (message.endTimestamp !== void 0) {
17727
+ obj.endTimestamp = message.endTimestamp.toISOString();
17728
+ }
17729
+ if (message.environmentId !== "") {
17730
+ obj.environmentId = message.environmentId;
17731
+ }
17732
+ return obj;
17733
+ },
17734
+ create(base) {
17735
+ return EnvironmentBillingSummaryRequest.fromPartial(base ?? {});
17736
+ },
17737
+ fromPartial(object) {
17738
+ const message = createBaseEnvironmentBillingSummaryRequest();
17739
+ message.startTimestamp = object.startTimestamp ?? void 0;
17740
+ message.endTimestamp = object.endTimestamp ?? void 0;
17741
+ message.environmentId = object.environmentId ?? "";
17742
+ return message;
17743
+ }
17744
+ };
17745
+ function createBaseEnvironmentBillingSummaryResponse() {
17746
+ return { startTimestamp: void 0, endTimestamp: void 0, meteredCost: "", meteredCostBreakdown: {} };
17747
+ }
17748
+ var EnvironmentBillingSummaryResponse = {
17749
+ encode(message, writer = new BinaryWriter()) {
17750
+ if (message.startTimestamp !== void 0) {
17751
+ Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
17752
+ }
17753
+ if (message.endTimestamp !== void 0) {
17754
+ Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
17755
+ }
17756
+ if (message.meteredCost !== "") {
17757
+ writer.uint32(26).string(message.meteredCost);
17758
+ }
17759
+ Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
17760
+ EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
17761
+ { key, value },
17762
+ writer.uint32(34).fork()
17763
+ ).join();
17764
+ });
17765
+ return writer;
17766
+ },
17767
+ decode(input, length) {
17768
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
17769
+ let end = length === void 0 ? reader.len : reader.pos + length;
17770
+ const message = createBaseEnvironmentBillingSummaryResponse();
17771
+ while (reader.pos < end) {
17772
+ const tag = reader.uint32();
17773
+ switch (tag >>> 3) {
17774
+ case 1: {
17775
+ if (tag !== 10) {
17776
+ break;
17777
+ }
17778
+ message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
17779
+ continue;
17780
+ }
17781
+ case 2: {
17782
+ if (tag !== 18) {
17783
+ break;
17784
+ }
17785
+ message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
17786
+ continue;
17787
+ }
17788
+ case 3: {
17789
+ if (tag !== 26) {
17790
+ break;
17791
+ }
17792
+ message.meteredCost = reader.string();
17793
+ continue;
17794
+ }
17795
+ case 4: {
17796
+ if (tag !== 34) {
17797
+ break;
17798
+ }
17799
+ const entry4 = EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
17800
+ if (entry4.value !== void 0) {
17801
+ message.meteredCostBreakdown[entry4.key] = entry4.value;
17802
+ }
17803
+ continue;
17804
+ }
17805
+ }
17806
+ if ((tag & 7) === 4 || tag === 0) {
17807
+ break;
17808
+ }
17809
+ reader.skip(tag & 7);
17810
+ }
17811
+ return message;
17812
+ },
17813
+ fromJSON(object) {
17814
+ return {
17815
+ startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
17816
+ endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
17817
+ meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
17818
+ meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
17819
+ acc[key] = String(value);
17820
+ return acc;
17821
+ }, {}) : {}
17822
+ };
17823
+ },
17824
+ toJSON(message) {
17825
+ const obj = {};
17826
+ if (message.startTimestamp !== void 0) {
17827
+ obj.startTimestamp = message.startTimestamp.toISOString();
17828
+ }
17829
+ if (message.endTimestamp !== void 0) {
17830
+ obj.endTimestamp = message.endTimestamp.toISOString();
17831
+ }
17832
+ if (message.meteredCost !== "") {
17833
+ obj.meteredCost = message.meteredCost;
17834
+ }
17835
+ if (message.meteredCostBreakdown) {
17836
+ const entries = Object.entries(message.meteredCostBreakdown);
17837
+ if (entries.length > 0) {
17838
+ obj.meteredCostBreakdown = {};
17839
+ entries.forEach(([k, v]) => {
17840
+ obj.meteredCostBreakdown[k] = v;
17841
+ });
17842
+ }
17843
+ }
17844
+ return obj;
17845
+ },
17846
+ create(base) {
17847
+ return EnvironmentBillingSummaryResponse.fromPartial(base ?? {});
17848
+ },
17849
+ fromPartial(object) {
17850
+ const message = createBaseEnvironmentBillingSummaryResponse();
17851
+ message.startTimestamp = object.startTimestamp ?? void 0;
17852
+ message.endTimestamp = object.endTimestamp ?? void 0;
17853
+ message.meteredCost = object.meteredCost ?? "";
17854
+ message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
17855
+ (acc, [key, value]) => {
17856
+ if (value !== void 0) {
17857
+ acc[key] = globalThis.String(value);
17858
+ }
17859
+ return acc;
17860
+ },
17861
+ {}
17862
+ );
17863
+ return message;
17864
+ }
17865
+ };
17866
+ function createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry() {
17867
+ return { key: "", value: "" };
17868
+ }
17869
+ var EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry = {
17870
+ encode(message, writer = new BinaryWriter()) {
17871
+ if (message.key !== "") {
17872
+ writer.uint32(10).string(message.key);
17873
+ }
17874
+ if (message.value !== "") {
17875
+ writer.uint32(18).string(message.value);
17876
+ }
17877
+ return writer;
17878
+ },
17879
+ decode(input, length) {
17880
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
17881
+ let end = length === void 0 ? reader.len : reader.pos + length;
17882
+ const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
17883
+ while (reader.pos < end) {
17884
+ const tag = reader.uint32();
17885
+ switch (tag >>> 3) {
17886
+ case 1: {
17887
+ if (tag !== 10) {
17888
+ break;
17889
+ }
17890
+ message.key = reader.string();
17891
+ continue;
17892
+ }
17893
+ case 2: {
17894
+ if (tag !== 18) {
17895
+ break;
17896
+ }
17897
+ message.value = reader.string();
17898
+ continue;
17899
+ }
17900
+ }
17901
+ if ((tag & 7) === 4 || tag === 0) {
17902
+ break;
17903
+ }
17904
+ reader.skip(tag & 7);
17905
+ }
17906
+ return message;
17907
+ },
17908
+ fromJSON(object) {
17909
+ return {
17910
+ key: isSet5(object.key) ? globalThis.String(object.key) : "",
17911
+ value: isSet5(object.value) ? globalThis.String(object.value) : ""
17912
+ };
17913
+ },
17914
+ toJSON(message) {
17915
+ const obj = {};
17916
+ if (message.key !== "") {
17917
+ obj.key = message.key;
17918
+ }
17919
+ if (message.value !== "") {
17920
+ obj.value = message.value;
17921
+ }
17922
+ return obj;
17923
+ },
17924
+ create(base) {
17925
+ return EnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
17926
+ },
17927
+ fromPartial(object) {
17928
+ const message = createBaseEnvironmentBillingSummaryResponse_MeteredCostBreakdownEntry();
17929
+ message.key = object.key ?? "";
17930
+ message.value = object.value ?? "";
17931
+ return message;
17932
+ }
17933
+ };
17583
17934
  function createBaseEnvironmentCreateRequest() {
17584
- return { name: "", isManaged: false, settings: void 0 };
17935
+ return { name: "", isManaged: false, settings: void 0, environmentType: 0 };
17585
17936
  }
17586
17937
  var EnvironmentCreateRequest = {
17587
17938
  encode(message, writer = new BinaryWriter()) {
@@ -17594,6 +17945,9 @@ var EnvironmentCreateRequest = {
17594
17945
  if (message.settings !== void 0) {
17595
17946
  EnvironmentSettings.encode(message.settings, writer.uint32(26).fork()).join();
17596
17947
  }
17948
+ if (message.environmentType !== 0) {
17949
+ writer.uint32(32).int32(message.environmentType);
17950
+ }
17597
17951
  return writer;
17598
17952
  },
17599
17953
  decode(input, length) {
@@ -17624,6 +17978,13 @@ var EnvironmentCreateRequest = {
17624
17978
  message.settings = EnvironmentSettings.decode(reader, reader.uint32());
17625
17979
  continue;
17626
17980
  }
17981
+ case 4: {
17982
+ if (tag !== 32) {
17983
+ break;
17984
+ }
17985
+ message.environmentType = reader.int32();
17986
+ continue;
17987
+ }
17627
17988
  }
17628
17989
  if ((tag & 7) === 4 || tag === 0) {
17629
17990
  break;
@@ -17636,7 +17997,8 @@ var EnvironmentCreateRequest = {
17636
17997
  return {
17637
17998
  name: isSet5(object.name) ? globalThis.String(object.name) : "",
17638
17999
  isManaged: isSet5(object.isManaged) ? globalThis.Boolean(object.isManaged) : false,
17639
- settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
18000
+ settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
18001
+ environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
17640
18002
  };
17641
18003
  },
17642
18004
  toJSON(message) {
@@ -17650,6 +18012,9 @@ var EnvironmentCreateRequest = {
17650
18012
  if (message.settings !== void 0) {
17651
18013
  obj.settings = EnvironmentSettings.toJSON(message.settings);
17652
18014
  }
18015
+ if (message.environmentType !== 0) {
18016
+ obj.environmentType = environmentTypeToJSON(message.environmentType);
18017
+ }
17653
18018
  return obj;
17654
18019
  },
17655
18020
  create(base) {
@@ -17660,6 +18025,7 @@ var EnvironmentCreateRequest = {
17660
18025
  message.name = object.name ?? "";
17661
18026
  message.isManaged = object.isManaged ?? false;
17662
18027
  message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
18028
+ message.environmentType = object.environmentType ?? 0;
17663
18029
  return message;
17664
18030
  }
17665
18031
  };
@@ -18347,7 +18713,8 @@ function createBaseEnvironmentListItem() {
18347
18713
  cycleBudgetDollars: void 0,
18348
18714
  effectiveCycleSpendLimit: 0,
18349
18715
  currentCycleUsage: 0,
18350
- spendLimitReached: false
18716
+ spendLimitReached: false,
18717
+ environmentType: 0
18351
18718
  };
18352
18719
  }
18353
18720
  var EnvironmentListItem = {
@@ -18394,6 +18761,9 @@ var EnvironmentListItem = {
18394
18761
  if (message.spendLimitReached !== false) {
18395
18762
  writer.uint32(112).bool(message.spendLimitReached);
18396
18763
  }
18764
+ if (message.environmentType !== 0) {
18765
+ writer.uint32(120).int32(message.environmentType);
18766
+ }
18397
18767
  return writer;
18398
18768
  },
18399
18769
  decode(input, length) {
@@ -18501,6 +18871,13 @@ var EnvironmentListItem = {
18501
18871
  message.spendLimitReached = reader.bool();
18502
18872
  continue;
18503
18873
  }
18874
+ case 15: {
18875
+ if (tag !== 120) {
18876
+ break;
18877
+ }
18878
+ message.environmentType = reader.int32();
18879
+ continue;
18880
+ }
18504
18881
  }
18505
18882
  if ((tag & 7) === 4 || tag === 0) {
18506
18883
  break;
@@ -18524,7 +18901,8 @@ var EnvironmentListItem = {
18524
18901
  cycleBudgetDollars: isSet5(object.cycleBudgetDollars) ? globalThis.Number(object.cycleBudgetDollars) : void 0,
18525
18902
  effectiveCycleSpendLimit: isSet5(object.effectiveCycleSpendLimit) ? globalThis.Number(object.effectiveCycleSpendLimit) : 0,
18526
18903
  currentCycleUsage: isSet5(object.currentCycleUsage) ? globalThis.Number(object.currentCycleUsage) : 0,
18527
- spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false
18904
+ spendLimitReached: isSet5(object.spendLimitReached) ? globalThis.Boolean(object.spendLimitReached) : false,
18905
+ environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
18528
18906
  };
18529
18907
  },
18530
18908
  toJSON(message) {
@@ -18571,6 +18949,9 @@ var EnvironmentListItem = {
18571
18949
  if (message.spendLimitReached !== false) {
18572
18950
  obj.spendLimitReached = message.spendLimitReached;
18573
18951
  }
18952
+ if (message.environmentType !== 0) {
18953
+ obj.environmentType = environmentTypeToJSON(message.environmentType);
18954
+ }
18574
18955
  return obj;
18575
18956
  },
18576
18957
  create(base) {
@@ -18592,6 +18973,7 @@ var EnvironmentListItem = {
18592
18973
  message.effectiveCycleSpendLimit = object.effectiveCycleSpendLimit ?? 0;
18593
18974
  message.currentCycleUsage = object.currentCycleUsage ?? 0;
18594
18975
  message.spendLimitReached = object.spendLimitReached ?? false;
18976
+ message.environmentType = object.environmentType ?? 0;
18595
18977
  return message;
18596
18978
  }
18597
18979
  };
@@ -18649,7 +19031,7 @@ var EnvironmentListResponse = {
18649
19031
  }
18650
19032
  };
18651
19033
  function createBaseEnvironmentMetadata() {
18652
- return { name: "", settings: void 0 };
19034
+ return { name: "", settings: void 0, environmentType: 0 };
18653
19035
  }
18654
19036
  var EnvironmentMetadata = {
18655
19037
  encode(message, writer = new BinaryWriter()) {
@@ -18659,6 +19041,9 @@ var EnvironmentMetadata = {
18659
19041
  if (message.settings !== void 0) {
18660
19042
  EnvironmentSettings.encode(message.settings, writer.uint32(18).fork()).join();
18661
19043
  }
19044
+ if (message.environmentType !== 0) {
19045
+ writer.uint32(24).int32(message.environmentType);
19046
+ }
18662
19047
  return writer;
18663
19048
  },
18664
19049
  decode(input, length) {
@@ -18682,6 +19067,13 @@ var EnvironmentMetadata = {
18682
19067
  message.settings = EnvironmentSettings.decode(reader, reader.uint32());
18683
19068
  continue;
18684
19069
  }
19070
+ case 3: {
19071
+ if (tag !== 24) {
19072
+ break;
19073
+ }
19074
+ message.environmentType = reader.int32();
19075
+ continue;
19076
+ }
18685
19077
  }
18686
19078
  if ((tag & 7) === 4 || tag === 0) {
18687
19079
  break;
@@ -18693,7 +19085,8 @@ var EnvironmentMetadata = {
18693
19085
  fromJSON(object) {
18694
19086
  return {
18695
19087
  name: isSet5(object.name) ? globalThis.String(object.name) : "",
18696
- settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0
19088
+ settings: isSet5(object.settings) ? EnvironmentSettings.fromJSON(object.settings) : void 0,
19089
+ environmentType: isSet5(object.environmentType) ? environmentTypeFromJSON(object.environmentType) : 0
18697
19090
  };
18698
19091
  },
18699
19092
  toJSON(message) {
@@ -18704,6 +19097,9 @@ var EnvironmentMetadata = {
18704
19097
  if (message.settings !== void 0) {
18705
19098
  obj.settings = EnvironmentSettings.toJSON(message.settings);
18706
19099
  }
19100
+ if (message.environmentType !== 0) {
19101
+ obj.environmentType = environmentTypeToJSON(message.environmentType);
19102
+ }
18707
19103
  return obj;
18708
19104
  },
18709
19105
  create(base) {
@@ -18713,6 +19109,7 @@ var EnvironmentMetadata = {
18713
19109
  const message = createBaseEnvironmentMetadata();
18714
19110
  message.name = object.name ?? "";
18715
19111
  message.settings = object.settings !== void 0 && object.settings !== null ? EnvironmentSettings.fromPartial(object.settings) : void 0;
19112
+ message.environmentType = object.environmentType ?? 0;
18716
19113
  return message;
18717
19114
  }
18718
19115
  };
@@ -21966,7 +22363,7 @@ var FunctionCallFromIdRequest = {
21966
22363
  }
21967
22364
  };
21968
22365
  function createBaseFunctionCallFromIdResponse() {
21969
- return { functionCallId: "", numInputs: 0 };
22366
+ return { functionCallId: "", numInputs: 0, metadata: void 0 };
21970
22367
  }
21971
22368
  var FunctionCallFromIdResponse = {
21972
22369
  encode(message, writer = new BinaryWriter()) {
@@ -21976,6 +22373,9 @@ var FunctionCallFromIdResponse = {
21976
22373
  if (message.numInputs !== 0) {
21977
22374
  writer.uint32(16).int32(message.numInputs);
21978
22375
  }
22376
+ if (message.metadata !== void 0) {
22377
+ FunctionCallHandleMetadata.encode(message.metadata, writer.uint32(26).fork()).join();
22378
+ }
21979
22379
  return writer;
21980
22380
  },
21981
22381
  decode(input, length) {
@@ -21999,6 +22399,13 @@ var FunctionCallFromIdResponse = {
21999
22399
  message.numInputs = reader.int32();
22000
22400
  continue;
22001
22401
  }
22402
+ case 3: {
22403
+ if (tag !== 26) {
22404
+ break;
22405
+ }
22406
+ message.metadata = FunctionCallHandleMetadata.decode(reader, reader.uint32());
22407
+ continue;
22408
+ }
22002
22409
  }
22003
22410
  if ((tag & 7) === 4 || tag === 0) {
22004
22411
  break;
@@ -22010,7 +22417,8 @@ var FunctionCallFromIdResponse = {
22010
22417
  fromJSON(object) {
22011
22418
  return {
22012
22419
  functionCallId: isSet5(object.functionCallId) ? globalThis.String(object.functionCallId) : "",
22013
- numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0
22420
+ numInputs: isSet5(object.numInputs) ? globalThis.Number(object.numInputs) : 0,
22421
+ metadata: isSet5(object.metadata) ? FunctionCallHandleMetadata.fromJSON(object.metadata) : void 0
22014
22422
  };
22015
22423
  },
22016
22424
  toJSON(message) {
@@ -22021,6 +22429,9 @@ var FunctionCallFromIdResponse = {
22021
22429
  if (message.numInputs !== 0) {
22022
22430
  obj.numInputs = Math.round(message.numInputs);
22023
22431
  }
22432
+ if (message.metadata !== void 0) {
22433
+ obj.metadata = FunctionCallHandleMetadata.toJSON(message.metadata);
22434
+ }
22024
22435
  return obj;
22025
22436
  },
22026
22437
  create(base) {
@@ -22030,6 +22441,7 @@ var FunctionCallFromIdResponse = {
22030
22441
  const message = createBaseFunctionCallFromIdResponse();
22031
22442
  message.functionCallId = object.functionCallId ?? "";
22032
22443
  message.numInputs = object.numInputs ?? 0;
22444
+ message.metadata = object.metadata !== void 0 && object.metadata !== null ? FunctionCallHandleMetadata.fromPartial(object.metadata) : void 0;
22033
22445
  return message;
22034
22446
  }
22035
22447
  };
@@ -22116,6 +22528,74 @@ var FunctionCallGetDataRequest = {
22116
22528
  return message;
22117
22529
  }
22118
22530
  };
22531
+ function createBaseFunctionCallHandleMetadata() {
22532
+ return { appId: "", functionId: "" };
22533
+ }
22534
+ var FunctionCallHandleMetadata = {
22535
+ encode(message, writer = new BinaryWriter()) {
22536
+ if (message.appId !== "") {
22537
+ writer.uint32(10).string(message.appId);
22538
+ }
22539
+ if (message.functionId !== "") {
22540
+ writer.uint32(18).string(message.functionId);
22541
+ }
22542
+ return writer;
22543
+ },
22544
+ decode(input, length) {
22545
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
22546
+ let end = length === void 0 ? reader.len : reader.pos + length;
22547
+ const message = createBaseFunctionCallHandleMetadata();
22548
+ while (reader.pos < end) {
22549
+ const tag = reader.uint32();
22550
+ switch (tag >>> 3) {
22551
+ case 1: {
22552
+ if (tag !== 10) {
22553
+ break;
22554
+ }
22555
+ message.appId = reader.string();
22556
+ continue;
22557
+ }
22558
+ case 2: {
22559
+ if (tag !== 18) {
22560
+ break;
22561
+ }
22562
+ message.functionId = reader.string();
22563
+ continue;
22564
+ }
22565
+ }
22566
+ if ((tag & 7) === 4 || tag === 0) {
22567
+ break;
22568
+ }
22569
+ reader.skip(tag & 7);
22570
+ }
22571
+ return message;
22572
+ },
22573
+ fromJSON(object) {
22574
+ return {
22575
+ appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
22576
+ functionId: isSet5(object.functionId) ? globalThis.String(object.functionId) : ""
22577
+ };
22578
+ },
22579
+ toJSON(message) {
22580
+ const obj = {};
22581
+ if (message.appId !== "") {
22582
+ obj.appId = message.appId;
22583
+ }
22584
+ if (message.functionId !== "") {
22585
+ obj.functionId = message.functionId;
22586
+ }
22587
+ return obj;
22588
+ },
22589
+ create(base) {
22590
+ return FunctionCallHandleMetadata.fromPartial(base ?? {});
22591
+ },
22592
+ fromPartial(object) {
22593
+ const message = createBaseFunctionCallHandleMetadata();
22594
+ message.appId = object.appId ?? "";
22595
+ message.functionId = object.functionId ?? "";
22596
+ return message;
22597
+ }
22598
+ };
22119
22599
  function createBaseFunctionCallInfo() {
22120
22600
  return {
22121
22601
  functionCallId: "",
@@ -25238,7 +25718,8 @@ function createBaseFunctionHandleMetadata() {
25238
25718
  maxObjectSizeBytes: void 0,
25239
25719
  ExperimentalFlashUrls: [],
25240
25720
  supportedInputFormats: [],
25241
- supportedOutputFormats: []
25721
+ supportedOutputFormats: [],
25722
+ appId: ""
25242
25723
  };
25243
25724
  }
25244
25725
  var FunctionHandleMetadata = {
@@ -25295,6 +25776,9 @@ var FunctionHandleMetadata = {
25295
25776
  writer.int32(v);
25296
25777
  }
25297
25778
  writer.join();
25779
+ if (message.appId !== "") {
25780
+ writer.uint32(418).string(message.appId);
25781
+ }
25298
25782
  return writer;
25299
25783
  },
25300
25784
  decode(input, length) {
@@ -25433,6 +25917,13 @@ var FunctionHandleMetadata = {
25433
25917
  }
25434
25918
  break;
25435
25919
  }
25920
+ case 52: {
25921
+ if (tag !== 418) {
25922
+ break;
25923
+ }
25924
+ message.appId = reader.string();
25925
+ continue;
25926
+ }
25436
25927
  }
25437
25928
  if ((tag & 7) === 4 || tag === 0) {
25438
25929
  break;
@@ -25464,7 +25955,8 @@ var FunctionHandleMetadata = {
25464
25955
  maxObjectSizeBytes: isSet5(object.maxObjectSizeBytes) ? globalThis.Number(object.maxObjectSizeBytes) : void 0,
25465
25956
  ExperimentalFlashUrls: globalThis.Array.isArray(object?.ExperimentalFlashUrls) ? object.ExperimentalFlashUrls.map((e) => globalThis.String(e)) : [],
25466
25957
  supportedInputFormats: globalThis.Array.isArray(object?.supportedInputFormats) ? object.supportedInputFormats.map((e) => dataFormatFromJSON(e)) : [],
25467
- supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : []
25958
+ supportedOutputFormats: globalThis.Array.isArray(object?.supportedOutputFormats) ? object.supportedOutputFormats.map((e) => dataFormatFromJSON(e)) : [],
25959
+ appId: isSet5(object.appId) ? globalThis.String(object.appId) : ""
25468
25960
  };
25469
25961
  },
25470
25962
  toJSON(message) {
@@ -25523,6 +26015,9 @@ var FunctionHandleMetadata = {
25523
26015
  if (message.supportedOutputFormats?.length) {
25524
26016
  obj.supportedOutputFormats = message.supportedOutputFormats.map((e) => dataFormatToJSON(e));
25525
26017
  }
26018
+ if (message.appId !== "") {
26019
+ obj.appId = message.appId;
26020
+ }
25526
26021
  return obj;
25527
26022
  },
25528
26023
  create(base) {
@@ -25551,6 +26046,7 @@ var FunctionHandleMetadata = {
25551
26046
  message.ExperimentalFlashUrls = object.ExperimentalFlashUrls?.map((e) => e) || [];
25552
26047
  message.supportedInputFormats = object.supportedInputFormats?.map((e) => e) || [];
25553
26048
  message.supportedOutputFormats = object.supportedOutputFormats?.map((e) => e) || [];
26049
+ message.appId = object.appId ?? "";
25554
26050
  return message;
25555
26051
  }
25556
26052
  };
@@ -26043,7 +26539,8 @@ function createBaseFunctionOptions() {
26043
26539
  cloudProviderStr: void 0,
26044
26540
  replaceCloudBucketMounts: false,
26045
26541
  cloudBucketMounts: [],
26046
- pinnedAppVersion: void 0
26542
+ pinnedAppVersion: void 0,
26543
+ routingRegion: void 0
26047
26544
  };
26048
26545
  }
26049
26546
  var FunctionOptions = {
@@ -26111,6 +26608,9 @@ var FunctionOptions = {
26111
26608
  if (message.pinnedAppVersion !== void 0) {
26112
26609
  writer.uint32(168).int32(message.pinnedAppVersion);
26113
26610
  }
26611
+ if (message.routingRegion !== void 0) {
26612
+ writer.uint32(178).string(message.routingRegion);
26613
+ }
26114
26614
  return writer;
26115
26615
  },
26116
26616
  decode(input, length) {
@@ -26267,6 +26767,13 @@ var FunctionOptions = {
26267
26767
  message.pinnedAppVersion = reader.int32();
26268
26768
  continue;
26269
26769
  }
26770
+ case 22: {
26771
+ if (tag !== 178) {
26772
+ break;
26773
+ }
26774
+ message.routingRegion = reader.string();
26775
+ continue;
26776
+ }
26270
26777
  }
26271
26778
  if ((tag & 7) === 4 || tag === 0) {
26272
26779
  break;
@@ -26297,7 +26804,8 @@ var FunctionOptions = {
26297
26804
  cloudProviderStr: isSet5(object.cloudProviderStr) ? globalThis.String(object.cloudProviderStr) : void 0,
26298
26805
  replaceCloudBucketMounts: isSet5(object.replaceCloudBucketMounts) ? globalThis.Boolean(object.replaceCloudBucketMounts) : false,
26299
26806
  cloudBucketMounts: globalThis.Array.isArray(object?.cloudBucketMounts) ? object.cloudBucketMounts.map((e) => CloudBucketMount.fromJSON(e)) : [],
26300
- pinnedAppVersion: isSet5(object.pinnedAppVersion) ? globalThis.Number(object.pinnedAppVersion) : void 0
26807
+ pinnedAppVersion: isSet5(object.pinnedAppVersion) ? globalThis.Number(object.pinnedAppVersion) : void 0,
26808
+ routingRegion: isSet5(object.routingRegion) ? globalThis.String(object.routingRegion) : void 0
26301
26809
  };
26302
26810
  },
26303
26811
  toJSON(message) {
@@ -26365,6 +26873,9 @@ var FunctionOptions = {
26365
26873
  if (message.pinnedAppVersion !== void 0) {
26366
26874
  obj.pinnedAppVersion = Math.round(message.pinnedAppVersion);
26367
26875
  }
26876
+ if (message.routingRegion !== void 0) {
26877
+ obj.routingRegion = message.routingRegion;
26878
+ }
26368
26879
  return obj;
26369
26880
  },
26370
26881
  create(base) {
@@ -26393,6 +26904,7 @@ var FunctionOptions = {
26393
26904
  message.replaceCloudBucketMounts = object.replaceCloudBucketMounts ?? false;
26394
26905
  message.cloudBucketMounts = object.cloudBucketMounts?.map((e) => CloudBucketMount.fromPartial(e)) || [];
26395
26906
  message.pinnedAppVersion = object.pinnedAppVersion ?? void 0;
26907
+ message.routingRegion = object.routingRegion ?? void 0;
26396
26908
  return message;
26397
26909
  }
26398
26910
  };
@@ -30192,7 +30704,7 @@ var ImageMetadata_PythonPackagesEntry = {
30192
30704
  }
30193
30705
  };
30194
30706
  function createBaseImagePublishRequest() {
30195
- return { imageId: "", tag: "", environmentName: "", isPublic: false };
30707
+ return { imageId: "", tag: "", environmentName: "", allowPublic: false };
30196
30708
  }
30197
30709
  var ImagePublishRequest = {
30198
30710
  encode(message, writer = new BinaryWriter()) {
@@ -30205,8 +30717,8 @@ var ImagePublishRequest = {
30205
30717
  if (message.environmentName !== "") {
30206
30718
  writer.uint32(26).string(message.environmentName);
30207
30719
  }
30208
- if (message.isPublic !== false) {
30209
- writer.uint32(32).bool(message.isPublic);
30720
+ if (message.allowPublic !== false) {
30721
+ writer.uint32(32).bool(message.allowPublic);
30210
30722
  }
30211
30723
  return writer;
30212
30724
  },
@@ -30242,7 +30754,7 @@ var ImagePublishRequest = {
30242
30754
  if (tag !== 32) {
30243
30755
  break;
30244
30756
  }
30245
- message.isPublic = reader.bool();
30757
+ message.allowPublic = reader.bool();
30246
30758
  continue;
30247
30759
  }
30248
30760
  }
@@ -30258,7 +30770,7 @@ var ImagePublishRequest = {
30258
30770
  imageId: isSet5(object.imageId) ? globalThis.String(object.imageId) : "",
30259
30771
  tag: isSet5(object.tag) ? globalThis.String(object.tag) : "",
30260
30772
  environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
30261
- isPublic: isSet5(object.isPublic) ? globalThis.Boolean(object.isPublic) : false
30773
+ allowPublic: isSet5(object.allowPublic) ? globalThis.Boolean(object.allowPublic) : false
30262
30774
  };
30263
30775
  },
30264
30776
  toJSON(message) {
@@ -30272,8 +30784,8 @@ var ImagePublishRequest = {
30272
30784
  if (message.environmentName !== "") {
30273
30785
  obj.environmentName = message.environmentName;
30274
30786
  }
30275
- if (message.isPublic !== false) {
30276
- obj.isPublic = message.isPublic;
30787
+ if (message.allowPublic !== false) {
30788
+ obj.allowPublic = message.allowPublic;
30277
30789
  }
30278
30790
  return obj;
30279
30791
  },
@@ -30285,7 +30797,7 @@ var ImagePublishRequest = {
30285
30797
  message.imageId = object.imageId ?? "";
30286
30798
  message.tag = object.tag ?? "";
30287
30799
  message.environmentName = object.environmentName ?? "";
30288
- message.isPublic = object.isPublic ?? false;
30800
+ message.allowPublic = object.allowPublic ?? false;
30289
30801
  return message;
30290
30802
  }
30291
30803
  };
@@ -30426,7 +30938,7 @@ var ImageRegistryConfig = {
30426
30938
  }
30427
30939
  };
30428
30940
  function createBaseImageTagRevisionsItem() {
30429
- return { imageId: "", revisionId: "", createdAt: 0 };
30941
+ return { imageId: "", revisionId: "", createdAt: 0, publishedBy: "" };
30430
30942
  }
30431
30943
  var ImageTagRevisionsItem = {
30432
30944
  encode(message, writer = new BinaryWriter()) {
@@ -30439,6 +30951,9 @@ var ImageTagRevisionsItem = {
30439
30951
  if (message.createdAt !== 0) {
30440
30952
  writer.uint32(25).double(message.createdAt);
30441
30953
  }
30954
+ if (message.publishedBy !== "") {
30955
+ writer.uint32(34).string(message.publishedBy);
30956
+ }
30442
30957
  return writer;
30443
30958
  },
30444
30959
  decode(input, length) {
@@ -30469,6 +30984,13 @@ var ImageTagRevisionsItem = {
30469
30984
  message.createdAt = reader.double();
30470
30985
  continue;
30471
30986
  }
30987
+ case 4: {
30988
+ if (tag !== 34) {
30989
+ break;
30990
+ }
30991
+ message.publishedBy = reader.string();
30992
+ continue;
30993
+ }
30472
30994
  }
30473
30995
  if ((tag & 7) === 4 || tag === 0) {
30474
30996
  break;
@@ -30481,7 +31003,8 @@ var ImageTagRevisionsItem = {
30481
31003
  return {
30482
31004
  imageId: isSet5(object.imageId) ? globalThis.String(object.imageId) : "",
30483
31005
  revisionId: isSet5(object.revisionId) ? globalThis.String(object.revisionId) : "",
30484
- createdAt: isSet5(object.createdAt) ? globalThis.Number(object.createdAt) : 0
31006
+ createdAt: isSet5(object.createdAt) ? globalThis.Number(object.createdAt) : 0,
31007
+ publishedBy: isSet5(object.publishedBy) ? globalThis.String(object.publishedBy) : ""
30485
31008
  };
30486
31009
  },
30487
31010
  toJSON(message) {
@@ -30495,6 +31018,9 @@ var ImageTagRevisionsItem = {
30495
31018
  if (message.createdAt !== 0) {
30496
31019
  obj.createdAt = message.createdAt;
30497
31020
  }
31021
+ if (message.publishedBy !== "") {
31022
+ obj.publishedBy = message.publishedBy;
31023
+ }
30498
31024
  return obj;
30499
31025
  },
30500
31026
  create(base) {
@@ -30505,6 +31031,7 @@ var ImageTagRevisionsItem = {
30505
31031
  message.imageId = object.imageId ?? "";
30506
31032
  message.revisionId = object.revisionId ?? "";
30507
31033
  message.createdAt = object.createdAt ?? 0;
31034
+ message.publishedBy = object.publishedBy ?? "";
30508
31035
  return message;
30509
31036
  }
30510
31037
  };
@@ -31922,6 +32449,112 @@ var MethodDefinition = {
31922
32449
  return message;
31923
32450
  }
31924
32451
  };
32452
+ function createBaseMountBatchedCheckExistenceRequest() {
32453
+ return { sha256HexHashes: [] };
32454
+ }
32455
+ var MountBatchedCheckExistenceRequest = {
32456
+ encode(message, writer = new BinaryWriter()) {
32457
+ for (const v of message.sha256HexHashes) {
32458
+ writer.uint32(10).string(v);
32459
+ }
32460
+ return writer;
32461
+ },
32462
+ decode(input, length) {
32463
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32464
+ let end = length === void 0 ? reader.len : reader.pos + length;
32465
+ const message = createBaseMountBatchedCheckExistenceRequest();
32466
+ while (reader.pos < end) {
32467
+ const tag = reader.uint32();
32468
+ switch (tag >>> 3) {
32469
+ case 1: {
32470
+ if (tag !== 10) {
32471
+ break;
32472
+ }
32473
+ message.sha256HexHashes.push(reader.string());
32474
+ continue;
32475
+ }
32476
+ }
32477
+ if ((tag & 7) === 4 || tag === 0) {
32478
+ break;
32479
+ }
32480
+ reader.skip(tag & 7);
32481
+ }
32482
+ return message;
32483
+ },
32484
+ fromJSON(object) {
32485
+ return {
32486
+ sha256HexHashes: globalThis.Array.isArray(object?.sha256HexHashes) ? object.sha256HexHashes.map((e) => globalThis.String(e)) : []
32487
+ };
32488
+ },
32489
+ toJSON(message) {
32490
+ const obj = {};
32491
+ if (message.sha256HexHashes?.length) {
32492
+ obj.sha256HexHashes = message.sha256HexHashes;
32493
+ }
32494
+ return obj;
32495
+ },
32496
+ create(base) {
32497
+ return MountBatchedCheckExistenceRequest.fromPartial(base ?? {});
32498
+ },
32499
+ fromPartial(object) {
32500
+ const message = createBaseMountBatchedCheckExistenceRequest();
32501
+ message.sha256HexHashes = object.sha256HexHashes?.map((e) => e) || [];
32502
+ return message;
32503
+ }
32504
+ };
32505
+ function createBaseMountBatchedCheckExistenceResponse() {
32506
+ return { missingSha256HexHashes: [] };
32507
+ }
32508
+ var MountBatchedCheckExistenceResponse = {
32509
+ encode(message, writer = new BinaryWriter()) {
32510
+ for (const v of message.missingSha256HexHashes) {
32511
+ writer.uint32(10).string(v);
32512
+ }
32513
+ return writer;
32514
+ },
32515
+ decode(input, length) {
32516
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
32517
+ let end = length === void 0 ? reader.len : reader.pos + length;
32518
+ const message = createBaseMountBatchedCheckExistenceResponse();
32519
+ while (reader.pos < end) {
32520
+ const tag = reader.uint32();
32521
+ switch (tag >>> 3) {
32522
+ case 1: {
32523
+ if (tag !== 10) {
32524
+ break;
32525
+ }
32526
+ message.missingSha256HexHashes.push(reader.string());
32527
+ continue;
32528
+ }
32529
+ }
32530
+ if ((tag & 7) === 4 || tag === 0) {
32531
+ break;
32532
+ }
32533
+ reader.skip(tag & 7);
32534
+ }
32535
+ return message;
32536
+ },
32537
+ fromJSON(object) {
32538
+ return {
32539
+ missingSha256HexHashes: globalThis.Array.isArray(object?.missingSha256HexHashes) ? object.missingSha256HexHashes.map((e) => globalThis.String(e)) : []
32540
+ };
32541
+ },
32542
+ toJSON(message) {
32543
+ const obj = {};
32544
+ if (message.missingSha256HexHashes?.length) {
32545
+ obj.missingSha256HexHashes = message.missingSha256HexHashes;
32546
+ }
32547
+ return obj;
32548
+ },
32549
+ create(base) {
32550
+ return MountBatchedCheckExistenceResponse.fromPartial(base ?? {});
32551
+ },
32552
+ fromPartial(object) {
32553
+ const message = createBaseMountBatchedCheckExistenceResponse();
32554
+ message.missingSha256HexHashes = object.missingSha256HexHashes?.map((e) => e) || [];
32555
+ return message;
32556
+ }
32557
+ };
31925
32558
  function createBaseMountFile() {
31926
32559
  return { filename: "", sha256Hex: "", size: void 0, mode: void 0 };
31927
32560
  }
@@ -38259,7 +38892,7 @@ var SandboxCreateResponse = {
38259
38892
  }
38260
38893
  };
38261
38894
  function createBaseSandboxCreateV2Request() {
38262
- return { appId: "", definition: void 0, ephemeralSecrets: void 0 };
38895
+ return { appId: "", definition: void 0, ephemeralSecrets: void 0, tags: [] };
38263
38896
  }
38264
38897
  var SandboxCreateV2Request = {
38265
38898
  encode(message, writer = new BinaryWriter()) {
@@ -38272,6 +38905,9 @@ var SandboxCreateV2Request = {
38272
38905
  if (message.ephemeralSecrets !== void 0) {
38273
38906
  StringMap.encode(message.ephemeralSecrets, writer.uint32(26).fork()).join();
38274
38907
  }
38908
+ for (const v of message.tags) {
38909
+ SandboxTag.encode(v, writer.uint32(34).fork()).join();
38910
+ }
38275
38911
  return writer;
38276
38912
  },
38277
38913
  decode(input, length) {
@@ -38302,6 +38938,13 @@ var SandboxCreateV2Request = {
38302
38938
  message.ephemeralSecrets = StringMap.decode(reader, reader.uint32());
38303
38939
  continue;
38304
38940
  }
38941
+ case 4: {
38942
+ if (tag !== 34) {
38943
+ break;
38944
+ }
38945
+ message.tags.push(SandboxTag.decode(reader, reader.uint32()));
38946
+ continue;
38947
+ }
38305
38948
  }
38306
38949
  if ((tag & 7) === 4 || tag === 0) {
38307
38950
  break;
@@ -38314,7 +38957,8 @@ var SandboxCreateV2Request = {
38314
38957
  return {
38315
38958
  appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
38316
38959
  definition: isSet5(object.definition) ? Sandbox.fromJSON(object.definition) : void 0,
38317
- ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0
38960
+ ephemeralSecrets: isSet5(object.ephemeralSecrets) ? StringMap.fromJSON(object.ephemeralSecrets) : void 0,
38961
+ tags: globalThis.Array.isArray(object?.tags) ? object.tags.map((e) => SandboxTag.fromJSON(e)) : []
38318
38962
  };
38319
38963
  },
38320
38964
  toJSON(message) {
@@ -38328,6 +38972,9 @@ var SandboxCreateV2Request = {
38328
38972
  if (message.ephemeralSecrets !== void 0) {
38329
38973
  obj.ephemeralSecrets = StringMap.toJSON(message.ephemeralSecrets);
38330
38974
  }
38975
+ if (message.tags?.length) {
38976
+ obj.tags = message.tags.map((e) => SandboxTag.toJSON(e));
38977
+ }
38331
38978
  return obj;
38332
38979
  },
38333
38980
  create(base) {
@@ -38338,6 +38985,7 @@ var SandboxCreateV2Request = {
38338
38985
  message.appId = object.appId ?? "";
38339
38986
  message.definition = object.definition !== void 0 && object.definition !== null ? Sandbox.fromPartial(object.definition) : void 0;
38340
38987
  message.ephemeralSecrets = object.ephemeralSecrets !== void 0 && object.ephemeralSecrets !== null ? StringMap.fromPartial(object.ephemeralSecrets) : void 0;
38988
+ message.tags = object.tags?.map((e) => SandboxTag.fromPartial(e)) || [];
38341
38989
  return message;
38342
38990
  }
38343
38991
  };
@@ -38425,13 +39073,16 @@ var SandboxCreateV2Response = {
38425
39073
  }
38426
39074
  };
38427
39075
  function createBaseSandboxGetCommandRouterAccessRequest() {
38428
- return { sandboxId: "" };
39076
+ return { sandboxId: void 0, taskId: void 0 };
38429
39077
  }
38430
39078
  var SandboxGetCommandRouterAccessRequest = {
38431
39079
  encode(message, writer = new BinaryWriter()) {
38432
- if (message.sandboxId !== "") {
39080
+ if (message.sandboxId !== void 0) {
38433
39081
  writer.uint32(10).string(message.sandboxId);
38434
39082
  }
39083
+ if (message.taskId !== void 0) {
39084
+ writer.uint32(18).string(message.taskId);
39085
+ }
38435
39086
  return writer;
38436
39087
  },
38437
39088
  decode(input, length) {
@@ -38448,6 +39099,13 @@ var SandboxGetCommandRouterAccessRequest = {
38448
39099
  message.sandboxId = reader.string();
38449
39100
  continue;
38450
39101
  }
39102
+ case 2: {
39103
+ if (tag !== 18) {
39104
+ break;
39105
+ }
39106
+ message.taskId = reader.string();
39107
+ continue;
39108
+ }
38451
39109
  }
38452
39110
  if ((tag & 7) === 4 || tag === 0) {
38453
39111
  break;
@@ -38457,13 +39115,19 @@ var SandboxGetCommandRouterAccessRequest = {
38457
39115
  return message;
38458
39116
  },
38459
39117
  fromJSON(object) {
38460
- return { sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : "" };
39118
+ return {
39119
+ sandboxId: isSet5(object.sandboxId) ? globalThis.String(object.sandboxId) : void 0,
39120
+ taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : void 0
39121
+ };
38461
39122
  },
38462
39123
  toJSON(message) {
38463
39124
  const obj = {};
38464
- if (message.sandboxId !== "") {
39125
+ if (message.sandboxId !== void 0) {
38465
39126
  obj.sandboxId = message.sandboxId;
38466
39127
  }
39128
+ if (message.taskId !== void 0) {
39129
+ obj.taskId = message.taskId;
39130
+ }
38467
39131
  return obj;
38468
39132
  },
38469
39133
  create(base) {
@@ -38471,7 +39135,8 @@ var SandboxGetCommandRouterAccessRequest = {
38471
39135
  },
38472
39136
  fromPartial(object) {
38473
39137
  const message = createBaseSandboxGetCommandRouterAccessRequest();
38474
- message.sandboxId = object.sandboxId ?? "";
39138
+ message.sandboxId = object.sandboxId ?? void 0;
39139
+ message.taskId = object.taskId ?? void 0;
38475
39140
  return message;
38476
39141
  }
38477
39142
  };
@@ -44022,7 +44687,7 @@ var SystemErrorMessage = {
44022
44687
  }
44023
44688
  };
44024
44689
  function createBaseTaskClusterHelloRequest() {
44025
- return { taskId: "", containerIp: "", imexHostIp: "" };
44690
+ return { taskId: "", containerIp: "", imexHostIp: "", imexFabricId: "" };
44026
44691
  }
44027
44692
  var TaskClusterHelloRequest = {
44028
44693
  encode(message, writer = new BinaryWriter()) {
@@ -44035,6 +44700,9 @@ var TaskClusterHelloRequest = {
44035
44700
  if (message.imexHostIp !== "") {
44036
44701
  writer.uint32(26).string(message.imexHostIp);
44037
44702
  }
44703
+ if (message.imexFabricId !== "") {
44704
+ writer.uint32(34).string(message.imexFabricId);
44705
+ }
44038
44706
  return writer;
44039
44707
  },
44040
44708
  decode(input, length) {
@@ -44065,6 +44733,13 @@ var TaskClusterHelloRequest = {
44065
44733
  message.imexHostIp = reader.string();
44066
44734
  continue;
44067
44735
  }
44736
+ case 4: {
44737
+ if (tag !== 34) {
44738
+ break;
44739
+ }
44740
+ message.imexFabricId = reader.string();
44741
+ continue;
44742
+ }
44068
44743
  }
44069
44744
  if ((tag & 7) === 4 || tag === 0) {
44070
44745
  break;
@@ -44077,7 +44752,8 @@ var TaskClusterHelloRequest = {
44077
44752
  return {
44078
44753
  taskId: isSet5(object.taskId) ? globalThis.String(object.taskId) : "",
44079
44754
  containerIp: isSet5(object.containerIp) ? globalThis.String(object.containerIp) : "",
44080
- imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : ""
44755
+ imexHostIp: isSet5(object.imexHostIp) ? globalThis.String(object.imexHostIp) : "",
44756
+ imexFabricId: isSet5(object.imexFabricId) ? globalThis.String(object.imexFabricId) : ""
44081
44757
  };
44082
44758
  },
44083
44759
  toJSON(message) {
@@ -44091,6 +44767,9 @@ var TaskClusterHelloRequest = {
44091
44767
  if (message.imexHostIp !== "") {
44092
44768
  obj.imexHostIp = message.imexHostIp;
44093
44769
  }
44770
+ if (message.imexFabricId !== "") {
44771
+ obj.imexFabricId = message.imexFabricId;
44772
+ }
44094
44773
  return obj;
44095
44774
  },
44096
44775
  create(base) {
@@ -44101,6 +44780,7 @@ var TaskClusterHelloRequest = {
44101
44780
  message.taskId = object.taskId ?? "";
44102
44781
  message.containerIp = object.containerIp ?? "";
44103
44782
  message.imexHostIp = object.imexHostIp ?? "";
44783
+ message.imexFabricId = object.imexFabricId ?? "";
44104
44784
  return message;
44105
44785
  }
44106
44786
  };
@@ -47289,6 +47969,147 @@ var VolumeCopyFilesRequest = {
47289
47969
  return message;
47290
47970
  }
47291
47971
  };
47972
+ function createBaseVolumeCreateOptions() {
47973
+ return { experimentalOptions: {} };
47974
+ }
47975
+ var VolumeCreateOptions = {
47976
+ encode(message, writer = new BinaryWriter()) {
47977
+ Object.entries(message.experimentalOptions).forEach(([key, value]) => {
47978
+ VolumeCreateOptions_ExperimentalOptionsEntry.encode({ key, value }, writer.uint32(10).fork()).join();
47979
+ });
47980
+ return writer;
47981
+ },
47982
+ decode(input, length) {
47983
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
47984
+ let end = length === void 0 ? reader.len : reader.pos + length;
47985
+ const message = createBaseVolumeCreateOptions();
47986
+ while (reader.pos < end) {
47987
+ const tag = reader.uint32();
47988
+ switch (tag >>> 3) {
47989
+ case 1: {
47990
+ if (tag !== 10) {
47991
+ break;
47992
+ }
47993
+ const entry1 = VolumeCreateOptions_ExperimentalOptionsEntry.decode(reader, reader.uint32());
47994
+ if (entry1.value !== void 0) {
47995
+ message.experimentalOptions[entry1.key] = entry1.value;
47996
+ }
47997
+ continue;
47998
+ }
47999
+ }
48000
+ if ((tag & 7) === 4 || tag === 0) {
48001
+ break;
48002
+ }
48003
+ reader.skip(tag & 7);
48004
+ }
48005
+ return message;
48006
+ },
48007
+ fromJSON(object) {
48008
+ return {
48009
+ experimentalOptions: isObject2(object.experimentalOptions) ? Object.entries(object.experimentalOptions).reduce((acc, [key, value]) => {
48010
+ acc[key] = String(value);
48011
+ return acc;
48012
+ }, {}) : {}
48013
+ };
48014
+ },
48015
+ toJSON(message) {
48016
+ const obj = {};
48017
+ if (message.experimentalOptions) {
48018
+ const entries = Object.entries(message.experimentalOptions);
48019
+ if (entries.length > 0) {
48020
+ obj.experimentalOptions = {};
48021
+ entries.forEach(([k, v]) => {
48022
+ obj.experimentalOptions[k] = v;
48023
+ });
48024
+ }
48025
+ }
48026
+ return obj;
48027
+ },
48028
+ create(base) {
48029
+ return VolumeCreateOptions.fromPartial(base ?? {});
48030
+ },
48031
+ fromPartial(object) {
48032
+ const message = createBaseVolumeCreateOptions();
48033
+ message.experimentalOptions = Object.entries(object.experimentalOptions ?? {}).reduce(
48034
+ (acc, [key, value]) => {
48035
+ if (value !== void 0) {
48036
+ acc[key] = globalThis.String(value);
48037
+ }
48038
+ return acc;
48039
+ },
48040
+ {}
48041
+ );
48042
+ return message;
48043
+ }
48044
+ };
48045
+ function createBaseVolumeCreateOptions_ExperimentalOptionsEntry() {
48046
+ return { key: "", value: "" };
48047
+ }
48048
+ var VolumeCreateOptions_ExperimentalOptionsEntry = {
48049
+ encode(message, writer = new BinaryWriter()) {
48050
+ if (message.key !== "") {
48051
+ writer.uint32(10).string(message.key);
48052
+ }
48053
+ if (message.value !== "") {
48054
+ writer.uint32(18).string(message.value);
48055
+ }
48056
+ return writer;
48057
+ },
48058
+ decode(input, length) {
48059
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
48060
+ let end = length === void 0 ? reader.len : reader.pos + length;
48061
+ const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
48062
+ while (reader.pos < end) {
48063
+ const tag = reader.uint32();
48064
+ switch (tag >>> 3) {
48065
+ case 1: {
48066
+ if (tag !== 10) {
48067
+ break;
48068
+ }
48069
+ message.key = reader.string();
48070
+ continue;
48071
+ }
48072
+ case 2: {
48073
+ if (tag !== 18) {
48074
+ break;
48075
+ }
48076
+ message.value = 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 {
48089
+ key: isSet5(object.key) ? globalThis.String(object.key) : "",
48090
+ value: isSet5(object.value) ? globalThis.String(object.value) : ""
48091
+ };
48092
+ },
48093
+ toJSON(message) {
48094
+ const obj = {};
48095
+ if (message.key !== "") {
48096
+ obj.key = message.key;
48097
+ }
48098
+ if (message.value !== "") {
48099
+ obj.value = message.value;
48100
+ }
48101
+ return obj;
48102
+ },
48103
+ create(base) {
48104
+ return VolumeCreateOptions_ExperimentalOptionsEntry.fromPartial(base ?? {});
48105
+ },
48106
+ fromPartial(object) {
48107
+ const message = createBaseVolumeCreateOptions_ExperimentalOptionsEntry();
48108
+ message.key = object.key ?? "";
48109
+ message.value = object.value ?? "";
48110
+ return message;
48111
+ }
48112
+ };
47292
48113
  function createBaseVolumeDeleteRequest() {
47293
48114
  return { volumeId: "", environmentName: "" };
47294
48115
  }
@@ -47884,7 +48705,14 @@ var VolumeGetFileResponse = {
47884
48705
  }
47885
48706
  };
47886
48707
  function createBaseVolumeGetOrCreateRequest() {
47887
- return { deploymentName: "", environmentName: "", objectCreationType: 0, appId: "", version: 0 };
48708
+ return {
48709
+ deploymentName: "",
48710
+ environmentName: "",
48711
+ objectCreationType: 0,
48712
+ appId: "",
48713
+ version: 0,
48714
+ createOptions: void 0
48715
+ };
47888
48716
  }
47889
48717
  var VolumeGetOrCreateRequest = {
47890
48718
  encode(message, writer = new BinaryWriter()) {
@@ -47903,6 +48731,9 @@ var VolumeGetOrCreateRequest = {
47903
48731
  if (message.version !== 0) {
47904
48732
  writer.uint32(48).int32(message.version);
47905
48733
  }
48734
+ if (message.createOptions !== void 0) {
48735
+ VolumeCreateOptions.encode(message.createOptions, writer.uint32(58).fork()).join();
48736
+ }
47906
48737
  return writer;
47907
48738
  },
47908
48739
  decode(input, length) {
@@ -47947,6 +48778,13 @@ var VolumeGetOrCreateRequest = {
47947
48778
  message.version = reader.int32();
47948
48779
  continue;
47949
48780
  }
48781
+ case 7: {
48782
+ if (tag !== 58) {
48783
+ break;
48784
+ }
48785
+ message.createOptions = VolumeCreateOptions.decode(reader, reader.uint32());
48786
+ continue;
48787
+ }
47950
48788
  }
47951
48789
  if ((tag & 7) === 4 || tag === 0) {
47952
48790
  break;
@@ -47961,7 +48799,8 @@ var VolumeGetOrCreateRequest = {
47961
48799
  environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "",
47962
48800
  objectCreationType: isSet5(object.objectCreationType) ? objectCreationTypeFromJSON(object.objectCreationType) : 0,
47963
48801
  appId: isSet5(object.appId) ? globalThis.String(object.appId) : "",
47964
- version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0
48802
+ version: isSet5(object.version) ? volumeFsVersionFromJSON(object.version) : 0,
48803
+ createOptions: isSet5(object.createOptions) ? VolumeCreateOptions.fromJSON(object.createOptions) : void 0
47965
48804
  };
47966
48805
  },
47967
48806
  toJSON(message) {
@@ -47981,6 +48820,9 @@ var VolumeGetOrCreateRequest = {
47981
48820
  if (message.version !== 0) {
47982
48821
  obj.version = volumeFsVersionToJSON(message.version);
47983
48822
  }
48823
+ if (message.createOptions !== void 0) {
48824
+ obj.createOptions = VolumeCreateOptions.toJSON(message.createOptions);
48825
+ }
47984
48826
  return obj;
47985
48827
  },
47986
48828
  create(base) {
@@ -47993,6 +48835,7 @@ var VolumeGetOrCreateRequest = {
47993
48835
  message.objectCreationType = object.objectCreationType ?? 0;
47994
48836
  message.appId = object.appId ?? "";
47995
48837
  message.version = object.version ?? 0;
48838
+ message.createOptions = object.createOptions !== void 0 && object.createOptions !== null ? VolumeCreateOptions.fromPartial(object.createOptions) : void 0;
47996
48839
  return message;
47997
48840
  }
47998
48841
  };
@@ -50451,7 +51294,6 @@ function createBaseWorkspaceBillingReportItem() {
50451
51294
  interval: void 0,
50452
51295
  cost: "",
50453
51296
  tags: {},
50454
- costByResourceFloat: {},
50455
51297
  costByResource: {}
50456
51298
  };
50457
51299
  }
@@ -50475,9 +51317,6 @@ var WorkspaceBillingReportItem = {
50475
51317
  Object.entries(message.tags).forEach(([key, value]) => {
50476
51318
  WorkspaceBillingReportItem_TagsEntry.encode({ key, value }, writer.uint32(50).fork()).join();
50477
51319
  });
50478
- Object.entries(message.costByResourceFloat).forEach(([key, value]) => {
50479
- WorkspaceBillingReportItem_CostByResourceFloatEntry.encode({ key, value }, writer.uint32(58).fork()).join();
50480
- });
50481
51320
  Object.entries(message.costByResource).forEach(([key, value]) => {
50482
51321
  WorkspaceBillingReportItem_CostByResourceEntry.encode({ key, value }, writer.uint32(66).fork()).join();
50483
51322
  });
@@ -50535,16 +51374,6 @@ var WorkspaceBillingReportItem = {
50535
51374
  }
50536
51375
  continue;
50537
51376
  }
50538
- case 7: {
50539
- if (tag !== 58) {
50540
- break;
50541
- }
50542
- const entry7 = WorkspaceBillingReportItem_CostByResourceFloatEntry.decode(reader, reader.uint32());
50543
- if (entry7.value !== void 0) {
50544
- message.costByResourceFloat[entry7.key] = entry7.value;
50545
- }
50546
- continue;
50547
- }
50548
51377
  case 8: {
50549
51378
  if (tag !== 66) {
50550
51379
  break;
@@ -50574,10 +51403,6 @@ var WorkspaceBillingReportItem = {
50574
51403
  acc[key] = String(value);
50575
51404
  return acc;
50576
51405
  }, {}) : {},
50577
- costByResourceFloat: isObject2(object.costByResourceFloat) ? Object.entries(object.costByResourceFloat).reduce((acc, [key, value]) => {
50578
- acc[key] = Number(value);
50579
- return acc;
50580
- }, {}) : {},
50581
51406
  costByResource: isObject2(object.costByResource) ? Object.entries(object.costByResource).reduce((acc, [key, value]) => {
50582
51407
  acc[key] = String(value);
50583
51408
  return acc;
@@ -50610,15 +51435,6 @@ var WorkspaceBillingReportItem = {
50610
51435
  });
50611
51436
  }
50612
51437
  }
50613
- if (message.costByResourceFloat) {
50614
- const entries = Object.entries(message.costByResourceFloat);
50615
- if (entries.length > 0) {
50616
- obj.costByResourceFloat = {};
50617
- entries.forEach(([k, v]) => {
50618
- obj.costByResourceFloat[k] = v;
50619
- });
50620
- }
50621
- }
50622
51438
  if (message.costByResource) {
50623
51439
  const entries = Object.entries(message.costByResource);
50624
51440
  if (entries.length > 0) {
@@ -50646,15 +51462,6 @@ var WorkspaceBillingReportItem = {
50646
51462
  }
50647
51463
  return acc;
50648
51464
  }, {});
50649
- message.costByResourceFloat = Object.entries(object.costByResourceFloat ?? {}).reduce(
50650
- (acc, [key, value]) => {
50651
- if (value !== void 0) {
50652
- acc[key] = globalThis.Number(value);
50653
- }
50654
- return acc;
50655
- },
50656
- {}
50657
- );
50658
51465
  message.costByResource = Object.entries(object.costByResource ?? {}).reduce(
50659
51466
  (acc, [key, value]) => {
50660
51467
  if (value !== void 0) {
@@ -50735,23 +51542,23 @@ var WorkspaceBillingReportItem_TagsEntry = {
50735
51542
  return message;
50736
51543
  }
50737
51544
  };
50738
- function createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry() {
50739
- return { key: "", value: 0 };
51545
+ function createBaseWorkspaceBillingReportItem_CostByResourceEntry() {
51546
+ return { key: "", value: "" };
50740
51547
  }
50741
- var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
51548
+ var WorkspaceBillingReportItem_CostByResourceEntry = {
50742
51549
  encode(message, writer = new BinaryWriter()) {
50743
51550
  if (message.key !== "") {
50744
51551
  writer.uint32(10).string(message.key);
50745
51552
  }
50746
- if (message.value !== 0) {
50747
- writer.uint32(17).double(message.value);
51553
+ if (message.value !== "") {
51554
+ writer.uint32(18).string(message.value);
50748
51555
  }
50749
51556
  return writer;
50750
51557
  },
50751
51558
  decode(input, length) {
50752
51559
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
50753
51560
  let end = length === void 0 ? reader.len : reader.pos + length;
50754
- const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
51561
+ const message = createBaseWorkspaceBillingReportItem_CostByResourceEntry();
50755
51562
  while (reader.pos < end) {
50756
51563
  const tag = reader.uint32();
50757
51564
  switch (tag >>> 3) {
@@ -50763,10 +51570,10 @@ var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
50763
51570
  continue;
50764
51571
  }
50765
51572
  case 2: {
50766
- if (tag !== 17) {
51573
+ if (tag !== 18) {
50767
51574
  break;
50768
51575
  }
50769
- message.value = reader.double();
51576
+ message.value = reader.string();
50770
51577
  continue;
50771
51578
  }
50772
51579
  }
@@ -50780,7 +51587,7 @@ var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
50780
51587
  fromJSON(object) {
50781
51588
  return {
50782
51589
  key: isSet5(object.key) ? globalThis.String(object.key) : "",
50783
- value: isSet5(object.value) ? globalThis.Number(object.value) : 0
51590
+ value: isSet5(object.value) ? globalThis.String(object.value) : ""
50784
51591
  };
50785
51592
  },
50786
51593
  toJSON(message) {
@@ -50788,38 +51595,57 @@ var WorkspaceBillingReportItem_CostByResourceFloatEntry = {
50788
51595
  if (message.key !== "") {
50789
51596
  obj.key = message.key;
50790
51597
  }
50791
- if (message.value !== 0) {
51598
+ if (message.value !== "") {
50792
51599
  obj.value = message.value;
50793
51600
  }
50794
51601
  return obj;
50795
51602
  },
50796
51603
  create(base) {
50797
- return WorkspaceBillingReportItem_CostByResourceFloatEntry.fromPartial(base ?? {});
51604
+ return WorkspaceBillingReportItem_CostByResourceEntry.fromPartial(base ?? {});
50798
51605
  },
50799
51606
  fromPartial(object) {
50800
- const message = createBaseWorkspaceBillingReportItem_CostByResourceFloatEntry();
51607
+ const message = createBaseWorkspaceBillingReportItem_CostByResourceEntry();
50801
51608
  message.key = object.key ?? "";
50802
- message.value = object.value ?? 0;
51609
+ message.value = object.value ?? "";
50803
51610
  return message;
50804
51611
  }
50805
51612
  };
50806
- function createBaseWorkspaceBillingReportItem_CostByResourceEntry() {
50807
- return { key: "", value: "" };
51613
+ function createBaseWorkspaceBillingReportRequest() {
51614
+ return {
51615
+ startTimestamp: void 0,
51616
+ endTimestamp: void 0,
51617
+ resolution: "",
51618
+ tagNames: [],
51619
+ environmentIds: [],
51620
+ appIds: []
51621
+ };
50808
51622
  }
50809
- var WorkspaceBillingReportItem_CostByResourceEntry = {
51623
+ var WorkspaceBillingReportRequest = {
50810
51624
  encode(message, writer = new BinaryWriter()) {
50811
- if (message.key !== "") {
50812
- writer.uint32(10).string(message.key);
51625
+ if (message.startTimestamp !== void 0) {
51626
+ Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
50813
51627
  }
50814
- if (message.value !== "") {
50815
- writer.uint32(18).string(message.value);
51628
+ if (message.endTimestamp !== void 0) {
51629
+ Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
51630
+ }
51631
+ if (message.resolution !== "") {
51632
+ writer.uint32(26).string(message.resolution);
51633
+ }
51634
+ for (const v of message.tagNames) {
51635
+ writer.uint32(34).string(v);
51636
+ }
51637
+ for (const v of message.environmentIds) {
51638
+ writer.uint32(42).string(v);
51639
+ }
51640
+ for (const v of message.appIds) {
51641
+ writer.uint32(50).string(v);
50816
51642
  }
50817
51643
  return writer;
50818
51644
  },
50819
51645
  decode(input, length) {
50820
51646
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
50821
51647
  let end = length === void 0 ? reader.len : reader.pos + length;
50822
- const message = createBaseWorkspaceBillingReportItem_CostByResourceEntry();
51648
+ const message = createBaseWorkspaceBillingReportRequest();
50823
51649
  while (reader.pos < end) {
50824
51650
  const tag = reader.uint32();
50825
51651
  switch (tag >>> 3) {
@@ -50827,14 +51653,42 @@ var WorkspaceBillingReportItem_CostByResourceEntry = {
50827
51653
  if (tag !== 10) {
50828
51654
  break;
50829
51655
  }
50830
- message.key = reader.string();
51656
+ message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
50831
51657
  continue;
50832
51658
  }
50833
51659
  case 2: {
50834
51660
  if (tag !== 18) {
50835
51661
  break;
50836
51662
  }
50837
- message.value = reader.string();
51663
+ message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
51664
+ continue;
51665
+ }
51666
+ case 3: {
51667
+ if (tag !== 26) {
51668
+ break;
51669
+ }
51670
+ message.resolution = reader.string();
51671
+ continue;
51672
+ }
51673
+ case 4: {
51674
+ if (tag !== 34) {
51675
+ break;
51676
+ }
51677
+ message.tagNames.push(reader.string());
51678
+ continue;
51679
+ }
51680
+ case 5: {
51681
+ if (tag !== 42) {
51682
+ break;
51683
+ }
51684
+ message.environmentIds.push(reader.string());
51685
+ continue;
51686
+ }
51687
+ case 6: {
51688
+ if (tag !== 50) {
51689
+ break;
51690
+ }
51691
+ message.appIds.push(reader.string());
50838
51692
  continue;
50839
51693
  }
50840
51694
  }
@@ -50847,41 +51701,132 @@ var WorkspaceBillingReportItem_CostByResourceEntry = {
50847
51701
  },
50848
51702
  fromJSON(object) {
50849
51703
  return {
50850
- key: isSet5(object.key) ? globalThis.String(object.key) : "",
50851
- value: isSet5(object.value) ? globalThis.String(object.value) : ""
51704
+ startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
51705
+ endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
51706
+ resolution: isSet5(object.resolution) ? globalThis.String(object.resolution) : "",
51707
+ tagNames: globalThis.Array.isArray(object?.tagNames) ? object.tagNames.map((e) => globalThis.String(e)) : [],
51708
+ environmentIds: globalThis.Array.isArray(object?.environmentIds) ? object.environmentIds.map((e) => globalThis.String(e)) : [],
51709
+ appIds: globalThis.Array.isArray(object?.appIds) ? object.appIds.map((e) => globalThis.String(e)) : []
50852
51710
  };
50853
51711
  },
50854
51712
  toJSON(message) {
50855
51713
  const obj = {};
50856
- if (message.key !== "") {
50857
- obj.key = message.key;
51714
+ if (message.startTimestamp !== void 0) {
51715
+ obj.startTimestamp = message.startTimestamp.toISOString();
50858
51716
  }
50859
- if (message.value !== "") {
50860
- obj.value = message.value;
51717
+ if (message.endTimestamp !== void 0) {
51718
+ obj.endTimestamp = message.endTimestamp.toISOString();
51719
+ }
51720
+ if (message.resolution !== "") {
51721
+ obj.resolution = message.resolution;
51722
+ }
51723
+ if (message.tagNames?.length) {
51724
+ obj.tagNames = message.tagNames;
51725
+ }
51726
+ if (message.environmentIds?.length) {
51727
+ obj.environmentIds = message.environmentIds;
51728
+ }
51729
+ if (message.appIds?.length) {
51730
+ obj.appIds = message.appIds;
50861
51731
  }
50862
51732
  return obj;
50863
51733
  },
50864
51734
  create(base) {
50865
- return WorkspaceBillingReportItem_CostByResourceEntry.fromPartial(base ?? {});
51735
+ return WorkspaceBillingReportRequest.fromPartial(base ?? {});
50866
51736
  },
50867
51737
  fromPartial(object) {
50868
- const message = createBaseWorkspaceBillingReportItem_CostByResourceEntry();
50869
- message.key = object.key ?? "";
50870
- message.value = object.value ?? "";
51738
+ const message = createBaseWorkspaceBillingReportRequest();
51739
+ message.startTimestamp = object.startTimestamp ?? void 0;
51740
+ message.endTimestamp = object.endTimestamp ?? void 0;
51741
+ message.resolution = object.resolution ?? "";
51742
+ message.tagNames = object.tagNames?.map((e) => e) || [];
51743
+ message.environmentIds = object.environmentIds?.map((e) => e) || [];
51744
+ message.appIds = object.appIds?.map((e) => e) || [];
50871
51745
  return message;
50872
51746
  }
50873
51747
  };
50874
- function createBaseWorkspaceBillingReportRequest() {
51748
+ function createBaseWorkspaceBillingSummaryRequest() {
51749
+ return { startTimestamp: void 0, endTimestamp: void 0 };
51750
+ }
51751
+ var WorkspaceBillingSummaryRequest = {
51752
+ encode(message, writer = new BinaryWriter()) {
51753
+ if (message.startTimestamp !== void 0) {
51754
+ Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
51755
+ }
51756
+ if (message.endTimestamp !== void 0) {
51757
+ Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
51758
+ }
51759
+ return writer;
51760
+ },
51761
+ decode(input, length) {
51762
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
51763
+ let end = length === void 0 ? reader.len : reader.pos + length;
51764
+ const message = createBaseWorkspaceBillingSummaryRequest();
51765
+ while (reader.pos < end) {
51766
+ const tag = reader.uint32();
51767
+ switch (tag >>> 3) {
51768
+ case 1: {
51769
+ if (tag !== 10) {
51770
+ break;
51771
+ }
51772
+ message.startTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
51773
+ continue;
51774
+ }
51775
+ case 2: {
51776
+ if (tag !== 18) {
51777
+ break;
51778
+ }
51779
+ message.endTimestamp = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
51780
+ continue;
51781
+ }
51782
+ }
51783
+ if ((tag & 7) === 4 || tag === 0) {
51784
+ break;
51785
+ }
51786
+ reader.skip(tag & 7);
51787
+ }
51788
+ return message;
51789
+ },
51790
+ fromJSON(object) {
51791
+ return {
51792
+ startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
51793
+ endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0
51794
+ };
51795
+ },
51796
+ toJSON(message) {
51797
+ const obj = {};
51798
+ if (message.startTimestamp !== void 0) {
51799
+ obj.startTimestamp = message.startTimestamp.toISOString();
51800
+ }
51801
+ if (message.endTimestamp !== void 0) {
51802
+ obj.endTimestamp = message.endTimestamp.toISOString();
51803
+ }
51804
+ return obj;
51805
+ },
51806
+ create(base) {
51807
+ return WorkspaceBillingSummaryRequest.fromPartial(base ?? {});
51808
+ },
51809
+ fromPartial(object) {
51810
+ const message = createBaseWorkspaceBillingSummaryRequest();
51811
+ message.startTimestamp = object.startTimestamp ?? void 0;
51812
+ message.endTimestamp = object.endTimestamp ?? void 0;
51813
+ return message;
51814
+ }
51815
+ };
51816
+ function createBaseWorkspaceBillingSummaryResponse() {
50875
51817
  return {
50876
51818
  startTimestamp: void 0,
50877
51819
  endTimestamp: void 0,
50878
- resolution: "",
50879
- tagNames: [],
50880
- environmentIds: [],
50881
- appIds: []
51820
+ meteredCost: "",
51821
+ planCost: "",
51822
+ creditsApplied: "",
51823
+ reservationsDiscount: "",
51824
+ volumesDiscount: "",
51825
+ billedCost: "",
51826
+ meteredCostBreakdown: {}
50882
51827
  };
50883
51828
  }
50884
- var WorkspaceBillingReportRequest = {
51829
+ var WorkspaceBillingSummaryResponse = {
50885
51830
  encode(message, writer = new BinaryWriter()) {
50886
51831
  if (message.startTimestamp !== void 0) {
50887
51832
  Timestamp.encode(toTimestamp(message.startTimestamp), writer.uint32(10).fork()).join();
@@ -50889,24 +51834,36 @@ var WorkspaceBillingReportRequest = {
50889
51834
  if (message.endTimestamp !== void 0) {
50890
51835
  Timestamp.encode(toTimestamp(message.endTimestamp), writer.uint32(18).fork()).join();
50891
51836
  }
50892
- if (message.resolution !== "") {
50893
- writer.uint32(26).string(message.resolution);
51837
+ if (message.meteredCost !== "") {
51838
+ writer.uint32(26).string(message.meteredCost);
50894
51839
  }
50895
- for (const v of message.tagNames) {
50896
- writer.uint32(34).string(v);
51840
+ if (message.planCost !== "") {
51841
+ writer.uint32(34).string(message.planCost);
50897
51842
  }
50898
- for (const v of message.environmentIds) {
50899
- writer.uint32(42).string(v);
51843
+ if (message.creditsApplied !== "") {
51844
+ writer.uint32(42).string(message.creditsApplied);
50900
51845
  }
50901
- for (const v of message.appIds) {
50902
- writer.uint32(50).string(v);
51846
+ if (message.reservationsDiscount !== "") {
51847
+ writer.uint32(50).string(message.reservationsDiscount);
51848
+ }
51849
+ if (message.volumesDiscount !== "") {
51850
+ writer.uint32(58).string(message.volumesDiscount);
51851
+ }
51852
+ if (message.billedCost !== "") {
51853
+ writer.uint32(66).string(message.billedCost);
50903
51854
  }
51855
+ Object.entries(message.meteredCostBreakdown).forEach(([key, value]) => {
51856
+ WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.encode(
51857
+ { key, value },
51858
+ writer.uint32(74).fork()
51859
+ ).join();
51860
+ });
50904
51861
  return writer;
50905
51862
  },
50906
51863
  decode(input, length) {
50907
51864
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
50908
51865
  let end = length === void 0 ? reader.len : reader.pos + length;
50909
- const message = createBaseWorkspaceBillingReportRequest();
51866
+ const message = createBaseWorkspaceBillingSummaryResponse();
50910
51867
  while (reader.pos < end) {
50911
51868
  const tag = reader.uint32();
50912
51869
  switch (tag >>> 3) {
@@ -50928,28 +51885,52 @@ var WorkspaceBillingReportRequest = {
50928
51885
  if (tag !== 26) {
50929
51886
  break;
50930
51887
  }
50931
- message.resolution = reader.string();
51888
+ message.meteredCost = reader.string();
50932
51889
  continue;
50933
51890
  }
50934
51891
  case 4: {
50935
51892
  if (tag !== 34) {
50936
51893
  break;
50937
51894
  }
50938
- message.tagNames.push(reader.string());
51895
+ message.planCost = reader.string();
50939
51896
  continue;
50940
51897
  }
50941
51898
  case 5: {
50942
51899
  if (tag !== 42) {
50943
51900
  break;
50944
51901
  }
50945
- message.environmentIds.push(reader.string());
51902
+ message.creditsApplied = reader.string();
50946
51903
  continue;
50947
51904
  }
50948
51905
  case 6: {
50949
51906
  if (tag !== 50) {
50950
51907
  break;
50951
51908
  }
50952
- message.appIds.push(reader.string());
51909
+ message.reservationsDiscount = reader.string();
51910
+ continue;
51911
+ }
51912
+ case 7: {
51913
+ if (tag !== 58) {
51914
+ break;
51915
+ }
51916
+ message.volumesDiscount = reader.string();
51917
+ continue;
51918
+ }
51919
+ case 8: {
51920
+ if (tag !== 66) {
51921
+ break;
51922
+ }
51923
+ message.billedCost = reader.string();
51924
+ continue;
51925
+ }
51926
+ case 9: {
51927
+ if (tag !== 74) {
51928
+ break;
51929
+ }
51930
+ const entry9 = WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.decode(reader, reader.uint32());
51931
+ if (entry9.value !== void 0) {
51932
+ message.meteredCostBreakdown[entry9.key] = entry9.value;
51933
+ }
50953
51934
  continue;
50954
51935
  }
50955
51936
  }
@@ -50964,10 +51945,16 @@ var WorkspaceBillingReportRequest = {
50964
51945
  return {
50965
51946
  startTimestamp: isSet5(object.startTimestamp) ? fromJsonTimestamp(object.startTimestamp) : void 0,
50966
51947
  endTimestamp: isSet5(object.endTimestamp) ? fromJsonTimestamp(object.endTimestamp) : void 0,
50967
- resolution: isSet5(object.resolution) ? globalThis.String(object.resolution) : "",
50968
- tagNames: globalThis.Array.isArray(object?.tagNames) ? object.tagNames.map((e) => globalThis.String(e)) : [],
50969
- environmentIds: globalThis.Array.isArray(object?.environmentIds) ? object.environmentIds.map((e) => globalThis.String(e)) : [],
50970
- appIds: globalThis.Array.isArray(object?.appIds) ? object.appIds.map((e) => globalThis.String(e)) : []
51948
+ meteredCost: isSet5(object.meteredCost) ? globalThis.String(object.meteredCost) : "",
51949
+ planCost: isSet5(object.planCost) ? globalThis.String(object.planCost) : "",
51950
+ creditsApplied: isSet5(object.creditsApplied) ? globalThis.String(object.creditsApplied) : "",
51951
+ reservationsDiscount: isSet5(object.reservationsDiscount) ? globalThis.String(object.reservationsDiscount) : "",
51952
+ volumesDiscount: isSet5(object.volumesDiscount) ? globalThis.String(object.volumesDiscount) : "",
51953
+ billedCost: isSet5(object.billedCost) ? globalThis.String(object.billedCost) : "",
51954
+ meteredCostBreakdown: isObject2(object.meteredCostBreakdown) ? Object.entries(object.meteredCostBreakdown).reduce((acc, [key, value]) => {
51955
+ acc[key] = String(value);
51956
+ return acc;
51957
+ }, {}) : {}
50971
51958
  };
50972
51959
  },
50973
51960
  toJSON(message) {
@@ -50978,31 +51965,125 @@ var WorkspaceBillingReportRequest = {
50978
51965
  if (message.endTimestamp !== void 0) {
50979
51966
  obj.endTimestamp = message.endTimestamp.toISOString();
50980
51967
  }
50981
- if (message.resolution !== "") {
50982
- obj.resolution = message.resolution;
51968
+ if (message.meteredCost !== "") {
51969
+ obj.meteredCost = message.meteredCost;
50983
51970
  }
50984
- if (message.tagNames?.length) {
50985
- obj.tagNames = message.tagNames;
51971
+ if (message.planCost !== "") {
51972
+ obj.planCost = message.planCost;
50986
51973
  }
50987
- if (message.environmentIds?.length) {
50988
- obj.environmentIds = message.environmentIds;
51974
+ if (message.creditsApplied !== "") {
51975
+ obj.creditsApplied = message.creditsApplied;
50989
51976
  }
50990
- if (message.appIds?.length) {
50991
- obj.appIds = message.appIds;
51977
+ if (message.reservationsDiscount !== "") {
51978
+ obj.reservationsDiscount = message.reservationsDiscount;
51979
+ }
51980
+ if (message.volumesDiscount !== "") {
51981
+ obj.volumesDiscount = message.volumesDiscount;
51982
+ }
51983
+ if (message.billedCost !== "") {
51984
+ obj.billedCost = message.billedCost;
51985
+ }
51986
+ if (message.meteredCostBreakdown) {
51987
+ const entries = Object.entries(message.meteredCostBreakdown);
51988
+ if (entries.length > 0) {
51989
+ obj.meteredCostBreakdown = {};
51990
+ entries.forEach(([k, v]) => {
51991
+ obj.meteredCostBreakdown[k] = v;
51992
+ });
51993
+ }
50992
51994
  }
50993
51995
  return obj;
50994
51996
  },
50995
51997
  create(base) {
50996
- return WorkspaceBillingReportRequest.fromPartial(base ?? {});
51998
+ return WorkspaceBillingSummaryResponse.fromPartial(base ?? {});
50997
51999
  },
50998
52000
  fromPartial(object) {
50999
- const message = createBaseWorkspaceBillingReportRequest();
52001
+ const message = createBaseWorkspaceBillingSummaryResponse();
51000
52002
  message.startTimestamp = object.startTimestamp ?? void 0;
51001
52003
  message.endTimestamp = object.endTimestamp ?? void 0;
51002
- message.resolution = object.resolution ?? "";
51003
- message.tagNames = object.tagNames?.map((e) => e) || [];
51004
- message.environmentIds = object.environmentIds?.map((e) => e) || [];
51005
- message.appIds = object.appIds?.map((e) => e) || [];
52004
+ message.meteredCost = object.meteredCost ?? "";
52005
+ message.planCost = object.planCost ?? "";
52006
+ message.creditsApplied = object.creditsApplied ?? "";
52007
+ message.reservationsDiscount = object.reservationsDiscount ?? "";
52008
+ message.volumesDiscount = object.volumesDiscount ?? "";
52009
+ message.billedCost = object.billedCost ?? "";
52010
+ message.meteredCostBreakdown = Object.entries(object.meteredCostBreakdown ?? {}).reduce(
52011
+ (acc, [key, value]) => {
52012
+ if (value !== void 0) {
52013
+ acc[key] = globalThis.String(value);
52014
+ }
52015
+ return acc;
52016
+ },
52017
+ {}
52018
+ );
52019
+ return message;
52020
+ }
52021
+ };
52022
+ function createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry() {
52023
+ return { key: "", value: "" };
52024
+ }
52025
+ var WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry = {
52026
+ encode(message, writer = new BinaryWriter()) {
52027
+ if (message.key !== "") {
52028
+ writer.uint32(10).string(message.key);
52029
+ }
52030
+ if (message.value !== "") {
52031
+ writer.uint32(18).string(message.value);
52032
+ }
52033
+ return writer;
52034
+ },
52035
+ decode(input, length) {
52036
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52037
+ let end = length === void 0 ? reader.len : reader.pos + length;
52038
+ const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
52039
+ while (reader.pos < end) {
52040
+ const tag = reader.uint32();
52041
+ switch (tag >>> 3) {
52042
+ case 1: {
52043
+ if (tag !== 10) {
52044
+ break;
52045
+ }
52046
+ message.key = reader.string();
52047
+ continue;
52048
+ }
52049
+ case 2: {
52050
+ if (tag !== 18) {
52051
+ break;
52052
+ }
52053
+ message.value = reader.string();
52054
+ continue;
52055
+ }
52056
+ }
52057
+ if ((tag & 7) === 4 || tag === 0) {
52058
+ break;
52059
+ }
52060
+ reader.skip(tag & 7);
52061
+ }
52062
+ return message;
52063
+ },
52064
+ fromJSON(object) {
52065
+ return {
52066
+ key: isSet5(object.key) ? globalThis.String(object.key) : "",
52067
+ value: isSet5(object.value) ? globalThis.String(object.value) : ""
52068
+ };
52069
+ },
52070
+ toJSON(message) {
52071
+ const obj = {};
52072
+ if (message.key !== "") {
52073
+ obj.key = message.key;
52074
+ }
52075
+ if (message.value !== "") {
52076
+ obj.value = message.value;
52077
+ }
52078
+ return obj;
52079
+ },
52080
+ create(base) {
52081
+ return WorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry.fromPartial(base ?? {});
52082
+ },
52083
+ fromPartial(object) {
52084
+ const message = createBaseWorkspaceBillingSummaryResponse_MeteredCostBreakdownEntry();
52085
+ message.key = object.key ?? "";
52086
+ message.value = object.value ?? "";
51006
52087
  return message;
51007
52088
  }
51008
52089
  };
@@ -51444,6 +52525,231 @@ var WorkspaceNameLookupResponse = {
51444
52525
  return message;
51445
52526
  }
51446
52527
  };
52528
+ function createBaseWorkspaceSetDefaultEnvironmentRequest() {
52529
+ return { environmentName: "" };
52530
+ }
52531
+ var WorkspaceSetDefaultEnvironmentRequest = {
52532
+ encode(message, writer = new BinaryWriter()) {
52533
+ if (message.environmentName !== "") {
52534
+ writer.uint32(10).string(message.environmentName);
52535
+ }
52536
+ return writer;
52537
+ },
52538
+ decode(input, length) {
52539
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52540
+ let end = length === void 0 ? reader.len : reader.pos + length;
52541
+ const message = createBaseWorkspaceSetDefaultEnvironmentRequest();
52542
+ while (reader.pos < end) {
52543
+ const tag = reader.uint32();
52544
+ switch (tag >>> 3) {
52545
+ case 1: {
52546
+ if (tag !== 10) {
52547
+ break;
52548
+ }
52549
+ message.environmentName = reader.string();
52550
+ continue;
52551
+ }
52552
+ }
52553
+ if ((tag & 7) === 4 || tag === 0) {
52554
+ break;
52555
+ }
52556
+ reader.skip(tag & 7);
52557
+ }
52558
+ return message;
52559
+ },
52560
+ fromJSON(object) {
52561
+ return { environmentName: isSet5(object.environmentName) ? globalThis.String(object.environmentName) : "" };
52562
+ },
52563
+ toJSON(message) {
52564
+ const obj = {};
52565
+ if (message.environmentName !== "") {
52566
+ obj.environmentName = message.environmentName;
52567
+ }
52568
+ return obj;
52569
+ },
52570
+ create(base) {
52571
+ return WorkspaceSetDefaultEnvironmentRequest.fromPartial(base ?? {});
52572
+ },
52573
+ fromPartial(object) {
52574
+ const message = createBaseWorkspaceSetDefaultEnvironmentRequest();
52575
+ message.environmentName = object.environmentName ?? "";
52576
+ return message;
52577
+ }
52578
+ };
52579
+ function createBaseWorkspaceSetImageBuilderVersionRequest() {
52580
+ return { newImageBuilderVersion: "" };
52581
+ }
52582
+ var WorkspaceSetImageBuilderVersionRequest = {
52583
+ encode(message, writer = new BinaryWriter()) {
52584
+ if (message.newImageBuilderVersion !== "") {
52585
+ writer.uint32(10).string(message.newImageBuilderVersion);
52586
+ }
52587
+ return writer;
52588
+ },
52589
+ decode(input, length) {
52590
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52591
+ let end = length === void 0 ? reader.len : reader.pos + length;
52592
+ const message = createBaseWorkspaceSetImageBuilderVersionRequest();
52593
+ while (reader.pos < end) {
52594
+ const tag = reader.uint32();
52595
+ switch (tag >>> 3) {
52596
+ case 1: {
52597
+ if (tag !== 10) {
52598
+ break;
52599
+ }
52600
+ message.newImageBuilderVersion = reader.string();
52601
+ continue;
52602
+ }
52603
+ }
52604
+ if ((tag & 7) === 4 || tag === 0) {
52605
+ break;
52606
+ }
52607
+ reader.skip(tag & 7);
52608
+ }
52609
+ return message;
52610
+ },
52611
+ fromJSON(object) {
52612
+ return {
52613
+ newImageBuilderVersion: isSet5(object.newImageBuilderVersion) ? globalThis.String(object.newImageBuilderVersion) : ""
52614
+ };
52615
+ },
52616
+ toJSON(message) {
52617
+ const obj = {};
52618
+ if (message.newImageBuilderVersion !== "") {
52619
+ obj.newImageBuilderVersion = message.newImageBuilderVersion;
52620
+ }
52621
+ return obj;
52622
+ },
52623
+ create(base) {
52624
+ return WorkspaceSetImageBuilderVersionRequest.fromPartial(base ?? {});
52625
+ },
52626
+ fromPartial(object) {
52627
+ const message = createBaseWorkspaceSetImageBuilderVersionRequest();
52628
+ message.newImageBuilderVersion = object.newImageBuilderVersion ?? "";
52629
+ return message;
52630
+ }
52631
+ };
52632
+ function createBaseWorkspaceSetImageBuilderVersionResponse() {
52633
+ return { imageBuilderVersion: "" };
52634
+ }
52635
+ var WorkspaceSetImageBuilderVersionResponse = {
52636
+ encode(message, writer = new BinaryWriter()) {
52637
+ if (message.imageBuilderVersion !== "") {
52638
+ writer.uint32(10).string(message.imageBuilderVersion);
52639
+ }
52640
+ return writer;
52641
+ },
52642
+ decode(input, length) {
52643
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52644
+ let end = length === void 0 ? reader.len : reader.pos + length;
52645
+ const message = createBaseWorkspaceSetImageBuilderVersionResponse();
52646
+ while (reader.pos < end) {
52647
+ const tag = reader.uint32();
52648
+ switch (tag >>> 3) {
52649
+ case 1: {
52650
+ if (tag !== 10) {
52651
+ break;
52652
+ }
52653
+ message.imageBuilderVersion = reader.string();
52654
+ continue;
52655
+ }
52656
+ }
52657
+ if ((tag & 7) === 4 || tag === 0) {
52658
+ break;
52659
+ }
52660
+ reader.skip(tag & 7);
52661
+ }
52662
+ return message;
52663
+ },
52664
+ fromJSON(object) {
52665
+ return {
52666
+ imageBuilderVersion: isSet5(object.imageBuilderVersion) ? globalThis.String(object.imageBuilderVersion) : ""
52667
+ };
52668
+ },
52669
+ toJSON(message) {
52670
+ const obj = {};
52671
+ if (message.imageBuilderVersion !== "") {
52672
+ obj.imageBuilderVersion = message.imageBuilderVersion;
52673
+ }
52674
+ return obj;
52675
+ },
52676
+ create(base) {
52677
+ return WorkspaceSetImageBuilderVersionResponse.fromPartial(base ?? {});
52678
+ },
52679
+ fromPartial(object) {
52680
+ const message = createBaseWorkspaceSetImageBuilderVersionResponse();
52681
+ message.imageBuilderVersion = object.imageBuilderVersion ?? "";
52682
+ return message;
52683
+ }
52684
+ };
52685
+ function createBaseWorkspaceSettingsResponse() {
52686
+ return { defaultEnvironmentName: "", imageBuilderVersion: "" };
52687
+ }
52688
+ var WorkspaceSettingsResponse = {
52689
+ encode(message, writer = new BinaryWriter()) {
52690
+ if (message.defaultEnvironmentName !== "") {
52691
+ writer.uint32(10).string(message.defaultEnvironmentName);
52692
+ }
52693
+ if (message.imageBuilderVersion !== "") {
52694
+ writer.uint32(18).string(message.imageBuilderVersion);
52695
+ }
52696
+ return writer;
52697
+ },
52698
+ decode(input, length) {
52699
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
52700
+ let end = length === void 0 ? reader.len : reader.pos + length;
52701
+ const message = createBaseWorkspaceSettingsResponse();
52702
+ while (reader.pos < end) {
52703
+ const tag = reader.uint32();
52704
+ switch (tag >>> 3) {
52705
+ case 1: {
52706
+ if (tag !== 10) {
52707
+ break;
52708
+ }
52709
+ message.defaultEnvironmentName = reader.string();
52710
+ continue;
52711
+ }
52712
+ case 2: {
52713
+ if (tag !== 18) {
52714
+ break;
52715
+ }
52716
+ message.imageBuilderVersion = reader.string();
52717
+ continue;
52718
+ }
52719
+ }
52720
+ if ((tag & 7) === 4 || tag === 0) {
52721
+ break;
52722
+ }
52723
+ reader.skip(tag & 7);
52724
+ }
52725
+ return message;
52726
+ },
52727
+ fromJSON(object) {
52728
+ return {
52729
+ defaultEnvironmentName: isSet5(object.defaultEnvironmentName) ? globalThis.String(object.defaultEnvironmentName) : "",
52730
+ imageBuilderVersion: isSet5(object.imageBuilderVersion) ? globalThis.String(object.imageBuilderVersion) : ""
52731
+ };
52732
+ },
52733
+ toJSON(message) {
52734
+ const obj = {};
52735
+ if (message.defaultEnvironmentName !== "") {
52736
+ obj.defaultEnvironmentName = message.defaultEnvironmentName;
52737
+ }
52738
+ if (message.imageBuilderVersion !== "") {
52739
+ obj.imageBuilderVersion = message.imageBuilderVersion;
52740
+ }
52741
+ return obj;
52742
+ },
52743
+ create(base) {
52744
+ return WorkspaceSettingsResponse.fromPartial(base ?? {});
52745
+ },
52746
+ fromPartial(object) {
52747
+ const message = createBaseWorkspaceSettingsResponse();
52748
+ message.defaultEnvironmentName = object.defaultEnvironmentName ?? "";
52749
+ message.imageBuilderVersion = object.imageBuilderVersion ?? "";
52750
+ return message;
52751
+ }
52752
+ };
51447
52753
  var ModalClientDefinition = {
51448
52754
  name: "ModalClient",
51449
52755
  fullName: "modal.client.ModalClient",
@@ -51808,6 +53114,14 @@ var ModalClientDefinition = {
51808
53114
  responseStream: false,
51809
53115
  options: {}
51810
53116
  },
53117
+ containerServerLifecycleReady: {
53118
+ name: "ContainerServerLifecycleReady",
53119
+ requestType: ContainerServerLifecycleReadyRequest,
53120
+ requestStream: false,
53121
+ responseType: Empty,
53122
+ responseStream: false,
53123
+ options: {}
53124
+ },
51811
53125
  containerStop: {
51812
53126
  name: "ContainerStop",
51813
53127
  requestType: ContainerStopRequest,
@@ -51989,6 +53303,14 @@ var ModalClientDefinition = {
51989
53303
  options: {}
51990
53304
  },
51991
53305
  /** Environments */
53306
+ environmentBillingSummary: {
53307
+ name: "EnvironmentBillingSummary",
53308
+ requestType: EnvironmentBillingSummaryRequest,
53309
+ requestStream: false,
53310
+ responseType: EnvironmentBillingSummaryResponse,
53311
+ responseStream: false,
53312
+ options: {}
53313
+ },
51992
53314
  environmentCreate: {
51993
53315
  name: "EnvironmentCreate",
51994
53316
  requestType: EnvironmentCreateRequest,
@@ -52390,6 +53712,14 @@ var ModalClientDefinition = {
52390
53712
  options: {}
52391
53713
  },
52392
53714
  /** Mounts */
53715
+ mountBatchedCheckExistence: {
53716
+ name: "MountBatchedCheckExistence",
53717
+ requestType: MountBatchedCheckExistenceRequest,
53718
+ requestStream: false,
53719
+ responseType: MountBatchedCheckExistenceResponse,
53720
+ responseStream: false,
53721
+ options: {}
53722
+ },
52393
53723
  mountGetOrCreate: {
52394
53724
  name: "MountGetOrCreate",
52395
53725
  requestType: MountGetOrCreateRequest,
@@ -52594,6 +53924,14 @@ var ModalClientDefinition = {
52594
53924
  responseStream: false,
52595
53925
  options: {}
52596
53926
  },
53927
+ sandboxGetFromNameV2: {
53928
+ name: "SandboxGetFromNameV2",
53929
+ requestType: SandboxGetFromNameRequest,
53930
+ requestStream: false,
53931
+ responseType: SandboxGetFromNameResponse,
53932
+ responseStream: false,
53933
+ options: {}
53934
+ },
52597
53935
  sandboxGetLogs: {
52598
53936
  name: "SandboxGetLogs",
52599
53937
  requestType: SandboxGetLogsRequest,
@@ -52731,6 +54069,14 @@ var ModalClientDefinition = {
52731
54069
  responseStream: false,
52732
54070
  options: {}
52733
54071
  },
54072
+ sandboxTagsGetV2: {
54073
+ name: "SandboxTagsGetV2",
54074
+ requestType: SandboxTagsGetRequest,
54075
+ requestStream: false,
54076
+ responseType: SandboxTagsGetResponse,
54077
+ responseStream: false,
54078
+ options: {}
54079
+ },
52734
54080
  sandboxTagsSet: {
52735
54081
  name: "SandboxTagsSet",
52736
54082
  requestType: SandboxTagsSetRequest,
@@ -52739,6 +54085,14 @@ var ModalClientDefinition = {
52739
54085
  responseStream: false,
52740
54086
  options: {}
52741
54087
  },
54088
+ sandboxTagsSetV2: {
54089
+ name: "SandboxTagsSetV2",
54090
+ requestType: SandboxTagsSetRequest,
54091
+ requestStream: false,
54092
+ responseType: Empty,
54093
+ responseStream: false,
54094
+ options: {}
54095
+ },
52742
54096
  sandboxTerminate: {
52743
54097
  name: "SandboxTerminate",
52744
54098
  requestType: SandboxTerminateRequest,
@@ -53205,6 +54559,14 @@ var ModalClientDefinition = {
53205
54559
  responseStream: true,
53206
54560
  options: {}
53207
54561
  },
54562
+ workspaceBillingSummary: {
54563
+ name: "WorkspaceBillingSummary",
54564
+ requestType: WorkspaceBillingSummaryRequest,
54565
+ requestStream: false,
54566
+ responseType: WorkspaceBillingSummaryResponse,
54567
+ responseStream: false,
54568
+ options: {}
54569
+ },
53208
54570
  workspaceDashboardUrlGet: {
53209
54571
  name: "WorkspaceDashboardUrlGet",
53210
54572
  requestType: WorkspaceDashboardUrlRequest,
@@ -53228,6 +54590,30 @@ var ModalClientDefinition = {
53228
54590
  responseType: WorkspaceNameLookupResponse,
53229
54591
  responseStream: false,
53230
54592
  options: {}
54593
+ },
54594
+ workspaceSetDefaultEnvironment: {
54595
+ name: "WorkspaceSetDefaultEnvironment",
54596
+ requestType: WorkspaceSetDefaultEnvironmentRequest,
54597
+ requestStream: false,
54598
+ responseType: Empty,
54599
+ responseStream: false,
54600
+ options: {}
54601
+ },
54602
+ workspaceSetImageBuilderVersion: {
54603
+ name: "WorkspaceSetImageBuilderVersion",
54604
+ requestType: WorkspaceSetImageBuilderVersionRequest,
54605
+ requestStream: false,
54606
+ responseType: WorkspaceSetImageBuilderVersionResponse,
54607
+ responseStream: false,
54608
+ options: {}
54609
+ },
54610
+ workspaceSettings: {
54611
+ name: "WorkspaceSettings",
54612
+ requestType: Empty,
54613
+ requestStream: false,
54614
+ responseType: WorkspaceSettingsResponse,
54615
+ responseStream: false,
54616
+ options: {}
53231
54617
  }
53232
54618
  }
53233
54619
  };
@@ -53819,6 +55205,16 @@ var import_nice_grpc4 = require("nice-grpc");
53819
55205
 
53820
55206
  // src/secret.ts
53821
55207
  var import_nice_grpc2 = require("nice-grpc");
55208
+ var ENV_VAR_KEY_REGEX = /^[a-zA-Z_][a-zA-Z0-9_]*$/;
55209
+ function validateEnvVarKeys(env) {
55210
+ for (const key of Object.keys(env)) {
55211
+ if (!ENV_VAR_KEY_REGEX.test(key)) {
55212
+ throw new InvalidError(
55213
+ `Secret key name ${JSON.stringify(key)} is invalid for environment variables. Only letters, numbers, and underscores are allowed, and the name may not start with a number.`
55214
+ );
55215
+ }
55216
+ }
55217
+ }
53822
55218
  var SecretService = class {
53823
55219
  #client;
53824
55220
  constructor(client) {
@@ -53848,7 +55244,16 @@ var SecretService = class {
53848
55244
  throw err;
53849
55245
  }
53850
55246
  }
53851
- /** Create a {@link Secret} from a plain object of key-value pairs. */
55247
+ /**
55248
+ * Create a {@link Secret} from a plain object of key-value pairs.
55249
+ *
55250
+ * The returned Secret is lazy: no server-side Secret is created (and
55251
+ * {@link Secret#secretId secretId} stays empty) until it is first used. When
55252
+ * used with {@link Sandbox#exec Sandbox.exec()} or
55253
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()},
55254
+ * the values are sent directly to the worker as environment variables,
55255
+ * avoiding a `SecretGetOrCreate` round-trip entirely.
55256
+ */
53852
55257
  async fromObject(entries, params) {
53853
55258
  for (const [, value] of Object.entries(entries)) {
53854
55259
  if (value == null || typeof value !== "string") {
@@ -53857,23 +55262,14 @@ var SecretService = class {
53857
55262
  );
53858
55263
  }
53859
55264
  }
53860
- try {
53861
- const resp = await this.#client.cpClient.secretGetOrCreate({
53862
- objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
53863
- envDict: entries,
53864
- environmentName: this.#client.environmentName(params?.environment)
53865
- });
53866
- this.#client.logger.debug(
53867
- "Created ephemeral Secret",
53868
- "secret_id",
53869
- resp.secretId
53870
- );
53871
- return new Secret(resp.secretId);
53872
- } catch (err) {
53873
- if (err instanceof import_nice_grpc2.ClientError && (err.code === import_nice_grpc2.Status.INVALID_ARGUMENT || err.code === import_nice_grpc2.Status.FAILED_PRECONDITION))
53874
- throw new InvalidError(err.details);
53875
- throw err;
53876
- }
55265
+ validateEnvVarKeys(entries);
55266
+ const envDict = { ...entries };
55267
+ const environment = this.#client.environmentName(params?.environment);
55268
+ return new Secret(
55269
+ "",
55270
+ void 0,
55271
+ new SecretFromObjectHydrator(envDict, environment)
55272
+ );
53877
55273
  }
53878
55274
  /**
53879
55275
  * Delete a named {@link Secret}.
@@ -53904,15 +55300,98 @@ var SecretService = class {
53904
55300
  }
53905
55301
  }
53906
55302
  };
55303
+ var SecretFromObjectHydrator = class {
55304
+ envDict;
55305
+ #environment;
55306
+ constructor(envDict, environment) {
55307
+ this.envDict = envDict;
55308
+ this.#environment = environment;
55309
+ }
55310
+ async hydrate(client) {
55311
+ try {
55312
+ const resp = await client.cpClient.secretGetOrCreate({
55313
+ objectCreationType: 5 /* OBJECT_CREATION_TYPE_EPHEMERAL */,
55314
+ envDict: this.envDict,
55315
+ environmentName: this.#environment
55316
+ });
55317
+ client.logger.debug(
55318
+ "Created ephemeral Secret",
55319
+ "secret_id",
55320
+ resp.secretId
55321
+ );
55322
+ return resp.secretId;
55323
+ } catch (err) {
55324
+ if (err instanceof import_nice_grpc2.ClientError && (err.code === import_nice_grpc2.Status.INVALID_ARGUMENT || err.code === import_nice_grpc2.Status.FAILED_PRECONDITION))
55325
+ throw new InvalidError(err.details);
55326
+ throw err;
55327
+ }
55328
+ }
55329
+ };
53907
55330
  var Secret = class {
53908
- secretId;
55331
+ #secretId;
53909
55332
  name;
55333
+ // Resolves secretId lazily the first time it is needed. Undefined for Secrets
55334
+ // constructed already-hydrated (e.g. from fromName), and not consulted again
55335
+ // once secretId is set.
55336
+ #hydrator;
55337
+ // Caches the single in-flight (or successfully completed) hydration so the
55338
+ // ephemeral Secret is created at most once, even if multiple callers hydrate
55339
+ // the same Secret concurrently. Cleared on failure so a transient error
55340
+ // doesn't permanently break the Secret; subsequent calls can retry.
55341
+ #hydratePromise;
53910
55342
  /** @ignore */
53911
- constructor(secretId, name) {
53912
- this.secretId = secretId;
55343
+ constructor(secretId, name, hydrator) {
55344
+ this.#secretId = secretId;
53913
55345
  this.name = name;
55346
+ this.#hydrator = hydrator;
55347
+ }
55348
+ /** The ID of the server-side Secret, or an empty string if not yet hydrated. */
55349
+ get secretId() {
55350
+ return this.#secretId;
55351
+ }
55352
+ /**
55353
+ * The hydrator resolving a lazy Secret to a secretId, or `undefined` for
55354
+ * Secrets that already reference a server-side Secret (e.g. from fromName).
55355
+ *
55356
+ * @internal
55357
+ * @hidden
55358
+ */
55359
+ get _hydrator() {
55360
+ return this.#hydrator;
55361
+ }
55362
+ /**
55363
+ * Lazily create the ephemeral server-side Secret backing a fromObject Secret
55364
+ * and populate {@link Secret#secretId secretId}. A no-op once secretId is set
55365
+ * (e.g. for Secrets returned by fromName).
55366
+ *
55367
+ * @internal
55368
+ * @hidden
55369
+ */
55370
+ async _hydrate(client) {
55371
+ if (this.#secretId !== "" || this.#hydrator === void 0) {
55372
+ return;
55373
+ }
55374
+ if (this.#hydratePromise === void 0) {
55375
+ this.#hydratePromise = this.#doHydrate(client);
55376
+ }
55377
+ const promise = this.#hydratePromise;
55378
+ try {
55379
+ await promise;
55380
+ } catch (err) {
55381
+ if (this.#hydratePromise === promise) {
55382
+ this.#hydratePromise = void 0;
55383
+ }
55384
+ throw err;
55385
+ }
55386
+ }
55387
+ async #doHydrate(client) {
55388
+ this.#secretId = await this.#hydrator.hydrate(client);
53914
55389
  }
53915
55390
  };
55391
+ function secretEnvDictHydrator(secret) {
55392
+ const hydrator = secret?._hydrator;
55393
+ return hydrator instanceof SecretFromObjectHydrator ? hydrator : void 0;
55394
+ }
53916
55395
  async function mergeEnvIntoSecrets(client, env, secrets) {
53917
55396
  const result = [...secrets || []];
53918
55397
  if (env && Object.keys(env).length > 0) {
@@ -53920,6 +55399,38 @@ async function mergeEnvIntoSecrets(client, env, secrets) {
53920
55399
  }
53921
55400
  return result;
53922
55401
  }
55402
+ async function hydrateSecrets(client, secrets) {
55403
+ secrets.forEach((secret, i) => {
55404
+ if (secret == null) {
55405
+ throw new InvalidError(`secret at index ${i} must not be null`);
55406
+ }
55407
+ });
55408
+ await Promise.all(secrets.map((secret) => secret._hydrate(client)));
55409
+ }
55410
+ function collectSecretIds(secrets) {
55411
+ return secrets.map((secret, i) => {
55412
+ if (secret == null) {
55413
+ throw new InvalidError(`secret at index ${i} must not be null`);
55414
+ }
55415
+ if (secret.secretId === "") {
55416
+ throw new InvalidError(`secret at index ${i} has not been hydrated`);
55417
+ }
55418
+ return secret.secretId;
55419
+ });
55420
+ }
55421
+ function splitEnvDictAndResolvableSecrets(secrets) {
55422
+ const envDict = {};
55423
+ const resolvable = [];
55424
+ for (const secret of secrets) {
55425
+ const hydrator = secret != null ? secretEnvDictHydrator(secret) : void 0;
55426
+ if (hydrator !== void 0) {
55427
+ Object.assign(envDict, hydrator.envDict);
55428
+ } else {
55429
+ resolvable.push(secret);
55430
+ }
55431
+ }
55432
+ return [envDict, resolvable];
55433
+ }
53923
55434
 
53924
55435
  // src/volume.ts
53925
55436
  var import_nice_grpc3 = require("nice-grpc");
@@ -54179,7 +55690,8 @@ var FunctionService = class {
54179
55690
  const resp = await this.#client.cpClient.functionGet({
54180
55691
  appName,
54181
55692
  objectTag: name,
54182
- environmentName: this.#client.environmentName(params.environment)
55693
+ environmentName: this.#client.environmentName(params.environment),
55694
+ appVersion: params.version
54183
55695
  });
54184
55696
  this.#client.logger.debug(
54185
55697
  "Retrieved Function",
@@ -54302,7 +55814,8 @@ async function buildFunctionOptionsProto(options) {
54302
55814
  maxConcurrentInputs: o.maxConcurrentInputs,
54303
55815
  targetConcurrentInputs: o.targetConcurrentInputs,
54304
55816
  batchMaxSize: o.batchMaxSize,
54305
- batchLingerMs: o.batchWaitMs
55817
+ batchLingerMs: o.batchWaitMs,
55818
+ routingRegion: o.routingRegion
54306
55819
  });
54307
55820
  return functionOptions;
54308
55821
  }
@@ -54367,6 +55880,7 @@ async function bindParameters(client, functionId, options = {}, schema = [], par
54367
55880
  options?.env,
54368
55881
  options?.secrets
54369
55882
  );
55883
+ await hydrateSecrets(client, mergedSecrets);
54370
55884
  const mergedOptions = mergeServiceOptions(options, {
54371
55885
  secrets: mergedSecrets,
54372
55886
  env: void 0
@@ -54443,6 +55957,7 @@ var Function_ = class _Function_ {
54443
55957
  * and/or {@link Function_#withBatching withBatching}. */
54444
55958
  async instance() {
54445
55959
  let newFnId = this.functionId;
55960
+ let handleMetadata = this.#handleMetadata;
54446
55961
  if (this.#options != null && Object.entries(this.#options).length > 0) {
54447
55962
  const boundF = await bindParameters(
54448
55963
  this.#client,
@@ -54450,12 +55965,13 @@ var Function_ = class _Function_ {
54450
55965
  this.#options
54451
55966
  );
54452
55967
  newFnId = boundF.boundFunctionId;
55968
+ handleMetadata = boundF.handleMetadata;
54453
55969
  }
54454
55970
  return new _Function_(
54455
55971
  this.#client,
54456
55972
  newFnId,
54457
55973
  this.methodName,
54458
- this.#handleMetadata
55974
+ handleMetadata
54459
55975
  );
54460
55976
  }
54461
55977
  // Execute a single input into a remote Function.
@@ -54606,7 +56122,8 @@ var ClsService = class {
54606
56122
  const serviceFunction = await this.#client.cpClient.functionGet({
54607
56123
  appName,
54608
56124
  objectTag: serviceFunctionName,
54609
- environmentName: this.#client.environmentName(params.environment)
56125
+ environmentName: this.#client.environmentName(params.environment),
56126
+ appVersion: params.version
54610
56127
  });
54611
56128
  const parameterInfo = serviceFunction.handleMetadata?.classParameterInfo;
54612
56129
  const schema = parameterInfo?.schema ?? [];
@@ -54655,15 +56172,17 @@ var Cls = class _Cls {
54655
56172
  /** Create a new instance of the Cls with parameters and/or runtime options. */
54656
56173
  async instance(parameters = {}) {
54657
56174
  let functionId;
56175
+ let methodHandleMetadata;
54658
56176
  if (this.#schema.length === 0 && this.#serviceFunctionOptions === void 0) {
54659
56177
  functionId = this.#serviceFunctionId;
56178
+ methodHandleMetadata = this.#serviceFunctionMetadata.methodHandleMetadata;
54660
56179
  } else {
54661
- functionId = await this.#bindParameters(parameters);
56180
+ const bindResp = await this.#bindParameters(parameters);
56181
+ functionId = bindResp.boundFunctionId;
56182
+ methodHandleMetadata = bindResp.handleMetadata?.methodHandleMetadata ?? {};
54662
56183
  }
54663
56184
  const methods = /* @__PURE__ */ new Map();
54664
- for (const [name, methodMetadata] of Object.entries(
54665
- this.#serviceFunctionMetadata.methodHandleMetadata
54666
- )) {
56185
+ for (const [name, methodMetadata] of Object.entries(methodHandleMetadata)) {
54667
56186
  methods.set(
54668
56187
  name,
54669
56188
  new Function_(this.#client, functionId, name, methodMetadata)
@@ -54709,14 +56228,13 @@ var Cls = class _Cls {
54709
56228
  }
54710
56229
  /** Bind parameters to the Cls function. */
54711
56230
  async #bindParameters(parameters) {
54712
- const bindResp = await bindParameters(
56231
+ return await bindParameters(
54713
56232
  this.#client,
54714
56233
  this.#serviceFunctionId,
54715
56234
  this.#serviceFunctionOptions,
54716
56235
  this.#schema,
54717
56236
  parameters
54718
56237
  );
54719
- return bindResp.boundFunctionId;
54720
56238
  }
54721
56239
  };
54722
56240
  var ClsInstance = class {
@@ -55383,11 +56901,27 @@ var Queue = class _Queue {
55383
56901
  // src/image.ts
55384
56902
  var import_nice_grpc7 = require("nice-grpc");
55385
56903
  var import_nice_grpc8 = require("nice-grpc");
56904
+
56905
+ // src/name_utils.ts
56906
+ var OBJECT_NAME_CHARSET = /^[a-zA-Z0-9\-_.]+$/;
56907
+ var APP_ID_PATTERN = /^ap-[a-zA-Z0-9]{22}$/;
56908
+ function isValidObjectName(name) {
56909
+ return name.length <= 64 && OBJECT_NAME_CHARSET.test(name) && !APP_ID_PATTERN.test(name);
56910
+ }
56911
+ function checkObjectName(name, objectType) {
56912
+ if (!isValidObjectName(name)) {
56913
+ throw new InvalidError(
56914
+ `Invalid ${objectType} name: '${name}'.
56915
+
56916
+ Names may contain only alphanumeric characters, dashes, periods, and underscores, must be shorter than 64 characters, and cannot conflict with App ID strings.`
56917
+ );
56918
+ }
56919
+ }
56920
+
56921
+ // src/image.ts
55386
56922
  var DEFAULT_IMAGE_TAG = "latest";
55387
56923
  function validateImageName(name) {
55388
- if (name === "") {
55389
- throw new InvalidError("Image name must be non-empty.");
55390
- }
56924
+ checkObjectName(name, "Image");
55391
56925
  if (name.startsWith("im-")) {
55392
56926
  throw new InvalidError(
55393
56927
  "Image name cannot start with 'im-' (reserved for image IDs)."
@@ -55395,21 +56929,53 @@ function validateImageName(name) {
55395
56929
  }
55396
56930
  }
55397
56931
  function validateImageTag(tag) {
55398
- if (tag === "") {
55399
- throw new InvalidError("Image tag must be non-empty.");
55400
- }
56932
+ checkObjectName(tag, "Image tag");
55401
56933
  }
55402
56934
  function parseNamedImageRef(value) {
55403
56935
  const separatorIndex = value.indexOf(":");
56936
+ let imageName;
56937
+ let tag;
55404
56938
  if (separatorIndex === -1) {
55405
- validateImageName(value);
55406
- return `${value}:${DEFAULT_IMAGE_TAG}`;
56939
+ imageName = value;
56940
+ tag = DEFAULT_IMAGE_TAG;
56941
+ } else {
56942
+ imageName = value.slice(0, separatorIndex);
56943
+ tag = value.slice(separatorIndex + 1);
56944
+ }
56945
+ let prefix = "";
56946
+ const lastSlashIndex = imageName.lastIndexOf("/");
56947
+ if (lastSlashIndex !== -1) {
56948
+ prefix = imageName.slice(0, lastSlashIndex);
56949
+ const after = imageName.slice(lastSlashIndex + 1);
56950
+ if (prefix === "") {
56951
+ throw new InvalidError(
56952
+ "Invalid Image name: '/' prefix must be non-empty."
56953
+ );
56954
+ }
56955
+ if (after === "") {
56956
+ throw new InvalidError(
56957
+ "Invalid Image name: name after '/' must be non-empty."
56958
+ );
56959
+ }
56960
+ imageName = after;
55407
56961
  }
55408
- const name = value.slice(0, separatorIndex);
55409
- const tag = value.slice(separatorIndex + 1);
55410
- validateImageName(name);
56962
+ validateImageName(imageName);
55411
56963
  validateImageTag(tag);
55412
- return `${name}:${tag}`;
56964
+ const fullName = prefix ? `${prefix}/${imageName}` : imageName;
56965
+ return [prefix, `${fullName}:${tag}`];
56966
+ }
56967
+ function registryConfigBuilder(authType, secret) {
56968
+ return async (client) => {
56969
+ let secretId = "";
56970
+ if (secret) {
56971
+ await hydrateSecrets(client, [secret]);
56972
+ secretId = secret.secretId;
56973
+ }
56974
+ return ImageRegistryConfig.create({
56975
+ registryAuthType: authType,
56976
+ secretId
56977
+ });
56978
+ };
55413
56979
  }
55414
56980
  var ImageService = class {
55415
56981
  #client;
@@ -55441,10 +57007,21 @@ var ImageService = class {
55441
57007
  * @param params - Optional environment.
55442
57008
  */
55443
57009
  async fromName(name, params = {}) {
55444
- const tag = parseNamedImageRef(name);
57010
+ const [namespacePrefix, tag] = parseNamedImageRef(name);
57011
+ let environmentName;
57012
+ if (namespacePrefix) {
57013
+ if (params.environment) {
57014
+ throw new InvalidError(
57015
+ "Cannot specify 'environment' when the image name contains a '/'."
57016
+ );
57017
+ }
57018
+ environmentName = "";
57019
+ } else {
57020
+ environmentName = this.#client.environmentName(params.environment);
57021
+ }
55445
57022
  try {
55446
57023
  const resp = await this.#client.cpClient.imageGetByTag({
55447
- environmentName: this.#client.environmentName(params.environment),
57024
+ environmentName,
55448
57025
  tag
55449
57026
  });
55450
57027
  return new Image2(this.#client, resp.imageId, "");
@@ -55461,19 +57038,19 @@ var ImageService = class {
55461
57038
  * @param secret - Optional. A Secret containing credentials for registry authentication.
55462
57039
  */
55463
57040
  fromRegistry(tag, secret) {
55464
- let imageRegistryConfig;
57041
+ let buildRegistryConfig;
55465
57042
  if (secret) {
55466
57043
  if (!(secret instanceof Secret)) {
55467
57044
  throw new TypeError(
55468
57045
  "secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
55469
57046
  );
55470
57047
  }
55471
- imageRegistryConfig = {
55472
- registryAuthType: 4 /* REGISTRY_AUTH_TYPE_STATIC_CREDS */,
55473
- secretId: secret.secretId
55474
- };
57048
+ buildRegistryConfig = registryConfigBuilder(
57049
+ 4 /* REGISTRY_AUTH_TYPE_STATIC_CREDS */,
57050
+ secret
57051
+ );
55475
57052
  }
55476
- return new Image2(this.#client, "", tag, imageRegistryConfig);
57053
+ return new Image2(this.#client, "", tag, buildRegistryConfig);
55477
57054
  }
55478
57055
  /**
55479
57056
  * Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
@@ -55482,19 +57059,16 @@ var ImageService = class {
55482
57059
  * @param secret - A Secret containing credentials for registry authentication.
55483
57060
  */
55484
57061
  fromAwsEcr(tag, secret) {
55485
- let imageRegistryConfig;
55486
- if (secret) {
55487
- if (!(secret instanceof Secret)) {
55488
- throw new TypeError(
55489
- "secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
55490
- );
55491
- }
55492
- imageRegistryConfig = {
55493
- registryAuthType: 1 /* REGISTRY_AUTH_TYPE_AWS */,
55494
- secretId: secret.secretId
55495
- };
57062
+ if (!(secret instanceof Secret)) {
57063
+ throw new TypeError(
57064
+ "secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
57065
+ );
55496
57066
  }
55497
- return new Image2(this.#client, "", tag, imageRegistryConfig);
57067
+ const buildRegistryConfig = registryConfigBuilder(
57068
+ 1 /* REGISTRY_AUTH_TYPE_AWS */,
57069
+ secret
57070
+ );
57071
+ return new Image2(this.#client, "", tag, buildRegistryConfig);
55498
57072
  }
55499
57073
  /**
55500
57074
  * Creates an {@link Image} from a raw registry tag, optionally using a {@link Secret} for authentication.
@@ -55503,19 +57077,16 @@ var ImageService = class {
55503
57077
  * @param secret - A Secret containing credentials for registry authentication.
55504
57078
  */
55505
57079
  fromGcpArtifactRegistry(tag, secret) {
55506
- let imageRegistryConfig;
55507
- if (secret) {
55508
- if (!(secret instanceof Secret)) {
55509
- throw new TypeError(
55510
- "secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
55511
- );
55512
- }
55513
- imageRegistryConfig = {
55514
- registryAuthType: 2 /* REGISTRY_AUTH_TYPE_GCP */,
55515
- secretId: secret.secretId
55516
- };
57080
+ if (!(secret instanceof Secret)) {
57081
+ throw new TypeError(
57082
+ "secret must be a reference to an existing Secret, e.g. `await client.secrets.fromName('my_secret')`"
57083
+ );
55517
57084
  }
55518
- return new Image2(this.#client, "", tag, imageRegistryConfig);
57085
+ const buildRegistryConfig = registryConfigBuilder(
57086
+ 2 /* REGISTRY_AUTH_TYPE_GCP */,
57087
+ secret
57088
+ );
57089
+ return new Image2(this.#client, "", tag, buildRegistryConfig);
55519
57090
  }
55520
57091
  /**
55521
57092
  * Delete an {@link Image} by ID.
@@ -55545,15 +57116,18 @@ var Image2 = class _Image {
55545
57116
  #tag;
55546
57117
  // Image ID of the parent image layer to use as `FROM base`.
55547
57118
  #baseImageId;
55548
- #imageRegistryConfig;
57119
+ // When set, hydrates the registry-auth Secret (if any) and returns the
57120
+ // ImageRegistryConfig for the base build layer. Runs at build time, since the
57121
+ // Secret may be lazy. Undefined when not pulling from a private registry.
57122
+ #buildRegistryConfig;
55549
57123
  #layers;
55550
57124
  /** @ignore */
55551
- constructor(client, imageId, tag, imageRegistryConfig, layers, baseImageId) {
57125
+ constructor(client, imageId, tag, buildRegistryConfig, layers, baseImageId) {
55552
57126
  this.#client = client;
55553
57127
  this.#imageId = imageId;
55554
57128
  this.#tag = tag;
55555
57129
  this.#baseImageId = baseImageId || "";
55556
- this.#imageRegistryConfig = imageRegistryConfig;
57130
+ this.#buildRegistryConfig = buildRegistryConfig;
55557
57131
  this.#layers = layers || [
55558
57132
  {
55559
57133
  commands: [],
@@ -55605,7 +57179,7 @@ var Image2 = class _Image {
55605
57179
  this.#client,
55606
57180
  "",
55607
57181
  this.#tag,
55608
- this.#imageRegistryConfig,
57182
+ this.#buildRegistryConfig,
55609
57183
  [...layers, newLayer],
55610
57184
  baseImageId
55611
57185
  );
@@ -55631,6 +57205,7 @@ var Image2 = class _Image {
55631
57205
  layer.env,
55632
57206
  layer.secrets
55633
57207
  );
57208
+ await hydrateSecrets(this.#client, mergedSecrets);
55634
57209
  const secretIds = mergedSecrets.map((secret) => secret.secretId);
55635
57210
  const gpuConfig = layer.gpuConfig;
55636
57211
  let dockerfileCommands;
@@ -55645,7 +57220,7 @@ var Image2 = class _Image {
55645
57220
  dockerfileCommands = ["FROM base", ...layer.commands];
55646
57221
  baseImages = [{ dockerTag: "base", imageId: baseImageId }];
55647
57222
  }
55648
- const imageRegistryConfig = i === 0 && !baseImageId ? this.#imageRegistryConfig : void 0;
57223
+ const imageRegistryConfig = i === 0 && !baseImageId && this.#buildRegistryConfig ? await this.#buildRegistryConfig(this.#client) : void 0;
55649
57224
  const resp = await this.#client.cpClient.imageGetOrCreate({
55650
57225
  appId: app.appId,
55651
57226
  image: Image.create({
@@ -55712,17 +57287,27 @@ ${result.exception}`
55712
57287
  * @param params - Optional environment.
55713
57288
  */
55714
57289
  async publish(name, params = {}) {
55715
- const tag = parseNamedImageRef(name);
57290
+ const [namespacePrefix, tag] = parseNamedImageRef(name);
55716
57291
  if (this.#imageId === "") {
55717
57292
  throw new InvalidError(
55718
57293
  "Cannot publish an image that has not been built yet. Call build() first."
55719
57294
  );
55720
57295
  }
55721
- const environmentName = this.#client.environmentName(params.environment);
57296
+ let environmentName;
57297
+ if (namespacePrefix) {
57298
+ if (params.environment) {
57299
+ throw new InvalidError(
57300
+ "Cannot specify 'environment' when the image name contains a '/'."
57301
+ );
57302
+ }
57303
+ environmentName = "";
57304
+ } else {
57305
+ environmentName = this.#client.environmentName(params.environment);
57306
+ }
55722
57307
  await this.#client.cpClient.imagePublish({
55723
57308
  imageId: this.#imageId,
55724
57309
  environmentName,
55725
- isPublic: false,
57310
+ allowPublic: false,
55726
57311
  tag
55727
57312
  });
55728
57313
  }
@@ -57930,8 +59515,45 @@ var TaskExecStdinWriteResponse = {
57930
59515
  return message;
57931
59516
  }
57932
59517
  };
59518
+ function createBaseTaskExecStdinWriteStreamEnd() {
59519
+ return {};
59520
+ }
59521
+ var TaskExecStdinWriteStreamEnd = {
59522
+ encode(_, writer = new BinaryWriter()) {
59523
+ return writer;
59524
+ },
59525
+ decode(input, length) {
59526
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
59527
+ let end = length === void 0 ? reader.len : reader.pos + length;
59528
+ const message = createBaseTaskExecStdinWriteStreamEnd();
59529
+ while (reader.pos < end) {
59530
+ const tag = reader.uint32();
59531
+ switch (tag >>> 3) {
59532
+ }
59533
+ if ((tag & 7) === 4 || tag === 0) {
59534
+ break;
59535
+ }
59536
+ reader.skip(tag & 7);
59537
+ }
59538
+ return message;
59539
+ },
59540
+ fromJSON(_) {
59541
+ return {};
59542
+ },
59543
+ toJSON(_) {
59544
+ const obj = {};
59545
+ return obj;
59546
+ },
59547
+ create(base) {
59548
+ return TaskExecStdinWriteStreamEnd.fromPartial(base ?? {});
59549
+ },
59550
+ fromPartial(_) {
59551
+ const message = createBaseTaskExecStdinWriteStreamEnd();
59552
+ return message;
59553
+ }
59554
+ };
57933
59555
  function createBaseTaskExecStdinWriteStreamRequest() {
57934
- return { start: void 0, data: void 0 };
59556
+ return { start: void 0, data: void 0, end: void 0 };
57935
59557
  }
57936
59558
  var TaskExecStdinWriteStreamRequest = {
57937
59559
  encode(message, writer = new BinaryWriter()) {
@@ -57941,6 +59563,9 @@ var TaskExecStdinWriteStreamRequest = {
57941
59563
  if (message.data !== void 0) {
57942
59564
  writer.uint32(18).bytes(message.data);
57943
59565
  }
59566
+ if (message.end !== void 0) {
59567
+ TaskExecStdinWriteStreamEnd.encode(message.end, writer.uint32(26).fork()).join();
59568
+ }
57944
59569
  return writer;
57945
59570
  },
57946
59571
  decode(input, length) {
@@ -57964,6 +59589,13 @@ var TaskExecStdinWriteStreamRequest = {
57964
59589
  message.data = reader.bytes();
57965
59590
  continue;
57966
59591
  }
59592
+ case 3: {
59593
+ if (tag !== 26) {
59594
+ break;
59595
+ }
59596
+ message.end = TaskExecStdinWriteStreamEnd.decode(reader, reader.uint32());
59597
+ continue;
59598
+ }
57967
59599
  }
57968
59600
  if ((tag & 7) === 4 || tag === 0) {
57969
59601
  break;
@@ -57975,7 +59607,8 @@ var TaskExecStdinWriteStreamRequest = {
57975
59607
  fromJSON(object) {
57976
59608
  return {
57977
59609
  start: isSet6(object.start) ? TaskExecStdinWriteStreamStart.fromJSON(object.start) : void 0,
57978
- data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0
59610
+ data: isSet6(object.data) ? bytesFromBase643(object.data) : void 0,
59611
+ end: isSet6(object.end) ? TaskExecStdinWriteStreamEnd.fromJSON(object.end) : void 0
57979
59612
  };
57980
59613
  },
57981
59614
  toJSON(message) {
@@ -57986,6 +59619,9 @@ var TaskExecStdinWriteStreamRequest = {
57986
59619
  if (message.data !== void 0) {
57987
59620
  obj.data = base64FromBytes3(message.data);
57988
59621
  }
59622
+ if (message.end !== void 0) {
59623
+ obj.end = TaskExecStdinWriteStreamEnd.toJSON(message.end);
59624
+ }
57989
59625
  return obj;
57990
59626
  },
57991
59627
  create(base) {
@@ -57995,6 +59631,7 @@ var TaskExecStdinWriteStreamRequest = {
57995
59631
  const message = createBaseTaskExecStdinWriteStreamRequest();
57996
59632
  message.start = object.start !== void 0 && object.start !== null ? TaskExecStdinWriteStreamStart.fromPartial(object.start) : void 0;
57997
59633
  message.data = object.data ?? void 0;
59634
+ message.end = object.end !== void 0 && object.end !== null ? TaskExecStdinWriteStreamEnd.fromPartial(object.end) : void 0;
57998
59635
  return message;
57999
59636
  }
58000
59637
  };
@@ -58501,6 +60138,94 @@ var TaskMountDirectoryRequest = {
58501
60138
  return message;
58502
60139
  }
58503
60140
  };
60141
+ function createBaseTaskReloadVolumesRequest() {
60142
+ return { taskId: "" };
60143
+ }
60144
+ var TaskReloadVolumesRequest = {
60145
+ encode(message, writer = new BinaryWriter()) {
60146
+ if (message.taskId !== "") {
60147
+ writer.uint32(10).string(message.taskId);
60148
+ }
60149
+ return writer;
60150
+ },
60151
+ decode(input, length) {
60152
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
60153
+ let end = length === void 0 ? reader.len : reader.pos + length;
60154
+ const message = createBaseTaskReloadVolumesRequest();
60155
+ while (reader.pos < end) {
60156
+ const tag = reader.uint32();
60157
+ switch (tag >>> 3) {
60158
+ case 1: {
60159
+ if (tag !== 10) {
60160
+ break;
60161
+ }
60162
+ message.taskId = reader.string();
60163
+ continue;
60164
+ }
60165
+ }
60166
+ if ((tag & 7) === 4 || tag === 0) {
60167
+ break;
60168
+ }
60169
+ reader.skip(tag & 7);
60170
+ }
60171
+ return message;
60172
+ },
60173
+ fromJSON(object) {
60174
+ return { taskId: isSet6(object.taskId) ? globalThis.String(object.taskId) : "" };
60175
+ },
60176
+ toJSON(message) {
60177
+ const obj = {};
60178
+ if (message.taskId !== "") {
60179
+ obj.taskId = message.taskId;
60180
+ }
60181
+ return obj;
60182
+ },
60183
+ create(base) {
60184
+ return TaskReloadVolumesRequest.fromPartial(base ?? {});
60185
+ },
60186
+ fromPartial(object) {
60187
+ const message = createBaseTaskReloadVolumesRequest();
60188
+ message.taskId = object.taskId ?? "";
60189
+ return message;
60190
+ }
60191
+ };
60192
+ function createBaseTaskReloadVolumesResponse() {
60193
+ return {};
60194
+ }
60195
+ var TaskReloadVolumesResponse = {
60196
+ encode(_, writer = new BinaryWriter()) {
60197
+ return writer;
60198
+ },
60199
+ decode(input, length) {
60200
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
60201
+ let end = length === void 0 ? reader.len : reader.pos + length;
60202
+ const message = createBaseTaskReloadVolumesResponse();
60203
+ while (reader.pos < end) {
60204
+ const tag = reader.uint32();
60205
+ switch (tag >>> 3) {
60206
+ }
60207
+ if ((tag & 7) === 4 || tag === 0) {
60208
+ break;
60209
+ }
60210
+ reader.skip(tag & 7);
60211
+ }
60212
+ return message;
60213
+ },
60214
+ fromJSON(_) {
60215
+ return {};
60216
+ },
60217
+ toJSON(_) {
60218
+ const obj = {};
60219
+ return obj;
60220
+ },
60221
+ create(base) {
60222
+ return TaskReloadVolumesResponse.fromPartial(base ?? {});
60223
+ },
60224
+ fromPartial(_) {
60225
+ const message = createBaseTaskReloadVolumesResponse();
60226
+ return message;
60227
+ }
60228
+ };
58504
60229
  function createBaseTaskSetNetworkAccessRequest() {
58505
60230
  return { taskId: "", networkAccess: void 0 };
58506
60231
  }
@@ -59146,6 +60871,15 @@ var TaskCommandRouterDefinition = {
59146
60871
  responseStream: false,
59147
60872
  options: {}
59148
60873
  },
60874
+ /** Reload all Volumes mounted in the task to reflect their latest committed state. */
60875
+ taskReloadVolumes: {
60876
+ name: "TaskReloadVolumes",
60877
+ requestType: TaskReloadVolumesRequest,
60878
+ requestStream: false,
60879
+ responseType: TaskReloadVolumesResponse,
60880
+ responseStream: false,
60881
+ options: {}
60882
+ },
59149
60883
  /** Replace the task's outbound network allowlist (domains + CIDRs). */
59150
60884
  taskSetNetworkAccess: {
59151
60885
  name: "TaskSetNetworkAccess",
@@ -59536,8 +61270,9 @@ var AuthTokenManager = class {
59536
61270
  };
59537
61271
 
59538
61272
  // src/version.ts
61273
+ var SDK_VERSION = "0.9.0";
59539
61274
  function getSDKVersion() {
59540
- return true ? "0.8.1" : "0.0.0";
61275
+ return SDK_VERSION;
59541
61276
  }
59542
61277
 
59543
61278
  // src/logger.ts
@@ -60433,6 +62168,40 @@ var TaskCommandRouterClientImpl = class _TaskCommandRouterClientImpl {
60433
62168
  async unmountDirectory(request) {
60434
62169
  await this.callUnary(() => this.stub.taskUnmountDirectory(request));
60435
62170
  }
62171
+ async setNetworkAccess(request) {
62172
+ await this.callUnary(() => this.stub.taskSetNetworkAccess(request));
62173
+ }
62174
+ /**
62175
+ * Reload all Volumes mounted in the task to reflect their latest committed state.
62176
+ *
62177
+ * `timeoutMs` is the client-side deadline. If the reload does not complete
62178
+ * within this window, the call is cancelled and a TimeoutError is thrown.
62179
+ */
62180
+ async reloadVolumes(request, options) {
62181
+ const overallDeadlineMs = options?.timeoutMs !== void 0 ? Date.now() + options.timeoutMs : null;
62182
+ try {
62183
+ await callWithRetriesOnTransientErrors(
62184
+ () => this.callWithAuthRetry(() => {
62185
+ const remainingMs = overallDeadlineMs !== null ? Math.max(1, overallDeadlineMs - Date.now()) : options?.timeoutMs;
62186
+ return this.stub.taskReloadVolumes(request, {
62187
+ ...options,
62188
+ timeoutMs: remainingMs
62189
+ });
62190
+ }),
62191
+ 10,
62192
+ 2,
62193
+ 10,
62194
+ overallDeadlineMs,
62195
+ () => this.closed,
62196
+ [import_nice_grpc11.Status.DEADLINE_EXCEEDED, import_nice_grpc11.Status.CANCELLED]
62197
+ );
62198
+ } catch (err) {
62199
+ if (overallDeadlineMs !== null && Date.now() >= overallDeadlineMs) {
62200
+ throw new TimeoutError("Timeout expired");
62201
+ }
62202
+ throw err;
62203
+ }
62204
+ }
60436
62205
  async sandboxWaitUntilReady(taskId, timeoutMs) {
60437
62206
  const deadlineMs = Date.now() + timeoutMs;
60438
62207
  try {
@@ -60798,6 +62567,44 @@ function raiseStatError(returnCode, stderr, remotePath) {
60798
62567
  function makeStatCommand(remotePath) {
60799
62568
  return JSON.stringify({ Stat: { path: remotePath } });
60800
62569
  }
62570
+ function raiseWatchError(returnCode, stderr, remotePath) {
62571
+ const payload = tryParseErrorPayload(stderr);
62572
+ if (payload) {
62573
+ logger.debug(
62574
+ `sandbox-fs-tools watch error: path=${remotePath}, error_kind=${payload.error_kind}, message=${payload.message}, detail=${payload.detail}`
62575
+ );
62576
+ if (payload.error_kind === "NotFound")
62577
+ throw new SandboxFilesystemNotFoundError(
62578
+ `${payload.message}: ${remotePath}`
62579
+ );
62580
+ if (payload.error_kind === "PermissionDenied")
62581
+ throw new SandboxFilesystemPermissionError(
62582
+ `${payload.message}: ${remotePath}`
62583
+ );
62584
+ if (payload.error_kind === "NotSupported")
62585
+ throw new InvalidError(
62586
+ `${payload.message}: ${remotePath} - this operation is not supported for CloudBucketMounts`
62587
+ );
62588
+ throw new SandboxFilesystemError(payload.message);
62589
+ }
62590
+ const text = stderrToText(stderr);
62591
+ if (text) logger.debug(`Unstructured modal-sandbox-fs-tools stderr: ${text}`);
62592
+ throw new SandboxFilesystemError(
62593
+ `Operation on '${remotePath}' failed with exit code ${returnCode}`
62594
+ );
62595
+ }
62596
+ function makeWatchCommand(remotePath, opts) {
62597
+ return JSON.stringify({
62598
+ Watch: {
62599
+ path: remotePath,
62600
+ recursive: opts.recursive,
62601
+ filter: opts.filter,
62602
+ // The fs-tools wire protocol takes whole seconds; convert from the SDK's
62603
+ // millisecond convention, truncating any sub-second remainder.
62604
+ timeout_secs: opts.timeoutMs !== null ? Math.trunc(opts.timeoutMs / 1e3) : null
62605
+ }
62606
+ });
62607
+ }
60801
62608
  function raiseWriteFileError(returnCode, stderr, remotePath) {
60802
62609
  const payload = tryParseErrorPayload(stderr);
60803
62610
  if (payload) {
@@ -60891,6 +62698,36 @@ function parseFileEntry(raw) {
60891
62698
  symlinkTarget: raw.symlink_target ?? null
60892
62699
  };
60893
62700
  }
62701
+ var RUST_RENAME_VARIANTS = ["Rename", "RenameFrom", "RenameTo"];
62702
+ var VALID_EVENT_TYPES = /* @__PURE__ */ new Set([
62703
+ "Access",
62704
+ "Create",
62705
+ "Modify",
62706
+ "Remove",
62707
+ "Unknown"
62708
+ ]);
62709
+ function expandWatchFilter(filter) {
62710
+ const result = [];
62711
+ for (const eventType of filter) {
62712
+ result.push(eventType);
62713
+ if (eventType === "Modify") {
62714
+ result.push(...RUST_RENAME_VARIANTS);
62715
+ }
62716
+ }
62717
+ return result;
62718
+ }
62719
+ async function* readLines(stream) {
62720
+ const decoder2 = new TextDecoder();
62721
+ let buffer = "";
62722
+ for await (const chunk of stream) {
62723
+ buffer += typeof chunk === "string" ? chunk : decoder2.decode(chunk, { stream: true });
62724
+ const lines = buffer.split("\n");
62725
+ buffer = lines.pop() ?? "";
62726
+ for (const line of lines) yield line;
62727
+ }
62728
+ const tail = decoder2.decode(void 0, { stream: false });
62729
+ if (buffer + tail) yield buffer + tail;
62730
+ }
60894
62731
  var WRITE_CHUNK_SIZE = 4 * 1024 * 1024;
60895
62732
  function toUint8Array(data) {
60896
62733
  if (data instanceof ArrayBuffer) return new Uint8Array(data);
@@ -61168,6 +63005,94 @@ var SandboxFilesystem = class {
61168
63005
  });
61169
63006
  return parseFileEntry(JSON.parse(stdout));
61170
63007
  }
63008
+ /**
63009
+ * Watch a path in the Sandbox for filesystem changes.
63010
+ *
63011
+ * `remotePath` must be an absolute path in the Sandbox. If it points to a
63012
+ * file, events for that file are reported. If it points to a directory,
63013
+ * events for entries directly inside it are reported. Set `recursive: true`
63014
+ * to also receive events for all nested subdirectories. If `remotePath` is
63015
+ * a symlink, it is followed and events reference paths under the resolved
63016
+ * target.
63017
+ *
63018
+ * Yields {@link FileWatchEvent} objects as changes occur, until either the
63019
+ * timeout elapses, the iterator is closed, or the Sandbox is terminated.
63020
+ *
63021
+ * Optionally restrict the kinds of events emitted to those included in
63022
+ * `filter`. An undefined `filter` permits all types; passing an empty array
63023
+ * suppresses all events.
63024
+ *
63025
+ * `timeoutMs` is truncated to whole seconds. Omit it to watch indefinitely.
63026
+ * When the timeout elapses, the iterator stops without raising an exception.
63027
+ *
63028
+ * @throws {SandboxFilesystemNotFoundError} `remotePath` does not exist.
63029
+ * @throws {SandboxFilesystemPermissionError} watch access is denied.
63030
+ * @throws {InvalidError} the filesystem does not support watching.
63031
+ * @throws {SandboxFilesystemError} the command fails for any other reason.
63032
+ */
63033
+ async *watch(remotePath, params = {}) {
63034
+ validateAbsoluteRemotePath(remotePath, "watch");
63035
+ checkForRenamedParams(params, { timeout: "timeoutMs" });
63036
+ const { filter, recursive = false, timeoutMs } = params;
63037
+ const process2 = await translateExecErrors(
63038
+ "watch",
63039
+ remotePath,
63040
+ () => this.exec(
63041
+ [
63042
+ SANDBOX_FS_TOOLS_PATH,
63043
+ makeWatchCommand(remotePath, {
63044
+ recursive,
63045
+ filter: filter !== void 0 ? expandWatchFilter(filter) : null,
63046
+ timeoutMs: timeoutMs ?? null
63047
+ })
63048
+ ],
63049
+ { mode: "text" }
63050
+ )
63051
+ );
63052
+ let streamEnded = false;
63053
+ try {
63054
+ for await (const line of readLines(process2.stdout)) {
63055
+ const trimmed = line.trim();
63056
+ if (!trimmed) continue;
63057
+ let data;
63058
+ try {
63059
+ data = JSON.parse(trimmed);
63060
+ } catch {
63061
+ continue;
63062
+ }
63063
+ const paths = data.paths ?? [];
63064
+ if (paths.length === 0) continue;
63065
+ let rawType = data.event_type;
63066
+ if (typeof rawType !== "string") continue;
63067
+ if (RUST_RENAME_VARIANTS.includes(rawType)) {
63068
+ rawType = "Modify";
63069
+ }
63070
+ if (!VALID_EVENT_TYPES.has(rawType)) continue;
63071
+ yield { eventType: rawType, paths };
63072
+ }
63073
+ streamEnded = true;
63074
+ } catch (err) {
63075
+ await translateExecErrors("watch", remotePath, () => {
63076
+ throw err;
63077
+ });
63078
+ throw err;
63079
+ } finally {
63080
+ await process2.closeStdin().catch(() => {
63081
+ });
63082
+ if (streamEnded) {
63083
+ await translateExecErrors("watch", remotePath, async () => {
63084
+ const returnCode = await process2.wait();
63085
+ if (returnCode !== 0) {
63086
+ const stderr = await process2.stderr.readBytes();
63087
+ raiseWatchError(returnCode, stderr, remotePath);
63088
+ }
63089
+ });
63090
+ } else {
63091
+ await process2.wait().catch(() => {
63092
+ });
63093
+ }
63094
+ }
63095
+ }
61171
63096
  /**
61172
63097
  * Write binary content to a file in the Sandbox.
61173
63098
  *
@@ -61278,7 +63203,13 @@ var SidecarService = class {
61278
63203
  const command = params?.command ?? [];
61279
63204
  validateExecArgs(command);
61280
63205
  validateWorkdir(params?.workdir);
61281
- const secretIds = (params?.secrets ?? []).map((secret) => secret.secretId);
63206
+ validateEnvVarKeys(params?.env ?? {});
63207
+ const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
63208
+ params?.secrets ?? []
63209
+ );
63210
+ Object.assign(envDict, params?.env ?? {});
63211
+ await hydrateSecrets(this.#access.client, resolvableSecrets);
63212
+ const secretIds = collectSecretIds(resolvableSecrets);
61282
63213
  const [taskId, client] = await this.#access.commandRouter();
61283
63214
  let resp;
61284
63215
  try {
@@ -61288,7 +63219,7 @@ var SidecarService = class {
61288
63219
  containerName: name,
61289
63220
  imageId: image.imageId,
61290
63221
  args: command,
61291
- env: params?.env ?? {},
63222
+ env: envDict,
61292
63223
  workdir: params?.workdir ?? "",
61293
63224
  secretIds
61294
63225
  })
@@ -61900,9 +63831,11 @@ async function buildSandboxCreateV2RequestProto(appId, imageId, params = {}) {
61900
63831
  throw new Error("custom domains are not supported by experimentalCreate");
61901
63832
  }
61902
63833
  const req = await buildSandboxCreateRequestProto(appId, imageId, params);
63834
+ const ephemeralSecrets = params.env && Object.keys(params.env).length > 0 ? StringMap.create({ contents: params.env }) : void 0;
61903
63835
  return SandboxCreateV2Request.create({
61904
63836
  appId: req.appId,
61905
- definition: req.definition
63837
+ definition: req.definition,
63838
+ ephemeralSecrets
61906
63839
  });
61907
63840
  }
61908
63841
  var SandboxService = class {
@@ -61920,6 +63853,11 @@ var SandboxService = class {
61920
63853
  params.env,
61921
63854
  params.secrets
61922
63855
  );
63856
+ await hydrateSandboxSecrets(
63857
+ this.#client,
63858
+ mergedSecrets,
63859
+ params.cloudBucketMounts
63860
+ );
61923
63861
  const mergedParams = {
61924
63862
  ...params,
61925
63863
  secrets: mergedSecrets,
@@ -61959,24 +63897,28 @@ var SandboxService = class {
61959
63897
  * supported.
61960
63898
  *
61961
63899
  * V2 sandboxes created with this method are not currently returned by
61962
- * {@link SandboxService#list client.sandboxes.list()} and cannot be looked up
61963
- * with {@link SandboxService#fromName client.sandboxes.fromName()}. Store
61964
- * {@link Sandbox#sandboxId sandbox.sandboxId} if you need to retrieve the
61965
- * sandbox later, and use {@link SandboxService#fromId client.sandboxes.fromId()}
61966
- * to reattach.
63900
+ * {@link SandboxService#list client.sandboxes.list()}. A named Sandbox can be
63901
+ * looked up with
63902
+ * {@link SandboxService#experimentalFromName client.sandboxes.experimentalFromName()};
63903
+ * otherwise store {@link Sandbox#sandboxId sandbox.sandboxId} and use
63904
+ * {@link SandboxService#fromId client.sandboxes.fromId()} to reattach.
61967
63905
  */
61968
63906
  async experimentalCreate(app, image, params = {}) {
61969
63907
  await image.build(app);
61970
- const mergedSecrets = await mergeEnvIntoSecrets(
63908
+ validateEnvVarKeys(params.env ?? {});
63909
+ const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
63910
+ params.secrets ?? []
63911
+ );
63912
+ Object.assign(envDict, params.env ?? {});
63913
+ await hydrateSandboxSecrets(
61971
63914
  this.#client,
61972
- params.env,
61973
- params.secrets
63915
+ resolvableSecrets,
63916
+ params.cloudBucketMounts
61974
63917
  );
61975
63918
  const mergedParams = {
61976
63919
  ...params,
61977
- secrets: mergedSecrets,
61978
- env: void 0
61979
- // setting env to undefined just to clarify it's not needed anymore
63920
+ secrets: resolvableSecrets,
63921
+ env: envDict
61980
63922
  };
61981
63923
  const createReq = await buildSandboxCreateV2RequestProto(
61982
63924
  app.appId,
@@ -62044,6 +63986,35 @@ var SandboxService = class {
62044
63986
  throw err;
62045
63987
  }
62046
63988
  }
63989
+ /**
63990
+ * Get a running V2 {@link Sandbox} by name from a deployed {@link App}.
63991
+ *
63992
+ * This looks up V2 Sandboxes, i.e. Sandboxes created via
63993
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
63994
+ *
63995
+ * EXPERIMENTAL: the API is subject to change.
63996
+ *
63997
+ * @param appName - Name of the deployed App
63998
+ * @param name - Name of the Sandbox
63999
+ * @param params - Optional parameters for getting the Sandbox
64000
+ * @returns Promise that resolves to a Sandbox
64001
+ */
64002
+ async experimentalFromName(appName, name, params) {
64003
+ try {
64004
+ const resp = await this.#client.cpClient.sandboxGetFromNameV2({
64005
+ sandboxName: name,
64006
+ appName,
64007
+ environmentName: this.#client.environmentName(params?.environment)
64008
+ });
64009
+ return new Sandbox2(this.#client, resp.sandboxId, { isV2: true });
64010
+ } catch (err) {
64011
+ if (err instanceof import_nice_grpc15.ClientError && err.code === import_nice_grpc15.Status.NOT_FOUND)
64012
+ throw new NotFoundError(
64013
+ `Sandbox with name '${name}' not found in App '${appName}'`
64014
+ );
64015
+ throw err;
64016
+ }
64017
+ }
62047
64018
  /**
62048
64019
  * List all {@link Sandbox}es for the current Environment or App ID (if specified).
62049
64020
  * If tags are specified, only Sandboxes that have at least those tags are returned.
@@ -62079,6 +64050,46 @@ var SandboxService = class {
62079
64050
  }
62080
64051
  }
62081
64052
  }
64053
+ /**
64054
+ * List the V2 {@link Sandbox}es in an {@link App}.
64055
+ *
64056
+ * This lists V2 Sandboxes, i.e. Sandboxes created via
64057
+ * {@link SandboxService#experimentalCreate client.sandboxes.experimentalCreate()}.
64058
+ * Such Sandboxes are not returned by
64059
+ * {@link SandboxService#list client.sandboxes.list()}. If tags are specified,
64060
+ * only Sandboxes that have at least those tags are returned.
64061
+ *
64062
+ * Yields {@link Sandbox} objects that are currently running in the App.
64063
+ *
64064
+ * EXPERIMENTAL: the API is subject to change.
64065
+ */
64066
+ async *experimentalList(params) {
64067
+ if (!params?.appId) {
64068
+ throw new InvalidError(
64069
+ 'experimentalList requires an `appId`:\n\nconst app = await modal.apps.fromName("my-app");\nmodal.sandboxes.experimentalList({ appId: app.appId });'
64070
+ );
64071
+ }
64072
+ const tagsList = params.tags ? Object.entries(params.tags).map(([tagName, tagValue]) => ({
64073
+ tagName,
64074
+ tagValue
64075
+ })) : [];
64076
+ let beforeTimestamp = void 0;
64077
+ while (true) {
64078
+ const resp = await this.#client.cpClient.sandboxListV2({
64079
+ appId: params.appId,
64080
+ beforeTimestamp,
64081
+ includeFinished: false,
64082
+ tags: tagsList
64083
+ });
64084
+ if (!resp.sandboxes || resp.sandboxes.length === 0) {
64085
+ return;
64086
+ }
64087
+ for (const info of resp.sandboxes) {
64088
+ yield new Sandbox2(this.#client, info.id, { isV2: true });
64089
+ }
64090
+ beforeTimestamp = resp.sandboxes[resp.sandboxes.length - 1].createdAt;
64091
+ }
64092
+ }
62082
64093
  };
62083
64094
  var Tunnel = class {
62084
64095
  /** @ignore */
@@ -62136,6 +64147,17 @@ function validateWorkdir(workdir) {
62136
64147
  throw new InvalidError(`workdir must be an absolute path, got: ${workdir}`);
62137
64148
  }
62138
64149
  }
64150
+ async function hydrateSandboxSecrets(client, secrets, mounts) {
64151
+ const toHydrate = [...secrets];
64152
+ if (mounts) {
64153
+ for (const mount of Object.values(mounts)) {
64154
+ if (mount?.secret) {
64155
+ toHydrate.push(mount.secret);
64156
+ }
64157
+ }
64158
+ }
64159
+ await hydrateSecrets(client, toHydrate);
64160
+ }
62139
64161
  function getReturnCode(result) {
62140
64162
  if (result === void 0 || result.status === 0 /* GENERIC_STATUS_UNSPECIFIED */) {
62141
64163
  return null;
@@ -62308,6 +64330,7 @@ var Sandbox2 = class _Sandbox {
62308
64330
  this.#ensureAttached();
62309
64331
  if (!this.#sidecars) {
62310
64332
  this.#sidecars = new SidecarService({
64333
+ client: this.#client,
62311
64334
  exec: (command, params, containerId) => this.#execInternal(command, params, containerId),
62312
64335
  commandRouter: () => this.#getCommandRouter()
62313
64336
  });
@@ -62362,13 +64385,24 @@ var Sandbox2 = class _Sandbox {
62362
64385
  async #execInternal(command, params, containerId) {
62363
64386
  this.#ensureAttached();
62364
64387
  validateExecArgs(command);
64388
+ validateEnvVarKeys(params?.env ?? {});
64389
+ const [envDict, resolvableSecrets] = splitEnvDictAndResolvableSecrets(
64390
+ params?.secrets ?? []
64391
+ );
64392
+ Object.assign(envDict, params?.env ?? {});
64393
+ await hydrateSecrets(this.#client, resolvableSecrets);
64394
+ const execParams = {
64395
+ ...params,
64396
+ env: envDict,
64397
+ secrets: resolvableSecrets
64398
+ };
62365
64399
  const [taskId, commandRouterClient] = await this.#getCommandRouter();
62366
64400
  const execId = (0, import_uuid2.v4)();
62367
64401
  const request = buildTaskExecStartRequestProto(
62368
64402
  taskId,
62369
64403
  execId,
62370
64404
  command,
62371
- params,
64405
+ execParams,
62372
64406
  containerId
62373
64407
  );
62374
64408
  await commandRouterClient.execStart(request);
@@ -62674,6 +64708,53 @@ var Sandbox2 = class _Sandbox {
62674
64708
  });
62675
64709
  await commandRouterClient.unmountDirectory(request);
62676
64710
  }
64711
+ /**
64712
+ * Updates the outbound network policy of a running Sandbox.
64713
+ *
64714
+ * Established connections that the new policy no longer permits are terminated.
64715
+ *
64716
+ * @param params - Both `outboundCidrAllowlist` and `outboundDomainAllowlist` must be provided.
64717
+ */
64718
+ async updateNetworkPolicy(params) {
64719
+ this.#ensureAttached();
64720
+ if (params.outboundCidrAllowlist === void 0 || params.outboundDomainAllowlist === void 0) {
64721
+ throw new InvalidError(
64722
+ "updateNetworkPolicy currently requires both outboundCidrAllowlist and outboundDomainAllowlist to be set"
64723
+ );
64724
+ }
64725
+ const [taskId, commandRouterClient] = await this.#getCommandRouter();
64726
+ const request = TaskSetNetworkAccessRequest.create({
64727
+ taskId,
64728
+ networkAccess: NetworkAccess.create({
64729
+ networkAccessType: 3 /* ALLOWLIST */,
64730
+ allowedCidrs: params.outboundCidrAllowlist,
64731
+ allowedDomains: params.outboundDomainAllowlist
64732
+ })
64733
+ });
64734
+ await commandRouterClient.setNetworkAccess(request);
64735
+ }
64736
+ /**
64737
+ * Reload all Volumes mounted in the Sandbox.
64738
+ *
64739
+ * Blocks until the Volumes have been reloaded, bounded by `timeoutMs` (55000
64740
+ * by default). If the reload does not complete within that window, a
64741
+ * `TimeoutError` is thrown; note that the reload may still complete in the
64742
+ * background.
64743
+ *
64744
+ * @param params - Optional parameters; see {@link SandboxReloadVolumesParams}.
64745
+ */
64746
+ async reloadVolumes(params) {
64747
+ this.#ensureAttached();
64748
+ if (params?.timeoutMs !== void 0 && params.timeoutMs < 0) {
64749
+ throw new InvalidError("`timeoutMs` must not be negative");
64750
+ }
64751
+ const timeoutMs = params?.timeoutMs || 55e3;
64752
+ const [taskId, commandRouterClient] = await this.#getCommandRouter();
64753
+ await commandRouterClient.reloadVolumes(
64754
+ TaskReloadVolumesRequest.create({ taskId }),
64755
+ { timeoutMs }
64756
+ );
64757
+ }
62677
64758
  /**
62678
64759
  * Snapshots and creates a new {@link Image} from a directory in the running sandbox.
62679
64760
  *