@adhdev/daemon-core 0.9.82-rc.505 → 0.9.82-rc.507

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
@@ -412,10 +412,10 @@ function readInjected(value) {
412
412
  }
413
413
  function getDaemonBuildInfo() {
414
414
  if (cached) return cached;
415
- const commit = readInjected(true ? "af1ce39e8e67cf5aef6eb49e344ca4e5d0b7e88f" : void 0) ?? "unknown";
416
- const commitShort = readInjected(true ? "af1ce39e" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
417
- const version = readInjected(true ? "0.9.82-rc.505" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
418
- const builtAt = readInjected(true ? "2026-07-12T13:30:23.635Z" : void 0);
415
+ const commit = readInjected(true ? "c79248529d56e594be601fcea3db3f9be709d4c9" : void 0) ?? "unknown";
416
+ const commitShort = readInjected(true ? "c7924852" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
417
+ const version = readInjected(true ? "0.9.82-rc.507" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
418
+ const builtAt = readInjected(true ? "2026-07-12T16:37:57.223Z" : void 0);
419
419
  cached = builtAt ? { commit, commitShort, version, builtAt } : { commit, commitShort, version };
420
420
  return cached;
421
421
  }
@@ -3558,7 +3558,8 @@ var init_mesh_config = __esm({
3558
3558
  // src/mesh/coordinator-prompt.ts
3559
3559
  var coordinator_prompt_exports = {};
3560
3560
  __export(coordinator_prompt_exports, {
3561
- buildCoordinatorSystemPrompt: () => buildCoordinatorSystemPrompt
3561
+ buildCoordinatorSystemPrompt: () => buildCoordinatorSystemPrompt,
3562
+ buildMagiKindPanelsSection: () => buildMagiKindPanelsSection
3562
3563
  });
3563
3564
  import * as fs2 from "fs";
3564
3565
  import * as os2 from "os";
@@ -3647,6 +3648,8 @@ Default branch: \`${mesh.defaultBranch}\`` : ""}`);
3647
3648
  }
3648
3649
  sections.push(buildPolicySection(mergeAndNormalizePolicy(void 0, mesh.policy)));
3649
3650
  sections.push(buildBrainPresetsSection());
3651
+ const magiSection = buildMagiKindPanelsSection(ctx.magiKindPanels);
3652
+ if (magiSection) sections.push(magiSection);
3650
3653
  sections.push(TOOLS_SECTION);
3651
3654
  sections.push(TOOL_EXPOSURE_PREFLIGHT_SECTION);
3652
3655
  sections.push(WORKFLOW_SECTION);
@@ -3863,6 +3866,36 @@ function buildBrainPresetsSection() {
3863
3866
  }
3864
3867
  return lines.join("\n");
3865
3868
  }
3869
+ function buildMagiKindPanelsSection(panels) {
3870
+ if (!panels) return null;
3871
+ const configured = Object.entries(panels).filter(([, slots]) => Array.isArray(slots) && slots.length > 0);
3872
+ if (configured.length === 0) return null;
3873
+ const lines = [
3874
+ "## Configured MAGI panels",
3875
+ "",
3876
+ "These machine-local MAGI kind-panels are configured on this mesh \u2014 read-only cross-verification quorums:",
3877
+ ""
3878
+ ];
3879
+ for (const [kind, slots] of configured) {
3880
+ const replicaCount = slots.reduce((sum, s2) => sum + (s2.n && s2.n > 0 ? s2.n : 1), 0);
3881
+ const label = replicaCount === slots.length ? `${slots.length} ${slots.length === 1 ? "slot" : "slots"}` : `${replicaCount} replicas`;
3882
+ const rendered = slots.map(renderMagiSlot).join(", ");
3883
+ lines.push(`- **${kind}** (${label}): ${rendered}`);
3884
+ }
3885
+ lines.push("");
3886
+ lines.push("Use these via `mesh_magi_review` (the `task_kind` is REQUIRED \u2014 it selects BOTH the output schema and the panel). The live authoritative slot list is `mesh_magi_kind_panel_list`. MAGI worker replicas are read-only and typically do NOT have mesh MCP tools exposed, so for live timing / tool-behavior claims you MUST gather the primary evidence yourself and use MAGI only for independent source-level corroboration.");
3887
+ return lines.join("\n");
3888
+ }
3889
+ function renderMagiSlot(slot) {
3890
+ let s2 = slot.provider;
3891
+ if (slot.nodeId) s2 += `@${slot.nodeId}`;
3892
+ const extra = [];
3893
+ if (slot.model) extra.push(`model: ${slot.model}`);
3894
+ if (slot.capabilityTags && slot.capabilityTags.length) extra.push(`tags: ${slot.capabilityTags.join("+")}`);
3895
+ if (slot.n && slot.n > 1) extra.push(`\xD7${slot.n}`);
3896
+ if (extra.length) s2 += ` (${extra.join(", ")})`;
3897
+ return s2;
3898
+ }
3866
3899
  function buildPolicySection(policy) {
3867
3900
  const rules = [];
3868
3901
  if (policy.requirePreTaskCheckpoint) rules.push("- Create a git checkpoint **before** starting each task");
@@ -16543,7 +16576,7 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
16543
16576
  markAutoLaunch(meshId, task.id, { status: "started", nodeId, providerType: resolved.providerType });
16544
16577
  let launchResult2;
16545
16578
  try {
16546
- launchResult2 = await components.dispatchMeshCommand(launchTarget.daemonId, "launch_cli", {
16579
+ launchResult2 = await components.dispatchMeshCommand(launchTarget.daemonId, "launch_cli", withStatusProbeMarker({
16547
16580
  cliType: resolved.providerType,
16548
16581
  dir: node.workspace,
16549
16582
  settings: remoteSettings,
@@ -16553,7 +16586,7 @@ async function maybeAutoLaunchOneQueueSession(components, meshId, mesh) {
16553
16586
  ...effectiveModel ? { initialModel: effectiveModel } : {},
16554
16587
  // BRAIN-ROUTING thinking axis: forward the effective thinking level (initialThinkingLevel).
16555
16588
  ...effectiveThinkingLevel ? { initialThinkingLevel: effectiveThinkingLevel } : {}
16556
- });
16589
+ }));
16557
16590
  } catch (e) {
16558
16591
  markAutoLaunch(meshId, task.id, { status: "failed", reason: `remote_launch_dispatch_failed: ${e?.message || String(e)}`, nodeId, providerType: resolved.providerType });
16559
16592
  autoLaunchCooldownUntil.set(launchKey, Date.now() + AUTO_LAUNCH_COOLDOWN_MS);
@@ -19837,7 +19870,7 @@ function stopStaleMeshWorker(components, args) {
19837
19870
  }
19838
19871
  }
19839
19872
  if (daemonId && components.dispatchMeshCommand) {
19840
- Promise.resolve(components.dispatchMeshCommand(daemonId, "stop_cli", stopArgs)).catch((e) => LOG.warn("MeshQueue", `Remote stop of stale worker ${sessionId} on daemon ${daemonId} failed: ${e?.message || e}`));
19873
+ Promise.resolve(components.dispatchMeshCommand(daemonId, "stop_cli", withStatusProbeMarker(stopArgs))).catch((e) => LOG.warn("MeshQueue", `Remote stop of stale worker ${sessionId} on daemon ${daemonId} failed: ${e?.message || e}`));
19841
19874
  } else {
19842
19875
  LOG.warn("MeshQueue", `Cannot stop stale worker ${sessionId}: no local adapter and no resolvable remote daemon id (node ${args.nodeId ?? "?"}). Ack already rejected \u2014 task will re-strand-and-fail if the worker completes.`);
19843
19876
  }
@@ -22080,7 +22113,7 @@ async function retryUnresolvedDelegateForwards(components) {
22080
22113
  let result;
22081
22114
  try {
22082
22115
  traceMeshEventStage("forward_send", entryTraceCtx, `retry \u2192 ${entry.coordinatorDaemonId}`);
22083
- result = await dispatchMeshCommand(entry.coordinatorDaemonId, "mesh_forward_event", pushPayload);
22116
+ result = await dispatchMeshCommand(entry.coordinatorDaemonId, "mesh_forward_event", withStatusProbeMarker(pushPayload));
22084
22117
  } catch (e) {
22085
22118
  LOG.warn("MeshReconcile", `Retry forward to coordinator ${entry.coordinatorDaemonId} failed: ${e?.message || e} \u2014 left queued`);
22086
22119
  traceMeshEventDrop("retry_forward_failed", entryTraceCtx, e?.message || String(e));
@@ -56988,6 +57021,14 @@ var meshCoordinatorLaunchHandlers = {
56988
57021
  return void 0;
56989
57022
  }
56990
57023
  };
57024
+ const loadMagiKindPanelsBestEffort = async () => {
57025
+ try {
57026
+ const { listMagiKindPanels: listMagiKindPanels2 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
57027
+ return listMagiKindPanels2();
57028
+ } catch {
57029
+ return void 0;
57030
+ }
57031
+ };
56991
57032
  let mesh;
56992
57033
  if (args?.inlineMesh && typeof args.inlineMesh === "object") {
56993
57034
  mesh = args.inlineMesh;
@@ -57085,7 +57126,7 @@ var meshCoordinatorLaunchHandlers = {
57085
57126
  if (coordinatorSetup.kind === "cli_command") {
57086
57127
  let cliCmdSystemPrompt = "";
57087
57128
  try {
57088
- cliCmdSystemPrompt = buildCoordinatorSystemPrompt2({ mesh: effectiveMesh, coordinatorCliType: cliType, userInstruction: extraSystemPrompt || void 0, missionSection: buildMissionSectionBestEffort(mesh.id), recentActivity: await buildRecentActivityBestEffort(mesh.id), operatingNotes: await buildEffectiveOperatingNotes(mesh.id) });
57129
+ cliCmdSystemPrompt = buildCoordinatorSystemPrompt2({ mesh: effectiveMesh, coordinatorCliType: cliType, userInstruction: extraSystemPrompt || void 0, missionSection: buildMissionSectionBestEffort(mesh.id), recentActivity: await buildRecentActivityBestEffort(mesh.id), operatingNotes: await buildEffectiveOperatingNotes(mesh.id), magiKindPanels: await loadMagiKindPanelsBestEffort() });
57089
57130
  } catch (error) {
57090
57131
  const message = error?.message || String(error);
57091
57132
  LOG.error("MeshCoordinator", `Failed to build coordinator prompt: ${message}`);
@@ -57264,7 +57305,7 @@ ${ptyResult.output.slice(-2e3)}`);
57264
57305
  }
57265
57306
  let systemPrompt = "";
57266
57307
  try {
57267
- systemPrompt = buildCoordinatorSystemPrompt2({ mesh: effectiveMesh, coordinatorCliType: cliType, userInstruction: extraSystemPrompt || void 0, missionSection: buildMissionSectionBestEffort(mesh.id), recentActivity: await buildRecentActivityBestEffort(mesh.id), operatingNotes: await buildEffectiveOperatingNotes(mesh.id) });
57308
+ systemPrompt = buildCoordinatorSystemPrompt2({ mesh: effectiveMesh, coordinatorCliType: cliType, userInstruction: extraSystemPrompt || void 0, missionSection: buildMissionSectionBestEffort(mesh.id), recentActivity: await buildRecentActivityBestEffort(mesh.id), operatingNotes: await buildEffectiveOperatingNotes(mesh.id), magiKindPanels: await loadMagiKindPanelsBestEffort() });
57268
57309
  } catch (error) {
57269
57310
  const message = error?.message || String(error);
57270
57311
  LOG.error("MeshCoordinator", `Failed to build coordinator prompt: ${message}`);