adhdev 0.7.33 → 0.7.35

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.js CHANGED
@@ -8333,7 +8333,7 @@ function detectCurrentWorkspace(ideId) {
8333
8333
  }
8334
8334
  } else if (plat === "win32") {
8335
8335
  try {
8336
- const fs15 = require("fs");
8336
+ const fs16 = require("fs");
8337
8337
  const appNameMap = getMacAppIdentifiers();
8338
8338
  const appName = appNameMap[ideId];
8339
8339
  if (appName) {
@@ -8342,8 +8342,8 @@ function detectCurrentWorkspace(ideId) {
8342
8342
  appName,
8343
8343
  "storage.json"
8344
8344
  );
8345
- if (fs15.existsSync(storagePath)) {
8346
- const data = JSON.parse(fs15.readFileSync(storagePath, "utf-8"));
8345
+ if (fs16.existsSync(storagePath)) {
8346
+ const data = JSON.parse(fs16.readFileSync(storagePath, "utf-8"));
8347
8347
  const workspaces = data?.openedPathsList?.workspaces3 || data?.openedPathsList?.entries || [];
8348
8348
  if (workspaces.length > 0) {
8349
8349
  const recent = workspaces[0];
@@ -8842,9 +8842,9 @@ var init_router = __esm({
8842
8842
  LOG.info("Upgrade", "Restarting daemon with new version...");
8843
8843
  try {
8844
8844
  const path18 = require("path");
8845
- const fs15 = require("fs");
8845
+ const fs16 = require("fs");
8846
8846
  const pidFile = path18.join(process.env.HOME || process.env.USERPROFILE || "", ".adhdev", "daemon.pid");
8847
- if (fs15.existsSync(pidFile)) fs15.unlinkSync(pidFile);
8847
+ if (fs16.existsSync(pidFile)) fs16.unlinkSync(pidFile);
8848
8848
  } catch {
8849
8849
  }
8850
8850
  const { spawn: spawn4 } = require("child_process");
@@ -18609,12 +18609,12 @@ function findBinary(name) {
18609
18609
  function isScriptBinary(binaryPath) {
18610
18610
  if (!path9.isAbsolute(binaryPath)) return false;
18611
18611
  try {
18612
- const fs15 = require("fs");
18613
- const resolved = fs15.realpathSync(binaryPath);
18612
+ const fs16 = require("fs");
18613
+ const resolved = fs16.realpathSync(binaryPath);
18614
18614
  const head = Buffer.alloc(8);
18615
- const fd = fs15.openSync(resolved, "r");
18616
- fs15.readSync(fd, head, 0, 8, 0);
18617
- fs15.closeSync(fd);
18615
+ const fd = fs16.openSync(resolved, "r");
18616
+ fs16.readSync(fd, head, 0, 8, 0);
18617
+ fs16.closeSync(fd);
18618
18618
  let i = 0;
18619
18619
  if (head[0] === 239 && head[1] === 187 && head[2] === 191) i = 3;
18620
18620
  return head[i] === 35 && head[i + 1] === 33;
@@ -18625,12 +18625,12 @@ function isScriptBinary(binaryPath) {
18625
18625
  function looksLikeMachOOrElf(filePath) {
18626
18626
  if (!path9.isAbsolute(filePath)) return false;
18627
18627
  try {
18628
- const fs15 = require("fs");
18629
- const resolved = fs15.realpathSync(filePath);
18628
+ const fs16 = require("fs");
18629
+ const resolved = fs16.realpathSync(filePath);
18630
18630
  const buf = Buffer.alloc(8);
18631
- const fd = fs15.openSync(resolved, "r");
18632
- fs15.readSync(fd, buf, 0, 8, 0);
18633
- fs15.closeSync(fd);
18631
+ const fd = fs16.openSync(resolved, "r");
18632
+ fs16.readSync(fd, buf, 0, 8, 0);
18633
+ fs16.closeSync(fd);
18634
18634
  let i = 0;
18635
18635
  if (buf[0] === 239 && buf[1] === 187 && buf[2] === 191) i = 3;
18636
18636
  const b2 = buf.subarray(i);
@@ -18751,14 +18751,14 @@ var init_provider_cli_adapter = __esm({
18751
18751
  pty2 = require("node-pty");
18752
18752
  if (os13.platform() !== "win32") {
18753
18753
  try {
18754
- const fs15 = require("fs");
18754
+ const fs16 = require("fs");
18755
18755
  const ptyDir = path9.resolve(path9.dirname(require.resolve("node-pty")), "..");
18756
18756
  const platformArch = `${os13.platform()}-${os13.arch()}`;
18757
18757
  const helper = path9.join(ptyDir, "prebuilds", platformArch, "spawn-helper");
18758
- if (fs15.existsSync(helper)) {
18759
- const stat4 = fs15.statSync(helper);
18758
+ if (fs16.existsSync(helper)) {
18759
+ const stat4 = fs16.statSync(helper);
18760
18760
  if (!(stat4.mode & 73)) {
18761
- fs15.chmodSync(helper, stat4.mode | 493);
18761
+ fs16.chmodSync(helper, stat4.mode | 493);
18762
18762
  LOG.info("CLI", "[node-pty] Fixed spawn-helper permissions");
18763
18763
  }
18764
18764
  }
@@ -43753,10 +43753,10 @@ var init_server_connection = __esm({
43753
43753
  this.setState("disconnected");
43754
43754
  try {
43755
43755
  const path18 = require("path");
43756
- const fs15 = require("fs");
43756
+ const fs16 = require("fs");
43757
43757
  const configPath = path18.join(process.env.HOME || process.env.USERPROFILE || "", ".adhdev", "config.json");
43758
- if (fs15.existsSync(configPath)) {
43759
- fs15.unlinkSync(configPath);
43758
+ if (fs16.existsSync(configPath)) {
43759
+ fs16.unlinkSync(configPath);
43760
43760
  LOG.info("Server", `[ServerConn] Config file removed. Re-run 'adhdev setup'.`);
43761
43761
  }
43762
43762
  } catch {
@@ -44847,13 +44847,12 @@ var init_screenshot_controller = __esm({
44847
44847
 
44848
44848
  // src/session-host.ts
44849
44849
  function resolveSessionHostEntry() {
44850
- const localCandidates = [
44850
+ const packagedCandidates = [
44851
44851
  path16.resolve(__dirname, "../vendor/session-host-daemon/index.js"),
44852
- path16.resolve(__dirname, "../../vendor/session-host-daemon/index.js"),
44853
- path16.resolve(__dirname, "../../../oss/packages/session-host-daemon/dist/index.js")
44852
+ path16.resolve(__dirname, "../../vendor/session-host-daemon/index.js")
44854
44853
  ];
44855
- for (const candidate of localCandidates) {
44856
- if (require("fs").existsSync(candidate)) {
44854
+ for (const candidate of packagedCandidates) {
44855
+ if (fs14.existsSync(candidate)) {
44857
44856
  return candidate;
44858
44857
  }
44859
44858
  }
@@ -44880,11 +44879,12 @@ async function ensureSessionHostReady2() {
44880
44879
  async function listHostedCliRuntimes2(endpoint) {
44881
44880
  return listHostedCliRuntimes(endpoint);
44882
44881
  }
44883
- var import_child_process8, path16, SESSION_HOST_APP_NAME;
44882
+ var import_child_process8, fs14, path16, SESSION_HOST_APP_NAME;
44884
44883
  var init_session_host = __esm({
44885
44884
  "src/session-host.ts"() {
44886
44885
  "use strict";
44887
44886
  import_child_process8 = require("child_process");
44887
+ fs14 = __toESM(require("fs"));
44888
44888
  path16 = __toESM(require("path"));
44889
44889
  init_src();
44890
44890
  SESSION_HOST_APP_NAME = process.env.ADHDEV_SESSION_HOST_NAME || "adhdev";
@@ -44900,23 +44900,23 @@ __export(adhdev_daemon_exports, {
44900
44900
  });
44901
44901
  function getDaemonPidFile() {
44902
44902
  const dir = path17.join(os19.homedir(), ".adhdev");
44903
- if (!fs14.existsSync(dir)) fs14.mkdirSync(dir, { recursive: true });
44903
+ if (!fs15.existsSync(dir)) fs15.mkdirSync(dir, { recursive: true });
44904
44904
  return path17.join(dir, "daemon.pid");
44905
44905
  }
44906
44906
  function writeDaemonPid(pid) {
44907
- fs14.writeFileSync(getDaemonPidFile(), String(pid), "utf-8");
44907
+ fs15.writeFileSync(getDaemonPidFile(), String(pid), "utf-8");
44908
44908
  }
44909
44909
  function removeDaemonPid() {
44910
44910
  try {
44911
- fs14.unlinkSync(getDaemonPidFile());
44911
+ fs15.unlinkSync(getDaemonPidFile());
44912
44912
  } catch (e) {
44913
44913
  }
44914
44914
  }
44915
44915
  function isDaemonRunning() {
44916
44916
  const pidFile = getDaemonPidFile();
44917
44917
  try {
44918
- if (!fs14.existsSync(pidFile)) return false;
44919
- const pid = parseInt(fs14.readFileSync(pidFile, "utf-8").trim());
44918
+ if (!fs15.existsSync(pidFile)) return false;
44919
+ const pid = parseInt(fs15.readFileSync(pidFile, "utf-8").trim());
44920
44920
  process.kill(pid, 0);
44921
44921
  return true;
44922
44922
  } catch {
@@ -44927,8 +44927,8 @@ function isDaemonRunning() {
44927
44927
  function stopDaemon() {
44928
44928
  const pidFile = getDaemonPidFile();
44929
44929
  try {
44930
- if (!fs14.existsSync(pidFile)) return false;
44931
- const pid = parseInt(fs14.readFileSync(pidFile, "utf-8").trim());
44930
+ if (!fs15.existsSync(pidFile)) return false;
44931
+ const pid = parseInt(fs15.readFileSync(pidFile, "utf-8").trim());
44932
44932
  process.kill(pid, "SIGTERM");
44933
44933
  removeDaemonPid();
44934
44934
  return true;
@@ -44937,7 +44937,7 @@ function stopDaemon() {
44937
44937
  return false;
44938
44938
  }
44939
44939
  }
44940
- var os19, fs14, path17, import_chalk2, pkgVersion, DANGEROUS_PATTERNS, AdhdevDaemon;
44940
+ var os19, fs15, path17, import_chalk2, pkgVersion, DANGEROUS_PATTERNS, AdhdevDaemon;
44941
44941
  var init_adhdev_daemon = __esm({
44942
44942
  "src/adhdev-daemon.ts"() {
44943
44943
  "use strict";
@@ -44948,10 +44948,10 @@ var init_adhdev_daemon = __esm({
44948
44948
  init_session_host();
44949
44949
  init_dist();
44950
44950
  os19 = __toESM(require("os"));
44951
- fs14 = __toESM(require("fs"));
44951
+ fs15 = __toESM(require("fs"));
44952
44952
  path17 = __toESM(require("path"));
44953
44953
  import_chalk2 = __toESM(require("chalk"));
44954
- pkgVersion = "0.7.33";
44954
+ pkgVersion = "0.7.35";
44955
44955
  if (pkgVersion === "unknown") {
44956
44956
  try {
44957
44957
  const possiblePaths = [
@@ -44960,7 +44960,7 @@ var init_adhdev_daemon = __esm({
44960
44960
  ];
44961
44961
  for (const p of possiblePaths) {
44962
44962
  try {
44963
- const data = JSON.parse(fs14.readFileSync(p, "utf-8"));
44963
+ const data = JSON.parse(fs15.readFileSync(p, "utf-8"));
44964
44964
  if (data.version) {
44965
44965
  pkgVersion = data.version;
44966
44966
  break;