@adhdev/daemon-core 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/commands/med-family/mesh-restart.d.ts +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +56 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/commands/med-family/index.ts +2 -0
- package/src/commands/med-family/mesh-restart.ts +92 -0
- package/src/index.ts +1 -1
package/dist/index.mjs
CHANGED
|
@@ -311,10 +311,10 @@ function readInjected(value) {
|
|
|
311
311
|
}
|
|
312
312
|
function getDaemonBuildInfo() {
|
|
313
313
|
if (cached) return cached;
|
|
314
|
-
const commit = readInjected(true ? "
|
|
315
|
-
const commitShort = readInjected(true ? "
|
|
316
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
317
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
314
|
+
const commit = readInjected(true ? "0e66043bc2858f114fbdd7b1edeb7774f33bfd2d" : void 0) ?? "unknown";
|
|
315
|
+
const commitShort = readInjected(true ? "0e66043b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
316
|
+
const version = readInjected(true ? "0.9.82-rc.371" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
317
|
+
const builtAt = readInjected(true ? "2026-06-24T12:30:13.850Z" : void 0);
|
|
318
318
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
319
319
|
return cached;
|
|
320
320
|
}
|
|
@@ -47330,6 +47330,52 @@ var fastForwardHandlers = {
|
|
|
47330
47330
|
}
|
|
47331
47331
|
};
|
|
47332
47332
|
|
|
47333
|
+
// src/commands/med-family/mesh-restart.ts
|
|
47334
|
+
init_dist();
|
|
47335
|
+
var RESTART_BLOCKING_STATES = /* @__PURE__ */ new Set(["generating", "waiting_approval", "starting"]);
|
|
47336
|
+
function hasBlockingSessions(ctx) {
|
|
47337
|
+
const states = ctx.deps.instanceManager.collectAllStates();
|
|
47338
|
+
for (const state of states) {
|
|
47339
|
+
if (RESTART_BLOCKING_STATES.has(String(state.status || ""))) return true;
|
|
47340
|
+
const childStates = "extensions" in state && Array.isArray(state.extensions) ? state.extensions : [];
|
|
47341
|
+
for (const child of childStates) {
|
|
47342
|
+
if (RESTART_BLOCKING_STATES.has(String(child?.status || ""))) return true;
|
|
47343
|
+
}
|
|
47344
|
+
}
|
|
47345
|
+
return false;
|
|
47346
|
+
}
|
|
47347
|
+
var meshRestartHandlers = {
|
|
47348
|
+
restart_daemon_node: async (ctx, args) => {
|
|
47349
|
+
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
47350
|
+
const nodeId = typeof args?.nodeId === "string" ? args.nodeId.trim() : "";
|
|
47351
|
+
let nodeDaemonId;
|
|
47352
|
+
if (meshId && nodeId) {
|
|
47353
|
+
const meshRecord = await ctx.getMeshForCommand(meshId, args?.inlineMesh, { preferInline: true });
|
|
47354
|
+
const node = meshRecord?.mesh?.nodes?.find((n) => meshNodeIdMatches(n, nodeId));
|
|
47355
|
+
nodeDaemonId = typeof node?.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
47356
|
+
}
|
|
47357
|
+
const selfDaemonId = ctx.deps.statusInstanceId;
|
|
47358
|
+
const isRemote = nodeDaemonId && selfDaemonId && !daemonIdsEquivalent(nodeDaemonId, selfDaemonId);
|
|
47359
|
+
if (isRemote && ctx.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
|
|
47360
|
+
const forwarded = await ctx.deps.dispatchMeshCommand(nodeDaemonId, "restart_daemon_node", {
|
|
47361
|
+
...typeof args === "object" && args !== null ? args : {},
|
|
47362
|
+
_meshDirectDispatch: true
|
|
47363
|
+
});
|
|
47364
|
+
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
47365
|
+
}
|
|
47366
|
+
if (hasBlockingSessions(ctx)) {
|
|
47367
|
+
return {
|
|
47368
|
+
success: false,
|
|
47369
|
+
restarted: false,
|
|
47370
|
+
code: "blocking_sessions",
|
|
47371
|
+
reason: "Daemon has an active session (generating / waiting_approval / starting); restart refused to avoid interrupting in-flight work. Retry when the node is idle."
|
|
47372
|
+
};
|
|
47373
|
+
}
|
|
47374
|
+
const result = await daemonLifecycleHandlers.daemon_upgrade({ deps: ctx.deps }, args);
|
|
47375
|
+
return { ...result, restarted: result?.restarting === true };
|
|
47376
|
+
}
|
|
47377
|
+
};
|
|
47378
|
+
|
|
47333
47379
|
// src/commands/med-family/index.ts
|
|
47334
47380
|
var medFamilyRegistry = new Map(
|
|
47335
47381
|
Object.entries({
|
|
@@ -47338,7 +47384,8 @@ var medFamilyRegistry = new Map(
|
|
|
47338
47384
|
...meshCrudHandlers,
|
|
47339
47385
|
...meshHostPairingHandlers,
|
|
47340
47386
|
...meshQueueHandlers,
|
|
47341
|
-
...fastForwardHandlers
|
|
47387
|
+
...fastForwardHandlers,
|
|
47388
|
+
...meshRestartHandlers
|
|
47342
47389
|
})
|
|
47343
47390
|
);
|
|
47344
47391
|
|
|
@@ -61550,6 +61597,7 @@ export {
|
|
|
61550
61597
|
MESH_CONVERGE_FAST_FORWARD_TAG,
|
|
61551
61598
|
MESH_CONVERGE_REFINE_TAG,
|
|
61552
61599
|
MESH_MISSION_STATUSES,
|
|
61600
|
+
MESH_NODE_LIVE_TRUTH_MARKER,
|
|
61553
61601
|
MESH_REFINE_CONFIG_LOCATIONS,
|
|
61554
61602
|
MESH_REFINE_CONFIG_SCHEMA,
|
|
61555
61603
|
MESH_SCHEDULING_STRATEGIES,
|
|
@@ -61596,6 +61644,7 @@ export {
|
|
|
61596
61644
|
buildMeshLedgerReconciliationEvidence,
|
|
61597
61645
|
buildMeshLedgerReplicaEvidence,
|
|
61598
61646
|
buildMeshNodeCapabilityTags,
|
|
61647
|
+
buildMeshNodeDataFreshness,
|
|
61599
61648
|
buildMissionPromptSection,
|
|
61600
61649
|
buildP2pRelayFailurePayload,
|
|
61601
61650
|
buildPinnedGlobalInstallCommand,
|