@adhdev/daemon-core 0.9.82-rc.424 → 0.9.82-rc.426
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 +75 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/commands/med-family/mesh-crud.ts +58 -0
- package/src/mesh/mesh-reconcile-loop.ts +47 -1
package/dist/index.mjs
CHANGED
|
@@ -384,10 +384,10 @@ function readInjected(value) {
|
|
|
384
384
|
}
|
|
385
385
|
function getDaemonBuildInfo() {
|
|
386
386
|
if (cached) return cached;
|
|
387
|
-
const commit = readInjected(true ? "
|
|
388
|
-
const commitShort = readInjected(true ? "
|
|
389
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
390
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
387
|
+
const commit = readInjected(true ? "d14dd8f4fe899ec4ff249b089869a2c330699ab2" : void 0) ?? "unknown";
|
|
388
|
+
const commitShort = readInjected(true ? "d14dd8f4" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
389
|
+
const version = readInjected(true ? "0.9.82-rc.426" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
390
|
+
const builtAt = readInjected(true ? "2026-06-29T15:33:39.213Z" : void 0);
|
|
391
391
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
392
392
|
return cached;
|
|
393
393
|
}
|
|
@@ -16828,6 +16828,21 @@ function findLiveCoordinators(components) {
|
|
|
16828
16828
|
const status = readNonEmptyString2(state.status).toLowerCase();
|
|
16829
16829
|
const modalParked = typeof inst.isModalParked === "function" ? inst.isModalParked() === true : status === "waiting_choice" || status === "waiting_approval";
|
|
16830
16830
|
const sessionId = readNonEmptyString2(state.instanceId);
|
|
16831
|
+
if (getLogLevel() === "debug") {
|
|
16832
|
+
let adapterRaw = "?";
|
|
16833
|
+
try {
|
|
16834
|
+
const a = inst.adapter;
|
|
16835
|
+
if (a && typeof a.getStatus === "function") {
|
|
16836
|
+
adapterRaw = readNonEmptyString2(a.getStatus({ allowParse: false })?.status) || "?";
|
|
16837
|
+
}
|
|
16838
|
+
} catch (e) {
|
|
16839
|
+
adapterRaw = `err:${e?.message || e}`;
|
|
16840
|
+
}
|
|
16841
|
+
const lastStatus = readNonEmptyString2(inst.lastStatus) || "?";
|
|
16842
|
+
const autoApproveBusy = inst.autoApproveBusy;
|
|
16843
|
+
const maskSince = inst.autoApproveMaskSince;
|
|
16844
|
+
LOG.debug("MeshReconcile", `coordDiag sess=${sessionId || "?"} mesh=${meshId} getState=${status || "?"} lastStatus=${lastStatus} adapterRaw=${adapterRaw} autoApproveBusy=${autoApproveBusy === true} maskSince=${maskSince || 0}`);
|
|
16845
|
+
}
|
|
16831
16846
|
const stateKey = `${meshId}::${sessionId || "?"}`;
|
|
16832
16847
|
const prevParked = coordinatorModalParkState.get(stateKey);
|
|
16833
16848
|
if (prevParked !== modalParked) {
|
|
@@ -17117,6 +17132,9 @@ async function runMeshReconcileTick(components) {
|
|
|
17117
17132
|
}
|
|
17118
17133
|
}
|
|
17119
17134
|
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${orphanEscaped > 0 ? `; ${orphanEscaped} orphan-targeted event(s) routed to strict-route TTL` : ""})`);
|
|
17135
|
+
if (getLogLevel() === "debug") {
|
|
17136
|
+
LOG.debug("MeshReconcile", `coordHoldModalParked mesh=${meshId} heldFor=[${modalParkedCoordinators.map((c) => c.sessionId || "?").join(",")}] (these were classified modal-parked; cross-ref same-tick coordDiag by sessionId)`);
|
|
17137
|
+
}
|
|
17120
17138
|
let hasPending = true;
|
|
17121
17139
|
if (store) {
|
|
17122
17140
|
try {
|
|
@@ -17142,6 +17160,9 @@ async function runMeshReconcileTick(components) {
|
|
|
17142
17160
|
}
|
|
17143
17161
|
if (hasPending) {
|
|
17144
17162
|
LOG.info("MeshReconcile", `Reconcile skip \u2192 generating: holding pending event(s) for mesh ${meshId} (${generatingCoordinators.length} coordinator(s) busy; events left queued for the next idle tick)`);
|
|
17163
|
+
if (getLogLevel() === "debug") {
|
|
17164
|
+
LOG.debug("MeshReconcile", `coordHoldGenerating mesh=${meshId} heldFor=[${generatingCoordinators.map((c) => c.sessionId || "?").join(",")}] (these were classified busy; cross-ref same-tick coordDiag by sessionId)`);
|
|
17165
|
+
}
|
|
17145
17166
|
recordHeldTerminalEventsToLedger(
|
|
17146
17167
|
meshId,
|
|
17147
17168
|
drainDaemonIds.length > 0 ? drainDaemonIds : localDaemonId ? [localDaemonId] : [],
|
|
@@ -48946,6 +48967,56 @@ var meshCrudHandlers = {
|
|
|
48946
48967
|
return { success: false, error: e.message };
|
|
48947
48968
|
}
|
|
48948
48969
|
},
|
|
48970
|
+
// ─── MAGI panels (machine-local config, sibling to meshes) ───────────────
|
|
48971
|
+
// Panels live in ~/.adhdev/meshes.json `magiPanels` and are pure local config
|
|
48972
|
+
// (no mesh ownership). These three handlers mirror list_meshes/create_mesh/
|
|
48973
|
+
// update_mesh: dynamic-import the already-exported mesh-config accessors and
|
|
48974
|
+
// surface normalizeMagiPanel's structured error codes (invalid_magi_panel,
|
|
48975
|
+
// magi_panel_exists) verbatim so the dashboard can render them.
|
|
48976
|
+
//
|
|
48977
|
+
// Permission: magi_panel_set / magi_panel_remove are WRITE commands. They are
|
|
48978
|
+
// intentionally NOT listed in canPeerUsePrivilegedShareCommand (daemon-cloud
|
|
48979
|
+
// data-channel-router), so a peer holding ANY share permission hits its
|
|
48980
|
+
// `default → false` branch — identical owner-only gating to create_mesh /
|
|
48981
|
+
// update_mesh / list_meshes (none of which are listed there either). A trusted
|
|
48982
|
+
// peer (no permission = the owner) passes the top `!permission → true` guard.
|
|
48983
|
+
// Mirror, don't invent: do not add a new policy tier here.
|
|
48984
|
+
//
|
|
48985
|
+
// Resolvability (coupling / stale / available) is deliberately NOT computed
|
|
48986
|
+
// here: buildMagiFanoutPlan lives in mcp-server, unreachable from daemon-core.
|
|
48987
|
+
// magi_panel_list returns the raw definitions only; the dashboard derives
|
|
48988
|
+
// member resolvability client-side (web-core MagiPanelManager, reusing the
|
|
48989
|
+
// MagiGroupRow coupling logic) against live mesh_status.
|
|
48990
|
+
magi_panel_list: async (_ctx, _args) => {
|
|
48991
|
+
try {
|
|
48992
|
+
const { listMagiPanels: listMagiPanels2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
48993
|
+
return { success: true, panels: listMagiPanels2() };
|
|
48994
|
+
} catch (e) {
|
|
48995
|
+
return { success: false, error: e.message };
|
|
48996
|
+
}
|
|
48997
|
+
},
|
|
48998
|
+
magi_panel_set: async (_ctx, args) => {
|
|
48999
|
+
const name = typeof args?.name === "string" ? args.name.trim() : "";
|
|
49000
|
+
if (!name) return { success: false, error: "invalid_magi_panel: panel name is required" };
|
|
49001
|
+
try {
|
|
49002
|
+
const { upsertMagiPanel: upsertMagiPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
49003
|
+
const panel = upsertMagiPanel2(name, args?.panel, { overwrite: args?.overwrite === true });
|
|
49004
|
+
return { success: true, name, panel };
|
|
49005
|
+
} catch (e) {
|
|
49006
|
+
return { success: false, error: e.message };
|
|
49007
|
+
}
|
|
49008
|
+
},
|
|
49009
|
+
magi_panel_remove: async (_ctx, args) => {
|
|
49010
|
+
const name = typeof args?.name === "string" ? args.name.trim() : "";
|
|
49011
|
+
if (!name) return { success: false, error: "invalid_magi_panel: panel name is required" };
|
|
49012
|
+
try {
|
|
49013
|
+
const { removeMagiPanel: removeMagiPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
49014
|
+
const removed = removeMagiPanel2(name);
|
|
49015
|
+
return { success: true, removed };
|
|
49016
|
+
} catch (e) {
|
|
49017
|
+
return { success: false, error: e.message };
|
|
49018
|
+
}
|
|
49019
|
+
},
|
|
48949
49020
|
add_mesh_node: async (ctx, args) => {
|
|
48950
49021
|
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
48951
49022
|
const workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
|