@threadbase-sh/streamer 1.18.2 → 1.18.4

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/dist/cli.cjs CHANGED
@@ -26078,7 +26078,7 @@ var require_thread_stream = __commonJS({
26078
26078
  var { version: version2 } = require_package();
26079
26079
  var { EventEmitter: EventEmitter6 } = require("events");
26080
26080
  var { Worker: Worker2 } = require("worker_threads");
26081
- var { join: join23 } = require("path");
26081
+ var { join: join24 } = require("path");
26082
26082
  var { pathToFileURL } = require("url");
26083
26083
  var { wait } = require_wait();
26084
26084
  var {
@@ -26129,7 +26129,7 @@ var require_thread_stream = __commonJS({
26129
26129
  function createWorker(stream, opts) {
26130
26130
  const { filename, workerData } = opts;
26131
26131
  const bundlerOverrides = "__bundlerPathsOverrides" in globalThis ? globalThis.__bundlerPathsOverrides : {};
26132
- const toExecute = bundlerOverrides["thread-stream-worker"] || join23(__dirname, "lib", "worker.js");
26132
+ const toExecute = bundlerOverrides["thread-stream-worker"] || join24(__dirname, "lib", "worker.js");
26133
26133
  const worker = new Worker2(toExecute, {
26134
26134
  ...opts.workerOpts,
26135
26135
  name: opts.workerOpts?.name || "thread-stream",
@@ -26597,7 +26597,7 @@ var require_transport = __commonJS({
26597
26597
  var { createRequire } = require("module");
26598
26598
  var { existsSync: existsSync11 } = require("fs");
26599
26599
  var getCallers = require_caller();
26600
- var { join: join23, isAbsolute: isAbsolute3, sep: sep2 } = require("path");
26600
+ var { join: join24, isAbsolute: isAbsolute3, sep: sep2 } = require("path");
26601
26601
  var { fileURLToPath: fileURLToPath3 } = require("url");
26602
26602
  var sleep = require_atomic_sleep();
26603
26603
  var onExit = require_on_exit_leak_free();
@@ -26750,7 +26750,7 @@ var require_transport = __commonJS({
26750
26750
  throw new Error("only one of target or targets can be specified");
26751
26751
  }
26752
26752
  if (targets) {
26753
- target = bundlerOverrides["pino-worker"] || join23(__dirname, "worker.js");
26753
+ target = bundlerOverrides["pino-worker"] || join24(__dirname, "worker.js");
26754
26754
  options.targets = targets.filter((dest) => dest.target).map((dest) => {
26755
26755
  return {
26756
26756
  ...dest,
@@ -26768,7 +26768,7 @@ var require_transport = __commonJS({
26768
26768
  });
26769
26769
  });
26770
26770
  } else if (pipeline2) {
26771
- target = bundlerOverrides["pino-worker"] || join23(__dirname, "worker.js");
26771
+ target = bundlerOverrides["pino-worker"] || join24(__dirname, "worker.js");
26772
26772
  options.pipelines = [pipeline2.map((dest) => {
26773
26773
  return {
26774
26774
  ...dest,
@@ -26791,7 +26791,7 @@ var require_transport = __commonJS({
26791
26791
  return origin;
26792
26792
  }
26793
26793
  if (origin === "pino/file") {
26794
- return join23(__dirname, "..", "file.js");
26794
+ return join24(__dirname, "..", "file.js");
26795
26795
  }
26796
26796
  let fixTarget2;
26797
26797
  for (const filePath of callers) {
@@ -27772,7 +27772,7 @@ var require_safe_stable_stringify = __commonJS({
27772
27772
  return circularValue;
27773
27773
  }
27774
27774
  let res = "";
27775
- let join23 = ",";
27775
+ let join24 = ",";
27776
27776
  const originalIndentation = indentation;
27777
27777
  if (Array.isArray(value)) {
27778
27778
  if (value.length === 0) {
@@ -27786,7 +27786,7 @@ var require_safe_stable_stringify = __commonJS({
27786
27786
  indentation += spacer;
27787
27787
  res += `
27788
27788
  ${indentation}`;
27789
- join23 = `,
27789
+ join24 = `,
27790
27790
  ${indentation}`;
27791
27791
  }
27792
27792
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -27794,13 +27794,13 @@ ${indentation}`;
27794
27794
  for (; i < maximumValuesToStringify - 1; i++) {
27795
27795
  const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
27796
27796
  res += tmp2 !== void 0 ? tmp2 : "null";
27797
- res += join23;
27797
+ res += join24;
27798
27798
  }
27799
27799
  const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
27800
27800
  res += tmp !== void 0 ? tmp : "null";
27801
27801
  if (value.length - 1 > maximumBreadth) {
27802
27802
  const removedKeys = value.length - maximumBreadth - 1;
27803
- res += `${join23}"... ${getItemCount(removedKeys)} not stringified"`;
27803
+ res += `${join24}"... ${getItemCount(removedKeys)} not stringified"`;
27804
27804
  }
27805
27805
  if (spacer !== "") {
27806
27806
  res += `
@@ -27821,7 +27821,7 @@ ${originalIndentation}`;
27821
27821
  let separator = "";
27822
27822
  if (spacer !== "") {
27823
27823
  indentation += spacer;
27824
- join23 = `,
27824
+ join24 = `,
27825
27825
  ${indentation}`;
27826
27826
  whitespace = " ";
27827
27827
  }
@@ -27835,13 +27835,13 @@ ${indentation}`;
27835
27835
  const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
27836
27836
  if (tmp !== void 0) {
27837
27837
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
27838
- separator = join23;
27838
+ separator = join24;
27839
27839
  }
27840
27840
  }
27841
27841
  if (keyLength > maximumBreadth) {
27842
27842
  const removedKeys = keyLength - maximumBreadth;
27843
27843
  res += `${separator}"...":${whitespace}"${getItemCount(removedKeys)} not stringified"`;
27844
- separator = join23;
27844
+ separator = join24;
27845
27845
  }
27846
27846
  if (spacer !== "" && separator.length > 1) {
27847
27847
  res = `
@@ -27882,7 +27882,7 @@ ${originalIndentation}`;
27882
27882
  }
27883
27883
  const originalIndentation = indentation;
27884
27884
  let res = "";
27885
- let join23 = ",";
27885
+ let join24 = ",";
27886
27886
  if (Array.isArray(value)) {
27887
27887
  if (value.length === 0) {
27888
27888
  return "[]";
@@ -27895,7 +27895,7 @@ ${originalIndentation}`;
27895
27895
  indentation += spacer;
27896
27896
  res += `
27897
27897
  ${indentation}`;
27898
- join23 = `,
27898
+ join24 = `,
27899
27899
  ${indentation}`;
27900
27900
  }
27901
27901
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
@@ -27903,13 +27903,13 @@ ${indentation}`;
27903
27903
  for (; i < maximumValuesToStringify - 1; i++) {
27904
27904
  const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
27905
27905
  res += tmp2 !== void 0 ? tmp2 : "null";
27906
- res += join23;
27906
+ res += join24;
27907
27907
  }
27908
27908
  const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
27909
27909
  res += tmp !== void 0 ? tmp : "null";
27910
27910
  if (value.length - 1 > maximumBreadth) {
27911
27911
  const removedKeys = value.length - maximumBreadth - 1;
27912
- res += `${join23}"... ${getItemCount(removedKeys)} not stringified"`;
27912
+ res += `${join24}"... ${getItemCount(removedKeys)} not stringified"`;
27913
27913
  }
27914
27914
  if (spacer !== "") {
27915
27915
  res += `
@@ -27922,7 +27922,7 @@ ${originalIndentation}`;
27922
27922
  let whitespace = "";
27923
27923
  if (spacer !== "") {
27924
27924
  indentation += spacer;
27925
- join23 = `,
27925
+ join24 = `,
27926
27926
  ${indentation}`;
27927
27927
  whitespace = " ";
27928
27928
  }
@@ -27931,7 +27931,7 @@ ${indentation}`;
27931
27931
  const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
27932
27932
  if (tmp !== void 0) {
27933
27933
  res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
27934
- separator = join23;
27934
+ separator = join24;
27935
27935
  }
27936
27936
  }
27937
27937
  if (spacer !== "" && separator.length > 1) {
@@ -27989,20 +27989,20 @@ ${originalIndentation}`;
27989
27989
  indentation += spacer;
27990
27990
  let res2 = `
27991
27991
  ${indentation}`;
27992
- const join24 = `,
27992
+ const join25 = `,
27993
27993
  ${indentation}`;
27994
27994
  const maximumValuesToStringify = Math.min(value.length, maximumBreadth);
27995
27995
  let i = 0;
27996
27996
  for (; i < maximumValuesToStringify - 1; i++) {
27997
27997
  const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
27998
27998
  res2 += tmp2 !== void 0 ? tmp2 : "null";
27999
- res2 += join24;
27999
+ res2 += join25;
28000
28000
  }
28001
28001
  const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
28002
28002
  res2 += tmp !== void 0 ? tmp : "null";
28003
28003
  if (value.length - 1 > maximumBreadth) {
28004
28004
  const removedKeys = value.length - maximumBreadth - 1;
28005
- res2 += `${join24}"... ${getItemCount(removedKeys)} not stringified"`;
28005
+ res2 += `${join25}"... ${getItemCount(removedKeys)} not stringified"`;
28006
28006
  }
28007
28007
  res2 += `
28008
28008
  ${originalIndentation}`;
@@ -28018,16 +28018,16 @@ ${originalIndentation}`;
28018
28018
  return '"[Object]"';
28019
28019
  }
28020
28020
  indentation += spacer;
28021
- const join23 = `,
28021
+ const join24 = `,
28022
28022
  ${indentation}`;
28023
28023
  let res = "";
28024
28024
  let separator = "";
28025
28025
  let maximumPropertiesToStringify = Math.min(keyLength, maximumBreadth);
28026
28026
  if (isTypedArrayWithEntries(value)) {
28027
- res += stringifyTypedArray(value, join23, maximumBreadth);
28027
+ res += stringifyTypedArray(value, join24, maximumBreadth);
28028
28028
  keys = keys.slice(value.length);
28029
28029
  maximumPropertiesToStringify -= value.length;
28030
- separator = join23;
28030
+ separator = join24;
28031
28031
  }
28032
28032
  if (deterministic) {
28033
28033
  keys = sort(keys, comparator);
@@ -28038,13 +28038,13 @@ ${indentation}`;
28038
28038
  const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
28039
28039
  if (tmp !== void 0) {
28040
28040
  res += `${separator}${strEscape(key2)}: ${tmp}`;
28041
- separator = join23;
28041
+ separator = join24;
28042
28042
  }
28043
28043
  }
28044
28044
  if (keyLength > maximumBreadth) {
28045
28045
  const removedKeys = keyLength - maximumBreadth;
28046
28046
  res += `${separator}"...": "${getItemCount(removedKeys)} not stringified"`;
28047
- separator = join23;
28047
+ separator = join24;
28048
28048
  }
28049
28049
  if (separator !== "") {
28050
28050
  res = `
@@ -124398,20 +124398,20 @@ var require_semver2 = __commonJS({
124398
124398
 
124399
124399
  // src/lifecycle/constants.ts
124400
124400
  function installDir() {
124401
- return process.env.THREADBASE_INSTALL_DIR ?? (0, import_node_path20.join)((0, import_node_os4.homedir)(), ".threadbase");
124401
+ return process.env.THREADBASE_INSTALL_DIR ?? (0, import_node_path21.join)((0, import_node_os4.homedir)(), ".threadbase");
124402
124402
  }
124403
124403
  function markerPath() {
124404
- return (0, import_node_path20.join)(installDir(), "prod-suspended.json");
124404
+ return (0, import_node_path21.join)(installDir(), "prod-suspended.json");
124405
124405
  }
124406
124406
  function prefsPath() {
124407
- return (0, import_node_path20.join)(installDir(), "dev-prefs.json");
124407
+ return (0, import_node_path21.join)(installDir(), "dev-prefs.json");
124408
124408
  }
124409
- var import_node_os4, import_node_path20, LAUNCHD_LABEL, TASK_NAME;
124409
+ var import_node_os4, import_node_path21, LAUNCHD_LABEL, TASK_NAME;
124410
124410
  var init_constants = __esm({
124411
124411
  "src/lifecycle/constants.ts"() {
124412
124412
  "use strict";
124413
124413
  import_node_os4 = require("os");
124414
- import_node_path20 = require("path");
124414
+ import_node_path21 = require("path");
124415
124415
  LAUNCHD_LABEL = "com.ronen.threadbase";
124416
124416
  TASK_NAME = process.env.THREADBASE_TASK_NAME ?? "Threadbase";
124417
124417
  }
@@ -124486,8 +124486,8 @@ function darwinPlistPath() {
124486
124486
  return `${process.env.HOME}/Library/LaunchAgents/${resolveLoadedLabel()}.plist`;
124487
124487
  }
124488
124488
  function getLogPaths() {
124489
- const dir = (0, import_node_path21.join)(installDir(), "logs");
124490
- return { stdout: (0, import_node_path21.join)(dir, "stdout.log"), stderr: (0, import_node_path21.join)(dir, "stderr.log") };
124489
+ const dir = (0, import_node_path22.join)(installDir(), "logs");
124490
+ return { stdout: (0, import_node_path22.join)(dir, "stdout.log"), stderr: (0, import_node_path22.join)(dir, "stderr.log") };
124491
124491
  }
124492
124492
  function getAgentPid() {
124493
124493
  try {
@@ -124507,12 +124507,12 @@ function getAgentPid() {
124507
124507
  return null;
124508
124508
  }
124509
124509
  }
124510
- var import_node_child_process4, import_node_path21, BREW_LAUNCHD_LABEL2;
124510
+ var import_node_child_process4, import_node_path22, BREW_LAUNCHD_LABEL2;
124511
124511
  var init_launchd = __esm({
124512
124512
  "src/lifecycle/launchd.ts"() {
124513
124513
  "use strict";
124514
124514
  import_node_child_process4 = require("child_process");
124515
- import_node_path21 = require("path");
124515
+ import_node_path22 = require("path");
124516
124516
  init_constants();
124517
124517
  BREW_LAUNCHD_LABEL2 = "homebrew.mxcl.tb-streamer";
124518
124518
  }
@@ -124551,7 +124551,7 @@ function readMarker() {
124551
124551
  }
124552
124552
  function writeMarker(marker) {
124553
124553
  MarkerSchema.parse(marker);
124554
- (0, import_node_fs18.mkdirSync)((0, import_node_path22.dirname)(markerPath()), { recursive: true });
124554
+ (0, import_node_fs18.mkdirSync)((0, import_node_path23.dirname)(markerPath()), { recursive: true });
124555
124555
  const tmp = `${markerPath()}.tmp`;
124556
124556
  (0, import_node_fs18.writeFileSync)(tmp, `${JSON.stringify(marker, null, 2)}
124557
124557
  `, { mode: 384 });
@@ -124560,12 +124560,12 @@ function writeMarker(marker) {
124560
124560
  function clearMarker() {
124561
124561
  if ((0, import_node_fs18.existsSync)(markerPath())) (0, import_node_fs18.rmSync)(markerPath());
124562
124562
  }
124563
- var import_node_fs18, import_node_path22, log3;
124563
+ var import_node_fs18, import_node_path23, log3;
124564
124564
  var init_marker = __esm({
124565
124565
  "src/lifecycle/marker.ts"() {
124566
124566
  "use strict";
124567
124567
  import_node_fs18 = require("fs");
124568
- import_node_path22 = require("path");
124568
+ import_node_path23 = require("path");
124569
124569
  init_logger();
124570
124570
  init_constants();
124571
124571
  init_marker_schema();
@@ -124672,7 +124672,7 @@ function readPrefs() {
124672
124672
  }
124673
124673
  function savePrefs(p2) {
124674
124674
  const path2 = prefsPath();
124675
- (0, import_node_fs20.mkdirSync)((0, import_node_path23.dirname)(path2), { recursive: true });
124675
+ (0, import_node_fs20.mkdirSync)((0, import_node_path24.dirname)(path2), { recursive: true });
124676
124676
  const tmp = `${path2}.tmp`;
124677
124677
  (0, import_node_fs20.writeFileSync)(tmp, `${JSON.stringify(p2, null, 2)}
124678
124678
  `, { mode: 384 });
@@ -124699,12 +124699,12 @@ function forgetAll() {
124699
124699
  const path2 = prefsPath();
124700
124700
  if ((0, import_node_fs20.existsSync)(path2)) (0, import_node_fs20.rmSync)(path2);
124701
124701
  }
124702
- var import_node_fs20, import_node_path23, log5, PrefsSchema;
124702
+ var import_node_fs20, import_node_path24, log5, PrefsSchema;
124703
124703
  var init_prefs = __esm({
124704
124704
  "src/lifecycle/prefs.ts"() {
124705
124705
  "use strict";
124706
124706
  import_node_fs20 = require("fs");
124707
- import_node_path23 = require("path");
124707
+ import_node_path24 = require("path");
124708
124708
  init_zod();
124709
124709
  init_logger();
124710
124710
  init_constants();
@@ -144502,6 +144502,7 @@ function stampVersionTxt(destDir, version2) {
144502
144502
 
144503
144503
  // src/updater/swap.ts
144504
144504
  var import_node_fs9 = require("fs");
144505
+ var import_node_path11 = require("path");
144505
144506
  var import_semver2 = __toESM(require_semver2(), 1);
144506
144507
  var KEEP_LAST_N = 2;
144507
144508
  function swapCurrent(version2) {
@@ -144517,6 +144518,7 @@ function swapCurrent(version2) {
144517
144518
  (0, import_node_fs9.rmSync)(CURRENT_SYMLINK, { recursive: true, force: true });
144518
144519
  }
144519
144520
  (0, import_node_fs9.renameSync)(tmp, CURRENT_SYMLINK);
144521
+ (0, import_node_fs9.copyFileSync)((0, import_node_path11.join)(CURRENT_SYMLINK, "dist", "cli.cjs"), (0, import_node_path11.join)(THREADBASE_ROOT, "cli.js"));
144520
144522
  return;
144521
144523
  }
144522
144524
  const tmpLink = `${CURRENT_SYMLINK}.new`;
@@ -144525,6 +144527,11 @@ function swapCurrent(version2) {
144525
144527
  }
144526
144528
  (0, import_node_fs9.symlinkSync)(target, tmpLink);
144527
144529
  (0, import_node_fs9.renameSync)(tmpLink, CURRENT_SYMLINK);
144530
+ const cliJs = (0, import_node_path11.join)(THREADBASE_ROOT, "cli.js");
144531
+ const tmpCliJs = `${cliJs}.new`;
144532
+ if ((0, import_node_fs9.existsSync)(tmpCliJs) || lstatSafeIsSymlink(tmpCliJs)) (0, import_node_fs9.unlinkSync)(tmpCliJs);
144533
+ (0, import_node_fs9.symlinkSync)((0, import_node_path11.join)(target, "dist", "cli.cjs"), tmpCliJs);
144534
+ (0, import_node_fs9.renameSync)(tmpCliJs, cliJs);
144528
144535
  }
144529
144536
  function lstatSafeIsSymlink(path2) {
144530
144537
  try {
@@ -144560,7 +144567,7 @@ var import_fs24 = __toESM(require("fs"), 1);
144560
144567
  var import_node_events3 = require("events");
144561
144568
  var import_node_stream3 = __toESM(require("stream"), 1);
144562
144569
  var import_node_string_decoder = require("string_decoder");
144563
- var import_node_path11 = __toESM(require("path"), 1);
144570
+ var import_node_path12 = __toESM(require("path"), 1);
144564
144571
  var import_node_fs10 = __toESM(require("fs"), 1);
144565
144572
  var import_path20 = require("path");
144566
144573
  var import_events5 = require("events");
@@ -144568,27 +144575,27 @@ var import_assert = __toESM(require("assert"), 1);
144568
144575
  var import_buffer = require("buffer");
144569
144576
  var Ms = __toESM(require("zlib"), 1);
144570
144577
  var import_zlib = __toESM(require("zlib"), 1);
144571
- var import_node_path12 = require("path");
144572
144578
  var import_node_path13 = require("path");
144579
+ var import_node_path14 = require("path");
144573
144580
  var import_fs25 = __toESM(require("fs"), 1);
144574
144581
  var import_fs26 = __toESM(require("fs"), 1);
144575
144582
  var import_path21 = __toESM(require("path"), 1);
144576
- var import_node_path14 = require("path");
144583
+ var import_node_path15 = require("path");
144577
144584
  var import_path22 = __toESM(require("path"), 1);
144578
144585
  var import_node_fs11 = __toESM(require("fs"), 1);
144579
144586
  var import_node_assert = __toESM(require("assert"), 1);
144580
144587
  var import_node_crypto5 = require("crypto");
144581
144588
  var import_node_fs12 = __toESM(require("fs"), 1);
144582
- var import_node_path15 = __toESM(require("path"), 1);
144589
+ var import_node_path16 = __toESM(require("path"), 1);
144583
144590
  var import_fs27 = __toESM(require("fs"), 1);
144584
144591
  var import_node_fs13 = __toESM(require("fs"), 1);
144585
- var import_node_path16 = __toESM(require("path"), 1);
144592
+ var import_node_path17 = __toESM(require("path"), 1);
144586
144593
  var import_node_fs14 = __toESM(require("fs"), 1);
144587
144594
  var import_promises16 = __toESM(require("fs/promises"), 1);
144588
- var import_node_path17 = __toESM(require("path"), 1);
144589
- var import_node_path18 = require("path");
144595
+ var import_node_path18 = __toESM(require("path"), 1);
144596
+ var import_node_path19 = require("path");
144590
144597
  var import_node_fs15 = __toESM(require("fs"), 1);
144591
- var import_node_path19 = __toESM(require("path"), 1);
144598
+ var import_node_path20 = __toESM(require("path"), 1);
144592
144599
  var Mr = Object.defineProperty;
144593
144600
  var Br = (s3, t2) => {
144594
144601
  for (var e in t2) Mr(s3, e, { get: t2[e], enumerable: true });
@@ -145481,12 +145488,12 @@ var C2 = class {
145481
145488
  }
145482
145489
  };
145483
145490
  var cn = (s3, t2) => {
145484
- let i = s3, r = "", n, o = import_node_path12.posix.parse(s3).root || ".";
145491
+ let i = s3, r = "", n, o = import_node_path13.posix.parse(s3).root || ".";
145485
145492
  if (Buffer.byteLength(i) < 100) n = [i, r, false];
145486
145493
  else {
145487
- r = import_node_path12.posix.dirname(i), i = import_node_path12.posix.basename(i);
145494
+ r = import_node_path13.posix.dirname(i), i = import_node_path13.posix.basename(i);
145488
145495
  do
145489
- Buffer.byteLength(i) <= 100 && Buffer.byteLength(r) <= t2 ? n = [i, r, false] : Buffer.byteLength(i) > 100 && Buffer.byteLength(r) <= t2 ? n = [i.slice(0, 99), r, true] : (i = import_node_path12.posix.join(import_node_path12.posix.basename(r), i), r = import_node_path12.posix.dirname(r));
145496
+ Buffer.byteLength(i) <= 100 && Buffer.byteLength(r) <= t2 ? n = [i, r, false] : Buffer.byteLength(i) > 100 && Buffer.byteLength(r) <= t2 ? n = [i.slice(0, 99), r, true] : (i = import_node_path13.posix.join(import_node_path13.posix.basename(r), i), r = import_node_path13.posix.dirname(r));
145490
145497
  while (r !== o && n === void 0);
145491
145498
  n || (n = [s3.slice(0, 99), "", true]);
145492
145499
  }
@@ -145532,7 +145539,7 @@ var ct = class s {
145532
145539
  if (t2 === "") return Buffer.allocUnsafe(0);
145533
145540
  let e = Buffer.byteLength(t2), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
145534
145541
  for (let n = 0; n < 512; n++) r[n] = 0;
145535
- new C2({ path: ("PaxHeader/" + (0, import_node_path13.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t2, 512, e, "utf8");
145542
+ new C2({ path: ("PaxHeader/" + (0, import_node_path14.basename)(this.path ?? "")).slice(0, 99), mode: this.mode || 420, uid: this.uid, gid: this.gid, size: e, mtime: this.mtime, type: this.global ? "GlobalExtendedHeader" : "ExtendedHeader", linkpath: "", uname: this.uname || "", gname: this.gname || "", devmaj: 0, devmin: 0, atime: this.atime, ctime: this.ctime }).encode(r), r.write(t2, 512, e, "utf8");
145536
145543
  for (let n = e + 512; n < r.length; n++) r[n] = 0;
145537
145544
  return r;
145538
145545
  }
@@ -145944,7 +145951,7 @@ var Ft = K2(In, Fn, (s3) => new st(s3), (s3) => new st(s3), (s3, t2) => {
145944
145951
  t2?.length && Xi(s3, t2), s3.noResume || An(s3);
145945
145952
  });
145946
145953
  var qi = (s3, t2, e) => (s3 &= 4095, e && (s3 = (s3 | 384) & -19), t2 && (s3 & 256 && (s3 |= 64), s3 & 32 && (s3 |= 8), s3 & 4 && (s3 |= 1)), s3);
145947
- var { isAbsolute: kn, parse: Vs } = import_node_path14.win32;
145954
+ var { isAbsolute: kn, parse: Vs } = import_node_path15.win32;
145948
145955
  var le = (s3) => {
145949
145956
  let t2 = "", e = Vs(s3);
145950
145957
  for (; kn(s3) || e.root; ) {
@@ -146653,11 +146660,11 @@ var Gn = (s3, t2) => {
146653
146660
  };
146654
146661
  var ar = (s3, t2) => {
146655
146662
  t2.forEach((e) => {
146656
- e.charAt(0) === "@" ? Ft({ file: import_node_path11.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
146663
+ e.charAt(0) === "@" ? Ft({ file: import_node_path12.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
146657
146664
  }), s3.end();
146658
146665
  };
146659
146666
  var lr = async (s3, t2) => {
146660
- for (let e of t2) e.charAt(0) === "@" ? await Ft({ file: import_node_path11.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
146667
+ for (let e of t2) e.charAt(0) === "@" ? await Ft({ file: import_node_path12.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => {
146661
146668
  s3.add(i);
146662
146669
  } }) : s3.add(e);
146663
146670
  s3.end();
@@ -146695,13 +146702,13 @@ var pi = (s3, t2, e, i) => {
146695
146702
  });
146696
146703
  };
146697
146704
  var Qn = (s3, t2, e, i, r) => {
146698
- if (t2.isDirectory()) ms(import_node_path16.default.resolve(s3, t2.name), e, i, (n) => {
146705
+ if (t2.isDirectory()) ms(import_node_path17.default.resolve(s3, t2.name), e, i, (n) => {
146699
146706
  if (n) return r(n);
146700
- let o = import_node_path16.default.resolve(s3, t2.name);
146707
+ let o = import_node_path17.default.resolve(s3, t2.name);
146701
146708
  pi(o, e, i, r);
146702
146709
  });
146703
146710
  else {
146704
- let n = import_node_path16.default.resolve(s3, t2.name);
146711
+ let n = import_node_path17.default.resolve(s3, t2.name);
146705
146712
  pi(n, e, i, r);
146706
146713
  }
146707
146714
  };
@@ -146722,7 +146729,7 @@ var ms = (s3, t2, e, i) => {
146722
146729
  });
146723
146730
  };
146724
146731
  var Jn = (s3, t2, e, i) => {
146725
- t2.isDirectory() && ps(import_node_path16.default.resolve(s3, t2.name), e, i), us(import_node_path16.default.resolve(s3, t2.name), e, i);
146732
+ t2.isDirectory() && ps(import_node_path17.default.resolve(s3, t2.name), e, i), us(import_node_path17.default.resolve(s3, t2.name), e, i);
146726
146733
  };
146727
146734
  var ps = (s3, t2, e) => {
146728
146735
  let i;
@@ -146772,12 +146779,12 @@ var Sr = (s3, t2, e) => {
146772
146779
  };
146773
146780
  if (s3 === d) return to(s3, S2);
146774
146781
  if (l) return import_promises16.default.mkdir(s3, { mode: r, recursive: true }).then((E2) => S2(null, E2 ?? void 0), S2);
146775
- let N2 = f(import_node_path17.default.relative(d, s3)).split("/");
146782
+ let N2 = f(import_node_path18.default.relative(d, s3)).split("/");
146776
146783
  Es(d, N2, r, c, d, void 0, S2);
146777
146784
  };
146778
146785
  var Es = (s3, t2, e, i, r, n, o) => {
146779
146786
  if (t2.length === 0) return o(null, n);
146780
- let a = t2.shift(), h = f(import_node_path17.default.resolve(s3 + "/" + a));
146787
+ let a = t2.shift(), h = f(import_node_path18.default.resolve(s3 + "/" + a));
146781
146788
  import_node_fs14.default.mkdir(h, e, yr(h, t2, e, i, r, n, o));
146782
146789
  };
146783
146790
  var yr = (s3, t2, e, i, r, n, o) => (a) => {
@@ -146811,9 +146818,9 @@ var Rr = (s3, t2) => {
146811
146818
  };
146812
146819
  if (s3 === c) return eo(c), d();
146813
146820
  if (h) return d(import_node_fs14.default.mkdirSync(s3, { mode: i, recursive: true }) ?? void 0);
146814
- let T2 = f(import_node_path17.default.relative(c, s3)).split("/"), N2;
146821
+ let T2 = f(import_node_path18.default.relative(c, s3)).split("/"), N2;
146815
146822
  for (let E2 = T2.shift(), x2 = c; E2 && (x2 += "/" + E2); E2 = T2.shift()) {
146816
- x2 = f(import_node_path17.default.resolve(x2));
146823
+ x2 = f(import_node_path18.default.resolve(x2));
146817
146824
  try {
146818
146825
  import_node_fs14.default.mkdirSync(x2, i), N2 = N2 || x2;
146819
146826
  } catch {
@@ -146842,14 +146849,14 @@ var io = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
146842
146849
  var so = io === "win32";
146843
146850
  var ro = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
146844
146851
  let r = e.at(-1);
146845
- return r !== void 0 && (i = (0, import_node_path18.join)(r, i)), e.push(i || "/"), e;
146852
+ return r !== void 0 && (i = (0, import_node_path19.join)(r, i)), e.push(i || "/"), e;
146846
146853
  }, []);
146847
146854
  var Si = class {
146848
146855
  #t = /* @__PURE__ */ new Map();
146849
146856
  #i = /* @__PURE__ */ new Map();
146850
146857
  #s = /* @__PURE__ */ new Set();
146851
146858
  reserve(t2, e) {
146852
- t2 = so ? ["win32 parallelization disabled"] : t2.map((r) => mt((0, import_node_path18.join)(br(r))));
146859
+ t2 = so ? ["win32 parallelization disabled"] : t2.map((r) => mt((0, import_node_path19.join)(br(r))));
146853
146860
  let i = new Set(t2.map((r) => ro(r)).reduce((r, n) => r.concat(n)));
146854
146861
  this.#i.set(e, { dirs: i, paths: t2 });
146855
146862
  for (let r of t2) {
@@ -146989,7 +146996,7 @@ var Xt = class extends st {
146989
146996
  if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
146990
146997
  this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
146991
146998
  } else this.uid = void 0, this.gid = void 0, this.setOwner = false;
146992
- this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : ho, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(import_node_path15.default.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : Or() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Tr](e));
146999
+ this.preserveOwner = t2.preserveOwner === void 0 && typeof t2.uid != "number" ? !!(process.getuid && process.getuid() === 0) : !!t2.preserveOwner, this.processUid = (this.preserveOwner || this.setOwner) && process.getuid ? process.getuid() : void 0, this.processGid = (this.preserveOwner || this.setOwner) && process.getgid ? process.getgid() : void 0, this.maxDepth = typeof t2.maxDepth == "number" ? t2.maxDepth : ho, this.forceChown = t2.forceChown === true, this.win32 = !!t2.win32 || Oe, this.newer = !!t2.newer, this.keep = !!t2.keep, this.noMtime = !!t2.noMtime, this.preservePaths = !!t2.preservePaths, this.unlink = !!t2.unlink, this.cwd = f(import_node_path16.default.resolve(t2.cwd || process.cwd())), this.strip = Number(t2.strip) || 0, this.processUmask = this.chmod ? typeof t2.processUmask == "number" ? t2.processUmask : Or() : 0, this.umask = typeof t2.umask == "number" ? t2.umask : this.processUmask, this.dmode = t2.dmode || 511 & ~this.umask, this.fmode = t2.fmode || 438 & ~this.umask, this.on("entry", (e) => this[Tr](e));
146993
147000
  }
146994
147001
  warn(t2, e, i = {}) {
146995
147002
  return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i.recoverable = false), super.warn(t2, e, i);
@@ -147003,7 +147010,7 @@ var Xt = class extends st {
147003
147010
  let [n, o] = le(i), a = o.replaceAll(/\\/g, "/").split("/");
147004
147011
  if (a.includes("..") || Oe && /^[a-z]:\.\.$/i.test(a[0] ?? "")) {
147005
147012
  if (e === "path" || r === "Link") return this.warn("TAR_ENTRY_ERROR", `${e} contains '..'`, { entry: t2, [e]: i }), false;
147006
- let h = import_node_path15.default.posix.dirname(t2.path), l = import_node_path15.default.posix.normalize(import_node_path15.default.posix.join(h, a.join("/")));
147013
+ let h = import_node_path16.default.posix.dirname(t2.path), l = import_node_path16.default.posix.normalize(import_node_path16.default.posix.join(h, a.join("/")));
147007
147014
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i }), false;
147008
147015
  }
147009
147016
  return n && (t2[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t2, [e]: i })), true;
@@ -147021,12 +147028,12 @@ var Xt = class extends st {
147021
147028
  }
147022
147029
  if (isFinite(this.maxDepth) && i.length > this.maxDepth) return this.warn("TAR_ENTRY_ERROR", "path excessively deep", { entry: t2, path: e, depth: i.length, maxDepth: this.maxDepth }), false;
147023
147030
  if (!this[Ss](t2, "path") || !this[Ss](t2, "linkpath")) return false;
147024
- if (t2.absolute = import_node_path15.default.isAbsolute(t2.path) ? f(import_node_path15.default.resolve(t2.path)) : f(import_node_path15.default.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
147031
+ if (t2.absolute = import_node_path16.default.isAbsolute(t2.path) ? f(import_node_path16.default.resolve(t2.path)) : f(import_node_path16.default.resolve(this.cwd, t2.path)), !this.preservePaths && typeof t2.absolute == "string" && t2.absolute.indexOf(this.cwd + "/") !== 0 && t2.absolute !== this.cwd) return this.warn("TAR_ENTRY_ERROR", "path escaped extraction target", { entry: t2, path: f(t2.path), resolvedPath: t2.absolute, cwd: this.cwd }), false;
147025
147032
  if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
147026
147033
  if (this.win32) {
147027
- let { root: r } = import_node_path15.default.win32.parse(String(t2.absolute));
147034
+ let { root: r } = import_node_path16.default.win32.parse(String(t2.absolute));
147028
147035
  t2.absolute = r + Ji(String(t2.absolute).slice(r.length));
147029
- let { root: n } = import_node_path15.default.win32.parse(t2.path);
147036
+ let { root: n } = import_node_path16.default.win32.parse(t2.path);
147030
147037
  t2.path = n + Ji(t2.path.slice(n.length));
147031
147038
  }
147032
147039
  return true;
@@ -147114,13 +147121,13 @@ var Xt = class extends st {
147114
147121
  t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
147115
147122
  }
147116
147123
  [Lr](t2, e) {
147117
- let i = f(import_node_path15.default.relative(this.cwd, import_node_path15.default.resolve(import_node_path15.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
147124
+ let i = f(import_node_path16.default.relative(this.cwd, import_node_path16.default.resolve(import_node_path16.default.dirname(String(t2.absolute)), String(t2.linkpath)))).split("/");
147118
147125
  this[ye](t2, this.cwd, i, () => this[Ri](t2, String(t2.linkpath), "symlink", e), (r) => {
147119
147126
  this[O2](r, t2), e();
147120
147127
  });
147121
147128
  }
147122
147129
  [Nr](t2, e) {
147123
- let i = f(import_node_path15.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
147130
+ let i = f(import_node_path16.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
147124
147131
  this[ye](t2, this.cwd, r, () => this[Ri](t2, i, "link", e), (n) => {
147125
147132
  this[O2](n, t2), e();
147126
147133
  });
@@ -147128,10 +147135,10 @@ var Xt = class extends st {
147128
147135
  [ye](t2, e, i, r, n) {
147129
147136
  let o = i.shift();
147130
147137
  if (this.preservePaths || o === void 0) return r();
147131
- let a = import_node_path15.default.resolve(e, o);
147138
+ let a = import_node_path16.default.resolve(e, o);
147132
147139
  import_node_fs12.default.lstat(a, (h, l) => {
147133
147140
  if (h) return r();
147134
- if (l?.isSymbolicLink()) return n(new St(a, import_node_path15.default.resolve(a, i.join("/"))));
147141
+ if (l?.isSymbolicLink()) return n(new St(a, import_node_path16.default.resolve(a, i.join("/"))));
147135
147142
  this[ye](t2, a, i, r, n);
147136
147143
  });
147137
147144
  }
@@ -147165,7 +147172,7 @@ var Xt = class extends st {
147165
147172
  });
147166
147173
  }, n = () => {
147167
147174
  if (t2.absolute !== this.cwd) {
147168
- let a = f(import_node_path15.default.dirname(String(t2.absolute)));
147175
+ let a = f(import_node_path16.default.dirname(String(t2.absolute)));
147169
147176
  if (a !== this.cwd) return this[yt](a, this.dmode, (h) => {
147170
147177
  if (h) {
147171
147178
  this[O2](h, t2), i();
@@ -147240,7 +147247,7 @@ var Te = class extends Xt {
147240
147247
  this[_e] = true;
147241
147248
  }
147242
147249
  if (t2.absolute !== this.cwd) {
147243
- let n = f(import_node_path15.default.dirname(String(t2.absolute)));
147250
+ let n = f(import_node_path16.default.dirname(String(t2.absolute)));
147244
147251
  if (n !== this.cwd) {
147245
147252
  let o = this[yt](n, this.dmode);
147246
147253
  if (o) return this[O2](o, t2);
@@ -147340,10 +147347,10 @@ var Te = class extends Xt {
147340
147347
  if (this.preservePaths || i.length === 0) return r();
147341
147348
  let o = e;
147342
147349
  for (let a of i) {
147343
- o = import_node_path15.default.resolve(o, a);
147350
+ o = import_node_path16.default.resolve(o, a);
147344
147351
  let [h, l] = Se(() => import_node_fs12.default.lstatSync(o));
147345
147352
  if (h) return r();
147346
- if (l.isSymbolicLink()) return n(new St(o, import_node_path15.default.resolve(e, i.join("/"))));
147353
+ if (l.isSymbolicLink()) return n(new St(o, import_node_path16.default.resolve(e, i.join("/"))));
147347
147354
  }
147348
147355
  r();
147349
147356
  }
@@ -147447,11 +147454,11 @@ var Eo = (s3, t2) => {
147447
147454
  };
147448
147455
  var wo = (s3, t2) => {
147449
147456
  t2.forEach((e) => {
147450
- e.charAt(0) === "@" ? Ft({ file: import_node_path19.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
147457
+ e.charAt(0) === "@" ? Ft({ file: import_node_path20.default.resolve(s3.cwd, e.slice(1)), sync: true, noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
147451
147458
  }), s3.end();
147452
147459
  };
147453
147460
  var So = async (s3, t2) => {
147454
- for (let e of t2) e.charAt(0) === "@" ? await Ft({ file: import_node_path19.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
147461
+ for (let e of t2) e.charAt(0) === "@" ? await Ft({ file: import_node_path20.default.resolve(String(s3.cwd), e.slice(1)), noResume: true, onReadEntry: (i) => s3.add(i) }) : s3.add(e);
147455
147462
  s3.end();
147456
147463
  };
147457
147464
  var vt = K2(mo, Eo, () => {
@@ -147879,8 +147886,8 @@ program2.command("cache").description("Manage the local SQLite conversation cach
147879
147886
  `${process.env.HOME}/.threadbase/cache`
147880
147887
  ).action((opts) => {
147881
147888
  const { rmSync: rmSync6, existsSync: existsSync11 } = require("fs");
147882
- const { join: join23 } = require("path");
147883
- const dbPath = join23(opts.cacheDir, "cache.db");
147889
+ const { join: join24 } = require("path");
147890
+ const dbPath = join24(opts.cacheDir, "cache.db");
147884
147891
  for (const suffix of ["", "-shm", "-wal"]) {
147885
147892
  const f2 = dbPath + suffix;
147886
147893
  if (existsSync11(f2)) {