@adhdev/daemon-standalone 1.0.41-rc.2 → 1.0.41-rc.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-standalone",
3
- "version": "1.0.41-rc.2",
3
+ "version": "1.0.41-rc.3",
4
4
  "description": "ADHDev standalone daemon — embedded HTTP/WS server for local dashboard",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -37,7 +37,7 @@
37
37
  "license": "AGPL-3.0-or-later",
38
38
  "dependencies": {
39
39
  "@adhdev/ghostty-vt-node": "*",
40
- "@adhdev/session-host-core": "1.0.41-rc.2",
40
+ "@adhdev/session-host-core": "1.0.41-rc.3",
41
41
  "@xterm/addon-serialize": "^0.14.0",
42
42
  "@xterm/xterm": "^6.0.0",
43
43
  "chalk": "^5.3.0",
@@ -4472,6 +4472,16 @@ function findInFlightDuplicate(ctx, message, targetNodeId) {
4472
4472
  }
4473
4473
  return null;
4474
4474
  }
4475
+ function buildUntargetedCodeChangeWorktreeAdvisory(input) {
4476
+ if (input.taskMode !== "code_change") return null;
4477
+ if (input.readonly) return null;
4478
+ if (input.targetNodeId) return null;
4479
+ if (input.preferWorktree) return null;
4480
+ if (Array.isArray(input.requiredTags) && input.requiredTags.length > 0) return null;
4481
+ return {
4482
+ worktreeRoutingAdvisory: 'This untargeted `code_change` will be claimed by whichever node polls first \u2014 usually the BASE node, which gives it no branch isolation. Base nodes are for environment-specific testing (win32 PATH/registry, clean install on one OS, that machine\'s package state, OS-dependent runtime behavior). If this task only changes code, cancel it (mesh_queue_cancel), call mesh_clone_node (~10s, auto-launch starts the session), and re-enqueue with target_node_id set to the returned worktree node id \u2014 or pass prefer_worktree: true to route to the most recent worktree. If it DOES need a specific machine, pin it with required_tags (e.g. ["os=win32"]) or target_node_id and this advisory will not appear.'
4483
+ };
4484
+ }
4475
4485
  async function meshEnqueueTask(ctx, args) {
4476
4486
  const message = readString(args.message);
4477
4487
  if (!message) {
@@ -4541,6 +4551,13 @@ async function meshEnqueueTask(ctx, args) {
4541
4551
  });
4542
4552
  const duplicateWarning = duplicateSuspect ? { duplicateSuspect: { taskId: duplicateSuspect.id, status: duplicateSuspect.status, assignedNodeId: duplicateSuspect.assignedNodeId, targetNodeId: duplicateSuspect.targetNodeId }, duplicateSuspectHint: "An in-flight task with the same message+target already exists. This new task was enqueued anyway (warn-only). Cancel one via mesh_queue_cancel if it is an accidental re-enqueue, or pass allow_duplicate=true to silence this, or block_duplicate=true to refuse next time." } : {};
4543
4553
  const missionWarning = buildMissionInactiveWarning(ctx, missionId) ?? {};
4554
+ const worktreeAdvisory = buildUntargetedCodeChangeWorktreeAdvisory({
4555
+ taskMode,
4556
+ readonly,
4557
+ requiredTags,
4558
+ targetNodeId,
4559
+ preferWorktree
4560
+ }) ?? {};
4544
4561
  const enqueueEcho = {
4545
4562
  ...task.priority ? { priority: task.priority } : {},
4546
4563
  ...task.notBefore ? { notBefore: task.notBefore } : {},
@@ -4560,6 +4577,7 @@ async function meshEnqueueTask(ctx, args) {
4560
4577
  ...preferWorktree && !explicitTargetRaw && !targetNodeId ? { preferWorktreeNoOp: true } : {},
4561
4578
  ...duplicateWarning,
4562
4579
  ...missionWarning,
4580
+ ...worktreeAdvisory,
4563
4581
  queueTrigger,
4564
4582
  ...buildQueueTriggerGuidance(queueTrigger)
4565
4583
  });
@@ -4645,6 +4663,7 @@ async function meshEnqueueTask(ctx, args) {
4645
4663
  ...eagerPushDeferred ? { eagerPushDeferred: true, eagerPushDeferredReason: "dependencies_unsatisfied" } : {},
4646
4664
  ...duplicateWarning,
4647
4665
  ...missionWarning,
4666
+ ...worktreeAdvisory,
4648
4667
  queueTrigger,
4649
4668
  ...buildQueueTriggerGuidance(queueTrigger)
4650
4669
  });