@adhdev/daemon-core 0.9.82-rc.313 → 0.9.82-rc.314

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/index.mjs CHANGED
@@ -311,10 +311,10 @@ function readInjected(value) {
311
311
  }
312
312
  function getDaemonBuildInfo() {
313
313
  if (cached) return cached;
314
- const commit = readInjected(true ? "ed3b7279be8ea9fa191f854f7e9b6ce969159e67" : void 0) ?? "unknown";
315
- const commitShort = readInjected(true ? "ed3b7279" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
316
- const version = readInjected(true ? "0.9.82-rc.313" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
317
- const builtAt = readInjected(true ? "2026-06-18T00:14:56.582Z" : void 0);
314
+ const commit = readInjected(true ? "f236ed7432cf04dbcfd2e530fa6c69e77e809c80" : void 0) ?? "unknown";
315
+ const commitShort = readInjected(true ? "f236ed74" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
316
+ const version = readInjected(true ? "0.9.82-rc.314" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
317
+ const builtAt = readInjected(true ? "2026-06-18T04:15:40.033Z" : void 0);
318
318
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
319
319
  return cached;
320
320
  }
@@ -41820,39 +41820,48 @@ function removeDaemonPidFile() {
41820
41820
  } catch {
41821
41821
  }
41822
41822
  }
41823
+ function safeRemoveStaleEntry(target, label) {
41824
+ try {
41825
+ fs24.rmSync(target, { recursive: true, force: true });
41826
+ appendUpgradeLog(`${label}: ${target}`);
41827
+ } catch (error) {
41828
+ appendUpgradeLog(`Skipped locked stale entry (${error?.code || "error"}): ${target} \u2014 ${error?.message || String(error)}`);
41829
+ }
41830
+ }
41823
41831
  function cleanupStaleGlobalInstallDirs(pkgName, surface) {
41824
- const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
41825
- const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41826
- if (!npmRoot) return;
41827
- const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41828
- const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
41829
- const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
41830
- const binNames = /* @__PURE__ */ new Set([packageBaseName]);
41831
- if (pkgName === "@adhdev/daemon-standalone") {
41832
- binNames.add("adhdev-standalone");
41833
- }
41834
- if (pkgName.startsWith("@")) {
41835
- const [scope, name] = pkgName.split("/");
41836
- const scopeDir = path35.join(npmRoot, scope);
41837
- if (!fs24.existsSync(scopeDir)) return;
41838
- for (const entry of fs24.readdirSync(scopeDir)) {
41839
- if (!entry.startsWith(`.${name}-`)) continue;
41840
- fs24.rmSync(path35.join(scopeDir, entry), { recursive: true, force: true });
41841
- appendUpgradeLog(`Removed stale scoped staging dir: ${path35.join(scopeDir, entry)}`);
41842
- }
41843
- } else {
41844
- for (const entry of fs24.readdirSync(npmRoot)) {
41845
- if (!entry.startsWith(`.${pkgName}-`)) continue;
41846
- fs24.rmSync(path35.join(npmRoot, entry), { recursive: true, force: true });
41847
- appendUpgradeLog(`Removed stale staging dir: ${path35.join(npmRoot, entry)}`);
41832
+ try {
41833
+ const prefixArgs = surface.installPrefix ? ["--prefix", surface.installPrefix] : [];
41834
+ const npmRoot = String(execNpmCommandSync(["root", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41835
+ if (!npmRoot) return;
41836
+ const npmPrefix = surface.installPrefix || String(execNpmCommandSync(["prefix", "-g", ...prefixArgs], { encoding: "utf8" }, surface)).trim();
41837
+ const binDir = process.platform === "win32" ? npmPrefix : path35.join(npmPrefix, "bin");
41838
+ const packageBaseName = pkgName.startsWith("@") ? pkgName.split("/")[1] : pkgName;
41839
+ const binNames = /* @__PURE__ */ new Set([packageBaseName]);
41840
+ if (pkgName === "@adhdev/daemon-standalone") {
41841
+ binNames.add("adhdev-standalone");
41842
+ }
41843
+ if (pkgName.startsWith("@")) {
41844
+ const [scope, name] = pkgName.split("/");
41845
+ const scopeDir = path35.join(npmRoot, scope);
41846
+ if (!fs24.existsSync(scopeDir)) return;
41847
+ for (const entry of fs24.readdirSync(scopeDir)) {
41848
+ if (!entry.startsWith(`.${name}-`)) continue;
41849
+ safeRemoveStaleEntry(path35.join(scopeDir, entry), "Removed stale scoped staging dir");
41850
+ }
41851
+ } else {
41852
+ for (const entry of fs24.readdirSync(npmRoot)) {
41853
+ if (!entry.startsWith(`.${pkgName}-`)) continue;
41854
+ safeRemoveStaleEntry(path35.join(npmRoot, entry), "Removed stale staging dir");
41855
+ }
41848
41856
  }
41849
- }
41850
- if (fs24.existsSync(binDir)) {
41851
- for (const entry of fs24.readdirSync(binDir)) {
41852
- if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
41853
- fs24.rmSync(path35.join(binDir, entry), { recursive: true, force: true });
41854
- appendUpgradeLog(`Removed stale bin staging entry: ${path35.join(binDir, entry)}`);
41857
+ if (fs24.existsSync(binDir)) {
41858
+ for (const entry of fs24.readdirSync(binDir)) {
41859
+ if (!Array.from(binNames).some((name) => entry.startsWith(`.${name}-`))) continue;
41860
+ safeRemoveStaleEntry(path35.join(binDir, entry), "Removed stale bin staging entry");
41861
+ }
41855
41862
  }
41863
+ } catch (error) {
41864
+ appendUpgradeLog(`Stale staging cleanup skipped (${error?.code || "error"}): ${error?.message || String(error)}`);
41856
41865
  }
41857
41866
  }
41858
41867
  function spawnDetachedDaemonUpgradeHelper(payload) {