@adhdev/daemon-standalone 1.0.48 → 1.0.49-rc.2

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
@@ -37056,10 +37056,10 @@ var require_dist3 = __commonJS({
37056
37056
  }
37057
37057
  function getDaemonBuildInfo() {
37058
37058
  if (cached2) return cached2;
37059
- const commit = readInjected(true ? "c19180c49771cb79932c9bf67d368436d94dbc34" : void 0) ?? "unknown";
37060
- const commitShort = readInjected(true ? "c19180c4" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37061
- const version2 = readInjected(true ? "1.0.48" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37062
- const builtAt = readInjected(true ? "2026-08-14T01:59:31.058Z" : void 0);
37059
+ const commit = readInjected(true ? "48ce5d9b7420dbc3520cd6c7ddee34af47c23627" : void 0) ?? "unknown";
37060
+ const commitShort = readInjected(true ? "48ce5d9b" : void 0) ?? (commit !== "unknown" ? commit.slice(0, 7) : "unknown");
37061
+ const version2 = readInjected(true ? "1.0.49-rc.2" : void 0) ?? readInjected(typeof process !== "undefined" ? process.env?.ADHDEV_PKG_VERSION : void 0) ?? "unknown";
37062
+ const builtAt = readInjected(true ? "2026-08-14T06:05:14.635Z" : void 0);
37063
37063
  cached2 = builtAt ? { commit, commitShort, version: version2, builtAt } : { commit, commitShort, version: version2 };
37064
37064
  return cached2;
37065
37065
  }
@@ -38307,7 +38307,7 @@ var require_dist3 = __commonJS({
38307
38307
  }
38308
38308
  });
38309
38309
  function resolveBuildTrack(env2 = process.env) {
38310
- const injected = true ? "stable" : void 0;
38310
+ const injected = true ? "preview" : void 0;
38311
38311
  const stamped = typeof injected === "string" ? injected.trim() : "";
38312
38312
  const raw = (stamped || (env2[BUILD_CHANNEL_ENV_VAR] ?? "").trim()).toLowerCase();
38313
38313
  return raw === "preview" || raw === "next" ? "preview" : "stable";
@@ -42990,7 +42990,9 @@ ${error48.message || ""}`;
42990
42990
  "mesh_magi_kind_panel_list",
42991
42991
  "mesh_node_slots_set",
42992
42992
  "mesh_node_slots_list",
42993
- "mesh_node_slots_propose"
42993
+ "mesh_node_slots_propose",
42994
+ "mesh_coordinator_prompt_append_get",
42995
+ "mesh_coordinator_prompt_append_set"
42994
42996
  ];
42995
42997
  CANONICAL_MESH_TOOL_COUNT = CANONICAL_MESH_TOOL_NAMES.length;
42996
42998
  STATUS_PROBE_ARG_KEY = "_statusProbe";
@@ -52711,7 +52713,9 @@ When you compose the task message you dispatch to a node, include this requireme
52711
52713
  | \`mesh_magi_kind_panel_list\` | List configured task_kind \u2192 MAGI kind-panel slot bindings (machine-local, read-only) |
52712
52714
  | \`mesh_node_slots_list\` | List a node's capability slots (its AI-tool profile: provider/model/thinking + difficulty range + capability tags), read-only |
52713
52715
  | \`mesh_node_slots_set\` | PROPOSE (dry-run) or APPLY a node's capability slots \u2014 how you autonomously retune a node's tool profile; WHOLESALE replacement, present current-vs-proposed and get user approval before write=true |
52714
- | \`mesh_node_slots_propose\` | AUTO-DETECT a node's installed CLI agents and DRAFT a slot profile from them (read-only, never writes) \u2014 use when a node has no slots yet or new CLIs were installed; reports droppedSlots (what a wholesale write would destroy), then apply via mesh_node_slots_set write=true after approval |`;
52716
+ | \`mesh_node_slots_propose\` | AUTO-DETECT a node's installed CLI agents and DRAFT a slot profile from them (read-only, never writes) \u2014 use when a node has no slots yet or new CLIs were installed; reports droppedSlots (what a wholesale write would destroy), then apply via mesh_node_slots_set write=true after approval |
52717
+ | \`mesh_coordinator_prompt_append_get\` | Read this daemon's user-level coordinator prompt APPEND text for a CLI type (per-machine file, applies to every mesh this daemon coordinates) |
52718
+ | \`mesh_coordinator_prompt_append_set\` | Write or clear this daemon's user-level coordinator prompt APPEND text for a CLI type \u2014 APPEND ONLY, always stacks after the base prompt; there is no tool to replace the base prompt itself |`;
52715
52719
  TOOL_EXPOSURE_PREFLIGHT_SECTION = `## Tool Exposure Preflight
52716
52720
 
52717
52721
  Before doing any coordinator work, confirm that the actual callable tool list includes \`mesh_status\` and the other \`mesh_*\` tools from the table above. If this Repo Mesh coordinator prompt is present but the callable \`mesh_*\` tools are missing, the MCP server/tool manifest is stale or not injected yet. Do not substitute terminal/file/git tools, do not inspect or edit the repository directly, and do not continue as a non-mesh local coding agent. Stop immediately and tell the user to run \`/reload-mcp\` or start a fresh coordinator session so ADHDev can reconnect \`adhdev-mesh\`.`;
@@ -64955,6 +64959,68 @@ ${cleanBody}`;
64955
64959
  recentReadDebugSignatureBySession = /* @__PURE__ */ new Map();
64956
64960
  }
64957
64961
  });
64962
+ function readNonEmptyString3(value) {
64963
+ return typeof value === "string" && value.trim() ? value.trim() : "";
64964
+ }
64965
+ function resolveLocalDaemonIds(components) {
64966
+ const statusInstanceId = readNonEmptyString3(components.statusInstanceId);
64967
+ const machineId = readNonEmptyString3(loadConfig2().machineId);
64968
+ return expandDaemonIdForms([statusInstanceId, machineId]);
64969
+ }
64970
+ function scheduleTaskCompletionSideEffectEvidence(components, args) {
64971
+ if (args.taskMode !== "code_change") return;
64972
+ if (!args.taskId) return;
64973
+ const nodeId = args.nodeId;
64974
+ if (!nodeId) return;
64975
+ setImmediate(() => {
64976
+ (async () => {
64977
+ try {
64978
+ const mesh = getMesh(args.meshId);
64979
+ const node = mesh?.nodes.find((n) => meshNodeIdMatches(n, nodeId));
64980
+ const workspace = readNonEmptyString3(node?.workspace);
64981
+ if (!workspace) return;
64982
+ const nodeDaemonId = node ? readMeshNodeDaemonId(node) : void 0;
64983
+ if (nodeDaemonId) {
64984
+ const localDaemonIds = resolveLocalDaemonIds(components);
64985
+ const isLocal = localDaemonIds.some((id) => daemonIdsEquivalent(id, nodeDaemonId));
64986
+ if (!isLocal) return;
64987
+ }
64988
+ const status = await getGitRepoStatus(workspace, { includeSubmodules: false });
64989
+ if (!status.isGitRepo) return;
64990
+ if (status.dirty) return;
64991
+ appendLedgerEntry(args.meshId, {
64992
+ kind: "task_completion_no_side_effects",
64993
+ nodeId,
64994
+ sessionId: args.sessionId,
64995
+ taskId: args.taskId,
64996
+ payload: {
64997
+ taskId: args.taskId,
64998
+ sessionId: args.sessionId,
64999
+ nodeId,
65000
+ workspace,
65001
+ gitDirty: false,
65002
+ changedFiles: 0,
65003
+ reason: "no_side_effects"
65004
+ }
65005
+ });
65006
+ } catch (e) {
65007
+ LOG2.warn("MeshLedger", `Skipped completion side-effect evidence check for task ${args.taskId}: ${e?.message || e}`);
65008
+ }
65009
+ })();
65010
+ });
65011
+ }
65012
+ var init_mesh_completion_side_effect_evidence = __esm2({
65013
+ "src/mesh/mesh-completion-side-effect-evidence.ts"() {
65014
+ "use strict";
65015
+ init_config();
65016
+ init_mesh_config();
65017
+ init_git_status();
65018
+ init_logger();
65019
+ init_dist();
65020
+ init_mesh_ledger();
65021
+ init_mesh_node_identity();
65022
+ }
65023
+ });
64958
65024
  function readLiveTurnPendingEvidence(instance) {
64959
65025
  const candidate = instance;
64960
65026
  try {
@@ -65968,7 +66034,7 @@ ${cleanBody}`;
65968
66034
  }
65969
66035
  }
65970
66036
  setImmediate(() => cleanupTerminalDirectDispatches());
65971
- return task ? { id: task.id } : null;
66037
+ return task ? { id: task.id, taskMode: task.taskMode } : null;
65972
66038
  }
