@adhdev/daemon-standalone 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.
@@ -22992,7 +22992,7 @@ function buildNodeConfigSection(mesh) {
22992
22992
  for (const n of mesh.nodes) {
22993
22993
  const labels = [];
22994
22994
  if (n.isLocalWorktree) labels.push("worktree");
22995
- if (n.policy.readOnly) labels.push("read-only");
22995
+ if (n.policy?.readOnly) labels.push("read-only");
22996
22996
  const suffix = labels.length ? ` [${labels.join(", ")}]` : "";
22997
22997
  lines.push(`- **${n.workspace}** (${n.id})${suffix}`);
22998
22998
  }
@@ -36999,18 +36999,20 @@ var init_dist2 = __esm({
36999
36999
  3. **Delegate** \u2014 For each task:
37000
37000
  a. Pick the best node (consider: health, dirty state, current workload).
37001
37001
  b. If no session exists, call \`mesh_launch_session\` to start one.
37002
- c. Call \`mesh_send_task\` with a clear, self-contained natural-language instruction.
37002
+ 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.
37003
37003
  4. **Monitor** \u2014 Periodically call \`mesh_read_chat\` to check progress. Handle approvals via \`mesh_approve\`.
37004
37004
  5. **Verify** \u2014 When a task reports completion, call \`mesh_git_status\` to verify changes were made.
37005
37005
  6. **Checkpoint** \u2014 Call \`mesh_checkpoint\` to save the work.
37006
37006
  7. **Report** \u2014 Summarize what was done, what changed, and any issues.`;
37007
37007
  RULES_SECTION = `## Rules
37008
37008
 
37009
- - **Be conversational.** Delegate work the way a tech lead would \u2014 clear, specific instructions in natural language.
37010
- - **Don't inspect code.** Trust the agent's output. Verify via git diff/status, not by reading source files.
37009
+ - **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.
37010
+ - **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.
37011
+ - **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.
37012
+ - **Don't inspect code.** Trust the agent's output. Verify via \`mesh_git_status\`, not by reading source files.
37011
37013
  - **Don't over-parallelize.** Start with 1-2 concurrent tasks. Scale up if they succeed.
37012
37014
  - **Handle failures gracefully.** If a task fails, read the chat to understand why, then retry or reassign.
37013
- - **Keep the user informed.** Report progress after each delegation round.
37015
+ - **Keep the user informed.** Report progress after each delegation round \u2014 one or two sentences, not a narration.
37014
37016
  - **Respect node capabilities.** Don't send build tasks to read-only nodes. Don't push from nodes that aren't allowed to.
37015
37017
  - **Never fabricate tool results.** Always call the actual tool; never pretend you did.`;
37016
37018
  }
@@ -37499,6 +37501,10 @@ var init_dist2 = __esm({
37499
37501
  const currentSnapshot = normalizeScreenSnapshot(screenText);
37500
37502
  const lastSnapshot = this.lastScreenSnapshot;
37501
37503
  if (!lastSnapshot || lastSnapshot === currentSnapshot) return screenText;
37504
+ const staleSnapshotLooksActive = /\besc to (?:interrupt|stop)\b|Enter to interrupt, Ctrl\+C to cancel/i.test(lastSnapshot);
37505
+ 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);
37506
+ if (staleSnapshotLooksActive && currentScreenLooksIdle) return screenText;
37507
+ if (currentSnapshot.length >= lastSnapshot.length) return screenText;
37502
37508
  return `${screenText}
37503
37509
  ${lastSnapshot}`;
37504
37510
  }
@@ -53252,7 +53258,14 @@ async function meshStatus(ctx) {
53252
53258
  workspace: node.workspace
53253
53259
  };
53254
53260
  try {
53255
- if (isLocalTransport(transport)) {
53261
+ if (!isLocalTransport(transport) && node.daemonId) {
53262
+ const result = await transport.gitStatus(node.daemonId, node.workspace, false);
53263
+ const status = result?.status ?? result;
53264
+ entry.health = status?.isGitRepo ? status?.isDirty ? "dirty" : "online" : "degraded";
53265
+ entry.branch = status?.branch;
53266
+ entry.isDirty = status?.isDirty;
53267
+ entry.uncommittedChanges = status?.uncommittedChanges ?? 0;
53268
+ } else if (isLocalTransport(transport)) {
53256
53269
  const statusResult = await transport.command("git_status", { workspace: node.workspace });
53257
53270
  const status = statusResult?.status ?? statusResult;
53258
53271
  entry.health = status?.isGitRepo ? status?.isDirty ? "dirty" : "online" : "degraded";
@@ -53261,7 +53274,7 @@ async function meshStatus(ctx) {
53261
53274
  entry.uncommittedChanges = status?.uncommittedChanges ?? 0;
53262
53275
  } else {
53263
53276
  entry.health = "unknown";
53264
- entry.note = "Cloud status probe not yet implemented for mesh nodes";
53277
+ entry.note = "No daemonId available for cloud status probe";
53265
53278
  }
53266
53279
  } catch (e) {
53267
53280
  entry.health = "degraded";
@@ -53295,7 +53308,7 @@ async function meshListNodes(ctx) {
53295
53308
  }
53296
53309
  async function meshSendTask(ctx, args) {
53297
53310
  const node = findNode(ctx.mesh, args.node_id);
53298
- if (node.policy.readOnly) {
53311
+ if (node.policy?.readOnly) {
53299
53312
  return JSON.stringify({ error: `Node '${args.node_id}' is read-only` });
53300
53313
  }
53301
53314
  if (isLocalTransport(ctx.transport)) {
@@ -53338,7 +53351,15 @@ async function meshLaunchSession(ctx, args) {
53338
53351
  }
53339
53352
  async function meshGitStatus(ctx, args) {
53340
53353
  const node = findNode(ctx.mesh, args.node_id);
53341
- if (isLocalTransport(ctx.transport)) {
53354
+ if (!isLocalTransport(ctx.transport) && node.daemonId) {
53355
+ const result = await ctx.transport.gitStatus(node.daemonId, node.workspace, true);
53356
+ return JSON.stringify({
53357
+ nodeId: args.node_id,
53358
+ workspace: node.workspace,
53359
+ status: result?.status ?? result,
53360
+ diff: result?.diff ?? null
53361
+ }, null, 2);
53362
+ } else if (isLocalTransport(ctx.transport)) {
53342
53363
  const statusResult = await ctx.transport.command("git_status", {
53343
53364
  workspace: node.workspace
53344
53365
  });
@@ -53352,12 +53373,12 @@ async function meshGitStatus(ctx, args) {
53352
53373
  diff: diffResult?.diffSummary ?? diffResult
53353
53374
  }, null, 2);
53354
53375
  } else {
53355
- return JSON.stringify({ error: "Cloud mesh git_status not yet implemented" });
53376
+ return JSON.stringify({ error: "No daemonId available for cloud git_status probe" });
53356
53377
  }
53357
53378
  }
53358
53379
  async function meshCheckpoint(ctx, args) {
53359
53380
  const node = findNode(ctx.mesh, args.node_id);
53360
- if (node.policy.readOnly) {
53381
+ if (node.policy?.readOnly) {
53361
53382
  return JSON.stringify({ error: `Node '${args.node_id}' is read-only \u2014 cannot checkpoint` });
53362
53383
  }
53363
53384
  if (isLocalTransport(ctx.transport)) {
@@ -53446,6 +53467,7 @@ async function startMcpServer(opts) {
53446
53467
  id: n.id,
53447
53468
  workspace: n.workspace,
53448
53469
  repoRoot: n.repo_root,
53470
+ daemonId: n.daemon_id,
53449
53471
  userOverrides: {},
53450
53472
  policy: {},
53451
53473
  isLocalWorktree: false