@coana-tech/cli 14.12.99 → 14.12.101

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.
@@ -5611,9 +5611,9 @@ var require_logform = __commonJS({
5611
5611
  }
5612
5612
  });
5613
5613
 
5614
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/common.js
5614
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/common.js
5615
5615
  var require_common = __commonJS({
5616
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/common.js"(exports) {
5616
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/common.js"(exports) {
5617
5617
  "use strict";
5618
5618
  var { format: format3 } = __require("util");
5619
5619
  exports.warn = {
@@ -5648,13 +5648,13 @@ var require_common = __commonJS({
5648
5648
  }
5649
5649
  });
5650
5650
 
5651
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/package.json
5651
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/package.json
5652
5652
  var require_package = __commonJS({
5653
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/package.json"(exports, module) {
5653
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/package.json"(exports, module) {
5654
5654
  module.exports = {
5655
5655
  name: "winston",
5656
5656
  description: "A logger for just about everything.",
5657
- version: "3.14.2",
5657
+ version: "3.16.0",
5658
5658
  author: "Charlie Robbins <charlie.robbins@gmail.com>",
5659
5659
  maintainers: [
5660
5660
  "David Hyde <dabh@alumni.stanford.edu>"
@@ -5701,7 +5701,7 @@ var require_package = __commonJS({
5701
5701
  eslint: "^8.57.0",
5702
5702
  hock: "^1.4.1",
5703
5703
  mocha: "^10.3.0",
5704
- nyc: "^15.1.0",
5704
+ nyc: "^17.1.0",
5705
5705
  rimraf: "5.0.1",
5706
5706
  split2: "^4.1.0",
5707
5707
  "std-mocks": "^2.0.0",
@@ -8417,9 +8417,9 @@ var require_winston_transport = __commonJS({
8417
8417
  }
8418
8418
  });
8419
8419
 
8420
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/console.js
8420
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/console.js
8421
8421
  var require_console = __commonJS({
8422
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/console.js"(exports, module) {
8422
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/console.js"(exports, module) {
8423
8423
  "use strict";
8424
8424
  var os = __require("os");
8425
8425
  var { LEVEL, MESSAGE } = require_triple_beam();
@@ -11342,9 +11342,9 @@ var require_node2 = __commonJS({
11342
11342
  }
11343
11343
  });
11344
11344
 
11345
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/tail-file.js
11345
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/tail-file.js
11346
11346
  var require_tail_file = __commonJS({
11347
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/tail-file.js"(exports, module) {
11347
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/tail-file.js"(exports, module) {
11348
11348
  "use strict";
11349
11349
  var fs12 = __require("fs");
11350
11350
  var { StringDecoder: StringDecoder2 } = __require("string_decoder");
@@ -11437,9 +11437,9 @@ var require_tail_file = __commonJS({
11437
11437
  }
11438
11438
  });
11439
11439
 
11440
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/file.js
11440
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/file.js
11441
11441
  var require_file = __commonJS({
11442
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/file.js"(exports, module) {
11442
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/file.js"(exports, module) {
11443
11443
  "use strict";
11444
11444
  var fs12 = __require("fs");
11445
11445
  var path10 = __require("path");
@@ -12031,9 +12031,9 @@ var require_file = __commonJS({
12031
12031
  }
12032
12032
  });
12033
12033
 
12034
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/http.js
12034
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/http.js
12035
12035
  var require_http = __commonJS({
12036
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/http.js"(exports, module) {
12036
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/http.js"(exports, module) {
12037
12037
  "use strict";
12038
12038
  var http3 = __require("http");
12039
12039
  var https3 = __require("https");
@@ -12262,9 +12262,9 @@ var require_is_stream = __commonJS({
12262
12262
  }
12263
12263
  });
12264
12264
 
12265
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/stream.js
12265
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/stream.js
12266
12266
  var require_stream2 = __commonJS({
12267
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/stream.js"(exports, module) {
12267
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/stream.js"(exports, module) {
12268
12268
  "use strict";
12269
12269
  var isStream4 = require_is_stream();
12270
12270
  var { MESSAGE } = require_triple_beam();
@@ -12311,9 +12311,9 @@ var require_stream2 = __commonJS({
12311
12311
  }
12312
12312
  });
12313
12313
 
12314
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/index.js
12314
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/index.js
12315
12315
  var require_transports = __commonJS({
12316
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/transports/index.js"(exports) {
12316
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/transports/index.js"(exports) {
12317
12317
  "use strict";
12318
12318
  Object.defineProperty(exports, "Console", {
12319
12319
  configurable: true,
@@ -12346,9 +12346,9 @@ var require_transports = __commonJS({
12346
12346
  }
12347
12347
  });
12348
12348
 
12349
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/config/index.js
12349
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/config/index.js
12350
12350
  var require_config2 = __commonJS({
12351
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/config/index.js"(exports) {
12351
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/config/index.js"(exports) {
12352
12352
  "use strict";
12353
12353
  var logform = require_logform();
12354
12354
  var { configs } = require_triple_beam();
@@ -12623,9 +12623,9 @@ var require_stack_trace = __commonJS({
12623
12623
  }
12624
12624
  });
12625
12625
 
12626
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-stream.js
12626
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/exception-stream.js
12627
12627
  var require_exception_stream = __commonJS({
12628
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-stream.js"(exports, module) {
12628
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/exception-stream.js"(exports, module) {
12629
12629
  "use strict";
12630
12630
  var { Writable } = require_readable();
12631
12631
  module.exports = class ExceptionStream extends Writable {
@@ -12663,9 +12663,9 @@ var require_exception_stream = __commonJS({
12663
12663
  }
12664
12664
  });
12665
12665
 
12666
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-handler.js
12666
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/exception-handler.js
12667
12667
  var require_exception_handler = __commonJS({
12668
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/exception-handler.js"(exports, module) {
12668
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/exception-handler.js"(exports, module) {
12669
12669
  "use strict";
12670
12670
  var os = __require("os");
12671
12671
  var asyncForEach2 = require_forEach();
@@ -12861,9 +12861,9 @@ var require_exception_handler = __commonJS({
12861
12861
  }
12862
12862
  });
12863
12863
 
12864
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-stream.js
12864
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/rejection-stream.js
12865
12865
  var require_rejection_stream = __commonJS({
12866
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-stream.js"(exports, module) {
12866
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/rejection-stream.js"(exports, module) {
12867
12867
  "use strict";
12868
12868
  var { Writable } = require_readable();
12869
12869
  module.exports = class RejectionStream extends Writable {
@@ -12901,9 +12901,9 @@ var require_rejection_stream = __commonJS({
12901
12901
  }
12902
12902
  });
12903
12903
 
12904
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-handler.js
12904
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/rejection-handler.js
12905
12905
  var require_rejection_handler = __commonJS({
12906
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/rejection-handler.js"(exports, module) {
12906
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/rejection-handler.js"(exports, module) {
12907
12907
  "use strict";
12908
12908
  var os = __require("os");
12909
12909
  var asyncForEach2 = require_forEach();
@@ -13105,9 +13105,9 @@ var require_rejection_handler = __commonJS({
13105
13105
  }
13106
13106
  });
13107
13107
 
13108
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/profiler.js
13108
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/profiler.js
13109
13109
  var require_profiler = __commonJS({
13110
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/profiler.js"(exports, module) {
13110
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/profiler.js"(exports, module) {
13111
13111
  "use strict";
13112
13112
  var Profiler = class {
13113
13113
  /**
@@ -13147,9 +13147,9 @@ var require_profiler = __commonJS({
13147
13147
  }
13148
13148
  });
13149
13149
 
13150
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/logger.js
13150
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/logger.js
13151
13151
  var require_logger = __commonJS({
13152
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/logger.js"(exports, module) {
13152
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/logger.js"(exports, module) {
13153
13153
  "use strict";
13154
13154
  var { Stream: Stream2, Transform } = require_readable();
13155
13155
  var asyncForEach2 = require_forEach();
@@ -13336,6 +13336,7 @@ var require_logger = __commonJS({
13336
13336
  });
13337
13337
  if (meta.message) info.message = `${info.message} ${meta.message}`;
13338
13338
  if (meta.stack) info.stack = meta.stack;
13339
+ if (meta.cause) info.cause = meta.cause;
13339
13340
  this.write(info);
13340
13341
  return this;
13341
13342
  }
@@ -13666,9 +13667,9 @@ var require_logger = __commonJS({
13666
13667
  }
13667
13668
  });
13668
13669
 
13669
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/create-logger.js
13670
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/create-logger.js
13670
13671
  var require_create_logger = __commonJS({
13671
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/create-logger.js"(exports, module) {
13672
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/create-logger.js"(exports, module) {
13672
13673
  "use strict";
13673
13674
  var { LEVEL } = require_triple_beam();
13674
13675
  var config2 = require_config2();
@@ -13722,9 +13723,9 @@ var require_create_logger = __commonJS({
13722
13723
  }
13723
13724
  });
13724
13725
 
13725
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/container.js
13726
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/container.js
13726
13727
  var require_container = __commonJS({
13727
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston/container.js"(exports, module) {
13728
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston/container.js"(exports, module) {
13728
13729
  "use strict";
13729
13730
  var createLogger2 = require_create_logger();
13730
13731
  module.exports = class Container {
@@ -13818,9 +13819,9 @@ var require_container = __commonJS({
13818
13819
  }
13819
13820
  });
13820
13821
 
13821
- // ../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston.js
13822
+ // ../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston.js
13822
13823
  var require_winston = __commonJS({
13823
- "../../node_modules/.pnpm/winston@3.14.2/node_modules/winston/lib/winston.js"(exports) {
13824
+ "../../node_modules/.pnpm/winston@3.16.0/node_modules/winston/lib/winston.js"(exports) {
13824
13825
  "use strict";
13825
13826
  var logform = require_logform();
13826
13827
  var { warn } = require_common();
@@ -23831,6 +23832,193 @@ var require_ora = __commonJS({
23831
23832
  }
23832
23833
  });
23833
23834
 
23835
+ // ../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/modern.js
23836
+ var require_modern2 = __commonJS({
23837
+ "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/modern.js"(exports, module) {
23838
+ "use strict";
23839
+ var util8 = __require("util");
23840
+ var Writable = require_stream_writable();
23841
+ var { LEVEL } = require_triple_beam();
23842
+ var TransportStream = module.exports = function TransportStream2(options = {}) {
23843
+ Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
23844
+ this.format = options.format;
23845
+ this.level = options.level;
23846
+ this.handleExceptions = options.handleExceptions;
23847
+ this.handleRejections = options.handleRejections;
23848
+ this.silent = options.silent;
23849
+ if (options.log) this.log = options.log;
23850
+ if (options.logv) this.logv = options.logv;
23851
+ if (options.close) this.close = options.close;
23852
+ this.once("pipe", (logger2) => {
23853
+ this.levels = logger2.levels;
23854
+ this.parent = logger2;
23855
+ });
23856
+ this.once("unpipe", (src) => {
23857
+ if (src === this.parent) {
23858
+ this.parent = null;
23859
+ if (this.close) {
23860
+ this.close();
23861
+ }
23862
+ }
23863
+ });
23864
+ };
23865
+ util8.inherits(TransportStream, Writable);
23866
+ TransportStream.prototype._write = function _write2(info, enc, callback) {
23867
+ if (this.silent || info.exception === true && !this.handleExceptions) {
23868
+ return callback(null);
23869
+ }
23870
+ const level = this.level || this.parent && this.parent.level;
23871
+ if (!level || this.levels[level] >= this.levels[info[LEVEL]]) {
23872
+ if (info && !this.format) {
23873
+ return this.log(info, callback);
23874
+ }
23875
+ let errState;
23876
+ let transformed;
23877
+ try {
23878
+ transformed = this.format.transform(Object.assign({}, info), this.format.options);
23879
+ } catch (err) {
23880
+ errState = err;
23881
+ }
23882
+ if (errState || !transformed) {
23883
+ callback();
23884
+ if (errState) throw errState;
23885
+ return;
23886
+ }
23887
+ return this.log(transformed, callback);
23888
+ }
23889
+ this._writableState.sync = false;
23890
+ return callback(null);
23891
+ };
23892
+ TransportStream.prototype._writev = function _writev(chunks, callback) {
23893
+ if (this.logv) {
23894
+ const infos = chunks.filter(this._accept, this);
23895
+ if (!infos.length) {
23896
+ return callback(null);
23897
+ }
23898
+ return this.logv(infos, callback);
23899
+ }
23900
+ for (let i3 = 0; i3 < chunks.length; i3++) {
23901
+ if (!this._accept(chunks[i3])) continue;
23902
+ if (chunks[i3].chunk && !this.format) {
23903
+ this.log(chunks[i3].chunk, chunks[i3].callback);
23904
+ continue;
23905
+ }
23906
+ let errState;
23907
+ let transformed;
23908
+ try {
23909
+ transformed = this.format.transform(
23910
+ Object.assign({}, chunks[i3].chunk),
23911
+ this.format.options
23912
+ );
23913
+ } catch (err) {
23914
+ errState = err;
23915
+ }
23916
+ if (errState || !transformed) {
23917
+ chunks[i3].callback();
23918
+ if (errState) {
23919
+ callback(null);
23920
+ throw errState;
23921
+ }
23922
+ } else {
23923
+ this.log(transformed, chunks[i3].callback);
23924
+ }
23925
+ }
23926
+ return callback(null);
23927
+ };
23928
+ TransportStream.prototype._accept = function _accept(write) {
23929
+ const info = write.chunk;
23930
+ if (this.silent) {
23931
+ return false;
23932
+ }
23933
+ const level = this.level || this.parent && this.parent.level;
23934
+ if (info.exception === true || !level || this.levels[level] >= this.levels[info[LEVEL]]) {
23935
+ if (this.handleExceptions || info.exception !== true) {
23936
+ return true;
23937
+ }
23938
+ }
23939
+ return false;
23940
+ };
23941
+ TransportStream.prototype._nop = function _nop() {
23942
+ return void 0;
23943
+ };
23944
+ }
23945
+ });
23946
+
23947
+ // ../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/legacy.js
23948
+ var require_legacy2 = __commonJS({
23949
+ "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/legacy.js"(exports, module) {
23950
+ "use strict";
23951
+ var util8 = __require("util");
23952
+ var { LEVEL } = require_triple_beam();
23953
+ var TransportStream = require_modern2();
23954
+ var LegacyTransportStream = module.exports = function LegacyTransportStream2(options = {}) {
23955
+ TransportStream.call(this, options);
23956
+ if (!options.transport || typeof options.transport.log !== "function") {
23957
+ throw new Error("Invalid transport, must be an object with a log method.");
23958
+ }
23959
+ this.transport = options.transport;
23960
+ this.level = this.level || options.transport.level;
23961
+ this.handleExceptions = this.handleExceptions || options.transport.handleExceptions;
23962
+ this._deprecated();
23963
+ function transportError(err) {
23964
+ this.emit("error", err, this.transport);
23965
+ }
23966
+ if (!this.transport.__winstonError) {
23967
+ this.transport.__winstonError = transportError.bind(this);
23968
+ this.transport.on("error", this.transport.__winstonError);
23969
+ }
23970
+ };
23971
+ util8.inherits(LegacyTransportStream, TransportStream);
23972
+ LegacyTransportStream.prototype._write = function _write2(info, enc, callback) {
23973
+ if (this.silent || info.exception === true && !this.handleExceptions) {
23974
+ return callback(null);
23975
+ }
23976
+ if (!this.level || this.levels[this.level] >= this.levels[info[LEVEL]]) {
23977
+ this.transport.log(info[LEVEL], info.message, info, this._nop);
23978
+ }
23979
+ callback(null);
23980
+ };
23981
+ LegacyTransportStream.prototype._writev = function _writev(chunks, callback) {
23982
+ for (let i3 = 0; i3 < chunks.length; i3++) {
23983
+ if (this._accept(chunks[i3])) {
23984
+ this.transport.log(
23985
+ chunks[i3].chunk[LEVEL],
23986
+ chunks[i3].chunk.message,
23987
+ chunks[i3].chunk,
23988
+ this._nop
23989
+ );
23990
+ chunks[i3].callback();
23991
+ }
23992
+ }
23993
+ return callback(null);
23994
+ };
23995
+ LegacyTransportStream.prototype._deprecated = function _deprecated() {
23996
+ console.error([
23997
+ `${this.transport.name} is a legacy winston transport. Consider upgrading: `,
23998
+ "- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"
23999
+ ].join("\n"));
24000
+ };
24001
+ LegacyTransportStream.prototype.close = function close() {
24002
+ if (this.transport.close) {
24003
+ this.transport.close();
24004
+ }
24005
+ if (this.transport.__winstonError) {
24006
+ this.transport.removeListener("error", this.transport.__winstonError);
24007
+ this.transport.__winstonError = null;
24008
+ }
24009
+ };
24010
+ }
24011
+ });
24012
+
24013
+ // ../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/index.js
24014
+ var require_winston_transport2 = __commonJS({
24015
+ "../../node_modules/.pnpm/winston-transport@4.9.0/node_modules/winston-transport/index.js"(exports, module) {
24016
+ "use strict";
24017
+ module.exports = require_modern2();
24018
+ module.exports.LegacyTransportStream = require_legacy2();
24019
+ }
24020
+ });
24021
+
23834
24022
  // ../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js
23835
24023
  var require_delayed_stream = __commonJS({
23836
24024
  "../../node_modules/.pnpm/delayed-stream@1.0.0/node_modules/delayed-stream/lib/delayed_stream.js"(exports, module) {
@@ -75560,8 +75748,11 @@ function utilFormatter() {
75560
75748
  var CLILogger = class {
75561
75749
  logger = console;
75562
75750
  writeStream;
75751
+ batchedHttpLogStreamer;
75752
+ socketTransport;
75563
75753
  // Spinner registers itself as wrapper in order to suspend spinning when logging -- default to the empty wrapper
75564
75754
  wrapper = (cb) => cb();
75755
+ finished = false;
75565
75756
  initWinstonLogger(debug, logFilePath) {
75566
75757
  if (this.logger instanceof import_winston.Logger) {
75567
75758
  return;
@@ -75592,6 +75783,39 @@ var CLILogger = class {
75592
75783
  transports
75593
75784
  });
75594
75785
  }
75786
+ /**
75787
+ * Initialize socket-based logger for child processes.
75788
+ * This replaces file-based logging with socket streaming to the main process.
75789
+ *
75790
+ * @param options - Socket logger configuration
75791
+ * @param socketTransport - Pre-created socket transport (must be created by caller)
75792
+ */
75793
+ initSocketLogger(options, socketTransport) {
75794
+ if (this.logger instanceof import_winston.Logger) {
75795
+ return;
75796
+ }
75797
+ const customLevels = {
75798
+ ...import_winston.config.npm.levels,
75799
+ // 5.5 includes 'debug' but not 'silly'
75800
+ file: 5.5
75801
+ };
75802
+ const customColors = {
75803
+ file: "gray"
75804
+ };
75805
+ (0, import_winston.addColors)(customColors);
75806
+ this.socketTransport = socketTransport;
75807
+ this.logger = (0, import_winston.createLogger)({
75808
+ level: options.debug ? "debug" : "info",
75809
+ levels: customLevels,
75810
+ format: import_winston.format.combine(
75811
+ import_winston.format.timestamp({ format: "YYYY-MM-DD HH:mm:ss.SSS" }),
75812
+ utilFormatter(),
75813
+ import_winston.format.colorize(),
75814
+ import_winston.format.printf(({ level, message, label, timestamp }) => `${timestamp} ${label || "-"} ${level}: ${message}`)
75815
+ ),
75816
+ transports: [new import_winston.transports.Console(), socketTransport]
75817
+ });
75818
+ }
75595
75819
  setWrapper(wrapper) {
75596
75820
  this.wrapper = wrapper;
75597
75821
  }
@@ -75614,6 +75838,26 @@ var CLILogger = class {
75614
75838
  isDebugEnabled() {
75615
75839
  return this.logger instanceof Console || this.logger.isDebugEnabled();
75616
75840
  }
75841
+ /**
75842
+ * Initialize HTTP logging streamer to send logs to backend.
75843
+ * Should be called after reportId is created.
75844
+ *
75845
+ * @param batchedHttpLogStreamer - The BatchedHttpLogStreamer instance (from utils package)
75846
+ */
75847
+ initHttpLogging(batchedHttpLogStreamer) {
75848
+ this.batchedHttpLogStreamer = batchedHttpLogStreamer;
75849
+ }
75850
+ /**
75851
+ * Add a transport to the main process logger.
75852
+ * Used to add the MainProcessTransport so main process logs are sent to backend.
75853
+ *
75854
+ * @param transport - The transport to add
75855
+ */
75856
+ addTransport(transport) {
75857
+ if (this.logger instanceof import_winston.Logger) {
75858
+ this.logger.add(transport);
75859
+ }
75860
+ }
75617
75861
  /**
75618
75862
  * End the logger instance and return a promise
75619
75863
  * that resolves when the logger is finished.
@@ -75622,8 +75866,14 @@ var CLILogger = class {
75622
75866
  * in errors that are swallowed by the 'error' event listener in this function.
75623
75867
  */
75624
75868
  async finish() {
75869
+ if (this.finished) {
75870
+ return;
75871
+ }
75872
+ this.finished = true;
75873
+ await this.batchedHttpLogStreamer?.close();
75874
+ this.socketTransport?.close?.();
75625
75875
  return new Promise((resolve23) => {
75626
- if (this.logger instanceof Console || this.logger.writableEnded) {
75876
+ if (this.logger instanceof Console) {
75627
75877
  resolve23();
75628
75878
  return;
75629
75879
  }
@@ -75996,9 +76246,117 @@ var Spinner = class _Spinner {
75996
76246
  }
75997
76247
  };
75998
76248
 
76249
+ // ../utils/src/logging/socket-transport.ts
76250
+ var import_winston_transport = __toESM(require_winston_transport2(), 1);
76251
+ import { Socket } from "net";
76252
+ var SocketTransport = class extends import_winston_transport.default {
76253
+ socket = null;
76254
+ socketPath;
76255
+ context;
76256
+ processVariant;
76257
+ connected = false;
76258
+ messageQueue = [];
76259
+ reconnectTimer = null;
76260
+ constructor(options) {
76261
+ super(options);
76262
+ this.socketPath = options.socketPath;
76263
+ this.context = options.context;
76264
+ this.processVariant = options.processVariant;
76265
+ this.connect();
76266
+ }
76267
+ connect() {
76268
+ this.socket = new Socket();
76269
+ this.socket.on("connect", () => {
76270
+ this.connected = true;
76271
+ const handshake = {
76272
+ type: "handshake",
76273
+ pid: process.pid,
76274
+ processVariant: this.processVariant,
76275
+ startTime: Date.now()
76276
+ };
76277
+ this.sendMessage(handshake);
76278
+ this.flushQueue();
76279
+ });
76280
+ this.socket.on("error", () => {
76281
+ this.connected = false;
76282
+ this.scheduleReconnect();
76283
+ });
76284
+ this.socket.on("close", () => {
76285
+ this.connected = false;
76286
+ this.scheduleReconnect();
76287
+ });
76288
+ this.socket.connect(this.socketPath);
76289
+ }
76290
+ scheduleReconnect() {
76291
+ if (this.reconnectTimer) return;
76292
+ this.reconnectTimer = setTimeout(() => {
76293
+ this.reconnectTimer = null;
76294
+ if (!this.connected && this.socket) {
76295
+ this.connect();
76296
+ }
76297
+ }, 1e3);
76298
+ }
76299
+ sendMessage(message) {
76300
+ if (!this.socket || !this.connected) {
76301
+ return;
76302
+ }
76303
+ const serialized = JSON.stringify(message) + "\n";
76304
+ this.socket.write(serialized, (error) => {
76305
+ if (error) {
76306
+ this.connected = false;
76307
+ }
76308
+ });
76309
+ }
76310
+ flushQueue() {
76311
+ while (this.messageQueue.length > 0 && this.connected) {
76312
+ const message = this.messageQueue.shift();
76313
+ if (this.socket) {
76314
+ this.socket.write(message);
76315
+ }
76316
+ }
76317
+ }
76318
+ log(info, callback) {
76319
+ setImmediate(() => {
76320
+ this.emit("logged", info);
76321
+ });
76322
+ const logMessage = {
76323
+ context: this.context,
76324
+ timestamp: info.timestamp || (/* @__PURE__ */ new Date()).toISOString(),
76325
+ level: info.level,
76326
+ message: info.message,
76327
+ label: info.label
76328
+ };
76329
+ this.sendMessage(logMessage);
76330
+ callback();
76331
+ }
76332
+ close() {
76333
+ if (this.reconnectTimer) {
76334
+ clearTimeout(this.reconnectTimer);
76335
+ this.reconnectTimer = null;
76336
+ }
76337
+ if (this.socket) {
76338
+ this.socket.destroy();
76339
+ this.socket = null;
76340
+ }
76341
+ this.connected = false;
76342
+ this.messageQueue = [];
76343
+ }
76344
+ };
76345
+
75999
76346
  // ../utils/src/cli-utils.ts
76000
- async function withLoggerAndSpinner(spinnerHeader, loggingOptions, f2) {
76001
- logger.initWinstonLogger(loggingOptions.debug, loggingOptions.coanaLogPath);
76347
+ async function withLoggerAndSpinner(spinnerHeader, loggingOptions, f2, processVariant) {
76348
+ if (loggingOptions.coanaSocketPath) {
76349
+ const context = `${processVariant}-${process.pid}`;
76350
+ const socketTransport = new SocketTransport({
76351
+ socketPath: loggingOptions.coanaSocketPath,
76352
+ context,
76353
+ processVariant,
76354
+ level: "file"
76355
+ });
76356
+ logger.initSocketLogger({ debug: loggingOptions.debug }, socketTransport);
76357
+ } else {
76358
+ logger.initWinstonLogger(loggingOptions.debug, loggingOptions.coanaLogPath);
76359
+ }
76002
76360
  logger.silent = loggingOptions.silent;
76003
76361
  const spinner = Spinner.instance({
76004
76362
  text: spinnerHeader,
@@ -80343,6 +80701,18 @@ async function finalizeUpgradePurlRun(upgradePurlRunId, status, stackTrace, logF
80343
80701
  handleError(error, "Error finalizing upgrade purl run", false);
80344
80702
  }
80345
80703
  }
80704
+ async function sendLogChunkSocket(reportId, logs) {
80705
+ try {
80706
+ const url3 = getSocketApiUrl("tier1-reachability-scan/add-log-chunk");
80707
+ const data2 = {
80708
+ tier1_reachability_scan_id: reportId,
80709
+ logs
80710
+ };
80711
+ await axios2.post(url3, data2, { headers: getAuthHeaders() });
80712
+ } catch (error) {
80713
+ console.warn("Failed to send log chunk to Socket:", error.message);
80714
+ }
80715
+ }
80346
80716
  function getSocketAPI() {
80347
80717
  return {
80348
80718
  createSocketTier1Scan,
@@ -80354,7 +80724,8 @@ function getSocketAPI() {
80354
80724
  registerAutofixOrUpgradePurlRun,
80355
80725
  finalizeAutofixRun,
80356
80726
  registerUpgradePurlRun,
80357
- finalizeUpgradePurlRun
80727
+ finalizeUpgradePurlRun,
80728
+ sendLogChunkSocket
80358
80729
  };
80359
80730
  }
80360
80731
 
@@ -80463,6 +80834,14 @@ var DashboardAPI = class {
80463
80834
  return await this.coanaAPI.getBucketsForLastReport(subprojectPath, workspacePath, ecosystem, reportId, apiKey3);
80464
80835
  }
80465
80836
  }
80837
+ async sendLogChunk(reportId, logs) {
80838
+ if (this.disableAnalyticsSharing) {
80839
+ return;
80840
+ }
80841
+ if (this.socketMode) {
80842
+ await this.socketAPI.sendLogChunkSocket(reportId, logs);
80843
+ }
80844
+ }
80466
80845
  };
80467
80846
 
80468
80847
  // dist/analyzers/go-analyzer.js
@@ -116193,7 +116572,7 @@ async function getReachabilityAnalyzersStateFromInput(rootWorkingDir, subproject
116193
116572
  }
116194
116573
 
116195
116574
  // dist/reachability-analyzers-cli.js
116196
- var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").argument("<rootWorkingDir>", "Directory where Coana is run").argument("<subprojectDir>", "Project root of directory being analyzed").argument("<workspacePath>", "Path to directory to analyze relative to subprojectDir").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output file for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (rootWorkingDir, subprojectDir, workspacePath, options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
116575
+ var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").argument("<rootWorkingDir>", "Directory where Coana is run").argument("<subprojectDir>", "Project root of directory being analyzed").argument("<workspacePath>", "Path to directory to analyze relative to subprojectDir").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-socket-path <socketPath>", "Coana socket path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output file for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (rootWorkingDir, subprojectDir, workspacePath, options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
116197
116576
  const state = await getReachabilityAnalyzersStateFromInput(rootWorkingDir, subprojectDir, workspacePath, options.inputFile);
116198
116577
  const result = await runReachabilityAnalysis(state);
116199
116578
  if (options.outputFile) {
@@ -116202,8 +116581,8 @@ var runReachabilityAnalysisCmd = new Command().name("runReachabilityAnalysis").a
116202
116581
  } else {
116203
116582
  logger.info("Result:", JSON.stringify(result, null, 2));
116204
116583
  }
116205
- }));
116206
- var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output file for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
116584
+ }, "reachability-analyzer"));
116585
+ var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("--coana-socket-path <socketPath>", "Coana socket path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).requiredOption("-i, --input-file <inputFile>", "Input file for data and vulnerabilities").requiredOption("-o, --output-file <outputFile>", "Output file for the results").configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (options) => withLoggerAndSpinner("Coana Reachability Analyzers", options, async () => {
116207
116586
  const { ecosystem, dependencyChain, vulnerability } = JSON.parse(await readFile14(options.inputFile, "utf-8"));
116208
116587
  const result = await analyzePackages(ecosystem, deserializeDependencyChain(ecosystem, dependencyChain), vulnerability);
116209
116588
  if (options.outputFile) {
@@ -116212,8 +116591,8 @@ var runOnDependencyChainCmd = new Command().name("runOnDependencyChain").option(
116212
116591
  } else {
116213
116592
  logger.info("Result:", JSON.stringify(result, null, 2));
116214
116593
  }
116215
- }));
116216
- var runOnPackageRegistryPackageCmd = new Command().name("runOnPackageRegistryPackage").argument("<mainPackage>", "Main package to analyze").requiredOption("--dependencies <dependencies...>", "Dependencies to analyze (installed as a dependency chain in the provided order)").requiredOption("--api-key <apiKey>", "Coana ApiKey").requiredOption("--ecosystem <ecosystem>", "Ecosystem for mainPackage and dependencies").requiredOption("-v, --vulnerability <vulnerability>", "GHSA id for vulnerability").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run", "60").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-o, --output-file <outputFile>", "Output file for the results").option("--coana-log-path <logPath>", "Coana log path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (mainPackage, options) => {
116594
+ }, "reachability-analyzer"));
116595
+ var runOnPackageRegistryPackageCmd = new Command().name("runOnPackageRegistryPackage").argument("<mainPackage>", "Main package to analyze").requiredOption("--dependencies <dependencies...>", "Dependencies to analyze (installed as a dependency chain in the provided order)").requiredOption("--api-key <apiKey>", "Coana ApiKey").requiredOption("--ecosystem <ecosystem>", "Ecosystem for mainPackage and dependencies").requiredOption("-v, --vulnerability <vulnerability>", "GHSA id for vulnerability").option("-d, --debug", "Enable debug logging", false).option("-s, --silent", "Silence all debug/warning output", false).option("-a, --analysis-timeout <timeout>", "Set <timeout> in seconds for each reachability analysis run", "60").option("--memory-limit <memoryInMB>", "Set memory limit for analysis to <memoryInMB> megabytes of memory.", "8192").option("-o, --output-file <outputFile>", "Output file for the results").option("--coana-socket-path <socketPath>", "Coana socket path").option("--silent-spinner", "Silence spinner", "CI" in process.env || !process.stdin.isTTY).configureHelp({ sortSubcommands: true, sortOptions: true }).action(async (mainPackage, options) => {
116217
116596
  withLoggerAndSpinner("Coana Reachability Analyzers runOnPackages", options, async () => {
116218
116597
  let vulnerability;
116219
116598
  try {
@@ -116240,7 +116619,7 @@ var runOnPackageRegistryPackageCmd = new Command().name("runOnPackageRegistryPac
116240
116619
  } else {
116241
116620
  logger.info("Result:", JSON.stringify(result, null, 2));
116242
116621
  }
116243
- });
116622
+ }, "reachability-analyzer");
116244
116623
  });
116245
116624
  new Command().addCommand(runReachabilityAnalysisCmd, { isDefault: true }).addCommand(runOnDependencyChainCmd).addCommand(runOnPackageRegistryPackageCmd).parseAsync();
116246
116625
  /*! Bundled license information: