@coana-tech/cli 14.12.143 → 14.12.144

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/cli.mjs CHANGED
@@ -14866,8 +14866,8 @@ var require_utils = __commonJS({
14866
14866
  exports2.toPosixSlashes = (str) => str.replace(REGEX_BACKSLASH, "/");
14867
14867
  exports2.isWindows = () => {
14868
14868
  if (typeof navigator !== "undefined" && navigator.platform) {
14869
- const platform7 = navigator.platform.toLowerCase();
14870
- return platform7 === "win32" || platform7 === "windows";
14869
+ const platform9 = navigator.platform.toLowerCase();
14870
+ return platform9 === "win32" || platform9 === "windows";
14871
14871
  }
14872
14872
  if (typeof process !== "undefined" && process.platform) {
14873
14873
  return process.platform === "win32";
@@ -54897,7 +54897,7 @@ var require_lib12 = __commonJS({
54897
54897
  var MurmurHash3 = require_imurmurhash();
54898
54898
  var { onExit } = require_cjs2();
54899
54899
  var path9 = __require("path");
54900
- var { promisify: promisify2 } = __require("util");
54900
+ var { promisify: promisify4 } = __require("util");
54901
54901
  var activeFiles = {};
54902
54902
  var threadId = function getId() {
54903
54903
  try {
@@ -54952,10 +54952,10 @@ var require_lib12 = __commonJS({
54952
54952
  const absoluteName = path9.resolve(filename);
54953
54953
  try {
54954
54954
  await serializeActiveFile(absoluteName);
54955
- const truename = await promisify2(fs11.realpath)(filename).catch(() => filename);
54955
+ const truename = await promisify4(fs11.realpath)(filename).catch(() => filename);
54956
54956
  tmpfile = getTmpname(truename);
54957
54957
  if (!options.mode || !options.chown) {
54958
- const stats = await promisify2(fs11.stat)(truename).catch(() => {
54958
+ const stats = await promisify4(fs11.stat)(truename).catch(() => {
54959
54959
  });
54960
54960
  if (stats) {
54961
54961
  if (options.mode == null) {
@@ -54966,45 +54966,45 @@ var require_lib12 = __commonJS({
54966
54966
  }
54967
54967
  }
54968
54968
  }
54969
- fd = await promisify2(fs11.open)(tmpfile, "w", options.mode);
54969
+ fd = await promisify4(fs11.open)(tmpfile, "w", options.mode);
54970
54970
  if (options.tmpfileCreated) {
54971
54971
  await options.tmpfileCreated(tmpfile);
54972
54972
  }
54973
54973
  if (ArrayBuffer.isView(data2)) {
54974
- await promisify2(fs11.write)(fd, data2, 0, data2.length, 0);
54974
+ await promisify4(fs11.write)(fd, data2, 0, data2.length, 0);
54975
54975
  } else if (data2 != null) {
54976
- await promisify2(fs11.write)(fd, String(data2), 0, String(options.encoding || "utf8"));
54976
+ await promisify4(fs11.write)(fd, String(data2), 0, String(options.encoding || "utf8"));
54977
54977
  }
54978
54978
  if (options.fsync !== false) {
54979
- await promisify2(fs11.fsync)(fd);
54979
+ await promisify4(fs11.fsync)(fd);
54980
54980
  }
54981
- await promisify2(fs11.close)(fd);
54981
+ await promisify4(fs11.close)(fd);
54982
54982
  fd = null;
54983
54983
  if (options.chown) {
54984
- await promisify2(fs11.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => {
54984
+ await promisify4(fs11.chown)(tmpfile, options.chown.uid, options.chown.gid).catch((err) => {
54985
54985
  if (!isChownErrOk(err)) {
54986
54986
  throw err;
54987
54987
  }
54988
54988
  });
54989
54989
  }
54990
54990
  if (options.mode) {
54991
- await promisify2(fs11.chmod)(tmpfile, options.mode).catch((err) => {
54991
+ await promisify4(fs11.chmod)(tmpfile, options.mode).catch((err) => {
54992
54992
  if (!isChownErrOk(err)) {
54993
54993
  throw err;
54994
54994
  }
54995
54995
  });
54996
54996
  }
54997
- await promisify2(fs11.rename)(tmpfile, truename);
54997
+ await promisify4(fs11.rename)(tmpfile, truename);
54998
54998
  } finally {
54999
54999
  if (fd) {
55000
- await promisify2(fs11.close)(fd).catch(
55000
+ await promisify4(fs11.close)(fd).catch(
55001
55001
  /* istanbul ignore next */
55002
55002
  () => {
55003
55003
  }
55004
55004
  );
55005
55005
  }
55006
55006
  removeOnExitHandler();
55007
- await promisify2(fs11.unlink)(tmpfile).catch(() => {
55007
+ await promisify4(fs11.unlink)(tmpfile).catch(() => {
55008
55008
  });
55009
55009
  activeFiles[absoluteName].shift();
55010
55010
  if (activeFiles[absoluteName].length > 0) {
@@ -56426,8 +56426,8 @@ var require_path_key = __commonJS({
56426
56426
  "use strict";
56427
56427
  var pathKey = (options = {}) => {
56428
56428
  const environment = options.env || process.env;
56429
- const platform7 = options.platform || process.platform;
56430
- if (platform7 !== "win32") {
56429
+ const platform9 = options.platform || process.platform;
56430
+ if (platform9 !== "win32") {
56431
56431
  return "PATH";
56432
56432
  }
56433
56433
  return Object.keys(environment).reverse().find((key) => key.toUpperCase() === "PATH") || "Path";
@@ -57410,9 +57410,9 @@ var require_get_stream = __commonJS({
57410
57410
  "use strict";
57411
57411
  var { constants: BufferConstants } = __require("buffer");
57412
57412
  var stream5 = __require("stream");
57413
- var { promisify: promisify2 } = __require("util");
57413
+ var { promisify: promisify4 } = __require("util");
57414
57414
  var bufferStream = require_buffer_stream();
57415
- var streamPipelinePromisified = promisify2(stream5.pipeline);
57415
+ var streamPipelinePromisified = promisify4(stream5.pipeline);
57416
57416
  var MaxBufferError = class extends Error {
57417
57417
  constructor() {
57418
57418
  super("maxBuffer exceeded");
@@ -62590,7 +62590,7 @@ var require_promisify = __commonJS({
62590
62590
  "../../node_modules/.pnpm/agent-base@6.0.2/node_modules/agent-base/dist/src/promisify.js"(exports2) {
62591
62591
  "use strict";
62592
62592
  Object.defineProperty(exports2, "__esModule", { value: true });
62593
- function promisify2(fn2) {
62593
+ function promisify4(fn2) {
62594
62594
  return function(req, opts) {
62595
62595
  return new Promise((resolve45, reject) => {
62596
62596
  fn2.call(this, req, opts, (err, rtn) => {
@@ -62603,7 +62603,7 @@ var require_promisify = __commonJS({
62603
62603
  });
62604
62604
  };
62605
62605
  }
62606
- exports2.default = promisify2;
62606
+ exports2.default = promisify4;
62607
62607
  }
62608
62608
  });
62609
62609
 
@@ -70346,9 +70346,9 @@ var require_lockfile = __commonJS({
70346
70346
  const SINGLE_INSTANCE_PORT = exports3.SINGLE_INSTANCE_PORT = 31997;
70347
70347
  const SINGLE_INSTANCE_FILENAME = exports3.SINGLE_INSTANCE_FILENAME = ".yarn-single-instance";
70348
70348
  const ENV_PATH_KEY = exports3.ENV_PATH_KEY = getPathKey(process.platform, process.env);
70349
- function getPathKey(platform7, env) {
70349
+ function getPathKey(platform9, env) {
70350
70350
  let pathKey = "PATH";
70351
- if (platform7 === "win32") {
70351
+ if (platform9 === "win32") {
70352
70352
  pathKey = "Path";
70353
70353
  for (const key in env) {
70354
70354
  if (key.toLowerCase() === "path") {
@@ -70950,14 +70950,14 @@ var require_lockfile = __commonJS({
70950
70950
  value: true
70951
70951
  });
70952
70952
  exports3.wait = wait;
70953
- exports3.promisify = promisify2;
70953
+ exports3.promisify = promisify4;
70954
70954
  exports3.queue = queue;
70955
70955
  function wait(delay) {
70956
70956
  return new Promise((resolve45) => {
70957
70957
  setTimeout(resolve45, delay);
70958
70958
  });
70959
70959
  }
70960
- function promisify2(fn2, firstData) {
70960
+ function promisify4(fn2, firstData) {
70961
70961
  return function(...args2) {
70962
70962
  return new Promise(function(resolve45, reject) {
70963
70963
  args2.push(function(err, ...result) {
@@ -115435,7 +115435,7 @@ var require_mock_interceptor = __commonJS({
115435
115435
  var require_mock_client = __commonJS({
115436
115436
  "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-client.js"(exports2, module2) {
115437
115437
  "use strict";
115438
- var { promisify: promisify2 } = __require("util");
115438
+ var { promisify: promisify4 } = __require("util");
115439
115439
  var Client = require_client();
115440
115440
  var { buildMockDispatch } = require_mock_utils();
115441
115441
  var {
@@ -115475,7 +115475,7 @@ var require_mock_client = __commonJS({
115475
115475
  return new MockInterceptor(opts, this[kDispatches]);
115476
115476
  }
115477
115477
  async [kClose]() {
115478
- await promisify2(this[kOriginalClose])();
115478
+ await promisify4(this[kOriginalClose])();
115479
115479
  this[kConnected] = 0;
115480
115480
  this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
115481
115481
  }
@@ -115488,7 +115488,7 @@ var require_mock_client = __commonJS({
115488
115488
  var require_mock_pool = __commonJS({
115489
115489
  "../../node_modules/.pnpm/undici@5.28.5/node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) {
115490
115490
  "use strict";
115491
- var { promisify: promisify2 } = __require("util");
115491
+ var { promisify: promisify4 } = __require("util");
115492
115492
  var Pool = require_pool();
115493
115493
  var { buildMockDispatch } = require_mock_utils();
115494
115494
  var {
@@ -115528,7 +115528,7 @@ var require_mock_pool = __commonJS({
115528
115528
  return new MockInterceptor(opts, this[kDispatches]);
115529
115529
  }
115530
115530
  async [kClose]() {
115531
- await promisify2(this[kOriginalClose])();
115531
+ await promisify4(this[kOriginalClose])();
115532
115532
  this[kConnected] = 0;
115533
115533
  this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
115534
115534
  }
@@ -126338,13 +126338,13 @@ var require_tmp = __commonJS({
126338
126338
  var require_tmp_promise = __commonJS({
126339
126339
  "../../node_modules/.pnpm/tmp-promise@3.0.3/node_modules/tmp-promise/index.js"(exports2, module2) {
126340
126340
  "use strict";
126341
- var { promisify: promisify2 } = __require("util");
126341
+ var { promisify: promisify4 } = __require("util");
126342
126342
  var tmp = require_tmp();
126343
126343
  module2.exports.fileSync = tmp.fileSync;
126344
- var fileWithOptions = promisify2(
126344
+ var fileWithOptions = promisify4(
126345
126345
  (options, cb) => tmp.file(
126346
126346
  options,
126347
- (err, path9, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path9, fd, cleanup: promisify2(cleanup) })
126347
+ (err, path9, fd, cleanup) => err ? cb(err) : cb(void 0, { path: path9, fd, cleanup: promisify4(cleanup) })
126348
126348
  )
126349
126349
  );
126350
126350
  module2.exports.file = async (options) => fileWithOptions(options);
@@ -126357,10 +126357,10 @@ var require_tmp_promise = __commonJS({
126357
126357
  }
126358
126358
  };
126359
126359
  module2.exports.dirSync = tmp.dirSync;
126360
- var dirWithOptions = promisify2(
126360
+ var dirWithOptions = promisify4(
126361
126361
  (options, cb) => tmp.dir(
126362
126362
  options,
126363
- (err, path9, cleanup) => err ? cb(err) : cb(void 0, { path: path9, cleanup: promisify2(cleanup) })
126363
+ (err, path9, cleanup) => err ? cb(err) : cb(void 0, { path: path9, cleanup: promisify4(cleanup) })
126364
126364
  )
126365
126365
  );
126366
126366
  module2.exports.dir = async (options) => dirWithOptions(options);
@@ -126373,7 +126373,7 @@ var require_tmp_promise = __commonJS({
126373
126373
  }
126374
126374
  };
126375
126375
  module2.exports.tmpNameSync = tmp.tmpNameSync;
126376
- module2.exports.tmpName = promisify2(tmp.tmpName);
126376
+ module2.exports.tmpName = promisify4(tmp.tmpName);
126377
126377
  module2.exports.tmpdir = tmp.tmpdir;
126378
126378
  module2.exports.setGracefulCleanup = tmp.setGracefulCleanup;
126379
126379
  }
@@ -138729,7 +138729,7 @@ var require_mock_interceptor2 = __commonJS({
138729
138729
  var require_mock_client2 = __commonJS({
138730
138730
  "../../node_modules/.pnpm/undici@6.21.2/node_modules/undici/lib/mock/mock-client.js"(exports2, module2) {
138731
138731
  "use strict";
138732
- var { promisify: promisify2 } = __require("node:util");
138732
+ var { promisify: promisify4 } = __require("node:util");
138733
138733
  var Client = require_client2();
138734
138734
  var { buildMockDispatch } = require_mock_utils2();
138735
138735
  var {
@@ -138769,7 +138769,7 @@ var require_mock_client2 = __commonJS({
138769
138769
  return new MockInterceptor(opts, this[kDispatches]);
138770
138770
  }
138771
138771
  async [kClose]() {
138772
- await promisify2(this[kOriginalClose])();
138772
+ await promisify4(this[kOriginalClose])();
138773
138773
  this[kConnected] = 0;
138774
138774
  this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
138775
138775
  }
@@ -138782,7 +138782,7 @@ var require_mock_client2 = __commonJS({
138782
138782
  var require_mock_pool2 = __commonJS({
138783
138783
  "../../node_modules/.pnpm/undici@6.21.2/node_modules/undici/lib/mock/mock-pool.js"(exports2, module2) {
138784
138784
  "use strict";
138785
- var { promisify: promisify2 } = __require("node:util");
138785
+ var { promisify: promisify4 } = __require("node:util");
138786
138786
  var Pool = require_pool2();
138787
138787
  var { buildMockDispatch } = require_mock_utils2();
138788
138788
  var {
@@ -138822,7 +138822,7 @@ var require_mock_pool2 = __commonJS({
138822
138822
  return new MockInterceptor(opts, this[kDispatches]);
138823
138823
  }
138824
138824
  async [kClose]() {
138825
- await promisify2(this[kOriginalClose])();
138825
+ await promisify4(this[kOriginalClose])();
138826
138826
  this[kConnected] = 0;
138827
138827
  this[kMockAgent][Symbols.kClients].delete(this[kOrigin]);
138828
138828
  }
@@ -180870,7 +180870,7 @@ var require_client_metadata = __commonJS({
180870
180870
  const name3 = Buffer.byteLength(appName, "utf8") <= 128 ? options.appName : Buffer.from(appName, "utf8").subarray(0, 128).toString("utf8");
180871
180871
  metadataDocument.ifItFitsItSits("application", { name: name3 });
180872
180872
  }
180873
- const { name: name2 = "", version: version4 = "", platform: platform7 = "" } = options.driverInfo;
180873
+ const { name: name2 = "", version: version4 = "", platform: platform9 = "" } = options.driverInfo;
180874
180874
  const driverInfo = {
180875
180875
  name: name2.length > 0 ? `nodejs|${name2}` : "nodejs",
180876
180876
  version: version4.length > 0 ? `${NODE_DRIVER_VERSION}|${version4}` : NODE_DRIVER_VERSION
@@ -180879,8 +180879,8 @@ var require_client_metadata = __commonJS({
180879
180879
  throw new error_1.MongoInvalidArgumentError("Unable to include driverInfo name and version, metadata cannot exceed 512 bytes");
180880
180880
  }
180881
180881
  let runtimeInfo = getRuntimeInfo();
180882
- if (platform7.length > 0) {
180883
- runtimeInfo = `${runtimeInfo}|${platform7}`;
180882
+ if (platform9.length > 0) {
180883
+ runtimeInfo = `${runtimeInfo}|${platform9}`;
180884
180884
  }
180885
180885
  if (!metadataDocument.ifItFitsItSits("platform", runtimeInfo)) {
180886
180886
  throw new error_1.MongoInvalidArgumentError("Unable to include driverInfo platform, metadata cannot exceed 512 bytes");
@@ -199530,14 +199530,14 @@ var require_axios = __commonJS({
199530
199530
  navigator: _navigator2,
199531
199531
  origin: origin2
199532
199532
  });
199533
- var platform7 = {
199533
+ var platform9 = {
199534
199534
  ...utils,
199535
199535
  ...platform$1
199536
199536
  };
199537
199537
  function toURLEncodedForm2(data2, options) {
199538
- return toFormData3(data2, new platform7.classes.URLSearchParams(), {
199538
+ return toFormData3(data2, new platform9.classes.URLSearchParams(), {
199539
199539
  visitor: function(value2, key, path9, helpers) {
199540
- if (platform7.isNode && utils$1.isBuffer(value2)) {
199540
+ if (platform9.isNode && utils$1.isBuffer(value2)) {
199541
199541
  this.append(key, value2.toString("base64"));
199542
199542
  return false;
199543
199543
  }
@@ -199686,8 +199686,8 @@ var require_axios = __commonJS({
199686
199686
  maxContentLength: -1,
199687
199687
  maxBodyLength: -1,
199688
199688
  env: {
199689
- FormData: platform7.classes.FormData,
199690
- Blob: platform7.classes.Blob
199689
+ FormData: platform9.classes.FormData,
199690
+ Blob: platform9.classes.Blob
199691
199691
  },
199692
199692
  validateStatus: function validateStatus2(status) {
199693
199693
  return status >= 200 && status < 300;
@@ -200028,7 +200028,7 @@ var require_axios = __commonJS({
200028
200028
  }
200029
200029
  var DATA_URL_PATTERN2 = /^(?:([^;]+);)?(?:[^;]+;)?(base64|),([\s\S]*)$/;
200030
200030
  function fromDataURI2(uri, asBlob, options) {
200031
- const _Blob = options && options.Blob || platform7.classes.Blob;
200031
+ const _Blob = options && options.Blob || platform9.classes.Blob;
200032
200032
  const protocol = parseProtocol2(uri);
200033
200033
  if (asBlob === void 0 && _Blob) {
200034
200034
  asBlob = true;
@@ -200178,7 +200178,7 @@ var require_axios = __commonJS({
200178
200178
  }
200179
200179
  };
200180
200180
  var readBlob$1 = readBlob2;
200181
- var BOUNDARY_ALPHABET2 = platform7.ALPHABET.ALPHA_DIGIT + "-_";
200181
+ var BOUNDARY_ALPHABET2 = platform9.ALPHABET.ALPHA_DIGIT + "-_";
200182
200182
  var textEncoder2 = typeof TextEncoder === "function" ? new TextEncoder() : new util__default["default"].TextEncoder();
200183
200183
  var CRLF2 = "\r\n";
200184
200184
  var CRLF_BYTES2 = textEncoder2.encode(CRLF2);
@@ -200221,7 +200221,7 @@ var require_axios = __commonJS({
200221
200221
  const {
200222
200222
  tag = "form-data-boundary",
200223
200223
  size = 25,
200224
- boundary = tag + "-" + platform7.generateString(size, BOUNDARY_ALPHABET2)
200224
+ boundary = tag + "-" + platform9.generateString(size, BOUNDARY_ALPHABET2)
200225
200225
  } = options || {};
200226
200226
  if (!utils$1.isFormData(form)) {
200227
200227
  throw TypeError("FormData instance required");
@@ -200445,7 +200445,7 @@ var require_axios = __commonJS({
200445
200445
  var isBrotliSupported2 = utils$1.isFunction(zlib__default["default"].createBrotliDecompress);
200446
200446
  var { http: httpFollow2, https: httpsFollow2 } = followRedirects__default["default"];
200447
200447
  var isHttps2 = /https:?/;
200448
- var supportedProtocols2 = platform7.protocols.map((protocol) => {
200448
+ var supportedProtocols2 = platform9.protocols.map((protocol) => {
200449
200449
  return protocol + ":";
200450
200450
  });
200451
200451
  var flushOnFinish2 = (stream6, [throttled, flush]) => {
@@ -200572,7 +200572,7 @@ var require_axios = __commonJS({
200572
200572
  }
200573
200573
  }
200574
200574
  const fullPath = buildFullPath2(config3.baseURL, config3.url, config3.allowAbsoluteUrls);
200575
- const parsed = new URL(fullPath, platform7.hasBrowserEnv ? platform7.origin : void 0);
200575
+ const parsed = new URL(fullPath, platform9.hasBrowserEnv ? platform9.origin : void 0);
200576
200576
  const protocol = parsed.protocol || supportedProtocols2[0];
200577
200577
  if (protocol === "data:") {
200578
200578
  if (config3.maxContentLength > -1) {
@@ -200944,14 +200944,14 @@ var require_axios = __commonJS({
200944
200944
  }
200945
200945
  });
200946
200946
  };
200947
- var isURLSameOrigin = platform7.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin3, isMSIE) => (url3) => {
200948
- url3 = new URL(url3, platform7.origin);
200947
+ var isURLSameOrigin = platform9.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin3, isMSIE) => (url3) => {
200948
+ url3 = new URL(url3, platform9.origin);
200949
200949
  return origin3.protocol === url3.protocol && origin3.host === url3.host && (isMSIE || origin3.port === url3.port);
200950
200950
  })(
200951
- new URL(platform7.origin),
200952
- platform7.navigator && /(msie|trident)/i.test(platform7.navigator.userAgent)
200951
+ new URL(platform9.origin),
200952
+ platform9.navigator && /(msie|trident)/i.test(platform9.navigator.userAgent)
200953
200953
  ) : () => true;
200954
- var cookies = platform7.hasStandardBrowserEnv ? (
200954
+ var cookies = platform9.hasStandardBrowserEnv ? (
200955
200955
  // Standard browser envs support document.cookie
200956
200956
  {
200957
200957
  write(name2, value2, expires, path9, domain, secure) {
@@ -201072,7 +201072,7 @@ var require_axios = __commonJS({
201072
201072
  );
201073
201073
  }
201074
201074
  if (utils$1.isFormData(data2)) {
201075
- if (platform7.hasStandardBrowserEnv || platform7.hasStandardBrowserWebWorkerEnv) {
201075
+ if (platform9.hasStandardBrowserEnv || platform9.hasStandardBrowserWebWorkerEnv) {
201076
201076
  headers.setContentType(void 0);
201077
201077
  } else if (utils$1.isFunction(data2.getHeaders)) {
201078
201078
  const formHeaders = data2.getHeaders();
@@ -201084,7 +201084,7 @@ var require_axios = __commonJS({
201084
201084
  });
201085
201085
  }
201086
201086
  }
201087
- if (platform7.hasStandardBrowserEnv) {
201087
+ if (platform9.hasStandardBrowserEnv) {
201088
201088
  withXSRFToken && utils$1.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));
201089
201089
  if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin(newConfig.url)) {
201090
201090
  const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);
@@ -201216,7 +201216,7 @@ var require_axios = __commonJS({
201216
201216
  }
201217
201217
  }
201218
201218
  const protocol = parseProtocol2(_config.url);
201219
- if (protocol && platform7.protocols.indexOf(protocol) === -1) {
201219
+ if (protocol && platform9.protocols.indexOf(protocol) === -1) {
201220
201220
  reject(new AxiosError3("Unsupported protocol " + protocol + ":", AxiosError3.ERR_BAD_REQUEST, config3));
201221
201221
  return;
201222
201222
  }
@@ -201362,7 +201362,7 @@ var require_axios = __commonJS({
201362
201362
  const encodeText = isFetchSupported && (typeof TextEncoder$1 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder$1()) : async (str) => new Uint8Array(await new Request(str).arrayBuffer()));
201363
201363
  const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test2(() => {
201364
201364
  let duplexAccessed = false;
201365
- const hasContentType = new Request(platform7.origin, {
201365
+ const hasContentType = new Request(platform9.origin, {
201366
201366
  body: new ReadableStream$1(),
201367
201367
  method: "POST",
201368
201368
  get duplex() {
@@ -201395,7 +201395,7 @@ var require_axios = __commonJS({
201395
201395
  return body.size;
201396
201396
  }
201397
201397
  if (utils$1.isSpecCompliantForm(body)) {
201398
- const _request = new Request(platform7.origin, {
201398
+ const _request = new Request(platform9.origin, {
201399
201399
  method: "POST",
201400
201400
  body
201401
201401
  });
@@ -208145,15 +208145,6 @@ var import_picomatch = __toESM(require_picomatch2(), 1);
208145
208145
  import { readFile as readFile2 } from "node:fs/promises";
208146
208146
  import { join } from "node:path";
208147
208147
 
208148
- // ../web-compat-utils/src/ghsa.ts
208149
- function extractGHSAIdFromUrl(url2) {
208150
- const match2 = url2.match(/(GHSA-[a-z0-9-]+)/);
208151
- if (match2) {
208152
- return match2[1];
208153
- }
208154
- return void 0;
208155
- }
208156
-
208157
208148
  // ../web-compat-utils/src/logger-singleton.ts
208158
208149
  var import_winston = __toESM(require_winston(), 1);
208159
208150
  import { Console } from "console";
@@ -209149,30 +209140,7 @@ async function registerCLIProgressSocket(isStartEvent, cliProgressEvent, tier1Sc
209149
209140
  handleError(error, "Error registering CLI progress", false);
209150
209141
  }
209151
209142
  }
209152
- async function registerAnalysisMetadataSocket(subprojectPath, workspacePath, ecosystem, analysisMetadata, tier1ScanId) {
209153
- if (!tier1ScanId) {
209154
- return;
209155
- }
209156
- const abnormalExit = analysisMetadata.analysisDiagnostics.aborted ? "ABORTED" : analysisMetadata.analysisDiagnostics.timeout ? "TIMEOUT" : "NONE";
209157
- try {
209158
- const url2 = getSocketApiUrl("tier1-reachability-scan/analysis-metadata");
209159
- const data2 = {
209160
- tier1_reachability_scan_id: tier1ScanId,
209161
- subproject_path: subprojectPath,
209162
- workspace_path: workspacePath,
209163
- ghsa_ids: analysisMetadata.vulnUrls.map((vUrl) => extractGHSAIdFromUrl(vUrl)).filter((ghsaId) => ghsaId !== void 0),
209164
- analysis_diagnostics: analysisMetadata.analysisDiagnostics,
209165
- heuristic_name: analysisMetadata.heuristicName,
209166
- is_final_result: analysisMetadata.finalResult,
209167
- purl_type: getPurlType(ecosystem),
209168
- error_message: analysisMetadata.errorMessage,
209169
- experiment_name: analysisMetadata.experiment,
209170
- abnormal_exit: abnormalExit
209171
- };
209172
- await axios2.put(url2, data2, { headers: getAuthHeaders() });
209173
- } catch (error) {
209174
- handleError(error, "Error registering analysis metadata", false);
209175
- }
209143
+ async function registerAnalysisMetadataSocket(_subprojectPath, _workspacePath, _ecosystem, _analysisMetadata, _tier1ScanId) {
209176
209144
  }
209177
209145
  async function getLatestBucketsSocket(subprojectPath, workspacePath) {
209178
209146
  try {
@@ -209446,6 +209414,54 @@ async function sendLogChunkSocket(reportId, logs) {
209446
209414
  console.warn("Failed to send log chunk to Socket:", error.message);
209447
209415
  }
209448
209416
  }
209417
+ async function createAnalysisMetadataSocket(tier1ScanId, subprojectPath, workspacePath, ecosystem, ghsaIds, heuristicName, experimentName) {
209418
+ if (!tier1ScanId) return void 0;
209419
+ try {
209420
+ const url2 = getSocketApiUrl("tier1-reachability-scan/create-analysis-metadata");
209421
+ const data2 = {
209422
+ tier1_reachability_scan_id: tier1ScanId,
209423
+ subproject_path: subprojectPath,
209424
+ workspace_path: workspacePath,
209425
+ purl_type: getPurlType(ecosystem),
209426
+ ghsa_ids: ghsaIds,
209427
+ heuristic_name: heuristicName,
209428
+ experiment_name: experimentName
209429
+ };
209430
+ const response = await axios2.post(url2, data2, { headers: getAuthHeaders() });
209431
+ return response.data.analysis_metadata_id;
209432
+ } catch (error) {
209433
+ handleError(error, "Error creating analysis metadata", false);
209434
+ return void 0;
209435
+ }
209436
+ }
209437
+ async function sendTelemetrySocket(analysisMetadataId, telemetry) {
209438
+ try {
209439
+ const url2 = getSocketApiUrl("tier1-reachability-scan/add-telemetry");
209440
+ const data2 = {
209441
+ analysis_metadata_id: analysisMetadataId,
209442
+ telemetry
209443
+ };
209444
+ await axios2.post(url2, data2, { headers: getAuthHeaders() });
209445
+ } catch (error) {
209446
+ console.warn("Failed to send telemetry to Socket:", error.message);
209447
+ }
209448
+ }
209449
+ async function registerDiagnosticsToAnalysisMetadataSocket(analysisMetadataId, diagnosticsData) {
209450
+ const abnormalExit = diagnosticsData.analysisDiagnostics.aborted ? "ABORTED" : diagnosticsData.analysisDiagnostics.timeout ? "TIMEOUT" : "NONE";
209451
+ try {
209452
+ const url2 = getSocketApiUrl("tier1-reachability-scan/register-diagnostics-to-analysis-metadata");
209453
+ const data2 = {
209454
+ analysis_metadata_id: analysisMetadataId,
209455
+ analysis_diagnostics: diagnosticsData.analysisDiagnostics,
209456
+ is_final_result: diagnosticsData.finalResult,
209457
+ error_message: diagnosticsData.errorMessage,
209458
+ abnormal_exit: abnormalExit
209459
+ };
209460
+ await axios2.post(url2, data2, { headers: getAuthHeaders() });
209461
+ } catch (error) {
209462
+ handleError(error, "Error registering diagnostics to analysis metadata", false);
209463
+ }
209464
+ }
209449
209465
  function getSocketAPI() {
209450
209466
  return {
209451
209467
  createSocketTier1Scan,
@@ -209458,7 +209474,10 @@ function getSocketAPI() {
209458
209474
  finalizeAutofixRun,
209459
209475
  registerUpgradePurlRun,
209460
209476
  finalizeUpgradePurlRun,
209461
- sendLogChunkSocket
209477
+ sendLogChunkSocket,
209478
+ createAnalysisMetadataSocket,
209479
+ sendTelemetrySocket,
209480
+ registerDiagnosticsToAnalysisMetadataSocket
209462
209481
  };
209463
209482
  }
209464
209483
 
@@ -209473,7 +209492,7 @@ import { createGunzip } from "node:zlib";
209473
209492
 
209474
209493
  // ../utils/src/command-utils.ts
209475
209494
  import assert from "assert";
209476
- import { execFile } from "child_process";
209495
+ import { execFile as execFile2 } from "child_process";
209477
209496
 
209478
209497
  // ../../node_modules/.pnpm/async-mutex@0.5.0/node_modules/async-mutex/index.mjs
209479
209498
  var E_TIMEOUT = new Error("timeout while waiting for mutex to become available");
@@ -209813,6 +209832,65 @@ var Spinner = class _Spinner {
209813
209832
  }
209814
209833
  };
209815
209834
 
209835
+ // ../utils/src/telemetry/telemetry-collector.ts
209836
+ import { execFile } from "child_process";
209837
+ import { platform } from "os";
209838
+ import { promisify } from "util";
209839
+ var execFileAsync = promisify(execFile);
209840
+ var TelemetryCollector = class {
209841
+ /**
209842
+ * Collect memory metrics for a child process by PID.
209843
+ * Uses OS-specific commands to query memory usage.
209844
+ *
209845
+ * @param pid - The process ID to query
209846
+ * @returns TelemetryMetrics or undefined if the process doesn't exist or query fails
209847
+ */
209848
+ async collectChildProcessMetrics(pid) {
209849
+ if (!Number.isInteger(pid) || pid <= 0) {
209850
+ return void 0;
209851
+ }
209852
+ try {
209853
+ const currentPlatform = platform();
209854
+ if (currentPlatform === "darwin" || currentPlatform === "linux") {
209855
+ return await this.collectUnixProcessMetrics(pid);
209856
+ }
209857
+ return void 0;
209858
+ } catch {
209859
+ return void 0;
209860
+ }
209861
+ }
209862
+ /**
209863
+ * Collect metrics for a Unix-like system (macOS, Linux) using ps command.
209864
+ */
209865
+ async collectUnixProcessMetrics(pid) {
209866
+ try {
209867
+ const { stdout } = await execFileAsync("ps", ["-o", "rss=,pcpu=", "-p", String(pid)], {
209868
+ timeout: 5e3
209869
+ });
209870
+ const trimmed = stdout.trim();
209871
+ if (!trimmed) {
209872
+ return void 0;
209873
+ }
209874
+ const parts = trimmed.split(/\s+/);
209875
+ if (parts.length < 2) {
209876
+ return void 0;
209877
+ }
209878
+ const rssKb = parseInt(parts[0], 10);
209879
+ const cpuPercent = parseFloat(parts[1]);
209880
+ if (isNaN(rssKb) || isNaN(cpuPercent)) {
209881
+ return void 0;
209882
+ }
209883
+ const rssBytes = rssKb * 1024;
209884
+ return {
209885
+ rss: rssBytes,
209886
+ cpuPercent
209887
+ };
209888
+ } catch {
209889
+ return void 0;
209890
+ }
209891
+ }
209892
+ };
209893
+
209816
209894
  // ../utils/src/command-utils.ts
209817
209895
  var DEFAULT_TIMEOUT_MS = 30 * 60 * 1e3;
209818
209896
  async function execAndLogOnFailure(cmd, dir, options, logLevel = "info") {
@@ -209845,14 +209923,35 @@ function startHeartbeat(options) {
209845
209923
  timer.unref?.();
209846
209924
  return () => clearInterval(timer);
209847
209925
  }
209926
+ var DEFAULT_TELEMETRY_INTERVAL_MS = 5e3;
209927
+ function startTelemetry(pid, handler) {
209928
+ const collector = new TelemetryCollector();
209929
+ const intervalMs = handler.intervalMs ?? DEFAULT_TELEMETRY_INTERVAL_MS;
209930
+ const collectAndReport = async () => {
209931
+ const metrics = await collector.collectChildProcessMetrics(pid);
209932
+ if (metrics) {
209933
+ handler.onTelemetry(metrics);
209934
+ }
209935
+ };
209936
+ collectAndReport().catch((err) => {
209937
+ logger.debug("Initial telemetry collection failed:", err);
209938
+ });
209939
+ const timer = setInterval(() => {
209940
+ collectAndReport().catch(() => {
209941
+ });
209942
+ }, intervalMs);
209943
+ timer.unref?.();
209944
+ return () => clearInterval(timer);
209945
+ }
209848
209946
  async function execNeverFail(cmd, dir, options) {
209849
209947
  const stopHeartbeat = options?.heartbeat ? startHeartbeat(options.heartbeat) : void 0;
209948
+ let stopTelemetry;
209850
209949
  try {
209851
209950
  return await new Promise((resolve45) => {
209852
209951
  let args2;
209853
209952
  if (typeof cmd !== "string") [cmd, ...args2] = cmd;
209854
209953
  const timeout = options?.timeout ?? DEFAULT_TIMEOUT_MS;
209855
- const childProcess = execFile(
209954
+ const childProcess = execFile2(
209856
209955
  cmd,
209857
209956
  args2,
209858
209957
  { ...options, cwd: dir, maxBuffer: 1024 * 1024 * 1024, shell: args2 === void 0, timeout },
@@ -209860,6 +209959,9 @@ async function execNeverFail(cmd, dir, options) {
209860
209959
  resolve45({ error, stdout, stderr });
209861
209960
  }
209862
209961
  );
209962
+ if (options?.telemetryHandler && childProcess.pid) {
209963
+ stopTelemetry = startTelemetry(childProcess.pid, options.telemetryHandler);
209964
+ }
209863
209965
  if (options?.pipe) {
209864
209966
  childProcess.stdout?.on("data", (data2) => {
209865
209967
  Spinner.instance().suspend(() => {
@@ -209877,6 +209979,7 @@ async function execNeverFail(cmd, dir, options) {
209877
209979
  });
209878
209980
  } finally {
209879
209981
  stopHeartbeat?.();
209982
+ stopTelemetry?.();
209880
209983
  }
209881
209984
  }
209882
209985
  async function runCommandResolveStdOut(cmd, dir, options) {
@@ -212569,8 +212672,8 @@ var parseKVLine = (set, line) => {
212569
212672
  };
212570
212673
 
212571
212674
  // ../../node_modules/.pnpm/tar@7.4.3/node_modules/tar/dist/esm/normalize-windows-path.js
212572
- var platform = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
212573
- var normalizeWindowsPath = platform !== "win32" ? (p3) => p3 : (p3) => p3 && p3.replace(/\\/g, "/");
212675
+ var platform2 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
212676
+ var normalizeWindowsPath = platform2 !== "win32" ? (p3) => p3 : (p3) => p3 && p3.replace(/\\/g, "/");
212574
212677
 
212575
212678
  // ../../node_modules/.pnpm/tar@7.4.3/node_modules/tar/dist/esm/read-entry.js
212576
212679
  var ReadEntry = class extends Minipass {
@@ -214397,8 +214500,8 @@ import path6 from "node:path";
214397
214500
 
214398
214501
  // ../../node_modules/.pnpm/tar@7.4.3/node_modules/tar/dist/esm/get-write-flag.js
214399
214502
  import fs5 from "fs";
214400
- var platform2 = process.env.__FAKE_PLATFORM__ || process.platform;
214401
- var isWindows = platform2 === "win32";
214503
+ var platform3 = process.env.__FAKE_PLATFORM__ || process.platform;
214504
+ var isWindows = platform3 === "win32";
214402
214505
  var { O_CREAT, O_TRUNC, O_WRONLY } = fs5.constants;
214403
214506
  var UV_FS_O_FILEMAP = Number(process.env.__FAKE_FS_O_FILENAME__) || fs5.constants.UV_FS_O_FILEMAP || 0;
214404
214507
  var fMapEnabled = isWindows && !!UV_FS_O_FILEMAP;
@@ -214653,7 +214756,7 @@ var mkdirpNative = Object.assign(async (path9, options) => {
214653
214756
 
214654
214757
  // ../../node_modules/.pnpm/mkdirp@3.0.1/node_modules/mkdirp/dist/mjs/path-arg.js
214655
214758
  import { parse as parse4, resolve as resolve2 } from "path";
214656
- var platform3 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
214759
+ var platform4 = process.env.__TESTING_MKDIRP_PLATFORM__ || process.platform;
214657
214760
  var pathArg = (path9) => {
214658
214761
  if (/\0/.test(path9)) {
214659
214762
  throw Object.assign(new TypeError("path must be a string without null bytes"), {
@@ -214662,7 +214765,7 @@ var pathArg = (path9) => {
214662
214765
  });
214663
214766
  }
214664
214767
  path9 = resolve2(path9);
214665
- if (platform3 === "win32") {
214768
+ if (platform4 === "win32") {
214666
214769
  const badWinChars = /[*|"<>?:]/;
214667
214770
  const { root: root3 } = parse4(path9);
214668
214771
  if (badWinChars.test(path9.substring(root3.length))) {
@@ -214922,8 +215025,8 @@ var normalizeUnicode = (s6) => {
214922
215025
 
214923
215026
  // ../../node_modules/.pnpm/tar@7.4.3/node_modules/tar/dist/esm/path-reservations.js
214924
215027
  import { join as join3 } from "node:path";
214925
- var platform4 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
214926
- var isWindows2 = platform4 === "win32";
215028
+ var platform5 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
215029
+ var isWindows2 = platform5 === "win32";
214927
215030
  var getDirs = (path9) => {
214928
215031
  const dirs = path9.split("/").slice(0, -1).reduce((set, path10) => {
214929
215032
  const s6 = set[set.length - 1];
@@ -215079,8 +215182,8 @@ var DOCHOWN = Symbol("doChown");
215079
215182
  var UID = Symbol("uid");
215080
215183
  var GID = Symbol("gid");
215081
215184
  var CHECKED_CWD = Symbol("checkedCwd");
215082
- var platform5 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
215083
- var isWindows3 = platform5 === "win32";
215185
+ var platform6 = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
215186
+ var isWindows3 = platform6 === "win32";
215084
215187
  var DEFAULT_MAX_DEPTH = 1024;
215085
215188
  var unlinkFile = (path9, cb) => {
215086
215189
  if (!isWindows3) {
@@ -216026,13 +216129,13 @@ async function getNodeExecutable(overridePath) {
216026
216129
  logger.debug("Extracting Node.js binary for spawned processes...");
216027
216130
  extractedNodePath = (async () => {
216028
216131
  const extractedPath = await extractTool("nodejs-binaries", "nodejs-binaries");
216029
- const { platform: platform7, arch } = process;
216132
+ const { platform: platform9, arch } = process;
216030
216133
  const nodeArch = arch === "arm" ? "arm64" : arch;
216031
- const isWindows4 = platform7 === "win32";
216032
- const binaryName = isWindows4 ? `node-${platform7}-${nodeArch}.exe.gz` : `node-${platform7}-${nodeArch}.gz`;
216134
+ const isWindows4 = platform9 === "win32";
216135
+ const binaryName = isWindows4 ? `node-${platform9}-${nodeArch}.exe.gz` : `node-${platform9}-${nodeArch}.gz`;
216033
216136
  const compressedBinaryPath = join4(extractedPath, binaryName);
216034
216137
  if (!await exists(compressedBinaryPath)) {
216035
- throw new Error(`Node.js binary not found: ${compressedBinaryPath}. Platform: ${platform7}-${nodeArch}`);
216138
+ throw new Error(`Node.js binary not found: ${compressedBinaryPath}. Platform: ${platform9}-${nodeArch}`);
216036
216139
  }
216037
216140
  const tmpDir = join4(getExtractionBaseDir(), "node-runtime");
216038
216141
  await mkdir4(tmpDir, { recursive: true });
@@ -216255,13 +216358,13 @@ async function getUvExecutable() {
216255
216358
  logger.debug("uv not found on system, extracting embedded uv...");
216256
216359
  extractedUvPath = (async () => {
216257
216360
  const extractedPath = await extractTool("uv-binaries", "uv-binaries");
216258
- const { platform: platform7, arch } = process;
216361
+ const { platform: platform9, arch } = process;
216259
216362
  const nodeArch = arch === "arm" ? "arm64" : arch;
216260
- const isWindows4 = platform7 === "win32";
216261
- const binaryName = isWindows4 ? `uv-${platform7}-${nodeArch}.exe.gz` : `uv-${platform7}-${nodeArch}.gz`;
216363
+ const isWindows4 = platform9 === "win32";
216364
+ const binaryName = isWindows4 ? `uv-${platform9}-${nodeArch}.exe.gz` : `uv-${platform9}-${nodeArch}.gz`;
216262
216365
  const compressedBinaryPath = join4(extractedPath, binaryName);
216263
216366
  if (!await exists(compressedBinaryPath)) {
216264
- throw new Error(`uv binary not found: ${compressedBinaryPath}. Platform: ${platform7}-${nodeArch}`);
216367
+ throw new Error(`uv binary not found: ${compressedBinaryPath}. Platform: ${platform9}-${nodeArch}`);
216265
216368
  }
216266
216369
  const tmpDir = join4(getExtractionBaseDir(), "uv-runtime");
216267
216370
  await mkdir4(tmpDir, { recursive: true });
@@ -227545,7 +227648,7 @@ var Pattern = class _Pattern {
227545
227648
  #isUNC;
227546
227649
  #isAbsolute;
227547
227650
  #followGlobstar = true;
227548
- constructor(patternList, globList, index2, platform7) {
227651
+ constructor(patternList, globList, index2, platform9) {
227549
227652
  if (!isPatternList(patternList)) {
227550
227653
  throw new TypeError("empty pattern list");
227551
227654
  }
@@ -227562,7 +227665,7 @@ var Pattern = class _Pattern {
227562
227665
  this.#patternList = patternList;
227563
227666
  this.#globList = globList;
227564
227667
  this.#index = index2;
227565
- this.#platform = platform7;
227668
+ this.#platform = platform9;
227566
227669
  if (this.#index === 0) {
227567
227670
  if (this.isUNC()) {
227568
227671
  const [p0, p1, p22, p3, ...prest] = this.#patternList;
@@ -227704,12 +227807,12 @@ var Ignore = class {
227704
227807
  absoluteChildren;
227705
227808
  platform;
227706
227809
  mmopts;
227707
- constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform7 = defaultPlatform2 }) {
227810
+ constructor(ignored, { nobrace, nocase, noext, noglobstar, platform: platform9 = defaultPlatform2 }) {
227708
227811
  this.relative = [];
227709
227812
  this.absolute = [];
227710
227813
  this.relativeChildren = [];
227711
227814
  this.absoluteChildren = [];
227712
- this.platform = platform7;
227815
+ this.platform = platform9;
227713
227816
  this.mmopts = {
227714
227817
  dot: true,
227715
227818
  nobrace,
@@ -227717,7 +227820,7 @@ var Ignore = class {
227717
227820
  noext,
227718
227821
  noglobstar,
227719
227822
  optimizationLevel: 2,
227720
- platform: platform7,
227823
+ platform: platform9,
227721
227824
  nocomment: true,
227722
227825
  nonegate: true
227723
227826
  };
@@ -228596,7 +228699,7 @@ import { join as join10, resolve as resolve18 } from "path";
228596
228699
 
228597
228700
  // ../utils/dist/command-utils.js
228598
228701
  import assert9 from "assert";
228599
- import { execFile as execFile2 } from "child_process";
228702
+ import { execFile as execFile4 } from "child_process";
228600
228703
 
228601
228704
  // ../utils/dist/spinner.js
228602
228705
  var import_lodash4 = __toESM(require_lodash(), 1);
@@ -228730,6 +228833,65 @@ var Spinner2 = class _Spinner {
228730
228833
  }
228731
228834
  };
228732
228835
 
228836
+ // ../utils/dist/telemetry/telemetry-collector.js
228837
+ import { execFile as execFile3 } from "child_process";
228838
+ import { platform as platform7 } from "os";
228839
+ import { promisify as promisify2 } from "util";
228840
+ var execFileAsync2 = promisify2(execFile3);
228841
+ var TelemetryCollector2 = class {
228842
+ /**
228843
+ * Collect memory metrics for a child process by PID.
228844
+ * Uses OS-specific commands to query memory usage.
228845
+ *
228846
+ * @param pid - The process ID to query
228847
+ * @returns TelemetryMetrics or undefined if the process doesn't exist or query fails
228848
+ */
228849
+ async collectChildProcessMetrics(pid) {
228850
+ if (!Number.isInteger(pid) || pid <= 0) {
228851
+ return void 0;
228852
+ }
228853
+ try {
228854
+ const currentPlatform = platform7();
228855
+ if (currentPlatform === "darwin" || currentPlatform === "linux") {
228856
+ return await this.collectUnixProcessMetrics(pid);
228857
+ }
228858
+ return void 0;
228859
+ } catch {
228860
+ return void 0;
228861
+ }
228862
+ }
228863
+ /**
228864
+ * Collect metrics for a Unix-like system (macOS, Linux) using ps command.
228865
+ */
228866
+ async collectUnixProcessMetrics(pid) {
228867
+ try {
228868
+ const { stdout } = await execFileAsync2("ps", ["-o", "rss=,pcpu=", "-p", String(pid)], {
228869
+ timeout: 5e3
228870
+ });
228871
+ const trimmed = stdout.trim();
228872
+ if (!trimmed) {
228873
+ return void 0;
228874
+ }
228875
+ const parts = trimmed.split(/\s+/);
228876
+ if (parts.length < 2) {
228877
+ return void 0;
228878
+ }
228879
+ const rssKb = parseInt(parts[0], 10);
228880
+ const cpuPercent = parseFloat(parts[1]);
228881
+ if (isNaN(rssKb) || isNaN(cpuPercent)) {
228882
+ return void 0;
228883
+ }
228884
+ const rssBytes = rssKb * 1024;
228885
+ return {
228886
+ rss: rssBytes,
228887
+ cpuPercent
228888
+ };
228889
+ } catch {
228890
+ return void 0;
228891
+ }
228892
+ }
228893
+ };
228894
+
228733
228895
  // ../utils/dist/command-utils.js
228734
228896
  var DEFAULT_TIMEOUT_MS2 = 30 * 60 * 1e3;
228735
228897
  async function execAndLogOnFailure3(cmd, dir, options, logLevel = "info") {
@@ -228760,17 +228922,41 @@ function startHeartbeat2(options) {
228760
228922
  timer.unref?.();
228761
228923
  return () => clearInterval(timer);
228762
228924
  }
228925
+ var DEFAULT_TELEMETRY_INTERVAL_MS2 = 5e3;
228926
+ function startTelemetry2(pid, handler) {
228927
+ const collector = new TelemetryCollector2();
228928
+ const intervalMs = handler.intervalMs ?? DEFAULT_TELEMETRY_INTERVAL_MS2;
228929
+ const collectAndReport = async () => {
228930
+ const metrics = await collector.collectChildProcessMetrics(pid);
228931
+ if (metrics) {
228932
+ handler.onTelemetry(metrics);
228933
+ }
228934
+ };
228935
+ collectAndReport().catch((err) => {
228936
+ logger.debug("Initial telemetry collection failed:", err);
228937
+ });
228938
+ const timer = setInterval(() => {
228939
+ collectAndReport().catch(() => {
228940
+ });
228941
+ }, intervalMs);
228942
+ timer.unref?.();
228943
+ return () => clearInterval(timer);
228944
+ }
228763
228945
  async function execNeverFail3(cmd, dir, options) {
228764
228946
  const stopHeartbeat = options?.heartbeat ? startHeartbeat2(options.heartbeat) : void 0;
228947
+ let stopTelemetry;
228765
228948
  try {
228766
228949
  return await new Promise((resolve45) => {
228767
228950
  let args2;
228768
228951
  if (typeof cmd !== "string")
228769
228952
  [cmd, ...args2] = cmd;
228770
228953
  const timeout = options?.timeout ?? DEFAULT_TIMEOUT_MS2;
228771
- const childProcess = execFile2(cmd, args2, { ...options, cwd: dir, maxBuffer: 1024 * 1024 * 1024, shell: args2 === void 0, timeout }, (error, stdout, stderr) => {
228954
+ const childProcess = execFile4(cmd, args2, { ...options, cwd: dir, maxBuffer: 1024 * 1024 * 1024, shell: args2 === void 0, timeout }, (error, stdout, stderr) => {
228772
228955
  resolve45({ error, stdout, stderr });
228773
228956
  });
228957
+ if (options?.telemetryHandler && childProcess.pid) {
228958
+ stopTelemetry = startTelemetry2(childProcess.pid, options.telemetryHandler);
228959
+ }
228774
228960
  if (options?.pipe) {
228775
228961
  childProcess.stdout?.on("data", (data2) => {
228776
228962
  Spinner2.instance().suspend(() => {
@@ -228789,6 +228975,7 @@ async function execNeverFail3(cmd, dir, options) {
228789
228975
  });
228790
228976
  } finally {
228791
228977
  stopHeartbeat?.();
228978
+ stopTelemetry?.();
228792
228979
  }
228793
228980
  }
228794
228981
  async function runCommandResolveStdOut3(cmd, dir, options) {
@@ -235517,7 +235704,7 @@ var import_lodash12 = __toESM(require_lodash(), 1);
235517
235704
  import { rmSync } from "fs";
235518
235705
  import { mkdir as mkdir5, readFile as readFile30, writeFile as writeFile10 } from "fs/promises";
235519
235706
  import assert15 from "node:assert";
235520
- import { platform as platform6 } from "os";
235707
+ import { platform as platform8 } from "os";
235521
235708
  import { join as join25, posix as posix2, relative as relative16, sep as sep3 } from "path";
235522
235709
 
235523
235710
  // ../utils/src/tmp-file.ts
@@ -236196,7 +236383,7 @@ var setUpGoModuleCache = once7(async () => {
236196
236383
  const { stdout, error } = await execNeverFail2("go env GOMODCACHE");
236197
236384
  if (error ?? !await exists(stdout.trim()))
236198
236385
  return;
236199
- if (platform6() !== "linux") return stdout.trim();
236386
+ if (platform8() !== "linux") return stdout.trim();
236200
236387
  const tmpDir = await createTmpDirectory("coana-go-module-cache-");
236201
236388
  let volume;
236202
236389
  const cleanup = once7(() => {
@@ -236847,6 +237034,15 @@ function getTypeFromEcosystem(ecosystem) {
236847
237034
  }
236848
237035
  }
236849
237036
 
237037
+ // ../web-compat-utils/src/ghsa.ts
237038
+ function extractGHSAIdFromUrl(url2) {
237039
+ const match2 = url2.match(/(GHSA-[a-z0-9-]+)/);
237040
+ if (match2) {
237041
+ return match2[1];
237042
+ }
237043
+ return void 0;
237044
+ }
237045
+
236850
237046
  // ../web-compat-utils/src/dismissed-vulnerability-utils.ts
236851
237047
  function getRelevantDismissedVulnerabilities(dismissedVulnerabilities, vulnerability) {
236852
237048
  const isServer = typeof window === "undefined";
@@ -238482,6 +238678,39 @@ var DashboardAPI = class {
238482
238678
  await this.socketAPI.sendLogChunkSocket(reportId, logs);
238483
238679
  }
238484
238680
  }
238681
+ async createAnalysisMetadata(tier1ScanId, subprojectPath, workspacePath, ecosystem, ghsaIds, heuristicName, experimentName) {
238682
+ if (this.disableAnalyticsSharing) {
238683
+ return void 0;
238684
+ }
238685
+ if (this.socketMode) {
238686
+ return await this.socketAPI.createAnalysisMetadataSocket(
238687
+ tier1ScanId,
238688
+ subprojectPath,
238689
+ workspacePath,
238690
+ ecosystem,
238691
+ ghsaIds,
238692
+ heuristicName,
238693
+ experimentName
238694
+ );
238695
+ }
238696
+ return void 0;
238697
+ }
238698
+ async sendTelemetry(analysisMetadataId, telemetry) {
238699
+ if (this.disableAnalyticsSharing) {
238700
+ return;
238701
+ }
238702
+ if (this.socketMode) {
238703
+ await this.socketAPI.sendTelemetrySocket(analysisMetadataId, telemetry);
238704
+ }
238705
+ }
238706
+ async registerDiagnosticsToAnalysisMetadata(analysisMetadataId, diagnosticsData) {
238707
+ if (this.disableAnalyticsSharing || !analysisMetadataId) {
238708
+ return;
238709
+ }
238710
+ if (this.socketMode) {
238711
+ this.socketAPI.registerDiagnosticsToAnalysisMetadataSocket(analysisMetadataId, diagnosticsData).catch((err) => logger.debug("Failed to register diagnostics to analysis metadata:", err));
238712
+ }
238713
+ }
238485
238714
  };
238486
238715
 
238487
238716
  // ../utils/src/dashboard-api/batched-http-log-streamer.ts
@@ -240150,7 +240379,7 @@ function getMongoClient() {
240150
240379
 
240151
240380
  // ../security-auditor/security-auditor-api/src/vulnerability-patterns-helper/get-interesting-urls-for-vulnerability.ts
240152
240381
  import { exec as exec3 } from "child_process";
240153
- import { promisify } from "util";
240382
+ import { promisify as promisify3 } from "util";
240154
240383
 
240155
240384
  // ../../node_modules/.pnpm/cheerio@1.0.0-rc.12/node_modules/cheerio/lib/esm/options.js
240156
240385
  var defaultOpts = {
@@ -253745,7 +253974,7 @@ async function getInterestingURLsForVulnerability(vulnerability, packageMetadata
253745
253974
  }
253746
253975
  async function computeComparisonURLs(scmUrl, vulnAndFixVersionsArr) {
253747
253976
  try {
253748
- const gitTags = (await promisify(exec3)(`git ls-remote ${scmUrl} | grep -F "refs/tags"`)).stdout.split("\n");
253977
+ const gitTags = (await promisify3(exec3)(`git ls-remote ${scmUrl} | grep -F "refs/tags"`)).stdout.split("\n");
253749
253978
  logger3.debug("gitTags", gitTags);
253750
253979
  logger3.debug("vulnAndFixVersionsArr", vulnAndFixVersionsArr);
253751
253980
  const versionToSha = {};
@@ -253780,7 +254009,7 @@ async function computeInterestingCommitURLs(text3, scmUrl) {
253780
254009
  const repo = scmUrl.split("/").slice(-2).join("/");
253781
254010
  const cmd = `gh search commits ${text3} --repo ${repo}`;
253782
254011
  logger3.debug(`Finding issue or PR url for text ${text3}`, cmd);
253783
- const { stdout } = await promisify(exec3)(cmd, { shell: "/bin/zsh" });
254012
+ const { stdout } = await promisify3(exec3)(cmd, { shell: "/bin/zsh" });
253784
254013
  return stdout.split("\n").filter((line) => line).map((line) => {
253785
254014
  const [repo2, sha] = line.split(" ");
253786
254015
  return `https://www.github.com/${repo2}/commit/${sha}`;
@@ -253794,7 +254023,7 @@ async function computeInterestingIssueAndPRUrlsWithText(text3, scmUrl) {
253794
254023
  const repo = scmUrl.split("/").slice(-2).join("/");
253795
254024
  const cmd = `gh search issues ${text3} in:title,body,comment --repo ${repo} --include-prs`;
253796
254025
  console.log(`Finding issue or PR url for text ${text3}`, cmd);
253797
- const { stdout } = await promisify(exec3)(cmd, { shell: "/bin/zsh" });
254026
+ const { stdout } = await promisify3(exec3)(cmd, { shell: "/bin/zsh" });
253798
254027
  return stdout.split("\n").filter((line) => line).map((line) => {
253799
254028
  const [issueOrPr, repo2, id] = line.split(" ");
253800
254029
  const issueOrPrUrlPart = issueOrPr === "issue" ? "issues" : "pull";
@@ -255023,7 +255252,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
255023
255252
  }
255024
255253
 
255025
255254
  // dist/version.js
255026
- var version3 = "14.12.143";
255255
+ var version3 = "14.12.144";
255027
255256
 
255028
255257
  // dist/cli-core.js
255029
255258
  var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;