@adhdev/daemon-standalone 0.9.82-rc.370 → 0.9.82-rc.371

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
@@ -30036,10 +30036,10 @@ var require_dist3 = __commonJS({
30036
30036
  }
30037
30037
  function getDaemonBuildInfo() {
30038
30038
  if (cached2) return cached2;
30039
- const commit = readInjected(true ? "84d52e533859a9dd3c3bc8bc11a2541911f7bd0c" : void 0) ?? "unknown";
30040
- const commitShort = readInjected(true ? "84d52e53" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
- const version2 = readInjected(true ? "0.9.82-rc.370" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
- const builtAt = readInjected(true ? "2026-06-24T10:08:19.248Z" : void 0);
30039
+ const commit = readInjected(true ? "0e66043bc2858f114fbdd7b1edeb7774f33bfd2d" : void 0) ?? "unknown";
30040
+ const commitShort = readInjected(true ? "0e66043b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
30041
+ const version2 = readInjected(true ? "0.9.82-rc.371" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
30042
+ const builtAt = readInjected(true ? "2026-06-24T12:30:40.845Z" : void 0);
30043
30043
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
30044
30044
  return cached2;
30045
30045
  }
@@ -50518,6 +50518,7 @@ ${lastSnapshot}`;
50518
50518
  MESH_CONVERGE_FAST_FORWARD_TAG: () => MESH_CONVERGE_FAST_FORWARD_TAG,
50519
50519
  MESH_CONVERGE_REFINE_TAG: () => MESH_CONVERGE_REFINE_TAG,
50520
50520
  MESH_MISSION_STATUSES: () => MESH_MISSION_STATUSES,
50521
+ MESH_NODE_LIVE_TRUTH_MARKER: () => MESH_NODE_LIVE_TRUTH_MARKER,
50521
50522
  MESH_REFINE_CONFIG_LOCATIONS: () => MESH_REFINE_CONFIG_LOCATIONS,
50522
50523
  MESH_REFINE_CONFIG_SCHEMA: () => MESH_REFINE_CONFIG_SCHEMA,
50523
50524
  MESH_SCHEDULING_STRATEGIES: () => MESH_SCHEDULING_STRATEGIES,
@@ -50564,6 +50565,7 @@ ${lastSnapshot}`;
50564
50565
  buildMeshLedgerReconciliationEvidence: () => buildMeshLedgerReconciliationEvidence,
50565
50566
  buildMeshLedgerReplicaEvidence: () => buildMeshLedgerReplicaEvidence,
50566
50567
  buildMeshNodeCapabilityTags: () => buildMeshNodeCapabilityTags,
50568
+ buildMeshNodeDataFreshness: () => buildMeshNodeDataFreshness,
50567
50569
  buildMissionPromptSection: () => buildMissionPromptSection,
50568
50570
  buildP2pRelayFailurePayload: () => buildP2pRelayFailurePayload,
50569
50571
  buildPinnedGlobalInstallCommand: () => buildPinnedGlobalInstallCommand,
@@ -77259,6 +77261,50 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
77259
77261
  return ctx.startMeshRefineBatchJob(meshId, requestedNodeIds, args);
77260
77262
  }
77261
77263
  };
77264
+ init_dist();
77265
+ var RESTART_BLOCKING_STATES = /* @__PURE__ */ new Set(["generating", "waiting_approval", "starting"]);
77266
+ function hasBlockingSessions(ctx) {
77267
+ const states = ctx.deps.instanceManager.collectAllStates();
77268
+ for (const state of states) {
77269
+ if (RESTART_BLOCKING_STATES.has(String(state.status || ""))) return true;
77270
+ const childStates = "extensions" in state && Array.isArray(state.extensions) ? state.extensions : [];
77271
+ for (const child of childStates) {
77272
+ if (RESTART_BLOCKING_STATES.has(String(child?.status || ""))) return true;
77273
+ }
77274
+ }
77275
+ return false;
77276
+ }
77277
+ var meshRestartHandlers = {
77278
+ restart_daemon_node: async (ctx, args) => {
77279
+ const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
77280
+ const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
77281
+ let nodeDaemonId;
77282
+ if (meshId && nodeId) {
77283
+ const meshRecord = await ctx.getMeshForCommand(meshId, args?.inlineMesh, { preferInline: true });
77284
+ const node = meshRecord?.mesh?.nodes?.find((n) => meshNodeIdMatches(n, nodeId));
77285
+ nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
77286
+ }
77287
+ const selfDaemonId = ctx.deps.statusInstanceId;
77288
+ const isRemote = nodeDaemonId && selfDaemonId && !daemonIdsEquivalent(nodeDaemonId, selfDaemonId);
77289
+ if (isRemote && ctx.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
77290
+ const forwarded = await ctx.deps.dispatchMeshCommand(nodeDaemonId, "restart_daemon_node", {
77291
+ ...typeof args === "object" && args !== null ? args : {},
77292
+ _meshDirectDispatch: true
77293
+ });
77294
+ return forwarded ?? { success: false, error: "no response from remote node" };
77295
+ }
77296
+ if (hasBlockingSessions(ctx)) {
77297
+ return {
77298
+ success: false,
77299
+ restarted: false,
77300
+ code: "blocking_sessions",
77301
+ reason: "Daemon has an active session (generating / waiting_approval / starting); restart refused to avoid interrupting in-flight work. Retry when the node is idle."
77302
+ };
77303
+ }
77304
+ const result = await daemonLifecycleHandlers.daemon_upgrade({ deps: ctx.deps }, args);
77305
+ return { ...result, restarted: result?.restarting === true };
77306
+ }
77307
+ };
77262
77308
  var medFamilyRegistry = new Map(
77263
77309
  Object.entries({
77264
77310
  ...cliAgentHandlers,
@@ -77266,7 +77312,8 @@ ${formatManifestValidationIssues2(validation2.issues)}`);
77266
77312
  ...meshCrudHandlers,
77267
77313
  ...meshHostPairingHandlers,
77268
77314
  ...meshQueueHandlers,
77269
- ...fastForwardHandlers
77315
+ ...fastForwardHandlers,
77316
+ ...meshRestartHandlers
77270
77317
  })
77271
77318
  );
77272
77319
  init_mesh_events();