@gapi/gcli 1.8.249 → 1.8.251

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/release/index.js CHANGED
@@ -11586,11 +11586,11 @@ var require_isReadableStreamLike = __commonJS({
11586
11586
  function verb(n) {
11587
11587
  if (g[n]) i2[n] = function(v) {
11588
11588
  return new Promise(function(a, b) {
11589
- q.push([n, v, a, b]) > 1 || resume(n, v);
11589
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
11590
11590
  });
11591
11591
  };
11592
11592
  }
11593
- function resume(n, v) {
11593
+ function resume2(n, v) {
11594
11594
  try {
11595
11595
  step(g[n](v));
11596
11596
  } catch (e2) {
@@ -11601,13 +11601,13 @@ var require_isReadableStreamLike = __commonJS({
11601
11601
  r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
11602
11602
  }
11603
11603
  function fulfill(value) {
11604
- resume("next", value);
11604
+ resume2("next", value);
11605
11605
  }
11606
11606
  function reject(value) {
11607
- resume("throw", value);
11607
+ resume2("throw", value);
11608
11608
  }
11609
11609
  function settle(f3, v) {
11610
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
11610
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
11611
11611
  }
11612
11612
  };
11613
11613
  Object.defineProperty(exports2, "__esModule", { value: true });
@@ -12391,7 +12391,7 @@ var require_lastValueFrom = __commonJS({
12391
12391
  Object.defineProperty(exports2, "__esModule", { value: true });
12392
12392
  exports2.lastValueFrom = void 0;
12393
12393
  var EmptyError_1 = require_EmptyError();
12394
- function lastValueFrom53(source, config2) {
12394
+ function lastValueFrom59(source, config2) {
12395
12395
  var hasConfig = typeof config2 === "object";
12396
12396
  return new Promise(function(resolve2, reject) {
12397
12397
  var _hasValue = false;
@@ -12414,7 +12414,7 @@ var require_lastValueFrom = __commonJS({
12414
12414
  });
12415
12415
  });
12416
12416
  }
12417
- exports2.lastValueFrom = lastValueFrom53;
12417
+ exports2.lastValueFrom = lastValueFrom59;
12418
12418
  }
12419
12419
  });
12420
12420
 
@@ -18990,11 +18990,11 @@ var require_tslib = __commonJS({
18990
18990
  function verb(n) {
18991
18991
  if (g[n]) i2[n] = function(v) {
18992
18992
  return new Promise(function(a, b) {
18993
- q.push([n, v, a, b]) > 1 || resume(n, v);
18993
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
18994
18994
  });
18995
18995
  };
18996
18996
  }
18997
- function resume(n, v) {
18997
+ function resume2(n, v) {
18998
18998
  try {
18999
18999
  step(g[n](v));
19000
19000
  } catch (e2) {
@@ -19005,13 +19005,13 @@ var require_tslib = __commonJS({
19005
19005
  r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
19006
19006
  }
19007
19007
  function fulfill(value) {
19008
- resume("next", value);
19008
+ resume2("next", value);
19009
19009
  }
19010
19010
  function reject(value) {
19011
- resume("throw", value);
19011
+ resume2("throw", value);
19012
19012
  }
19013
19013
  function settle(f3, v) {
19014
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
19014
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
19015
19015
  }
19016
19016
  };
19017
19017
  __asyncDelegator2 = function(o) {
@@ -19349,11 +19349,11 @@ var require_tslib2 = __commonJS({
19349
19349
  function verb(n) {
19350
19350
  if (g[n]) i2[n] = function(v) {
19351
19351
  return new Promise(function(a, b) {
19352
- q.push([n, v, a, b]) > 1 || resume(n, v);
19352
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
19353
19353
  });
19354
19354
  };
19355
19355
  }
19356
- function resume(n, v) {
19356
+ function resume2(n, v) {
19357
19357
  try {
19358
19358
  step(g[n](v));
19359
19359
  } catch (e2) {
@@ -19364,13 +19364,13 @@ var require_tslib2 = __commonJS({
19364
19364
  r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
19365
19365
  }
19366
19366
  function fulfill(value) {
19367
- resume("next", value);
19367
+ resume2("next", value);
19368
19368
  }
19369
19369
  function reject(value) {
19370
- resume("throw", value);
19370
+ resume2("throw", value);
19371
19371
  }
19372
19372
  function settle(f3, v) {
19373
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
19373
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
19374
19374
  }
19375
19375
  };
19376
19376
  __asyncDelegator2 = function(o) {
@@ -20720,11 +20720,11 @@ var require_tslib3 = __commonJS({
20720
20720
  function verb(n) {
20721
20721
  if (g[n]) i2[n] = function(v) {
20722
20722
  return new Promise(function(a, b) {
20723
- q.push([n, v, a, b]) > 1 || resume(n, v);
20723
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
20724
20724
  });
20725
20725
  };
20726
20726
  }
20727
- function resume(n, v) {
20727
+ function resume2(n, v) {
20728
20728
  try {
20729
20729
  step(g[n](v));
20730
20730
  } catch (e2) {
@@ -20735,13 +20735,13 @@ var require_tslib3 = __commonJS({
20735
20735
  r2.value instanceof __await2 ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
20736
20736
  }
20737
20737
  function fulfill(value) {
20738
- resume("next", value);
20738
+ resume2("next", value);
20739
20739
  }
20740
20740
  function reject(value) {
20741
- resume("throw", value);
20741
+ resume2("throw", value);
20742
20742
  }
20743
20743
  function settle(f3, v) {
20744
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
20744
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
20745
20745
  }
20746
20746
  };
20747
20747
  __asyncDelegator2 = function(o) {
@@ -27839,7 +27839,7 @@ var require_auth = __commonJS({
27839
27839
  this.a = this.c;
27840
27840
  qm(this, true);
27841
27841
  };
27842
- function rm3(a, b) {
27842
+ function rm5(a, b) {
27843
27843
  if (b) return a.a = a.c, a.g();
27844
27844
  b = a.a;
27845
27845
  a.a *= 2;
@@ -27848,7 +27848,7 @@ var require_auth = __commonJS({
27848
27848
  }
27849
27849
  function qm(a, b) {
27850
27850
  a.stop();
27851
- a.b = Bd(rm3(a, b)).then(function() {
27851
+ a.b = Bd(rm5(a, b)).then(function() {
27852
27852
  return Ye();
27853
27853
  }).then(function() {
27854
27854
  return a.h();
@@ -29867,7 +29867,7 @@ var require_buffer_list = __commonJS({
29867
29867
  }
29868
29868
  }, {
29869
29869
  key: "join",
29870
- value: function join3(s2) {
29870
+ value: function join6(s2) {
29871
29871
  if (this.length === 0) return "";
29872
29872
  var p = this.head;
29873
29873
  var ret = "" + p.data;
@@ -31980,12 +31980,12 @@ var require_stream_readable = __commonJS({
31980
31980
  if (!state.flowing) {
31981
31981
  debug("resume");
31982
31982
  state.flowing = !state.readableListening;
31983
- resume(this, state);
31983
+ resume2(this, state);
31984
31984
  }
31985
31985
  state.paused = false;
31986
31986
  return this;
31987
31987
  };
31988
- function resume(stream, state) {
31988
+ function resume2(stream, state) {
31989
31989
  if (!state.resumeScheduled) {
31990
31990
  state.resumeScheduled = true;
31991
31991
  process.nextTick(resume_, stream, state);
@@ -32885,7 +32885,7 @@ var require_buffer_list2 = __commonJS({
32885
32885
  }
32886
32886
  }, {
32887
32887
  key: "join",
32888
- value: function join3(s2) {
32888
+ value: function join6(s2) {
32889
32889
  if (this.length === 0) return "";
32890
32890
  var p = this.head;
32891
32891
  var ret = "" + p.data;
@@ -34707,12 +34707,12 @@ var require_stream_readable2 = __commonJS({
34707
34707
  if (!state.flowing) {
34708
34708
  debug("resume");
34709
34709
  state.flowing = !state.readableListening;
34710
- resume(this, state);
34710
+ resume2(this, state);
34711
34711
  }
34712
34712
  state.paused = false;
34713
34713
  return this;
34714
34714
  };
34715
- function resume(stream, state) {
34715
+ function resume2(stream, state) {
34716
34716
  if (!state.resumeScheduled) {
34717
34717
  state.resumeScheduled = true;
34718
34718
  process.nextTick(resume_, stream, state);
@@ -36015,7 +36015,7 @@ var init_types = __esm({
36015
36015
  });
36016
36016
 
36017
36017
  // src/commands/cluster/types.ts
36018
- var ClusterChangeFragment, ClusterAutoscaleFragment, ClusterOverviewFragment, ClusterHealthFragment, ClusterScaleEventFragment;
36018
+ var ClusterChangeFragment, ClusterAutoscaleFragment, ClusterOverviewFragment, ClusterHealthFragment, ClusterScaleEventFragment, ClusterNodeFragment;
36019
36019
  var init_types2 = __esm({
36020
36020
  "src/commands/cluster/types.ts"() {
36021
36021
  ClusterChangeFragment = `
@@ -36133,6 +36133,23 @@ cpuRequestsPercent
36133
36133
  memRequestsPercent
36134
36134
  pendingPods
36135
36135
  error
36136
+ `;
36137
+ ClusterNodeFragment = `
36138
+ name
36139
+ pool
36140
+ reserved
36141
+ status
36142
+ cordoned
36143
+ internalIp
36144
+ cpuCores
36145
+ memoryGb
36146
+ osImage
36147
+ kubeletVersion
36148
+ joinedAt
36149
+ addedAt
36150
+ recorded
36151
+ source
36152
+ role
36136
36153
  `;
36137
36154
  }
36138
36155
  });
@@ -37211,6 +37228,127 @@ var init_gql_client = __esm({
37211
37228
  variables: { projectId }
37212
37229
  }).pipe((0, import_operators.map)((res) => res.projectClustersOverview ?? []));
37213
37230
  }
37231
+ // Self-managed machines attached to a Talos cluster (cluster-provisioner,
37232
+ // feature self-managed-nodes; ADMIN in phase 1).
37233
+ static clusterNodeJoinConfig(input) {
37234
+ return this.query({
37235
+ query: gql`
37236
+ mutation clusterNodeJoinConfig(
37237
+ $clusterId: String!
37238
+ $name: String!
37239
+ $pool: String
37240
+ $reserved: Boolean
37241
+ $installDisk: String
37242
+ ) {
37243
+ clusterNodeJoinConfig(
37244
+ clusterId: $clusterId
37245
+ name: $name
37246
+ pool: $pool
37247
+ reserved: $reserved
37248
+ installDisk: $installDisk
37249
+ ) {
37250
+ clusterName
37251
+ nodeName
37252
+ pool
37253
+ reserved
37254
+ config
37255
+ talosVersion
37256
+ isoUrl
37257
+ isoUrlArm64
37258
+ endpoint
37259
+ }
37260
+ }
37261
+ `,
37262
+ variables: input
37263
+ }).pipe((0, import_operators.map)((res) => res.clusterNodeJoinConfig));
37264
+ }
37265
+ static clusterAttachInfo(clusterId) {
37266
+ return this.query({
37267
+ query: gql`
37268
+ query clusterAttachInfo($clusterId: String!) {
37269
+ clusterAttachInfo(clusterId: $clusterId) {
37270
+ clusterName
37271
+ attachable
37272
+ reason
37273
+ kubespanEnabled
37274
+ talosVersion
37275
+ isoUrl
37276
+ isoUrlArm64
37277
+ }
37278
+ }
37279
+ `,
37280
+ variables: { clusterId }
37281
+ }).pipe((0, import_operators.map)((res) => res.clusterAttachInfo));
37282
+ }
37283
+ /** includeCloud: also the cluster's Hetzner nodes (default: attached
37284
+ machines only, which is what cluster:attach waits on). */
37285
+ static clusterNodes(clusterId, includeCloud = false) {
37286
+ return this.query({
37287
+ query: gql`
37288
+ query clusterNodes($clusterId: String!, $includeCloud: Boolean) {
37289
+ clusterNodes(clusterId: $clusterId, includeCloud: $includeCloud) {
37290
+ ${ClusterNodeFragment}
37291
+ }
37292
+ }
37293
+ `,
37294
+ variables: { clusterId, includeCloud }
37295
+ }).pipe((0, import_operators.map)((res) => res.clusterNodes ?? []));
37296
+ }
37297
+ static clusterTalosconfig(projectId, clusterId, ttlMinutes) {
37298
+ return this.query({
37299
+ query: gql`
37300
+ query clusterTalosconfig(
37301
+ $projectId: String!
37302
+ $clusterId: String!
37303
+ $ttlMinutes: Int
37304
+ ) {
37305
+ clusterTalosconfig(
37306
+ projectId: $projectId
37307
+ clusterId: $clusterId
37308
+ ttlMinutes: $ttlMinutes
37309
+ ) {
37310
+ talosconfig
37311
+ expiresAt
37312
+ endpoint
37313
+ talosVersion
37314
+ }
37315
+ }
37316
+ `,
37317
+ variables: { projectId, clusterId, ttlMinutes }
37318
+ }).pipe((0, import_operators.map)((res) => res.clusterTalosconfig));
37319
+ }
37320
+ static setClusterNodePaused(clusterId, name2, paused) {
37321
+ return this.query({
37322
+ query: gql`
37323
+ mutation setClusterNodePaused(
37324
+ $clusterId: String!
37325
+ $name: String!
37326
+ $paused: Boolean!
37327
+ ) {
37328
+ setClusterNodePaused(
37329
+ clusterId: $clusterId
37330
+ name: $name
37331
+ paused: $paused
37332
+ ) {
37333
+ ${ClusterNodeFragment}
37334
+ }
37335
+ }
37336
+ `,
37337
+ variables: { clusterId, name: name2, paused }
37338
+ }).pipe((0, import_operators.map)((res) => res.setClusterNodePaused));
37339
+ }
37340
+ static detachClusterNode(clusterId, name2) {
37341
+ return this.query({
37342
+ query: gql`
37343
+ mutation detachClusterNode($clusterId: String!, $name: String!) {
37344
+ detachClusterNode(clusterId: $clusterId, name: $name) {
37345
+ ${ClusterNodeFragment}
37346
+ }
37347
+ }
37348
+ `,
37349
+ variables: { clusterId, name: name2 }
37350
+ }).pipe((0, import_operators.map)((res) => res.detachClusterNode));
37351
+ }
37214
37352
  static clusterHealth(projectId, clusterId, limit = 1) {
37215
37353
  return this.query({
37216
37354
  query: gql`
@@ -38155,13 +38293,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
38155
38293
  if (g[n]) {
38156
38294
  i2[n] = function(v) {
38157
38295
  return new Promise(function(a, b) {
38158
- q.push([n, v, a, b]) > 1 || resume(n, v);
38296
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
38159
38297
  });
38160
38298
  };
38161
38299
  if (f3) i2[n] = f3(i2[n]);
38162
38300
  }
38163
38301
  }
38164
- function resume(n, v) {
38302
+ function resume2(n, v) {
38165
38303
  try {
38166
38304
  step(g[n](v));
38167
38305
  } catch (e2) {
@@ -38172,13 +38310,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
38172
38310
  r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
38173
38311
  }
38174
38312
  function fulfill(value) {
38175
- resume("next", value);
38313
+ resume2("next", value);
38176
38314
  }
38177
38315
  function reject(value) {
38178
- resume("throw", value);
38316
+ resume2("throw", value);
38179
38317
  }
38180
38318
  function settle(f3, v) {
38181
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
38319
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
38182
38320
  }
38183
38321
  }
38184
38322
  function __asyncDelegator(o) {
@@ -38580,7 +38718,7 @@ var require_util = __commonJS({
38580
38718
  return path2;
38581
38719
  }
38582
38720
  exports2.normalize = normalize2;
38583
- function join3(aRoot, aPath) {
38721
+ function join6(aRoot, aPath) {
38584
38722
  if (aRoot === "") {
38585
38723
  aRoot = ".";
38586
38724
  }
@@ -38612,7 +38750,7 @@ var require_util = __commonJS({
38612
38750
  }
38613
38751
  return joined;
38614
38752
  }
38615
- exports2.join = join3;
38753
+ exports2.join = join6;
38616
38754
  exports2.isAbsolute = function(aPath) {
38617
38755
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
38618
38756
  };
@@ -38785,7 +38923,7 @@ var require_util = __commonJS({
38785
38923
  parsed.path = parsed.path.substring(0, index + 1);
38786
38924
  }
38787
38925
  }
38788
- sourceURL = join3(urlGenerate(parsed), sourceURL);
38926
+ sourceURL = join6(urlGenerate(parsed), sourceURL);
38789
38927
  }
38790
38928
  return normalize2(sourceURL);
38791
38929
  }
@@ -42911,7 +43049,7 @@ var require_typescript = __commonJS({
42911
43049
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
42912
43050
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
42913
43051
  writeCommentRange: () => writeCommentRange,
42914
- writeFile: () => writeFile9,
43052
+ writeFile: () => writeFile13,
42915
43053
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
42916
43054
  zipWith: () => zipWith
42917
43055
  });
@@ -61554,7 +61692,7 @@ ${lanes.join("\n")}
61554
61692
  sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
61555
61693
  return combinePaths(newDirPath, sourceFilePath);
61556
61694
  }
61557
- function writeFile9(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
61695
+ function writeFile13(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
61558
61696
  host.writeFile(
61559
61697
  fileName,
61560
61698
  text,
@@ -74076,8 +74214,8 @@ ${lanes.join("\n")}
74076
74214
  return void 0;
74077
74215
  }
74078
74216
  function tryRenameExternalModule(factory2, moduleName, sourceFile) {
74079
- const rename = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);
74080
- return rename ? factory2.createStringLiteral(rename) : void 0;
74217
+ const rename2 = sourceFile.renamedDependencies && sourceFile.renamedDependencies.get(moduleName.text);
74218
+ return rename2 ? factory2.createStringLiteral(rename2) : void 0;
74081
74219
  }
74082
74220
  function tryGetModuleNameFromFile(factory2, file2, host, options) {
74083
74221
  if (!file2) {
@@ -170305,7 +170443,7 @@ ${lanes.join("\n")}
170305
170443
  return;
170306
170444
  }
170307
170445
  const buildInfo = host.getBuildInfo() || { version: version2 };
170308
- writeFile9(
170446
+ writeFile13(
170309
170447
  host,
170310
170448
  emitterDiagnostics,
170311
170449
  buildInfoPath,
@@ -170517,7 +170655,7 @@ ${lanes.join("\n")}
170517
170655
  }
170518
170656
  if (sourceMapFilePath) {
170519
170657
  const sourceMap = sourceMapGenerator.toString();
170520
- writeFile9(
170658
+ writeFile13(
170521
170659
  host,
170522
170660
  emitterDiagnostics,
170523
170661
  sourceMapFilePath,
@@ -170532,7 +170670,7 @@ ${lanes.join("\n")}
170532
170670
  }
170533
170671
  const text = writer.getText();
170534
170672
  const data = { sourceMapUrlPos, diagnostics: transform22.diagnostics };
170535
- writeFile9(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
170673
+ writeFile13(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
170536
170674
  writer.clear();
170537
170675
  return !data.skippedDtsWrite;
170538
170676
  }
@@ -208198,19 +208336,19 @@ ${newComment.split("\n").map((c) => ` * ${c}`).join("\n")}
208198
208336
  }
208199
208337
  function convertNamedExport(sourceFile, assignment, changes, exports22) {
208200
208338
  const { text } = assignment.left.name;
208201
- const rename = exports22.get(text);
208202
- if (rename !== void 0) {
208339
+ const rename2 = exports22.get(text);
208340
+ if (rename2 !== void 0) {
208203
208341
  const newNodes = [
208204
208342
  makeConst(
208205
208343
  /*modifiers*/
208206
208344
  void 0,
208207
- rename,
208345
+ rename2,
208208
208346
  assignment.right
208209
208347
  ),
208210
208348
  makeExportDeclaration([factory.createExportSpecifier(
208211
208349
  /*isTypeOnly*/
208212
208350
  false,
208213
- rename,
208351
+ rename2,
208214
208352
  text
208215
208353
  )])
208216
208354
  ];
@@ -238414,7 +238552,7 @@ ${options.prefix}` : "\n" : options.prefix
238414
238552
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
238415
238553
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
238416
238554
  writeCommentRange: () => writeCommentRange,
238417
- writeFile: () => writeFile9,
238555
+ writeFile: () => writeFile13,
238418
238556
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
238419
238557
  zipWith: () => zipWith
238420
238558
  });
@@ -255480,22 +255618,605 @@ var init_status = __esm({
255480
255618
  }
255481
255619
  });
255482
255620
 
255621
+ // src/commands/cluster/helpers/attach.ts
255622
+ function parseAttachOptions(cmd) {
255623
+ const nodeIp = (cmd.nodeIp ?? "").trim();
255624
+ const name2 = (cmd.name ?? "").trim();
255625
+ const pool = (cmd.pool ?? "").trim() || void 0;
255626
+ const disk = (cmd.disk ?? "").trim() || void 0;
255627
+ if (!nodeIp || !HOST_RE.test(nodeIp)) {
255628
+ throw new Error(
255629
+ "--node-ip is required: the machine's address on your network, shown on its screen after booting the Talos ISO (e.g. 192.168.1.50)"
255630
+ );
255631
+ }
255632
+ if (!NAME_RE.test(name2)) {
255633
+ throw new Error(
255634
+ "--name is required: lowercase letters, digits and dashes (it becomes the machine hostname, e.g. home-1)"
255635
+ );
255636
+ }
255637
+ if (pool && !POOL_RE.test(pool)) {
255638
+ throw new Error("--pool: lowercase letters, digits and dashes (max 32)");
255639
+ }
255640
+ if (disk && !DISK_RE.test(disk)) {
255641
+ throw new Error("--disk must look like /dev/nvme0n1 or /dev/sda");
255642
+ }
255643
+ const timeoutMinutes = cmd.timeout === void 0 ? 10 : Number(cmd.timeout);
255644
+ if (!Number.isFinite(timeoutMinutes) || timeoutMinutes < 1 || timeoutMinutes > 60) {
255645
+ throw new Error("--timeout is in minutes, 1 to 60");
255646
+ }
255647
+ return {
255648
+ nodeIp,
255649
+ name: name2,
255650
+ pool,
255651
+ disk,
255652
+ reserved: !!cmd.reserved,
255653
+ yes: !!cmd.yes,
255654
+ wait: cmd.wait !== false,
255655
+ timeoutMs: timeoutMinutes * 6e4
255656
+ };
255657
+ }
255658
+ function serverTalosVersion(output) {
255659
+ const spec = output.split(/^spec:/m)[1];
255660
+ return spec?.match(/^\s+version:\s*(v[\d.]+\S*)/m)?.[1];
255661
+ }
255662
+ var NAME_RE, POOL_RE, DISK_RE, HOST_RE, nodeRow, resetHint;
255663
+ var init_attach = __esm({
255664
+ "src/commands/cluster/helpers/attach.ts"() {
255665
+ NAME_RE = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/;
255666
+ POOL_RE = /^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$/;
255667
+ DISK_RE = /^\/dev\/[A-Za-z0-9/_-]+$/;
255668
+ HOST_RE = /^[A-Za-z0-9.:-]+$/;
255669
+ nodeRow = (n) => {
255670
+ const own = n.source !== "hetzner";
255671
+ return {
255672
+ node: n.name,
255673
+ role: n.role === "control-plane" ? "control plane" : "worker",
255674
+ source: own ? "own" : "hetzner",
255675
+ status: n.cordoned ? `${n.status}, paused` : n.status,
255676
+ pool: own ? n.pool ?? "-" : "-",
255677
+ use: own ? n.reserved ? "reserved" : "capacity" : "-",
255678
+ ip: n.internalIp ?? "-",
255679
+ cpu: n.cpuCores ?? "-",
255680
+ memoryGb: n.memoryGb ?? "-",
255681
+ talos: n.osImage ?? "-",
255682
+ joined: n.joinedAt ?? "-",
255683
+ ...own && !n.recorded ? { note: "joined by hand" } : {}
255684
+ };
255685
+ };
255686
+ resetHint = (clusterId = "<cluster-id>", name2 = "<machine-name>", ip = "<machine-ip>") => `gcli cluster:reset-machine --cluster ${clusterId} --name ${name2} --node-ip ${ip}`;
255687
+ }
255688
+ });
255689
+
255690
+ // src/commands/cluster/helpers/talosctl.ts
255691
+ function talosctlAssetName(platform = process.platform, arch = process.arch) {
255692
+ const os2 = platform === "win32" ? "windows" : platform === "darwin" ? "darwin" : platform === "linux" ? "linux" : null;
255693
+ const cpu = arch === "x64" ? "amd64" : arch === "arm64" ? "arm64" : null;
255694
+ if (!os2 || !cpu) {
255695
+ throw new Error(
255696
+ `No talosctl release for ${platform}/${arch}. Install talosctl yourself: https://www.talos.dev/latest/talos-guides/install/talosctl/`
255697
+ );
255698
+ }
255699
+ return `talosctl-${os2}-${cpu}${os2 === "windows" ? ".exe" : ""}`;
255700
+ }
255701
+ function checksumFor(sums, asset) {
255702
+ for (const line of sums.split("\n")) {
255703
+ const [hash2, name2] = line.trim().split(/\s+\*?/);
255704
+ if (name2 === asset && /^[a-f0-9]{64}$/i.test(hash2 ?? "")) {
255705
+ return hash2.toLowerCase();
255706
+ }
255707
+ }
255708
+ return null;
255709
+ }
255710
+ async function download(url2) {
255711
+ const res = await fetch(url2);
255712
+ if (!res.ok) {
255713
+ throw new Error(`Download failed (${res.status}): ${url2}`);
255714
+ }
255715
+ return Buffer.from(await res.arrayBuffer());
255716
+ }
255717
+ async function ensureTalosctl(version2) {
255718
+ if (!VERSION_RE.test(version2)) {
255719
+ throw new Error(`Unknown Talos version "${version2}"`);
255720
+ }
255721
+ const onPath = await runBinary("talosctl", [
255722
+ "version",
255723
+ "--client",
255724
+ "--short"
255725
+ ]);
255726
+ if (onPath.code === 0 && clientVersionOf(onPath.stdout) === version2) {
255727
+ return "talosctl";
255728
+ }
255729
+ const asset = talosctlAssetName();
255730
+ const dir = (0, import_path.join)(mainDirectory, "bin");
255731
+ const binary = (0, import_path.join)(
255732
+ dir,
255733
+ `talosctl-${version2}${asset.endsWith(".exe") ? ".exe" : ""}`
255734
+ );
255735
+ if ((0, import_fs3.existsSync)(binary)) {
255736
+ return binary;
255737
+ }
255738
+ Logger.info(
255739
+ `Downloading talosctl ${version2} (${asset}, about 90 MB, once) from the Talos releases ...`
255740
+ );
255741
+ const sums = (await download(`${RELEASES}/${version2}/sha256sum.txt`)).toString("utf8");
255742
+ const expected = checksumFor(sums, asset);
255743
+ if (!expected) {
255744
+ throw new Error(`The ${version2} release lists no checksum for ${asset}.`);
255745
+ }
255746
+ const body = await download(`${RELEASES}/${version2}/${asset}`);
255747
+ const actual = (0, import_crypto.createHash)("sha256").update(body).digest("hex");
255748
+ if (actual !== expected) {
255749
+ throw new Error(
255750
+ `Checksum mismatch for ${asset} ${version2} - the download was not used.`
255751
+ );
255752
+ }
255753
+ await (0, import_promises.mkdir)(dir, { recursive: true });
255754
+ const partial2 = `${binary}.partial`;
255755
+ await (0, import_promises.writeFile)(partial2, body, { mode: 493 });
255756
+ await (0, import_promises.chmod)(partial2, 493);
255757
+ await (0, import_promises.rename)(partial2, binary);
255758
+ Logger.info(`talosctl ${version2} saved to ${binary}`);
255759
+ return binary;
255760
+ }
255761
+ var import_child_process, import_crypto, import_fs3, import_promises, import_path, RELEASES, VERSION_RE, clientVersionOf, runBinary;
255762
+ var init_talosctl = __esm({
255763
+ "src/commands/cluster/helpers/talosctl.ts"() {
255764
+ import_child_process = require("child_process");
255765
+ import_crypto = require("crypto");
255766
+ import_fs3 = require("fs");
255767
+ import_promises = require("fs/promises");
255768
+ import_path = require("path");
255769
+ init_log();
255770
+ init_types();
255771
+ RELEASES = "https://github.com/siderolabs/talos/releases/download";
255772
+ VERSION_RE = /^v\d+\.\d+\.\d+$/;
255773
+ clientVersionOf = (output) => output.match(/Talos (v\d+\.\d+\.\d+\S*)/)?.[1] ?? null;
255774
+ runBinary = (binary, args, timeoutMs = 2e4) => new Promise(
255775
+ (resolve2) => (0, import_child_process.execFile)(
255776
+ binary,
255777
+ args,
255778
+ { timeout: timeoutMs, maxBuffer: 10 * 1024 * 1024 },
255779
+ (error48, stdout, stderr) => resolve2({
255780
+ code: error48 ? error48.code ?? 1 : 0,
255781
+ stdout: String(stdout),
255782
+ stderr: String(stderr)
255783
+ })
255784
+ )
255785
+ );
255786
+ }
255787
+ });
255788
+
255789
+ // src/commands/cluster/attach.ts
255790
+ var attach_exports = {};
255791
+ __export(attach_exports, {
255792
+ default: () => attach_default
255793
+ });
255794
+ var import_promises2, import_os2, import_path2, import_readline, import_rxjs17, sleep, ask, attach_default;
255795
+ var init_attach2 = __esm({
255796
+ "src/commands/cluster/attach.ts"() {
255797
+ import_promises2 = require("fs/promises");
255798
+ import_os2 = require("os");
255799
+ import_path2 = require("path");
255800
+ import_readline = require("readline");
255801
+ import_rxjs17 = __toESM(require_cjs());
255802
+ init_gql_client();
255803
+ init_log();
255804
+ init_attach();
255805
+ init_cluster_change();
255806
+ init_talosctl();
255807
+ sleep = (ms) => new Promise((r2) => setTimeout(r2, ms));
255808
+ ask = (question) => new Promise((resolve2) => {
255809
+ const rl = (0, import_readline.createInterface)({
255810
+ input: process.stdin,
255811
+ output: process.stdout
255812
+ });
255813
+ rl.question(question, (answer) => {
255814
+ rl.close();
255815
+ resolve2(answer.trim());
255816
+ });
255817
+ });
255818
+ attach_default = async (cmd) => {
255819
+ const opts = parseAttachOptions(cmd);
255820
+ const { clusterId } = await resolveClusterTarget(cmd);
255821
+ const info = await (0, import_rxjs17.lastValueFrom)(
255822
+ GraphqlClienAPI.clusterAttachInfo(clusterId)
255823
+ );
255824
+ if (!info.attachable) {
255825
+ throw new Error(
255826
+ info.reason ?? "Machines cannot be attached to this cluster."
255827
+ );
255828
+ }
255829
+ const binary = info.talosVersion ? await ensureTalosctl(info.talosVersion) : "talosctl";
255830
+ const talosctl = (args, timeoutMs = 2e4) => runBinary(binary, args, timeoutMs);
255831
+ if ((await talosctl(["version", "--client"])).code !== 0) {
255832
+ throw new Error(
255833
+ "talosctl is not available. Install it: https://www.talos.dev/latest/talos-guides/install/talosctl/"
255834
+ );
255835
+ }
255836
+ Logger.info(`Looking for the Talos installer at ${opts.nodeIp}:50000 ...`);
255837
+ let version2;
255838
+ for (let i2 = 0; i2 < 12 && !version2; i2++) {
255839
+ const probe = await talosctl([
255840
+ "-n",
255841
+ opts.nodeIp,
255842
+ "get",
255843
+ "version",
255844
+ "--insecure",
255845
+ "-o",
255846
+ "yaml"
255847
+ ]);
255848
+ version2 = probe.code === 0 ? serverTalosVersion(probe.stdout) : void 0;
255849
+ if (!version2) await sleep(5e3);
255850
+ }
255851
+ if (!version2) {
255852
+ throw new Error(
255853
+ `No Talos installer answers at ${opts.nodeIp}:50000. Boot the machine from the Talos ${info.talosVersion ?? ""} ISO (${info.isoUrl ?? "https://github.com/siderolabs/talos/releases"}; ARM: ${info.isoUrlArm64 ?? "-"}) and run this from the same network.`
255854
+ );
255855
+ }
255856
+ Logger.info(`Machine runs the Talos ${version2} installer. Its disks:`);
255857
+ const disks = await talosctl([
255858
+ "-n",
255859
+ opts.nodeIp,
255860
+ "get",
255861
+ "disks",
255862
+ "--insecure"
255863
+ ]);
255864
+ Logger.log(disks.stdout || disks.stderr);
255865
+ if (!opts.disk) {
255866
+ throw new Error(
255867
+ `Pick the install disk from the list above and run again with --disk, e.g. --disk /dev/nvme0n1. It is WIPED. Nothing was changed.`
255868
+ );
255869
+ }
255870
+ if (!opts.yes) {
255871
+ const answer = await ask(
255872
+ `Talos will WIPE ${opts.disk} on ${opts.nodeIp}. Type the machine name (${opts.name}) to continue: `
255873
+ );
255874
+ if (answer !== opts.name) {
255875
+ Logger.warn("Cancelled - nothing was changed.");
255876
+ return;
255877
+ }
255878
+ }
255879
+ const join_ = await (0, import_rxjs17.lastValueFrom)(
255880
+ GraphqlClienAPI.clusterNodeJoinConfig({
255881
+ clusterId,
255882
+ name: opts.name,
255883
+ pool: opts.pool,
255884
+ reserved: opts.reserved,
255885
+ installDisk: opts.disk
255886
+ })
255887
+ );
255888
+ if (join_.talosVersion && join_.talosVersion !== version2) {
255889
+ Logger.warn(
255890
+ `The cluster runs Talos ${join_.talosVersion}, the machine booted ${version2}. It installs ${join_.talosVersion} anyway; if the join fails, boot ${join_.isoUrl}.`
255891
+ );
255892
+ }
255893
+ const dir = await (0, import_promises2.mkdtemp)((0, import_path2.join)((0, import_os2.tmpdir)(), "gcli-attach-"));
255894
+ const file2 = (0, import_path2.join)(dir, "machine.yaml");
255895
+ try {
255896
+ await (0, import_promises2.writeFile)(file2, join_.config, { mode: 384 });
255897
+ const applied = await talosctl(
255898
+ ["-n", opts.nodeIp, "apply-config", "--insecure", "--file", file2],
255899
+ 6e4
255900
+ );
255901
+ if (applied.code !== 0) {
255902
+ throw new Error(
255903
+ `talosctl apply-config failed: ${(applied.stderr || applied.stdout).trim()}`
255904
+ );
255905
+ }
255906
+ } finally {
255907
+ await (0, import_promises2.rm)(dir, { recursive: true, force: true });
255908
+ }
255909
+ Logger.info(
255910
+ `Config applied - ${opts.name} installs Talos and reboots, then joins "${join_.clusterName}" (pool ${join_.pool}, ${join_.reserved ? "reserved" : "extra capacity"}).`
255911
+ );
255912
+ if (!opts.wait) {
255913
+ Logger.info("Check progress with: gcli cluster:nodes");
255914
+ return;
255915
+ }
255916
+ Logger.info(
255917
+ "Waiting for it to join (install + reboot take a few minutes) ..."
255918
+ );
255919
+ const deadline = Date.now() + opts.timeoutMs;
255920
+ while (Date.now() < deadline) {
255921
+ await sleep(15e3);
255922
+ const nodes = await (0, import_rxjs17.lastValueFrom)(GraphqlClienAPI.clusterNodes(clusterId));
255923
+ const node = nodes.find((n) => n.name === opts.name);
255924
+ if (node?.status === "ready") {
255925
+ Logger.log(`${opts.name} joined and is ready.`);
255926
+ Logger.table([nodeRow(node)]);
255927
+ return;
255928
+ }
255929
+ }
255930
+ Logger.warn(
255931
+ `${opts.name} has not joined yet. Check gcli cluster:nodes later; if it never joins, reset it (${resetHint(clusterId, opts.name, opts.nodeIp)}) and attach again.`
255932
+ );
255933
+ };
255934
+ }
255935
+ });
255936
+
255937
+ // src/commands/cluster/nodes.ts
255938
+ var nodes_exports = {};
255939
+ __export(nodes_exports, {
255940
+ default: () => nodes_default
255941
+ });
255942
+ var import_rxjs18, nodes_default;
255943
+ var init_nodes = __esm({
255944
+ "src/commands/cluster/nodes.ts"() {
255945
+ import_rxjs18 = __toESM(require_cjs());
255946
+ init_gql_client();
255947
+ init_log();
255948
+ init_attach();
255949
+ init_cluster_change();
255950
+ nodes_default = async (cmd) => {
255951
+ const { clusterId } = await resolveClusterTarget(cmd);
255952
+ const nodes = await (0, import_rxjs18.lastValueFrom)(
255953
+ GraphqlClienAPI.clusterNodes(clusterId, true)
255954
+ );
255955
+ if (!nodes.length) {
255956
+ Logger.info("No nodes reported for this cluster yet.");
255957
+ return;
255958
+ }
255959
+ Logger.table(nodes.map(nodeRow));
255960
+ if (!nodes.some((n) => n.source !== "hetzner")) {
255961
+ Logger.info(
255962
+ "No machines of your own attached. Attach one with: gcli cluster:attach --cluster <id> --node-ip <ip> --name <name> --disk <disk>"
255963
+ );
255964
+ }
255965
+ };
255966
+ }
255967
+ });
255968
+
255969
+ // src/commands/cluster/pause.ts
255970
+ var pause_exports = {};
255971
+ __export(pause_exports, {
255972
+ pause: () => pause,
255973
+ resume: () => resume
255974
+ });
255975
+ var import_rxjs19, setPaused, pause, resume;
255976
+ var init_pause = __esm({
255977
+ "src/commands/cluster/pause.ts"() {
255978
+ import_rxjs19 = __toESM(require_cjs());
255979
+ init_gql_client();
255980
+ init_log();
255981
+ init_cluster_change();
255982
+ setPaused = (paused) => async (cmd) => {
255983
+ const name2 = (cmd.name ?? "").trim();
255984
+ if (!name2) {
255985
+ throw new Error("--name is required (see gcli cluster:nodes)");
255986
+ }
255987
+ const { clusterId } = await resolveClusterTarget(cmd);
255988
+ const node = await (0, import_rxjs19.lastValueFrom)(
255989
+ GraphqlClienAPI.setClusterNodePaused(clusterId, name2, paused)
255990
+ );
255991
+ Logger.log(
255992
+ paused ? `${node.name} is paused: nothing new runs there, running work stays. Undo with gcli cluster:resume.` : `${node.name} takes new work again.`
255993
+ );
255994
+ };
255995
+ pause = setPaused(true);
255996
+ resume = setPaused(false);
255997
+ }
255998
+ });
255999
+
256000
+ // src/commands/cluster/reset-machine.ts
256001
+ var reset_machine_exports = {};
256002
+ __export(reset_machine_exports, {
256003
+ default: () => reset_machine_default,
256004
+ hostnameOf: () => hostnameOf
256005
+ });
256006
+ var import_promises3, import_os3, import_path3, import_readline2, import_rxjs20, hostnameOf, reset_machine_default;
256007
+ var init_reset_machine = __esm({
256008
+ "src/commands/cluster/reset-machine.ts"() {
256009
+ import_promises3 = require("fs/promises");
256010
+ import_os3 = require("os");
256011
+ import_path3 = require("path");
256012
+ import_readline2 = require("readline");
256013
+ import_rxjs20 = __toESM(require_cjs());
256014
+ init_gql_client();
256015
+ init_log();
256016
+ init_attach();
256017
+ init_cluster_change();
256018
+ init_talosctl();
256019
+ hostnameOf = (yaml) => yaml.match(/^\s*hostname:\s*(\S+)/m)?.[1] ?? null;
256020
+ reset_machine_default = async (cmd) => {
256021
+ const name2 = (cmd.name ?? "").trim();
256022
+ const ip = (cmd.nodeIp ?? "").trim();
256023
+ if (!NAME_RE.test(name2)) {
256024
+ throw new Error(
256025
+ "--name is required: the machine name (see gcli cluster:nodes)"
256026
+ );
256027
+ }
256028
+ if (!HOST_RE.test(ip)) {
256029
+ throw new Error(
256030
+ "--node-ip is required: the machine's address on your network"
256031
+ );
256032
+ }
256033
+ const { projectId, clusterId } = await resolveClusterTarget(cmd);
256034
+ const node = (await (0, import_rxjs20.lastValueFrom)(GraphqlClienAPI.clusterNodes(clusterId, true))).find((n) => n.name === name2);
256035
+ if (node?.source === "hetzner") {
256036
+ throw new Error(
256037
+ `${name2} is a Hetzner node - those are removed by scaling the cluster.`
256038
+ );
256039
+ }
256040
+ if (node && (node.status === "ready" || node.status === "not-ready")) {
256041
+ throw new Error(
256042
+ `${name2} is still in the cluster. Detach it first: gcli cluster:detach --cluster ${clusterId} --name ${name2}`
256043
+ );
256044
+ }
256045
+ const access = await (0, import_rxjs20.lastValueFrom)(
256046
+ GraphqlClienAPI.clusterTalosconfig(projectId, clusterId, 15)
256047
+ );
256048
+ const binary = access.talosVersion ? await ensureTalosctl(access.talosVersion) : "talosctl";
256049
+ const dir = await (0, import_promises3.mkdtemp)((0, import_path3.join)((0, import_os3.tmpdir)(), "gcli-reset-"));
256050
+ const config2 = (0, import_path3.join)(dir, "talosconfig");
256051
+ try {
256052
+ await (0, import_promises3.writeFile)(config2, access.talosconfig, { mode: 384 });
256053
+ const talos = (args, timeoutMs = 3e4) => runBinary(
256054
+ binary,
256055
+ ["--talosconfig", config2, "-e", ip, "-n", ip, ...args],
256056
+ timeoutMs
256057
+ );
256058
+ const status2 = await talos(["get", "hostnamestatus", "-o", "yaml"]);
256059
+ if (status2.code !== 0) {
256060
+ throw new Error(
256061
+ `Cannot reach the machine at ${ip} with this cluster's credentials: ${(status2.stderr || status2.stdout).trim().split("\n")[0]}. It must be on this network and still configured for this cluster (a machine in maintenance mode needs no reset).`
256062
+ );
256063
+ }
256064
+ const actual = hostnameOf(status2.stdout);
256065
+ if (actual !== name2) {
256066
+ throw new Error(
256067
+ `The machine at ${ip} is "${actual ?? "unknown"}", not "${name2}" - nothing was changed.`
256068
+ );
256069
+ }
256070
+ if (!cmd.yes) {
256071
+ const answer = await new Promise((resolve2) => {
256072
+ const rl = (0, import_readline2.createInterface)({
256073
+ input: process.stdin,
256074
+ output: process.stdout
256075
+ });
256076
+ rl.question(
256077
+ `Wipe the config and data of ${name2} (${ip})? It reboots into maintenance mode, ready to attach again. Type the machine name to continue: `,
256078
+ (a) => {
256079
+ rl.close();
256080
+ resolve2(a.trim());
256081
+ }
256082
+ );
256083
+ });
256084
+ if (answer !== name2) {
256085
+ Logger.warn("Cancelled - nothing was changed.");
256086
+ return;
256087
+ }
256088
+ }
256089
+ const reset = await talos(
256090
+ [
256091
+ "reset",
256092
+ "--graceful=false",
256093
+ "--reboot",
256094
+ "--wait=false",
256095
+ "--system-labels-to-wipe",
256096
+ "STATE",
256097
+ "--system-labels-to-wipe",
256098
+ "EPHEMERAL"
256099
+ ],
256100
+ 6e4
256101
+ );
256102
+ if (reset.code !== 0) {
256103
+ throw new Error(
256104
+ `Reset failed: ${(reset.stderr || reset.stdout).trim().split("\n")[0]}`
256105
+ );
256106
+ }
256107
+ Logger.log(
256108
+ `${name2} is resetting. In a few minutes its screen shows "Maintenance"; attach it again with gcli cluster:attach.`
256109
+ );
256110
+ } finally {
256111
+ await (0, import_promises3.rm)(dir, { recursive: true, force: true });
256112
+ }
256113
+ };
256114
+ }
256115
+ });
256116
+
256117
+ // src/commands/cluster/talosconfig.ts
256118
+ var talosconfig_exports = {};
256119
+ __export(talosconfig_exports, {
256120
+ default: () => talosconfig_default
256121
+ });
256122
+ var import_promises4, import_rxjs21, talosconfig_default;
256123
+ var init_talosconfig = __esm({
256124
+ "src/commands/cluster/talosconfig.ts"() {
256125
+ import_promises4 = require("fs/promises");
256126
+ import_rxjs21 = __toESM(require_cjs());
256127
+ init_gql_client();
256128
+ init_log();
256129
+ init_cluster_change();
256130
+ talosconfig_default = async (cmd) => {
256131
+ const ttl = cmd.ttl === void 0 ? void 0 : Number(cmd.ttl);
256132
+ if (ttl !== void 0 && (!Number.isInteger(ttl) || ttl < 5 || ttl > 1440)) {
256133
+ throw new Error("--ttl is in minutes, 5 to 1440");
256134
+ }
256135
+ const { projectId, clusterId } = await resolveClusterTarget(cmd);
256136
+ const res = await (0, import_rxjs21.lastValueFrom)(
256137
+ GraphqlClienAPI.clusterTalosconfig(projectId, clusterId, ttl)
256138
+ );
256139
+ if (!cmd.output) {
256140
+ process.stdout.write(res.talosconfig);
256141
+ return;
256142
+ }
256143
+ await (0, import_promises4.writeFile)(cmd.output, res.talosconfig, { mode: 384 });
256144
+ Logger.log(
256145
+ `Wrote talosconfig to ${cmd.output} (valid until ${res.expiresAt}).`
256146
+ );
256147
+ Logger.info(
256148
+ `Use it with: talosctl --talosconfig ${cmd.output} -n <node-ip> <command> (Talos ${res.talosVersion ?? ""})`
256149
+ );
256150
+ };
256151
+ }
256152
+ });
256153
+
256154
+ // src/commands/cluster/detach.ts
256155
+ var detach_exports = {};
256156
+ __export(detach_exports, {
256157
+ default: () => detach_default
256158
+ });
256159
+ var import_readline3, import_rxjs22, detach_default;
256160
+ var init_detach = __esm({
256161
+ "src/commands/cluster/detach.ts"() {
256162
+ import_readline3 = require("readline");
256163
+ import_rxjs22 = __toESM(require_cjs());
256164
+ init_gql_client();
256165
+ init_log();
256166
+ init_attach();
256167
+ init_cluster_change();
256168
+ detach_default = async (cmd) => {
256169
+ const name2 = (cmd.name ?? "").trim();
256170
+ if (!name2) {
256171
+ throw new Error("--name is required (see gcli cluster:nodes)");
256172
+ }
256173
+ const { clusterId } = await resolveClusterTarget(cmd);
256174
+ if (!cmd.yes) {
256175
+ const answer = await new Promise((resolve2) => {
256176
+ const rl = (0, import_readline3.createInterface)({
256177
+ input: process.stdin,
256178
+ output: process.stdout
256179
+ });
256180
+ rl.question(
256181
+ `Drain and remove ${name2} from the cluster? Its pods move to other nodes. [y/N] `,
256182
+ (a) => {
256183
+ rl.close();
256184
+ resolve2(a.trim().toLowerCase());
256185
+ }
256186
+ );
256187
+ });
256188
+ if (answer !== "y" && answer !== "yes") {
256189
+ Logger.warn("Cancelled - nothing was changed.");
256190
+ return;
256191
+ }
256192
+ }
256193
+ const node = await (0, import_rxjs22.lastValueFrom)(
256194
+ GraphqlClienAPI.detachClusterNode(clusterId, name2)
256195
+ );
256196
+ Logger.log(`${node.name} is detached.`);
256197
+ Logger.info(
256198
+ `The machine still runs Talos. To attach it again (or anywhere else), reset it from its network: ${resetHint(clusterId, node.name)}`
256199
+ );
256200
+ };
256201
+ }
256202
+ });
256203
+
255483
256204
  // src/commands/cluster/health.ts
255484
256205
  var health_exports = {};
255485
256206
  __export(health_exports, {
255486
256207
  default: () => health_default
255487
256208
  });
255488
- var import_rxjs17, pct2, health_default;
256209
+ var import_rxjs23, pct2, health_default;
255489
256210
  var init_health = __esm({
255490
256211
  "src/commands/cluster/health.ts"() {
255491
- import_rxjs17 = __toESM(require_cjs());
256212
+ import_rxjs23 = __toESM(require_cjs());
255492
256213
  init_gql_client();
255493
256214
  init_log();
255494
256215
  init_cluster_change();
255495
256216
  pct2 = (v) => v == null ? "-" : `${Math.round(v)}%`;
255496
256217
  health_default = async (cmd) => {
255497
256218
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255498
- const [latest] = await (0, import_rxjs17.lastValueFrom)(
256219
+ const [latest] = await (0, import_rxjs23.lastValueFrom)(
255499
256220
  GraphqlClienAPI.clusterHealth(projectId, clusterId, 1)
255500
256221
  );
255501
256222
  Logger.log("-------------------");
@@ -255542,17 +256263,17 @@ var scale_events_exports = {};
255542
256263
  __export(scale_events_exports, {
255543
256264
  default: () => scale_events_default
255544
256265
  });
255545
- var import_rxjs18, scale_events_default;
256266
+ var import_rxjs24, scale_events_default;
255546
256267
  var init_scale_events = __esm({
255547
256268
  "src/commands/cluster/scale-events.ts"() {
255548
- import_rxjs18 = __toESM(require_cjs());
256269
+ import_rxjs24 = __toESM(require_cjs());
255549
256270
  init_gql_client();
255550
256271
  init_log();
255551
256272
  init_cluster_change();
255552
256273
  scale_events_default = async (cmd) => {
255553
256274
  const limit = cmd.limit === void 0 ? 20 : parseIntOption("limit", cmd.limit, 1, 200);
255554
256275
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255555
- const events = await (0, import_rxjs18.lastValueFrom)(
256276
+ const events = await (0, import_rxjs24.lastValueFrom)(
255556
256277
  GraphqlClienAPI.clusterScaleEvents(projectId, clusterId, limit)
255557
256278
  );
255558
256279
  Logger.log("-------------------");
@@ -255582,17 +256303,17 @@ var cost_exports = {};
255582
256303
  __export(cost_exports, {
255583
256304
  default: () => cost_default
255584
256305
  });
255585
- var import_rxjs19, money, cost_default;
256306
+ var import_rxjs25, money, cost_default;
255586
256307
  var init_cost = __esm({
255587
256308
  "src/commands/cluster/cost.ts"() {
255588
- import_rxjs19 = __toESM(require_cjs());
256309
+ import_rxjs25 = __toESM(require_cjs());
255589
256310
  init_helpers();
255590
256311
  init_gql_client();
255591
256312
  init_log();
255592
256313
  money = (v, sign = "\u20AC") => v == null ? "-" : `${sign}${v.toFixed(2)}`;
255593
256314
  cost_default = async (cmd) => {
255594
- const projectId = await (0, import_rxjs19.lastValueFrom)(parseProjectId(cmd.project));
255595
- const rows = await (0, import_rxjs19.lastValueFrom)(
256315
+ const projectId = await (0, import_rxjs25.lastValueFrom)(parseProjectId(cmd.project));
256316
+ const rows = await (0, import_rxjs25.lastValueFrom)(
255596
256317
  GraphqlClienAPI.projectClustersOverview(projectId)
255597
256318
  );
255598
256319
  Logger.log("-------------------");
@@ -255680,10 +256401,10 @@ __export(autoscale_exports, {
255680
256401
  default: () => autoscale_default,
255681
256402
  toAutoscaleInput: () => toAutoscaleInput
255682
256403
  });
255683
- var import_rxjs20, toAutoscaleInput, autoscale_default;
256404
+ var import_rxjs26, toAutoscaleInput, autoscale_default;
255684
256405
  var init_autoscale = __esm({
255685
256406
  "src/commands/cluster/autoscale.ts"() {
255686
- import_rxjs20 = __toESM(require_cjs());
256407
+ import_rxjs26 = __toESM(require_cjs());
255687
256408
  init_gql_client();
255688
256409
  init_log();
255689
256410
  init_cluster_change();
@@ -255724,7 +256445,7 @@ var init_autoscale = __esm({
255724
256445
  autoscale_default = async (cmd) => {
255725
256446
  const input = toAutoscaleInput(cmd);
255726
256447
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255727
- const cluster = await (0, import_rxjs20.lastValueFrom)(
256448
+ const cluster = await (0, import_rxjs26.lastValueFrom)(
255728
256449
  GraphqlClienAPI.updateProjectClusterAutoscale(projectId, clusterId, input)
255729
256450
  );
255730
256451
  const a = cluster.autoscale ?? {};
@@ -255832,15 +256553,15 @@ var list_environments_exports = {};
255832
256553
  __export(list_environments_exports, {
255833
256554
  default: () => list_environments_default
255834
256555
  });
255835
- var import_rxjs21, import_operators12, list_environments_default;
256556
+ var import_rxjs27, import_operators12, list_environments_default;
255836
256557
  var init_list_environments = __esm({
255837
256558
  "src/commands/environment/list-environments.ts"() {
255838
- import_rxjs21 = __toESM(require_cjs());
256559
+ import_rxjs27 = __toESM(require_cjs());
255839
256560
  import_operators12 = __toESM(require_operators());
255840
256561
  init_helpers();
255841
256562
  init_gql_client();
255842
256563
  init_log();
255843
- list_environments_default = (cmd) => (0, import_rxjs21.lastValueFrom)(
256564
+ list_environments_default = (cmd) => (0, import_rxjs27.lastValueFrom)(
255844
256565
  parseProjectId(cmd.project).pipe(
255845
256566
  (0, import_operators12.switchMap)((projectId) => GraphqlClienAPI.listEnvironments(projectId)),
255846
256567
  (0, import_operators12.tap)((data) => {
@@ -255873,10 +256594,10 @@ var create_environment_exports = {};
255873
256594
  __export(create_environment_exports, {
255874
256595
  default: () => create_environment_default
255875
256596
  });
255876
- var import_rxjs22, import_operators13, create_environment_default;
256597
+ var import_rxjs28, import_operators13, create_environment_default;
255877
256598
  var init_create_environment = __esm({
255878
256599
  "src/commands/environment/create-environment.ts"() {
255879
- import_rxjs22 = __toESM(require_cjs());
256600
+ import_rxjs28 = __toESM(require_cjs());
255880
256601
  import_operators13 = __toESM(require_operators());
255881
256602
  init_helpers();
255882
256603
  init_gql_client();
@@ -255884,7 +256605,7 @@ var init_create_environment = __esm({
255884
256605
  init_load_spec();
255885
256606
  create_environment_default = (cmd) => {
255886
256607
  const { clusterName: cmdClusterName, ...cmdRest } = cmd;
255887
- return (0, import_rxjs22.lastValueFrom)(
256608
+ return (0, import_rxjs28.lastValueFrom)(
255888
256609
  parseProjectId(cmd.project).pipe(
255889
256610
  (0, import_operators13.switchMap)(
255890
256611
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -255939,10 +256660,10 @@ var update_environment_exports = {};
255939
256660
  __export(update_environment_exports, {
255940
256661
  default: () => update_environment_default
255941
256662
  });
255942
- var import_rxjs23, import_operators14, update_environment_default;
256663
+ var import_rxjs29, import_operators14, update_environment_default;
255943
256664
  var init_update_environment = __esm({
255944
256665
  "src/commands/environment/update-environment.ts"() {
255945
- import_rxjs23 = __toESM(require_cjs());
256666
+ import_rxjs29 = __toESM(require_cjs());
255946
256667
  import_operators14 = __toESM(require_operators());
255947
256668
  init_helpers();
255948
256669
  init_gql_client();
@@ -255950,7 +256671,7 @@ var init_update_environment = __esm({
255950
256671
  init_load_spec();
255951
256672
  update_environment_default = (cmd) => {
255952
256673
  const { clusterName: cmdClusterName, ...cmdRest } = cmd;
255953
- return (0, import_rxjs23.lastValueFrom)(
256674
+ return (0, import_rxjs29.lastValueFrom)(
255954
256675
  parseProjectId(cmd.project).pipe(
255955
256676
  (0, import_operators14.switchMap)(
255956
256677
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -256006,16 +256727,16 @@ var delete_environment_exports = {};
256006
256727
  __export(delete_environment_exports, {
256007
256728
  default: () => delete_environment_default
256008
256729
  });
256009
- var import_rxjs24, import_operators15, delete_environment_default;
256730
+ var import_rxjs30, import_operators15, delete_environment_default;
256010
256731
  var init_delete_environment = __esm({
256011
256732
  "src/commands/environment/delete-environment.ts"() {
256012
- import_rxjs24 = __toESM(require_cjs());
256733
+ import_rxjs30 = __toESM(require_cjs());
256013
256734
  import_operators15 = __toESM(require_operators());
256014
256735
  init_helpers();
256015
256736
  init_gql_client();
256016
256737
  init_log();
256017
256738
  init_load_spec();
256018
- delete_environment_default = (cmd) => (0, import_rxjs24.lastValueFrom)(
256739
+ delete_environment_default = (cmd) => (0, import_rxjs30.lastValueFrom)(
256019
256740
  parseProjectId(cmd.project).pipe(
256020
256741
  (0, import_operators15.switchMap)(
256021
256742
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -256068,16 +256789,16 @@ var get_environment_exports = {};
256068
256789
  __export(get_environment_exports, {
256069
256790
  default: () => get_environment_default
256070
256791
  });
256071
- var import_rxjs25, import_operators16, get_environment_default;
256792
+ var import_rxjs31, import_operators16, get_environment_default;
256072
256793
  var init_get_environment = __esm({
256073
256794
  "src/commands/environment/get-environment.ts"() {
256074
- import_rxjs25 = __toESM(require_cjs());
256795
+ import_rxjs31 = __toESM(require_cjs());
256075
256796
  import_operators16 = __toESM(require_operators());
256076
256797
  init_helpers();
256077
256798
  init_gql_client();
256078
256799
  init_log();
256079
256800
  init_load_spec();
256080
- get_environment_default = (cmd) => (0, import_rxjs25.lastValueFrom)(
256801
+ get_environment_default = (cmd) => (0, import_rxjs31.lastValueFrom)(
256081
256802
  parseProjectId(cmd.project).pipe(
256082
256803
  (0, import_operators16.switchMap)(
256083
256804
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -269786,8 +270507,8 @@ var require_graceful_fs = __commonJS({
269786
270507
  }
269787
270508
  }
269788
270509
  var fs$writeFile = fs4.writeFile;
269789
- fs4.writeFile = writeFile9;
269790
- function writeFile9(path2, data, options, cb) {
270510
+ fs4.writeFile = writeFile13;
270511
+ function writeFile13(path2, data, options, cb) {
269791
270512
  if (typeof options === "function")
269792
270513
  cb = options, options = null;
269793
270514
  return go$writeFile(path2, data, options, cb);
@@ -270236,7 +270957,7 @@ var require_BufferList2 = __commonJS({
270236
270957
  this.head = this.tail = null;
270237
270958
  this.length = 0;
270238
270959
  };
270239
- BufferList.prototype.join = function join3(s2) {
270960
+ BufferList.prototype.join = function join6(s2) {
270240
270961
  if (this.length === 0) return "";
270241
270962
  var p = this.head;
270242
270963
  var ret = "" + p.data;
@@ -271580,11 +272301,11 @@ var require_stream_readable3 = __commonJS({
271580
272301
  if (!state.flowing) {
271581
272302
  debug("resume");
271582
272303
  state.flowing = true;
271583
- resume(this, state);
272304
+ resume2(this, state);
271584
272305
  }
271585
272306
  return this;
271586
272307
  };
271587
- function resume(stream, state) {
272308
+ function resume2(stream, state) {
271588
272309
  if (!state.resumeScheduled) {
271589
272310
  state.resumeScheduled = true;
271590
272311
  pna.nextTick(resume_, stream, state);
@@ -275036,7 +275757,7 @@ var require_buffer_list3 = __commonJS({
275036
275757
  }
275037
275758
  }, {
275038
275759
  key: "join",
275039
- value: function join3(s2) {
275760
+ value: function join6(s2) {
275040
275761
  if (this.length === 0) return "";
275041
275762
  var p = this.head;
275042
275763
  var ret = "" + p.data;
@@ -276858,12 +277579,12 @@ var require_stream_readable4 = __commonJS({
276858
277579
  if (!state.flowing) {
276859
277580
  debug("resume");
276860
277581
  state.flowing = !state.readableListening;
276861
- resume(this, state);
277582
+ resume2(this, state);
276862
277583
  }
276863
277584
  state.paused = false;
276864
277585
  return this;
276865
277586
  };
276866
- function resume(stream, state) {
277587
+ function resume2(stream, state) {
276867
277588
  if (!state.resumeScheduled) {
276868
277589
  state.resumeScheduled = true;
276869
277590
  process.nextTick(resume_, stream, state);
@@ -278378,7 +279099,7 @@ var require_buffer_list4 = __commonJS({
278378
279099
  }
278379
279100
  }, {
278380
279101
  key: "join",
278381
- value: function join3(s2) {
279102
+ value: function join6(s2) {
278382
279103
  if (this.length === 0) return "";
278383
279104
  var p = this.head;
278384
279105
  var ret = "" + p.data;
@@ -280200,12 +280921,12 @@ var require_stream_readable5 = __commonJS({
280200
280921
  if (!state.flowing) {
280201
280922
  debug("resume");
280202
280923
  state.flowing = !state.readableListening;
280203
- resume(this, state);
280924
+ resume2(this, state);
280204
280925
  }
280205
280926
  state.paused = false;
280206
280927
  return this;
280207
280928
  };
280208
- function resume(stream, state) {
280929
+ function resume2(stream, state) {
280209
280930
  if (!state.resumeScheduled) {
280210
280931
  state.resumeScheduled = true;
280211
280932
  process.nextTick(resume_, stream, state);
@@ -281150,7 +281871,7 @@ var require_buffer_list5 = __commonJS({
281150
281871
  }
281151
281872
  }, {
281152
281873
  key: "join",
281153
- value: function join3(s2) {
281874
+ value: function join6(s2) {
281154
281875
  if (this.length === 0) return "";
281155
281876
  var p = this.head;
281156
281877
  var ret = "" + p.data;
@@ -282972,12 +283693,12 @@ var require_stream_readable6 = __commonJS({
282972
283693
  if (!state.flowing) {
282973
283694
  debug("resume");
282974
283695
  state.flowing = !state.readableListening;
282975
- resume(this, state);
283696
+ resume2(this, state);
282976
283697
  }
282977
283698
  state.paused = false;
282978
283699
  return this;
282979
283700
  };
282980
- function resume(stream, state) {
283701
+ function resume2(stream, state) {
282981
283702
  if (!state.resumeScheduled) {
282982
283703
  state.resumeScheduled = true;
282983
283704
  process.nextTick(resume_, stream, state);
@@ -284387,7 +285108,7 @@ var require_buffer_list6 = __commonJS({
284387
285108
  }
284388
285109
  }, {
284389
285110
  key: "join",
284390
- value: function join3(s2) {
285111
+ value: function join6(s2) {
284391
285112
  if (this.length === 0) return "";
284392
285113
  var p = this.head;
284393
285114
  var ret = "" + p.data;
@@ -286209,12 +286930,12 @@ var require_stream_readable7 = __commonJS({
286209
286930
  if (!state.flowing) {
286210
286931
  debug("resume");
286211
286932
  state.flowing = !state.readableListening;
286212
- resume(this, state);
286933
+ resume2(this, state);
286213
286934
  }
286214
286935
  state.paused = false;
286215
286936
  return this;
286216
286937
  };
286217
- function resume(stream, state) {
286938
+ function resume2(stream, state) {
286218
286939
  if (!state.resumeScheduled) {
286219
286940
  state.resumeScheduled = true;
286220
286941
  process.nextTick(resume_, stream, state);
@@ -287335,22 +288056,22 @@ var package_exports = {};
287335
288056
  __export(package_exports, {
287336
288057
  default: () => package_default
287337
288058
  });
287338
- var import_archiver, import_child_process, import_fs3, import_rxjs26, import_operators17, import_util3, ReadFile, package_default;
288059
+ var import_archiver, import_child_process2, import_fs4, import_rxjs32, import_operators17, import_util3, ReadFile, package_default;
287339
288060
  var init_package = __esm({
287340
288061
  "src/commands/lambda/package.ts"() {
287341
288062
  import_archiver = __toESM(require_archiver());
287342
- import_child_process = require("child_process");
287343
- import_fs3 = require("fs");
287344
- import_rxjs26 = __toESM(require_cjs());
288063
+ import_child_process2 = require("child_process");
288064
+ import_fs4 = require("fs");
288065
+ import_rxjs32 = __toESM(require_cjs());
287345
288066
  import_operators17 = __toESM(require_operators());
287346
288067
  import_util3 = require("util");
287347
288068
  init_helpers2();
287348
288069
  init_load_spec();
287349
288070
  init_parse_ignore();
287350
288071
  init_read_file();
287351
- ReadFile = (file2) => readFileAsObservable(file2).pipe((0, import_operators17.catchError)(() => (0, import_rxjs26.of)("")));
288072
+ ReadFile = (file2) => readFileAsObservable(file2).pipe((0, import_operators17.catchError)(() => (0, import_rxjs32.of)("")));
287352
288073
  package_default = (cmd) => {
287353
- return (0, import_rxjs26.lastValueFrom)(
288074
+ return (0, import_rxjs32.lastValueFrom)(
287354
288075
  loadSpec(cmd.spec).pipe(
287355
288076
  (0, import_operators17.map)((spec) => spec?.function ?? spec),
287356
288077
  (0, import_operators17.switchMap)(async (data) => {
@@ -287358,8 +288079,8 @@ var init_package = __esm({
287358
288079
  zlib: { level: 9 }
287359
288080
  // Sets the compression level.
287360
288081
  });
287361
- await (0, import_util3.promisify)(import_child_process.exec)(["chmod", "+x", data.script].join(" "));
287362
- const ignore = await (0, import_rxjs26.lastValueFrom)(
288082
+ await (0, import_util3.promisify)(import_child_process2.exec)(["chmod", "+x", data.script].join(" "));
288083
+ const ignore = await (0, import_rxjs32.lastValueFrom)(
287363
288084
  ReadFile(".gignore").pipe(
287364
288085
  (0, import_operators17.map)((ignore2) => parseIgnoredFiles(ignore2))
287365
288086
  )
@@ -287368,13 +288089,13 @@ var init_package = __esm({
287368
288089
  ignore: [".gcache/**", ...ignore]
287369
288090
  });
287370
288091
  archive.finalize();
287371
- return (0, import_rxjs26.lastValueFrom)(
287372
- (0, import_rxjs26.from)(streamToBufferPromise(archive)).pipe(
288092
+ return (0, import_rxjs32.lastValueFrom)(
288093
+ (0, import_rxjs32.from)(streamToBufferPromise(archive)).pipe(
287373
288094
  (0, import_operators17.switchMap)(
287374
- (buffer) => (0, import_rxjs26.from)((0, import_util3.promisify)(import_fs3.mkdir)(".gcache")).pipe(
287375
- (0, import_operators17.catchError)(() => (0, import_rxjs26.of)(true)),
288095
+ (buffer) => (0, import_rxjs32.from)((0, import_util3.promisify)(import_fs4.mkdir)(".gcache")).pipe(
288096
+ (0, import_operators17.catchError)(() => (0, import_rxjs32.of)(true)),
287376
288097
  (0, import_operators17.switchMap)(
287377
- () => (0, import_util3.promisify)(import_fs3.writeFile)(`.gcache/${data.name}.zip`, buffer)
288098
+ () => (0, import_util3.promisify)(import_fs4.writeFile)(`.gcache/${data.name}.zip`, buffer)
287378
288099
  )
287379
288100
  )
287380
288101
  )
@@ -287398,13 +288119,13 @@ function streamToBufferPromise(file2) {
287398
288119
  });
287399
288120
  });
287400
288121
  }
287401
- var import_form_data, import_fs4, import_rxjs27, import_operators18, import_stream_to_buffer, ReadFile2, createOrUpdateLambda, createCommand;
288122
+ var import_form_data, import_fs5, import_rxjs33, import_operators18, import_stream_to_buffer, ReadFile2, createOrUpdateLambda, createCommand;
287402
288123
  var init_helpers2 = __esm({
287403
288124
  "src/commands/lambda/helpers/index.ts"() {
287404
288125
  import_form_data = __toESM(require_form_data());
287405
- import_fs4 = require("fs");
288126
+ import_fs5 = require("fs");
287406
288127
  init_src();
287407
- import_rxjs27 = __toESM(require_cjs());
288128
+ import_rxjs33 = __toESM(require_cjs());
287408
288129
  import_operators18 = __toESM(require_operators());
287409
288130
  import_stream_to_buffer = __toESM(require_stream_to_buffer());
287410
288131
  init_helpers();
@@ -287413,14 +288134,14 @@ var init_helpers2 = __esm({
287413
288134
  init_package();
287414
288135
  init_load_spec();
287415
288136
  init_read_file();
287416
- ReadFile2 = (file2) => readFileAsObservable(file2).pipe((0, import_operators18.catchError)(() => (0, import_rxjs27.of)("")));
287417
- createOrUpdateLambda = (cmd, type) => (0, import_rxjs27.lastValueFrom)(
288137
+ ReadFile2 = (file2) => readFileAsObservable(file2).pipe((0, import_operators18.catchError)(() => (0, import_rxjs33.of)("")));
288138
+ createOrUpdateLambda = (cmd, type) => (0, import_rxjs33.lastValueFrom)(
287418
288139
  parseProjectId(cmd.project).pipe(
287419
288140
  (0, import_operators18.switchMap)(
287420
288141
  (projectId) => GraphqlClienAPI.getProject(projectId).pipe((0, import_operators18.map)(() => projectId))
287421
288142
  ),
287422
288143
  (0, import_operators18.switchMap)(async (projectId) => {
287423
- const spec = await (0, import_rxjs27.lastValueFrom)(loadSpec(cmd.spec));
288144
+ const spec = await (0, import_rxjs33.lastValueFrom)(loadSpec(cmd.spec));
287424
288145
  return {
287425
288146
  projectId,
287426
288147
  ...spec?.function ?? spec
@@ -287434,10 +288155,10 @@ var init_helpers2 = __esm({
287434
288155
  }
287435
288156
  await package_default(cmd);
287436
288157
  const body = new import_form_data.default();
287437
- body.append("file[]", (0, import_fs4.createReadStream)(`.gcache/${data.name}.zip`));
287438
- const config2 = await (0, import_rxjs27.lastValueFrom)(GraphqlClienAPI.getConfig());
287439
- return (0, import_rxjs27.lastValueFrom)(
287440
- (0, import_rxjs27.from)(
288158
+ body.append("file[]", (0, import_fs5.createReadStream)(`.gcache/${data.name}.zip`));
288159
+ const config2 = await (0, import_rxjs33.lastValueFrom)(GraphqlClienAPI.getConfig());
288160
+ return (0, import_rxjs33.lastValueFrom)(
288161
+ (0, import_rxjs33.from)(
287441
288162
  fetch2(config2.uploadUrl, {
287442
288163
  method: "POST",
287443
288164
  body,
@@ -287458,23 +288179,23 @@ var init_helpers2 = __esm({
287458
288179
  );
287459
288180
  }),
287460
288181
  (0, import_operators18.switchMap)(async (payload) => {
287461
- const clusterId = await (0, import_rxjs27.lastValueFrom)(
288182
+ const clusterId = await (0, import_rxjs33.lastValueFrom)(
287462
288183
  resolveClusterId(payload.projectId, {
287463
288184
  clusterId: cmd.clusterId || payload.clusterId,
287464
288185
  clusterName: cmd.clusterName || payload.clusterName
287465
288186
  })
287466
288187
  );
287467
- return (0, import_rxjs27.lastValueFrom)(
288188
+ return (0, import_rxjs33.lastValueFrom)(
287468
288189
  GraphqlClienAPI[type]({
287469
- code: cmd.code || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
288190
+ code: cmd.code || await (0, import_rxjs33.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
287470
288191
  name: cmd.name || payload.name || "",
287471
288192
  projectId: payload.projectId,
287472
288193
  route: cmd.route || payload.route || "",
287473
- buildBashScript: cmd.buildBashScript || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
288194
+ buildBashScript: cmd.buildBashScript || await (0, import_rxjs33.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
287474
288195
  configs: cmd.configs || payload.configs || [],
287475
288196
  env: cmd.env || payload.env || "nodejs",
287476
288197
  method: cmd.method || payload.method || ["GET"],
287477
- packageJson: cmd.packageJson || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
288198
+ packageJson: cmd.packageJson || await (0, import_rxjs33.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
287478
288199
  params: cmd.params || payload.params || [],
287479
288200
  secrets: cmd.secrets || payload.secrets || [],
287480
288201
  envSecrets: cmd.envSecrets || payload.envSecrets || [],
@@ -287530,15 +288251,15 @@ var list_exports2 = {};
287530
288251
  __export(list_exports2, {
287531
288252
  default: () => list_default2
287532
288253
  });
287533
- var import_rxjs28, import_operators19, list_default2;
288254
+ var import_rxjs34, import_operators19, list_default2;
287534
288255
  var init_list2 = __esm({
287535
288256
  "src/commands/lambda/list.ts"() {
287536
- import_rxjs28 = __toESM(require_cjs());
288257
+ import_rxjs34 = __toESM(require_cjs());
287537
288258
  import_operators19 = __toESM(require_operators());
287538
288259
  init_helpers();
287539
288260
  init_gql_client();
287540
288261
  init_log();
287541
- list_default2 = (cmd) => (0, import_rxjs28.lastValueFrom)(
288262
+ list_default2 = (cmd) => (0, import_rxjs34.lastValueFrom)(
287542
288263
  parseProjectId(cmd.project).pipe(
287543
288264
  (0, import_operators19.switchMap)(
287544
288265
  (projectId) => resolveClusterId(projectId, {
@@ -287573,10 +288294,10 @@ var get_exports = {};
287573
288294
  __export(get_exports, {
287574
288295
  default: () => get_default
287575
288296
  });
287576
- var import_rxjs29, import_operators20, get_default;
288297
+ var import_rxjs35, import_operators20, get_default;
287577
288298
  var init_get = __esm({
287578
288299
  "src/commands/lambda/get.ts"() {
287579
- import_rxjs29 = __toESM(require_cjs());
288300
+ import_rxjs35 = __toESM(require_cjs());
287580
288301
  import_operators20 = __toESM(require_operators());
287581
288302
  init_helpers();
287582
288303
  init_gql_client();
@@ -287598,26 +288319,26 @@ var init_get = __esm({
287598
288319
  Logger.log("-------------------");
287599
288320
  });
287600
288321
  if (cmd.lambda) {
287601
- return (0, import_rxjs29.lastValueFrom)(
288322
+ return (0, import_rxjs35.lastValueFrom)(
287602
288323
  isMongoId(cmd.lambda).pipe(
287603
288324
  (0, import_operators20.switchMap)((id) => GraphqlClienAPI.getLambda(id)),
287604
288325
  table
287605
288326
  )
287606
288327
  );
287607
288328
  }
287608
- const spec = await (0, import_rxjs29.lastValueFrom)(loadSpec(cmd.spec));
288329
+ const spec = await (0, import_rxjs35.lastValueFrom)(loadSpec(cmd.spec));
287609
288330
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287610
288331
  if (name2) {
287611
- return (0, import_rxjs29.lastValueFrom)(
288332
+ return (0, import_rxjs35.lastValueFrom)(
287612
288333
  parseProjectId(cmd.project).pipe(
287613
288334
  (0, import_operators20.catchError)((error48) => {
287614
288335
  if (!cmd.project) {
287615
- return (0, import_rxjs29.throwError)(
288336
+ return (0, import_rxjs35.throwError)(
287616
288337
  () => `No project id try with "gcli use --project your-project-id" to specify one
287617
288338
  Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
287618
288339
  );
287619
288340
  }
287620
- return (0, import_rxjs29.throwError)(() => error48);
288341
+ return (0, import_rxjs35.throwError)(() => error48);
287621
288342
  }),
287622
288343
  (0, import_operators20.switchMap)(
287623
288344
  (projectId) => resolveClusterId(projectId, {
@@ -287674,22 +288395,22 @@ var delete_exports = {};
287674
288395
  __export(delete_exports, {
287675
288396
  default: () => delete_default
287676
288397
  });
287677
- var import_rxjs30, import_operators21, delete_default;
288398
+ var import_rxjs36, import_operators21, delete_default;
287678
288399
  var init_delete = __esm({
287679
288400
  "src/commands/lambda/delete.ts"() {
287680
- import_rxjs30 = __toESM(require_cjs());
288401
+ import_rxjs36 = __toESM(require_cjs());
287681
288402
  import_operators21 = __toESM(require_operators());
287682
288403
  init_helpers();
287683
288404
  init_gql_client();
287684
288405
  init_log();
287685
288406
  init_load_spec();
287686
288407
  delete_default = async (cmd) => {
287687
- const spec = await (0, import_rxjs30.lastValueFrom)(loadSpec(cmd.spec));
288408
+ const spec = await (0, import_rxjs36.lastValueFrom)(loadSpec(cmd.spec));
287688
288409
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287689
288410
  const env = cmd.env ?? spec.function?.env ?? spec.env;
287690
288411
  const clusterIdHint = cmd.clusterId ?? spec.function?.clusterId ?? spec.clusterId;
287691
288412
  const clusterNameHint = cmd.clusterName ?? spec.function?.clusterName ?? spec.clusterName;
287692
- return (0, import_rxjs30.lastValueFrom)(
288413
+ return (0, import_rxjs36.lastValueFrom)(
287693
288414
  parseProjectId(cmd.project).pipe(
287694
288415
  (0, import_operators21.switchMap)(
287695
288416
  (projectId) => resolveClusterId(projectId, {
@@ -287724,10 +288445,10 @@ var logs_exports = {};
287724
288445
  __export(logs_exports, {
287725
288446
  default: () => logs_default
287726
288447
  });
287727
- var import_rxjs31, import_operators22, logs_default;
288448
+ var import_rxjs37, import_operators22, logs_default;
287728
288449
  var init_logs = __esm({
287729
288450
  "src/commands/lambda/logs.ts"() {
287730
- import_rxjs31 = __toESM(require_cjs());
288451
+ import_rxjs37 = __toESM(require_cjs());
287731
288452
  import_operators22 = __toESM(require_operators());
287732
288453
  init_helpers();
287733
288454
  init_gql_client();
@@ -287736,26 +288457,26 @@ var init_logs = __esm({
287736
288457
  logs_default = async (cmd) => {
287737
288458
  const result = (0, import_operators22.tap)(({ data }) => Logger.log(data));
287738
288459
  if (cmd.lambda) {
287739
- return (0, import_rxjs31.lastValueFrom)(
288460
+ return (0, import_rxjs37.lastValueFrom)(
287740
288461
  isMongoId(cmd.lambda).pipe(
287741
288462
  (0, import_operators22.switchMap)((id) => GraphqlClienAPI.getLambdaLogs(id)),
287742
288463
  result
287743
288464
  )
287744
288465
  );
287745
288466
  }
287746
- const spec = await (0, import_rxjs31.lastValueFrom)(loadSpec(cmd.spec));
288467
+ const spec = await (0, import_rxjs37.lastValueFrom)(loadSpec(cmd.spec));
287747
288468
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287748
288469
  if (name2) {
287749
- return (0, import_rxjs31.lastValueFrom)(
288470
+ return (0, import_rxjs37.lastValueFrom)(
287750
288471
  parseProjectId(cmd.project).pipe(
287751
288472
  (0, import_operators22.catchError)((error48) => {
287752
288473
  if (!cmd.project) {
287753
- return (0, import_rxjs31.throwError)(
288474
+ return (0, import_rxjs37.throwError)(
287754
288475
  () => `No project id try with "gcli use --project your-project-id" to specify one
287755
288476
  Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
287756
288477
  );
287757
288478
  }
287758
- return (0, import_rxjs31.throwError)(() => error48);
288479
+ return (0, import_rxjs37.throwError)(() => error48);
287759
288480
  }),
287760
288481
  (0, import_operators22.switchMap)(
287761
288482
  (projectId) => resolveClusterId(projectId, {
@@ -287781,10 +288502,10 @@ var logs_builder_exports = {};
287781
288502
  __export(logs_builder_exports, {
287782
288503
  default: () => logs_builder_default
287783
288504
  });
287784
- var import_rxjs32, import_operators23, logs_builder_default;
288505
+ var import_rxjs38, import_operators23, logs_builder_default;
287785
288506
  var init_logs_builder = __esm({
287786
288507
  "src/commands/lambda/logs-builder.ts"() {
287787
- import_rxjs32 = __toESM(require_cjs());
288508
+ import_rxjs38 = __toESM(require_cjs());
287788
288509
  import_operators23 = __toESM(require_operators());
287789
288510
  init_helpers();
287790
288511
  init_gql_client();
@@ -287793,26 +288514,26 @@ var init_logs_builder = __esm({
287793
288514
  logs_builder_default = async (cmd) => {
287794
288515
  const result = (0, import_operators23.tap)(({ data }) => Logger.log(data));
287795
288516
  if (cmd.lambda) {
287796
- return (0, import_rxjs32.lastValueFrom)(
288517
+ return (0, import_rxjs38.lastValueFrom)(
287797
288518
  isMongoId(cmd.lambda).pipe(
287798
288519
  (0, import_operators23.switchMap)((id) => GraphqlClienAPI.getLambdaBuilderLogs(id)),
287799
288520
  result
287800
288521
  )
287801
288522
  );
287802
288523
  }
287803
- const spec = await (0, import_rxjs32.lastValueFrom)(loadSpec(cmd.spec));
288524
+ const spec = await (0, import_rxjs38.lastValueFrom)(loadSpec(cmd.spec));
287804
288525
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287805
288526
  if (name2) {
287806
- return (0, import_rxjs32.lastValueFrom)(
288527
+ return (0, import_rxjs38.lastValueFrom)(
287807
288528
  parseProjectId(cmd.project).pipe(
287808
288529
  (0, import_operators23.catchError)((error48) => {
287809
288530
  if (!cmd.project) {
287810
- return (0, import_rxjs32.throwError)(
288531
+ return (0, import_rxjs38.throwError)(
287811
288532
  () => `No project id try with "gcli use --project your-project-id" to specify one
287812
288533
  Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
287813
288534
  );
287814
288535
  }
287815
- return (0, import_rxjs32.throwError)(() => error48);
288536
+ return (0, import_rxjs38.throwError)(() => error48);
287816
288537
  }),
287817
288538
  (0, import_operators23.switchMap)(
287818
288539
  (projectId) => resolveClusterId(projectId, {
@@ -287842,18 +288563,18 @@ var test_exports = {};
287842
288563
  __export(test_exports, {
287843
288564
  default: () => test_default
287844
288565
  });
287845
- var import_rxjs33, import_operators24, test_default;
288566
+ var import_rxjs39, import_operators24, test_default;
287846
288567
  var init_test = __esm({
287847
288568
  "src/commands/lambda/test.ts"() {
287848
- import_rxjs33 = __toESM(require_cjs());
288569
+ import_rxjs39 = __toESM(require_cjs());
287849
288570
  import_operators24 = __toESM(require_operators());
287850
288571
  init_helpers();
287851
288572
  init_gql_client();
287852
288573
  init_log();
287853
288574
  init_load_spec();
287854
288575
  test_default = async (cmd) => {
287855
- const spec = await (0, import_rxjs33.lastValueFrom)(loadSpec(cmd.spec));
287856
- const processParameters = (lambda) => (0, import_rxjs33.of)(lambda).pipe(
288576
+ const spec = await (0, import_rxjs39.lastValueFrom)(loadSpec(cmd.spec));
288577
+ const processParameters = (lambda) => (0, import_rxjs39.of)(lambda).pipe(
287857
288578
  (0, import_operators24.map)((lambda2) => ({
287858
288579
  ...lambda2,
287859
288580
  url: cmd.pathParams ? cmd.pathParams.split(";").map((param) => param.split("=")).reduce(
@@ -287867,7 +288588,7 @@ var init_test = __esm({
287867
288588
  );
287868
288589
  }),
287869
288590
  (0, import_operators24.switchMap)(
287870
- (lambda2) => (0, import_rxjs33.from)(
288591
+ (lambda2) => (0, import_rxjs39.from)(
287871
288592
  fetch([lambda2.url, cmd.queryParams].filter((i2) => !!i2).join(""), {
287872
288593
  method: cmd?.method ?? "GET",
287873
288594
  body: cmd.body
@@ -287883,7 +288604,7 @@ var init_test = __esm({
287883
288604
  })
287884
288605
  );
287885
288606
  if (cmd.lambda) {
287886
- return (0, import_rxjs33.lastValueFrom)(
288607
+ return (0, import_rxjs39.lastValueFrom)(
287887
288608
  isMongoId(cmd.lambda).pipe(
287888
288609
  (0, import_operators24.switchMap)(
287889
288610
  (id) => GraphqlClienAPI.getLambda(id, ["id", "url", "method", "params"])
@@ -287894,16 +288615,16 @@ var init_test = __esm({
287894
288615
  }
287895
288616
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287896
288617
  if (name2) {
287897
- return (0, import_rxjs33.lastValueFrom)(
288618
+ return (0, import_rxjs39.lastValueFrom)(
287898
288619
  parseProjectId(cmd.project).pipe(
287899
288620
  (0, import_operators24.catchError)((error48) => {
287900
288621
  if (!cmd.project) {
287901
- return (0, import_rxjs33.throwError)(
288622
+ return (0, import_rxjs39.throwError)(
287902
288623
  () => `No project id try with "gcli use --project your-project-id" to specify one
287903
288624
  Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
287904
288625
  );
287905
288626
  }
287906
- return (0, import_rxjs33.throwError)(() => error48);
288627
+ return (0, import_rxjs39.throwError)(() => error48);
287907
288628
  }),
287908
288629
  (0, import_operators24.switchMap)(
287909
288630
  (projectId) => GraphqlClienAPI.getLambdaByName(name2, projectId, [
@@ -287927,14 +288648,14 @@ var list_exports3 = {};
287927
288648
  __export(list_exports3, {
287928
288649
  default: () => list_default3
287929
288650
  });
287930
- var import_rxjs34, import_operators25, list_default3;
288651
+ var import_rxjs40, import_operators25, list_default3;
287931
288652
  var init_list3 = __esm({
287932
288653
  "src/commands/plugin/list.ts"() {
287933
- import_rxjs34 = __toESM(require_cjs());
288654
+ import_rxjs40 = __toESM(require_cjs());
287934
288655
  import_operators25 = __toESM(require_operators());
287935
288656
  init_gql_client();
287936
288657
  init_log();
287937
- list_default3 = () => (0, import_rxjs34.lastValueFrom)(
288658
+ list_default3 = () => (0, import_rxjs40.lastValueFrom)(
287938
288659
  GraphqlClienAPI.listAvailablePlugins().pipe(
287939
288660
  (0, import_operators25.tap)((plugins) => {
287940
288661
  Logger.log("-------------------");
@@ -287959,15 +288680,15 @@ var installed_exports = {};
287959
288680
  __export(installed_exports, {
287960
288681
  default: () => installed_default
287961
288682
  });
287962
- var import_rxjs35, import_operators26, installed_default;
288683
+ var import_rxjs41, import_operators26, installed_default;
287963
288684
  var init_installed = __esm({
287964
288685
  "src/commands/plugin/installed.ts"() {
287965
- import_rxjs35 = __toESM(require_cjs());
288686
+ import_rxjs41 = __toESM(require_cjs());
287966
288687
  import_operators26 = __toESM(require_operators());
287967
288688
  init_helpers();
287968
288689
  init_gql_client();
287969
288690
  init_log();
287970
- installed_default = (cmd) => (0, import_rxjs35.lastValueFrom)(
288691
+ installed_default = (cmd) => (0, import_rxjs41.lastValueFrom)(
287971
288692
  parseProjectId(cmd.project).pipe(
287972
288693
  (0, import_operators26.switchMap)((projectId) => GraphqlClienAPI.listInstalledPlugins(projectId)),
287973
288694
  (0, import_operators26.tap)((installed) => {
@@ -287998,16 +288719,16 @@ var install_exports = {};
287998
288719
  __export(install_exports, {
287999
288720
  default: () => install_default
288000
288721
  });
288001
- var import_rxjs36, import_operators27, install_default;
288722
+ var import_rxjs42, import_operators27, install_default;
288002
288723
  var init_install = __esm({
288003
288724
  "src/commands/plugin/install.ts"() {
288004
- import_rxjs36 = __toESM(require_cjs());
288725
+ import_rxjs42 = __toESM(require_cjs());
288005
288726
  import_operators27 = __toESM(require_operators());
288006
288727
  init_helpers();
288007
288728
  init_gql_client();
288008
288729
  init_log();
288009
288730
  init_load_spec();
288010
- install_default = (cmd) => (0, import_rxjs36.lastValueFrom)(
288731
+ install_default = (cmd) => (0, import_rxjs42.lastValueFrom)(
288011
288732
  parseProjectId(cmd.project).pipe(
288012
288733
  (0, import_operators27.switchMap)(
288013
288734
  (projectId) => loadSpec(
@@ -288016,7 +288737,7 @@ var init_install = __esm({
288016
288737
  // No spec file is required at all if --name/--cluster fully
288017
288738
  // cover it (unlike every other resource here, a plugin install
288018
288739
  // is often just "install this by name", no YAML needed).
288019
- (0, import_operators27.catchError)(() => (0, import_rxjs36.of)(void 0)),
288740
+ (0, import_operators27.catchError)(() => (0, import_rxjs42.of)(void 0)),
288020
288741
  (0, import_operators27.map)((data) => ({
288021
288742
  projectId,
288022
288743
  ...data ? data.plugin ?? data : {}
@@ -288047,15 +288768,15 @@ var uninstall_exports = {};
288047
288768
  __export(uninstall_exports, {
288048
288769
  default: () => uninstall_default
288049
288770
  });
288050
- var import_rxjs37, import_operators28, uninstall_default;
288771
+ var import_rxjs43, import_operators28, uninstall_default;
288051
288772
  var init_uninstall = __esm({
288052
288773
  "src/commands/plugin/uninstall.ts"() {
288053
- import_rxjs37 = __toESM(require_cjs());
288774
+ import_rxjs43 = __toESM(require_cjs());
288054
288775
  import_operators28 = __toESM(require_operators());
288055
288776
  init_helpers();
288056
288777
  init_gql_client();
288057
288778
  init_log();
288058
- uninstall_default = (cmd) => (0, import_rxjs37.lastValueFrom)(
288779
+ uninstall_default = (cmd) => (0, import_rxjs43.lastValueFrom)(
288059
288780
  parseProjectId(cmd.project).pipe(
288060
288781
  (0, import_operators28.switchMap)(
288061
288782
  (projectId) => GraphqlClienAPI.uninstallPlugin(projectId, cmd.name, cmd.cluster)
@@ -288075,14 +288796,14 @@ var list_exports4 = {};
288075
288796
  __export(list_exports4, {
288076
288797
  default: () => list_default4
288077
288798
  });
288078
- var import_rxjs38, import_operators29, list_default4;
288799
+ var import_rxjs44, import_operators29, list_default4;
288079
288800
  var init_list4 = __esm({
288080
288801
  "src/commands/project/list.ts"() {
288081
- import_rxjs38 = __toESM(require_cjs());
288802
+ import_rxjs44 = __toESM(require_cjs());
288082
288803
  import_operators29 = __toESM(require_operators());
288083
288804
  init_gql_client();
288084
288805
  init_log();
288085
- list_default4 = async () => (0, import_rxjs38.lastValueFrom)(
288806
+ list_default4 = async () => (0, import_rxjs44.lastValueFrom)(
288086
288807
  GraphqlClienAPI.listProjects().pipe(
288087
288808
  (0, import_operators29.tap)((project) => {
288088
288809
  const columns = ["id", "name"];
@@ -288101,25 +288822,25 @@ var use_exports = {};
288101
288822
  __export(use_exports, {
288102
288823
  default: () => use_default
288103
288824
  });
288104
- var import_fs5, import_rxjs39, import_operators30, import_util4, use_default;
288825
+ var import_fs6, import_rxjs45, import_operators30, import_util4, use_default;
288105
288826
  var init_use = __esm({
288106
288827
  "src/commands/project/use.ts"() {
288107
- import_fs5 = require("fs");
288108
- import_rxjs39 = __toESM(require_cjs());
288828
+ import_fs6 = require("fs");
288829
+ import_rxjs45 = __toESM(require_cjs());
288109
288830
  import_operators30 = __toESM(require_operators());
288110
288831
  import_util4 = require("util");
288111
288832
  init_helpers();
288112
288833
  init_gql_client();
288113
288834
  init_types();
288114
288835
  use_default = async (cmd) => {
288115
- return (0, import_rxjs39.lastValueFrom)(
288836
+ return (0, import_rxjs45.lastValueFrom)(
288116
288837
  parseProjectId(cmd).pipe(
288117
288838
  (0, import_operators30.switchMap)(
288118
288839
  (projectId) => GraphqlClienAPI.getProject(projectId).pipe((0, import_operators30.map)(() => projectId))
288119
288840
  ),
288120
288841
  (0, import_operators30.switchMap)(
288121
- (projectId) => (0, import_rxjs39.from)(
288122
- (0, import_util4.promisify)(import_fs5.writeFile)(projectDirectory, projectId, {
288842
+ (projectId) => (0, import_rxjs45.from)(
288843
+ (0, import_util4.promisify)(import_fs6.writeFile)(projectDirectory, projectId, {
288123
288844
  encoding: "utf-8"
288124
288845
  })
288125
288846
  )
@@ -288135,13 +288856,13 @@ var clear_exports = {};
288135
288856
  __export(clear_exports, {
288136
288857
  default: () => clear_default
288137
288858
  });
288138
- var import_fs6, import_util5, clear_default;
288859
+ var import_fs7, import_util5, clear_default;
288139
288860
  var init_clear = __esm({
288140
288861
  "src/commands/project/clear.ts"() {
288141
- import_fs6 = require("fs");
288862
+ import_fs7 = require("fs");
288142
288863
  import_util5 = require("util");
288143
288864
  init_types();
288144
- clear_default = async () => (0, import_util5.promisify)(import_fs6.unlink)(projectDirectory);
288865
+ clear_default = async () => (0, import_util5.promisify)(import_fs7.unlink)(projectDirectory);
288145
288866
  }
288146
288867
  });
288147
288868
 
@@ -318955,7 +319676,7 @@ __export(start_exports, {
318955
319676
  default: () => startProxy
318956
319677
  });
318957
319678
  async function startProxy(cmd) {
318958
- return (0, import_rxjs40.lastValueFrom)(
319679
+ return (0, import_rxjs46.lastValueFrom)(
318959
319680
  GraphqlClienAPI.getConfig().pipe(
318960
319681
  (0, import_operators31.take)(1),
318961
319682
  (0, import_operators31.map)((config2) => ({
@@ -318971,7 +319692,7 @@ async function startProxy(cmd) {
318971
319692
  process.stderr.write("Retrieving config for auth...\n");
318972
319693
  }),
318973
319694
  (0, import_operators31.switchMap)(
318974
- (config2) => config2?.token ? (0, import_rxjs40.of)(config2) : (0, import_rxjs40.throwError)(
319695
+ (config2) => config2?.token ? (0, import_rxjs46.of)(config2) : (0, import_rxjs46.throwError)(
318975
319696
  () => new Error("User is not authenticated (no token in config)")
318976
319697
  )
318977
319698
  ),
@@ -318989,7 +319710,7 @@ async function startProxy(cmd) {
318989
319710
  Authorization: config2.token
318990
319711
  }
318991
319712
  },
318992
- fetch: (input, init) => (0, import_rxjs40.lastValueFrom)(performFetch(input, init))
319713
+ fetch: (input, init) => (0, import_rxjs46.lastValueFrom)(performFetch(input, init))
318993
319714
  }),
318994
319715
  client: new Client({
318995
319716
  name: "gapi-proxy-client",
@@ -319000,7 +319721,7 @@ async function startProxy(cmd) {
319000
319721
  process.stderr.write("Connecting to upstream...\n");
319001
319722
  }),
319002
319723
  (0, import_operators31.switchMap)(
319003
- (config2) => (0, import_rxjs40.from)(config2.client.connect(config2.transport)).pipe((0, import_operators31.map)(() => config2))
319724
+ (config2) => (0, import_rxjs46.from)(config2.client.connect(config2.transport)).pipe((0, import_operators31.map)(() => config2))
319004
319725
  ),
319005
319726
  (0, import_operators31.tap)(() => {
319006
319727
  process.stderr.write("Connected to upstream MCP server\n");
@@ -319026,25 +319747,25 @@ async function startProxy(cmd) {
319026
319747
  capabilities: config2.capabilities || {}
319027
319748
  }
319028
319749
  );
319029
- server2.fallbackRequestHandler = async (request) => (0, import_rxjs40.lastValueFrom)(
319030
- (0, import_rxjs40.defer)(() => config2.client.request(request, external_exports3.any())).pipe(
319750
+ server2.fallbackRequestHandler = async (request) => (0, import_rxjs46.lastValueFrom)(
319751
+ (0, import_rxjs46.defer)(() => config2.client.request(request, external_exports3.any())).pipe(
319031
319752
  (0, import_operators31.catchError)((e2) => {
319032
319753
  process.stderr.write(`Upstream error: ${e2.message}
319033
319754
  `);
319034
- return (0, import_rxjs40.throwError)(() => e2);
319755
+ return (0, import_rxjs46.throwError)(() => e2);
319035
319756
  })
319036
319757
  )
319037
319758
  );
319038
319759
  server2.fallbackNotificationHandler = async (notification) => {
319039
- await (0, import_rxjs40.lastValueFrom)(
319040
- (0, import_rxjs40.of)(notification).pipe(
319760
+ await (0, import_rxjs46.lastValueFrom)(
319761
+ (0, import_rxjs46.of)(notification).pipe(
319041
319762
  (0, import_operators31.filter)((n) => n.method !== "notifications/initialized"),
319042
319763
  (0, import_operators31.switchMap)(
319043
- (n) => (0, import_rxjs40.defer)(() => config2.client.notification(n)).pipe(
319764
+ (n) => (0, import_rxjs46.defer)(() => config2.client.notification(n)).pipe(
319044
319765
  (0, import_operators31.catchError)((e2) => {
319045
319766
  process.stderr.write(`Notification error: ${e2}
319046
319767
  `);
319047
- return import_rxjs40.EMPTY;
319768
+ return import_rxjs46.EMPTY;
319048
319769
  })
319049
319770
  )
319050
319771
  ),
@@ -319054,7 +319775,7 @@ async function startProxy(cmd) {
319054
319775
  };
319055
319776
  return server2;
319056
319777
  }),
319057
- (0, import_operators31.switchMap)((server2) => (0, import_rxjs40.from)(server2.connect(new StdioServerTransport()))),
319778
+ (0, import_operators31.switchMap)((server2) => (0, import_rxjs46.from)(server2.connect(new StdioServerTransport()))),
319058
319779
  (0, import_operators31.tap)(() => {
319059
319780
  process.stderr.write("MCP stdio server ready\n");
319060
319781
  }),
@@ -319064,20 +319785,20 @@ async function startProxy(cmd) {
319064
319785
  )
319065
319786
  );
319066
319787
  }
319067
- var import_rxjs40, import_operators31, import_stream2, performFetch;
319788
+ var import_rxjs46, import_operators31, import_stream2, performFetch;
319068
319789
  var init_start = __esm({
319069
319790
  "src/commands/proxy/start.ts"() {
319070
319791
  init_client2();
319071
319792
  init_streamableHttp();
319072
319793
  init_server2();
319073
319794
  init_stdio2();
319074
- import_rxjs40 = __toESM(require_cjs());
319795
+ import_rxjs46 = __toESM(require_cjs());
319075
319796
  import_operators31 = __toESM(require_operators());
319076
319797
  import_stream2 = require("stream");
319077
319798
  init_zod();
319078
319799
  init_gql_client();
319079
319800
  performFetch = (input, init) => {
319080
- return (0, import_rxjs40.from)(fetch(input, init)).pipe(
319801
+ return (0, import_rxjs46.from)(fetch(input, init)).pipe(
319081
319802
  (0, import_operators31.switchMap)((res) => {
319082
319803
  if (res.status === 401 || res.status === 403) {
319083
319804
  process.stderr.write(
@@ -319099,7 +319820,7 @@ var init_start = __esm({
319099
319820
  })
319100
319821
  );
319101
319822
  }
319102
- return (0, import_rxjs40.of)(res);
319823
+ return (0, import_rxjs46.of)(res);
319103
319824
  }),
319104
319825
  (0, import_operators31.map)((res) => {
319105
319826
  if (typeof res?.body?.pipeThrough !== "function") {
@@ -319118,7 +319839,7 @@ var init_start = __esm({
319118
319839
  (0, import_operators31.catchError)((e2) => {
319119
319840
  process.stderr.write(`[ERROR] Fetch error: ${e2.message}
319120
319841
  `);
319121
- return (0, import_rxjs40.throwError)(() => e2);
319842
+ return (0, import_rxjs46.throwError)(() => e2);
319122
319843
  })
319123
319844
  );
319124
319845
  };
@@ -319130,16 +319851,16 @@ var create_exports3 = {};
319130
319851
  __export(create_exports3, {
319131
319852
  default: () => create_default3
319132
319853
  });
319133
- var import_rxjs41, import_operators32, create_default3;
319854
+ var import_rxjs47, import_operators32, create_default3;
319134
319855
  var init_create3 = __esm({
319135
319856
  "src/commands/rabbitmq/create.ts"() {
319136
- import_rxjs41 = __toESM(require_cjs());
319857
+ import_rxjs47 = __toESM(require_cjs());
319137
319858
  import_operators32 = __toESM(require_operators());
319138
319859
  init_helpers();
319139
319860
  init_gql_client();
319140
319861
  init_log();
319141
319862
  init_load_spec();
319142
- create_default3 = (cmd) => (0, import_rxjs41.lastValueFrom)(
319863
+ create_default3 = (cmd) => (0, import_rxjs47.lastValueFrom)(
319143
319864
  parseProjectId(cmd.project).pipe(
319144
319865
  (0, import_operators32.switchMap)(
319145
319866
  (projectId) => loadSpec(
@@ -319178,15 +319899,15 @@ var list_exports5 = {};
319178
319899
  __export(list_exports5, {
319179
319900
  default: () => list_default5
319180
319901
  });
319181
- var import_rxjs42, import_operators33, list_default5;
319902
+ var import_rxjs48, import_operators33, list_default5;
319182
319903
  var init_list5 = __esm({
319183
319904
  "src/commands/rabbitmq/list.ts"() {
319184
- import_rxjs42 = __toESM(require_cjs());
319905
+ import_rxjs48 = __toESM(require_cjs());
319185
319906
  import_operators33 = __toESM(require_operators());
319186
319907
  init_helpers();
319187
319908
  init_gql_client();
319188
319909
  init_log();
319189
- list_default5 = (cmd) => (0, import_rxjs42.lastValueFrom)(
319910
+ list_default5 = (cmd) => (0, import_rxjs48.lastValueFrom)(
319190
319911
  parseProjectId(cmd.project).pipe(
319191
319912
  (0, import_operators33.switchMap)(
319192
319913
  (projectId) => GraphqlClienAPI.listRabbitMqInstances(projectId)
@@ -319221,15 +319942,15 @@ var delete_exports2 = {};
319221
319942
  __export(delete_exports2, {
319222
319943
  default: () => delete_default2
319223
319944
  });
319224
- var import_rxjs43, import_operators34, delete_default2;
319945
+ var import_rxjs49, import_operators34, delete_default2;
319225
319946
  var init_delete2 = __esm({
319226
319947
  "src/commands/rabbitmq/delete.ts"() {
319227
- import_rxjs43 = __toESM(require_cjs());
319948
+ import_rxjs49 = __toESM(require_cjs());
319228
319949
  import_operators34 = __toESM(require_operators());
319229
319950
  init_helpers();
319230
319951
  init_gql_client();
319231
319952
  init_log();
319232
- delete_default2 = (cmd) => (0, import_rxjs43.lastValueFrom)(
319953
+ delete_default2 = (cmd) => (0, import_rxjs49.lastValueFrom)(
319233
319954
  parseProjectId(cmd.project).pipe(
319234
319955
  (0, import_operators34.switchMap)(
319235
319956
  (projectId) => GraphqlClienAPI.uninstallRabbitMq(cmd.id, projectId)
@@ -319246,10 +319967,10 @@ var init_delete2 = __esm({
319246
319967
  });
319247
319968
 
319248
319969
  // src/commands/runner/config.ts
319249
- var import_promises, DEFAULT_WS_URL, deriveSubscriptionsUrl, readLoginApiUrl, readSavedRunner, saveRunner, forgetRunner;
319970
+ var import_promises5, DEFAULT_WS_URL, deriveSubscriptionsUrl, readLoginApiUrl, readSavedRunner, saveRunner, forgetRunner;
319250
319971
  var init_config = __esm({
319251
319972
  "src/commands/runner/config.ts"() {
319252
- import_promises = require("fs/promises");
319973
+ import_promises5 = require("fs/promises");
319253
319974
  init_types();
319254
319975
  DEFAULT_WS_URL = "wss://api.lambforge.com/subscriptions";
319255
319976
  deriveSubscriptionsUrl = (apiUrl) => {
@@ -319265,21 +319986,21 @@ var init_config = __esm({
319265
319986
  url2.search = "";
319266
319987
  return url2.toString();
319267
319988
  };
319268
- readLoginApiUrl = () => (0, import_promises.readFile)(urlDirectory, "utf-8").catch(() => "");
319989
+ readLoginApiUrl = () => (0, import_promises5.readFile)(urlDirectory, "utf-8").catch(() => "");
319269
319990
  readSavedRunner = async () => {
319270
319991
  try {
319271
- const saved = JSON.parse(await (0, import_promises.readFile)(runnerDirectory, "utf-8"));
319992
+ const saved = JSON.parse(await (0, import_promises5.readFile)(runnerDirectory, "utf-8"));
319272
319993
  return saved?.id && saved?.token ? saved : null;
319273
319994
  } catch {
319274
319995
  return null;
319275
319996
  }
319276
319997
  };
319277
319998
  saveRunner = async (runner) => {
319278
- await (0, import_promises.mkdir)(mainDirectory, { recursive: true });
319279
- await (0, import_promises.writeFile)(runnerDirectory, JSON.stringify(runner, null, 2), "utf-8");
319280
- await (0, import_promises.chmod)(runnerDirectory, 384);
319999
+ await (0, import_promises5.mkdir)(mainDirectory, { recursive: true });
320000
+ await (0, import_promises5.writeFile)(runnerDirectory, JSON.stringify(runner, null, 2), "utf-8");
320001
+ await (0, import_promises5.chmod)(runnerDirectory, 384);
319281
320002
  };
319282
- forgetRunner = () => (0, import_promises.rm)(runnerDirectory, { force: true });
320003
+ forgetRunner = () => (0, import_promises5.rm)(runnerDirectory, { force: true });
319283
320004
  }
319284
320005
  });
319285
320006
 
@@ -319801,19 +320522,19 @@ var init_connection = __esm({
319801
320522
  });
319802
320523
 
319803
320524
  // src/commands/runner/daemon.ts
319804
- var import_child_process2, import_fs7, import_promises2, import_os2, import_path, import_util11, DEFAULT_SERVICE_NAME, RUNNER_AUTH_EXIT_CODE, systemdQuote, unitPath, buildUnit, resolveGcliCommand, defaultExec, SystemdUserService, assertSystemdAvailable;
320525
+ var import_child_process3, import_fs8, import_promises6, import_os4, import_path4, import_util11, DEFAULT_SERVICE_NAME, RUNNER_AUTH_EXIT_CODE, systemdQuote, unitPath, buildUnit, resolveGcliCommand, defaultExec, SystemdUserService, assertSystemdAvailable;
319805
320526
  var init_daemon = __esm({
319806
320527
  "src/commands/runner/daemon.ts"() {
319807
- import_child_process2 = require("child_process");
319808
- import_fs7 = require("fs");
319809
- import_promises2 = require("fs/promises");
319810
- import_os2 = require("os");
319811
- import_path = require("path");
320528
+ import_child_process3 = require("child_process");
320529
+ import_fs8 = require("fs");
320530
+ import_promises6 = require("fs/promises");
320531
+ import_os4 = require("os");
320532
+ import_path4 = require("path");
319812
320533
  import_util11 = require("util");
319813
320534
  DEFAULT_SERVICE_NAME = "lambforge-runner";
319814
320535
  RUNNER_AUTH_EXIT_CODE = 78;
319815
320536
  systemdQuote = (word) => /^[A-Za-z0-9_@%+=:,./-]+$/.test(word) ? word : `"${word.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
319816
- unitPath = (serviceName, home = (0, import_os2.homedir)()) => (0, import_path.join)(home, ".config", "systemd", "user", `${serviceName}.service`);
320537
+ unitPath = (serviceName, home = (0, import_os4.homedir)()) => (0, import_path4.join)(home, ".config", "systemd", "user", `${serviceName}.service`);
319817
320538
  buildUnit = ({
319818
320539
  serviceName,
319819
320540
  execStart,
@@ -319852,7 +320573,7 @@ var init_daemon = __esm({
319852
320573
  }
319853
320574
  let script = argv[1];
319854
320575
  try {
319855
- script = (0, import_fs7.realpathSync)(script);
320576
+ script = (0, import_fs8.realpathSync)(script);
319856
320577
  } catch {
319857
320578
  }
319858
320579
  const ephemeral = /[/\\]_npx[/\\]|[/\\]\.npm[/\\]_cacache/.test(script);
@@ -319861,9 +320582,9 @@ var init_daemon = __esm({
319861
320582
  warning: ephemeral ? `gcli is running from the npx cache (${script}), which npm may clean up and break the service. Install it globally first: npm i -g @gapi/gcli, then re-run this command with \`gcli\`.` : void 0
319862
320583
  };
319863
320584
  };
319864
- defaultExec = (file2, args) => (0, import_util11.promisify)(import_child_process2.execFile)(file2, args, { encoding: "utf8" });
320585
+ defaultExec = (file2, args) => (0, import_util11.promisify)(import_child_process3.execFile)(file2, args, { encoding: "utf8" });
319865
320586
  SystemdUserService = class {
319866
- constructor(serviceName = DEFAULT_SERVICE_NAME, exec2 = defaultExec, home = (0, import_os2.homedir)()) {
320587
+ constructor(serviceName = DEFAULT_SERVICE_NAME, exec2 = defaultExec, home = (0, import_os4.homedir)()) {
319867
320588
  this.serviceName = serviceName;
319868
320589
  this.exec = exec2;
319869
320590
  this.home = home;
@@ -319874,8 +320595,8 @@ var init_daemon = __esm({
319874
320595
  /** install -> daemon-reload -> enable -> restart (picks up a changed unit). */
319875
320596
  async install(unitContent) {
319876
320597
  const path2 = unitPath(this.serviceName, this.home);
319877
- await (0, import_promises2.mkdir)((0, import_path.join)(path2, ".."), { recursive: true });
319878
- await (0, import_promises2.writeFile)(path2, unitContent, "utf-8");
320598
+ await (0, import_promises6.mkdir)((0, import_path4.join)(path2, ".."), { recursive: true });
320599
+ await (0, import_promises6.writeFile)(path2, unitContent, "utf-8");
319879
320600
  await this.systemctl("daemon-reload");
319880
320601
  await this.systemctl("enable", this.unit);
319881
320602
  await this.systemctl("restart", this.unit);
@@ -319884,13 +320605,13 @@ var init_daemon = __esm({
319884
320605
  async uninstall() {
319885
320606
  await this.systemctl("disable", "--now", this.unit).catch(() => void 0);
319886
320607
  const path2 = unitPath(this.serviceName, this.home);
319887
- await (0, import_promises2.rm)(path2, { force: true });
320608
+ await (0, import_promises6.rm)(path2, { force: true });
319888
320609
  await this.systemctl("daemon-reload");
319889
320610
  return path2;
319890
320611
  }
319891
320612
  /** Whether `runner:daemon:install` wrote the unit. */
319892
320613
  installed() {
319893
- return (0, import_fs7.existsSync)(unitPath(this.serviceName, this.home));
320614
+ return (0, import_fs8.existsSync)(unitPath(this.serviceName, this.home));
319894
320615
  }
319895
320616
  start() {
319896
320617
  return this.systemctl("start", this.unit);
@@ -319954,11 +320675,11 @@ __export(start_exports2, {
319954
320675
  default: () => start_default,
319955
320676
  resolveRunner: () => resolveRunner
319956
320677
  });
319957
- var import_os3, import_rxjs44, RUNNER_VERSION, resolveRunner, start_default;
320678
+ var import_os5, import_rxjs50, RUNNER_VERSION, resolveRunner, start_default;
319958
320679
  var init_start2 = __esm({
319959
320680
  "src/commands/runner/start.ts"() {
319960
- import_os3 = require("os");
319961
- import_rxjs44 = __toESM(require_cjs());
320681
+ import_os5 = require("os");
320682
+ import_rxjs50 = __toESM(require_cjs());
319962
320683
  init_gql_client();
319963
320684
  init_log();
319964
320685
  init_config();
@@ -319977,9 +320698,9 @@ var init_start2 = __esm({
319977
320698
  if (saved) {
319978
320699
  return saved;
319979
320700
  }
319980
- const name2 = cmd.name || (0, import_os3.hostname)();
320701
+ const name2 = cmd.name || (0, import_os5.hostname)();
319981
320702
  Logger.info(`Registering this machine as local runner "${name2}"...`);
319982
- const { runner, token } = await (0, import_rxjs44.lastValueFrom)(
320703
+ const { runner, token } = await (0, import_rxjs50.lastValueFrom)(
319983
320704
  GraphqlClienAPI.createLocalRunner(name2)
319984
320705
  ).catch((e2) => {
319985
320706
  throw new Error(
@@ -320040,10 +320761,10 @@ __export(daemon_commands_exports, {
320040
320761
  stop: () => stop,
320041
320762
  uninstall: () => uninstall
320042
320763
  });
320043
- var import_child_process3, install, uninstall, installedService, reportStarted, start, restart, stop, status, logs;
320764
+ var import_child_process4, install, uninstall, installedService, reportStarted, start, restart, stop, status, logs;
320044
320765
  var init_daemon_commands = __esm({
320045
320766
  "src/commands/runner/daemon-commands.ts"() {
320046
- import_child_process3 = require("child_process");
320767
+ import_child_process4 = require("child_process");
320047
320768
  init_log();
320048
320769
  init_config();
320049
320770
  init_daemon();
@@ -320159,7 +320880,7 @@ var init_daemon_commands = __esm({
320159
320880
  assertSystemdAvailable();
320160
320881
  const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
320161
320882
  return new Promise((resolve2) => {
320162
- (0, import_child_process3.spawn)(
320883
+ (0, import_child_process4.spawn)(
320163
320884
  "journalctl",
320164
320885
  ["--user", "-u", `${serviceName}.service`, "-f", "-n", cmd.lines || "50"],
320165
320886
  { stdio: "inherit" }
@@ -320174,14 +320895,14 @@ var list_exports6 = {};
320174
320895
  __export(list_exports6, {
320175
320896
  default: () => list_default6
320176
320897
  });
320177
- var import_rxjs45, import_operators35, list_default6;
320898
+ var import_rxjs51, import_operators35, list_default6;
320178
320899
  var init_list6 = __esm({
320179
320900
  "src/commands/runner/list.ts"() {
320180
- import_rxjs45 = __toESM(require_cjs());
320901
+ import_rxjs51 = __toESM(require_cjs());
320181
320902
  import_operators35 = __toESM(require_operators());
320182
320903
  init_gql_client();
320183
320904
  init_log();
320184
- list_default6 = () => (0, import_rxjs45.lastValueFrom)(
320905
+ list_default6 = () => (0, import_rxjs51.lastValueFrom)(
320185
320906
  GraphqlClienAPI.listLocalRunners().pipe(
320186
320907
  (0, import_operators35.tap)((runners) => {
320187
320908
  Logger.log("-------------------");
@@ -320214,10 +320935,10 @@ __export(models_exports, {
320214
320935
  default: () => models_default,
320215
320936
  parseSelection: () => parseSelection
320216
320937
  });
320217
- var import_rxjs46, isShown, parseSelection, models_default;
320938
+ var import_rxjs52, isShown, parseSelection, models_default;
320218
320939
  var init_models = __esm({
320219
320940
  "src/commands/runner/models.ts"() {
320220
- import_rxjs46 = __toESM(require_cjs());
320941
+ import_rxjs52 = __toESM(require_cjs());
320221
320942
  init_gql_client();
320222
320943
  init_log();
320223
320944
  init_config();
@@ -320247,11 +320968,11 @@ var init_models = __esm({
320247
320968
  }
320248
320969
  let runner;
320249
320970
  if (selection) {
320250
- runner = await (0, import_rxjs46.lastValueFrom)(
320971
+ runner = await (0, import_rxjs52.lastValueFrom)(
320251
320972
  GraphqlClienAPI.setLocalRunnerModels(runnerId, selection.models)
320252
320973
  );
320253
320974
  } else {
320254
- const runners = await (0, import_rxjs46.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
320975
+ const runners = await (0, import_rxjs52.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
320255
320976
  runner = runners.find((r2) => r2.id === runnerId);
320256
320977
  }
320257
320978
  if (!runner) {
@@ -320286,10 +321007,10 @@ var delete_exports3 = {};
320286
321007
  __export(delete_exports3, {
320287
321008
  default: () => delete_default3
320288
321009
  });
320289
- var import_rxjs47, delete_default3;
321010
+ var import_rxjs53, delete_default3;
320290
321011
  var init_delete3 = __esm({
320291
321012
  "src/commands/runner/delete.ts"() {
320292
- import_rxjs47 = __toESM(require_cjs());
321013
+ import_rxjs53 = __toESM(require_cjs());
320293
321014
  init_gql_client();
320294
321015
  init_log();
320295
321016
  init_config();
@@ -320299,7 +321020,7 @@ var init_delete3 = __esm({
320299
321020
  if (!runnerId) {
320300
321021
  throw new Error("Specify the runner with --id (see `gcli runner:list`).");
320301
321022
  }
320302
- await (0, import_rxjs47.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
321023
+ await (0, import_rxjs53.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
320303
321024
  if (saved?.id === runnerId) {
320304
321025
  await forgetRunner();
320305
321026
  }
@@ -320315,10 +321036,10 @@ __export(start_exports3, {
320315
321036
  });
320316
321037
  async function start2(args) {
320317
321038
  Logger.log("---------------------------------");
320318
- return (0, import_rxjs48.lastValueFrom)(
321039
+ return (0, import_rxjs54.lastValueFrom)(
320319
321040
  loadSpec().pipe(
320320
321041
  (0, import_operators36.switchMap)(
320321
- (config2) => (0, import_rxjs48.of)({
321042
+ (config2) => (0, import_rxjs54.of)({
320322
321043
  watcher: (0, import_node_fs2.watch)(process.cwd(), {
320323
321044
  recursive: true
320324
321045
  }),
@@ -320347,7 +321068,7 @@ async function start2(args) {
320347
321068
  outfile,
320348
321069
  startCommand,
320349
321070
  ignorelist
320350
- }) => (0, import_rxjs48.from)(build_default(args)).pipe(
321071
+ }) => (0, import_rxjs54.from)(build_default(args)).pipe(
320351
321072
  (0, import_operators36.tap)(() => {
320352
321073
  Logger.warn(
320353
321074
  `\u{1F4E2} Starting script "${startCommand} ${outfile}"`
@@ -320365,10 +321086,10 @@ async function start2(args) {
320365
321086
  );
320366
321087
  }),
320367
321088
  (0, import_operators36.tap)(
320368
- () => (0, import_rxjs48.merge)(
320369
- (0, import_rxjs48.fromEvent)(process, "SIGINT"),
320370
- (0, import_rxjs48.fromEvent)(process, "SIGTERM"),
320371
- (0, import_rxjs48.fromEvent)(process, "exit")
321089
+ () => (0, import_rxjs54.merge)(
321090
+ (0, import_rxjs54.fromEvent)(process, "SIGINT"),
321091
+ (0, import_rxjs54.fromEvent)(process, "SIGTERM"),
321092
+ (0, import_rxjs54.fromEvent)(process, "exit")
320372
321093
  ).pipe(
320373
321094
  (0, import_operators36.debounceTime)(100),
320374
321095
  (0, import_operators36.tap)(() => {
@@ -320380,7 +321101,7 @@ async function start2(args) {
320380
321101
  ).subscribe()
320381
321102
  ),
320382
321103
  (0, import_operators36.switchMap)(
320383
- () => (0, import_rxjs48.fromEvent)(watcher, "change").pipe(
321104
+ () => (0, import_rxjs54.fromEvent)(watcher, "change").pipe(
320384
321105
  (0, import_operators36.map)(([event, filename]) => ({
320385
321106
  event,
320386
321107
  filename
@@ -320429,12 +321150,12 @@ async function start2(args) {
320429
321150
  )
320430
321151
  );
320431
321152
  }
320432
- var import_node_child_process, import_node_fs2, import_rxjs48, import_operators36;
321153
+ var import_node_child_process, import_node_fs2, import_rxjs54, import_operators36;
320433
321154
  var init_start3 = __esm({
320434
321155
  "src/commands/start/start.ts"() {
320435
321156
  import_node_child_process = require("node:child_process");
320436
321157
  import_node_fs2 = require("node:fs");
320437
- import_rxjs48 = __toESM(require_cjs());
321158
+ import_rxjs54 = __toESM(require_cjs());
320438
321159
  import_operators36 = __toESM(require_operators());
320439
321160
  init_log();
320440
321161
  init_build();
@@ -320447,16 +321168,16 @@ var create_cron_exports = {};
320447
321168
  __export(create_cron_exports, {
320448
321169
  default: () => create_cron_default
320449
321170
  });
320450
- var import_rxjs49, import_operators37, create_cron_default;
321171
+ var import_rxjs55, import_operators37, create_cron_default;
320451
321172
  var init_create_cron = __esm({
320452
321173
  "src/commands/triggers/cron/create-cron.ts"() {
320453
- import_rxjs49 = __toESM(require_cjs());
321174
+ import_rxjs55 = __toESM(require_cjs());
320454
321175
  import_operators37 = __toESM(require_operators());
320455
321176
  init_helpers();
320456
321177
  init_gql_client();
320457
321178
  init_log();
320458
321179
  init_load_spec();
320459
- create_cron_default = (cmd) => (0, import_rxjs49.lastValueFrom)(
321180
+ create_cron_default = (cmd) => (0, import_rxjs55.lastValueFrom)(
320460
321181
  parseProjectId(cmd.project).pipe(
320461
321182
  (0, import_operators37.switchMap)(
320462
321183
  (projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
@@ -320479,7 +321200,7 @@ var init_create_cron = __esm({
320479
321200
  )
320480
321201
  ),
320481
321202
  (0, import_operators37.switchMap)(
320482
- ({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs49.throwError)(
321203
+ ({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs55.throwError)(
320483
321204
  () => new Error(
320484
321205
  "cron:create needs --cron and --triggerName (or triggers.time.cron / triggerName in lambforge.yaml)"
320485
321206
  )
@@ -320512,16 +321233,16 @@ var delete_cron_exports = {};
320512
321233
  __export(delete_cron_exports, {
320513
321234
  default: () => delete_cron_default
320514
321235
  });
320515
- var import_rxjs50, import_operators38, delete_cron_default;
321236
+ var import_rxjs56, import_operators38, delete_cron_default;
320516
321237
  var init_delete_cron = __esm({
320517
321238
  "src/commands/triggers/cron/delete-cron.ts"() {
320518
- import_rxjs50 = __toESM(require_cjs());
321239
+ import_rxjs56 = __toESM(require_cjs());
320519
321240
  import_operators38 = __toESM(require_operators());
320520
321241
  init_helpers();
320521
321242
  init_gql_client();
320522
321243
  init_log();
320523
321244
  init_load_spec();
320524
- delete_cron_default = (cmd) => (0, import_rxjs50.lastValueFrom)(
321245
+ delete_cron_default = (cmd) => (0, import_rxjs56.lastValueFrom)(
320525
321246
  parseProjectId(cmd.project).pipe(
320526
321247
  (0, import_operators38.switchMap)(
320527
321248
  (projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
@@ -320565,18 +321286,18 @@ var list_crons_exports = {};
320565
321286
  __export(list_crons_exports, {
320566
321287
  default: () => list_crons_default
320567
321288
  });
320568
- var import_rxjs51, import_operators39, list_crons_default;
321289
+ var import_rxjs57, import_operators39, list_crons_default;
320569
321290
  var init_list_crons = __esm({
320570
321291
  "src/commands/triggers/cron/list-crons.ts"() {
320571
- import_rxjs51 = __toESM(require_cjs());
321292
+ import_rxjs57 = __toESM(require_cjs());
320572
321293
  import_operators39 = __toESM(require_operators());
320573
321294
  init_helpers();
320574
321295
  init_gql_client();
320575
321296
  init_log();
320576
- list_crons_default = (cmd) => (0, import_rxjs51.lastValueFrom)(
321297
+ list_crons_default = (cmd) => (0, import_rxjs57.lastValueFrom)(
320577
321298
  parseProjectId(cmd.project).pipe(
320578
321299
  (0, import_operators39.switchMap)(
320579
- (projectId) => (0, import_rxjs51.combineLatest)([
321300
+ (projectId) => (0, import_rxjs57.combineLatest)([
320580
321301
  GraphqlClienAPI.listProjectTimeTriggers(projectId),
320581
321302
  GraphqlClienAPI.listLambdas(projectId)
320582
321303
  ])
@@ -320609,15 +321330,15 @@ var list_exports7 = {};
320609
321330
  __export(list_exports7, {
320610
321331
  default: () => list_default7
320611
321332
  });
320612
- var import_rxjs52, import_operators40, list_default7;
321333
+ var import_rxjs58, import_operators40, list_default7;
320613
321334
  var init_list7 = __esm({
320614
321335
  "src/commands/triggers/message-queue/list.ts"() {
320615
- import_rxjs52 = __toESM(require_cjs());
321336
+ import_rxjs58 = __toESM(require_cjs());
320616
321337
  import_operators40 = __toESM(require_operators());
320617
321338
  init_helpers();
320618
321339
  init_gql_client();
320619
321340
  init_log();
320620
- list_default7 = (cmd) => (0, import_rxjs52.lastValueFrom)(
321341
+ list_default7 = (cmd) => (0, import_rxjs58.lastValueFrom)(
320621
321342
  parseProjectId(cmd.project).pipe(
320622
321343
  (0, import_operators40.switchMap)(
320623
321344
  (projectId) => GraphqlClienAPI.listMessageQueueTriggers(projectId)
@@ -320653,10 +321374,10 @@ __export(save_exports, {
320653
321374
  mergeOverExisting: () => mergeOverExisting,
320654
321375
  toTriggerInput: () => toTriggerInput
320655
321376
  });
320656
- var import_rxjs53, import_operators41, int2, toTriggerInput, mergeOverExisting, save_default;
321377
+ var import_rxjs59, import_operators41, int2, toTriggerInput, mergeOverExisting, save_default;
320657
321378
  var init_save = __esm({
320658
321379
  "src/commands/triggers/message-queue/save.ts"() {
320659
- import_rxjs53 = __toESM(require_cjs());
321380
+ import_rxjs59 = __toESM(require_cjs());
320660
321381
  import_operators41 = __toESM(require_operators());
320661
321382
  init_helpers();
320662
321383
  init_gql_client();
@@ -320719,11 +321440,11 @@ var init_save = __esm({
320719
321440
  )
320720
321441
  );
320721
321442
  };
320722
- save_default = (mode, cmd) => (0, import_rxjs53.lastValueFrom)(
321443
+ save_default = (mode, cmd) => (0, import_rxjs59.lastValueFrom)(
320723
321444
  parseProjectId(cmd.project).pipe(
320724
321445
  (0, import_operators41.switchMap)((projectId) => {
320725
321446
  const changes = toTriggerInput(mode, cmd);
320726
- const payload$ = mode === "create" ? (0, import_rxjs53.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
321447
+ const payload$ = mode === "create" ? (0, import_rxjs59.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
320727
321448
  (0, import_operators41.map)(
320728
321449
  (triggers) => mergeOverExisting(
320729
321450
  triggers.find((t2) => t2.name === cmd.name),
@@ -320761,15 +321482,15 @@ var delete_exports4 = {};
320761
321482
  __export(delete_exports4, {
320762
321483
  default: () => delete_default4
320763
321484
  });
320764
- var import_rxjs54, import_operators42, delete_default4;
321485
+ var import_rxjs60, import_operators42, delete_default4;
320765
321486
  var init_delete4 = __esm({
320766
321487
  "src/commands/triggers/message-queue/delete.ts"() {
320767
- import_rxjs54 = __toESM(require_cjs());
321488
+ import_rxjs60 = __toESM(require_cjs());
320768
321489
  import_operators42 = __toESM(require_operators());
320769
321490
  init_helpers();
320770
321491
  init_gql_client();
320771
321492
  init_log();
320772
- delete_default4 = (cmd) => (0, import_rxjs54.lastValueFrom)(
321493
+ delete_default4 = (cmd) => (0, import_rxjs60.lastValueFrom)(
320773
321494
  parseProjectId(cmd.project).pipe(
320774
321495
  (0, import_operators42.switchMap)(
320775
321496
  (projectId) => GraphqlClienAPI.deleteMessageQueueTrigger(projectId, cmd.name)
@@ -320879,11 +321600,11 @@ var init_definition = __esm({
320879
321600
  });
320880
321601
 
320881
321602
  // src/commands/workflow/helpers.ts
320882
- var import_promises3, import_rxjs55, import_operators43, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
321603
+ var import_promises7, import_rxjs61, import_operators43, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
320883
321604
  var init_helpers4 = __esm({
320884
321605
  "src/commands/workflow/helpers.ts"() {
320885
- import_promises3 = require("fs/promises");
320886
- import_rxjs55 = __toESM(require_cjs());
321606
+ import_promises7 = require("fs/promises");
321607
+ import_rxjs61 = __toESM(require_cjs());
320887
321608
  import_operators43 = __toESM(require_operators());
320888
321609
  init_helpers();
320889
321610
  init_gql_client();
@@ -320905,18 +321626,18 @@ var init_helpers4 = __esm({
320905
321626
  })
320906
321627
  );
320907
321628
  };
320908
- withProject = (project, fn) => (0, import_rxjs55.lastValueFrom)(parseProjectId(project).pipe((0, import_operators43.switchMap)(fn)));
321629
+ withProject = (project, fn) => (0, import_rxjs61.lastValueFrom)(parseProjectId(project).pipe((0, import_operators43.switchMap)(fn)));
320909
321630
  readWorkflowFile = (path2) => {
320910
321631
  if (!path2) {
320911
321632
  throw new Error("--file is required (a workflow YAML or JSON file)");
320912
321633
  }
320913
- return (0, import_rxjs55.from)((0, import_promises3.readFile)(path2, "utf8")).pipe((0, import_operators43.map)(parseWorkflowFile));
321634
+ return (0, import_rxjs61.from)((0, import_promises7.readFile)(path2, "utf8")).pipe((0, import_operators43.map)(parseWorkflowFile));
320914
321635
  };
320915
- writeTextFile = (path2, text) => (0, import_rxjs55.from)((0, import_promises3.writeFile)(path2, text, "utf8"));
321636
+ writeTextFile = (path2, text) => (0, import_rxjs61.from)((0, import_promises7.writeFile)(path2, text, "utf8"));
320916
321637
  POLL_MS = 2e3;
320917
321638
  followRun = (projectId, workflowId, runName) => {
320918
321639
  let printed = 0;
320919
- return (0, import_rxjs55.timer)(0, POLL_MS).pipe(
321640
+ return (0, import_rxjs61.timer)(0, POLL_MS).pipe(
320920
321641
  (0, import_operators43.switchMap)(
320921
321642
  () => GraphqlClienAPI.getWorkflowRun(projectId, workflowId, runName)
320922
321643
  ),
@@ -320989,10 +321710,10 @@ var get_exports2 = {};
320989
321710
  __export(get_exports2, {
320990
321711
  default: () => get_default2
320991
321712
  });
320992
- var import_rxjs56, import_operators45, get_default2;
321713
+ var import_rxjs62, import_operators45, get_default2;
320993
321714
  var init_get2 = __esm({
320994
321715
  "src/commands/workflow/get.ts"() {
320995
- import_rxjs56 = __toESM(require_cjs());
321716
+ import_rxjs62 = __toESM(require_cjs());
320996
321717
  import_operators45 = __toESM(require_operators());
320997
321718
  init_log();
320998
321719
  init_definition();
@@ -321008,7 +321729,7 @@ var init_get2 = __esm({
321008
321729
  });
321009
321730
  if (!cmd.out) {
321010
321731
  Logger.log(text);
321011
- return (0, import_rxjs56.of)(null);
321732
+ return (0, import_rxjs62.of)(null);
321012
321733
  }
321013
321734
  return writeTextFile(cmd.out, text).pipe(
321014
321735
  (0, import_operators45.tap)(() => Logger.info(`Wrote ${cmd.out}`))
@@ -321078,11 +321799,11 @@ var generate_exports = {};
321078
321799
  __export(generate_exports, {
321079
321800
  default: () => generate_default
321080
321801
  });
321081
- var import_promises4, import_rxjs57, import_operators47, generate_default;
321802
+ var import_promises8, import_rxjs63, import_operators47, generate_default;
321082
321803
  var init_generate = __esm({
321083
321804
  "src/commands/workflow/generate.ts"() {
321084
- import_promises4 = require("fs/promises");
321085
- import_rxjs57 = __toESM(require_cjs());
321805
+ import_promises8 = require("fs/promises");
321806
+ import_rxjs63 = __toESM(require_cjs());
321086
321807
  import_operators47 = __toESM(require_operators());
321087
321808
  init_gql_client();
321088
321809
  init_log();
@@ -321095,7 +321816,7 @@ var init_generate = __esm({
321095
321816
  'Describe the workflow: --description "charge the card with retries, then email the receipt"'
321096
321817
  );
321097
321818
  }
321098
- const base$ = cmd.from ? (0, import_rxjs57.from)((0, import_promises4.readFile)(cmd.from, "utf8")).pipe((0, import_operators47.map)(parseWorkflowFile)) : cmd.name ? GraphqlClienAPI.listWorkflows(projectId).pipe(
321819
+ const base$ = cmd.from ? (0, import_rxjs63.from)((0, import_promises8.readFile)(cmd.from, "utf8")).pipe((0, import_operators47.map)(parseWorkflowFile)) : cmd.name ? GraphqlClienAPI.listWorkflows(projectId).pipe(
321099
321820
  (0, import_operators47.switchMap)(
321100
321821
  (workflows) => workflows.some((w) => w.name === cmd.name) ? resolveWorkflow(projectId, cmd.name).pipe(
321101
321822
  (0, import_operators47.map)((w) => ({
@@ -321103,9 +321824,9 @@ var init_generate = __esm({
321103
321824
  description: w.description ?? void 0,
321104
321825
  definition: w.definition
321105
321826
  }))
321106
- ) : (0, import_rxjs57.of)(null)
321827
+ ) : (0, import_rxjs63.of)(null)
321107
321828
  )
321108
- ) : (0, import_rxjs57.of)(null);
321829
+ ) : (0, import_rxjs63.of)(null);
321109
321830
  return base$.pipe(
321110
321831
  (0, import_operators47.tap)(() => Logger.info("Asking the AI for a draft...")),
321111
321832
  (0, import_operators47.switchMap)(
@@ -321132,10 +321853,10 @@ var init_generate = __esm({
321132
321853
  const text = toWorkflowYaml(file2);
321133
321854
  const written$ = cmd.out ? writeTextFile(cmd.out, text).pipe(
321134
321855
  (0, import_operators47.tap)(() => Logger.info(`Wrote ${cmd.out}`))
321135
- ) : (0, import_rxjs57.of)(null).pipe((0, import_operators47.tap)(() => !cmd.apply && Logger.log(text)));
321856
+ ) : (0, import_rxjs63.of)(null).pipe((0, import_operators47.tap)(() => !cmd.apply && Logger.log(text)));
321136
321857
  return written$.pipe(
321137
321858
  (0, import_operators47.switchMap)(
321138
- () => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs57.of)(null).pipe(
321859
+ () => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs63.of)(null).pipe(
321139
321860
  (0, import_operators47.tap)(
321140
321861
  () => Logger.info(
321141
321862
  cmd.out ? `Review it, then: gcli workflow:apply --file ${cmd.out}${file2.name ? "" : " --name <name>"}` : "Save it with -o <file>, or re-run with --apply --name <name>"
@@ -321209,11 +321930,11 @@ var run_exports = {};
321209
321930
  __export(run_exports, {
321210
321931
  default: () => run_default
321211
321932
  });
321212
- var import_promises5, import_rxjs58, import_operators50, run_default;
321933
+ var import_promises9, import_rxjs64, import_operators50, run_default;
321213
321934
  var init_run = __esm({
321214
321935
  "src/commands/workflow/run.ts"() {
321215
- import_promises5 = require("fs/promises");
321216
- import_rxjs58 = __toESM(require_cjs());
321936
+ import_promises9 = require("fs/promises");
321937
+ import_rxjs64 = __toESM(require_cjs());
321217
321938
  import_operators50 = __toESM(require_operators());
321218
321939
  init_gql_client();
321219
321940
  init_log();
@@ -321221,7 +321942,7 @@ var init_run = __esm({
321221
321942
  init_helpers4();
321222
321943
  run_default = (cmd) => withProject(
321223
321944
  cmd.project,
321224
- (projectId) => (cmd.inputFile ? (0, import_rxjs58.from)((0, import_promises5.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs58.of)(cmd.input)).pipe(
321945
+ (projectId) => (cmd.inputFile ? (0, import_rxjs64.from)((0, import_promises9.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs64.of)(cmd.input)).pipe(
321225
321946
  (0, import_operators50.map)(parseRunInput),
321226
321947
  (0, import_operators50.switchMap)(
321227
321948
  (input) => resolveWorkflow(projectId, cmd.name).pipe(
@@ -321229,7 +321950,7 @@ var init_run = __esm({
321229
321950
  (w) => GraphqlClienAPI.startWorkflowRun(projectId, w.id, input).pipe(
321230
321951
  (0, import_operators50.tap)((run2) => Logger.info(`Started run ${run2.name}`)),
321231
321952
  (0, import_operators50.switchMap)(
321232
- (run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs58.of)(run2).pipe(
321953
+ (run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs64.of)(run2).pipe(
321233
321954
  (0, import_operators50.tap)(
321234
321955
  () => Logger.info(
321235
321956
  `Follow it: gcli workflow:status --name ${w.name} --run ${run2.name} --follow`
@@ -321403,11 +322124,11 @@ var trigger_add_exports = {};
321403
322124
  __export(trigger_add_exports, {
321404
322125
  default: () => trigger_add_default
321405
322126
  });
321406
- var import_promises6, import_rxjs59, import_operators54, trigger_add_default;
322127
+ var import_promises10, import_rxjs65, import_operators54, trigger_add_default;
321407
322128
  var init_trigger_add = __esm({
321408
322129
  "src/commands/workflow/trigger-add.ts"() {
321409
- import_promises6 = require("fs/promises");
321410
- import_rxjs59 = __toESM(require_cjs());
322130
+ import_promises10 = require("fs/promises");
322131
+ import_rxjs65 = __toESM(require_cjs());
321411
322132
  import_operators54 = __toESM(require_operators());
321412
322133
  init_gql_client();
321413
322134
  init_log();
@@ -321415,7 +322136,7 @@ var init_trigger_add = __esm({
321415
322136
  init_triggers();
321416
322137
  trigger_add_default = (cmd) => withProject(
321417
322138
  cmd.project,
321418
- (projectId) => (cmd.inputFile ? (0, import_rxjs59.from)((0, import_promises6.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs59.of)(void 0)).pipe(
322139
+ (projectId) => (cmd.inputFile ? (0, import_rxjs65.from)((0, import_promises10.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs65.of)(void 0)).pipe(
321419
322140
  (0, import_operators54.map)((inputText) => buildTriggerInput({ ...cmd, inputText })),
321420
322141
  (0, import_operators54.switchMap)(
321421
322142
  (trigger) => resolveWorkflow(projectId, cmd.name).pipe(
@@ -321504,10 +322225,10 @@ var init_trigger_remove = __esm({
321504
322225
  });
321505
322226
 
321506
322227
  // src/commands/workspace/approvals.ts
321507
- var import_readline, APPROVAL_TIMEOUT_MS, TerminalPrompt, ApprovalGate;
322228
+ var import_readline4, APPROVAL_TIMEOUT_MS, TerminalPrompt, ApprovalGate;
321508
322229
  var init_approvals = __esm({
321509
322230
  "src/commands/workspace/approvals.ts"() {
321510
- import_readline = require("readline");
322231
+ import_readline4 = require("readline");
321511
322232
  APPROVAL_TIMEOUT_MS = 5 * 6e4;
321512
322233
  TerminalPrompt = class {
321513
322234
  constructor() {
@@ -321521,7 +322242,7 @@ var init_approvals = __esm({
321521
322242
  askNow(question, signal) {
321522
322243
  if (signal.aborted) return Promise.resolve(null);
321523
322244
  return new Promise((resolve2) => {
321524
- const rl = (0, import_readline.createInterface)({
322245
+ const rl = (0, import_readline4.createInterface)({
321525
322246
  input: process.stdin,
321526
322247
  output: process.stdout
321527
322248
  });
@@ -321631,23 +322352,23 @@ var init_approvals = __esm({
321631
322352
  });
321632
322353
 
321633
322354
  // src/commands/workspace/config.ts
321634
- var import_promises7, readSavedWorkspaces, writeAll, readSavedWorkspace, saveWorkspace, forgetWorkspace;
322355
+ var import_promises11, readSavedWorkspaces, writeAll, readSavedWorkspace, saveWorkspace, forgetWorkspace;
321635
322356
  var init_config2 = __esm({
321636
322357
  "src/commands/workspace/config.ts"() {
321637
- import_promises7 = require("fs/promises");
322358
+ import_promises11 = require("fs/promises");
321638
322359
  init_types();
321639
322360
  readSavedWorkspaces = async () => {
321640
322361
  try {
321641
- const saved = JSON.parse(await (0, import_promises7.readFile)(workspacesDirectory, "utf-8"));
322362
+ const saved = JSON.parse(await (0, import_promises11.readFile)(workspacesDirectory, "utf-8"));
321642
322363
  return saved && typeof saved === "object" ? saved : {};
321643
322364
  } catch {
321644
322365
  return {};
321645
322366
  }
321646
322367
  };
321647
322368
  writeAll = async (all) => {
321648
- await (0, import_promises7.mkdir)(mainDirectory, { recursive: true });
321649
- await (0, import_promises7.writeFile)(workspacesDirectory, JSON.stringify(all, null, 2), "utf-8");
321650
- await (0, import_promises7.chmod)(workspacesDirectory, 384);
322369
+ await (0, import_promises11.mkdir)(mainDirectory, { recursive: true });
322370
+ await (0, import_promises11.writeFile)(workspacesDirectory, JSON.stringify(all, null, 2), "utf-8");
322371
+ await (0, import_promises11.chmod)(workspacesDirectory, 384);
321651
322372
  };
321652
322373
  readSavedWorkspace = async (root) => {
321653
322374
  const saved = (await readSavedWorkspaces())[root];
@@ -321676,15 +322397,15 @@ var init_config2 = __esm({
321676
322397
  });
321677
322398
 
321678
322399
  // src/commands/workspace/files.ts
321679
- var import_child_process4, import_crypto, import_fs8, import_path2, import_util12, run, WorkspaceError, MAX_READ_BYTES, MAX_WRITE_BYTES, DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT, DEFAULT_SEARCH_RESULTS, MAX_SEARCH_RESULTS, MAX_MATCH_TEXT, SKIP_DIRS, SECRET_FILE, SECRET_TEMPLATE, isSecretFile, contentHash, toPosix, WorkspaceFiles;
322400
+ var import_child_process5, import_crypto2, import_fs9, import_path5, import_util12, run, WorkspaceError, MAX_READ_BYTES, MAX_WRITE_BYTES, DEFAULT_LIST_LIMIT, MAX_LIST_LIMIT, DEFAULT_SEARCH_RESULTS, MAX_SEARCH_RESULTS, MAX_MATCH_TEXT, SKIP_DIRS, SECRET_FILE, SECRET_TEMPLATE, isSecretFile, contentHash, toPosix, WorkspaceFiles;
321680
322401
  var init_files = __esm({
321681
322402
  "src/commands/workspace/files.ts"() {
321682
- import_child_process4 = require("child_process");
321683
- import_crypto = require("crypto");
321684
- import_fs8 = require("fs");
321685
- import_path2 = require("path");
322403
+ import_child_process5 = require("child_process");
322404
+ import_crypto2 = require("crypto");
322405
+ import_fs9 = require("fs");
322406
+ import_path5 = require("path");
321686
322407
  import_util12 = require("util");
321687
- run = (0, import_util12.promisify)(import_child_process4.execFile);
322408
+ run = (0, import_util12.promisify)(import_child_process5.execFile);
321688
322409
  WorkspaceError = class extends Error {
321689
322410
  constructor(message, status2 = 400) {
321690
322411
  super(message);
@@ -321702,11 +322423,11 @@ var init_files = __esm({
321702
322423
  SECRET_FILE = /^(\.env(\..+)?|.*\.(pem|key|p12|pfx|keystore|jks)|id_(rsa|dsa|ecdsa|ed25519)(\.pub)?|\.npmrc|\.pypirc|\.netrc|credentials(\.json)?)$/i;
321703
322424
  SECRET_TEMPLATE = /\.(example|sample|template|dist|defaults)$/i;
321704
322425
  isSecretFile = (path2) => {
321705
- const name2 = (0, import_path2.basename)(path2);
322426
+ const name2 = (0, import_path5.basename)(path2);
321706
322427
  return SECRET_FILE.test(name2) && !SECRET_TEMPLATE.test(name2);
321707
322428
  };
321708
- contentHash = (content) => (0, import_crypto.createHash)("sha256").update(content).digest("hex").slice(0, 16);
321709
- toPosix = (p) => p.split(import_path2.sep).join("/");
322429
+ contentHash = (content) => (0, import_crypto2.createHash)("sha256").update(content).digest("hex").slice(0, 16);
322430
+ toPosix = (p) => p.split(import_path5.sep).join("/");
321710
322431
  WorkspaceFiles = class {
321711
322432
  constructor(root, options = {}) {
321712
322433
  this.root = root;
@@ -321715,9 +322436,9 @@ var init_files = __esm({
321715
322436
  /** Absolute path for a workspace-relative one, or a WorkspaceError. */
321716
322437
  async resolvePath(input, { forWrite = false } = {}) {
321717
322438
  const rel = (input ?? ".").trim() || ".";
321718
- const abs = (0, import_path2.resolve)(this.root, rel);
321719
- const fromRoot = (0, import_path2.relative)(this.root, abs);
321720
- if (fromRoot.startsWith("..") || (0, import_path2.isAbsolute)(fromRoot)) {
322439
+ const abs = (0, import_path5.resolve)(this.root, rel);
322440
+ const fromRoot = (0, import_path5.relative)(this.root, abs);
322441
+ if (fromRoot.startsWith("..") || (0, import_path5.isAbsolute)(fromRoot)) {
321721
322442
  throw new WorkspaceError(
321722
322443
  `${input} is outside the workspace root - paths are relative to ${this.root}`,
321723
322444
  403
@@ -321726,9 +322447,9 @@ var init_files = __esm({
321726
322447
  let existing = abs;
321727
322448
  for (; ; ) {
321728
322449
  try {
321729
- const real = await import_fs8.promises.realpath(existing);
321730
- const realFromRoot = (0, import_path2.relative)(this.root, real);
321731
- if (realFromRoot.startsWith("..") || (0, import_path2.isAbsolute)(realFromRoot)) {
322450
+ const real = await import_fs9.promises.realpath(existing);
322451
+ const realFromRoot = (0, import_path5.relative)(this.root, real);
322452
+ if (realFromRoot.startsWith("..") || (0, import_path5.isAbsolute)(realFromRoot)) {
321732
322453
  throw new WorkspaceError(
321733
322454
  `${input} resolves outside the workspace root (symlink)`,
321734
322455
  403
@@ -321737,7 +322458,7 @@ var init_files = __esm({
321737
322458
  break;
321738
322459
  } catch (e2) {
321739
322460
  if (e2 instanceof WorkspaceError) throw e2;
321740
- const parent = (0, import_path2.dirname)(existing);
322461
+ const parent = (0, import_path5.dirname)(existing);
321741
322462
  if (parent === existing) break;
321742
322463
  existing = parent;
321743
322464
  }
@@ -321785,7 +322506,7 @@ var init_files = __esm({
321785
322506
  const out = [];
321786
322507
  const walk = async (relDir) => {
321787
322508
  if (out.length > limit) return;
321788
- const entries = await import_fs8.promises.readdir((0, import_path2.join)(this.root, relDir), { withFileTypes: true }).catch(() => []);
322509
+ const entries = await import_fs9.promises.readdir((0, import_path5.join)(this.root, relDir), { withFileTypes: true }).catch(() => []);
321789
322510
  for (const entry of entries) {
321790
322511
  if (SKIP_DIRS.has(entry.name)) continue;
321791
322512
  const rel = relDir === "." ? entry.name : `${relDir}/${entry.name}`;
@@ -321828,7 +322549,7 @@ var init_files = __esm({
321828
322549
  entries = entries.slice(0, limit);
321829
322550
  await Promise.all(
321830
322551
  entries.filter((e2) => e2.type === "file").map(async (e2) => {
321831
- e2.size = await import_fs8.promises.stat((0, import_path2.join)(this.root, e2.path)).then((s2) => s2.size).catch(() => void 0);
322552
+ e2.size = await import_fs9.promises.stat((0, import_path5.join)(this.root, e2.path)).then((s2) => s2.size).catch(() => void 0);
321832
322553
  })
321833
322554
  );
321834
322555
  return {
@@ -321839,12 +322560,12 @@ var init_files = __esm({
321839
322560
  async read(args) {
321840
322561
  if (!args.path) throw new WorkspaceError("path is required");
321841
322562
  const { abs, rel } = await this.resolvePath(args.path);
321842
- const stat2 = await import_fs8.promises.stat(abs).catch(() => null);
322563
+ const stat2 = await import_fs9.promises.stat(abs).catch(() => null);
321843
322564
  if (!stat2) throw new WorkspaceError(`${rel} does not exist`, 404);
321844
322565
  if (stat2.isDirectory()) {
321845
322566
  throw new WorkspaceError(`${rel} is a directory - use LocalListFiles`);
321846
322567
  }
321847
- const buffer = await import_fs8.promises.readFile(abs);
322568
+ const buffer = await import_fs9.promises.readFile(abs);
321848
322569
  if (buffer.subarray(0, 8e3).includes(0)) {
321849
322570
  return { path: rel, size: stat2.size, binary: true, content: "" };
321850
322571
  }
@@ -321873,7 +322594,7 @@ var init_files = __esm({
321873
322594
  };
321874
322595
  }
321875
322596
  async currentText(abs) {
321876
- return import_fs8.promises.readFile(abs, "utf-8").catch((e2) => {
322597
+ return import_fs9.promises.readFile(abs, "utf-8").catch((e2) => {
321877
322598
  if (e2?.code === "ENOENT") return null;
321878
322599
  throw e2;
321879
322600
  });
@@ -321894,8 +322615,8 @@ var init_files = __esm({
321894
322615
  );
321895
322616
  }
321896
322617
  }
321897
- await import_fs8.promises.mkdir((0, import_path2.dirname)(abs), { recursive: true });
321898
- await import_fs8.promises.writeFile(abs, content, "utf-8");
322618
+ await import_fs9.promises.mkdir((0, import_path5.dirname)(abs), { recursive: true });
322619
+ await import_fs9.promises.writeFile(abs, content, "utf-8");
321899
322620
  return {
321900
322621
  path: rel,
321901
322622
  size: Buffer.byteLength(content),
@@ -321927,7 +322648,7 @@ var init_files = __esm({
321927
322648
  );
321928
322649
  }
321929
322650
  const after = args.replaceAll ? before.split(args.oldText).join(args.newText ?? "") : before.replace(args.oldText, () => args.newText ?? "");
321930
- await import_fs8.promises.writeFile(abs, after, "utf-8");
322651
+ await import_fs9.promises.writeFile(abs, after, "utf-8");
321931
322652
  return {
321932
322653
  path: rel,
321933
322654
  replacements: args.replaceAll ? count : 1,
@@ -321938,14 +322659,14 @@ var init_files = __esm({
321938
322659
  async delete(args) {
321939
322660
  if (!args.path) throw new WorkspaceError("path is required");
321940
322661
  const { abs, rel } = await this.resolvePath(args.path, { forWrite: true });
321941
- const stat2 = await import_fs8.promises.lstat(abs).catch(() => null);
322662
+ const stat2 = await import_fs9.promises.lstat(abs).catch(() => null);
321942
322663
  if (!stat2) return { path: rel, deleted: false };
321943
322664
  if (stat2.isDirectory()) {
321944
322665
  throw new WorkspaceError(
321945
322666
  `${rel} is a directory - only files can be deleted (use RunCommand for more)`
321946
322667
  );
321947
322668
  }
321948
- await import_fs8.promises.unlink(abs);
322669
+ await import_fs9.promises.unlink(abs);
321949
322670
  return { path: rel, deleted: true };
321950
322671
  }
321951
322672
  async search(args) {
@@ -321997,7 +322718,7 @@ var init_files = __esm({
321997
322718
  raw = [];
321998
322719
  for (const file2 of await this.allFiles(rel, 2e4)) {
321999
322720
  if (globRe && !globRe.test(file2)) continue;
322000
- const text = await import_fs8.promises.readFile((0, import_path2.join)(this.root, file2)).catch(() => null);
322721
+ const text = await import_fs9.promises.readFile((0, import_path5.join)(this.root, file2)).catch(() => null);
322001
322722
  if (!text || text.subarray(0, 8e3).includes(0)) continue;
322002
322723
  text.toString("utf-8").split("\n").forEach((line, i2) => {
322003
322724
  if (raw.length <= max && re.test(line)) {
@@ -322018,10 +322739,10 @@ var init_files = __esm({
322018
322739
  });
322019
322740
 
322020
322741
  // src/commands/workspace/processes.ts
322021
- var import_child_process5, DEFAULT_TIMEOUT_S, MAX_TIMEOUT_S, MAX_STREAM_CHARS, MAX_PROCESS_LINES, MAX_PROCESSES, DEFAULT_WAIT_S, MAX_WAIT_S, KILL_GRACE_MS, ANSI, stripAnsi, BASE_ENV, buildEnv, shellOf, killTree, terminate, TailBuffer, runCommand, ProcessManager;
322742
+ var import_child_process6, DEFAULT_TIMEOUT_S, MAX_TIMEOUT_S, MAX_STREAM_CHARS, MAX_PROCESS_LINES, MAX_PROCESSES, DEFAULT_WAIT_S, MAX_WAIT_S, KILL_GRACE_MS, ANSI, stripAnsi, BASE_ENV, buildEnv, shellOf, killTree, terminate, TailBuffer, runCommand, ProcessManager;
322022
322743
  var init_processes = __esm({
322023
322744
  "src/commands/workspace/processes.ts"() {
322024
- import_child_process5 = require("child_process");
322745
+ import_child_process6 = require("child_process");
322025
322746
  init_files();
322026
322747
  DEFAULT_TIMEOUT_S = 300;
322027
322748
  MAX_TIMEOUT_S = 1800;
@@ -322104,7 +322825,7 @@ var init_processes = __esm({
322104
322825
  if (!child.pid || child.exitCode !== null) return;
322105
322826
  try {
322106
322827
  if (process.platform === "win32") {
322107
- (0, import_child_process5.spawn)("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
322828
+ (0, import_child_process6.spawn)("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
322108
322829
  } else {
322109
322830
  process.kill(-child.pid, signal);
322110
322831
  }
@@ -322146,7 +322867,7 @@ ${this.text}` : this.text;
322146
322867
  );
322147
322868
  const started = Date.now();
322148
322869
  const [shell, shellArgs] = shellOf(args.command);
322149
- const child = (0, import_child_process5.spawn)(shell, shellArgs, {
322870
+ const child = (0, import_child_process6.spawn)(shell, shellArgs, {
322150
322871
  cwd: args.cwd,
322151
322872
  env: args.env,
322152
322873
  stdio: ["ignore", "pipe", "pipe"],
@@ -322236,7 +322957,7 @@ ${this.text}` : this.text;
322236
322957
  }
322237
322958
  }
322238
322959
  const [shell, shellArgs] = shellOf(args.command);
322239
- const child = (0, import_child_process5.spawn)(shell, shellArgs, {
322960
+ const child = (0, import_child_process6.spawn)(shell, shellArgs, {
322240
322961
  cwd: args.cwd,
322241
322962
  env: args.env,
322242
322963
  stdio: ["ignore", "pipe", "pipe"],
@@ -322392,10 +323113,10 @@ ${this.text}` : this.text;
322392
323113
  });
322393
323114
 
322394
323115
  // src/commands/workspace/connection.ts
322395
- var import_os4, WORKSPACE_PATH_PREFIX, WORKSPACE_OPS, HEARTBEAT_MUTATION2, REQUEST_APPROVAL_MUTATION, SETTLE_APPROVAL_MUTATION, str, num, short, WorkspaceConnection;
323116
+ var import_os6, WORKSPACE_PATH_PREFIX, WORKSPACE_OPS, HEARTBEAT_MUTATION2, REQUEST_APPROVAL_MUTATION, SETTLE_APPROVAL_MUTATION, str, num, short, WorkspaceConnection;
322396
323117
  var init_connection2 = __esm({
322397
323118
  "src/commands/workspace/connection.ts"() {
322398
- import_os4 = require("os");
323119
+ import_os6 = require("os");
322399
323120
  init_tunnel();
322400
323121
  init_approvals();
322401
323122
  init_files();
@@ -322478,7 +323199,7 @@ var init_connection2 = __esm({
322478
323199
  const data = await this.operation(HEARTBEAT_MUTATION2, {
322479
323200
  info: {
322480
323201
  root: this.options.root,
322481
- hostname: (0, import_os4.hostname)(),
323202
+ hostname: (0, import_os6.hostname)(),
322482
323203
  platform: process.platform,
322483
323204
  gitBranch: await this.files.gitBranch(),
322484
323205
  clientVersion: this.options.version,
@@ -322790,12 +323511,12 @@ __export(start_exports4, {
322790
323511
  WORKSPACE_VERSION: () => WORKSPACE_VERSION,
322791
323512
  default: () => start_default2
322792
323513
  });
322793
- var import_promises8, import_path3, import_rxjs60, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
323514
+ var import_promises12, import_path6, import_rxjs66, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
322794
323515
  var init_start4 = __esm({
322795
323516
  "src/commands/workspace/start.ts"() {
322796
- import_promises8 = require("fs/promises");
322797
- import_path3 = require("path");
322798
- import_rxjs60 = __toESM(require_cjs());
323517
+ import_promises12 = require("fs/promises");
323518
+ import_path6 = require("path");
323519
+ import_rxjs66 = __toESM(require_cjs());
322799
323520
  init_helpers();
322800
323521
  init_gql_client();
322801
323522
  init_log();
@@ -322812,7 +323533,7 @@ var init_start4 = __esm({
322812
323533
  if (cmd.token) {
322813
323534
  return {
322814
323535
  id: "(from --token)",
322815
- name: cmd.name ?? (0, import_path3.basename)(root),
323536
+ name: cmd.name ?? (0, import_path6.basename)(root),
322816
323537
  token: cmd.token,
322817
323538
  projectId: cmd.project ?? "",
322818
323539
  root
@@ -322825,16 +323546,16 @@ var init_start4 = __esm({
322825
323546
  if (saved && (!cmd.project || cmd.project === saved.projectId)) {
322826
323547
  return saved;
322827
323548
  }
322828
- const projectId = await (0, import_rxjs60.lastValueFrom)(parseProjectId(cmd.project)).catch(
323549
+ const projectId = await (0, import_rxjs66.lastValueFrom)(parseProjectId(cmd.project)).catch(
322829
323550
  () => {
322830
323551
  throw new Error(
322831
323552
  "No project selected. Pass --project <projectId> or run `gcli project:use <projectId>` first."
322832
323553
  );
322833
323554
  }
322834
323555
  );
322835
- const name2 = cmd.name || (0, import_path3.basename)(root);
323556
+ const name2 = cmd.name || (0, import_path6.basename)(root);
322836
323557
  Logger.info(`Registering ${root} as local workspace "${name2}"...`);
322837
- const { workspace, token } = await (0, import_rxjs60.lastValueFrom)(
323558
+ const { workspace, token } = await (0, import_rxjs66.lastValueFrom)(
322838
323559
  GraphqlClienAPI.createLocalWorkspace(projectId, name2)
322839
323560
  ).catch((e2) => {
322840
323561
  throw new Error(
@@ -322852,7 +323573,7 @@ var init_start4 = __esm({
322852
323573
  return created;
322853
323574
  };
322854
323575
  start_default2 = async (cmd) => {
322855
- const root = await (0, import_promises8.realpath)(process.cwd());
323576
+ const root = await (0, import_promises12.realpath)(process.cwd());
322856
323577
  const workspace = await resolveWorkspace(root, cmd);
322857
323578
  const wsUrl = cmd.wsUrl || workspace.wsUrl || deriveSubscriptionsUrl(await readLoginApiUrl());
322858
323579
  const policy = new CommandPolicy(
@@ -322925,16 +323646,16 @@ var list_exports9 = {};
322925
323646
  __export(list_exports9, {
322926
323647
  default: () => list_default9
322927
323648
  });
322928
- var import_rxjs61, list_default9;
323649
+ var import_rxjs67, list_default9;
322929
323650
  var init_list9 = __esm({
322930
323651
  "src/commands/workspace/list.ts"() {
322931
- import_rxjs61 = __toESM(require_cjs());
323652
+ import_rxjs67 = __toESM(require_cjs());
322932
323653
  init_gql_client();
322933
323654
  init_log();
322934
323655
  init_config2();
322935
323656
  list_default9 = async (cmd) => {
322936
323657
  const [workspaces, saved] = await Promise.all([
322937
- (0, import_rxjs61.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
323658
+ (0, import_rxjs67.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
322938
323659
  readSavedWorkspaces()
322939
323660
  ]);
322940
323661
  const onThisMachine = new Set(Object.values(saved).map((w) => w.id));
@@ -322968,23 +323689,23 @@ var delete_exports6 = {};
322968
323689
  __export(delete_exports6, {
322969
323690
  default: () => delete_default6
322970
323691
  });
322971
- var import_promises9, import_rxjs62, delete_default6;
323692
+ var import_promises13, import_rxjs68, delete_default6;
322972
323693
  var init_delete6 = __esm({
322973
323694
  "src/commands/workspace/delete.ts"() {
322974
- import_promises9 = require("fs/promises");
322975
- import_rxjs62 = __toESM(require_cjs());
323695
+ import_promises13 = require("fs/promises");
323696
+ import_rxjs68 = __toESM(require_cjs());
322976
323697
  init_gql_client();
322977
323698
  init_log();
322978
323699
  init_config2();
322979
323700
  delete_default6 = async (cmd) => {
322980
- const root = await (0, import_promises9.realpath)(process.cwd());
323701
+ const root = await (0, import_promises13.realpath)(process.cwd());
322981
323702
  const workspaceId = cmd.id || (await readSavedWorkspace(root))?.id;
322982
323703
  if (!workspaceId) {
322983
323704
  throw new Error(
322984
323705
  "No workspace registered for this directory - pass --id (see `gcli workspace:list`)."
322985
323706
  );
322986
323707
  }
322987
- await (0, import_rxjs62.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
323708
+ await (0, import_rxjs68.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
322988
323709
  await forgetWorkspace({ id: workspaceId });
322989
323710
  Logger.log(
322990
323711
  `Local workspace ${workspaceId} deleted; its token no longer works.`
@@ -323066,6 +323787,48 @@ function registerClusterCommands(program2) {
323066
323787
  "Every cluster's status, agent, nodes, CPU/memory load, autoscaling and open issues (or one with --cluster)"
323067
323788
  )
323068
323789
  ).action(lazy(() => Promise.resolve().then(() => (init_status(), status_exports)).then((m2) => m2.default)));
323790
+ target(
323791
+ program2.command("cluster:attach").description(
323792
+ "Attach a machine you own (booted from the Talos ISO, on this network) to a Talos cluster as an extra worker - its install disk is WIPED"
323793
+ )
323794
+ ).option("--node-ip <nodeIp>", "The machine's address on your network").option("-n, --name <name>", "Machine name = hostname, e.g. home-1").option("--pool <pool>", 'Pool label lambforge.io/pool (default "default")').option(
323795
+ "--reserved",
323796
+ "Only workloads that tolerate the pool run there (default: plain extra capacity)"
323797
+ ).option("--disk <disk>", "Install disk, e.g. /dev/nvme0n1 (WIPED)").option("--yes", "Do not ask before wiping the disk").option("--no-wait", "Do not wait for the machine to join").option("--timeout <minutes>", "How long to wait for the join (default 10)").action(lazy(() => Promise.resolve().then(() => (init_attach2(), attach_exports)).then((m2) => m2.default)));
323798
+ target(
323799
+ program2.command("cluster:nodes").description(
323800
+ "Every node of a cluster: its Hetzner control planes and workers and the machines attached to it"
323801
+ )
323802
+ ).action(lazy(() => Promise.resolve().then(() => (init_nodes(), nodes_exports)).then((m2) => m2.default)));
323803
+ target(
323804
+ program2.command("cluster:pause").description(
323805
+ "Pause an attached machine (cordon): nothing new runs there, running work stays"
323806
+ )
323807
+ ).option("-n, --name <name>", "Machine name (see cluster:nodes)").action(lazy(() => Promise.resolve().then(() => (init_pause(), pause_exports)).then((m2) => m2.pause)));
323808
+ target(
323809
+ program2.command("cluster:resume").description("Let new work run on a paused machine again (uncordon)")
323810
+ ).option("-n, --name <name>", "Machine name (see cluster:nodes)").action(lazy(() => Promise.resolve().then(() => (init_pause(), pause_exports)).then((m2) => m2.resume)));
323811
+ target(
323812
+ program2.command("cluster:reset-machine").description(
323813
+ "Bring a detached machine back to maintenance mode to attach it again (wipes its config and data, keeps the boot loader)"
323814
+ )
323815
+ ).option("-n, --name <name>", "Machine name").option("--node-ip <nodeIp>", "The machine's address on your network").option("--yes", "Do not ask for confirmation").action(lazy(() => Promise.resolve().then(() => (init_reset_machine(), reset_machine_exports)).then((m2) => m2.default)));
323816
+ target(
323817
+ program2.command("cluster:talosconfig").description(
323818
+ "A short-lived talosconfig for one of your Talos clusters (admin of its machines with talosctl) - printed, or saved with -o"
323819
+ )
323820
+ ).option(
323821
+ "-o, --output <output>",
323822
+ "Write to this file (mode 600) instead of stdout"
323823
+ ).option(
323824
+ "--ttl <minutes>",
323825
+ "How long it works, 5 to 1440 minutes (default 60)"
323826
+ ).action(lazy(() => Promise.resolve().then(() => (init_talosconfig(), talosconfig_exports)).then((m2) => m2.default)));
323827
+ target(
323828
+ program2.command("cluster:detach").description(
323829
+ "Drain and remove an attached machine from a cluster (reset the machine afterwards)"
323830
+ )
323831
+ ).option("-n, --name <name>", "Machine name (see cluster:nodes)").option("--yes", "Do not ask for confirmation").action(lazy(() => Promise.resolve().then(() => (init_detach(), detach_exports)).then((m2) => m2.default)));
323069
323832
  target(
323070
323833
  program2.command("cluster:health").description(
323071
323834
  "The latest health report of a cluster's agent, with every node"