@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.js
CHANGED
|
@@ -389,10 +389,10 @@ function readInjected(value) {
|
|
|
389
389
|
}
|
|
390
390
|
function getDaemonBuildInfo() {
|
|
391
391
|
if (cached) return cached;
|
|
392
|
-
const commit = readInjected(true ? "
|
|
393
|
-
const commitShort = readInjected(true ? "
|
|
394
|
-
const version = readInjected(true ? "0.9.82-rc.
|
|
395
|
-
const builtAt = readInjected(true ? "2026-06-
|
|
392
|
+
const commit = readInjected(true ? "d14dd8f4fe899ec4ff249b089869a2c330699ab2" : void 0) ?? "unknown";
|
|
393
|
+
const commitShort = readInjected(true ? "d14dd8f4" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
|
|
394
|
+
const version = readInjected(true ? "0.9.82-rc.426" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
|
|
395
|
+
const builtAt = readInjected(true ? "2026-06-29T15:33:39.213Z" : void 0);
|
|
396
396
|
cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
|
|
397
397
|
return cached;
|
|
398
398
|
}
|
|
@@ -16833,6 +16833,21 @@ function findLiveCoordinators(components) {
|
|
|
16833
16833
|
const status = readNonEmptyString2(state.status).toLowerCase();
|
|
16834
16834
|
const modalParked = typeof inst.isModalParked === "function" ? inst.isModalParked() === true : status === "waiting_choice" || status === "waiting_approval";
|
|
16835
16835
|
const sessionId = readNonEmptyString2(state.instanceId);
|
|
16836
|
+
if (getLogLevel() === "debug") {
|
|
16837
|
+
let adapterRaw = "?";
|
|
16838
|
+
try {
|
|
16839
|
+
const a = inst.adapter;
|
|
16840
|
+
if (a && typeof a.getStatus === "function") {
|
|
16841
|
+
adapterRaw = readNonEmptyString2(a.getStatus({ allowParse: false })?.status) || "?";
|
|
16842
|
+
}
|
|
16843
|
+
} catch (e) {
|
|
16844
|
+
adapterRaw = `err:${e?.message || e}`;
|
|
16845
|
+
}
|
|
16846
|
+
const lastStatus = readNonEmptyString2(inst.lastStatus) || "?";
|
|
16847
|
+
const autoApproveBusy = inst.autoApproveBusy;
|
|
16848
|
+
const maskSince = inst.autoApproveMaskSince;
|
|
16849
|
+
LOG.debug("MeshReconcile", `coordDiag sess=${sessionId || "?"} mesh=${meshId} getState=${status || "?"} lastStatus=${lastStatus} adapterRaw=${adapterRaw} autoApproveBusy=${autoApproveBusy === true} maskSince=${maskSince || 0}`);
|
|
16850
|
+
}
|
|
16836
16851
|
const stateKey = `${meshId}::${sessionId || "?"}`;
|
|
16837
16852
|
const prevParked = coordinatorModalParkState.get(stateKey);
|
|
16838
16853
|
if (prevParked !== modalParked) {
|
|
@@ -17122,6 +17137,9 @@ async function runMeshReconcileTick(components) {
|
|
|
17122
17137
|
}
|
|
17123
17138
|
}
|
|
17124
17139
|
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` : ""})`);
|
|
17140
|
+
if (getLogLevel() === "debug") {
|
|
17141
|
+
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)`);
|
|
17142
|
+
}
|
|
17125
17143
|
let hasPending = true;
|
|
17126
17144
|
if (store) {
|
|
17127
17145
|
try {
|
|
@@ -17147,6 +17165,9 @@ async function runMeshReconcileTick(components) {
|
|
|
17147
17165
|
}
|
|
17148
17166
|
if (hasPending) {
|
|
17149
17167
|
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)`);
|
|
17168
|
+
if (getLogLevel() === "debug") {
|
|
17169
|
+
LOG.debug("MeshReconcile", `coordHoldGenerating mesh=${meshId} heldFor=[${generatingCoordinators.map((c) => c.sessionId || "?").join(",")}] (these were classified busy; cross-ref same-tick coordDiag by sessionId)`);
|
|
17170
|
+
}
|
|
17150
17171
|
recordHeldTerminalEventsToLedger(
|
|
17151
17172
|
meshId,
|
|
17152
17173
|
drainDaemonIds.length > 0 ? drainDaemonIds : localDaemonId ? [localDaemonId] : [],
|
|
@@ -49337,6 +49358,56 @@ var meshCrudHandlers = {
|
|
|
49337
49358
|
return { success: false, error: e.message };
|
|
49338
49359
|
}
|
|
49339
49360
|
},
|
|
49361
|
+
// ─── MAGI panels (machine-local config, sibling to meshes) ───────────────
|
|
49362
|
+
// Panels live in ~/.adhdev/meshes.json `magiPanels` and are pure local config
|
|
49363
|
+
// (no mesh ownership). These three handlers mirror list_meshes/create_mesh/
|
|
49364
|
+
// update_mesh: dynamic-import the already-exported mesh-config accessors and
|
|
49365
|
+
// surface normalizeMagiPanel's structured error codes (invalid_magi_panel,
|
|
49366
|
+
// magi_panel_exists) verbatim so the dashboard can render them.
|
|
49367
|
+
//
|
|
49368
|
+
// Permission: magi_panel_set / magi_panel_remove are WRITE commands. They are
|
|
49369
|
+
// intentionally NOT listed in canPeerUsePrivilegedShareCommand (daemon-cloud
|
|
49370
|
+
// data-channel-router), so a peer holding ANY share permission hits its
|
|
49371
|
+
// `default → false` branch — identical owner-only gating to create_mesh /
|
|
49372
|
+
// update_mesh / list_meshes (none of which are listed there either). A trusted
|
|
49373
|
+
// peer (no permission = the owner) passes the top `!permission → true` guard.
|
|
49374
|
+
// Mirror, don't invent: do not add a new policy tier here.
|
|
49375
|
+
//
|
|
49376
|
+
// Resolvability (coupling / stale / available) is deliberately NOT computed
|
|
49377
|
+
// here: buildMagiFanoutPlan lives in mcp-server, unreachable from daemon-core.
|
|
49378
|
+
// magi_panel_list returns the raw definitions only; the dashboard derives
|
|
49379
|
+
// member resolvability client-side (web-core MagiPanelManager, reusing the
|
|
49380
|
+
// MagiGroupRow coupling logic) against live mesh_status.
|
|
49381
|
+
magi_panel_list: async (_ctx, _args) => {
|
|
49382
|
+
try {
|
|
49383
|
+
const { listMagiPanels: listMagiPanels2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
49384
|
+
return { success: true, panels: listMagiPanels2() };
|
|
49385
|
+
} catch (e) {
|
|
49386
|
+
return { success: false, error: e.message };
|
|
49387
|
+
}
|
|
49388
|
+
},
|
|
49389
|
+
magi_panel_set: async (_ctx, args) => {
|
|
49390
|
+
const name = typeof args?.name === "string" ? args.name.trim() : "";
|
|
49391
|
+
if (!name) return { success: false, error: "invalid_magi_panel: panel name is required" };
|
|
49392
|
+
try {
|
|
49393
|
+
const { upsertMagiPanel: upsertMagiPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
49394
|
+
const panel = upsertMagiPanel2(name, args?.panel, { overwrite: args?.overwrite === true });
|
|
49395
|
+
return { success: true, name, panel };
|
|
49396
|
+
} catch (e) {
|
|
49397
|
+
return { success: false, error: e.message };
|
|
49398
|
+
}
|
|
49399
|
+
},
|
|
49400
|
+
magi_panel_remove: async (_ctx, args) => {
|
|
49401
|
+
const name = typeof args?.name === "string" ? args.name.trim() : "";
|
|
49402
|
+
if (!name) return { success: false, error: "invalid_magi_panel: panel name is required" };
|
|
49403
|
+
try {
|
|
49404
|
+
const { removeMagiPanel: removeMagiPanel2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
|
|
49405
|
+
const removed = removeMagiPanel2(name);
|
|
49406
|
+
return { success: true, removed };
|
|
49407
|
+
} catch (e) {
|
|
49408
|
+
return { success: false, error: e.message };
|
|
49409
|
+
}
|
|
49410
|
+
},
|
|
49340
49411
|
add_mesh_node: async (ctx, args) => {
|
|
49341
49412
|
const meshId = typeof args?.meshId === "string" ? args.meshId.trim() : "";
|
|
49342
49413
|
const workspace = typeof args?.workspace === "string" ? args.workspace.trim() : "";
|