@gapi/gcli 1.8.239 → 1.8.240

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
@@ -8037,7 +8037,7 @@ var init_response = __esm({
8037
8037
  Response2 = class _Response extends Body {
8038
8038
  constructor(body = null, options = {}) {
8039
8039
  super(body, options);
8040
- const status = options.status != null ? options.status : 200;
8040
+ const status2 = options.status != null ? options.status : 200;
8041
8041
  const headers = new Headers2(options.headers);
8042
8042
  if (body !== null && !headers.has("Content-Type")) {
8043
8043
  const contentType = extractContentType(body, this);
@@ -8048,7 +8048,7 @@ var init_response = __esm({
8048
8048
  this[INTERNALS2] = {
8049
8049
  type: "default",
8050
8050
  url: options.url,
8051
- status,
8051
+ status: status2,
8052
8052
  statusText: options.statusText || "",
8053
8053
  headers,
8054
8054
  counter: options.counter,
@@ -8105,15 +8105,15 @@ var init_response = __esm({
8105
8105
  * @param {number} status An optional status code for the response (e.g., 302.)
8106
8106
  * @returns {Response} A Response object.
8107
8107
  */
8108
- static redirect(url2, status = 302) {
8109
- if (!isRedirect(status)) {
8108
+ static redirect(url2, status2 = 302) {
8109
+ if (!isRedirect(status2)) {
8110
8110
  throw new RangeError('Failed to execute "redirect" on "response": Invalid status code');
8111
8111
  }
8112
8112
  return new _Response(null, {
8113
8113
  headers: {
8114
8114
  location: new URL(url2).toString()
8115
8115
  },
8116
- status
8116
+ status: status2
8117
8117
  });
8118
8118
  }
8119
8119
  static error() {
@@ -21369,7 +21369,7 @@ var require_lib = __commonJS({
21369
21369
  var require_XMLHttpRequest = __commonJS({
21370
21370
  "../../node_modules/xmlhttprequest/lib/XMLHttpRequest.js"(exports2) {
21371
21371
  var Url = require("url");
21372
- var spawn2 = require("child_process").spawn;
21372
+ var spawn3 = require("child_process").spawn;
21373
21373
  var fs2 = require("fs");
21374
21374
  exports2.XMLHttpRequest = function() {
21375
21375
  "use strict";
@@ -21639,7 +21639,7 @@ var require_XMLHttpRequest = __commonJS({
21639
21639
  var syncFile = ".node-xmlhttprequest-sync-" + process.pid;
21640
21640
  fs2.writeFileSync(syncFile, "", "utf8");
21641
21641
  var execString = "var http = require('http'), https = require('https'), fs = require('fs');var doRequest = http" + (ssl ? "s" : "") + ".request;var options = " + JSON.stringify(options) + ";var responseText = '';var req = doRequest(options, function(response) {response.setEncoding('utf8');response.on('data', function(chunk) { responseText += chunk;});response.on('end', function() {fs.writeFileSync('" + contentFile + "', JSON.stringify({err: null, data: {statusCode: response.statusCode, headers: response.headers, text: responseText}}), 'utf8');fs.unlinkSync('" + syncFile + "');});response.on('error', function(error) {fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('" + syncFile + "');});}).on('error', function(error) {fs.writeFileSync('" + contentFile + "', JSON.stringify({err: error}), 'utf8');fs.unlinkSync('" + syncFile + "');});" + (data ? "req.write('" + JSON.stringify(data).slice(1, -1).replace(/'/g, "\\'") + "');" : "") + "req.end();";
21642
- var syncProc = spawn2(process.argv[0], ["-e", execString]);
21642
+ var syncProc = spawn3(process.argv[0], ["-e", execString]);
21643
21643
  while (fs2.existsSync(syncFile)) {
21644
21644
  }
21645
21645
  var resp = JSON.parse(fs2.readFileSync(contentFile, "utf8"));
@@ -27839,7 +27839,7 @@ var require_auth = __commonJS({
27839
27839
  this.a = this.c;
27840
27840
  qm(this, true);
27841
27841
  };
27842
- function rm2(a, b) {
27842
+ function rm3(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(rm2(a, b)).then(function() {
27851
+ a.b = Bd(rm3(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 join(s2) {
29870
+ value: function join2(s2) {
29871
29871
  if (this.length === 0) return "";
29872
29872
  var p = this.head;
29873
29873
  var ret = "" + p.data;
@@ -32885,7 +32885,7 @@ var require_buffer_list2 = __commonJS({
32885
32885
  }
32886
32886
  }, {
32887
32887
  key: "join",
32888
- value: function join(s2) {
32888
+ value: function join2(s2) {
32889
32889
  if (this.length === 0) return "";
32890
32890
  var p = this.head;
32891
32891
  var ret = "" + p.data;
@@ -36402,9 +36402,9 @@ var init_gql_client = __esm({
36402
36402
  }).pipe(
36403
36403
  (0, import_operators.map)((res) => res.getLambdaLogs),
36404
36404
  (0, import_operators.map)(
36405
- (logs) => ({
36406
- ...logs,
36407
- data: import_compressor.LZWService.decompress(logs.data)
36405
+ (logs2) => ({
36406
+ ...logs2,
36407
+ data: import_compressor.LZWService.decompress(logs2.data)
36408
36408
  })
36409
36409
  )
36410
36410
  );
@@ -36430,9 +36430,9 @@ var init_gql_client = __esm({
36430
36430
  }).pipe(
36431
36431
  (0, import_operators.map)((res) => res.getLambdaLogsByName),
36432
36432
  (0, import_operators.map)(
36433
- (logs) => ({
36434
- ...logs,
36435
- data: import_compressor.LZWService.decompress(logs.data)
36433
+ (logs2) => ({
36434
+ ...logs2,
36435
+ data: import_compressor.LZWService.decompress(logs2.data)
36436
36436
  })
36437
36437
  )
36438
36438
  );
@@ -36450,9 +36450,9 @@ var init_gql_client = __esm({
36450
36450
  }).pipe(
36451
36451
  (0, import_operators.map)((res) => res.getLambdaBuilderLogs),
36452
36452
  (0, import_operators.map)(
36453
- (logs) => ({
36454
- ...logs,
36455
- data: import_compressor.LZWService.decompress(logs.data)
36453
+ (logs2) => ({
36454
+ ...logs2,
36455
+ data: import_compressor.LZWService.decompress(logs2.data)
36456
36456
  })
36457
36457
  )
36458
36458
  );
@@ -36478,9 +36478,9 @@ var init_gql_client = __esm({
36478
36478
  }).pipe(
36479
36479
  (0, import_operators.map)((res) => res.getLambdaBuilderLogsByName),
36480
36480
  (0, import_operators.map)(
36481
- (logs) => ({
36482
- ...logs,
36483
- data: import_compressor.LZWService.decompress(logs.data)
36481
+ (logs2) => ({
36482
+ ...logs2,
36483
+ data: import_compressor.LZWService.decompress(logs2.data)
36484
36484
  })
36485
36485
  )
36486
36486
  );
@@ -37850,7 +37850,7 @@ var require_util = __commonJS({
37850
37850
  return path2;
37851
37851
  }
37852
37852
  exports2.normalize = normalize;
37853
- function join(aRoot, aPath) {
37853
+ function join2(aRoot, aPath) {
37854
37854
  if (aRoot === "") {
37855
37855
  aRoot = ".";
37856
37856
  }
@@ -37882,7 +37882,7 @@ var require_util = __commonJS({
37882
37882
  }
37883
37883
  return joined;
37884
37884
  }
37885
- exports2.join = join;
37885
+ exports2.join = join2;
37886
37886
  exports2.isAbsolute = function(aPath) {
37887
37887
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
37888
37888
  };
@@ -38055,7 +38055,7 @@ var require_util = __commonJS({
38055
38055
  parsed.path = parsed.path.substring(0, index + 1);
38056
38056
  }
38057
38057
  }
38058
- sourceURL = join(urlGenerate(parsed), sourceURL);
38058
+ sourceURL = join2(urlGenerate(parsed), sourceURL);
38059
38059
  }
38060
38060
  return normalize(sourceURL);
38061
38061
  }
@@ -42181,7 +42181,7 @@ var require_typescript = __commonJS({
42181
42181
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
42182
42182
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
42183
42183
  writeCommentRange: () => writeCommentRange,
42184
- writeFile: () => writeFile6,
42184
+ writeFile: () => writeFile7,
42185
42185
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
42186
42186
  zipWith: () => zipWith
42187
42187
  });
@@ -60824,7 +60824,7 @@ ${lanes.join("\n")}
60824
60824
  sourceFilePath = isSourceFileInCommonSourceDirectory ? sourceFilePath.substring(commonSourceDirectory.length) : sourceFilePath;
60825
60825
  return combinePaths(newDirPath, sourceFilePath);
60826
60826
  }
60827
- function writeFile6(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
60827
+ function writeFile7(host, diagnostics, fileName, text, writeByteOrderMark, sourceFiles, data) {
60828
60828
  host.writeFile(
60829
60829
  fileName,
60830
60830
  text,
@@ -113498,8 +113498,8 @@ ${lanes.join("\n")}
113498
113498
  void 0
113499
113499
  ) : void 0;
113500
113500
  let reportedError = false;
113501
- for (let status = iterator.next(); !status.done; status = iterator.next()) {
113502
- const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status.value;
113501
+ for (let status2 = iterator.next(); !status2.done; status2 = iterator.next()) {
113502
+ const { errorNode: prop, innerExpression: next, nameType, errorMessage } = status2.value;
113503
113503
  let targetPropType = iterationType;
113504
113504
  const targetIndexedPropType = tupleOrArrayLikeTargetParts !== neverType2 ? getBestMatchIndexedAccessTypeOrUndefined(source, tupleOrArrayLikeTargetParts, nameType) : void 0;
113505
113505
  if (targetIndexedPropType && !(targetIndexedPropType.flags & 8388608)) {
@@ -118360,9 +118360,9 @@ ${lanes.join("\n")}
118360
118360
  }
118361
118361
  function invokeOnce(source, target, action) {
118362
118362
  const key = source.id + "," + target.id;
118363
- const status = visited && visited.get(key);
118364
- if (status !== void 0) {
118365
- inferencePriority = Math.min(inferencePriority, status);
118363
+ const status2 = visited && visited.get(key);
118364
+ if (status2 !== void 0) {
118365
+ inferencePriority = Math.min(inferencePriority, status2);
118366
118366
  return;
118367
118367
  }
118368
118368
  (visited || (visited = /* @__PURE__ */ new Map())).set(
@@ -169575,7 +169575,7 @@ ${lanes.join("\n")}
169575
169575
  return;
169576
169576
  }
169577
169577
  const buildInfo = host.getBuildInfo() || { version: version2 };
169578
- writeFile6(
169578
+ writeFile7(
169579
169579
  host,
169580
169580
  emitterDiagnostics,
169581
169581
  buildInfoPath,
@@ -169787,7 +169787,7 @@ ${lanes.join("\n")}
169787
169787
  }
169788
169788
  if (sourceMapFilePath) {
169789
169789
  const sourceMap = sourceMapGenerator.toString();
169790
- writeFile6(
169790
+ writeFile7(
169791
169791
  host,
169792
169792
  emitterDiagnostics,
169793
169793
  sourceMapFilePath,
@@ -169802,7 +169802,7 @@ ${lanes.join("\n")}
169802
169802
  }
169803
169803
  const text = writer.getText();
169804
169804
  const data = { sourceMapUrlPos, diagnostics: transform22.diagnostics };
169805
- writeFile6(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
169805
+ writeFile7(host, emitterDiagnostics, jsFilePath, text, !!compilerOptions.emitBOM, sourceFiles, data);
169806
169806
  writer.clear();
169807
169807
  return !data.skippedDtsWrite;
169808
169808
  }
@@ -184329,7 +184329,7 @@ ${lanes.join("\n")}
184329
184329
  }
184330
184330
  };
184331
184331
  }
184332
- function createBuildOrUpdateInvalidedProject(state, project, projectPath, projectIndex, config2, status, buildOrder) {
184332
+ function createBuildOrUpdateInvalidedProject(state, project, projectPath, projectIndex, config2, status2, buildOrder) {
184333
184333
  let step = 0;
184334
184334
  let program2;
184335
184335
  let buildResult;
@@ -184500,7 +184500,7 @@ ${lanes.join("\n")}
184500
184500
  void 0,
184501
184501
  customTransformers || ((_b = (_a2 = state.host).getCustomTransformers) == null ? void 0 : _b.call(_a2, project))
184502
184502
  );
184503
- if ((!options.noEmitOnError || !diagnostics.length) && (emittedOutputs.size || status.type !== 8)) {
184503
+ if ((!options.noEmitOnError || !diagnostics.length) && (emittedOutputs.size || status2.type !== 8)) {
184504
184504
  updateOutputTimestampsWorker(state, config2, projectPath, Diagnostics.Updating_unchanged_output_timestamps_of_project_0, emittedOutputs);
184505
184505
  }
184506
184506
  state.projectErrorsReported.set(projectPath, true);
@@ -184580,10 +184580,10 @@ ${lanes.join("\n")}
184580
184580
  watchInputFiles(state, project, projectPath, config2);
184581
184581
  watchPackageJsonFiles(state, project, projectPath, config2);
184582
184582
  }
184583
- const status = getUpToDateStatus(state, config2, projectPath);
184583
+ const status2 = getUpToDateStatus(state, config2, projectPath);
184584
184584
  if (!options.force) {
184585
- if (status.type === 1) {
184586
- verboseReportProjectStatus(state, project, status);
184585
+ if (status2.type === 1) {
184586
+ verboseReportProjectStatus(state, project, status2);
184587
184587
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config2));
184588
184588
  projectPendingBuild.delete(projectPath);
184589
184589
  if (options.dry) {
@@ -184591,11 +184591,11 @@ ${lanes.join("\n")}
184591
184591
  }
184592
184592
  continue;
184593
184593
  }
184594
- if (status.type === 2 || status.type === 15) {
184594
+ if (status2.type === 2 || status2.type === 15) {
184595
184595
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config2));
184596
184596
  return {
184597
184597
  kind: 1,
184598
- status,
184598
+ status: status2,
184599
184599
  project,
184600
184600
  projectPath,
184601
184601
  projectIndex,
@@ -184603,29 +184603,29 @@ ${lanes.join("\n")}
184603
184603
  };
184604
184604
  }
184605
184605
  }
184606
- if (status.type === 12) {
184607
- verboseReportProjectStatus(state, project, status);
184606
+ if (status2.type === 12) {
184607
+ verboseReportProjectStatus(state, project, status2);
184608
184608
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config2));
184609
184609
  projectPendingBuild.delete(projectPath);
184610
184610
  if (options.verbose) {
184611
184611
  reportStatus(
184612
184612
  state,
184613
- status.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
184613
+ status2.upstreamProjectBlocked ? Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_was_not_built : Diagnostics.Skipping_build_of_project_0_because_its_dependency_1_has_errors,
184614
184614
  project,
184615
- status.upstreamProjectName
184615
+ status2.upstreamProjectName
184616
184616
  );
184617
184617
  }
184618
184618
  continue;
184619
184619
  }
184620
- if (status.type === 16) {
184621
- verboseReportProjectStatus(state, project, status);
184620
+ if (status2.type === 16) {
184621
+ verboseReportProjectStatus(state, project, status2);
184622
184622
  reportAndStoreErrors(state, projectPath, getConfigFileParsingDiagnostics(config2));
184623
184623
  projectPendingBuild.delete(projectPath);
184624
184624
  continue;
184625
184625
  }
184626
184626
  return {
184627
184627
  kind: 0,
184628
- status,
184628
+ status: status2,
184629
184629
  project,
184630
184630
  projectPath,
184631
184631
  projectIndex,
@@ -185079,12 +185079,12 @@ ${lanes.join("\n")}
185079
185079
  for (const ref of nextProjectConfig.projectReferences) {
185080
185080
  const resolvedRefPath = resolveProjectName(state, ref.path);
185081
185081
  if (toResolvedConfigFilePath(state, resolvedRefPath) !== projectPath) continue;
185082
- const status = state.projectStatus.get(nextProjectPath);
185083
- if (status) {
185084
- switch (status.type) {
185082
+ const status2 = state.projectStatus.get(nextProjectPath);
185083
+ if (status2) {
185084
+ switch (status2.type) {
185085
185085
  case 1:
185086
185086
  if (buildResult & 2) {
185087
- status.type = 2;
185087
+ status2.type = 2;
185088
185088
  break;
185089
185089
  }
185090
185090
  // falls through
@@ -185093,13 +185093,13 @@ ${lanes.join("\n")}
185093
185093
  if (!(buildResult & 2)) {
185094
185094
  state.projectStatus.set(nextProjectPath, {
185095
185095
  type: 6,
185096
- outOfDateOutputFileName: status.oldestOutputFileName,
185096
+ outOfDateOutputFileName: status2.oldestOutputFileName,
185097
185097
  newerProjectName: project
185098
185098
  });
185099
185099
  }
185100
185100
  break;
185101
185101
  case 12:
185102
- if (toResolvedConfigFilePath(state, resolveProjectName(state, status.upstreamProjectName)) === projectPath) {
185102
+ if (toResolvedConfigFilePath(state, resolveProjectName(state, status2.upstreamProjectName)) === projectPath) {
185103
185103
  clearProjectStatus(state, nextProjectPath);
185104
185104
  }
185105
185105
  break;
@@ -185525,75 +185525,75 @@ ${lanes.join("\n")}
185525
185525
  reportStatus(state, Diagnostics.Projects_in_this_build_Colon_0, buildQueue.map((s2) => "\r\n * " + relName(state, s2)).join(""));
185526
185526
  }
185527
185527
  }
185528
- function reportUpToDateStatus(state, configFileName, status) {
185529
- switch (status.type) {
185528
+ function reportUpToDateStatus(state, configFileName, status2) {
185529
+ switch (status2.type) {
185530
185530
  case 5:
185531
185531
  return reportStatus(
185532
185532
  state,
185533
185533
  Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,
185534
185534
  relName(state, configFileName),
185535
- relName(state, status.outOfDateOutputFileName),
185536
- relName(state, status.newerInputFileName)
185535
+ relName(state, status2.outOfDateOutputFileName),
185536
+ relName(state, status2.newerInputFileName)
185537
185537
  );
185538
185538
  case 6:
185539
185539
  return reportStatus(
185540
185540
  state,
185541
185541
  Diagnostics.Project_0_is_out_of_date_because_output_1_is_older_than_input_2,
185542
185542
  relName(state, configFileName),
185543
- relName(state, status.outOfDateOutputFileName),
185544
- relName(state, status.newerProjectName)
185543
+ relName(state, status2.outOfDateOutputFileName),
185544
+ relName(state, status2.newerProjectName)
185545
185545
  );
185546
185546
  case 3:
185547
185547
  return reportStatus(
185548
185548
  state,
185549
185549
  Diagnostics.Project_0_is_out_of_date_because_output_file_1_does_not_exist,
185550
185550
  relName(state, configFileName),
185551
- relName(state, status.missingOutputFileName)
185551
+ relName(state, status2.missingOutputFileName)
185552
185552
  );
185553
185553
  case 4:
185554
185554
  return reportStatus(
185555
185555
  state,
185556
185556
  Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1,
185557
185557
  relName(state, configFileName),
185558
- relName(state, status.fileName)
185558
+ relName(state, status2.fileName)
185559
185559
  );
185560
185560
  case 7:
185561
185561
  return reportStatus(
185562
185562
  state,
185563
185563
  Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_some_of_the_changes_were_not_emitted,
185564
185564
  relName(state, configFileName),
185565
- relName(state, status.buildInfoFile)
185565
+ relName(state, status2.buildInfoFile)
185566
185566
  );
185567
185567
  case 8:
185568
185568
  return reportStatus(
185569
185569
  state,
185570
185570
  Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_program_needs_to_report_errors,
185571
185571
  relName(state, configFileName),
185572
- relName(state, status.buildInfoFile)
185572
+ relName(state, status2.buildInfoFile)
185573
185573
  );
185574
185574
  case 9:
185575
185575
  return reportStatus(
185576
185576
  state,
185577
185577
  Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_there_is_change_in_compilerOptions,
185578
185578
  relName(state, configFileName),
185579
- relName(state, status.buildInfoFile)
185579
+ relName(state, status2.buildInfoFile)
185580
185580
  );
185581
185581
  case 10:
185582
185582
  return reportStatus(
185583
185583
  state,
185584
185584
  Diagnostics.Project_0_is_out_of_date_because_buildinfo_file_1_indicates_that_file_2_was_root_file_of_compilation_but_not_any_more,
185585
185585
  relName(state, configFileName),
185586
- relName(state, status.buildInfoFile),
185587
- relName(state, status.inputFile)
185586
+ relName(state, status2.buildInfoFile),
185587
+ relName(state, status2.inputFile)
185588
185588
  );
185589
185589
  case 1:
185590
- if (status.newestInputFileTime !== void 0) {
185590
+ if (status2.newestInputFileTime !== void 0) {
185591
185591
  return reportStatus(
185592
185592
  state,
185593
185593
  Diagnostics.Project_0_is_up_to_date_because_newest_input_1_is_older_than_output_2,
185594
185594
  relName(state, configFileName),
185595
- relName(state, status.newestInputFileName || ""),
185596
- relName(state, status.oldestOutputFileName || "")
185595
+ relName(state, status2.newestInputFileName || ""),
185596
+ relName(state, status2.oldestOutputFileName || "")
185597
185597
  );
185598
185598
  }
185599
185599
  break;
@@ -185614,28 +185614,28 @@ ${lanes.join("\n")}
185614
185614
  state,
185615
185615
  Diagnostics.Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date,
185616
185616
  relName(state, configFileName),
185617
- relName(state, status.upstreamProjectName)
185617
+ relName(state, status2.upstreamProjectName)
185618
185618
  );
185619
185619
  case 12:
185620
185620
  return reportStatus(
185621
185621
  state,
185622
- status.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
185622
+ status2.upstreamProjectBlocked ? Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_was_not_built : Diagnostics.Project_0_can_t_be_built_because_its_dependency_1_has_errors,
185623
185623
  relName(state, configFileName),
185624
- relName(state, status.upstreamProjectName)
185624
+ relName(state, status2.upstreamProjectName)
185625
185625
  );
185626
185626
  case 0:
185627
185627
  return reportStatus(
185628
185628
  state,
185629
185629
  Diagnostics.Project_0_is_out_of_date_because_1,
185630
185630
  relName(state, configFileName),
185631
- status.reason
185631
+ status2.reason
185632
185632
  );
185633
185633
  case 14:
185634
185634
  return reportStatus(
185635
185635
  state,
185636
185636
  Diagnostics.Project_0_is_out_of_date_because_output_for_it_was_generated_with_version_1_that_differs_with_current_version_2,
185637
185637
  relName(state, configFileName),
185638
- status.version,
185638
+ status2.version,
185639
185639
  version2
185640
185640
  );
185641
185641
  case 17:
@@ -185650,12 +185650,12 @@ ${lanes.join("\n")}
185650
185650
  case 13:
185651
185651
  break;
185652
185652
  default:
185653
- assertType(status);
185653
+ assertType(status2);
185654
185654
  }
185655
185655
  }
185656
- function verboseReportProjectStatus(state, configFileName, status) {
185656
+ function verboseReportProjectStatus(state, configFileName, status2) {
185657
185657
  if (state.options.verbose) {
185658
- reportUpToDateStatus(state, configFileName, status);
185658
+ reportUpToDateStatus(state, configFileName, status2);
185659
185659
  }
185660
185660
  }
185661
185661
  var StatisticType = /* @__PURE__ */ ((StatisticType2) => {
@@ -237684,7 +237684,7 @@ ${options.prefix}` : "\n" : options.prefix
237684
237684
  walkUpParenthesizedTypesAndGetParentAndChild: () => walkUpParenthesizedTypesAndGetParentAndChild,
237685
237685
  whitespaceOrMapCommentRegExp: () => whitespaceOrMapCommentRegExp,
237686
237686
  writeCommentRange: () => writeCommentRange,
237687
- writeFile: () => writeFile6,
237687
+ writeFile: () => writeFile7,
237688
237688
  writeFileEnsuringDirectories: () => writeFileEnsuringDirectories,
237689
237689
  zipWith: () => zipWith
237690
237690
  });
@@ -237915,12 +237915,12 @@ ${options.prefix}` : "\n" : options.prefix
237915
237915
  return void 0;
237916
237916
  }
237917
237917
  }
237918
- function installNpmPackages(npmPath, tsVersion, packageNames, install) {
237918
+ function installNpmPackages(npmPath, tsVersion, packageNames, install2) {
237919
237919
  let hasError = false;
237920
237920
  for (let remaining = packageNames.length; remaining > 0; ) {
237921
237921
  const result = getNpmCommandForInstallation(npmPath, tsVersion, packageNames, remaining);
237922
237922
  remaining = result.remaining;
237923
- hasError = install(result.command) || hasError;
237923
+ hasError = install2(result.command) || hasError;
237924
237924
  }
237925
237925
  return hasError;
237926
237926
  }
@@ -267482,8 +267482,8 @@ var require_graceful_fs = __commonJS({
267482
267482
  }
267483
267483
  }
267484
267484
  var fs$writeFile = fs3.writeFile;
267485
- fs3.writeFile = writeFile6;
267486
- function writeFile6(path2, data, options, cb) {
267485
+ fs3.writeFile = writeFile7;
267486
+ function writeFile7(path2, data, options, cb) {
267487
267487
  if (typeof options === "function")
267488
267488
  cb = options, options = null;
267489
267489
  return go$writeFile(path2, data, options, cb);
@@ -267932,7 +267932,7 @@ var require_BufferList2 = __commonJS({
267932
267932
  this.head = this.tail = null;
267933
267933
  this.length = 0;
267934
267934
  };
267935
- BufferList.prototype.join = function join(s2) {
267935
+ BufferList.prototype.join = function join2(s2) {
267936
267936
  if (this.length === 0) return "";
267937
267937
  var p = this.head;
267938
267938
  var ret = "" + p.data;
@@ -270850,7 +270850,7 @@ var require_old = __commonJS({
270850
270850
  splitRootRe = /^[\/]*/;
270851
270851
  }
270852
270852
  var splitRootRe;
270853
- exports2.realpathSync = function realpathSync(p, cache) {
270853
+ exports2.realpathSync = function realpathSync2(p, cache) {
270854
270854
  p = pathModule.resolve(p);
270855
270855
  if (cache && Object.prototype.hasOwnProperty.call(cache, p)) {
270856
270856
  return cache[p];
@@ -271003,8 +271003,8 @@ var require_fs = __commonJS({
271003
271003
  "../../node_modules/fs.realpath/index.js"(exports2, module2) {
271004
271004
  module2.exports = realpath;
271005
271005
  realpath.realpath = realpath;
271006
- realpath.sync = realpathSync;
271007
- realpath.realpathSync = realpathSync;
271006
+ realpath.sync = realpathSync2;
271007
+ realpath.realpathSync = realpathSync2;
271008
271008
  realpath.monkeypatch = monkeypatch;
271009
271009
  realpath.unmonkeypatch = unmonkeypatch;
271010
271010
  var fs2 = require("fs");
@@ -271032,7 +271032,7 @@ var require_fs = __commonJS({
271032
271032
  }
271033
271033
  });
271034
271034
  }
271035
- function realpathSync(p, cache) {
271035
+ function realpathSync2(p, cache) {
271036
271036
  if (ok) {
271037
271037
  return origRealpathSync(p, cache);
271038
271038
  }
@@ -271048,7 +271048,7 @@ var require_fs = __commonJS({
271048
271048
  }
271049
271049
  function monkeypatch() {
271050
271050
  fs2.realpath = realpath;
271051
- fs2.realpathSync = realpathSync;
271051
+ fs2.realpathSync = realpathSync2;
271052
271052
  }
271053
271053
  function unmonkeypatch() {
271054
271054
  fs2.realpath = origRealpath;
@@ -272732,7 +272732,7 @@ var require_buffer_list3 = __commonJS({
272732
272732
  }
272733
272733
  }, {
272734
272734
  key: "join",
272735
- value: function join(s2) {
272735
+ value: function join2(s2) {
272736
272736
  if (this.length === 0) return "";
272737
272737
  var p = this.head;
272738
272738
  var ret = "" + p.data;
@@ -276074,7 +276074,7 @@ var require_buffer_list4 = __commonJS({
276074
276074
  }
276075
276075
  }, {
276076
276076
  key: "join",
276077
- value: function join(s2) {
276077
+ value: function join2(s2) {
276078
276078
  if (this.length === 0) return "";
276079
276079
  var p = this.head;
276080
276080
  var ret = "" + p.data;
@@ -278846,7 +278846,7 @@ var require_buffer_list5 = __commonJS({
278846
278846
  }
278847
278847
  }, {
278848
278848
  key: "join",
278849
- value: function join(s2) {
278849
+ value: function join2(s2) {
278850
278850
  if (this.length === 0) return "";
278851
278851
  var p = this.head;
278852
278852
  var ret = "" + p.data;
@@ -282083,7 +282083,7 @@ var require_buffer_list6 = __commonJS({
282083
282083
  }
282084
282084
  }, {
282085
282085
  key: "join",
282086
- value: function join(s2) {
282086
+ value: function join2(s2) {
282087
282087
  if (this.length === 0) return "";
282088
282088
  var p = this.head;
282089
282089
  var ret = "" + p.data;
@@ -286279,18 +286279,18 @@ var init_parseUtil = __esm({
286279
286279
  if (this.value !== "aborted")
286280
286280
  this.value = "aborted";
286281
286281
  }
286282
- static mergeArray(status, results) {
286282
+ static mergeArray(status2, results) {
286283
286283
  const arrayValue = [];
286284
286284
  for (const s2 of results) {
286285
286285
  if (s2.status === "aborted")
286286
286286
  return INVALID;
286287
286287
  if (s2.status === "dirty")
286288
- status.dirty();
286288
+ status2.dirty();
286289
286289
  arrayValue.push(s2.value);
286290
286290
  }
286291
- return { status: status.value, value: arrayValue };
286291
+ return { status: status2.value, value: arrayValue };
286292
286292
  }
286293
- static async mergeObjectAsync(status, pairs) {
286293
+ static async mergeObjectAsync(status2, pairs) {
286294
286294
  const syncPairs = [];
286295
286295
  for (const pair of pairs) {
286296
286296
  const key = await pair.key;
@@ -286300,9 +286300,9 @@ var init_parseUtil = __esm({
286300
286300
  value
286301
286301
  });
286302
286302
  }
286303
- return _ParseStatus.mergeObjectSync(status, syncPairs);
286303
+ return _ParseStatus.mergeObjectSync(status2, syncPairs);
286304
286304
  }
286305
- static mergeObjectSync(status, pairs) {
286305
+ static mergeObjectSync(status2, pairs) {
286306
286306
  const finalObject = {};
286307
286307
  for (const pair of pairs) {
286308
286308
  const { key, value } = pair;
@@ -286311,14 +286311,14 @@ var init_parseUtil = __esm({
286311
286311
  if (value.status === "aborted")
286312
286312
  return INVALID;
286313
286313
  if (key.status === "dirty")
286314
- status.dirty();
286314
+ status2.dirty();
286315
286315
  if (value.status === "dirty")
286316
- status.dirty();
286316
+ status2.dirty();
286317
286317
  if (key.value !== "__proto__" && (typeof value.value !== "undefined" || pair.alwaysSet)) {
286318
286318
  finalObject[key.value] = value.value;
286319
286319
  }
286320
286320
  }
286321
- return { status: status.value, value: finalObject };
286321
+ return { status: status2.value, value: finalObject };
286322
286322
  }
286323
286323
  };
286324
286324
  INVALID = Object.freeze({
@@ -286876,7 +286876,7 @@ var init_types2 = __esm({
286876
286876
  });
286877
286877
  return INVALID;
286878
286878
  }
286879
- const status = new ParseStatus();
286879
+ const status2 = new ParseStatus();
286880
286880
  let ctx = void 0;
286881
286881
  for (const check2 of this._def.checks) {
286882
286882
  if (check2.kind === "min") {
@@ -286890,7 +286890,7 @@ var init_types2 = __esm({
286890
286890
  exact: false,
286891
286891
  message: check2.message
286892
286892
  });
286893
- status.dirty();
286893
+ status2.dirty();
286894
286894
  }
286895
286895
  } else if (check2.kind === "max") {
286896
286896
  if (input.data.length > check2.value) {
@@ -286903,7 +286903,7 @@ var init_types2 = __esm({
286903
286903
  exact: false,
286904
286904
  message: check2.message
286905
286905
  });
286906
- status.dirty();
286906
+ status2.dirty();
286907
286907
  }
286908
286908
  } else if (check2.kind === "length") {
286909
286909
  const tooBig = input.data.length > check2.value;
@@ -286929,7 +286929,7 @@ var init_types2 = __esm({
286929
286929
  message: check2.message
286930
286930
  });
286931
286931
  }
286932
- status.dirty();
286932
+ status2.dirty();
286933
286933
  }
286934
286934
  } else if (check2.kind === "email") {
286935
286935
  if (!emailRegex.test(input.data)) {
@@ -286939,7 +286939,7 @@ var init_types2 = __esm({
286939
286939
  code: ZodIssueCode.invalid_string,
286940
286940
  message: check2.message
286941
286941
  });
286942
- status.dirty();
286942
+ status2.dirty();
286943
286943
  }
286944
286944
  } else if (check2.kind === "emoji") {
286945
286945
  if (!emojiRegex) {
@@ -286952,7 +286952,7 @@ var init_types2 = __esm({
286952
286952
  code: ZodIssueCode.invalid_string,
286953
286953
  message: check2.message
286954
286954
  });
286955
- status.dirty();
286955
+ status2.dirty();
286956
286956
  }
286957
286957
  } else if (check2.kind === "uuid") {
286958
286958
  if (!uuidRegex.test(input.data)) {
@@ -286962,7 +286962,7 @@ var init_types2 = __esm({
286962
286962
  code: ZodIssueCode.invalid_string,
286963
286963
  message: check2.message
286964
286964
  });
286965
- status.dirty();
286965
+ status2.dirty();
286966
286966
  }
286967
286967
  } else if (check2.kind === "nanoid") {
286968
286968
  if (!nanoidRegex.test(input.data)) {
@@ -286972,7 +286972,7 @@ var init_types2 = __esm({
286972
286972
  code: ZodIssueCode.invalid_string,
286973
286973
  message: check2.message
286974
286974
  });
286975
- status.dirty();
286975
+ status2.dirty();
286976
286976
  }
286977
286977
  } else if (check2.kind === "cuid") {
286978
286978
  if (!cuidRegex.test(input.data)) {
@@ -286982,7 +286982,7 @@ var init_types2 = __esm({
286982
286982
  code: ZodIssueCode.invalid_string,
286983
286983
  message: check2.message
286984
286984
  });
286985
- status.dirty();
286985
+ status2.dirty();
286986
286986
  }
286987
286987
  } else if (check2.kind === "cuid2") {
286988
286988
  if (!cuid2Regex.test(input.data)) {
@@ -286992,7 +286992,7 @@ var init_types2 = __esm({
286992
286992
  code: ZodIssueCode.invalid_string,
286993
286993
  message: check2.message
286994
286994
  });
286995
- status.dirty();
286995
+ status2.dirty();
286996
286996
  }
286997
286997
  } else if (check2.kind === "ulid") {
286998
286998
  if (!ulidRegex.test(input.data)) {
@@ -287002,7 +287002,7 @@ var init_types2 = __esm({
287002
287002
  code: ZodIssueCode.invalid_string,
287003
287003
  message: check2.message
287004
287004
  });
287005
- status.dirty();
287005
+ status2.dirty();
287006
287006
  }
287007
287007
  } else if (check2.kind === "url") {
287008
287008
  try {
@@ -287014,7 +287014,7 @@ var init_types2 = __esm({
287014
287014
  code: ZodIssueCode.invalid_string,
287015
287015
  message: check2.message
287016
287016
  });
287017
- status.dirty();
287017
+ status2.dirty();
287018
287018
  }
287019
287019
  } else if (check2.kind === "regex") {
287020
287020
  check2.regex.lastIndex = 0;
@@ -287026,7 +287026,7 @@ var init_types2 = __esm({
287026
287026
  code: ZodIssueCode.invalid_string,
287027
287027
  message: check2.message
287028
287028
  });
287029
- status.dirty();
287029
+ status2.dirty();
287030
287030
  }
287031
287031
  } else if (check2.kind === "trim") {
287032
287032
  input.data = input.data.trim();
@@ -287038,7 +287038,7 @@ var init_types2 = __esm({
287038
287038
  validation: { includes: check2.value, position: check2.position },
287039
287039
  message: check2.message
287040
287040
  });
287041
- status.dirty();
287041
+ status2.dirty();
287042
287042
  }
287043
287043
  } else if (check2.kind === "toLowerCase") {
287044
287044
  input.data = input.data.toLowerCase();
@@ -287052,7 +287052,7 @@ var init_types2 = __esm({
287052
287052
  validation: { startsWith: check2.value },
287053
287053
  message: check2.message
287054
287054
  });
287055
- status.dirty();
287055
+ status2.dirty();
287056
287056
  }
287057
287057
  } else if (check2.kind === "endsWith") {
287058
287058
  if (!input.data.endsWith(check2.value)) {
@@ -287062,7 +287062,7 @@ var init_types2 = __esm({
287062
287062
  validation: { endsWith: check2.value },
287063
287063
  message: check2.message
287064
287064
  });
287065
- status.dirty();
287065
+ status2.dirty();
287066
287066
  }
287067
287067
  } else if (check2.kind === "datetime") {
287068
287068
  const regex = datetimeRegex(check2);
@@ -287073,7 +287073,7 @@ var init_types2 = __esm({
287073
287073
  validation: "datetime",
287074
287074
  message: check2.message
287075
287075
  });
287076
- status.dirty();
287076
+ status2.dirty();
287077
287077
  }
287078
287078
  } else if (check2.kind === "date") {
287079
287079
  const regex = dateRegex;
@@ -287084,7 +287084,7 @@ var init_types2 = __esm({
287084
287084
  validation: "date",
287085
287085
  message: check2.message
287086
287086
  });
287087
- status.dirty();
287087
+ status2.dirty();
287088
287088
  }
287089
287089
  } else if (check2.kind === "time") {
287090
287090
  const regex = timeRegex(check2);
@@ -287095,7 +287095,7 @@ var init_types2 = __esm({
287095
287095
  validation: "time",
287096
287096
  message: check2.message
287097
287097
  });
287098
- status.dirty();
287098
+ status2.dirty();
287099
287099
  }
287100
287100
  } else if (check2.kind === "duration") {
287101
287101
  if (!durationRegex.test(input.data)) {
@@ -287105,7 +287105,7 @@ var init_types2 = __esm({
287105
287105
  code: ZodIssueCode.invalid_string,
287106
287106
  message: check2.message
287107
287107
  });
287108
- status.dirty();
287108
+ status2.dirty();
287109
287109
  }
287110
287110
  } else if (check2.kind === "ip") {
287111
287111
  if (!isValidIP(input.data, check2.version)) {
@@ -287115,7 +287115,7 @@ var init_types2 = __esm({
287115
287115
  code: ZodIssueCode.invalid_string,
287116
287116
  message: check2.message
287117
287117
  });
287118
- status.dirty();
287118
+ status2.dirty();
287119
287119
  }
287120
287120
  } else if (check2.kind === "jwt") {
287121
287121
  if (!isValidJWT(input.data, check2.alg)) {
@@ -287125,7 +287125,7 @@ var init_types2 = __esm({
287125
287125
  code: ZodIssueCode.invalid_string,
287126
287126
  message: check2.message
287127
287127
  });
287128
- status.dirty();
287128
+ status2.dirty();
287129
287129
  }
287130
287130
  } else if (check2.kind === "cidr") {
287131
287131
  if (!isValidCidr(input.data, check2.version)) {
@@ -287135,7 +287135,7 @@ var init_types2 = __esm({
287135
287135
  code: ZodIssueCode.invalid_string,
287136
287136
  message: check2.message
287137
287137
  });
287138
- status.dirty();
287138
+ status2.dirty();
287139
287139
  }
287140
287140
  } else if (check2.kind === "base64") {
287141
287141
  if (!base64Regex.test(input.data)) {
@@ -287145,7 +287145,7 @@ var init_types2 = __esm({
287145
287145
  code: ZodIssueCode.invalid_string,
287146
287146
  message: check2.message
287147
287147
  });
287148
- status.dirty();
287148
+ status2.dirty();
287149
287149
  }
287150
287150
  } else if (check2.kind === "base64url") {
287151
287151
  if (!base64urlRegex.test(input.data)) {
@@ -287155,13 +287155,13 @@ var init_types2 = __esm({
287155
287155
  code: ZodIssueCode.invalid_string,
287156
287156
  message: check2.message
287157
287157
  });
287158
- status.dirty();
287158
+ status2.dirty();
287159
287159
  }
287160
287160
  } else {
287161
287161
  util.assertNever(check2);
287162
287162
  }
287163
287163
  }
287164
- return { status: status.value, value: input.data };
287164
+ return { status: status2.value, value: input.data };
287165
287165
  }
287166
287166
  _regex(regex, validation, message) {
287167
287167
  return this.refinement((data) => regex.test(data), {
@@ -287429,7 +287429,7 @@ var init_types2 = __esm({
287429
287429
  return INVALID;
287430
287430
  }
287431
287431
  let ctx = void 0;
287432
- const status = new ParseStatus();
287432
+ const status2 = new ParseStatus();
287433
287433
  for (const check2 of this._def.checks) {
287434
287434
  if (check2.kind === "int") {
287435
287435
  if (!util.isInteger(input.data)) {
@@ -287440,7 +287440,7 @@ var init_types2 = __esm({
287440
287440
  received: "float",
287441
287441
  message: check2.message
287442
287442
  });
287443
- status.dirty();
287443
+ status2.dirty();
287444
287444
  }
287445
287445
  } else if (check2.kind === "min") {
287446
287446
  const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
@@ -287454,7 +287454,7 @@ var init_types2 = __esm({
287454
287454
  exact: false,
287455
287455
  message: check2.message
287456
287456
  });
287457
- status.dirty();
287457
+ status2.dirty();
287458
287458
  }
287459
287459
  } else if (check2.kind === "max") {
287460
287460
  const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
@@ -287468,7 +287468,7 @@ var init_types2 = __esm({
287468
287468
  exact: false,
287469
287469
  message: check2.message
287470
287470
  });
287471
- status.dirty();
287471
+ status2.dirty();
287472
287472
  }
287473
287473
  } else if (check2.kind === "multipleOf") {
287474
287474
  if (floatSafeRemainder(input.data, check2.value) !== 0) {
@@ -287478,7 +287478,7 @@ var init_types2 = __esm({
287478
287478
  multipleOf: check2.value,
287479
287479
  message: check2.message
287480
287480
  });
287481
- status.dirty();
287481
+ status2.dirty();
287482
287482
  }
287483
287483
  } else if (check2.kind === "finite") {
287484
287484
  if (!Number.isFinite(input.data)) {
@@ -287487,13 +287487,13 @@ var init_types2 = __esm({
287487
287487
  code: ZodIssueCode.not_finite,
287488
287488
  message: check2.message
287489
287489
  });
287490
- status.dirty();
287490
+ status2.dirty();
287491
287491
  }
287492
287492
  } else {
287493
287493
  util.assertNever(check2);
287494
287494
  }
287495
287495
  }
287496
- return { status: status.value, value: input.data };
287496
+ return { status: status2.value, value: input.data };
287497
287497
  }
287498
287498
  gte(value, message) {
287499
287499
  return this.setLimit("min", value, true, errorUtil.toString(message));
@@ -287658,7 +287658,7 @@ var init_types2 = __esm({
287658
287658
  return this._getInvalidInput(input);
287659
287659
  }
287660
287660
  let ctx = void 0;
287661
- const status = new ParseStatus();
287661
+ const status2 = new ParseStatus();
287662
287662
  for (const check2 of this._def.checks) {
287663
287663
  if (check2.kind === "min") {
287664
287664
  const tooSmall = check2.inclusive ? input.data < check2.value : input.data <= check2.value;
@@ -287671,7 +287671,7 @@ var init_types2 = __esm({
287671
287671
  inclusive: check2.inclusive,
287672
287672
  message: check2.message
287673
287673
  });
287674
- status.dirty();
287674
+ status2.dirty();
287675
287675
  }
287676
287676
  } else if (check2.kind === "max") {
287677
287677
  const tooBig = check2.inclusive ? input.data > check2.value : input.data >= check2.value;
@@ -287684,7 +287684,7 @@ var init_types2 = __esm({
287684
287684
  inclusive: check2.inclusive,
287685
287685
  message: check2.message
287686
287686
  });
287687
- status.dirty();
287687
+ status2.dirty();
287688
287688
  }
287689
287689
  } else if (check2.kind === "multipleOf") {
287690
287690
  if (input.data % check2.value !== BigInt(0)) {
@@ -287694,13 +287694,13 @@ var init_types2 = __esm({
287694
287694
  multipleOf: check2.value,
287695
287695
  message: check2.message
287696
287696
  });
287697
- status.dirty();
287697
+ status2.dirty();
287698
287698
  }
287699
287699
  } else {
287700
287700
  util.assertNever(check2);
287701
287701
  }
287702
287702
  }
287703
- return { status: status.value, value: input.data };
287703
+ return { status: status2.value, value: input.data };
287704
287704
  }
287705
287705
  _getInvalidInput(input) {
287706
287706
  const ctx = this._getOrReturnCtx(input);
@@ -287858,7 +287858,7 @@ var init_types2 = __esm({
287858
287858
  });
287859
287859
  return INVALID;
287860
287860
  }
287861
- const status = new ParseStatus();
287861
+ const status2 = new ParseStatus();
287862
287862
  let ctx = void 0;
287863
287863
  for (const check2 of this._def.checks) {
287864
287864
  if (check2.kind === "min") {
@@ -287872,7 +287872,7 @@ var init_types2 = __esm({
287872
287872
  minimum: check2.value,
287873
287873
  type: "date"
287874
287874
  });
287875
- status.dirty();
287875
+ status2.dirty();
287876
287876
  }
287877
287877
  } else if (check2.kind === "max") {
287878
287878
  if (input.data.getTime() > check2.value) {
@@ -287885,14 +287885,14 @@ var init_types2 = __esm({
287885
287885
  maximum: check2.value,
287886
287886
  type: "date"
287887
287887
  });
287888
- status.dirty();
287888
+ status2.dirty();
287889
287889
  }
287890
287890
  } else {
287891
287891
  util.assertNever(check2);
287892
287892
  }
287893
287893
  }
287894
287894
  return {
287895
- status: status.value,
287895
+ status: status2.value,
287896
287896
  value: new Date(input.data.getTime())
287897
287897
  };
287898
287898
  }
@@ -288078,7 +288078,7 @@ var init_types2 = __esm({
288078
288078
  };
288079
288079
  ZodArray = class _ZodArray extends ZodType {
288080
288080
  _parse(input) {
288081
- const { ctx, status } = this._processInputParams(input);
288081
+ const { ctx, status: status2 } = this._processInputParams(input);
288082
288082
  const def = this._def;
288083
288083
  if (ctx.parsedType !== ZodParsedType.array) {
288084
288084
  addIssueToContext(ctx, {
@@ -288101,7 +288101,7 @@ var init_types2 = __esm({
288101
288101
  exact: true,
288102
288102
  message: def.exactLength.message
288103
288103
  });
288104
- status.dirty();
288104
+ status2.dirty();
288105
288105
  }
288106
288106
  }
288107
288107
  if (def.minLength !== null) {
@@ -288114,7 +288114,7 @@ var init_types2 = __esm({
288114
288114
  exact: false,
288115
288115
  message: def.minLength.message
288116
288116
  });
288117
- status.dirty();
288117
+ status2.dirty();
288118
288118
  }
288119
288119
  }
288120
288120
  if (def.maxLength !== null) {
@@ -288127,20 +288127,20 @@ var init_types2 = __esm({
288127
288127
  exact: false,
288128
288128
  message: def.maxLength.message
288129
288129
  });
288130
- status.dirty();
288130
+ status2.dirty();
288131
288131
  }
288132
288132
  }
288133
288133
  if (ctx.common.async) {
288134
288134
  return Promise.all([...ctx.data].map((item, i2) => {
288135
288135
  return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
288136
288136
  })).then((result2) => {
288137
- return ParseStatus.mergeArray(status, result2);
288137
+ return ParseStatus.mergeArray(status2, result2);
288138
288138
  });
288139
288139
  }
288140
288140
  const result = [...ctx.data].map((item, i2) => {
288141
288141
  return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i2));
288142
288142
  });
288143
- return ParseStatus.mergeArray(status, result);
288143
+ return ParseStatus.mergeArray(status2, result);
288144
288144
  }
288145
288145
  get element() {
288146
288146
  return this._def.type;
@@ -288203,7 +288203,7 @@ var init_types2 = __esm({
288203
288203
  });
288204
288204
  return INVALID;
288205
288205
  }
288206
- const { status, ctx } = this._processInputParams(input);
288206
+ const { status: status2, ctx } = this._processInputParams(input);
288207
288207
  const { shape, keys: shapeKeys } = this._getCached();
288208
288208
  const extraKeys = [];
288209
288209
  if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
@@ -288238,7 +288238,7 @@ var init_types2 = __esm({
288238
288238
  code: ZodIssueCode.unrecognized_keys,
288239
288239
  keys: extraKeys
288240
288240
  });
288241
- status.dirty();
288241
+ status2.dirty();
288242
288242
  }
288243
288243
  } else if (unknownKeys === "strip") {
288244
288244
  } else {
@@ -288272,10 +288272,10 @@ var init_types2 = __esm({
288272
288272
  }
288273
288273
  return syncPairs;
288274
288274
  }).then((syncPairs) => {
288275
- return ParseStatus.mergeObjectSync(status, syncPairs);
288275
+ return ParseStatus.mergeObjectSync(status2, syncPairs);
288276
288276
  });
288277
288277
  } else {
288278
- return ParseStatus.mergeObjectSync(status, pairs);
288278
+ return ParseStatus.mergeObjectSync(status2, pairs);
288279
288279
  }
288280
288280
  }
288281
288281
  get shape() {
@@ -288715,7 +288715,7 @@ var init_types2 = __esm({
288715
288715
  };
288716
288716
  ZodIntersection = class extends ZodType {
288717
288717
  _parse(input) {
288718
- const { status, ctx } = this._processInputParams(input);
288718
+ const { status: status2, ctx } = this._processInputParams(input);
288719
288719
  const handleParsed = (parsedLeft, parsedRight) => {
288720
288720
  if (isAborted(parsedLeft) || isAborted(parsedRight)) {
288721
288721
  return INVALID;
@@ -288728,9 +288728,9 @@ var init_types2 = __esm({
288728
288728
  return INVALID;
288729
288729
  }
288730
288730
  if (isDirty(parsedLeft) || isDirty(parsedRight)) {
288731
- status.dirty();
288731
+ status2.dirty();
288732
288732
  }
288733
- return { status: status.value, value: merged.data };
288733
+ return { status: status2.value, value: merged.data };
288734
288734
  };
288735
288735
  if (ctx.common.async) {
288736
288736
  return Promise.all([
@@ -288768,7 +288768,7 @@ var init_types2 = __esm({
288768
288768
  };
288769
288769
  ZodTuple = class _ZodTuple extends ZodType {
288770
288770
  _parse(input) {
288771
- const { status, ctx } = this._processInputParams(input);
288771
+ const { status: status2, ctx } = this._processInputParams(input);
288772
288772
  if (ctx.parsedType !== ZodParsedType.array) {
288773
288773
  addIssueToContext(ctx, {
288774
288774
  code: ZodIssueCode.invalid_type,
@@ -288796,7 +288796,7 @@ var init_types2 = __esm({
288796
288796
  exact: false,
288797
288797
  type: "array"
288798
288798
  });
288799
- status.dirty();
288799
+ status2.dirty();
288800
288800
  }
288801
288801
  const items = [...ctx.data].map((item, itemIndex) => {
288802
288802
  const schema = this._def.items[itemIndex] || this._def.rest;
@@ -288806,10 +288806,10 @@ var init_types2 = __esm({
288806
288806
  }).filter((x2) => !!x2);
288807
288807
  if (ctx.common.async) {
288808
288808
  return Promise.all(items).then((results) => {
288809
- return ParseStatus.mergeArray(status, results);
288809
+ return ParseStatus.mergeArray(status2, results);
288810
288810
  });
288811
288811
  } else {
288812
- return ParseStatus.mergeArray(status, items);
288812
+ return ParseStatus.mergeArray(status2, items);
288813
288813
  }
288814
288814
  }
288815
288815
  get items() {
@@ -288841,7 +288841,7 @@ var init_types2 = __esm({
288841
288841
  return this._def.valueType;
288842
288842
  }
288843
288843
  _parse(input) {
288844
- const { status, ctx } = this._processInputParams(input);
288844
+ const { status: status2, ctx } = this._processInputParams(input);
288845
288845
  if (ctx.parsedType !== ZodParsedType.object) {
288846
288846
  addIssueToContext(ctx, {
288847
288847
  code: ZodIssueCode.invalid_type,
@@ -288861,9 +288861,9 @@ var init_types2 = __esm({
288861
288861
  });
288862
288862
  }
288863
288863
  if (ctx.common.async) {
288864
- return ParseStatus.mergeObjectAsync(status, pairs);
288864
+ return ParseStatus.mergeObjectAsync(status2, pairs);
288865
288865
  } else {
288866
- return ParseStatus.mergeObjectSync(status, pairs);
288866
+ return ParseStatus.mergeObjectSync(status2, pairs);
288867
288867
  }
288868
288868
  }
288869
288869
  get element() {
@@ -288894,7 +288894,7 @@ var init_types2 = __esm({
288894
288894
  return this._def.valueType;
288895
288895
  }
288896
288896
  _parse(input) {
288897
- const { status, ctx } = this._processInputParams(input);
288897
+ const { status: status2, ctx } = this._processInputParams(input);
288898
288898
  if (ctx.parsedType !== ZodParsedType.map) {
288899
288899
  addIssueToContext(ctx, {
288900
288900
  code: ZodIssueCode.invalid_type,
@@ -288921,11 +288921,11 @@ var init_types2 = __esm({
288921
288921
  return INVALID;
288922
288922
  }
288923
288923
  if (key.status === "dirty" || value.status === "dirty") {
288924
- status.dirty();
288924
+ status2.dirty();
288925
288925
  }
288926
288926
  finalMap.set(key.value, value.value);
288927
288927
  }
288928
- return { status: status.value, value: finalMap };
288928
+ return { status: status2.value, value: finalMap };
288929
288929
  });
288930
288930
  } else {
288931
288931
  const finalMap = /* @__PURE__ */ new Map();
@@ -288936,11 +288936,11 @@ var init_types2 = __esm({
288936
288936
  return INVALID;
288937
288937
  }
288938
288938
  if (key.status === "dirty" || value.status === "dirty") {
288939
- status.dirty();
288939
+ status2.dirty();
288940
288940
  }
288941
288941
  finalMap.set(key.value, value.value);
288942
288942
  }
288943
- return { status: status.value, value: finalMap };
288943
+ return { status: status2.value, value: finalMap };
288944
288944
  }
288945
288945
  }
288946
288946
  };
@@ -288954,7 +288954,7 @@ var init_types2 = __esm({
288954
288954
  };
288955
288955
  ZodSet = class _ZodSet extends ZodType {
288956
288956
  _parse(input) {
288957
- const { status, ctx } = this._processInputParams(input);
288957
+ const { status: status2, ctx } = this._processInputParams(input);
288958
288958
  if (ctx.parsedType !== ZodParsedType.set) {
288959
288959
  addIssueToContext(ctx, {
288960
288960
  code: ZodIssueCode.invalid_type,
@@ -288974,7 +288974,7 @@ var init_types2 = __esm({
288974
288974
  exact: false,
288975
288975
  message: def.minSize.message
288976
288976
  });
288977
- status.dirty();
288977
+ status2.dirty();
288978
288978
  }
288979
288979
  }
288980
288980
  if (def.maxSize !== null) {
@@ -288987,7 +288987,7 @@ var init_types2 = __esm({
288987
288987
  exact: false,
288988
288988
  message: def.maxSize.message
288989
288989
  });
288990
- status.dirty();
288990
+ status2.dirty();
288991
288991
  }
288992
288992
  }
288993
288993
  const valueType = this._def.valueType;
@@ -288997,10 +288997,10 @@ var init_types2 = __esm({
288997
288997
  if (element.status === "aborted")
288998
288998
  return INVALID;
288999
288999
  if (element.status === "dirty")
289000
- status.dirty();
289000
+ status2.dirty();
289001
289001
  parsedSet.add(element.value);
289002
289002
  }
289003
- return { status: status.value, value: parsedSet };
289003
+ return { status: status2.value, value: parsedSet };
289004
289004
  }
289005
289005
  const elements = [...ctx.data.values()].map((item, i2) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i2)));
289006
289006
  if (ctx.common.async) {
@@ -289324,15 +289324,15 @@ var init_types2 = __esm({
289324
289324
  return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
289325
289325
  }
289326
289326
  _parse(input) {
289327
- const { status, ctx } = this._processInputParams(input);
289327
+ const { status: status2, ctx } = this._processInputParams(input);
289328
289328
  const effect = this._def.effect || null;
289329
289329
  const checkCtx = {
289330
289330
  addIssue: (arg) => {
289331
289331
  addIssueToContext(ctx, arg);
289332
289332
  if (arg.fatal) {
289333
- status.abort();
289333
+ status2.abort();
289334
289334
  } else {
289335
- status.dirty();
289335
+ status2.dirty();
289336
289336
  }
289337
289337
  },
289338
289338
  get path() {
@@ -289344,7 +289344,7 @@ var init_types2 = __esm({
289344
289344
  const processed = effect.transform(ctx.data, checkCtx);
289345
289345
  if (ctx.common.async) {
289346
289346
  return Promise.resolve(processed).then(async (processed2) => {
289347
- if (status.value === "aborted")
289347
+ if (status2.value === "aborted")
289348
289348
  return INVALID;
289349
289349
  const result = await this._def.schema._parseAsync({
289350
289350
  data: processed2,
@@ -289355,12 +289355,12 @@ var init_types2 = __esm({
289355
289355
  return INVALID;
289356
289356
  if (result.status === "dirty")
289357
289357
  return DIRTY(result.value);
289358
- if (status.value === "dirty")
289358
+ if (status2.value === "dirty")
289359
289359
  return DIRTY(result.value);
289360
289360
  return result;
289361
289361
  });
289362
289362
  } else {
289363
- if (status.value === "aborted")
289363
+ if (status2.value === "aborted")
289364
289364
  return INVALID;
289365
289365
  const result = this._def.schema._parseSync({
289366
289366
  data: processed,
@@ -289371,7 +289371,7 @@ var init_types2 = __esm({
289371
289371
  return INVALID;
289372
289372
  if (result.status === "dirty")
289373
289373
  return DIRTY(result.value);
289374
- if (status.value === "dirty")
289374
+ if (status2.value === "dirty")
289375
289375
  return DIRTY(result.value);
289376
289376
  return result;
289377
289377
  }
@@ -289396,17 +289396,17 @@ var init_types2 = __esm({
289396
289396
  if (inner.status === "aborted")
289397
289397
  return INVALID;
289398
289398
  if (inner.status === "dirty")
289399
- status.dirty();
289399
+ status2.dirty();
289400
289400
  executeRefinement(inner.value);
289401
- return { status: status.value, value: inner.value };
289401
+ return { status: status2.value, value: inner.value };
289402
289402
  } else {
289403
289403
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
289404
289404
  if (inner.status === "aborted")
289405
289405
  return INVALID;
289406
289406
  if (inner.status === "dirty")
289407
- status.dirty();
289407
+ status2.dirty();
289408
289408
  return executeRefinement(inner.value).then(() => {
289409
- return { status: status.value, value: inner.value };
289409
+ return { status: status2.value, value: inner.value };
289410
289410
  });
289411
289411
  });
289412
289412
  }
@@ -289424,13 +289424,13 @@ var init_types2 = __esm({
289424
289424
  if (result instanceof Promise) {
289425
289425
  throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
289426
289426
  }
289427
- return { status: status.value, value: result };
289427
+ return { status: status2.value, value: result };
289428
289428
  } else {
289429
289429
  return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
289430
289430
  if (!isValid(base))
289431
289431
  return INVALID;
289432
289432
  return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
289433
- status: status.value,
289433
+ status: status2.value,
289434
289434
  value: result
289435
289435
  }));
289436
289436
  });
@@ -289608,7 +289608,7 @@ var init_types2 = __esm({
289608
289608
  };
289609
289609
  ZodPipeline = class _ZodPipeline extends ZodType {
289610
289610
  _parse(input) {
289611
- const { status, ctx } = this._processInputParams(input);
289611
+ const { status: status2, ctx } = this._processInputParams(input);
289612
289612
  if (ctx.common.async) {
289613
289613
  const handleAsync = async () => {
289614
289614
  const inResult = await this._def.in._parseAsync({
@@ -289619,7 +289619,7 @@ var init_types2 = __esm({
289619
289619
  if (inResult.status === "aborted")
289620
289620
  return INVALID;
289621
289621
  if (inResult.status === "dirty") {
289622
- status.dirty();
289622
+ status2.dirty();
289623
289623
  return DIRTY(inResult.value);
289624
289624
  } else {
289625
289625
  return this._def.out._parseAsync({
@@ -289639,7 +289639,7 @@ var init_types2 = __esm({
289639
289639
  if (inResult.status === "aborted")
289640
289640
  return INVALID;
289641
289641
  if (inResult.status === "dirty") {
289642
- status.dirty();
289642
+ status2.dirty();
289643
289643
  return {
289644
289644
  status: "dirty",
289645
289645
  value: inResult.value
@@ -305749,8 +305749,8 @@ var init_types3 = __esm({
305749
305749
  });
305750
305750
 
305751
305751
  // ../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js
305752
- function isTerminal(status) {
305753
- return status === "completed" || status === "failed" || status === "cancelled";
305752
+ function isTerminal(status2) {
305753
+ return status2 === "completed" || status2 === "failed" || status2 === "cancelled";
305754
305754
  }
305755
305755
  var init_interfaces = __esm({
305756
305756
  "../../node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js"() {
@@ -307046,8 +307046,8 @@ var init_protocol = __esm({
307046
307046
  }
307047
307047
  return task;
307048
307048
  },
307049
- storeTaskResult: async (taskId, status, result) => {
307050
- await taskStore.storeTaskResult(taskId, status, result, sessionId);
307049
+ storeTaskResult: async (taskId, status2, result) => {
307050
+ await taskStore.storeTaskResult(taskId, status2, result, sessionId);
307051
307051
  const task = await taskStore.getTask(taskId, sessionId);
307052
307052
  if (task) {
307053
307053
  const notification = TaskStatusNotificationSchema.parse({
@@ -307063,15 +307063,15 @@ var init_protocol = __esm({
307063
307063
  getTaskResult: (taskId) => {
307064
307064
  return taskStore.getTaskResult(taskId, sessionId);
307065
307065
  },
307066
- updateTaskStatus: async (taskId, status, statusMessage) => {
307066
+ updateTaskStatus: async (taskId, status2, statusMessage) => {
307067
307067
  const task = await taskStore.getTask(taskId, sessionId);
307068
307068
  if (!task) {
307069
307069
  throw new McpError(ErrorCode.InvalidParams, `Task "${taskId}" not found - it may have been cleaned up`);
307070
307070
  }
307071
307071
  if (isTerminal(task.status)) {
307072
- throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
307072
+ throw new McpError(ErrorCode.InvalidParams, `Cannot update task "${taskId}" from terminal status "${task.status}" to "${status2}". Terminal states (completed, failed, cancelled) cannot transition to other states.`);
307073
307073
  }
307074
- await taskStore.updateTaskStatus(taskId, status, statusMessage, sessionId);
307074
+ await taskStore.updateTaskStatus(taskId, status2, statusMessage, sessionId);
307075
307075
  const updatedTask = await taskStore.getTask(taskId, sessionId);
307076
307076
  if (updatedTask) {
307077
307077
  const notification = TaskStatusNotificationSchema.parse({
@@ -317442,21 +317442,141 @@ var init_connection = __esm({
317442
317442
  }
317443
317443
  });
317444
317444
 
317445
+ // src/commands/runner/daemon.ts
317446
+ 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;
317447
+ var init_daemon = __esm({
317448
+ "src/commands/runner/daemon.ts"() {
317449
+ import_child_process2 = require("child_process");
317450
+ import_fs7 = require("fs");
317451
+ import_promises2 = require("fs/promises");
317452
+ import_os2 = require("os");
317453
+ import_path = require("path");
317454
+ import_util11 = require("util");
317455
+ DEFAULT_SERVICE_NAME = "lambforge-runner";
317456
+ RUNNER_AUTH_EXIT_CODE = 78;
317457
+ systemdQuote = (word) => /^[A-Za-z0-9_@%+=:,./-]+$/.test(word) ? word : `"${word.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`;
317458
+ unitPath = (serviceName, home = (0, import_os2.homedir)()) => (0, import_path.join)(home, ".config", "systemd", "user", `${serviceName}.service`);
317459
+ buildUnit = ({
317460
+ serviceName,
317461
+ execStart,
317462
+ env = {},
317463
+ description = "Lambforge local AI runner"
317464
+ }) => [
317465
+ "[Unit]",
317466
+ `Description=${description} (${serviceName})`,
317467
+ "After=network-online.target",
317468
+ "Wants=network-online.target",
317469
+ "",
317470
+ "[Service]",
317471
+ "Type=simple",
317472
+ `ExecStart=${execStart.map(systemdQuote).join(" ")}`,
317473
+ ...Object.entries(env).map(
317474
+ ([key, value]) => `Environment=${systemdQuote(`${key}=${value}`)}`
317475
+ ),
317476
+ "Restart=always",
317477
+ "RestartSec=5",
317478
+ // A refused token won't fix itself - don't hammer the API with it.
317479
+ `RestartPreventExitStatus=${RUNNER_AUTH_EXIT_CODE}`,
317480
+ "",
317481
+ "[Install]",
317482
+ "WantedBy=default.target",
317483
+ ""
317484
+ ].join("\n");
317485
+ resolveGcliCommand = (argv = process.argv, execPath = process.execPath, isSeaBinary = (() => {
317486
+ try {
317487
+ return require("node:sea").isSea();
317488
+ } catch {
317489
+ return false;
317490
+ }
317491
+ })()) => {
317492
+ if (isSeaBinary) {
317493
+ return { command: [execPath] };
317494
+ }
317495
+ let script = argv[1];
317496
+ try {
317497
+ script = (0, import_fs7.realpathSync)(script);
317498
+ } catch {
317499
+ }
317500
+ const ephemeral = /[/\\]_npx[/\\]|[/\\]\.npm[/\\]_cacache/.test(script);
317501
+ return {
317502
+ command: [execPath, script],
317503
+ 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
317504
+ };
317505
+ };
317506
+ defaultExec = (file2, args) => (0, import_util11.promisify)(import_child_process2.execFile)(file2, args, { encoding: "utf8" });
317507
+ SystemdUserService = class {
317508
+ constructor(serviceName = DEFAULT_SERVICE_NAME, exec2 = defaultExec, home = (0, import_os2.homedir)()) {
317509
+ this.serviceName = serviceName;
317510
+ this.exec = exec2;
317511
+ this.home = home;
317512
+ }
317513
+ get unit() {
317514
+ return `${this.serviceName}.service`;
317515
+ }
317516
+ /** install -> daemon-reload -> enable -> restart (picks up a changed unit). */
317517
+ async install(unitContent) {
317518
+ const path2 = unitPath(this.serviceName, this.home);
317519
+ await (0, import_promises2.mkdir)((0, import_path.join)(path2, ".."), { recursive: true });
317520
+ await (0, import_promises2.writeFile)(path2, unitContent, "utf-8");
317521
+ await this.systemctl("daemon-reload");
317522
+ await this.systemctl("enable", this.unit);
317523
+ await this.systemctl("restart", this.unit);
317524
+ return path2;
317525
+ }
317526
+ async uninstall() {
317527
+ await this.systemctl("disable", "--now", this.unit).catch(() => void 0);
317528
+ const path2 = unitPath(this.serviceName, this.home);
317529
+ await (0, import_promises2.rm)(path2, { force: true });
317530
+ await this.systemctl("daemon-reload");
317531
+ return path2;
317532
+ }
317533
+ async status() {
317534
+ return this.systemctl("status", "--no-pager", "--lines=15", this.unit).then((r2) => r2.stdout).catch((e2) => e2.stdout || e2.message);
317535
+ }
317536
+ /** Whether the service keeps running after logout / starts at boot. */
317537
+ async lingerEnabled(user = process.env.USER) {
317538
+ try {
317539
+ const { stdout } = await this.exec("loginctl", [
317540
+ "show-user",
317541
+ user,
317542
+ "--property=Linger"
317543
+ ]);
317544
+ return /Linger=yes/.test(stdout);
317545
+ } catch {
317546
+ return false;
317547
+ }
317548
+ }
317549
+ systemctl(...args) {
317550
+ return this.exec("systemctl", ["--user", ...args]);
317551
+ }
317552
+ };
317553
+ assertSystemdAvailable = () => {
317554
+ if (process.platform !== "linux") {
317555
+ throw new Error(
317556
+ `runner:daemon uses systemd and is Linux-only for now (this is ${process.platform}). Run \`gcli runner:start\` under your own process manager meanwhile.`
317557
+ );
317558
+ }
317559
+ };
317560
+ }
317561
+ });
317562
+
317445
317563
  // src/commands/runner/start.ts
317446
317564
  var start_exports2 = {};
317447
317565
  __export(start_exports2, {
317448
317566
  RUNNER_VERSION: () => RUNNER_VERSION,
317449
- default: () => start_default
317567
+ default: () => start_default,
317568
+ resolveRunner: () => resolveRunner
317450
317569
  });
317451
- var import_os2, import_rxjs35, RUNNER_VERSION, resolveRunner, start_default;
317570
+ var import_os3, import_rxjs35, RUNNER_VERSION, resolveRunner, start_default;
317452
317571
  var init_start2 = __esm({
317453
317572
  "src/commands/runner/start.ts"() {
317454
- import_os2 = require("os");
317573
+ import_os3 = require("os");
317455
317574
  import_rxjs35 = __toESM(require_cjs());
317456
317575
  init_gql_client();
317457
317576
  init_log();
317458
317577
  init_config();
317459
317578
  init_connection();
317579
+ init_daemon();
317460
317580
  init_ollama();
317461
317581
  RUNNER_VERSION = "gcli-runner/1";
317462
317582
  resolveRunner = async (cmd) => {
@@ -317470,7 +317590,7 @@ var init_start2 = __esm({
317470
317590
  if (saved) {
317471
317591
  return saved;
317472
317592
  }
317473
- const name2 = cmd.name || (0, import_os2.hostname)();
317593
+ const name2 = cmd.name || (0, import_os3.hostname)();
317474
317594
  Logger.info(`Registering this machine as local runner "${name2}"...`);
317475
317595
  const { runner, token } = await (0, import_rxjs35.lastValueFrom)(
317476
317596
  GraphqlClienAPI.createLocalRunner(name2)
@@ -317513,7 +317633,7 @@ var init_start2 = __esm({
317513
317633
  } catch (e2) {
317514
317634
  if (e2 instanceof RunnerAuthError) {
317515
317635
  Logger.error(e2.message);
317516
- process.exit(1);
317636
+ process.exit(RUNNER_AUTH_EXIT_CODE);
317517
317637
  }
317518
317638
  throw e2;
317519
317639
  }
@@ -317521,6 +317641,99 @@ var init_start2 = __esm({
317521
317641
  }
317522
317642
  });
317523
317643
 
317644
+ // src/commands/runner/daemon-commands.ts
317645
+ var daemon_commands_exports = {};
317646
+ __export(daemon_commands_exports, {
317647
+ install: () => install,
317648
+ logs: () => logs,
317649
+ status: () => status,
317650
+ uninstall: () => uninstall
317651
+ });
317652
+ var import_child_process3, install, uninstall, status, logs;
317653
+ var init_daemon_commands = __esm({
317654
+ "src/commands/runner/daemon-commands.ts"() {
317655
+ import_child_process3 = require("child_process");
317656
+ init_log();
317657
+ init_config();
317658
+ init_daemon();
317659
+ init_ollama();
317660
+ init_start2();
317661
+ install = async (cmd) => {
317662
+ assertSystemdAvailable();
317663
+ const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
317664
+ const { command, warning } = resolveGcliCommand();
317665
+ if (warning) {
317666
+ Logger.warn(warning);
317667
+ }
317668
+ const ollamaUrl = resolveOllamaUrl(cmd.ollama);
317669
+ const execStart = [
317670
+ ...command,
317671
+ "runner:start",
317672
+ "--ollama",
317673
+ ollamaUrl,
317674
+ ...cmd.wsUrl ? ["--wsUrl", cmd.wsUrl] : []
317675
+ ];
317676
+ const unit = buildUnit({ serviceName, execStart });
317677
+ if (cmd.dryRun) {
317678
+ Logger.info(`Would write ${unitPath(serviceName)}:`);
317679
+ console.log(unit);
317680
+ return;
317681
+ }
317682
+ if (cmd.token) {
317683
+ if (cmd.reset) {
317684
+ await forgetRunner();
317685
+ }
317686
+ await saveRunner({
317687
+ id: "(from --token)",
317688
+ name: cmd.name ?? "",
317689
+ token: cmd.token,
317690
+ wsUrl: cmd.wsUrl
317691
+ });
317692
+ } else {
317693
+ await resolveRunner({ name: cmd.name, reset: cmd.reset });
317694
+ }
317695
+ const runner = await readSavedRunner();
317696
+ const systemd = new SystemdUserService(serviceName);
317697
+ const path2 = await systemd.install(unit);
317698
+ Logger.log(
317699
+ `Runner "${runner?.name || runner?.id}" installed as systemd user service ${serviceName} (${path2}) and started.`
317700
+ );
317701
+ Logger.info(
317702
+ `Status: gcli runner:daemon:status Logs: gcli runner:daemon:logs`
317703
+ );
317704
+ if (!await systemd.lingerEnabled()) {
317705
+ Logger.warn(
317706
+ `It stops when you log out and starts at your next login. To keep it running and start it at boot: sudo loginctl enable-linger ${process.env.USER ?? "$USER"}`
317707
+ );
317708
+ }
317709
+ };
317710
+ uninstall = async (cmd) => {
317711
+ assertSystemdAvailable();
317712
+ const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
317713
+ const path2 = await new SystemdUserService(serviceName).uninstall();
317714
+ Logger.log(
317715
+ `Stopped and removed ${serviceName} (${path2}). The runner itself is still registered - \`gcli runner:delete\` revokes it.`
317716
+ );
317717
+ };
317718
+ status = async (cmd) => {
317719
+ assertSystemdAvailable();
317720
+ const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
317721
+ console.log(await new SystemdUserService(serviceName).status());
317722
+ };
317723
+ logs = (cmd) => {
317724
+ assertSystemdAvailable();
317725
+ const serviceName = cmd.service || DEFAULT_SERVICE_NAME;
317726
+ return new Promise((resolve) => {
317727
+ (0, import_child_process3.spawn)(
317728
+ "journalctl",
317729
+ ["--user", "-u", `${serviceName}.service`, "-f", "-n", cmd.lines || "50"],
317730
+ { stdio: "inherit" }
317731
+ ).on("exit", () => resolve());
317732
+ });
317733
+ };
317734
+ }
317735
+ });
317736
+
317524
317737
  // src/commands/runner/list.ts
317525
317738
  var list_exports6 = {};
317526
317739
  __export(list_exports6, {
@@ -318259,6 +318472,23 @@ function registerRunnerCommands(program2) {
318259
318472
  "--ollama <url>",
318260
318473
  "Ollama URL (default: $OLLAMA_HOST or http://127.0.0.1:11434)"
318261
318474
  ).option("--wsUrl <url>", "Lambforge subscriptions endpoint override").option("--reset", "Forget the saved runner and register a new one").action(lazy(() => Promise.resolve().then(() => (init_start2(), start_exports2)).then((m2) => m2.default)));
318475
+ program2.command("runner:daemon:install").alias("runner:start:daemon").description(
318476
+ "Run the runner in the background as a systemd user service: starts with your session, restarts on failure (Linux)"
318477
+ ).option(
318478
+ "-n, --name <name>",
318479
+ "Runner name when registering (default: hostname)"
318480
+ ).option(
318481
+ "-t, --token <token>",
318482
+ "Runner token for a machine without `gcli login`"
318483
+ ).option(
318484
+ "--ollama <url>",
318485
+ "Ollama URL (default: $OLLAMA_HOST or http://127.0.0.1:11434)"
318486
+ ).option("--wsUrl <url>", "Lambforge subscriptions endpoint override").option("--reset", "Forget the saved runner and register a new one").option("--service <name>", "systemd unit name (default: lambforge-runner)").option("--dry-run", "Print the unit file instead of installing it").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.install)));
318487
+ program2.command("runner:daemon:status").description("Show the runner service status (systemctl --user status)").option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.status)));
318488
+ program2.command("runner:daemon:logs").description("Follow the runner service log (journalctl --user -f)").option("--service <name>", "systemd unit name (default: lambforge-runner)").option("--lines <n>", "Lines of history to show first (default 50)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.logs)));
318489
+ program2.command("runner:daemon:uninstall").description(
318490
+ "Stop and remove the runner service (the runner stays registered)"
318491
+ ).option("--service <name>", "systemd unit name (default: lambforge-runner)").action(lazy(() => Promise.resolve().then(() => (init_daemon_commands(), daemon_commands_exports)).then((m2) => m2.uninstall)));
318262
318492
  program2.command("runner:list").description("List your local AI runners and the models they serve").action(lazy(() => Promise.resolve().then(() => (init_list6(), list_exports6)).then((m2) => m2.default)));
318263
318493
  program2.command("runner:models").description(
318264
318494
  "Choose which of a runner's models appear in the chat model picker (no flags: list them)"