adhdev 0.8.66 → 0.8.67

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
@@ -52960,7 +52960,7 @@ var init_adhdev_daemon = __esm({
52960
52960
  init_source2();
52961
52961
  init_version();
52962
52962
  init_src();
52963
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.66" });
52963
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.8.67" });
52964
52964
  AdhdevDaemon = class _AdhdevDaemon {
52965
52965
  localHttpServer = null;
52966
52966
  localWss = null;
@@ -53682,6 +53682,15 @@ ${err?.stack || ""}`);
53682
53682
  await this.handleCommand(msg, msg.type, msg.payload);
53683
53683
  });
53684
53684
  }
53685
+ shouldFastFlushLaunchStatus(commandType, result) {
53686
+ if (!result || result.success !== true) return false;
53687
+ return commandType === "launch_cli" || commandType === "launch_ide";
53688
+ }
53689
+ triggerImmediateLaunchStatusUpdate(reason) {
53690
+ this.statusReporter?.resetP2PHash();
53691
+ void this.statusReporter?.sendUnifiedStatusReport({ forceServer: true, reason });
53692
+ void this.flushP2PDaemonMetadataSubscriptions();
53693
+ }
53685
53694
  async handleCommand(msg, cmd, args) {
53686
53695
  const normalizedArgs = this.ensureInteractionContext(args);
53687
53696
  const interactionId = String(normalizedArgs._interactionId);
@@ -53709,6 +53718,9 @@ ${err?.stack || ""}`);
53709
53718
  return;
53710
53719
  }
53711
53720
  const result = await this.components.router.execute(cmd, normalizedArgs, source);
53721
+ if (this.shouldFastFlushLaunchStatus(cmd, result)) {
53722
+ this.triggerImmediateLaunchStatusUpdate(`command:${cmd}`);
53723
+ }
53712
53724
  if (cmd.startsWith("workspace_")) this.statusReporter?.throttledReport();
53713
53725
  if (cmd === "get_status_metadata" || cmd.startsWith("workspace_") || cmd.startsWith("session_host_")) {
53714
53726
  void this.flushP2PDaemonMetadataSubscriptions();
@@ -53779,6 +53791,9 @@ ${err?.stack || ""}`);
53779
53791
  }
53780
53792
  }
53781
53793
  const routed = await this.components.router.execute(cmdType, normalizedData, "p2p");
53794
+ if (this.shouldFastFlushLaunchStatus(cmdType, routed)) {
53795
+ this.triggerImmediateLaunchStatusUpdate(`p2p:${cmdType}`);
53796
+ }
53782
53797
  if (cmdType.startsWith("workspace_")) this.statusReporter?.throttledReport();
53783
53798
  if (cmdType === "get_status_metadata" || cmdType.startsWith("workspace_") || cmdType.startsWith("session_host_")) {
53784
53799
  void this.flushP2PDaemonMetadataSubscriptions();