@adhdev/daemon-core 0.9.82-rc.319 → 0.9.82-rc.320

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.mjs CHANGED
@@ -348,10 +348,10 @@ function readInjected(value) {
348
348
  }
349
349
  function getDaemonBuildInfo() {
350
350
  if (cached) return cached;
351
- const commit = readInjected(true ? "b7441eaef1ad5631a86c48e4931520524ff8cdec" : void 0) ?? "unknown";
352
- const commitShort = readInjected(true ? "b7441eae" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
353
- const version = readInjected(true ? "0.9.82-rc.319" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
354
- const builtAt = readInjected(true ? "2026-06-18T17:15:31.135Z" : void 0);
351
+ const commit = readInjected(true ? "bbaf30f95c09531cec77fb48a8cf6d38b3b6d7f9" : void 0) ?? "unknown";
352
+ const commitShort = readInjected(true ? "bbaf30f9" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
353
+ const version = readInjected(true ? "0.9.82-rc.320" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
354
+ const builtAt = readInjected(true ? "2026-06-19T01:16:38.511Z" : void 0);
355
355
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
356
356
  return cached;
357
357
  }
@@ -9175,6 +9175,13 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
9175
9175
  markAutoLaunch(meshId, task.id, { status: "skipped", reason: "target_session_constraint" });
9176
9176
  continue;
9177
9177
  }
9178
+ if (task.autoLaunch?.status === "completed" && task.autoLaunch.sessionId) {
9179
+ const launchedAtMs = Date.parse(task.autoLaunch.updatedAt);
9180
+ if (Number.isFinite(launchedAtMs) && Date.now() - launchedAtMs < AUTO_LAUNCH_AWAIT_CLAIM_MS) {
9181
+ recordAutoLaunchEvent(meshId, { phase: "skipped", taskId: task.id, reason: "awaiting_launched_session_claim", nodeId: task.autoLaunch.nodeId, sessionId: task.autoLaunch.sessionId });
9182
+ continue;
9183
+ }
9184
+ }
9178
9185
  const candidateNodes = Array.isArray(mesh?.nodes) ? mesh.nodes.filter((node) => {
9179
9186
  if (task.targetNodeId && readMeshNodeId(node) !== task.targetNodeId) return false;
9180
9187
  if (task.requiredTags?.length) {
@@ -9892,7 +9899,13 @@ function injectMeshSystemMessage(components, args) {
9892
9899
  metadataEvent: args.metadataEvent,
9893
9900
  recoveryContext
9894
9901
  });
9895
- if (!messageText) return { success: false, error: "unsupported mesh event" };
9902
+ if (!messageText) {
9903
+ const isSilentClaimRelevantEvent = args.event === "agent:ready" || args.event === "agent:generating_started";
9904
+ const coordinatorIsRemote = !!workerCoordinatorDaemonId && !resolveCoordinatorDrainDaemonIds(components).includes(workerCoordinatorDaemonId);
9905
+ if (!(isSilentClaimRelevantEvent && coordinatorIsRemote)) {
9906
+ return { success: false, error: "unsupported mesh event" };
9907
+ }
9908
+ }
9896
9909
  const pendingEvent = {
9897
9910
  event: args.event,
9898
9911
  meshId: args.meshId,
@@ -9903,7 +9916,11 @@ function injectMeshSystemMessage(components, args) {
9903
9916
  ...args.metadataEvent,
9904
9917
  ...recoveryContext ? { recoveryContext } : {}
9905
9918
  },
9906
- coordinatorMessage: messageText,
9919
+ // Silent lifecycle events (agent:ready / agent:generating_started) carry no
9920
+ // coordinator message; they are queued only so the coordinator re-runs the
9921
+ // remote-claim state machine on pull. injectPendingIntoCoordinator skips
9922
+ // entries without a coordinatorMessage, so a live CLI coordinator is not spammed.
9923
+ ...messageText ? { coordinatorMessage: messageText } : {},
9907
9924
  queuedAt: Date.now(),
9908
9925
  ...workerCoordinatorDaemonId ? { targetCoordinatorDaemonId: workerCoordinatorDaemonId } : {}
9909
9926
  };
@@ -10055,7 +10072,7 @@ function setupMeshEventForwarding(components) {
10055
10072
  });
10056
10073
  });
10057
10074
  }
10058
- var REMOTE_IDLE_SESSION_TTL_MS, meshByWorkspaceCache, MESH_WORKSPACE_CACHE_TTL_MS, IDLE_AUTO_FAST_FORWARD_THROTTLE_MS, idleAutoFastForwardLastAttempt, INTENTIONAL_CLEANUP_STOP_SUPPRESSION_MS, RECENT_COMPLETION_FINGERPRINT_TTL_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, lastAutoLaunchLedgerKey, AUTO_LAUNCH_LEDGER_DEDUP_MAX, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, MESH_FORCE_INJECT_EVENTS;
10075
+ var REMOTE_IDLE_SESSION_TTL_MS, meshByWorkspaceCache, MESH_WORKSPACE_CACHE_TTL_MS, IDLE_AUTO_FAST_FORWARD_THROTTLE_MS, idleAutoFastForwardLastAttempt, INTENTIONAL_CLEANUP_STOP_SUPPRESSION_MS, RECENT_COMPLETION_FINGERPRINT_TTL_MS, autoLaunchInProgress, autoLaunchCooldownUntil, AUTO_LAUNCH_COOLDOWN_MS, AUTO_LAUNCH_AWAIT_CLAIM_MS, lastAutoLaunchLedgerKey, AUTO_LAUNCH_LEDGER_DEDUP_MAX, MESH_COORDINATOR_EVENTS, EVENT_TO_LEDGER_KIND, MESH_FORCE_INJECT_EVENTS;
10059
10076
  var init_mesh_events_coordinator = __esm({
10060
10077
  "src/mesh/mesh-events-coordinator.ts"() {
10061
10078
  "use strict";
@@ -10085,6 +10102,7 @@ var init_mesh_events_coordinator = __esm({
10085
10102
  autoLaunchInProgress = /* @__PURE__ */ new Set();
10086
10103
  autoLaunchCooldownUntil = /* @__PURE__ */ new Map();
10087
10104
  AUTO_LAUNCH_COOLDOWN_MS = 5e3;
10105
+ AUTO_LAUNCH_AWAIT_CLAIM_MS = 9e4;
10088
10106
  lastAutoLaunchLedgerKey = /* @__PURE__ */ new Map();
10089
10107
  AUTO_LAUNCH_LEDGER_DEDUP_MAX = 2e3;
10090
10108
  MESH_COORDINATOR_EVENTS = /* @__PURE__ */ new Set([