65973
66039
  let completedTaskForLedger = null;
65974
66040
  let directDispatchTaskIdForLedger;
@@ -66273,6 +66339,15 @@ ${cleanBody}`;
66273
66339
  ...completionEvidence ? completionEvidence.workerResult.source === "default" ? { evidenceLevel: "insufficient", reviewRecommended: true } : { evidenceLevel: "sufficient" } : {}
66274
66340
  }
66275
66341
  });
66342
+ if (ledgerKind === "task_completed") {
66343
+ scheduleTaskCompletionSideEffectEvidence(components, {
66344
+ meshId: args.meshId,
66345
+ taskId: completedTaskForLedger?.id || directDispatchTaskIdForLedger || void 0,
66346
+ taskMode: completedTaskForLedger?.taskMode,
66347
+ sessionId: ledgerSessionId,
66348
+ nodeId: ledgerNodeId
66349
+ });
66350
+ }
66276
66351
  } catch (e) {
66277
66352
  LOG2.warn("MeshLedger", `Failed to record ${ledgerKind}: ${e?.message || e}`);
66278
66353
  }
@@ -66769,6 +66844,7 @@ ${cleanBody}`;
66769
66844
  init_mesh_json_config();
66770
66845
  init_mesh_quota_routing();
66771
66846
  init_mesh_node_slots();
