@gapi/gcli 1.8.249 → 1.8.250

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 lastValueFrom57(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 = lastValueFrom57;
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 rm4(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(rm4(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 join4(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 join4(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,104 @@ 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 setClusterNodePaused(clusterId, name2, paused) {
37298
+ return this.query({
37299
+ query: gql`
37300
+ mutation setClusterNodePaused(
37301
+ $clusterId: String!
37302
+ $name: String!
37303
+ $paused: Boolean!
37304
+ ) {
37305
+ setClusterNodePaused(
37306
+ clusterId: $clusterId
37307
+ name: $name
37308
+ paused: $paused
37309
+ ) {
37310
+ ${ClusterNodeFragment}
37311
+ }
37312
+ }
37313
+ `,
37314
+ variables: { clusterId, name: name2, paused }
37315
+ }).pipe((0, import_operators.map)((res) => res.setClusterNodePaused));
37316
+ }
37317
+ static detachClusterNode(clusterId, name2) {
37318
+ return this.query({
37319
+ query: gql`
37320
+ mutation detachClusterNode($clusterId: String!, $name: String!) {
37321
+ detachClusterNode(clusterId: $clusterId, name: $name) {
37322
+ ${ClusterNodeFragment}
37323
+ }
37324
+ }
37325
+ `,
37326
+ variables: { clusterId, name: name2 }
37327
+ }).pipe((0, import_operators.map)((res) => res.detachClusterNode));
37328
+ }
37214
37329
  static clusterHealth(projectId, clusterId, limit = 1) {
37215
37330
  return this.query({
37216
37331
  query: gql`
@@ -38155,13 +38270,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
38155
38270
  if (g[n]) {
38156
38271
  i2[n] = function(v) {
38157
38272
  return new Promise(function(a, b) {
38158
- q.push([n, v, a, b]) > 1 || resume(n, v);
38273
+ q.push([n, v, a, b]) > 1 || resume2(n, v);
38159
38274
  });
38160
38275
  };
38161
38276
  if (f3) i2[n] = f3(i2[n]);
38162
38277
  }
38163
38278
  }
38164
- function resume(n, v) {
38279
+ function resume2(n, v) {
38165
38280
  try {
38166
38281
  step(g[n](v));
38167
38282
  } catch (e2) {
@@ -38172,13 +38287,13 @@ function __asyncGenerator(thisArg, _arguments, generator) {
38172
38287
  r2.value instanceof __await ? Promise.resolve(r2.value.v).then(fulfill, reject) : settle(q[0][2], r2);
38173
38288
  }
38174
38289
  function fulfill(value) {
38175
- resume("next", value);
38290
+ resume2("next", value);
38176
38291
  }
38177
38292
  function reject(value) {
38178
- resume("throw", value);
38293
+ resume2("throw", value);
38179
38294
  }
38180
38295
  function settle(f3, v) {
38181
- if (f3(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
38296
+ if (f3(v), q.shift(), q.length) resume2(q[0][0], q[0][1]);
38182
38297
  }
38183
38298
  }
38184
38299
  function __asyncDelegator(o) {
@@ -38580,7 +38695,7 @@ var require_util = __commonJS({
38580
38695
  return path2;
38581
38696
  }
38582
38697
  exports2.normalize = normalize2;
38583
- function join3(aRoot, aPath) {
38698
+ function join4(aRoot, aPath) {
38584
38699
  if (aRoot === "") {
38585
38700
  aRoot = ".";
38586
38701
  }
@@ -38612,7 +38727,7 @@ var require_util = __commonJS({
38612
38727
  }
38613
38728
  return joined;
38614
38729
  }
38615
- exports2.join = join3;
38730
+ exports2.join = join4;
38616
38731
  exports2.isAbsolute = function(aPath) {
38617
38732
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
38618
38733
  };
@@ -38785,7 +38900,7 @@ var require_util = __commonJS({
38785
38900
  parsed.path = parsed.path.substring(0, index + 1);
38786
38901
  }
38787
38902
  }
38788
- sourceURL = join3(urlGenerate(parsed), sourceURL);
38903
+ sourceURL = join4(urlGenerate(parsed), sourceURL);
38789
38904
  }
38790
38905
  return normalize2(sourceURL);
38791
38906
  }
@@ -42911,7 +43026,7 @@ var require_typescript = __commonJS({
42911
43026
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
42912
43027
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
42913
43028
  writeCommentRange: () => writeCommentRange,
42914
- writeFile: () => writeFile9,
43029
+ writeFile: () => writeFile10,
42915
43030
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
42916
43031
  zipWith: () => zipWith
42917
43032
  });
@@ -61554,7 +61669,7 @@ ${lanes.join("\n")}
61554
61669
  sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
61555
61670
  return combinePaths(newDirPath, sourceFilePath);
61556
61671
  }
61557
- function writeFile9(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
61672
+ function writeFile10(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
61558
61673
  host.writeFile(
61559
61674
  fileName,
61560
61675
  text,
@@ -170305,7 +170420,7 @@ ${lanes.join("\n")}
170305
170420
  return;
170306
170421
  }
170307
170422
  const buildInfo = host.getBuildInfo() || { version: version2 };
170308
- writeFile9(
170423
+ writeFile10(
170309
170424
  host,
170310
170425
  emitterDiagnostics,
170311
170426
  buildInfoPath,
@@ -170517,7 +170632,7 @@ ${lanes.join("\n")}
170517
170632
  }
170518
170633
  if (sourceMapFilePath) {
170519
170634
  const sourceMap = sourceMapGenerator.toString();
170520
- writeFile9(
170635
+ writeFile10(
170521
170636
  host,
170522
170637
  emitterDiagnostics,
170523
170638
  sourceMapFilePath,
@@ -170532,7 +170647,7 @@ ${lanes.join("\n")}
170532
170647
  }
170533
170648
  const text = writer.getText();
170534
170649
  const data = { sourceMapUrlPos, diagnostics: transform22.diagnostics };
170535
- writeFile9(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
170650
+ writeFile10(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
170536
170651
  writer.clear();
170537
170652
  return !data.skippedDtsWrite;
170538
170653
  }
@@ -238414,7 +238529,7 @@ ${options.prefix}` : "\n" : options.prefix
238414
238529
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
238415
238530
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
238416
238531
  writeCommentRange: () => writeCommentRange,
238417
- writeFile: () => writeFile9,
238532
+ writeFile: () => writeFile10,
238418
238533
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
238419
238534
  zipWith: () => zipWith
238420
238535
  });
@@ -255480,22 +255595,362 @@ var init_status = __esm({
255480
255595
  }
255481
255596
  });
255482
255597
 
255598
+ // src/commands/cluster/helpers/attach.ts
255599
+ function parseAttachOptions(cmd) {
255600
+ const nodeIp = (cmd.nodeIp ?? "").trim();
255601
+ const name2 = (cmd.name ?? "").trim();
255602
+ const pool = (cmd.pool ?? "").trim() || void 0;
255603
+ const disk = (cmd.disk ?? "").trim() || void 0;
255604
+ if (!nodeIp || !HOST_RE.test(nodeIp)) {
255605
+ throw new Error(
255606
+ "--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)"
255607
+ );
255608
+ }
255609
+ if (!NAME_RE.test(name2)) {
255610
+ throw new Error(
255611
+ "--name is required: lowercase letters, digits and dashes (it becomes the machine hostname, e.g. home-1)"
255612
+ );
255613
+ }
255614
+ if (pool && !POOL_RE.test(pool)) {
255615
+ throw new Error("--pool: lowercase letters, digits and dashes (max 32)");
255616
+ }
255617
+ if (disk && !DISK_RE.test(disk)) {
255618
+ throw new Error("--disk must look like /dev/nvme0n1 or /dev/sda");
255619
+ }
255620
+ const timeoutMinutes = cmd.timeout === void 0 ? 10 : Number(cmd.timeout);
255621
+ if (!Number.isFinite(timeoutMinutes) || timeoutMinutes < 1 || timeoutMinutes > 60) {
255622
+ throw new Error("--timeout is in minutes, 1 to 60");
255623
+ }
255624
+ return {
255625
+ nodeIp,
255626
+ name: name2,
255627
+ pool,
255628
+ disk,
255629
+ reserved: !!cmd.reserved,
255630
+ yes: !!cmd.yes,
255631
+ wait: cmd.wait !== false,
255632
+ timeoutMs: timeoutMinutes * 6e4
255633
+ };
255634
+ }
255635
+ function serverTalosVersion(output) {
255636
+ const spec = output.split(/^spec:/m)[1];
255637
+ return spec?.match(/^\s+version:\s*(v[\d.]+\S*)/m)?.[1];
255638
+ }
255639
+ var NAME_RE, POOL_RE, DISK_RE, HOST_RE, nodeRow, resetHint;
255640
+ var init_attach = __esm({
255641
+ "src/commands/cluster/helpers/attach.ts"() {
255642
+ NAME_RE = /^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/;
255643
+ POOL_RE = /^[a-z0-9]([a-z0-9-]{0,30}[a-z0-9])?$/;
255644
+ DISK_RE = /^\/dev\/[A-Za-z0-9/_-]+$/;
255645
+ HOST_RE = /^[A-Za-z0-9.:-]+$/;
255646
+ nodeRow = (n) => {
255647
+ const own = n.source !== "hetzner";
255648
+ return {
255649
+ node: n.name,
255650
+ role: n.role === "control-plane" ? "control plane" : "worker",
255651
+ source: own ? "own" : "hetzner",
255652
+ status: n.cordoned ? `${n.status}, paused` : n.status,
255653
+ pool: own ? n.pool ?? "-" : "-",
255654
+ use: own ? n.reserved ? "reserved" : "capacity" : "-",
255655
+ ip: n.internalIp ?? "-",
255656
+ cpu: n.cpuCores ?? "-",
255657
+ memoryGb: n.memoryGb ?? "-",
255658
+ talos: n.osImage ?? "-",
255659
+ joined: n.joinedAt ?? "-",
255660
+ ...own && !n.recorded ? { note: "joined by hand" } : {}
255661
+ };
255662
+ };
255663
+ resetHint = (ip = "<machine-ip>") => `talosctl --talosconfig <cluster talosconfig> -n ${ip} -e ${ip} reset --graceful=false --reboot --system-labels-to-wipe STATE --system-labels-to-wipe EPHEMERAL`;
255664
+ }
255665
+ });
255666
+
255667
+ // src/commands/cluster/attach.ts
255668
+ var attach_exports = {};
255669
+ __export(attach_exports, {
255670
+ default: () => attach_default
255671
+ });
255672
+ var import_child_process, import_promises, import_os2, import_path, import_readline, import_rxjs17, talosctl, sleep, ask, attach_default;
255673
+ var init_attach2 = __esm({
255674
+ "src/commands/cluster/attach.ts"() {
255675
+ import_child_process = require("child_process");
255676
+ import_promises = require("fs/promises");
255677
+ import_os2 = require("os");
255678
+ import_path = require("path");
255679
+ import_readline = require("readline");
255680
+ import_rxjs17 = __toESM(require_cjs());
255681
+ init_gql_client();
255682
+ init_log();
255683
+ init_attach();
255684
+ init_cluster_change();
255685
+ talosctl = (args, timeoutMs = 2e4) => new Promise(
255686
+ (resolve2) => (0, import_child_process.execFile)(
255687
+ "talosctl",
255688
+ args,
255689
+ { timeout: timeoutMs, maxBuffer: 10 * 1024 * 1024 },
255690
+ (error48, stdout, stderr) => resolve2({
255691
+ code: error48 ? error48.code ?? 1 : 0,
255692
+ stdout: String(stdout),
255693
+ stderr: String(stderr)
255694
+ })
255695
+ )
255696
+ );
255697
+ sleep = (ms) => new Promise((r2) => setTimeout(r2, ms));
255698
+ ask = (question) => new Promise((resolve2) => {
255699
+ const rl = (0, import_readline.createInterface)({
255700
+ input: process.stdin,
255701
+ output: process.stdout
255702
+ });
255703
+ rl.question(question, (answer) => {
255704
+ rl.close();
255705
+ resolve2(answer.trim());
255706
+ });
255707
+ });
255708
+ attach_default = async (cmd) => {
255709
+ const opts = parseAttachOptions(cmd);
255710
+ const { clusterId } = await resolveClusterTarget(cmd);
255711
+ const info = await (0, import_rxjs17.lastValueFrom)(
255712
+ GraphqlClienAPI.clusterAttachInfo(clusterId)
255713
+ );
255714
+ if (!info.attachable) {
255715
+ throw new Error(
255716
+ info.reason ?? "Machines cannot be attached to this cluster."
255717
+ );
255718
+ }
255719
+ if ((await talosctl(["version", "--client"])).code !== 0) {
255720
+ throw new Error(
255721
+ "talosctl is not installed. Install it (https://www.talos.dev/latest/talos-guides/install/talosctl/) - e.g. curl -sL https://talos.dev/install | sh"
255722
+ );
255723
+ }
255724
+ Logger.info(`Looking for the Talos installer at ${opts.nodeIp}:50000 ...`);
255725
+ let version2;
255726
+ for (let i2 = 0; i2 < 12 && !version2; i2++) {
255727
+ const probe = await talosctl([
255728
+ "-n",
255729
+ opts.nodeIp,
255730
+ "get",
255731
+ "version",
255732
+ "--insecure",
255733
+ "-o",
255734
+ "yaml"
255735
+ ]);
255736
+ version2 = probe.code === 0 ? serverTalosVersion(probe.stdout) : void 0;
255737
+ if (!version2) await sleep(5e3);
255738
+ }
255739
+ if (!version2) {
255740
+ throw new Error(
255741
+ `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.`
255742
+ );
255743
+ }
255744
+ Logger.info(`Machine runs the Talos ${version2} installer. Its disks:`);
255745
+ const disks = await talosctl([
255746
+ "-n",
255747
+ opts.nodeIp,
255748
+ "get",
255749
+ "disks",
255750
+ "--insecure"
255751
+ ]);
255752
+ Logger.log(disks.stdout || disks.stderr);
255753
+ if (!opts.disk) {
255754
+ throw new Error(
255755
+ `Pick the install disk from the list above and run again with --disk, e.g. --disk /dev/nvme0n1. It is WIPED. Nothing was changed.`
255756
+ );
255757
+ }
255758
+ if (!opts.yes) {
255759
+ const answer = await ask(
255760
+ `Talos will WIPE ${opts.disk} on ${opts.nodeIp}. Type the machine name (${opts.name}) to continue: `
255761
+ );
255762
+ if (answer !== opts.name) {
255763
+ Logger.warn("Cancelled - nothing was changed.");
255764
+ return;
255765
+ }
255766
+ }
255767
+ const join_ = await (0, import_rxjs17.lastValueFrom)(
255768
+ GraphqlClienAPI.clusterNodeJoinConfig({
255769
+ clusterId,
255770
+ name: opts.name,
255771
+ pool: opts.pool,
255772
+ reserved: opts.reserved,
255773
+ installDisk: opts.disk
255774
+ })
255775
+ );
255776
+ if (join_.talosVersion && join_.talosVersion !== version2) {
255777
+ Logger.warn(
255778
+ `The cluster runs Talos ${join_.talosVersion}, the machine booted ${version2}. It installs ${join_.talosVersion} anyway; if the join fails, boot ${join_.isoUrl}.`
255779
+ );
255780
+ }
255781
+ const dir = await (0, import_promises.mkdtemp)((0, import_path.join)((0, import_os2.tmpdir)(), "gcli-attach-"));
255782
+ const file2 = (0, import_path.join)(dir, "machine.yaml");
255783
+ try {
255784
+ await (0, import_promises.writeFile)(file2, join_.config, { mode: 384 });
255785
+ const applied = await talosctl(
255786
+ ["-n", opts.nodeIp, "apply-config", "--insecure", "--file", file2],
255787
+ 6e4
255788
+ );
255789
+ if (applied.code !== 0) {
255790
+ throw new Error(
255791
+ `talosctl apply-config failed: ${(applied.stderr || applied.stdout).trim()}`
255792
+ );
255793
+ }
255794
+ } finally {
255795
+ await (0, import_promises.rm)(dir, { recursive: true, force: true });
255796
+ }
255797
+ Logger.info(
255798
+ `Config applied - ${opts.name} installs Talos and reboots, then joins "${join_.clusterName}" (pool ${join_.pool}, ${join_.reserved ? "reserved" : "extra capacity"}).`
255799
+ );
255800
+ if (!opts.wait) {
255801
+ Logger.info("Check progress with: gcli cluster:nodes");
255802
+ return;
255803
+ }
255804
+ Logger.info(
255805
+ "Waiting for it to join (install + reboot take a few minutes) ..."
255806
+ );
255807
+ const deadline = Date.now() + opts.timeoutMs;
255808
+ while (Date.now() < deadline) {
255809
+ await sleep(15e3);
255810
+ const nodes = await (0, import_rxjs17.lastValueFrom)(GraphqlClienAPI.clusterNodes(clusterId));
255811
+ const node = nodes.find((n) => n.name === opts.name);
255812
+ if (node?.status === "ready") {
255813
+ Logger.log(`${opts.name} joined and is ready.`);
255814
+ Logger.table([nodeRow(node)]);
255815
+ return;
255816
+ }
255817
+ }
255818
+ Logger.warn(
255819
+ `${opts.name} has not joined yet. Check gcli cluster:nodes later; if it never joins, reset it (${resetHint(opts.nodeIp)}) and attach again.`
255820
+ );
255821
+ };
255822
+ }
255823
+ });
255824
+
255825
+ // src/commands/cluster/nodes.ts
255826
+ var nodes_exports = {};
255827
+ __export(nodes_exports, {
255828
+ default: () => nodes_default
255829
+ });
255830
+ var import_rxjs18, nodes_default;
255831
+ var init_nodes = __esm({
255832
+ "src/commands/cluster/nodes.ts"() {
255833
+ import_rxjs18 = __toESM(require_cjs());
255834
+ init_gql_client();
255835
+ init_log();
255836
+ init_attach();
255837
+ init_cluster_change();
255838
+ nodes_default = async (cmd) => {
255839
+ const { clusterId } = await resolveClusterTarget(cmd);
255840
+ const nodes = await (0, import_rxjs18.lastValueFrom)(
255841
+ GraphqlClienAPI.clusterNodes(clusterId, true)
255842
+ );
255843
+ if (!nodes.length) {
255844
+ Logger.info("No nodes reported for this cluster yet.");
255845
+ return;
255846
+ }
255847
+ Logger.table(nodes.map(nodeRow));
255848
+ if (!nodes.some((n) => n.source !== "hetzner")) {
255849
+ Logger.info(
255850
+ "No machines of your own attached. Attach one with: gcli cluster:attach --cluster <id> --node-ip <ip> --name <name> --disk <disk>"
255851
+ );
255852
+ }
255853
+ };
255854
+ }
255855
+ });
255856
+
255857
+ // src/commands/cluster/pause.ts
255858
+ var pause_exports = {};
255859
+ __export(pause_exports, {
255860
+ pause: () => pause,
255861
+ resume: () => resume
255862
+ });
255863
+ var import_rxjs19, setPaused, pause, resume;
255864
+ var init_pause = __esm({
255865
+ "src/commands/cluster/pause.ts"() {
255866
+ import_rxjs19 = __toESM(require_cjs());
255867
+ init_gql_client();
255868
+ init_log();
255869
+ init_cluster_change();
255870
+ setPaused = (paused) => async (cmd) => {
255871
+ const name2 = (cmd.name ?? "").trim();
255872
+ if (!name2) {
255873
+ throw new Error("--name is required (see gcli cluster:nodes)");
255874
+ }
255875
+ const { clusterId } = await resolveClusterTarget(cmd);
255876
+ const node = await (0, import_rxjs19.lastValueFrom)(
255877
+ GraphqlClienAPI.setClusterNodePaused(clusterId, name2, paused)
255878
+ );
255879
+ Logger.log(
255880
+ paused ? `${node.name} is paused: nothing new runs there, running work stays. Undo with gcli cluster:resume.` : `${node.name} takes new work again.`
255881
+ );
255882
+ };
255883
+ pause = setPaused(true);
255884
+ resume = setPaused(false);
255885
+ }
255886
+ });
255887
+
255888
+ // src/commands/cluster/detach.ts
255889
+ var detach_exports = {};
255890
+ __export(detach_exports, {
255891
+ default: () => detach_default
255892
+ });
255893
+ var import_readline2, import_rxjs20, detach_default;
255894
+ var init_detach = __esm({
255895
+ "src/commands/cluster/detach.ts"() {
255896
+ import_readline2 = require("readline");
255897
+ import_rxjs20 = __toESM(require_cjs());
255898
+ init_gql_client();
255899
+ init_log();
255900
+ init_attach();
255901
+ init_cluster_change();
255902
+ detach_default = async (cmd) => {
255903
+ const name2 = (cmd.name ?? "").trim();
255904
+ if (!name2) {
255905
+ throw new Error("--name is required (see gcli cluster:nodes)");
255906
+ }
255907
+ const { clusterId } = await resolveClusterTarget(cmd);
255908
+ if (!cmd.yes) {
255909
+ const answer = await new Promise((resolve2) => {
255910
+ const rl = (0, import_readline2.createInterface)({
255911
+ input: process.stdin,
255912
+ output: process.stdout
255913
+ });
255914
+ rl.question(
255915
+ `Drain and remove ${name2} from the cluster? Its pods move to other nodes. [y/N] `,
255916
+ (a) => {
255917
+ rl.close();
255918
+ resolve2(a.trim().toLowerCase());
255919
+ }
255920
+ );
255921
+ });
255922
+ if (answer !== "y" && answer !== "yes") {
255923
+ Logger.warn("Cancelled - nothing was changed.");
255924
+ return;
255925
+ }
255926
+ }
255927
+ const node = await (0, import_rxjs20.lastValueFrom)(
255928
+ GraphqlClienAPI.detachClusterNode(clusterId, name2)
255929
+ );
255930
+ Logger.log(`${node.name} is detached.`);
255931
+ Logger.info(
255932
+ `The machine still runs Talos. To reuse it, reset it from its network: ${resetHint()}`
255933
+ );
255934
+ };
255935
+ }
255936
+ });
255937
+
255483
255938
  // src/commands/cluster/health.ts
255484
255939
  var health_exports = {};
255485
255940
  __export(health_exports, {
255486
255941
  default: () => health_default
255487
255942
  });
255488
- var import_rxjs17, pct2, health_default;
255943
+ var import_rxjs21, pct2, health_default;
255489
255944
  var init_health = __esm({
255490
255945
  "src/commands/cluster/health.ts"() {
255491
- import_rxjs17 = __toESM(require_cjs());
255946
+ import_rxjs21 = __toESM(require_cjs());
255492
255947
  init_gql_client();
255493
255948
  init_log();
255494
255949
  init_cluster_change();
255495
255950
  pct2 = (v) => v == null ? "-" : `${Math.round(v)}%`;
255496
255951
  health_default = async (cmd) => {
255497
255952
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255498
- const [latest] = await (0, import_rxjs17.lastValueFrom)(
255953
+ const [latest] = await (0, import_rxjs21.lastValueFrom)(
255499
255954
  GraphqlClienAPI.clusterHealth(projectId, clusterId, 1)
255500
255955
  );
255501
255956
  Logger.log("-------------------");
@@ -255542,17 +255997,17 @@ var scale_events_exports = {};
255542
255997
  __export(scale_events_exports, {
255543
255998
  default: () => scale_events_default
255544
255999
  });
255545
- var import_rxjs18, scale_events_default;
256000
+ var import_rxjs22, scale_events_default;
255546
256001
  var init_scale_events = __esm({
255547
256002
  "src/commands/cluster/scale-events.ts"() {
255548
- import_rxjs18 = __toESM(require_cjs());
256003
+ import_rxjs22 = __toESM(require_cjs());
255549
256004
  init_gql_client();
255550
256005
  init_log();
255551
256006
  init_cluster_change();
255552
256007
  scale_events_default = async (cmd) => {
255553
256008
  const limit = cmd.limit === void 0 ? 20 : parseIntOption("limit", cmd.limit, 1, 200);
255554
256009
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255555
- const events = await (0, import_rxjs18.lastValueFrom)(
256010
+ const events = await (0, import_rxjs22.lastValueFrom)(
255556
256011
  GraphqlClienAPI.clusterScaleEvents(projectId, clusterId, limit)
255557
256012
  );
255558
256013
  Logger.log("-------------------");
@@ -255582,17 +256037,17 @@ var cost_exports = {};
255582
256037
  __export(cost_exports, {
255583
256038
  default: () => cost_default
255584
256039
  });
255585
- var import_rxjs19, money, cost_default;
256040
+ var import_rxjs23, money, cost_default;
255586
256041
  var init_cost = __esm({
255587
256042
  "src/commands/cluster/cost.ts"() {
255588
- import_rxjs19 = __toESM(require_cjs());
256043
+ import_rxjs23 = __toESM(require_cjs());
255589
256044
  init_helpers();
255590
256045
  init_gql_client();
255591
256046
  init_log();
255592
256047
  money = (v, sign = "\u20AC") => v == null ? "-" : `${sign}${v.toFixed(2)}`;
255593
256048
  cost_default = async (cmd) => {
255594
- const projectId = await (0, import_rxjs19.lastValueFrom)(parseProjectId(cmd.project));
255595
- const rows = await (0, import_rxjs19.lastValueFrom)(
256049
+ const projectId = await (0, import_rxjs23.lastValueFrom)(parseProjectId(cmd.project));
256050
+ const rows = await (0, import_rxjs23.lastValueFrom)(
255596
256051
  GraphqlClienAPI.projectClustersOverview(projectId)
255597
256052
  );
255598
256053
  Logger.log("-------------------");
@@ -255680,10 +256135,10 @@ __export(autoscale_exports, {
255680
256135
  default: () => autoscale_default,
255681
256136
  toAutoscaleInput: () => toAutoscaleInput
255682
256137
  });
255683
- var import_rxjs20, toAutoscaleInput, autoscale_default;
256138
+ var import_rxjs24, toAutoscaleInput, autoscale_default;
255684
256139
  var init_autoscale = __esm({
255685
256140
  "src/commands/cluster/autoscale.ts"() {
255686
- import_rxjs20 = __toESM(require_cjs());
256141
+ import_rxjs24 = __toESM(require_cjs());
255687
256142
  init_gql_client();
255688
256143
  init_log();
255689
256144
  init_cluster_change();
@@ -255724,7 +256179,7 @@ var init_autoscale = __esm({
255724
256179
  autoscale_default = async (cmd) => {
255725
256180
  const input = toAutoscaleInput(cmd);
255726
256181
  const { projectId, clusterId } = await resolveClusterTarget(cmd);
255727
- const cluster = await (0, import_rxjs20.lastValueFrom)(
256182
+ const cluster = await (0, import_rxjs24.lastValueFrom)(
255728
256183
  GraphqlClienAPI.updateProjectClusterAutoscale(projectId, clusterId, input)
255729
256184
  );
255730
256185
  const a = cluster.autoscale ?? {};
@@ -255832,15 +256287,15 @@ var list_environments_exports = {};
255832
256287
  __export(list_environments_exports, {
255833
256288
  default: () => list_environments_default
255834
256289
  });
255835
- var import_rxjs21, import_operators12, list_environments_default;
256290
+ var import_rxjs25, import_operators12, list_environments_default;
255836
256291
  var init_list_environments = __esm({
255837
256292
  "src/commands/environment/list-environments.ts"() {
255838
- import_rxjs21 = __toESM(require_cjs());
256293
+ import_rxjs25 = __toESM(require_cjs());
255839
256294
  import_operators12 = __toESM(require_operators());
255840
256295
  init_helpers();
255841
256296
  init_gql_client();
255842
256297
  init_log();
255843
- list_environments_default = (cmd) => (0, import_rxjs21.lastValueFrom)(
256298
+ list_environments_default = (cmd) => (0, import_rxjs25.lastValueFrom)(
255844
256299
  parseProjectId(cmd.project).pipe(
255845
256300
  (0, import_operators12.switchMap)((projectId) => GraphqlClienAPI.listEnvironments(projectId)),
255846
256301
  (0, import_operators12.tap)((data) => {
@@ -255873,10 +256328,10 @@ var create_environment_exports = {};
255873
256328
  __export(create_environment_exports, {
255874
256329
  default: () => create_environment_default
255875
256330
  });
255876
- var import_rxjs22, import_operators13, create_environment_default;
256331
+ var import_rxjs26, import_operators13, create_environment_default;
255877
256332
  var init_create_environment = __esm({
255878
256333
  "src/commands/environment/create-environment.ts"() {
255879
- import_rxjs22 = __toESM(require_cjs());
256334
+ import_rxjs26 = __toESM(require_cjs());
255880
256335
  import_operators13 = __toESM(require_operators());
255881
256336
  init_helpers();
255882
256337
  init_gql_client();
@@ -255884,7 +256339,7 @@ var init_create_environment = __esm({
255884
256339
  init_load_spec();
255885
256340
  create_environment_default = (cmd) => {
255886
256341
  const { clusterName: cmdClusterName, ...cmdRest } = cmd;
255887
- return (0, import_rxjs22.lastValueFrom)(
256342
+ return (0, import_rxjs26.lastValueFrom)(
255888
256343
  parseProjectId(cmd.project).pipe(
255889
256344
  (0, import_operators13.switchMap)(
255890
256345
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -255939,10 +256394,10 @@ var update_environment_exports = {};
255939
256394
  __export(update_environment_exports, {
255940
256395
  default: () => update_environment_default
255941
256396
  });
255942
- var import_rxjs23, import_operators14, update_environment_default;
256397
+ var import_rxjs27, import_operators14, update_environment_default;
255943
256398
  var init_update_environment = __esm({
255944
256399
  "src/commands/environment/update-environment.ts"() {
255945
- import_rxjs23 = __toESM(require_cjs());
256400
+ import_rxjs27 = __toESM(require_cjs());
255946
256401
  import_operators14 = __toESM(require_operators());
255947
256402
  init_helpers();
255948
256403
  init_gql_client();
@@ -255950,7 +256405,7 @@ var init_update_environment = __esm({
255950
256405
  init_load_spec();
255951
256406
  update_environment_default = (cmd) => {
255952
256407
  const { clusterName: cmdClusterName, ...cmdRest } = cmd;
255953
- return (0, import_rxjs23.lastValueFrom)(
256408
+ return (0, import_rxjs27.lastValueFrom)(
255954
256409
  parseProjectId(cmd.project).pipe(
255955
256410
  (0, import_operators14.switchMap)(
255956
256411
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -256006,16 +256461,16 @@ var delete_environment_exports = {};
256006
256461
  __export(delete_environment_exports, {
256007
256462
  default: () => delete_environment_default
256008
256463
  });
256009
- var import_rxjs24, import_operators15, delete_environment_default;
256464
+ var import_rxjs28, import_operators15, delete_environment_default;
256010
256465
  var init_delete_environment = __esm({
256011
256466
  "src/commands/environment/delete-environment.ts"() {
256012
- import_rxjs24 = __toESM(require_cjs());
256467
+ import_rxjs28 = __toESM(require_cjs());
256013
256468
  import_operators15 = __toESM(require_operators());
256014
256469
  init_helpers();
256015
256470
  init_gql_client();
256016
256471
  init_log();
256017
256472
  init_load_spec();
256018
- delete_environment_default = (cmd) => (0, import_rxjs24.lastValueFrom)(
256473
+ delete_environment_default = (cmd) => (0, import_rxjs28.lastValueFrom)(
256019
256474
  parseProjectId(cmd.project).pipe(
256020
256475
  (0, import_operators15.switchMap)(
256021
256476
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -256068,16 +256523,16 @@ var get_environment_exports = {};
256068
256523
  __export(get_environment_exports, {
256069
256524
  default: () => get_environment_default
256070
256525
  });
256071
- var import_rxjs25, import_operators16, get_environment_default;
256526
+ var import_rxjs29, import_operators16, get_environment_default;
256072
256527
  var init_get_environment = __esm({
256073
256528
  "src/commands/environment/get-environment.ts"() {
256074
- import_rxjs25 = __toESM(require_cjs());
256529
+ import_rxjs29 = __toESM(require_cjs());
256075
256530
  import_operators16 = __toESM(require_operators());
256076
256531
  init_helpers();
256077
256532
  init_gql_client();
256078
256533
  init_log();
256079
256534
  init_load_spec();
256080
- get_environment_default = (cmd) => (0, import_rxjs25.lastValueFrom)(
256535
+ get_environment_default = (cmd) => (0, import_rxjs29.lastValueFrom)(
256081
256536
  parseProjectId(cmd.project).pipe(
256082
256537
  (0, import_operators16.switchMap)(
256083
256538
  (projectId) => loadSpec(cmd.spec ?? "env.yaml").pipe(
@@ -269786,8 +270241,8 @@ var require_graceful_fs = __commonJS({
269786
270241
  }
269787
270242
  }
269788
270243
  var fs$writeFile = fs4.writeFile;
269789
- fs4.writeFile = writeFile9;
269790
- function writeFile9(path2, data, options, cb) {
270244
+ fs4.writeFile = writeFile10;
270245
+ function writeFile10(path2, data, options, cb) {
269791
270246
  if (typeof options === "function")
269792
270247
  cb = options, options = null;
269793
270248
  return go$writeFile(path2, data, options, cb);
@@ -270236,7 +270691,7 @@ var require_BufferList2 = __commonJS({
270236
270691
  this.head = this.tail = null;
270237
270692
  this.length = 0;
270238
270693
  };
270239
- BufferList.prototype.join = function join3(s2) {
270694
+ BufferList.prototype.join = function join4(s2) {
270240
270695
  if (this.length === 0) return "";
270241
270696
  var p = this.head;
270242
270697
  var ret = "" + p.data;
@@ -271580,11 +272035,11 @@ var require_stream_readable3 = __commonJS({
271580
272035
  if (!state.flowing) {
271581
272036
  debug("resume");
271582
272037
  state.flowing = true;
271583
- resume(this, state);
272038
+ resume2(this, state);
271584
272039
  }
271585
272040
  return this;
271586
272041
  };
271587
- function resume(stream, state) {
272042
+ function resume2(stream, state) {
271588
272043
  if (!state.resumeScheduled) {
271589
272044
  state.resumeScheduled = true;
271590
272045
  pna.nextTick(resume_, stream, state);
@@ -275036,7 +275491,7 @@ var require_buffer_list3 = __commonJS({
275036
275491
  }
275037
275492
  }, {
275038
275493
  key: "join",
275039
- value: function join3(s2) {
275494
+ value: function join4(s2) {
275040
275495
  if (this.length === 0) return "";
275041
275496
  var p = this.head;
275042
275497
  var ret = "" + p.data;
@@ -276858,12 +277313,12 @@ var require_stream_readable4 = __commonJS({
276858
277313
  if (!state.flowing) {
276859
277314
  debug("resume");
276860
277315
  state.flowing = !state.readableListening;
276861
- resume(this, state);
277316
+ resume2(this, state);
276862
277317
  }
276863
277318
  state.paused = false;
276864
277319
  return this;
276865
277320
  };
276866
- function resume(stream, state) {
277321
+ function resume2(stream, state) {
276867
277322
  if (!state.resumeScheduled) {
276868
277323
  state.resumeScheduled = true;
276869
277324
  process.nextTick(resume_, stream, state);
@@ -278378,7 +278833,7 @@ var require_buffer_list4 = __commonJS({
278378
278833
  }
278379
278834
  }, {
278380
278835
  key: "join",
278381
- value: function join3(s2) {
278836
+ value: function join4(s2) {
278382
278837
  if (this.length === 0) return "";
278383
278838
  var p = this.head;
278384
278839
  var ret = "" + p.data;
@@ -280200,12 +280655,12 @@ var require_stream_readable5 = __commonJS({
280200
280655
  if (!state.flowing) {
280201
280656
  debug("resume");
280202
280657
  state.flowing = !state.readableListening;
280203
- resume(this, state);
280658
+ resume2(this, state);
280204
280659
  }
280205
280660
  state.paused = false;
280206
280661
  return this;
280207
280662
  };
280208
- function resume(stream, state) {
280663
+ function resume2(stream, state) {
280209
280664
  if (!state.resumeScheduled) {
280210
280665
  state.resumeScheduled = true;
280211
280666
  process.nextTick(resume_, stream, state);
@@ -281150,7 +281605,7 @@ var require_buffer_list5 = __commonJS({
281150
281605
  }
281151
281606
  }, {
281152
281607
  key: "join",
281153
- value: function join3(s2) {
281608
+ value: function join4(s2) {
281154
281609
  if (this.length === 0) return "";
281155
281610
  var p = this.head;
281156
281611
  var ret = "" + p.data;
@@ -282972,12 +283427,12 @@ var require_stream_readable6 = __commonJS({
282972
283427
  if (!state.flowing) {
282973
283428
  debug("resume");
282974
283429
  state.flowing = !state.readableListening;
282975
- resume(this, state);
283430
+ resume2(this, state);
282976
283431
  }
282977
283432
  state.paused = false;
282978
283433
  return this;
282979
283434
  };
282980
- function resume(stream, state) {
283435
+ function resume2(stream, state) {
282981
283436
  if (!state.resumeScheduled) {
282982
283437
  state.resumeScheduled = true;
282983
283438
  process.nextTick(resume_, stream, state);
@@ -284387,7 +284842,7 @@ var require_buffer_list6 = __commonJS({
284387
284842
  }
284388
284843
  }, {
284389
284844
  key: "join",
284390
- value: function join3(s2) {
284845
+ value: function join4(s2) {
284391
284846
  if (this.length === 0) return "";
284392
284847
  var p = this.head;
284393
284848
  var ret = "" + p.data;
@@ -286209,12 +286664,12 @@ var require_stream_readable7 = __commonJS({
286209
286664
  if (!state.flowing) {
286210
286665
  debug("resume");
286211
286666
  state.flowing = !state.readableListening;
286212
- resume(this, state);
286667
+ resume2(this, state);
286213
286668
  }
286214
286669
  state.paused = false;
286215
286670
  return this;
286216
286671
  };
286217
- function resume(stream, state) {
286672
+ function resume2(stream, state) {
286218
286673
  if (!state.resumeScheduled) {
286219
286674
  state.resumeScheduled = true;
286220
286675
  process.nextTick(resume_, stream, state);
@@ -287335,22 +287790,22 @@ var package_exports = {};
287335
287790
  __export(package_exports, {
287336
287791
  default: () => package_default
287337
287792
  });
287338
- var import_archiver, import_child_process, import_fs3, import_rxjs26, import_operators17, import_util3, ReadFile, package_default;
287793
+ var import_archiver, import_child_process2, import_fs3, import_rxjs30, import_operators17, import_util3, ReadFile, package_default;
287339
287794
  var init_package = __esm({
287340
287795
  "src/commands/lambda/package.ts"() {
287341
287796
  import_archiver = __toESM(require_archiver());
287342
- import_child_process = require("child_process");
287797
+ import_child_process2 = require("child_process");
287343
287798
  import_fs3 = require("fs");
287344
- import_rxjs26 = __toESM(require_cjs());
287799
+ import_rxjs30 = __toESM(require_cjs());
287345
287800
  import_operators17 = __toESM(require_operators());
287346
287801
  import_util3 = require("util");
287347
287802
  init_helpers2();
287348
287803
  init_load_spec();
287349
287804
  init_parse_ignore();
287350
287805
  init_read_file();
287351
- ReadFile = (file2) => readFileAsObservable(file2).pipe((0, import_operators17.catchError)(() => (0, import_rxjs26.of)("")));
287806
+ ReadFile = (file2) => readFileAsObservable(file2).pipe((0, import_operators17.catchError)(() => (0, import_rxjs30.of)("")));
287352
287807
  package_default = (cmd) => {
287353
- return (0, import_rxjs26.lastValueFrom)(
287808
+ return (0, import_rxjs30.lastValueFrom)(
287354
287809
  loadSpec(cmd.spec).pipe(
287355
287810
  (0, import_operators17.map)((spec) => spec?.function ?? spec),
287356
287811
  (0, import_operators17.switchMap)(async (data) => {
@@ -287358,8 +287813,8 @@ var init_package = __esm({
287358
287813
  zlib: { level: 9 }
287359
287814
  // Sets the compression level.
287360
287815
  });
287361
- await (0, import_util3.promisify)(import_child_process.exec)(["chmod", "+x", data.script].join(" "));
287362
- const ignore = await (0, import_rxjs26.lastValueFrom)(
287816
+ await (0, import_util3.promisify)(import_child_process2.exec)(["chmod", "+x", data.script].join(" "));
287817
+ const ignore = await (0, import_rxjs30.lastValueFrom)(
287363
287818
  ReadFile(".gignore").pipe(
287364
287819
  (0, import_operators17.map)((ignore2) => parseIgnoredFiles(ignore2))
287365
287820
  )
@@ -287368,11 +287823,11 @@ var init_package = __esm({
287368
287823
  ignore: [".gcache/**", ...ignore]
287369
287824
  });
287370
287825
  archive.finalize();
287371
- return (0, import_rxjs26.lastValueFrom)(
287372
- (0, import_rxjs26.from)(streamToBufferPromise(archive)).pipe(
287826
+ return (0, import_rxjs30.lastValueFrom)(
287827
+ (0, import_rxjs30.from)(streamToBufferPromise(archive)).pipe(
287373
287828
  (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)),
287829
+ (buffer) => (0, import_rxjs30.from)((0, import_util3.promisify)(import_fs3.mkdir)(".gcache")).pipe(
287830
+ (0, import_operators17.catchError)(() => (0, import_rxjs30.of)(true)),
287376
287831
  (0, import_operators17.switchMap)(
287377
287832
  () => (0, import_util3.promisify)(import_fs3.writeFile)(`.gcache/${data.name}.zip`, buffer)
287378
287833
  )
@@ -287398,13 +287853,13 @@ function streamToBufferPromise(file2) {
287398
287853
  });
287399
287854
  });
287400
287855
  }
287401
- var import_form_data, import_fs4, import_rxjs27, import_operators18, import_stream_to_buffer, ReadFile2, createOrUpdateLambda, createCommand;
287856
+ var import_form_data, import_fs4, import_rxjs31, import_operators18, import_stream_to_buffer, ReadFile2, createOrUpdateLambda, createCommand;
287402
287857
  var init_helpers2 = __esm({
287403
287858
  "src/commands/lambda/helpers/index.ts"() {
287404
287859
  import_form_data = __toESM(require_form_data());
287405
287860
  import_fs4 = require("fs");
287406
287861
  init_src();
287407
- import_rxjs27 = __toESM(require_cjs());
287862
+ import_rxjs31 = __toESM(require_cjs());
287408
287863
  import_operators18 = __toESM(require_operators());
287409
287864
  import_stream_to_buffer = __toESM(require_stream_to_buffer());
287410
287865
  init_helpers();
@@ -287413,14 +287868,14 @@ var init_helpers2 = __esm({
287413
287868
  init_package();
287414
287869
  init_load_spec();
287415
287870
  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)(
287871
+ ReadFile2 = (file2) => readFileAsObservable(file2).pipe((0, import_operators18.catchError)(() => (0, import_rxjs31.of)("")));
287872
+ createOrUpdateLambda = (cmd, type) => (0, import_rxjs31.lastValueFrom)(
287418
287873
  parseProjectId(cmd.project).pipe(
287419
287874
  (0, import_operators18.switchMap)(
287420
287875
  (projectId) => GraphqlClienAPI.getProject(projectId).pipe((0, import_operators18.map)(() => projectId))
287421
287876
  ),
287422
287877
  (0, import_operators18.switchMap)(async (projectId) => {
287423
- const spec = await (0, import_rxjs27.lastValueFrom)(loadSpec(cmd.spec));
287878
+ const spec = await (0, import_rxjs31.lastValueFrom)(loadSpec(cmd.spec));
287424
287879
  return {
287425
287880
  projectId,
287426
287881
  ...spec?.function ?? spec
@@ -287435,9 +287890,9 @@ var init_helpers2 = __esm({
287435
287890
  await package_default(cmd);
287436
287891
  const body = new import_form_data.default();
287437
287892
  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)(
287893
+ const config2 = await (0, import_rxjs31.lastValueFrom)(GraphqlClienAPI.getConfig());
287894
+ return (0, import_rxjs31.lastValueFrom)(
287895
+ (0, import_rxjs31.from)(
287441
287896
  fetch2(config2.uploadUrl, {
287442
287897
  method: "POST",
287443
287898
  body,
@@ -287458,23 +287913,23 @@ var init_helpers2 = __esm({
287458
287913
  );
287459
287914
  }),
287460
287915
  (0, import_operators18.switchMap)(async (payload) => {
287461
- const clusterId = await (0, import_rxjs27.lastValueFrom)(
287916
+ const clusterId = await (0, import_rxjs31.lastValueFrom)(
287462
287917
  resolveClusterId(payload.projectId, {
287463
287918
  clusterId: cmd.clusterId || payload.clusterId,
287464
287919
  clusterName: cmd.clusterName || payload.clusterName
287465
287920
  })
287466
287921
  );
287467
- return (0, import_rxjs27.lastValueFrom)(
287922
+ return (0, import_rxjs31.lastValueFrom)(
287468
287923
  GraphqlClienAPI[type]({
287469
- code: cmd.code || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
287924
+ code: cmd.code || await (0, import_rxjs31.lastValueFrom)(ReadFile2(cmd.file || payload.file)) || "",
287470
287925
  name: cmd.name || payload.name || "",
287471
287926
  projectId: payload.projectId,
287472
287927
  route: cmd.route || payload.route || "",
287473
- buildBashScript: cmd.buildBashScript || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
287928
+ buildBashScript: cmd.buildBashScript || await (0, import_rxjs31.lastValueFrom)(ReadFile2(cmd.script || payload.script)) || "",
287474
287929
  configs: cmd.configs || payload.configs || [],
287475
287930
  env: cmd.env || payload.env || "nodejs",
287476
287931
  method: cmd.method || payload.method || ["GET"],
287477
- packageJson: cmd.packageJson || await (0, import_rxjs27.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
287932
+ packageJson: cmd.packageJson || await (0, import_rxjs31.lastValueFrom)(ReadFile2(cmd.package || payload.package)) || "{}",
287478
287933
  params: cmd.params || payload.params || [],
287479
287934
  secrets: cmd.secrets || payload.secrets || [],
287480
287935
  envSecrets: cmd.envSecrets || payload.envSecrets || [],
@@ -287530,15 +287985,15 @@ var list_exports2 = {};
287530
287985
  __export(list_exports2, {
287531
287986
  default: () => list_default2
287532
287987
  });
287533
- var import_rxjs28, import_operators19, list_default2;
287988
+ var import_rxjs32, import_operators19, list_default2;
287534
287989
  var init_list2 = __esm({
287535
287990
  "src/commands/lambda/list.ts"() {
287536
- import_rxjs28 = __toESM(require_cjs());
287991
+ import_rxjs32 = __toESM(require_cjs());
287537
287992
  import_operators19 = __toESM(require_operators());
287538
287993
  init_helpers();
287539
287994
  init_gql_client();
287540
287995
  init_log();
287541
- list_default2 = (cmd) => (0, import_rxjs28.lastValueFrom)(
287996
+ list_default2 = (cmd) => (0, import_rxjs32.lastValueFrom)(
287542
287997
  parseProjectId(cmd.project).pipe(
287543
287998
  (0, import_operators19.switchMap)(
287544
287999
  (projectId) => resolveClusterId(projectId, {
@@ -287573,10 +288028,10 @@ var get_exports = {};
287573
288028
  __export(get_exports, {
287574
288029
  default: () => get_default
287575
288030
  });
287576
- var import_rxjs29, import_operators20, get_default;
288031
+ var import_rxjs33, import_operators20, get_default;
287577
288032
  var init_get = __esm({
287578
288033
  "src/commands/lambda/get.ts"() {
287579
- import_rxjs29 = __toESM(require_cjs());
288034
+ import_rxjs33 = __toESM(require_cjs());
287580
288035
  import_operators20 = __toESM(require_operators());
287581
288036
  init_helpers();
287582
288037
  init_gql_client();
@@ -287598,26 +288053,26 @@ var init_get = __esm({
287598
288053
  Logger.log("-------------------");
287599
288054
  });
287600
288055
  if (cmd.lambda) {
287601
- return (0, import_rxjs29.lastValueFrom)(
288056
+ return (0, import_rxjs33.lastValueFrom)(
287602
288057
  isMongoId(cmd.lambda).pipe(
287603
288058
  (0, import_operators20.switchMap)((id) => GraphqlClienAPI.getLambda(id)),
287604
288059
  table
287605
288060
  )
287606
288061
  );
287607
288062
  }
287608
- const spec = await (0, import_rxjs29.lastValueFrom)(loadSpec(cmd.spec));
288063
+ const spec = await (0, import_rxjs33.lastValueFrom)(loadSpec(cmd.spec));
287609
288064
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287610
288065
  if (name2) {
287611
- return (0, import_rxjs29.lastValueFrom)(
288066
+ return (0, import_rxjs33.lastValueFrom)(
287612
288067
  parseProjectId(cmd.project).pipe(
287613
288068
  (0, import_operators20.catchError)((error48) => {
287614
288069
  if (!cmd.project) {
287615
- return (0, import_rxjs29.throwError)(
288070
+ return (0, import_rxjs33.throwError)(
287616
288071
  () => `No project id try with "gcli use --project your-project-id" to specify one
287617
288072
  Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
287618
288073
  );
287619
288074
  }
287620
- return (0, import_rxjs29.throwError)(() => error48);
288075
+ return (0, import_rxjs33.throwError)(() => error48);
287621
288076
  }),
287622
288077
  (0, import_operators20.switchMap)(
287623
288078
  (projectId) => resolveClusterId(projectId, {
@@ -287674,22 +288129,22 @@ var delete_exports = {};
287674
288129
  __export(delete_exports, {
287675
288130
  default: () => delete_default
287676
288131
  });
287677
- var import_rxjs30, import_operators21, delete_default;
288132
+ var import_rxjs34, import_operators21, delete_default;
287678
288133
  var init_delete = __esm({
287679
288134
  "src/commands/lambda/delete.ts"() {
287680
- import_rxjs30 = __toESM(require_cjs());
288135
+ import_rxjs34 = __toESM(require_cjs());
287681
288136
  import_operators21 = __toESM(require_operators());
287682
288137
  init_helpers();
287683
288138
  init_gql_client();
287684
288139
  init_log();
287685
288140
  init_load_spec();
287686
288141
  delete_default = async (cmd) => {
287687
- const spec = await (0, import_rxjs30.lastValueFrom)(loadSpec(cmd.spec));
288142
+ const spec = await (0, import_rxjs34.lastValueFrom)(loadSpec(cmd.spec));
287688
288143
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287689
288144
  const env = cmd.env ?? spec.function?.env ?? spec.env;
287690
288145
  const clusterIdHint = cmd.clusterId ?? spec.function?.clusterId ?? spec.clusterId;
287691
288146
  const clusterNameHint = cmd.clusterName ?? spec.function?.clusterName ?? spec.clusterName;
287692
- return (0, import_rxjs30.lastValueFrom)(
288147
+ return (0, import_rxjs34.lastValueFrom)(
287693
288148
  parseProjectId(cmd.project).pipe(
287694
288149
  (0, import_operators21.switchMap)(
287695
288150
  (projectId) => resolveClusterId(projectId, {
@@ -287724,10 +288179,10 @@ var logs_exports = {};
287724
288179
  __export(logs_exports, {
287725
288180
  default: () => logs_default
287726
288181
  });
287727
- var import_rxjs31, import_operators22, logs_default;
288182
+ var import_rxjs35, import_operators22, logs_default;
287728
288183
  var init_logs = __esm({
287729
288184
  "src/commands/lambda/logs.ts"() {
287730
- import_rxjs31 = __toESM(require_cjs());
288185
+ import_rxjs35 = __toESM(require_cjs());
287731
288186
  import_operators22 = __toESM(require_operators());
287732
288187
  init_helpers();
287733
288188
  init_gql_client();
@@ -287736,26 +288191,26 @@ var init_logs = __esm({
287736
288191
  logs_default = async (cmd) => {
287737
288192
  const result = (0, import_operators22.tap)(({ data }) => Logger.log(data));
287738
288193
  if (cmd.lambda) {
287739
- return (0, import_rxjs31.lastValueFrom)(
288194
+ return (0, import_rxjs35.lastValueFrom)(
287740
288195
  isMongoId(cmd.lambda).pipe(
287741
288196
  (0, import_operators22.switchMap)((id) => GraphqlClienAPI.getLambdaLogs(id)),
287742
288197
  result
287743
288198
  )
287744
288199
  );
287745
288200
  }
287746
- const spec = await (0, import_rxjs31.lastValueFrom)(loadSpec(cmd.spec));
288201
+ const spec = await (0, import_rxjs35.lastValueFrom)(loadSpec(cmd.spec));
287747
288202
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287748
288203
  if (name2) {
287749
- return (0, import_rxjs31.lastValueFrom)(
288204
+ return (0, import_rxjs35.lastValueFrom)(
287750
288205
  parseProjectId(cmd.project).pipe(
287751
288206
  (0, import_operators22.catchError)((error48) => {
287752
288207
  if (!cmd.project) {
287753
- return (0, import_rxjs31.throwError)(
288208
+ return (0, import_rxjs35.throwError)(
287754
288209
  () => `No project id try with "gcli use --project your-project-id" to specify one
287755
288210
  Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
287756
288211
  );
287757
288212
  }
287758
- return (0, import_rxjs31.throwError)(() => error48);
288213
+ return (0, import_rxjs35.throwError)(() => error48);
287759
288214
  }),
287760
288215
  (0, import_operators22.switchMap)(
287761
288216
  (projectId) => resolveClusterId(projectId, {
@@ -287781,10 +288236,10 @@ var logs_builder_exports = {};
287781
288236
  __export(logs_builder_exports, {
287782
288237
  default: () => logs_builder_default
287783
288238
  });
287784
- var import_rxjs32, import_operators23, logs_builder_default;
288239
+ var import_rxjs36, import_operators23, logs_builder_default;
287785
288240
  var init_logs_builder = __esm({
287786
288241
  "src/commands/lambda/logs-builder.ts"() {
287787
- import_rxjs32 = __toESM(require_cjs());
288242
+ import_rxjs36 = __toESM(require_cjs());
287788
288243
  import_operators23 = __toESM(require_operators());
287789
288244
  init_helpers();
287790
288245
  init_gql_client();
@@ -287793,26 +288248,26 @@ var init_logs_builder = __esm({
287793
288248
  logs_builder_default = async (cmd) => {
287794
288249
  const result = (0, import_operators23.tap)(({ data }) => Logger.log(data));
287795
288250
  if (cmd.lambda) {
287796
- return (0, import_rxjs32.lastValueFrom)(
288251
+ return (0, import_rxjs36.lastValueFrom)(
287797
288252
  isMongoId(cmd.lambda).pipe(
287798
288253
  (0, import_operators23.switchMap)((id) => GraphqlClienAPI.getLambdaBuilderLogs(id)),
287799
288254
  result
287800
288255
  )
287801
288256
  );
287802
288257
  }
287803
- const spec = await (0, import_rxjs32.lastValueFrom)(loadSpec(cmd.spec));
288258
+ const spec = await (0, import_rxjs36.lastValueFrom)(loadSpec(cmd.spec));
287804
288259
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287805
288260
  if (name2) {
287806
- return (0, import_rxjs32.lastValueFrom)(
288261
+ return (0, import_rxjs36.lastValueFrom)(
287807
288262
  parseProjectId(cmd.project).pipe(
287808
288263
  (0, import_operators23.catchError)((error48) => {
287809
288264
  if (!cmd.project) {
287810
- return (0, import_rxjs32.throwError)(
288265
+ return (0, import_rxjs36.throwError)(
287811
288266
  () => `No project id try with "gcli use --project your-project-id" to specify one
287812
288267
  Hint: "gcli lambda:logs --name ${name2} --project your-project-id"`
287813
288268
  );
287814
288269
  }
287815
- return (0, import_rxjs32.throwError)(() => error48);
288270
+ return (0, import_rxjs36.throwError)(() => error48);
287816
288271
  }),
287817
288272
  (0, import_operators23.switchMap)(
287818
288273
  (projectId) => resolveClusterId(projectId, {
@@ -287842,18 +288297,18 @@ var test_exports = {};
287842
288297
  __export(test_exports, {
287843
288298
  default: () => test_default
287844
288299
  });
287845
- var import_rxjs33, import_operators24, test_default;
288300
+ var import_rxjs37, import_operators24, test_default;
287846
288301
  var init_test = __esm({
287847
288302
  "src/commands/lambda/test.ts"() {
287848
- import_rxjs33 = __toESM(require_cjs());
288303
+ import_rxjs37 = __toESM(require_cjs());
287849
288304
  import_operators24 = __toESM(require_operators());
287850
288305
  init_helpers();
287851
288306
  init_gql_client();
287852
288307
  init_log();
287853
288308
  init_load_spec();
287854
288309
  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(
288310
+ const spec = await (0, import_rxjs37.lastValueFrom)(loadSpec(cmd.spec));
288311
+ const processParameters = (lambda) => (0, import_rxjs37.of)(lambda).pipe(
287857
288312
  (0, import_operators24.map)((lambda2) => ({
287858
288313
  ...lambda2,
287859
288314
  url: cmd.pathParams ? cmd.pathParams.split(";").map((param) => param.split("=")).reduce(
@@ -287867,7 +288322,7 @@ var init_test = __esm({
287867
288322
  );
287868
288323
  }),
287869
288324
  (0, import_operators24.switchMap)(
287870
- (lambda2) => (0, import_rxjs33.from)(
288325
+ (lambda2) => (0, import_rxjs37.from)(
287871
288326
  fetch([lambda2.url, cmd.queryParams].filter((i2) => !!i2).join(""), {
287872
288327
  method: cmd?.method ?? "GET",
287873
288328
  body: cmd.body
@@ -287883,7 +288338,7 @@ var init_test = __esm({
287883
288338
  })
287884
288339
  );
287885
288340
  if (cmd.lambda) {
287886
- return (0, import_rxjs33.lastValueFrom)(
288341
+ return (0, import_rxjs37.lastValueFrom)(
287887
288342
  isMongoId(cmd.lambda).pipe(
287888
288343
  (0, import_operators24.switchMap)(
287889
288344
  (id) => GraphqlClienAPI.getLambda(id, ["id", "url", "method", "params"])
@@ -287894,16 +288349,16 @@ var init_test = __esm({
287894
288349
  }
287895
288350
  const name2 = typeof cmd.name === "string" ? cmd.name : spec.function?.name ?? spec.name;
287896
288351
  if (name2) {
287897
- return (0, import_rxjs33.lastValueFrom)(
288352
+ return (0, import_rxjs37.lastValueFrom)(
287898
288353
  parseProjectId(cmd.project).pipe(
287899
288354
  (0, import_operators24.catchError)((error48) => {
287900
288355
  if (!cmd.project) {
287901
- return (0, import_rxjs33.throwError)(
288356
+ return (0, import_rxjs37.throwError)(
287902
288357
  () => `No project id try with "gcli use --project your-project-id" to specify one
287903
288358
  Hint: "gcli lambda:get --name ${name2} --project your-project-id"`
287904
288359
  );
287905
288360
  }
287906
- return (0, import_rxjs33.throwError)(() => error48);
288361
+ return (0, import_rxjs37.throwError)(() => error48);
287907
288362
  }),
287908
288363
  (0, import_operators24.switchMap)(
287909
288364
  (projectId) => GraphqlClienAPI.getLambdaByName(name2, projectId, [
@@ -287927,14 +288382,14 @@ var list_exports3 = {};
287927
288382
  __export(list_exports3, {
287928
288383
  default: () => list_default3
287929
288384
  });
287930
- var import_rxjs34, import_operators25, list_default3;
288385
+ var import_rxjs38, import_operators25, list_default3;
287931
288386
  var init_list3 = __esm({
287932
288387
  "src/commands/plugin/list.ts"() {
287933
- import_rxjs34 = __toESM(require_cjs());
288388
+ import_rxjs38 = __toESM(require_cjs());
287934
288389
  import_operators25 = __toESM(require_operators());
287935
288390
  init_gql_client();
287936
288391
  init_log();
287937
- list_default3 = () => (0, import_rxjs34.lastValueFrom)(
288392
+ list_default3 = () => (0, import_rxjs38.lastValueFrom)(
287938
288393
  GraphqlClienAPI.listAvailablePlugins().pipe(
287939
288394
  (0, import_operators25.tap)((plugins) => {
287940
288395
  Logger.log("-------------------");
@@ -287959,15 +288414,15 @@ var installed_exports = {};
287959
288414
  __export(installed_exports, {
287960
288415
  default: () => installed_default
287961
288416
  });
287962
- var import_rxjs35, import_operators26, installed_default;
288417
+ var import_rxjs39, import_operators26, installed_default;
287963
288418
  var init_installed = __esm({
287964
288419
  "src/commands/plugin/installed.ts"() {
287965
- import_rxjs35 = __toESM(require_cjs());
288420
+ import_rxjs39 = __toESM(require_cjs());
287966
288421
  import_operators26 = __toESM(require_operators());
287967
288422
  init_helpers();
287968
288423
  init_gql_client();
287969
288424
  init_log();
287970
- installed_default = (cmd) => (0, import_rxjs35.lastValueFrom)(
288425
+ installed_default = (cmd) => (0, import_rxjs39.lastValueFrom)(
287971
288426
  parseProjectId(cmd.project).pipe(
287972
288427
  (0, import_operators26.switchMap)((projectId) => GraphqlClienAPI.listInstalledPlugins(projectId)),
287973
288428
  (0, import_operators26.tap)((installed) => {
@@ -287998,16 +288453,16 @@ var install_exports = {};
287998
288453
  __export(install_exports, {
287999
288454
  default: () => install_default
288000
288455
  });
288001
- var import_rxjs36, import_operators27, install_default;
288456
+ var import_rxjs40, import_operators27, install_default;
288002
288457
  var init_install = __esm({
288003
288458
  "src/commands/plugin/install.ts"() {
288004
- import_rxjs36 = __toESM(require_cjs());
288459
+ import_rxjs40 = __toESM(require_cjs());
288005
288460
  import_operators27 = __toESM(require_operators());
288006
288461
  init_helpers();
288007
288462
  init_gql_client();
288008
288463
  init_log();
288009
288464
  init_load_spec();
288010
- install_default = (cmd) => (0, import_rxjs36.lastValueFrom)(
288465
+ install_default = (cmd) => (0, import_rxjs40.lastValueFrom)(
288011
288466
  parseProjectId(cmd.project).pipe(
288012
288467
  (0, import_operators27.switchMap)(
288013
288468
  (projectId) => loadSpec(
@@ -288016,7 +288471,7 @@ var init_install = __esm({
288016
288471
  // No spec file is required at all if --name/--cluster fully
288017
288472
  // cover it (unlike every other resource here, a plugin install
288018
288473
  // is often just "install this by name", no YAML needed).
288019
- (0, import_operators27.catchError)(() => (0, import_rxjs36.of)(void 0)),
288474
+ (0, import_operators27.catchError)(() => (0, import_rxjs40.of)(void 0)),
288020
288475
  (0, import_operators27.map)((data) => ({
288021
288476
  projectId,
288022
288477
  ...data ? data.plugin ?? data : {}
@@ -288047,15 +288502,15 @@ var uninstall_exports = {};
288047
288502
  __export(uninstall_exports, {
288048
288503
  default: () => uninstall_default
288049
288504
  });
288050
- var import_rxjs37, import_operators28, uninstall_default;
288505
+ var import_rxjs41, import_operators28, uninstall_default;
288051
288506
  var init_uninstall = __esm({
288052
288507
  "src/commands/plugin/uninstall.ts"() {
288053
- import_rxjs37 = __toESM(require_cjs());
288508
+ import_rxjs41 = __toESM(require_cjs());
288054
288509
  import_operators28 = __toESM(require_operators());
288055
288510
  init_helpers();
288056
288511
  init_gql_client();
288057
288512
  init_log();
288058
- uninstall_default = (cmd) => (0, import_rxjs37.lastValueFrom)(
288513
+ uninstall_default = (cmd) => (0, import_rxjs41.lastValueFrom)(
288059
288514
  parseProjectId(cmd.project).pipe(
288060
288515
  (0, import_operators28.switchMap)(
288061
288516
  (projectId) => GraphqlClienAPI.uninstallPlugin(projectId, cmd.name, cmd.cluster)
@@ -288075,14 +288530,14 @@ var list_exports4 = {};
288075
288530
  __export(list_exports4, {
288076
288531
  default: () => list_default4
288077
288532
  });
288078
- var import_rxjs38, import_operators29, list_default4;
288533
+ var import_rxjs42, import_operators29, list_default4;
288079
288534
  var init_list4 = __esm({
288080
288535
  "src/commands/project/list.ts"() {
288081
- import_rxjs38 = __toESM(require_cjs());
288536
+ import_rxjs42 = __toESM(require_cjs());
288082
288537
  import_operators29 = __toESM(require_operators());
288083
288538
  init_gql_client();
288084
288539
  init_log();
288085
- list_default4 = async () => (0, import_rxjs38.lastValueFrom)(
288540
+ list_default4 = async () => (0, import_rxjs42.lastValueFrom)(
288086
288541
  GraphqlClienAPI.listProjects().pipe(
288087
288542
  (0, import_operators29.tap)((project) => {
288088
288543
  const columns = ["id", "name"];
@@ -288101,24 +288556,24 @@ var use_exports = {};
288101
288556
  __export(use_exports, {
288102
288557
  default: () => use_default
288103
288558
  });
288104
- var import_fs5, import_rxjs39, import_operators30, import_util4, use_default;
288559
+ var import_fs5, import_rxjs43, import_operators30, import_util4, use_default;
288105
288560
  var init_use = __esm({
288106
288561
  "src/commands/project/use.ts"() {
288107
288562
  import_fs5 = require("fs");
288108
- import_rxjs39 = __toESM(require_cjs());
288563
+ import_rxjs43 = __toESM(require_cjs());
288109
288564
  import_operators30 = __toESM(require_operators());
288110
288565
  import_util4 = require("util");
288111
288566
  init_helpers();
288112
288567
  init_gql_client();
288113
288568
  init_types();
288114
288569
  use_default = async (cmd) => {
288115
- return (0, import_rxjs39.lastValueFrom)(
288570
+ return (0, import_rxjs43.lastValueFrom)(
288116
288571
  parseProjectId(cmd).pipe(
288117
288572
  (0, import_operators30.switchMap)(
288118
288573
  (projectId) => GraphqlClienAPI.getProject(projectId).pipe((0, import_operators30.map)(() => projectId))
288119
288574
  ),
288120
288575
  (0, import_operators30.switchMap)(
288121
- (projectId) => (0, import_rxjs39.from)(
288576
+ (projectId) => (0, import_rxjs43.from)(
288122
288577
  (0, import_util4.promisify)(import_fs5.writeFile)(projectDirectory, projectId, {
288123
288578
  encoding: "utf-8"
288124
288579
  })
@@ -318955,7 +319410,7 @@ __export(start_exports, {
318955
319410
  default: () => startProxy
318956
319411
  });
318957
319412
  async function startProxy(cmd) {
318958
- return (0, import_rxjs40.lastValueFrom)(
319413
+ return (0, import_rxjs44.lastValueFrom)(
318959
319414
  GraphqlClienAPI.getConfig().pipe(
318960
319415
  (0, import_operators31.take)(1),
318961
319416
  (0, import_operators31.map)((config2) => ({
@@ -318971,7 +319426,7 @@ async function startProxy(cmd) {
318971
319426
  process.stderr.write("Retrieving config for auth...\n");
318972
319427
  }),
318973
319428
  (0, import_operators31.switchMap)(
318974
- (config2) => config2?.token ? (0, import_rxjs40.of)(config2) : (0, import_rxjs40.throwError)(
319429
+ (config2) => config2?.token ? (0, import_rxjs44.of)(config2) : (0, import_rxjs44.throwError)(
318975
319430
  () => new Error("User is not authenticated (no token in config)")
318976
319431
  )
318977
319432
  ),
@@ -318989,7 +319444,7 @@ async function startProxy(cmd) {
318989
319444
  Authorization: config2.token
318990
319445
  }
318991
319446
  },
318992
- fetch: (input, init) => (0, import_rxjs40.lastValueFrom)(performFetch(input, init))
319447
+ fetch: (input, init) => (0, import_rxjs44.lastValueFrom)(performFetch(input, init))
318993
319448
  }),
318994
319449
  client: new Client({
318995
319450
  name: "gapi-proxy-client",
@@ -319000,7 +319455,7 @@ async function startProxy(cmd) {
319000
319455
  process.stderr.write("Connecting to upstream...\n");
319001
319456
  }),
319002
319457
  (0, import_operators31.switchMap)(
319003
- (config2) => (0, import_rxjs40.from)(config2.client.connect(config2.transport)).pipe((0, import_operators31.map)(() => config2))
319458
+ (config2) => (0, import_rxjs44.from)(config2.client.connect(config2.transport)).pipe((0, import_operators31.map)(() => config2))
319004
319459
  ),
319005
319460
  (0, import_operators31.tap)(() => {
319006
319461
  process.stderr.write("Connected to upstream MCP server\n");
@@ -319026,25 +319481,25 @@ async function startProxy(cmd) {
319026
319481
  capabilities: config2.capabilities || {}
319027
319482
  }
319028
319483
  );
319029
- server2.fallbackRequestHandler = async (request) => (0, import_rxjs40.lastValueFrom)(
319030
- (0, import_rxjs40.defer)(() => config2.client.request(request, external_exports3.any())).pipe(
319484
+ server2.fallbackRequestHandler = async (request) => (0, import_rxjs44.lastValueFrom)(
319485
+ (0, import_rxjs44.defer)(() => config2.client.request(request, external_exports3.any())).pipe(
319031
319486
  (0, import_operators31.catchError)((e2) => {
319032
319487
  process.stderr.write(`Upstream error: ${e2.message}
319033
319488
  `);
319034
- return (0, import_rxjs40.throwError)(() => e2);
319489
+ return (0, import_rxjs44.throwError)(() => e2);
319035
319490
  })
319036
319491
  )
319037
319492
  );
319038
319493
  server2.fallbackNotificationHandler = async (notification) => {
319039
- await (0, import_rxjs40.lastValueFrom)(
319040
- (0, import_rxjs40.of)(notification).pipe(
319494
+ await (0, import_rxjs44.lastValueFrom)(
319495
+ (0, import_rxjs44.of)(notification).pipe(
319041
319496
  (0, import_operators31.filter)((n) => n.method !== "notifications/initialized"),
319042
319497
  (0, import_operators31.switchMap)(
319043
- (n) => (0, import_rxjs40.defer)(() => config2.client.notification(n)).pipe(
319498
+ (n) => (0, import_rxjs44.defer)(() => config2.client.notification(n)).pipe(
319044
319499
  (0, import_operators31.catchError)((e2) => {
319045
319500
  process.stderr.write(`Notification error: ${e2}
319046
319501
  `);
319047
- return import_rxjs40.EMPTY;
319502
+ return import_rxjs44.EMPTY;
319048
319503
  })
319049
319504
  )
319050
319505
  ),
@@ -319054,7 +319509,7 @@ async function startProxy(cmd) {
319054
319509
  };
319055
319510
  return server2;
319056
319511
  }),
319057
- (0, import_operators31.switchMap)((server2) => (0, import_rxjs40.from)(server2.connect(new StdioServerTransport()))),
319512
+ (0, import_operators31.switchMap)((server2) => (0, import_rxjs44.from)(server2.connect(new StdioServerTransport()))),
319058
319513
  (0, import_operators31.tap)(() => {
319059
319514
  process.stderr.write("MCP stdio server ready\n");
319060
319515
  }),
@@ -319064,20 +319519,20 @@ async function startProxy(cmd) {
319064
319519
  )
319065
319520
  );
319066
319521
  }
319067
- var import_rxjs40, import_operators31, import_stream2, performFetch;
319522
+ var import_rxjs44, import_operators31, import_stream2, performFetch;
319068
319523
  var init_start = __esm({
319069
319524
  "src/commands/proxy/start.ts"() {
319070
319525
  init_client2();
319071
319526
  init_streamableHttp();
319072
319527
  init_server2();
319073
319528
  init_stdio2();
319074
- import_rxjs40 = __toESM(require_cjs());
319529
+ import_rxjs44 = __toESM(require_cjs());
319075
319530
  import_operators31 = __toESM(require_operators());
319076
319531
  import_stream2 = require("stream");
319077
319532
  init_zod();
319078
319533
  init_gql_client();
319079
319534
  performFetch = (input, init) => {
319080
- return (0, import_rxjs40.from)(fetch(input, init)).pipe(
319535
+ return (0, import_rxjs44.from)(fetch(input, init)).pipe(
319081
319536
  (0, import_operators31.switchMap)((res) => {
319082
319537
  if (res.status === 401 || res.status === 403) {
319083
319538
  process.stderr.write(
@@ -319099,7 +319554,7 @@ var init_start = __esm({
319099
319554
  })
319100
319555
  );
319101
319556
  }
319102
- return (0, import_rxjs40.of)(res);
319557
+ return (0, import_rxjs44.of)(res);
319103
319558
  }),
319104
319559
  (0, import_operators31.map)((res) => {
319105
319560
  if (typeof res?.body?.pipeThrough !== "function") {
@@ -319118,7 +319573,7 @@ var init_start = __esm({
319118
319573
  (0, import_operators31.catchError)((e2) => {
319119
319574
  process.stderr.write(`[ERROR] Fetch error: ${e2.message}
319120
319575
  `);
319121
- return (0, import_rxjs40.throwError)(() => e2);
319576
+ return (0, import_rxjs44.throwError)(() => e2);
319122
319577
  })
319123
319578
  );
319124
319579
  };
@@ -319130,16 +319585,16 @@ var create_exports3 = {};
319130
319585
  __export(create_exports3, {
319131
319586
  default: () => create_default3
319132
319587
  });
319133
- var import_rxjs41, import_operators32, create_default3;
319588
+ var import_rxjs45, import_operators32, create_default3;
319134
319589
  var init_create3 = __esm({
319135
319590
  "src/commands/rabbitmq/create.ts"() {
319136
- import_rxjs41 = __toESM(require_cjs());
319591
+ import_rxjs45 = __toESM(require_cjs());
319137
319592
  import_operators32 = __toESM(require_operators());
319138
319593
  init_helpers();
319139
319594
  init_gql_client();
319140
319595
  init_log();
319141
319596
  init_load_spec();
319142
- create_default3 = (cmd) => (0, import_rxjs41.lastValueFrom)(
319597
+ create_default3 = (cmd) => (0, import_rxjs45.lastValueFrom)(
319143
319598
  parseProjectId(cmd.project).pipe(
319144
319599
  (0, import_operators32.switchMap)(
319145
319600
  (projectId) => loadSpec(
@@ -319178,15 +319633,15 @@ var list_exports5 = {};
319178
319633
  __export(list_exports5, {
319179
319634
  default: () => list_default5
319180
319635
  });
319181
- var import_rxjs42, import_operators33, list_default5;
319636
+ var import_rxjs46, import_operators33, list_default5;
319182
319637
  var init_list5 = __esm({
319183
319638
  "src/commands/rabbitmq/list.ts"() {
319184
- import_rxjs42 = __toESM(require_cjs());
319639
+ import_rxjs46 = __toESM(require_cjs());
319185
319640
  import_operators33 = __toESM(require_operators());
319186
319641
  init_helpers();
319187
319642
  init_gql_client();
319188
319643
  init_log();
319189
- list_default5 = (cmd) => (0, import_rxjs42.lastValueFrom)(
319644
+ list_default5 = (cmd) => (0, import_rxjs46.lastValueFrom)(
319190
319645
  parseProjectId(cmd.project).pipe(
319191
319646
  (0, import_operators33.switchMap)(
319192
319647
  (projectId) => GraphqlClienAPI.listRabbitMqInstances(projectId)
@@ -319221,15 +319676,15 @@ var delete_exports2 = {};
319221
319676
  __export(delete_exports2, {
319222
319677
  default: () => delete_default2
319223
319678
  });
319224
- var import_rxjs43, import_operators34, delete_default2;
319679
+ var import_rxjs47, import_operators34, delete_default2;
319225
319680
  var init_delete2 = __esm({
319226
319681
  "src/commands/rabbitmq/delete.ts"() {
319227
- import_rxjs43 = __toESM(require_cjs());
319682
+ import_rxjs47 = __toESM(require_cjs());
319228
319683
  import_operators34 = __toESM(require_operators());
319229
319684
  init_helpers();
319230
319685
  init_gql_client();
319231
319686
  init_log();
319232
- delete_default2 = (cmd) => (0, import_rxjs43.lastValueFrom)(
319687
+ delete_default2 = (cmd) => (0, import_rxjs47.lastValueFrom)(
319233
319688
  parseProjectId(cmd.project).pipe(
319234
319689
  (0, import_operators34.switchMap)(
319235
319690
  (projectId) => GraphqlClienAPI.uninstallRabbitMq(cmd.id, projectId)
@@ -319246,10 +319701,10 @@ var init_delete2 = __esm({
319246
319701
  });
319247
319702
 
319248
319703
  // src/commands/runner/config.ts
319249
- var import_promises, DEFAULT_WS_URL, deriveSubscriptionsUrl, readLoginApiUrl, readSavedRunner, saveRunner, forgetRunner;
319704
+ var import_promises2, DEFAULT_WS_URL, deriveSubscriptionsUrl, readLoginApiUrl, readSavedRunner, saveRunner, forgetRunner;
319250
319705
  var init_config = __esm({
319251
319706
  "src/commands/runner/config.ts"() {
319252
- import_promises = require("fs/promises");
319707
+ import_promises2 = require("fs/promises");
319253
319708
  init_types();
319254
319709
  DEFAULT_WS_URL = "wss://api.lambforge.com/subscriptions";
319255
319710
  deriveSubscriptionsUrl = (apiUrl) => {
@@ -319265,21 +319720,21 @@ var init_config = __esm({
319265
319720
  url2.search = "";
319266
319721
  return url2.toString();
319267
319722
  };
319268
- readLoginApiUrl = () => (0, import_promises.readFile)(urlDirectory, "utf-8").catch(() => "");
319723
+ readLoginApiUrl = () => (0, import_promises2.readFile)(urlDirectory, "utf-8").catch(() => "");
319269
319724
  readSavedRunner = async () => {
319270
319725
  try {
319271
- const saved = JSON.parse(await (0, import_promises.readFile)(runnerDirectory, "utf-8"));
319726
+ const saved = JSON.parse(await (0, import_promises2.readFile)(runnerDirectory, "utf-8"));
319272
319727
  return saved?.id && saved?.token ? saved : null;
319273
319728
  } catch {
319274
319729
  return null;
319275
319730
  }
319276
319731
  };
319277
319732
  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);
319733
+ await (0, import_promises2.mkdir)(mainDirectory, { recursive: true });
319734
+ await (0, import_promises2.writeFile)(runnerDirectory, JSON.stringify(runner, null, 2), "utf-8");
319735
+ await (0, import_promises2.chmod)(runnerDirectory, 384);
319281
319736
  };
319282
- forgetRunner = () => (0, import_promises.rm)(runnerDirectory, { force: true });
319737
+ forgetRunner = () => (0, import_promises2.rm)(runnerDirectory, { force: true });
319283
319738
  }
319284
319739
  });
319285
319740
 
@@ -319801,19 +320256,19 @@ var init_connection = __esm({
319801
320256
  });
319802
320257
 
319803
320258
  // 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;
320259
+ var import_child_process3, import_fs7, import_promises3, import_os3, import_path2, import_util11, DEFAULT_SERVICE_NAME, RUNNER_AUTH_EXIT_CODE, systemdQuote, unitPath, buildUnit, resolveGcliCommand, defaultExec, SystemdUserService, assertSystemdAvailable;
319805
320260
  var init_daemon = __esm({
319806
320261
  "src/commands/runner/daemon.ts"() {
319807
- import_child_process2 = require("child_process");
320262
+ import_child_process3 = require("child_process");
319808
320263
  import_fs7 = require("fs");
319809
- import_promises2 = require("fs/promises");
319810
- import_os2 = require("os");
319811
- import_path = require("path");
320264
+ import_promises3 = require("fs/promises");
320265
+ import_os3 = require("os");
320266
+ import_path2 = require("path");
319812
320267
  import_util11 = require("util");
319813
320268
  DEFAULT_SERVICE_NAME = "lambforge-runner";
319814
320269
  RUNNER_AUTH_EXIT_CODE = 78;
319815
320270
  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`);
320271
+ unitPath = (serviceName, home = (0, import_os3.homedir)()) => (0, import_path2.join)(home, ".config", "systemd", "user", `${serviceName}.service`);
319817
320272
  buildUnit = ({
319818
320273
  serviceName,
319819
320274
  execStart,
@@ -319861,9 +320316,9 @@ var init_daemon = __esm({
319861
320316
  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
320317
  };
319863
320318
  };
319864
- defaultExec = (file2, args) => (0, import_util11.promisify)(import_child_process2.execFile)(file2, args, { encoding: "utf8" });
320319
+ defaultExec = (file2, args) => (0, import_util11.promisify)(import_child_process3.execFile)(file2, args, { encoding: "utf8" });
319865
320320
  SystemdUserService = class {
319866
- constructor(serviceName = DEFAULT_SERVICE_NAME, exec2 = defaultExec, home = (0, import_os2.homedir)()) {
320321
+ constructor(serviceName = DEFAULT_SERVICE_NAME, exec2 = defaultExec, home = (0, import_os3.homedir)()) {
319867
320322
  this.serviceName = serviceName;
319868
320323
  this.exec = exec2;
319869
320324
  this.home = home;
@@ -319874,8 +320329,8 @@ var init_daemon = __esm({
319874
320329
  /** install -> daemon-reload -> enable -> restart (picks up a changed unit). */
319875
320330
  async install(unitContent) {
319876
320331
  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");
320332
+ await (0, import_promises3.mkdir)((0, import_path2.join)(path2, ".."), { recursive: true });
320333
+ await (0, import_promises3.writeFile)(path2, unitContent, "utf-8");
319879
320334
  await this.systemctl("daemon-reload");
319880
320335
  await this.systemctl("enable", this.unit);
319881
320336
  await this.systemctl("restart", this.unit);
@@ -319884,7 +320339,7 @@ var init_daemon = __esm({
319884
320339
  async uninstall() {
319885
320340
  await this.systemctl("disable", "--now", this.unit).catch(() => void 0);
319886
320341
  const path2 = unitPath(this.serviceName, this.home);
319887
- await (0, import_promises2.rm)(path2, { force: true });
320342
+ await (0, import_promises3.rm)(path2, { force: true });
319888
320343
  await this.systemctl("daemon-reload");
319889
320344
  return path2;
319890
320345
  }
@@ -319954,11 +320409,11 @@ __export(start_exports2, {
319954
320409
  default: () => start_default,
319955
320410
  resolveRunner: () => resolveRunner
319956
320411
  });
319957
- var import_os3, import_rxjs44, RUNNER_VERSION, resolveRunner, start_default;
320412
+ var import_os4, import_rxjs48, RUNNER_VERSION, resolveRunner, start_default;
319958
320413
  var init_start2 = __esm({
319959
320414
  "src/commands/runner/start.ts"() {
319960
- import_os3 = require("os");
319961
- import_rxjs44 = __toESM(require_cjs());
320415
+ import_os4 = require("os");
320416
+ import_rxjs48 = __toESM(require_cjs());
319962
320417
  init_gql_client();
319963
320418
  init_log();
319964
320419
  init_config();
@@ -319977,9 +320432,9 @@ var init_start2 = __esm({
319977
320432
  if (saved) {
319978
320433
  return saved;
319979
320434
  }
319980
- const name2 = cmd.name || (0, import_os3.hostname)();
320435
+ const name2 = cmd.name || (0, import_os4.hostname)();
319981
320436
  Logger.info(`Registering this machine as local runner "${name2}"...`);
319982
- const { runner, token } = await (0, import_rxjs44.lastValueFrom)(
320437
+ const { runner, token } = await (0, import_rxjs48.lastValueFrom)(
319983
320438
  GraphqlClienAPI.createLocalRunner(name2)
319984
320439
  ).catch((e2) => {
319985
320440
  throw new Error(
@@ -320040,10 +320495,10 @@ __export(daemon_commands_exports, {
320040
320495
  stop: () => stop,
320041
320496
  uninstall: () => uninstall
320042
320497
  });
320043
- var import_child_process3, install, uninstall, installedService, reportStarted, start, restart, stop, status, logs;
320498
+ var import_child_process4, install, uninstall, installedService, reportStarted, start, restart, stop, status, logs;
320044
320499
  var init_daemon_commands = __esm({
320045
320500
  "src/commands/runner/daemon-commands.ts"() {
320046
- import_child_process3 = require("child_process");
320501
+ import_child_process4 = require("child_process");
320047
320502
  init_log();
320048
320503
  init_config();
320049
320504
  init_daemon();
@@ -320159,7 +320614,7 @@ var init_daemon_commands = __esm({
320159
320614
  assertSystemdAvailable();
320160
320615
  const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
320161
320616
  return new Promise((resolve2) => {
320162
- (0, import_child_process3.spawn)(
320617
+ (0, import_child_process4.spawn)(
320163
320618
  "journalctl",
320164
320619
  ["--user", "-u", `${serviceName}.service`, "-f", "-n", cmd.lines || "50"],
320165
320620
  { stdio: "inherit" }
@@ -320174,14 +320629,14 @@ var list_exports6 = {};
320174
320629
  __export(list_exports6, {
320175
320630
  default: () => list_default6
320176
320631
  });
320177
- var import_rxjs45, import_operators35, list_default6;
320632
+ var import_rxjs49, import_operators35, list_default6;
320178
320633
  var init_list6 = __esm({
320179
320634
  "src/commands/runner/list.ts"() {
320180
- import_rxjs45 = __toESM(require_cjs());
320635
+ import_rxjs49 = __toESM(require_cjs());
320181
320636
  import_operators35 = __toESM(require_operators());
320182
320637
  init_gql_client();
320183
320638
  init_log();
320184
- list_default6 = () => (0, import_rxjs45.lastValueFrom)(
320639
+ list_default6 = () => (0, import_rxjs49.lastValueFrom)(
320185
320640
  GraphqlClienAPI.listLocalRunners().pipe(
320186
320641
  (0, import_operators35.tap)((runners) => {
320187
320642
  Logger.log("-------------------");
@@ -320214,10 +320669,10 @@ __export(models_exports, {
320214
320669
  default: () => models_default,
320215
320670
  parseSelection: () => parseSelection
320216
320671
  });
320217
- var import_rxjs46, isShown, parseSelection, models_default;
320672
+ var import_rxjs50, isShown, parseSelection, models_default;
320218
320673
  var init_models = __esm({
320219
320674
  "src/commands/runner/models.ts"() {
320220
- import_rxjs46 = __toESM(require_cjs());
320675
+ import_rxjs50 = __toESM(require_cjs());
320221
320676
  init_gql_client();
320222
320677
  init_log();
320223
320678
  init_config();
@@ -320247,11 +320702,11 @@ var init_models = __esm({
320247
320702
  }
320248
320703
  let runner;
320249
320704
  if (selection) {
320250
- runner = await (0, import_rxjs46.lastValueFrom)(
320705
+ runner = await (0, import_rxjs50.lastValueFrom)(
320251
320706
  GraphqlClienAPI.setLocalRunnerModels(runnerId, selection.models)
320252
320707
  );
320253
320708
  } else {
320254
- const runners = await (0, import_rxjs46.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
320709
+ const runners = await (0, import_rxjs50.lastValueFrom)(GraphqlClienAPI.listLocalRunners());
320255
320710
  runner = runners.find((r2) => r2.id === runnerId);
320256
320711
  }
320257
320712
  if (!runner) {
@@ -320286,10 +320741,10 @@ var delete_exports3 = {};
320286
320741
  __export(delete_exports3, {
320287
320742
  default: () => delete_default3
320288
320743
  });
320289
- var import_rxjs47, delete_default3;
320744
+ var import_rxjs51, delete_default3;
320290
320745
  var init_delete3 = __esm({
320291
320746
  "src/commands/runner/delete.ts"() {
320292
- import_rxjs47 = __toESM(require_cjs());
320747
+ import_rxjs51 = __toESM(require_cjs());
320293
320748
  init_gql_client();
320294
320749
  init_log();
320295
320750
  init_config();
@@ -320299,7 +320754,7 @@ var init_delete3 = __esm({
320299
320754
  if (!runnerId) {
320300
320755
  throw new Error("Specify the runner with --id (see `gcli runner:list`).");
320301
320756
  }
320302
- await (0, import_rxjs47.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
320757
+ await (0, import_rxjs51.lastValueFrom)(GraphqlClienAPI.deleteLocalRunner(runnerId));
320303
320758
  if (saved?.id === runnerId) {
320304
320759
  await forgetRunner();
320305
320760
  }
@@ -320315,10 +320770,10 @@ __export(start_exports3, {
320315
320770
  });
320316
320771
  async function start2(args) {
320317
320772
  Logger.log("---------------------------------");
320318
- return (0, import_rxjs48.lastValueFrom)(
320773
+ return (0, import_rxjs52.lastValueFrom)(
320319
320774
  loadSpec().pipe(
320320
320775
  (0, import_operators36.switchMap)(
320321
- (config2) => (0, import_rxjs48.of)({
320776
+ (config2) => (0, import_rxjs52.of)({
320322
320777
  watcher: (0, import_node_fs2.watch)(process.cwd(), {
320323
320778
  recursive: true
320324
320779
  }),
@@ -320347,7 +320802,7 @@ async function start2(args) {
320347
320802
  outfile,
320348
320803
  startCommand,
320349
320804
  ignorelist
320350
- }) => (0, import_rxjs48.from)(build_default(args)).pipe(
320805
+ }) => (0, import_rxjs52.from)(build_default(args)).pipe(
320351
320806
  (0, import_operators36.tap)(() => {
320352
320807
  Logger.warn(
320353
320808
  `\u{1F4E2} Starting script "${startCommand} ${outfile}"`
@@ -320365,10 +320820,10 @@ async function start2(args) {
320365
320820
  );
320366
320821
  }),
320367
320822
  (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")
320823
+ () => (0, import_rxjs52.merge)(
320824
+ (0, import_rxjs52.fromEvent)(process, "SIGINT"),
320825
+ (0, import_rxjs52.fromEvent)(process, "SIGTERM"),
320826
+ (0, import_rxjs52.fromEvent)(process, "exit")
320372
320827
  ).pipe(
320373
320828
  (0, import_operators36.debounceTime)(100),
320374
320829
  (0, import_operators36.tap)(() => {
@@ -320380,7 +320835,7 @@ async function start2(args) {
320380
320835
  ).subscribe()
320381
320836
  ),
320382
320837
  (0, import_operators36.switchMap)(
320383
- () => (0, import_rxjs48.fromEvent)(watcher, "change").pipe(
320838
+ () => (0, import_rxjs52.fromEvent)(watcher, "change").pipe(
320384
320839
  (0, import_operators36.map)(([event, filename]) => ({
320385
320840
  event,
320386
320841
  filename
@@ -320429,12 +320884,12 @@ async function start2(args) {
320429
320884
  )
320430
320885
  );
320431
320886
  }
320432
- var import_node_child_process, import_node_fs2, import_rxjs48, import_operators36;
320887
+ var import_node_child_process, import_node_fs2, import_rxjs52, import_operators36;
320433
320888
  var init_start3 = __esm({
320434
320889
  "src/commands/start/start.ts"() {
320435
320890
  import_node_child_process = require("node:child_process");
320436
320891
  import_node_fs2 = require("node:fs");
320437
- import_rxjs48 = __toESM(require_cjs());
320892
+ import_rxjs52 = __toESM(require_cjs());
320438
320893
  import_operators36 = __toESM(require_operators());
320439
320894
  init_log();
320440
320895
  init_build();
@@ -320447,16 +320902,16 @@ var create_cron_exports = {};
320447
320902
  __export(create_cron_exports, {
320448
320903
  default: () => create_cron_default
320449
320904
  });
320450
- var import_rxjs49, import_operators37, create_cron_default;
320905
+ var import_rxjs53, import_operators37, create_cron_default;
320451
320906
  var init_create_cron = __esm({
320452
320907
  "src/commands/triggers/cron/create-cron.ts"() {
320453
- import_rxjs49 = __toESM(require_cjs());
320908
+ import_rxjs53 = __toESM(require_cjs());
320454
320909
  import_operators37 = __toESM(require_operators());
320455
320910
  init_helpers();
320456
320911
  init_gql_client();
320457
320912
  init_log();
320458
320913
  init_load_spec();
320459
- create_cron_default = (cmd) => (0, import_rxjs49.lastValueFrom)(
320914
+ create_cron_default = (cmd) => (0, import_rxjs53.lastValueFrom)(
320460
320915
  parseProjectId(cmd.project).pipe(
320461
320916
  (0, import_operators37.switchMap)(
320462
320917
  (projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
@@ -320479,7 +320934,7 @@ var init_create_cron = __esm({
320479
320934
  )
320480
320935
  ),
320481
320936
  (0, import_operators37.switchMap)(
320482
- ({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs49.throwError)(
320937
+ ({ lambdaId, cron, triggerName, lambdaName }) => !cron || !triggerName ? (0, import_rxjs53.throwError)(
320483
320938
  () => new Error(
320484
320939
  "cron:create needs --cron and --triggerName (or triggers.time.cron / triggerName in lambforge.yaml)"
320485
320940
  )
@@ -320512,16 +320967,16 @@ var delete_cron_exports = {};
320512
320967
  __export(delete_cron_exports, {
320513
320968
  default: () => delete_cron_default
320514
320969
  });
320515
- var import_rxjs50, import_operators38, delete_cron_default;
320970
+ var import_rxjs54, import_operators38, delete_cron_default;
320516
320971
  var init_delete_cron = __esm({
320517
320972
  "src/commands/triggers/cron/delete-cron.ts"() {
320518
- import_rxjs50 = __toESM(require_cjs());
320973
+ import_rxjs54 = __toESM(require_cjs());
320519
320974
  import_operators38 = __toESM(require_operators());
320520
320975
  init_helpers();
320521
320976
  init_gql_client();
320522
320977
  init_log();
320523
320978
  init_load_spec();
320524
- delete_cron_default = (cmd) => (0, import_rxjs50.lastValueFrom)(
320979
+ delete_cron_default = (cmd) => (0, import_rxjs54.lastValueFrom)(
320525
320980
  parseProjectId(cmd.project).pipe(
320526
320981
  (0, import_operators38.switchMap)(
320527
320982
  (projectId) => loadSpec(cmd.spec ?? "cron.yaml").pipe(
@@ -320565,18 +321020,18 @@ var list_crons_exports = {};
320565
321020
  __export(list_crons_exports, {
320566
321021
  default: () => list_crons_default
320567
321022
  });
320568
- var import_rxjs51, import_operators39, list_crons_default;
321023
+ var import_rxjs55, import_operators39, list_crons_default;
320569
321024
  var init_list_crons = __esm({
320570
321025
  "src/commands/triggers/cron/list-crons.ts"() {
320571
- import_rxjs51 = __toESM(require_cjs());
321026
+ import_rxjs55 = __toESM(require_cjs());
320572
321027
  import_operators39 = __toESM(require_operators());
320573
321028
  init_helpers();
320574
321029
  init_gql_client();
320575
321030
  init_log();
320576
- list_crons_default = (cmd) => (0, import_rxjs51.lastValueFrom)(
321031
+ list_crons_default = (cmd) => (0, import_rxjs55.lastValueFrom)(
320577
321032
  parseProjectId(cmd.project).pipe(
320578
321033
  (0, import_operators39.switchMap)(
320579
- (projectId) => (0, import_rxjs51.combineLatest)([
321034
+ (projectId) => (0, import_rxjs55.combineLatest)([
320580
321035
  GraphqlClienAPI.listProjectTimeTriggers(projectId),
320581
321036
  GraphqlClienAPI.listLambdas(projectId)
320582
321037
  ])
@@ -320609,15 +321064,15 @@ var list_exports7 = {};
320609
321064
  __export(list_exports7, {
320610
321065
  default: () => list_default7
320611
321066
  });
320612
- var import_rxjs52, import_operators40, list_default7;
321067
+ var import_rxjs56, import_operators40, list_default7;
320613
321068
  var init_list7 = __esm({
320614
321069
  "src/commands/triggers/message-queue/list.ts"() {
320615
- import_rxjs52 = __toESM(require_cjs());
321070
+ import_rxjs56 = __toESM(require_cjs());
320616
321071
  import_operators40 = __toESM(require_operators());
320617
321072
  init_helpers();
320618
321073
  init_gql_client();
320619
321074
  init_log();
320620
- list_default7 = (cmd) => (0, import_rxjs52.lastValueFrom)(
321075
+ list_default7 = (cmd) => (0, import_rxjs56.lastValueFrom)(
320621
321076
  parseProjectId(cmd.project).pipe(
320622
321077
  (0, import_operators40.switchMap)(
320623
321078
  (projectId) => GraphqlClienAPI.listMessageQueueTriggers(projectId)
@@ -320653,10 +321108,10 @@ __export(save_exports, {
320653
321108
  mergeOverExisting: () => mergeOverExisting,
320654
321109
  toTriggerInput: () => toTriggerInput
320655
321110
  });
320656
- var import_rxjs53, import_operators41, int2, toTriggerInput, mergeOverExisting, save_default;
321111
+ var import_rxjs57, import_operators41, int2, toTriggerInput, mergeOverExisting, save_default;
320657
321112
  var init_save = __esm({
320658
321113
  "src/commands/triggers/message-queue/save.ts"() {
320659
- import_rxjs53 = __toESM(require_cjs());
321114
+ import_rxjs57 = __toESM(require_cjs());
320660
321115
  import_operators41 = __toESM(require_operators());
320661
321116
  init_helpers();
320662
321117
  init_gql_client();
@@ -320719,11 +321174,11 @@ var init_save = __esm({
320719
321174
  )
320720
321175
  );
320721
321176
  };
320722
- save_default = (mode, cmd) => (0, import_rxjs53.lastValueFrom)(
321177
+ save_default = (mode, cmd) => (0, import_rxjs57.lastValueFrom)(
320723
321178
  parseProjectId(cmd.project).pipe(
320724
321179
  (0, import_operators41.switchMap)((projectId) => {
320725
321180
  const changes = toTriggerInput(mode, cmd);
320726
- const payload$ = mode === "create" ? (0, import_rxjs53.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
321181
+ const payload$ = mode === "create" ? (0, import_rxjs57.of)(changes) : GraphqlClienAPI.listMessageQueueTriggers(projectId).pipe(
320727
321182
  (0, import_operators41.map)(
320728
321183
  (triggers) => mergeOverExisting(
320729
321184
  triggers.find((t2) => t2.name === cmd.name),
@@ -320761,15 +321216,15 @@ var delete_exports4 = {};
320761
321216
  __export(delete_exports4, {
320762
321217
  default: () => delete_default4
320763
321218
  });
320764
- var import_rxjs54, import_operators42, delete_default4;
321219
+ var import_rxjs58, import_operators42, delete_default4;
320765
321220
  var init_delete4 = __esm({
320766
321221
  "src/commands/triggers/message-queue/delete.ts"() {
320767
- import_rxjs54 = __toESM(require_cjs());
321222
+ import_rxjs58 = __toESM(require_cjs());
320768
321223
  import_operators42 = __toESM(require_operators());
320769
321224
  init_helpers();
320770
321225
  init_gql_client();
320771
321226
  init_log();
320772
- delete_default4 = (cmd) => (0, import_rxjs54.lastValueFrom)(
321227
+ delete_default4 = (cmd) => (0, import_rxjs58.lastValueFrom)(
320773
321228
  parseProjectId(cmd.project).pipe(
320774
321229
  (0, import_operators42.switchMap)(
320775
321230
  (projectId) => GraphqlClienAPI.deleteMessageQueueTrigger(projectId, cmd.name)
@@ -320879,11 +321334,11 @@ var init_definition = __esm({
320879
321334
  });
320880
321335
 
320881
321336
  // src/commands/workflow/helpers.ts
320882
- var import_promises3, import_rxjs55, import_operators43, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
321337
+ var import_promises4, import_rxjs59, import_operators43, resolveWorkflow, withProject, readWorkflowFile, writeTextFile, POLL_MS, followRun, printRunResult;
320883
321338
  var init_helpers4 = __esm({
320884
321339
  "src/commands/workflow/helpers.ts"() {
320885
- import_promises3 = require("fs/promises");
320886
- import_rxjs55 = __toESM(require_cjs());
321340
+ import_promises4 = require("fs/promises");
321341
+ import_rxjs59 = __toESM(require_cjs());
320887
321342
  import_operators43 = __toESM(require_operators());
320888
321343
  init_helpers();
320889
321344
  init_gql_client();
@@ -320905,18 +321360,18 @@ var init_helpers4 = __esm({
320905
321360
  })
320906
321361
  );
320907
321362
  };
320908
- withProject = (project, fn) => (0, import_rxjs55.lastValueFrom)(parseProjectId(project).pipe((0, import_operators43.switchMap)(fn)));
321363
+ withProject = (project, fn) => (0, import_rxjs59.lastValueFrom)(parseProjectId(project).pipe((0, import_operators43.switchMap)(fn)));
320909
321364
  readWorkflowFile = (path2) => {
320910
321365
  if (!path2) {
320911
321366
  throw new Error("--file is required (a workflow YAML or JSON file)");
320912
321367
  }
320913
- return (0, import_rxjs55.from)((0, import_promises3.readFile)(path2, "utf8")).pipe((0, import_operators43.map)(parseWorkflowFile));
321368
+ return (0, import_rxjs59.from)((0, import_promises4.readFile)(path2, "utf8")).pipe((0, import_operators43.map)(parseWorkflowFile));
320914
321369
  };
320915
- writeTextFile = (path2, text) => (0, import_rxjs55.from)((0, import_promises3.writeFile)(path2, text, "utf8"));
321370
+ writeTextFile = (path2, text) => (0, import_rxjs59.from)((0, import_promises4.writeFile)(path2, text, "utf8"));
320916
321371
  POLL_MS = 2e3;
320917
321372
  followRun = (projectId, workflowId, runName) => {
320918
321373
  let printed = 0;
320919
- return (0, import_rxjs55.timer)(0, POLL_MS).pipe(
321374
+ return (0, import_rxjs59.timer)(0, POLL_MS).pipe(
320920
321375
  (0, import_operators43.switchMap)(
320921
321376
  () => GraphqlClienAPI.getWorkflowRun(projectId, workflowId, runName)
320922
321377
  ),
@@ -320989,10 +321444,10 @@ var get_exports2 = {};
320989
321444
  __export(get_exports2, {
320990
321445
  default: () => get_default2
320991
321446
  });
320992
- var import_rxjs56, import_operators45, get_default2;
321447
+ var import_rxjs60, import_operators45, get_default2;
320993
321448
  var init_get2 = __esm({
320994
321449
  "src/commands/workflow/get.ts"() {
320995
- import_rxjs56 = __toESM(require_cjs());
321450
+ import_rxjs60 = __toESM(require_cjs());
320996
321451
  import_operators45 = __toESM(require_operators());
320997
321452
  init_log();
320998
321453
  init_definition();
@@ -321008,7 +321463,7 @@ var init_get2 = __esm({
321008
321463
  });
321009
321464
  if (!cmd.out) {
321010
321465
  Logger.log(text);
321011
- return (0, import_rxjs56.of)(null);
321466
+ return (0, import_rxjs60.of)(null);
321012
321467
  }
321013
321468
  return writeTextFile(cmd.out, text).pipe(
321014
321469
  (0, import_operators45.tap)(() => Logger.info(`Wrote ${cmd.out}`))
@@ -321078,11 +321533,11 @@ var generate_exports = {};
321078
321533
  __export(generate_exports, {
321079
321534
  default: () => generate_default
321080
321535
  });
321081
- var import_promises4, import_rxjs57, import_operators47, generate_default;
321536
+ var import_promises5, import_rxjs61, import_operators47, generate_default;
321082
321537
  var init_generate = __esm({
321083
321538
  "src/commands/workflow/generate.ts"() {
321084
- import_promises4 = require("fs/promises");
321085
- import_rxjs57 = __toESM(require_cjs());
321539
+ import_promises5 = require("fs/promises");
321540
+ import_rxjs61 = __toESM(require_cjs());
321086
321541
  import_operators47 = __toESM(require_operators());
321087
321542
  init_gql_client();
321088
321543
  init_log();
@@ -321095,7 +321550,7 @@ var init_generate = __esm({
321095
321550
  'Describe the workflow: --description "charge the card with retries, then email the receipt"'
321096
321551
  );
321097
321552
  }
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(
321553
+ const base$ = cmd.from ? (0, import_rxjs61.from)((0, import_promises5.readFile)(cmd.from, "utf8")).pipe((0, import_operators47.map)(parseWorkflowFile)) : cmd.name ? GraphqlClienAPI.listWorkflows(projectId).pipe(
321099
321554
  (0, import_operators47.switchMap)(
321100
321555
  (workflows) => workflows.some((w) => w.name === cmd.name) ? resolveWorkflow(projectId, cmd.name).pipe(
321101
321556
  (0, import_operators47.map)((w) => ({
@@ -321103,9 +321558,9 @@ var init_generate = __esm({
321103
321558
  description: w.description ?? void 0,
321104
321559
  definition: w.definition
321105
321560
  }))
321106
- ) : (0, import_rxjs57.of)(null)
321561
+ ) : (0, import_rxjs61.of)(null)
321107
321562
  )
321108
- ) : (0, import_rxjs57.of)(null);
321563
+ ) : (0, import_rxjs61.of)(null);
321109
321564
  return base$.pipe(
321110
321565
  (0, import_operators47.tap)(() => Logger.info("Asking the AI for a draft...")),
321111
321566
  (0, import_operators47.switchMap)(
@@ -321132,10 +321587,10 @@ var init_generate = __esm({
321132
321587
  const text = toWorkflowYaml(file2);
321133
321588
  const written$ = cmd.out ? writeTextFile(cmd.out, text).pipe(
321134
321589
  (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)));
321590
+ ) : (0, import_rxjs61.of)(null).pipe((0, import_operators47.tap)(() => !cmd.apply && Logger.log(text)));
321136
321591
  return written$.pipe(
321137
321592
  (0, import_operators47.switchMap)(
321138
- () => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs57.of)(null).pipe(
321593
+ () => cmd.apply ? applyWorkflow(projectId, file2) : (0, import_rxjs61.of)(null).pipe(
321139
321594
  (0, import_operators47.tap)(
321140
321595
  () => Logger.info(
321141
321596
  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 +321664,11 @@ var run_exports = {};
321209
321664
  __export(run_exports, {
321210
321665
  default: () => run_default
321211
321666
  });
321212
- var import_promises5, import_rxjs58, import_operators50, run_default;
321667
+ var import_promises6, import_rxjs62, import_operators50, run_default;
321213
321668
  var init_run = __esm({
321214
321669
  "src/commands/workflow/run.ts"() {
321215
- import_promises5 = require("fs/promises");
321216
- import_rxjs58 = __toESM(require_cjs());
321670
+ import_promises6 = require("fs/promises");
321671
+ import_rxjs62 = __toESM(require_cjs());
321217
321672
  import_operators50 = __toESM(require_operators());
321218
321673
  init_gql_client();
321219
321674
  init_log();
@@ -321221,7 +321676,7 @@ var init_run = __esm({
321221
321676
  init_helpers4();
321222
321677
  run_default = (cmd) => withProject(
321223
321678
  cmd.project,
321224
- (projectId) => (cmd.inputFile ? (0, import_rxjs58.from)((0, import_promises5.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs58.of)(cmd.input)).pipe(
321679
+ (projectId) => (cmd.inputFile ? (0, import_rxjs62.from)((0, import_promises6.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs62.of)(cmd.input)).pipe(
321225
321680
  (0, import_operators50.map)(parseRunInput),
321226
321681
  (0, import_operators50.switchMap)(
321227
321682
  (input) => resolveWorkflow(projectId, cmd.name).pipe(
@@ -321229,7 +321684,7 @@ var init_run = __esm({
321229
321684
  (w) => GraphqlClienAPI.startWorkflowRun(projectId, w.id, input).pipe(
321230
321685
  (0, import_operators50.tap)((run2) => Logger.info(`Started run ${run2.name}`)),
321231
321686
  (0, import_operators50.switchMap)(
321232
- (run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs58.of)(run2).pipe(
321687
+ (run2) => cmd.wait ? followRun(projectId, w.id, run2.name) : (0, import_rxjs62.of)(run2).pipe(
321233
321688
  (0, import_operators50.tap)(
321234
321689
  () => Logger.info(
321235
321690
  `Follow it: gcli workflow:status --name ${w.name} --run ${run2.name} --follow`
@@ -321403,11 +321858,11 @@ var trigger_add_exports = {};
321403
321858
  __export(trigger_add_exports, {
321404
321859
  default: () => trigger_add_default
321405
321860
  });
321406
- var import_promises6, import_rxjs59, import_operators54, trigger_add_default;
321861
+ var import_promises7, import_rxjs63, import_operators54, trigger_add_default;
321407
321862
  var init_trigger_add = __esm({
321408
321863
  "src/commands/workflow/trigger-add.ts"() {
321409
- import_promises6 = require("fs/promises");
321410
- import_rxjs59 = __toESM(require_cjs());
321864
+ import_promises7 = require("fs/promises");
321865
+ import_rxjs63 = __toESM(require_cjs());
321411
321866
  import_operators54 = __toESM(require_operators());
321412
321867
  init_gql_client();
321413
321868
  init_log();
@@ -321415,7 +321870,7 @@ var init_trigger_add = __esm({
321415
321870
  init_triggers();
321416
321871
  trigger_add_default = (cmd) => withProject(
321417
321872
  cmd.project,
321418
- (projectId) => (cmd.inputFile ? (0, import_rxjs59.from)((0, import_promises6.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs59.of)(void 0)).pipe(
321873
+ (projectId) => (cmd.inputFile ? (0, import_rxjs63.from)((0, import_promises7.readFile)(cmd.inputFile, "utf8")) : (0, import_rxjs63.of)(void 0)).pipe(
321419
321874
  (0, import_operators54.map)((inputText) => buildTriggerInput({ ...cmd, inputText })),
321420
321875
  (0, import_operators54.switchMap)(
321421
321876
  (trigger) => resolveWorkflow(projectId, cmd.name).pipe(
@@ -321504,10 +321959,10 @@ var init_trigger_remove = __esm({
321504
321959
  });
321505
321960
 
321506
321961
  // src/commands/workspace/approvals.ts
321507
- var import_readline, APPROVAL_TIMEOUT_MS, TerminalPrompt, ApprovalGate;
321962
+ var import_readline3, APPROVAL_TIMEOUT_MS, TerminalPrompt, ApprovalGate;
321508
321963
  var init_approvals = __esm({
321509
321964
  "src/commands/workspace/approvals.ts"() {
321510
- import_readline = require("readline");
321965
+ import_readline3 = require("readline");
321511
321966
  APPROVAL_TIMEOUT_MS = 5 * 6e4;
321512
321967
  TerminalPrompt = class {
321513
321968
  constructor() {
@@ -321521,7 +321976,7 @@ var init_approvals = __esm({
321521
321976
  askNow(question, signal) {
321522
321977
  if (signal.aborted) return Promise.resolve(null);
321523
321978
  return new Promise((resolve2) => {
321524
- const rl = (0, import_readline.createInterface)({
321979
+ const rl = (0, import_readline3.createInterface)({
321525
321980
  input: process.stdin,
321526
321981
  output: process.stdout
321527
321982
  });
@@ -321631,23 +322086,23 @@ var init_approvals = __esm({
321631
322086
  });
321632
322087
 
321633
322088
  // src/commands/workspace/config.ts
321634
- var import_promises7, readSavedWorkspaces, writeAll, readSavedWorkspace, saveWorkspace, forgetWorkspace;
322089
+ var import_promises8, readSavedWorkspaces, writeAll, readSavedWorkspace, saveWorkspace, forgetWorkspace;
321635
322090
  var init_config2 = __esm({
321636
322091
  "src/commands/workspace/config.ts"() {
321637
- import_promises7 = require("fs/promises");
322092
+ import_promises8 = require("fs/promises");
321638
322093
  init_types();
321639
322094
  readSavedWorkspaces = async () => {
321640
322095
  try {
321641
- const saved = JSON.parse(await (0, import_promises7.readFile)(workspacesDirectory, "utf-8"));
322096
+ const saved = JSON.parse(await (0, import_promises8.readFile)(workspacesDirectory, "utf-8"));
321642
322097
  return saved && typeof saved === "object" ? saved : {};
321643
322098
  } catch {
321644
322099
  return {};
321645
322100
  }
321646
322101
  };
321647
322102
  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);
322103
+ await (0, import_promises8.mkdir)(mainDirectory, { recursive: true });
322104
+ await (0, import_promises8.writeFile)(workspacesDirectory, JSON.stringify(all, null, 2), "utf-8");
322105
+ await (0, import_promises8.chmod)(workspacesDirectory, 384);
321651
322106
  };
321652
322107
  readSavedWorkspace = async (root) => {
321653
322108
  const saved = (await readSavedWorkspaces())[root];
@@ -321676,15 +322131,15 @@ var init_config2 = __esm({
321676
322131
  });
321677
322132
 
321678
322133
  // 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;
322134
+ var import_child_process5, import_crypto, import_fs8, import_path3, 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
322135
  var init_files = __esm({
321681
322136
  "src/commands/workspace/files.ts"() {
321682
- import_child_process4 = require("child_process");
322137
+ import_child_process5 = require("child_process");
321683
322138
  import_crypto = require("crypto");
321684
322139
  import_fs8 = require("fs");
321685
- import_path2 = require("path");
322140
+ import_path3 = require("path");
321686
322141
  import_util12 = require("util");
321687
- run = (0, import_util12.promisify)(import_child_process4.execFile);
322142
+ run = (0, import_util12.promisify)(import_child_process5.execFile);
321688
322143
  WorkspaceError = class extends Error {
321689
322144
  constructor(message, status2 = 400) {
321690
322145
  super(message);
@@ -321702,11 +322157,11 @@ var init_files = __esm({
321702
322157
  SECRET_FILE = /^(\.env(\..+)?|.*\.(pem|key|p12|pfx|keystore|jks)|id_(rsa|dsa|ecdsa|ed25519)(\.pub)?|\.npmrc|\.pypirc|\.netrc|credentials(\.json)?)$/i;
321703
322158
  SECRET_TEMPLATE = /\.(example|sample|template|dist|defaults)$/i;
321704
322159
  isSecretFile = (path2) => {
321705
- const name2 = (0, import_path2.basename)(path2);
322160
+ const name2 = (0, import_path3.basename)(path2);
321706
322161
  return SECRET_FILE.test(name2) && !SECRET_TEMPLATE.test(name2);
321707
322162
  };
321708
322163
  contentHash = (content) => (0, import_crypto.createHash)("sha256").update(content).digest("hex").slice(0, 16);
321709
- toPosix = (p) => p.split(import_path2.sep).join("/");
322164
+ toPosix = (p) => p.split(import_path3.sep).join("/");
321710
322165
  WorkspaceFiles = class {
321711
322166
  constructor(root, options = {}) {
321712
322167
  this.root = root;
@@ -321715,9 +322170,9 @@ var init_files = __esm({
321715
322170
  /** Absolute path for a workspace-relative one, or a WorkspaceError. */
321716
322171
  async resolvePath(input, { forWrite = false } = {}) {
321717
322172
  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)) {
322173
+ const abs = (0, import_path3.resolve)(this.root, rel);
322174
+ const fromRoot = (0, import_path3.relative)(this.root, abs);
322175
+ if (fromRoot.startsWith("..") || (0, import_path3.isAbsolute)(fromRoot)) {
321721
322176
  throw new WorkspaceError(
321722
322177
  `${input} is outside the workspace root - paths are relative to ${this.root}`,
321723
322178
  403
@@ -321727,8 +322182,8 @@ var init_files = __esm({
321727
322182
  for (; ; ) {
321728
322183
  try {
321729
322184
  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)) {
322185
+ const realFromRoot = (0, import_path3.relative)(this.root, real);
322186
+ if (realFromRoot.startsWith("..") || (0, import_path3.isAbsolute)(realFromRoot)) {
321732
322187
  throw new WorkspaceError(
321733
322188
  `${input} resolves outside the workspace root (symlink)`,
321734
322189
  403
@@ -321737,7 +322192,7 @@ var init_files = __esm({
321737
322192
  break;
321738
322193
  } catch (e2) {
321739
322194
  if (e2 instanceof WorkspaceError) throw e2;
321740
- const parent = (0, import_path2.dirname)(existing);
322195
+ const parent = (0, import_path3.dirname)(existing);
321741
322196
  if (parent === existing) break;
321742
322197
  existing = parent;
321743
322198
  }
@@ -321785,7 +322240,7 @@ var init_files = __esm({
321785
322240
  const out = [];
321786
322241
  const walk = async (relDir) => {
321787
322242
  if (out.length > limit) return;
321788
- const entries = await import_fs8.promises.readdir((0, import_path2.join)(this.root, relDir), { withFileTypes: true }).catch(() => []);
322243
+ const entries = await import_fs8.promises.readdir((0, import_path3.join)(this.root, relDir), { withFileTypes: true }).catch(() => []);
321789
322244
  for (const entry of entries) {
321790
322245
  if (SKIP_DIRS.has(entry.name)) continue;
321791
322246
  const rel = relDir === "." ? entry.name : `${relDir}/${entry.name}`;
@@ -321828,7 +322283,7 @@ var init_files = __esm({
321828
322283
  entries = entries.slice(0, limit);
321829
322284
  await Promise.all(
321830
322285
  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);
322286
+ e2.size = await import_fs8.promises.stat((0, import_path3.join)(this.root, e2.path)).then((s2) => s2.size).catch(() => void 0);
321832
322287
  })
321833
322288
  );
321834
322289
  return {
@@ -321894,7 +322349,7 @@ var init_files = __esm({
321894
322349
  );
321895
322350
  }
321896
322351
  }
321897
- await import_fs8.promises.mkdir((0, import_path2.dirname)(abs), { recursive: true });
322352
+ await import_fs8.promises.mkdir((0, import_path3.dirname)(abs), { recursive: true });
321898
322353
  await import_fs8.promises.writeFile(abs, content, "utf-8");
321899
322354
  return {
321900
322355
  path: rel,
@@ -321997,7 +322452,7 @@ var init_files = __esm({
321997
322452
  raw = [];
321998
322453
  for (const file2 of await this.allFiles(rel, 2e4)) {
321999
322454
  if (globRe && !globRe.test(file2)) continue;
322000
- const text = await import_fs8.promises.readFile((0, import_path2.join)(this.root, file2)).catch(() => null);
322455
+ const text = await import_fs8.promises.readFile((0, import_path3.join)(this.root, file2)).catch(() => null);
322001
322456
  if (!text || text.subarray(0, 8e3).includes(0)) continue;
322002
322457
  text.toString("utf-8").split("\n").forEach((line, i2) => {
322003
322458
  if (raw.length <= max && re.test(line)) {
@@ -322018,10 +322473,10 @@ var init_files = __esm({
322018
322473
  });
322019
322474
 
322020
322475
  // 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;
322476
+ 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
322477
  var init_processes = __esm({
322023
322478
  "src/commands/workspace/processes.ts"() {
322024
- import_child_process5 = require("child_process");
322479
+ import_child_process6 = require("child_process");
322025
322480
  init_files();
322026
322481
  DEFAULT_TIMEOUT_S = 300;
322027
322482
  MAX_TIMEOUT_S = 1800;
@@ -322104,7 +322559,7 @@ var init_processes = __esm({
322104
322559
  if (!child.pid || child.exitCode !== null) return;
322105
322560
  try {
322106
322561
  if (process.platform === "win32") {
322107
- (0, import_child_process5.spawn)("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
322562
+ (0, import_child_process6.spawn)("taskkill", ["/pid", String(child.pid), "/T", "/F"]);
322108
322563
  } else {
322109
322564
  process.kill(-child.pid, signal);
322110
322565
  }
@@ -322146,7 +322601,7 @@ ${this.text}` : this.text;
322146
322601
  );
322147
322602
  const started = Date.now();
322148
322603
  const [shell, shellArgs] = shellOf(args.command);
322149
- const child = (0, import_child_process5.spawn)(shell, shellArgs, {
322604
+ const child = (0, import_child_process6.spawn)(shell, shellArgs, {
322150
322605
  cwd: args.cwd,
322151
322606
  env: args.env,
322152
322607
  stdio: ["ignore", "pipe", "pipe"],
@@ -322236,7 +322691,7 @@ ${this.text}` : this.text;
322236
322691
  }
322237
322692
  }
322238
322693
  const [shell, shellArgs] = shellOf(args.command);
322239
- const child = (0, import_child_process5.spawn)(shell, shellArgs, {
322694
+ const child = (0, import_child_process6.spawn)(shell, shellArgs, {
322240
322695
  cwd: args.cwd,
322241
322696
  env: args.env,
322242
322697
  stdio: ["ignore", "pipe", "pipe"],
@@ -322392,10 +322847,10 @@ ${this.text}` : this.text;
322392
322847
  });
322393
322848
 
322394
322849
  // 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;
322850
+ var import_os5, WORKSPACE_PATH_PREFIX, WORKSPACE_OPS, HEARTBEAT_MUTATION2, REQUEST_APPROVAL_MUTATION, SETTLE_APPROVAL_MUTATION, str, num, short, WorkspaceConnection;
322396
322851
  var init_connection2 = __esm({
322397
322852
  "src/commands/workspace/connection.ts"() {
322398
- import_os4 = require("os");
322853
+ import_os5 = require("os");
322399
322854
  init_tunnel();
322400
322855
  init_approvals();
322401
322856
  init_files();
@@ -322478,7 +322933,7 @@ var init_connection2 = __esm({
322478
322933
  const data = await this.operation(HEARTBEAT_MUTATION2, {
322479
322934
  info: {
322480
322935
  root: this.options.root,
322481
- hostname: (0, import_os4.hostname)(),
322936
+ hostname: (0, import_os5.hostname)(),
322482
322937
  platform: process.platform,
322483
322938
  gitBranch: await this.files.gitBranch(),
322484
322939
  clientVersion: this.options.version,
@@ -322790,12 +323245,12 @@ __export(start_exports4, {
322790
323245
  WORKSPACE_VERSION: () => WORKSPACE_VERSION,
322791
323246
  default: () => start_default2
322792
323247
  });
322793
- var import_promises8, import_path3, import_rxjs60, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
323248
+ var import_promises9, import_path4, import_rxjs64, WORKSPACE_VERSION, csv, resolveWorkspace, start_default2;
322794
323249
  var init_start4 = __esm({
322795
323250
  "src/commands/workspace/start.ts"() {
322796
- import_promises8 = require("fs/promises");
322797
- import_path3 = require("path");
322798
- import_rxjs60 = __toESM(require_cjs());
323251
+ import_promises9 = require("fs/promises");
323252
+ import_path4 = require("path");
323253
+ import_rxjs64 = __toESM(require_cjs());
322799
323254
  init_helpers();
322800
323255
  init_gql_client();
322801
323256
  init_log();
@@ -322812,7 +323267,7 @@ var init_start4 = __esm({
322812
323267
  if (cmd.token) {
322813
323268
  return {
322814
323269
  id: "(from --token)",
322815
- name: cmd.name ?? (0, import_path3.basename)(root),
323270
+ name: cmd.name ?? (0, import_path4.basename)(root),
322816
323271
  token: cmd.token,
322817
323272
  projectId: cmd.project ?? "",
322818
323273
  root
@@ -322825,16 +323280,16 @@ var init_start4 = __esm({
322825
323280
  if (saved && (!cmd.project || cmd.project === saved.projectId)) {
322826
323281
  return saved;
322827
323282
  }
322828
- const projectId = await (0, import_rxjs60.lastValueFrom)(parseProjectId(cmd.project)).catch(
323283
+ const projectId = await (0, import_rxjs64.lastValueFrom)(parseProjectId(cmd.project)).catch(
322829
323284
  () => {
322830
323285
  throw new Error(
322831
323286
  "No project selected. Pass --project <projectId> or run `gcli project:use <projectId>` first."
322832
323287
  );
322833
323288
  }
322834
323289
  );
322835
- const name2 = cmd.name || (0, import_path3.basename)(root);
323290
+ const name2 = cmd.name || (0, import_path4.basename)(root);
322836
323291
  Logger.info(`Registering ${root} as local workspace "${name2}"...`);
322837
- const { workspace, token } = await (0, import_rxjs60.lastValueFrom)(
323292
+ const { workspace, token } = await (0, import_rxjs64.lastValueFrom)(
322838
323293
  GraphqlClienAPI.createLocalWorkspace(projectId, name2)
322839
323294
  ).catch((e2) => {
322840
323295
  throw new Error(
@@ -322852,7 +323307,7 @@ var init_start4 = __esm({
322852
323307
  return created;
322853
323308
  };
322854
323309
  start_default2 = async (cmd) => {
322855
- const root = await (0, import_promises8.realpath)(process.cwd());
323310
+ const root = await (0, import_promises9.realpath)(process.cwd());
322856
323311
  const workspace = await resolveWorkspace(root, cmd);
322857
323312
  const wsUrl = cmd.wsUrl || workspace.wsUrl || deriveSubscriptionsUrl(await readLoginApiUrl());
322858
323313
  const policy = new CommandPolicy(
@@ -322925,16 +323380,16 @@ var list_exports9 = {};
322925
323380
  __export(list_exports9, {
322926
323381
  default: () => list_default9
322927
323382
  });
322928
- var import_rxjs61, list_default9;
323383
+ var import_rxjs65, list_default9;
322929
323384
  var init_list9 = __esm({
322930
323385
  "src/commands/workspace/list.ts"() {
322931
- import_rxjs61 = __toESM(require_cjs());
323386
+ import_rxjs65 = __toESM(require_cjs());
322932
323387
  init_gql_client();
322933
323388
  init_log();
322934
323389
  init_config2();
322935
323390
  list_default9 = async (cmd) => {
322936
323391
  const [workspaces, saved] = await Promise.all([
322937
- (0, import_rxjs61.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
323392
+ (0, import_rxjs65.lastValueFrom)(GraphqlClienAPI.listLocalWorkspaces(cmd.project)),
322938
323393
  readSavedWorkspaces()
322939
323394
  ]);
322940
323395
  const onThisMachine = new Set(Object.values(saved).map((w) => w.id));
@@ -322968,23 +323423,23 @@ var delete_exports6 = {};
322968
323423
  __export(delete_exports6, {
322969
323424
  default: () => delete_default6
322970
323425
  });
322971
- var import_promises9, import_rxjs62, delete_default6;
323426
+ var import_promises10, import_rxjs66, delete_default6;
322972
323427
  var init_delete6 = __esm({
322973
323428
  "src/commands/workspace/delete.ts"() {
322974
- import_promises9 = require("fs/promises");
322975
- import_rxjs62 = __toESM(require_cjs());
323429
+ import_promises10 = require("fs/promises");
323430
+ import_rxjs66 = __toESM(require_cjs());
322976
323431
  init_gql_client();
322977
323432
  init_log();
322978
323433
  init_config2();
322979
323434
  delete_default6 = async (cmd) => {
322980
- const root = await (0, import_promises9.realpath)(process.cwd());
323435
+ const root = await (0, import_promises10.realpath)(process.cwd());
322981
323436
  const workspaceId = cmd.id || (await readSavedWorkspace(root))?.id;
322982
323437
  if (!workspaceId) {
322983
323438
  throw new Error(
322984
323439
  "No workspace registered for this directory - pass --id (see `gcli workspace:list`)."
322985
323440
  );
322986
323441
  }
322987
- await (0, import_rxjs62.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
323442
+ await (0, import_rxjs66.lastValueFrom)(GraphqlClienAPI.deleteLocalWorkspace(workspaceId));
322988
323443
  await forgetWorkspace({ id: workspaceId });
322989
323444
  Logger.log(
322990
323445
  `Local workspace ${workspaceId} deleted; its token no longer works.`
@@ -323066,6 +323521,32 @@ function registerClusterCommands(program2) {
323066
323521
  "Every cluster's status, agent, nodes, CPU/memory load, autoscaling and open issues (or one with --cluster)"
323067
323522
  )
323068
323523
  ).action(lazy(() => Promise.resolve().then(() => (init_status(), status_exports)).then((m2) => m2.default)));
323524
+ target(
323525
+ program2.command("cluster:attach").description(
323526
+ "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"
323527
+ )
323528
+ ).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(
323529
+ "--reserved",
323530
+ "Only workloads that tolerate the pool run there (default: plain extra capacity)"
323531
+ ).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)));
323532
+ target(
323533
+ program2.command("cluster:nodes").description(
323534
+ "Every node of a cluster: its Hetzner control planes and workers and the machines attached to it"
323535
+ )
323536
+ ).action(lazy(() => Promise.resolve().then(() => (init_nodes(), nodes_exports)).then((m2) => m2.default)));
323537
+ target(
323538
+ program2.command("cluster:pause").description(
323539
+ "Pause an attached machine (cordon): nothing new runs there, running work stays"
323540
+ )
323541
+ ).option("-n, --name <name>", "Machine name (see cluster:nodes)").action(lazy(() => Promise.resolve().then(() => (init_pause(), pause_exports)).then((m2) => m2.pause)));
323542
+ target(
323543
+ program2.command("cluster:resume").description("Let new work run on a paused machine again (uncordon)")
323544
+ ).option("-n, --name <name>", "Machine name (see cluster:nodes)").action(lazy(() => Promise.resolve().then(() => (init_pause(), pause_exports)).then((m2) => m2.resume)));
323545
+ target(
323546
+ program2.command("cluster:detach").description(
323547
+ "Drain and remove an attached machine from a cluster (reset the machine afterwards)"
323548
+ )
323549
+ ).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
323550
  target(
323070
323551
  program2.command("cluster:health").description(
323071
323552
  "The latest health report of a cluster's agent, with every node"