@adhdev/daemon-core 0.9.75 → 0.9.76-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
@@ -493,7 +493,7 @@ function buildNodeConfigSection(mesh) {
493
493
  for (const n of mesh.nodes) {
494
494
  const labels = [];
495
495
  if (n.isLocalWorktree) labels.push("worktree");
496
- if (n.policy.readOnly) labels.push("read-only");
496
+ if (n.policy?.readOnly) labels.push("read-only");
497
497
  const suffix = labels.length ? ` [${labels.join(", ")}]` : "";
498
498
  lines.push(`- **${n.workspace}** (${n.id})${suffix}`);
499
499
  }
@@ -539,18 +539,20 @@ var init_coordinator_prompt = __esm({
539
539
  3. **Delegate** \u2014 For each task:
540
540
  a. Pick the best node (consider: health, dirty state, current workload).
541
541
  b. If no session exists, call \`mesh_launch_session\` to start one.
542
- c. Call \`mesh_send_task\` with a clear, self-contained natural-language instruction.
542
+ c. Call \`mesh_send_task\` with a **complete, self-contained** instruction that includes all context the agent needs (file paths, line numbers, what to change, why). Do not send partial instructions expecting future follow-up.
543
543
  4. **Monitor** \u2014 Periodically call \`mesh_read_chat\` to check progress. Handle approvals via \`mesh_approve\`.
544
544
  5. **Verify** \u2014 When a task reports completion, call \`mesh_git_status\` to verify changes were made.
545
545
  6. **Checkpoint** \u2014 Call \`mesh_checkpoint\` to save the work.
546
546
  7. **Report** \u2014 Summarize what was done, what changed, and any issues.`;
547
547
  RULES_SECTION = `## Rules
548
548
 
549
- - **Be conversational.** Delegate work the way a tech lead would \u2014 clear, specific instructions in natural language.
550
- - **Don't inspect code.** Trust the agent's output. Verify via git diff/status, not by reading source files.
549
+ - **Minimize coordinator context.** The coordinator's job is routing, not implementing. Do not read source files, run commands, or analyze code directly \u2014 delegate all of that to node agents. Your context should stay lean.
550
+ - **Delegate analysis too.** If you need to understand a bug or explore the codebase, send that investigation as a task to a node. Do not do it yourself.
551
+ - **Front-load the task message.** When calling \`mesh_send_task\`, include everything the agent needs: what files to touch, what the problem is, what the fix should look like. The agent won't ask follow-up questions.
552
+ - **Don't inspect code.** Trust the agent's output. Verify via \`mesh_git_status\`, not by reading source files.
551
553
  - **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed.
552
554
  - **Handle failures gracefully.** If a task fails, read the chat to understand why, then retry or reassign.
553
- - **Keep the user informed.** Report progress after each delegation round.
555
+ - **Keep the user informed.** Report progress after each delegation round \u2014 one or two sentences, not a narration.
554
556
  - **Respect node capabilities.** Don't send build tasks to read-only nodes. Don't push from nodes that aren't allowed to.
555
557
  - **Never fabricate tool results.** Always call the actual tool; never pretend you did.`;
556
558
  }
@@ -1764,6 +1766,10 @@ var init_provider_cli_adapter = __esm({
1764
1766
  const currentSnapshot = normalizeScreenSnapshot(screenText);
1765
1767
  const lastSnapshot = this.lastScreenSnapshot;
1766
1768
  if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
1769
+ const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
1770
+ const currentScreenLooksIdle = /(?:^|\n|\r)\s*[❯›>]\s*(?:\n|\r|$)/.test(screenText) && !/\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(screenText);
1771
+ if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
1772
+ if (currentSnapshot.length >= lastSnapshot.length) return screenText;
1767
1773
  return `${screenText}
1768
1774
  ${lastSnapshot}`;
1769
1775
  }