@adhdev/daemon-core 0.9.82-rc.331 → 0.9.82-rc.332

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
@@ -316,10 +316,10 @@ function readInjected(value) {
316
316
  }
317
317
  function getDaemonBuildInfo() {
318
318
  if (cached) return cached;
319
- const commit = readInjected(true ? "a6ef3a58ea926c6fa42f5ec53fae14e0bd5cac1b" : void 0) ?? "unknown";
320
- const commitShort = readInjected(true ? "a6ef3a58" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
- const version = readInjected(true ? "0.9.82-rc.331" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
- const builtAt = readInjected(true ? "2026-06-20T00:34:05.737Z" : void 0);
319
+ const commit = readInjected(true ? "2466d8b001000d509eb9058a0c51ec6f383741ed" : void 0) ?? "unknown";
320
+ const commitShort = readInjected(true ? "2466d8b0" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
321
+ const version = readInjected(true ? "0.9.82-rc.332" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
322
+ const builtAt = readInjected(true ? "2026-06-20T01:55:54.421Z" : void 0);
323
323
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
324
324
  return cached;
325
325
  }
@@ -10669,6 +10669,21 @@ function handleMeshForwardEvent(components, payload) {
10669
10669
  targetSessionId: readNonEmptyString2(payload.targetSessionId) || readNonEmptyString2(payload.sessionId) || readNonEmptyString2(payload.instanceId),
10670
10670
  providerType: readNonEmptyString2(payload.providerType),
10671
10671
  providerSessionId: readNonEmptyString2(payload.providerSessionId),
10672
+ // Carry the session identity fields the worker provider event emits so the
10673
+ // coordinator's mirror (updateMeshOwnedSession) gets a real workspace/title/
10674
+ // settings. Without these the remote-relay hop reconstructs metadataEvent with
10675
+ // an empty workspace, and the dashboard flaps to the generic
10676
+ // "Terminal (Mesh Node)" title (and degrades the provider label) between live
10677
+ // events and the periodic get_status_metadata snapshot. The local in-process
10678
+ // forward path (onMeshCoordinatorEventForwarded) already preserves these; this
10679
+ // mirrors them for the remote-only relay path.
10680
+ workspace: readNonEmptyString2(payload.workspace) || readNonEmptyString2(payload.workspaceName),
10681
+ workspaceName: readNonEmptyString2(payload.workspaceName) || readNonEmptyString2(payload.workspace),
10682
+ sessionTitle: readNonEmptyString2(payload.sessionTitle),
10683
+ sessionStatus: readNonEmptyString2(payload.sessionStatus),
10684
+ sessionChatStatus: readNonEmptyString2(payload.sessionChatStatus),
10685
+ providerName: readNonEmptyString2(payload.providerName),
10686
+ ...payload.sessionSettings && typeof payload.sessionSettings === "object" && !Array.isArray(payload.sessionSettings) ? { sessionSettings: payload.sessionSettings } : {},
10672
10687
  finalSummary: readNonEmptyString2(payload.finalSummary) || readNonEmptyString2(payload.summary),
10673
10688
  jobId: readNonEmptyString2(payload.jobId),
10674
10689
  interactionId: readNonEmptyString2(payload.interactionId),
@@ -11549,7 +11564,8 @@ function findLiveCoordinators(components) {
11549
11564
  const meshId = readNonEmptyString2(settings.meshCoordinatorFor);
11550
11565
  if (!meshId) continue;
11551
11566
  const status = readNonEmptyString2(state.status).toLowerCase();
11552
- out.push({ meshId, instance: inst, idle: status === "idle" });
11567
+ const modalParked = status === "waiting_choice" || status === "waiting_approval";
11568
+ out.push({ meshId, instance: inst, idle: status === "idle", modalParked });
11553
11569
  }
11554
11570
  return out;
11555
11571
  }
@@ -11638,9 +11654,16 @@ async function runMeshReconcileTick(components) {
11638
11654
  }
11639
11655
  for (const [meshId, meshCoordinators] of byMesh) {
11640
11656
  const idleCoordinators = meshCoordinators.filter((c) => c.idle);
11641
- const generatingCoordinators = meshCoordinators.filter((c) => !c.idle);
11657
+ const generatingCoordinators = meshCoordinators.filter((c) => !c.idle && !c.modalParked);
11658
+ const modalParkedCoordinators = meshCoordinators.filter((c) => !c.idle && c.modalParked);
11642
11659
  const targetCoordinators = idleCoordinators.length > 0 ? idleCoordinators : generatingCoordinators;
11643
11660
  const forceOnly = idleCoordinators.length === 0;
11661
+ if (targetCoordinators.length === 0) {
11662
+ if (modalParkedCoordinators.length > 0) {
11663
+ LOG.info("MeshReconcile", `Reconcile skip \u2192 modal-parked: holding pending event(s) for mesh ${meshId} (${modalParkedCoordinators.length} coordinator(s) awaiting a modal answer; events left queued)`);
11664
+ }
11665
+ continue;
11666
+ }
11644
11667
  if (store) {
11645
11668
  try {
11646
11669
  if (store.pendingEventCount(meshId) === 0) continue;
@@ -15957,6 +15980,10 @@ ${lastSnapshot}`;
15957
15980
  if (!this.ptyProcess) throw new Error(`${this.cliName} is not running`);
15958
15981
  const content = String(text || "");
15959
15982
  if (!content.trim()) return;
15983
+ if (this.engine.currentStatus === "waiting_approval" || this.engine.hasActionableApproval()) {
15984
+ LOG.info("CLI", `[${this.cliType}] force-send held \u2014 session parked on approval modal (status=${this.engine.currentStatus})`);
15985
+ return;
15986
+ }
15960
15987
  LOG.info("CLI", `[${this.cliType}] force-sending prompt while status=${this.engine.currentStatus}`);
15961
15988
  await this.writeToPty(content + this.sendKey);
15962
15989
  this.onStatusChange?.();
@@ -34861,6 +34888,35 @@ var CliProviderInstance = class _CliProviderInstance {
34861
34888
  this.settings = rest;
34862
34889
  this.adapter.updateRuntimeSettings?.(this.settings);
34863
34890
  }
34891
+ /**
34892
+ * The resolved modal-park status of this session, or null when it is not
34893
+ * parked on a modal awaiting a human answer. Mirrors the overlay logic in
34894
+ * getState(): an active AskUserQuestion interactive prompt resolves to
34895
+ * waiting_choice; otherwise the adapter's waiting_approval (tool consent)
34896
+ * counts — UNLESS auto-approve will dismiss it, in which case the session is
34897
+ * effectively generating and is NOT modal-parked. This is the single signal
34898
+ * the mesh force-inject guard consults, and the same status string the
34899
+ * reconcile loop reads off get_status_metadata. Lowercase literals only —
34900
+ * the SessionStatus enum is forked across modules and waiting_choice is
34901
+ * absent from some of them.
34902
+ */
34903
+ resolveModalParkStatus() {
34904
+ if (this.activeInteractivePrompt) return "waiting_choice";
34905
+ let adapterStatus;
34906
+ try {
34907
+ adapterStatus = this.adapter.getStatus({ allowParse: false });
34908
+ } catch {
34909
+ return null;
34910
+ }
34911
+ if (adapterStatus.status === "waiting_approval" && !this.shouldAutoApprove()) {
34912
+ return "waiting_approval";
34913
+ }
34914
+ return null;
34915
+ }
34916
+ /** True when this session is parked on a modal awaiting a human answer. */
34917
+ isModalParked() {
34918
+ return this.resolveModalParkStatus() !== null;
34919
+ }
34864
34920
  onEvent(event, data) {
34865
34921
  if (event === "send_message") {
34866
34922
  const input = normalizeInputEnvelope(data);
@@ -34868,6 +34924,10 @@ var CliProviderInstance = class _CliProviderInstance {
34868
34924
  const promptText = buildCliStructuredInputPrompt(input);
34869
34925
  if (promptText) {
34870
34926
  const force = data?.force === true;
34927
+ if (force && this.isModalParked()) {
34928
+ LOG.info("CLI", `[${this.type}] force send_message held \u2014 coordinator parked on modal (${this.resolveModalParkStatus()})`);
34929
+ return;
34930
+ }
34871
34931
  void this.adapter.sendMessage(promptText, force ? { force: true } : {}).catch((e) => {
34872
34932
  LOG.warn("CLI", `[${this.type}] send_message failed: ${e?.message || e}`);
34873
34933
  });