abtars 0.1.0-alpha.22 → 0.1.0-alpha.24

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.
@@ -2,7 +2,7 @@
2
2
  import { createRequire as __bundleCreateRequire } from 'node:module'; import { fileURLToPath as __bundleFileURLToPath } from 'node:url'; import { dirname as __bundleDirname } from 'node:path'; const require = __bundleCreateRequire(import.meta.url); const __chunk_filename = __bundleFileURLToPath(import.meta.url); const __chunk_dirname = __bundleDirname(__chunk_filename);
3
3
  import {
4
4
  install
5
- } from "./chunk-7CHLS36W.js";
5
+ } from "./chunk-XMJ76XLE.js";
6
6
  import {
7
7
  RETENTION,
8
8
  acquireLock,
@@ -535,7 +535,7 @@ async function runInteractive(existing) {
535
535
  if (telegramToken && telegramToken.trim() && !detectedChatId) {
536
536
  const botUrl = `https://api.telegram.org/bot${telegramToken.trim()}`;
537
537
  try {
538
- await fetch(`${botUrl}/deleteWebhook?drop_pending_updates=true`);
538
+ await fetch(`${botUrl}/deleteWebhook`);
539
539
  } catch {
540
540
  }
541
541
  process.stdout.write("\nSend /start to your bot on Telegram now... (waiting 30s)\n");
@@ -1069,23 +1069,6 @@ Next: run 'abtars update' to stage the release, then start the bridge.
1069
1069
  `);
1070
1070
  return 0;
1071
1071
  }
1072
- try {
1073
- const { spawnSync: spawnSync4 } = await import("node:child_process");
1074
- const which = spawnSync4("which", ["abmind"], { encoding: "utf-8" });
1075
- if (which.status === 0) {
1076
- process.stdout.write(`
1077
- \u2500\u2500 Running 'abmind install' \u2500\u2500
1078
- `);
1079
- const r = spawnSync4("abmind", ["install"], { stdio: "inherit" });
1080
- if (r.status !== 0) process.stdout.write(`\u26A0 abmind install exited with code ${r.status}
1081
- `);
1082
- } else {
1083
- process.stdout.write(`
1084
- \u2139\uFE0F abmind not installed. Run 'npm install -g abmind && abmind install' later to enable persistent memory.
1085
- `);
1086
- }
1087
- } catch {
1088
- }
1089
1072
  const { confirm: confirm2 } = await import("./dist-J3T4XVKX.js");
1090
1073
  const startCmds = [];
1091
1074
  if (answers.installMode === "simple") {
@@ -1602,27 +1585,29 @@ Use --source local (default) or --source npm.
1602
1585
  const entry = existsSync8(join9(staged.stagedPath, "bundle", "abtars.js")) ? "bundle/abtars.js" : "dist/main.js";
1603
1586
  symlinkSync(entry, mainLink);
1604
1587
  }
1605
- const { existsSync: ex2, lstatSync, readlinkSync: readlinkSync2, symlinkSync: sl2, mkdirSync: mk2 } = await import("node:fs");
1606
- const oldNm = join9(paths.home, "current", "node_modules");
1607
- const preservedLinks = [];
1608
- if (ex2(oldNm)) {
1609
- for (const name of ["abmind", "better-sqlite3"]) {
1610
- const p = join9(oldNm, name);
1611
- try {
1612
- if (ex2(p) && lstatSync(p).isSymbolicLink()) preservedLinks.push({ name, target: readlinkSync2(p) });
1613
- } catch {
1614
- }
1615
- }
1616
- }
1588
+ const { existsSync: ex2, symlinkSync: sl2, mkdirSync: mk2, unlinkSync: ul2 } = await import("node:fs");
1589
+ const { dirname: dn2 } = await import("node:path");
1617
1590
  await activate(paths.current, staged.version);
1618
1591
  process.stdout.write(`\u2713 current -> releases/${staged.version}
1619
1592
  `);
1620
- if (preservedLinks.length > 0) {
1593
+ const globalModules = join9(dn2(process.execPath), "..", "lib", "node_modules");
1594
+ const abmindHome = process.env["ABMIND_HOME"] ?? join9(process.env["HOME"] ?? "", ".abmind");
1595
+ const links = [];
1596
+ const globalAbmind = join9(globalModules, "abmind");
1597
+ if (ex2(globalAbmind)) links.push({ name: "abmind", target: globalAbmind });
1598
+ const bsq3 = join9(abmindHome, "lib", "node_modules", "better-sqlite3");
1599
+ if (ex2(bsq3)) links.push({ name: "better-sqlite3", target: bsq3 });
1600
+ if (links.length > 0) {
1621
1601
  const newNm = join9(paths.home, "current", "node_modules");
1622
1602
  mk2(newNm, { recursive: true });
1623
- for (const { name, target } of preservedLinks) {
1603
+ for (const { name, target } of links) {
1604
+ const dest = join9(newNm, name);
1605
+ try {
1606
+ if (ex2(dest)) ul2(dest);
1607
+ } catch {
1608
+ }
1624
1609
  try {
1625
- sl2(target, join9(newNm, name));
1610
+ sl2(target, dest);
1626
1611
  } catch {
1627
1612
  }
1628
1613
  }
@@ -1691,7 +1676,7 @@ Update complete: ${staged.version}
1691
1676
  } catch {
1692
1677
  }
1693
1678
  }
1694
- const { loadManifest } = await import("./install-manifest-ZETY4AFS.js");
1679
+ const { loadManifest } = await import("./install-manifest-QRWID3KZ.js");
1695
1680
  const sourceRoot = staged.stagedPath;
1696
1681
  const installManifest = loadManifest(sourceRoot);
1697
1682
  const repoScripts = join9(sourceRoot, "scripts");
@@ -1741,7 +1726,7 @@ Update complete: ${staged.version}
1741
1726
  }
1742
1727
  process.stdout.write(`\u2713 scripts refreshed (${scriptFiles.length} files)
1743
1728
  `);
1744
- const { writeWrapper } = await import("./install-24XR5FO5.js");
1729
+ const { writeWrapper } = await import("./install-K67U3WLX.js");
1745
1730
  await mkdir4(paths.bin, { recursive: true });
1746
1731
  for (const name of installManifest.cliWrappers) {
1747
1732
  await writeWrapper(paths.bin, name, paths.current, false);
@@ -1798,7 +1783,7 @@ Update complete: ${staged.version}
1798
1783
  }
1799
1784
  }
1800
1785
  void hashFile;
1801
- const { ensureInstallInvariants } = await import("./ensure-invariants-KUXIW73S.js");
1786
+ const { ensureInstallInvariants } = await import("./ensure-invariants-BJIEOSJ2.js");
1802
1787
  const invariantResults = await ensureInstallInvariants(process.cwd(), paths.home);
1803
1788
  if (invariantResults.length > 0) {
1804
1789
  process.stdout.write(`\u2713 invariants: ${invariantResults.join(", ")}