adhdev 0.5.23 → 0.5.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.
package/dist/cli/index.js CHANGED
@@ -20834,6 +20834,10 @@ var require_dist = __commonJS({
20834
20834
  /** Extract ideType from _targetInstance or explicit ideType */
20835
20835
  extractIdeType(args) {
20836
20836
  if (args?.ideType) {
20837
+ const mappedKey = this._ctx.instanceIdMap?.get(args.ideType);
20838
+ if (mappedKey) {
20839
+ return mappedKey;
20840
+ }
20837
20841
  if (this._ctx.cdpManagers.has(args.ideType)) {
20838
20842
  return args.ideType;
20839
20843
  }
@@ -29794,16 +29798,16 @@ ${e?.stack || ""}`);
29794
29798
  }
29795
29799
  }
29796
29800
  async handleInputEvent(peerId, msg) {
29797
- const { id, action, params } = msg;
29801
+ const { id, action, params, instanceId } = msg;
29798
29802
  if (!this.inputHandler) {
29799
29803
  this.sendToPeer(peerId, { id, type: "response", success: false, error: "No input handler" });
29800
29804
  return;
29801
29805
  }
29802
29806
  try {
29803
29807
  const peer = this.peers.get(peerId);
29804
- const ideType = peer?.screenshotIdeType;
29808
+ const ideType = instanceId || peer?.screenshotIdeType;
29805
29809
  if (!ideType) {
29806
- log(`[Input] WARNING: No screenshotIdeType for peer ${peerId} \u2014 input may route to wrong IDE`);
29810
+ log(`[Input] WARNING: No instanceId or screenshotIdeType for peer ${peerId}`);
29807
29811
  }
29808
29812
  const result = await this.inputHandler({ action, params, ideType });
29809
29813
  this.sendToPeer(peerId, { id, type: "response", success: true, result });
@@ -30175,7 +30179,7 @@ var init_adhdev_daemon = __esm({
30175
30179
  path2 = __toESM(require("path"));
30176
30180
  crypto2 = __toESM(require("crypto"));
30177
30181
  import_chalk = __toESM(require("chalk"));
30178
- pkgVersion = "0.5.23";
30182
+ pkgVersion = "0.5.24";
30179
30183
  if (pkgVersion === "unknown") {
30180
30184
  try {
30181
30185
  const possiblePaths = [
@@ -31172,6 +31176,38 @@ function registerSetupCommands(program2, providerLoader) {
31172
31176
  console.log(import_chalk3.default.gray(" Run `adhdev setup` to reconfigure.\n"));
31173
31177
  }
31174
31178
  });
31179
+ program2.command("logout").description("Log out from ADHDev (clear auth credentials, keep config)").option("-f, --force", "Skip confirmation prompt").action(async (options) => {
31180
+ const { loadConfig: loadConfig3, saveConfig: saveConfig2 } = await Promise.resolve().then(() => __toESM(require_dist()));
31181
+ if (!options.force) {
31182
+ const inquirer2 = await import("inquirer");
31183
+ const { confirm } = await inquirer2.default.prompt([
31184
+ {
31185
+ type: "confirm",
31186
+ name: "confirm",
31187
+ message: "Log out from ADHDev? This will clear your auth token and disconnect the daemon.",
31188
+ default: false
31189
+ }
31190
+ ]);
31191
+ if (!confirm) return;
31192
+ }
31193
+ try {
31194
+ const { isDaemonRunning: isDaemonRunning2, stopDaemon: stopDaemon2 } = await Promise.resolve().then(() => (init_adhdev_daemon(), adhdev_daemon_exports));
31195
+ if (isDaemonRunning2()) {
31196
+ console.log(import_chalk3.default.gray(" Stopping daemon..."));
31197
+ stopDaemon2();
31198
+ }
31199
+ } catch {
31200
+ }
31201
+ const config2 = loadConfig3();
31202
+ config2.apiToken = null;
31203
+ config2.connectionToken = null;
31204
+ config2.userEmail = null;
31205
+ config2.userName = null;
31206
+ saveConfig2(config2);
31207
+ console.log(import_chalk3.default.green("\n\u2713 Logged out successfully."));
31208
+ console.log(import_chalk3.default.gray(" Auth credentials cleared. IDE and workspace settings preserved."));
31209
+ console.log(import_chalk3.default.gray(" Run `adhdev setup` to log in again.\n"));
31210
+ });
31175
31211
  }
31176
31212
 
31177
31213
  // src/cli/daemon-commands.ts