66847
+ init_mesh_completion_side_effect_evidence();
66772
66848
  init_dist();
66773
66849
  init_mesh_events_stale();
66774
66850
  init_mesh_task_inflight();
@@ -98019,7 +98095,7 @@ ${buttons.join("\n")}`;
98019
98095
  timestamp: Date.now(),
98020
98096
  taskId,
98021
98097
  finalSummary,
98022
- evidenceLevel: "transcript",
98098
+ evidenceLevel: "reported",
98023
98099
  completionDiagnostic: { source: "pre_cleanup_transcript_completion" }
98024
98100
  });
98025
98101
  return true;
@@ -98068,7 +98144,7 @@ ${buttons.join("\n")}`;
98068
98144
  timestamp: Date.now(),
98069
98145
  taskId,
98070
98146
  finalSummary,
98071
- evidenceLevel: "transcript",
98147
+ evidenceLevel: "reported",
98072
98148
  completionDiagnostic: { source: diagnosticSource }
98073
98149
  });
98074
98150
  return true;
@@ -100734,7 +100810,7 @@ ${buttons.join("\n")}`;
100734
100810
  timestamp: pending.timestamp,
100735
100811
  taskId: pending.taskId,
100736
100812
  finalSummary,
100737
- evidenceLevel: "transcript",
100813
+ evidenceLevel: "reported",
100738
100814
  completionDiagnostic: {
100739
100815
  source: "clean_final_assistant",
100740
100816
  cleanPath: true,
@@ -100873,7 +100949,7 @@ ${buttons.join("\n")}`;
100873
100949
  * • prior emit was WEAK → re-arm ONE-SHOT, but only across a real generating→idle
100874
100950
  * transition: require busyEpoch to have advanced past the weak emit's epoch, so a
100875
100951
  * static idle screen cannot re-fire the same weak frame. The genuine re-emit passes
100876
- * evidenceLevel:'transcript' (non-weak), overwriting the latch → any subsequent idle
100952
+ * evidenceLevel:'reported' (non-weak), overwriting the latch → any subsequent idle
100877
100953
  * tick hits the now-genuine latch and is suppressed. Never a third emit.
100878
100954
  */
100879
100955
  shouldSuppressCompletionReEmit(taskId) {