@threadbase-sh/streamer 1.18.2 → 1.18.3

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`;
@@ -144560,7 +144562,7 @@ var import_fs24 = __toESM(require("fs"), 1);
144560
144562
  var import_node_events3 = require("events");
144561
144563
  var import_node_stream3 = __toESM(require("stream"), 1);
144562
144564
  var import_node_string_decoder = require("string_decoder");
144563
- var import_node_path11 = __toESM(require("path"), 1);
144565
+ var import_node_path12 = __toESM(require("path"), 1);
144564
144566
  var import_node_fs10 = __toESM(require("fs"), 1);
144565
144567
  var import_path20 = require("path");
144566
144568
  var import_events5 = require("events");
@@ -144568,27 +144570,27 @@ var import_assert = __toESM(require("assert"), 1);
144568
144570
  var import_buffer = require("buffer");
144569
144571
  var Ms = __toESM(require("zlib"), 1);
144570
144572
  var import_zlib = __toESM(require("zlib"), 1);
144571
- var import_node_path12 = require("path");
144572
144573
  var import_node_path13 = require("path");
144574
+ var import_node_path14 = require("path");
144573
144575
  var import_fs25 = __toESM(require("fs"), 1);
144574
144576
  var import_fs26 = __toESM(require("fs"), 1);
144575
144577
  var import_path21 = __toESM(require("path"), 1);
144576
- var import_node_path14 = require("path");
144578
+ var import_node_path15 = require("path");
144577
144579
  var import_path22 = __toESM(require("path"), 1);
144578
144580
  var import_node_fs11 = __toESM(require("fs"), 1);
144579
144581
  var import_node_assert = __toESM(require("assert"), 1);
144580
144582
  var import_node_crypto5 = require("crypto");
144581
144583
  var import_node_fs12 = __toESM(require("fs"), 1);
144582
- var import_node_path15 = __toESM(require("path"), 1);
144584
+ var import_node_path16 = __toESM(require("path"), 1);
144583
144585
  var import_fs27 = __toESM(require("fs"), 1);
144584
144586
  var import_node_fs13 = __toESM(require("fs"), 1);
144585
- var import_node_path16 = __toESM(require("path"), 1);
144587
+ var import_node_path17 = __toESM(require("path"), 1);
144586
144588
  var import_node_fs14 = __toESM(require("fs"), 1);
144587
144589
  var import_promises16 = __toESM(require("fs/promises"), 1);
144588
- var import_node_path17 = __toESM(require("path"), 1);
144589
- var import_node_path18 = require("path");
144590
+ var import_node_path18 = __toESM(require("path"), 1);
144591
+ var import_node_path19 = require("path");
144590
144592
  var import_node_fs15 = __toESM(require("fs"), 1);
144591
- var import_node_path19 = __toESM(require("path"), 1);
144593
+ var import_node_path20 = __toESM(require("path"), 1);
144592
144594
  var Mr = Object.defineProperty;
144593
144595
  var Br = (s3, t2) => {
144594
144596
  for (var e in t2) Mr(s3, e, { get: t2[e], enumerable: true });
@@ -145481,12 +145483,12 @@ var C2 = class {
145481
145483
  }
145482
145484
  };
145483
145485
  var cn = (s3, t2) => {
145484
- let i = s3, r = "", n, o = import_node_path12.posix.parse(s3).root || ".";
145486
+ let i = s3, r = "", n, o = import_node_path13.posix.parse(s3).root || ".";
145485
145487
  if (Buffer.byteLength(i) < 100) n = [i, r, false];
145486
145488
  else {
145487
- r = import_node_path12.posix.dirname(i), i = import_node_path12.posix.basename(i);
145489
+ r = import_node_path13.posix.dirname(i), i = import_node_path13.posix.basename(i);
145488
145490
  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));
145491
+ 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
145492
  while (r !== o && n === void 0);
145491
145493
  n || (n = [s3.slice(0, 99), "", true]);
145492
145494
  }
@@ -145532,7 +145534,7 @@ var ct = class s {
145532
145534
  if (t2 === "") return Buffer.allocUnsafe(0);
145533
145535
  let e = Buffer.byteLength(t2), i = 512 * Math.ceil(1 + e / 512), r = Buffer.allocUnsafe(i);
145534
145536
  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");
145537
+ 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
145538
  for (let n = e + 512; n < r.length; n++) r[n] = 0;
145537
145539
  return r;
145538
145540
  }
@@ -145944,7 +145946,7 @@ var Ft = K2(In, Fn, (s3) => new st(s3), (s3) => new st(s3), (s3, t2) => {
145944
145946
  t2?.length && Xi(s3, t2), s3.noResume || An(s3);
145945
145947
  });
145946
145948
  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;
145949
+ var { isAbsolute: kn, parse: Vs } = import_node_path15.win32;
145948
145950
  var le = (s3) => {
145949
145951
  let t2 = "", e = Vs(s3);
145950
145952
  for (; kn(s3) || e.root; ) {
@@ -146653,11 +146655,11 @@ var Gn = (s3, t2) => {
146653
146655
  };
146654
146656
  var ar = (s3, t2) => {
146655
146657
  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);
146658
+ 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
146659
  }), s3.end();
146658
146660
  };
146659
146661
  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) => {
146662
+ 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
146663
  s3.add(i);
146662
146664
  } }) : s3.add(e);
146663
146665
  s3.end();
@@ -146695,13 +146697,13 @@ var pi = (s3, t2, e, i) => {
146695
146697
  });
146696
146698
  };
146697
146699
  var Qn = (s3, t2, e, i, r) => {
146698
- if (t2.isDirectory()) ms(import_node_path16.default.resolve(s3, t2.name), e, i, (n) => {
146700
+ if (t2.isDirectory()) ms(import_node_path17.default.resolve(s3, t2.name), e, i, (n) => {
146699
146701
  if (n) return r(n);
146700
- let o = import_node_path16.default.resolve(s3, t2.name);
146702
+ let o = import_node_path17.default.resolve(s3, t2.name);
146701
146703
  pi(o, e, i, r);
146702
146704
  });
146703
146705
  else {
146704
- let n = import_node_path16.default.resolve(s3, t2.name);
146706
+ let n = import_node_path17.default.resolve(s3, t2.name);
146705
146707
  pi(n, e, i, r);
146706
146708
  }
146707
146709
  };
@@ -146722,7 +146724,7 @@ var ms = (s3, t2, e, i) => {
146722
146724
  });
146723
146725
  };
146724
146726
  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);
146727
+ 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
146728
  };
146727
146729
  var ps = (s3, t2, e) => {
146728
146730
  let i;
@@ -146772,12 +146774,12 @@ var Sr = (s3, t2, e) => {
146772
146774
  };
146773
146775
  if (s3 === d) return to(s3, S2);
146774
146776
  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("/");
146777
+ let N2 = f(import_node_path18.default.relative(d, s3)).split("/");
146776
146778
  Es(d, N2, r, c, d, void 0, S2);
146777
146779
  };
146778
146780
  var Es = (s3, t2, e, i, r, n, o) => {
146779
146781
  if (t2.length === 0) return o(null, n);
146780
- let a = t2.shift(), h = f(import_node_path17.default.resolve(s3 + "/" + a));
146782
+ let a = t2.shift(), h = f(import_node_path18.default.resolve(s3 + "/" + a));
146781
146783
  import_node_fs14.default.mkdir(h, e, yr(h, t2, e, i, r, n, o));
146782
146784
  };
146783
146785
  var yr = (s3, t2, e, i, r, n, o) => (a) => {
@@ -146811,9 +146813,9 @@ var Rr = (s3, t2) => {
146811
146813
  };
146812
146814
  if (s3 === c) return eo(c), d();
146813
146815
  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;
146816
+ let T2 = f(import_node_path18.default.relative(c, s3)).split("/"), N2;
146815
146817
  for (let E2 = T2.shift(), x2 = c; E2 && (x2 += "/" + E2); E2 = T2.shift()) {
146816
- x2 = f(import_node_path17.default.resolve(x2));
146818
+ x2 = f(import_node_path18.default.resolve(x2));
146817
146819
  try {
146818
146820
  import_node_fs14.default.mkdirSync(x2, i), N2 = N2 || x2;
146819
146821
  } catch {
@@ -146842,14 +146844,14 @@ var io = process.env.TESTING_TAR_FAKE_PLATFORM || process.platform;
146842
146844
  var so = io === "win32";
146843
146845
  var ro = (s3) => s3.split("/").slice(0, -1).reduce((e, i) => {
146844
146846
  let r = e.at(-1);
146845
- return r !== void 0 && (i = (0, import_node_path18.join)(r, i)), e.push(i || "/"), e;
146847
+ return r !== void 0 && (i = (0, import_node_path19.join)(r, i)), e.push(i || "/"), e;
146846
146848
  }, []);
146847
146849
  var Si = class {
146848
146850
  #t = /* @__PURE__ */ new Map();
146849
146851
  #i = /* @__PURE__ */ new Map();
146850
146852
  #s = /* @__PURE__ */ new Set();
146851
146853
  reserve(t2, e) {
146852
- t2 = so ? ["win32 parallelization disabled"] : t2.map((r) => mt((0, import_node_path18.join)(br(r))));
146854
+ t2 = so ? ["win32 parallelization disabled"] : t2.map((r) => mt((0, import_node_path19.join)(br(r))));
146853
146855
  let i = new Set(t2.map((r) => ro(r)).reduce((r, n) => r.concat(n)));
146854
146856
  this.#i.set(e, { dirs: i, paths: t2 });
146855
146857
  for (let r of t2) {
@@ -146989,7 +146991,7 @@ var Xt = class extends st {
146989
146991
  if (t2.preserveOwner) throw new TypeError("cannot preserve owner in archive and also set owner explicitly");
146990
146992
  this.uid = t2.uid, this.gid = t2.gid, this.setOwner = true;
146991
146993
  } 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));
146994
+ 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
146995
  }
146994
146996
  warn(t2, e, i = {}) {
146995
146997
  return (t2 === "TAR_BAD_ARCHIVE" || t2 === "TAR_ABORT") && (i.recoverable = false), super.warn(t2, e, i);
@@ -147003,7 +147005,7 @@ var Xt = class extends st {
147003
147005
  let [n, o] = le(i), a = o.replaceAll(/\\/g, "/").split("/");
147004
147006
  if (a.includes("..") || Oe && /^[a-z]:\.\.$/i.test(a[0] ?? "")) {
147005
147007
  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("/")));
147008
+ 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
147009
  if (l.startsWith("../") || l === "..") return this.warn("TAR_ENTRY_ERROR", `${e} escapes extraction directory`, { entry: t2, [e]: i }), false;
147008
147010
  }
147009
147011
  return n && (t2[e] = String(o), this.warn("TAR_ENTRY_INFO", `stripping ${n} from absolute ${e}`, { entry: t2, [e]: i })), true;
@@ -147021,12 +147023,12 @@ var Xt = class extends st {
147021
147023
  }
147022
147024
  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
147025
  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;
147026
+ 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
147027
  if (t2.absolute === this.cwd && t2.type !== "Directory" && t2.type !== "GNUDumpDir") return false;
147026
147028
  if (this.win32) {
147027
- let { root: r } = import_node_path15.default.win32.parse(String(t2.absolute));
147029
+ let { root: r } = import_node_path16.default.win32.parse(String(t2.absolute));
147028
147030
  t2.absolute = r + Ji(String(t2.absolute).slice(r.length));
147029
- let { root: n } = import_node_path15.default.win32.parse(t2.path);
147031
+ let { root: n } = import_node_path16.default.win32.parse(t2.path);
147030
147032
  t2.path = n + Ji(t2.path.slice(n.length));
147031
147033
  }
147032
147034
  return true;
@@ -147114,13 +147116,13 @@ var Xt = class extends st {
147114
147116
  t2.unsupported = true, this.warn("TAR_ENTRY_UNSUPPORTED", `unsupported entry type: ${t2.type}`, { entry: t2 }), t2.resume();
147115
147117
  }
147116
147118
  [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("/");
147119
+ 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
147120
  this[ye](t2, this.cwd, i, () => this[Ri](t2, String(t2.linkpath), "symlink", e), (r) => {
147119
147121
  this[O2](r, t2), e();
147120
147122
  });
147121
147123
  }
147122
147124
  [Nr](t2, e) {
147123
- let i = f(import_node_path15.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
147125
+ let i = f(import_node_path16.default.resolve(this.cwd, String(t2.linkpath))), r = f(String(t2.linkpath)).split("/");
147124
147126
  this[ye](t2, this.cwd, r, () => this[Ri](t2, i, "link", e), (n) => {
147125
147127
  this[O2](n, t2), e();
147126
147128
  });
@@ -147128,10 +147130,10 @@ var Xt = class extends st {
147128
147130
  [ye](t2, e, i, r, n) {
147129
147131
  let o = i.shift();
147130
147132
  if (this.preservePaths || o === void 0) return r();
147131
- let a = import_node_path15.default.resolve(e, o);
147133
+ let a = import_node_path16.default.resolve(e, o);
147132
147134
  import_node_fs12.default.lstat(a, (h, l) => {
147133
147135
  if (h) return r();
147134
- if (l?.isSymbolicLink()) return n(new St(a, import_node_path15.default.resolve(a, i.join("/"))));
147136
+ if (l?.isSymbolicLink()) return n(new St(a, import_node_path16.default.resolve(a, i.join("/"))));
147135
147137
  this[ye](t2, a, i, r, n);
147136
147138
  });
147137
147139
  }
@@ -147165,7 +147167,7 @@ var Xt = class extends st {
147165
147167
  });
147166
147168
  }, n = () => {
147167
147169
  if (t2.absolute !== this.cwd) {
147168
- let a = f(import_node_path15.default.dirname(String(t2.absolute)));
147170
+ let a = f(import_node_path16.default.dirname(String(t2.absolute)));
147169
147171
  if (a !== this.cwd) return this[yt](a, this.dmode, (h) => {
147170
147172
  if (h) {
147171
147173
  this[O2](h, t2), i();
@@ -147240,7 +147242,7 @@ var Te = class extends Xt {
147240
147242
  this[_e] = true;
147241
147243
  }
147242
147244
  if (t2.absolute !== this.cwd) {
147243
- let n = f(import_node_path15.default.dirname(String(t2.absolute)));
147245
+ let n = f(import_node_path16.default.dirname(String(t2.absolute)));
147244
147246
  if (n !== this.cwd) {
147245
147247
  let o = this[yt](n, this.dmode);
147246
147248
  if (o) return this[O2](o, t2);
@@ -147340,10 +147342,10 @@ var Te = class extends Xt {
147340
147342
  if (this.preservePaths || i.length === 0) return r();
147341
147343
  let o = e;
147342
147344
  for (let a of i) {
147343
- o = import_node_path15.default.resolve(o, a);
147345
+ o = import_node_path16.default.resolve(o, a);
147344
147346
  let [h, l] = Se(() => import_node_fs12.default.lstatSync(o));
147345
147347
  if (h) return r();
147346
- if (l.isSymbolicLink()) return n(new St(o, import_node_path15.default.resolve(e, i.join("/"))));
147348
+ if (l.isSymbolicLink()) return n(new St(o, import_node_path16.default.resolve(e, i.join("/"))));
147347
147349
  }
147348
147350
  r();
147349
147351
  }
@@ -147447,11 +147449,11 @@ var Eo = (s3, t2) => {
147447
147449
  };
147448
147450
  var wo = (s3, t2) => {
147449
147451
  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);
147452
+ 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
147453
  }), s3.end();
147452
147454
  };
147453
147455
  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);
147456
+ 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
147457
  s3.end();
147456
147458
  };
147457
147459
  var vt = K2(mo, Eo, () => {
@@ -147879,8 +147881,8 @@ program2.command("cache").description("Manage the local SQLite conversation cach
147879
147881
  `${process.env.HOME}/.threadbase/cache`
147880
147882
  ).action((opts) => {
147881
147883
  const { rmSync: rmSync6, existsSync: existsSync11 } = require("fs");
147882
- const { join: join23 } = require("path");
147883
- const dbPath = join23(opts.cacheDir, "cache.db");
147884
+ const { join: join24 } = require("path");
147885
+ const dbPath = join24(opts.cacheDir, "cache.db");
147884
147886
  for (const suffix of ["", "-shm", "-wal"]) {
147885
147887
  const f2 = dbPath + suffix;
147886
147888
  if (existsSync11(f2)) {