@adhdev/daemon-standalone 0.9.82-rc.389 → 0.9.82-rc.390

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
@@ -30108,10 +30108,10 @@ var require_dist3 = __commonJS({
30108
30108
  }
30109
30109
  function getDaemonBuildInfo() {
30110
30110
  if (cached2) return cached2;
30111
- const commit = readInjected(true ? "f82b4b4cdb13171d2666cc959054b788af4f2ea5" : void 0) ?? "unknown";
30112
- const commitShort = readInjected(true ? "f82b4b4c" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30113
- const version2 = readInjected(true ? "0.9.82-rc.389" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30114
- const builtAt = readInjected(true ? "2026-06-26T06:17:46.237Z" : void 0);
30111
+ const commit = readInjected(true ? "25bb0512a5fd46999cb1fe21ef4ab7e2ed23a6c6" : void 0) ?? "unknown";
30112
+ const commitShort = readInjected(true ? "25bb0512" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30113
+ const version2 = readInjected(true ? "0.9.82-rc.390" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30114
+ const builtAt = readInjected(true ? "2026-06-26T09:56:10.994Z" : void 0);
30115
30115
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30116
30116
  return cached2;
30117
30117
  }
@@ -68770,6 +68770,24 @@ ${body}
68770
68770
  * from scratch rather than firing on a stale timestamp.
68771
68771
  */
68772
68772
  static AUTO_APPROVE_GATE_HYSTERESIS_MS = 1500;
68773
+ /**
68774
+ * STATUS-MISMATCH: upper bound on how long the auto-approve→`generating` SURFACE
68775
+ * mask may hide a worker's `waiting_approval` (status + activeModal) before we give
68776
+ * up and surface the real prompt. The mask exists because auto-approve is expected
68777
+ * to resolve the modal momentarily; but if it STALLS without ever calling
68778
+ * resolveModal — the modal signature never settles for AUTO_APPROVE_SETTLE_MS (a
68779
+ * perpetually-flapping/streaming prompt), no concrete modal is ever captured, or the
68780
+ * modal is a picker/non-affirmative we never auto-pick — the mask would persist
68781
+ * forever and read_chat / mesh_status / the dashboard would NEVER see the pending
68782
+ * approval (the coordinator cannot mesh_approve what it cannot see). Once an episode
68783
+ * exceeds this bound we stop masking. Generously larger than
68784
+ * AUTO_APPROVE_SETTLE_MS (600) + AUTO_APPROVE_GATE_HYSTERESIS_MS (1500) so a
68785
+ * legitimately slow-settling / blip-flapping prompt is never unmasked early; a
68786
+ * genuine never-resolving stall surfaces within this window. The settle gate keeps
68787
+ * running underneath, so a prompt that finally stabilises still auto-approves, and
68788
+ * mesh_approve (raw FSM, unmasked) works throughout.
68789
+ */
68790
+ static AUTO_APPROVE_MASK_STALL_MS = 4500;
68773
68791
  adapter;
68774
68792
  context = null;
68775
68793
  events = [];
@@ -68803,6 +68821,14 @@ ${body}
68803
68821
  // a settle gate was in progress. Drives AUTO_APPROVE_GATE_HYSTERESIS_MS so a
68804
68822
  // brief generating flip does not immediately wipe the settle clock.
68805
68823
  autoApproveInactiveSince = 0;
68824
+ // STATUS-MISMATCH: wall-clock when the CURRENT auto-approve episode (waiting_approval
68825
+ // + shouldAutoApprove) first began wanting to mask. Unlike pendingAutoApprovalSince it
68826
+ // is NOT reset when the modal signature changes (a still-streaming/flapping prompt) and
68827
+ // survives the same hysteresis blips the settle gate does, so it measures the TRUE age
68828
+ // of an unresolved auto-approve. Once it exceeds AUTO_APPROVE_MASK_STALL_MS the surface
68829
+ // mask is dropped so the real waiting_approval surfaces. Cleared when the episode ends
68830
+ // (modal genuinely gone, manual attendance takes over, or auto-approve fires).
68831
+ autoApproveMaskSince = 0;
68806
68832
  // Provider-common manual-attendance signal: while a human is actively driving
68807
68833
  // this session from the dashboard, auto-approve holds so they can take manual
68808
68834
  // control. Background mesh workers are never attended → delegated auto-approve
@@ -68950,7 +68976,8 @@ ${body}
68950
68976
  this.provider,
68951
68977
  typeof adapterStatus?.providerSessionId === "string" ? adapterStatus.providerSessionId : ""
68952
68978
  );
68953
- const autoApproveActive = this.maybeAutoApproveStatus(adapterStatus, Date.now());
68979
+ const nowMs = Date.now();
68980
+ const autoApproveActive = this.maybeAutoApproveStatus(adapterStatus, nowMs) && !this.autoApproveMaskStalled(nowMs);
68954
68981
  const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
68955
68982
  let visibleStatus = parseErrorMessage || parsedStatus?.status === "error" ? "error" : autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
68956
68983
  if (isCliGeneratingLikeStatus(visibleStatus) && this.lastStatus === "idle") {
@@ -69091,7 +69118,8 @@ ${body}
69091
69118
  }
69092
69119
  getHotChatSessionState() {
69093
69120
  const adapterStatus = this.adapter.getStatus({ allowParse: false });
69094
- const autoApproveActive = this.autoApproveEffectivelyActive(adapterStatus.status);
69121
+ const nowMs = Date.now();
69122
+ const autoApproveActive = this.autoApproveEffectivelyActive(adapterStatus.status, nowMs) && !this.autoApproveMaskStalled(nowMs);
69095
69123
  const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
69096
69124
  const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
69097
69125
  const runtime = this.adapter.getRuntimeMetadata();
@@ -69106,7 +69134,8 @@ ${body}
69106
69134
  }
69107
69135
  getSessionModalState(sessionId) {
69108
69136
  const adapterStatus = this.adapter.getStatus({ allowParse: true });
69109
- const autoApproveActive = this.autoApproveEffectivelyActive(adapterStatus.status);
69137
+ const nowMs = Date.now();
69138
+ const autoApproveActive = this.autoApproveEffectivelyActive(adapterStatus.status, nowMs) && !this.autoApproveMaskStalled(nowMs);
69110
69139
  const autoApproveHoldIdle = this.autoApproveBusy && adapterStatus.status === "idle";
69111
69140
  const visibleStatus = autoApproveActive || autoApproveHoldIdle ? "generating" : adapterStatus.status;
69112
69141
  const dirName = workingDirBasename(this.workingDir);
@@ -69219,7 +69248,7 @@ ${body}
69219
69248
  } catch {
69220
69249
  return null;
69221
69250
  }
69222
- if (adapterStatus.status === "waiting_approval" && !this.autoApproveEffectivelyActive(adapterStatus.status)) {
69251
+ if (adapterStatus.status === "waiting_approval" && (!this.autoApproveEffectivelyActive(adapterStatus.status) || this.autoApproveMaskStalled())) {
69223
69252
  return "waiting_approval";
69224
69253
  }
69225
69254
  return null;
@@ -69758,6 +69787,7 @@ ${body}
69758
69787
  this.pendingAutoApprovalSignature = "";
69759
69788
  this.pendingAutoApprovalSince = 0;
69760
69789
  this.autoApproveInactiveSince = 0;
69790
+ this.autoApproveMaskSince = 0;
69761
69791
  if (this.autoApproveSettleTimer) clearTimeout(this.autoApproveSettleTimer);
69762
69792
  this.autoApproveSettleTimer = setTimeout(() => {
69763
69793
  this.autoApproveSettleTimer = null;
@@ -69783,6 +69813,7 @@ ${body}
69783
69813
  this.pendingAutoApprovalSignature = "";
69784
69814
  this.pendingAutoApprovalSince = 0;
69785
69815
  this.autoApproveInactiveSince = 0;
69816
+ this.autoApproveMaskSince = 0;
69786
69817
  if (this.autoApproveSettleTimer) {
69787
69818
  clearTimeout(this.autoApproveSettleTimer);
69788
69819
  this.autoApproveSettleTimer = null;
@@ -69790,6 +69821,7 @@ ${body}
69790
69821
  return autoApproveActive;
69791
69822
  }
69792
69823
  this.autoApproveInactiveSince = 0;
69824
+ if (!this.autoApproveMaskSince) this.autoApproveMaskSince = now;
69793
69825
  const modal = adapterStatus.activeModal;
69794
69826
  const buttons = Array.isArray(modal?.buttons) ? modal.buttons.map((b) => String(b || "").trim()).filter(Boolean) : [];
69795
69827
  if (!modal || buttons.length === 0) {
@@ -69835,6 +69867,7 @@ ${body}
69835
69867
  this.pendingAutoApprovalSignature = "";
69836
69868
  this.pendingAutoApprovalSince = 0;
69837
69869
  this.autoApproveInactiveSince = 0;
69870
+ this.autoApproveMaskSince = 0;
69838
69871
  if (this.autoApproveBusyTimer) clearTimeout(this.autoApproveBusyTimer);
69839
69872
  this.autoApproveBusyTimer = setTimeout(() => {
69840
69873
  this.autoApproveBusy = false;
@@ -70276,6 +70309,16 @@ ${effect.notification.body || ""}`.trim();
70276
70309
  autoApproveEffectivelyActive(status, now = Date.now()) {
70277
70310
  return status === "waiting_approval" && this.shouldAutoApprove() && !this.manualAttendance.isAttended(now);
70278
70311
  }
70312
+ // STATUS-MISMATCH: true once the current auto-approve episode has been masking
70313
+ // waiting_approval behind `generating` for longer than AUTO_APPROVE_MASK_STALL_MS without
70314
+ // resolving (the settle gate never fired). When stalled, the surface mask must be dropped
70315
+ // so read_chat / mesh_status / the dashboard see the real waiting_approval + modal (and a
70316
+ // coordinator can mesh_approve it). autoApproveMaskSince is maintained by
70317
+ // maybeAutoApproveStatus (driven by getState + the recheck timer during a waiting episode);
70318
+ // this read is side-effect-free so getStatusMetadata can consult it too.
70319
+ autoApproveMaskStalled(now = Date.now()) {
70320
+ return this.autoApproveMaskSince > 0 && now - this.autoApproveMaskSince > _CliProviderInstance.AUTO_APPROVE_MASK_STALL_MS;
70321
+ }
70279
70322
  recordAutoApproval(modalMessage, buttonLabel, now = Date.now()) {
70280
70323
  this.appendRuntimeSystemMessage(
70281
70324
  formatAutoApprovalMessage(modalMessage, buttonLabel),
@@ -78364,11 +78407,12 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
78364
78407
  get_pending_mesh_events: async (ctx, args) => {
78365
78408
  const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
78366
78409
  const coordinatorDaemonId = typeof args?.coordinatorDaemonId === "string" && args.coordinatorDaemonId.trim() ? args.coordinatorDaemonId.trim() : void 0;
78410
+ const hasLiveCliCoordinator = meshId ? resolveCoordinatorDrainDeliverability(ctx.deps, meshId).hasLiveCliCoordinator : false;
78367
78411
  if (meshId && shouldHoldPendingDrainForBusyLocalCoordinator(ctx.deps, meshId, coordinatorDaemonId)) {
78368
- return { success: true, events: [], heldForBusyLocalCoordinator: true };
78412
+ return { success: true, events: [], heldForBusyLocalCoordinator: true, hasLiveCliCoordinator };
78369
78413
  }
78370
78414
  const events = drainPendingMeshCoordinatorEvents(meshId || void 0, coordinatorDaemonId);
78371
- return { success: true, events };
78415
+ return { success: true, events, hasLiveCliCoordinator };
78372
78416
  },
78373
78417
  interactive_prompt_response: async (ctx, args) => {
78374
78418
  const sessionId = typeof args?.targetSessionId === "string" && args.targetSessionId.trim() ? args.targetSessionId.trim() : typeof args?.sessionId === "string" && args.sessionId.trim() ? args.sessionId.trim() : "";