@adhdev/daemon-standalone 0.9.82-rc.121 → 0.9.82-rc.123

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/public/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
8
8
  <link rel="icon" href="/otter-logo.png" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-BKsjvBcH.js"></script>
10
+ <script type="module" crossorigin src="/assets/index--3Wc6sJr.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-CgiI0UIA.js">
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-xSlc1ntZ.css">
13
13
  </head>
@@ -275,8 +275,8 @@ function buildActiveWorkPollingGuidance(summary, now = Date.now()) {
275
275
  generatingCount: summary.generatingCount,
276
276
  doNotPollBefore: new Date(now + ACTIVE_WORK_POLLING_BACKOFF_MS).toISOString(),
277
277
  eventSurface: "pendingCoordinatorEvents",
278
- nextRecommendedAction: "Wait for pendingCoordinatorEvents/completion events or an explicit user status request. After a terminal signal, call mesh_read_chat once with compact=true, then verify git state if repository changes were expected.",
279
- message: "Do not repeatedly poll mesh_status/mesh_view_queue/mesh_read_chat while delegated work is generating; these snapshots rarely change until the worker emits a completion/status event."
278
+ nextRecommendedAction: "Wait for pendingCoordinatorEvents/completion events or an explicit user status request. If no terminal evidence appears and the user asks for status, make one bounded status check, then wait again.",
279
+ message: "Do not repeatedly poll mesh_status/mesh_view_queue/mesh_read_chat while delegated work is generating; terminal ledger or completion evidence will be surfaced through pendingCoordinatorEvents when available."
280
280
  };
281
281
  }
282
282
  function readString(value) {
@@ -478,6 +478,17 @@ function isMeshCoordinatorSessionRecord(session) {
478
478
  readString(session?.settings?.meshCoordinatorFor) || readString(session?.meta?.meshCoordinatorFor) || readString(session?.metadata?.meshCoordinatorFor) || readString(session?.meshCoordinatorFor)
479
479
  );
480
480
  }
481
+ function isUnmanagedSessionRecord(session) {
482
+ const hasMeshNodeFor = Boolean(
483
+ readString(session?.settings?.meshNodeFor) || readString(session?.meta?.meshNodeFor) || readString(session?.metadata?.meshNodeFor) || readString(session?.meshNodeFor)
484
+ );
485
+ if (hasMeshNodeFor) return false;
486
+ if (isMeshCoordinatorSessionRecord(session)) return false;
487
+ const launchedByCoordinator = Boolean(
488
+ session?.settings?.launchedByCoordinator === true || session?.meta?.launchedByCoordinator === true || session?.launchedByCoordinator === true
489
+ );
490
+ return !launchedByCoordinator;
491
+ }
481
492
  function isWorkerTaskMode(taskMode) {
482
493
  return taskMode !== "live_debug_readonly";
483
494
  }
@@ -742,8 +753,9 @@ function buildRelayUnsafeRemoteSessionFailure(ctx, node, sessionId, providerType
742
753
  daemonId: node.daemonId,
743
754
  workspace: node.workspace,
744
755
  sessionId,
756
+ unsafeTranscriptAlias: true,
745
757
  ...providerType ? { resolvedProviderType: providerType } : {},
746
- error: `Remote session '${sessionId}' is not relay-safe for mesh '${ctx.mesh.id}': missing meshNodeFor/meshCoordinatorDaemonId metadata, so completion events would not reach the coordinator ledger.`,
758
+ error: `Remote session '${sessionId}' is not relay-safe for mesh '${ctx.mesh.id}': missing meshNodeFor/meshCoordinatorDaemonId metadata, so completion events would not reach the coordinator ledger. This session may be the coordinator itself or an unrelated session (unsafe_transcript_alias risk).`,
747
759
  nextAction: `Launch a fresh relay-safe session with mesh_launch_session(node_id: '${node.id}'${providerType ? `, type: '${providerType}'` : ""}) or dispatch without session_id so Repo Mesh can choose a valid delegate session.`,
748
760
  noFallbackReason: "Blindly reusing a remote session without mesh relay metadata would silently drop task_completed / generating_completed events."
749
761
  };
@@ -1169,6 +1181,10 @@ function isConfiguredCoordinatorNode(ctx, node) {
1169
1181
  if (!ctx.localMachineId && !ctx.localDaemonId) return false;
1170
1182
  const nodeId = readString(node.id) || readString(node.nodeId) || readString(node.node_id);
1171
1183
  if (!nodeId) return false;
1184
+ const nodeDaemonId = readNodeDaemonId(node);
1185
+ const nodeMachineId = readNodeMachineId(node);
1186
+ if (nodeDaemonId && ctx.localDaemonId && nodeDaemonId !== ctx.localDaemonId) return false;
1187
+ if (nodeMachineId && ctx.localMachineId && nodeMachineId !== ctx.localMachineId) return false;
1172
1188
  const preferredNodeId = readString(ctx.mesh.coordinator?.preferredNodeId) || readString(ctx.mesh.coordinator?.preferred_node_id);
1173
1189
  if (preferredNodeId) return nodeId === preferredNodeId;
1174
1190
  const first = ctx.mesh.nodes?.[0];
@@ -2424,6 +2440,20 @@ async function meshSendTask(ctx, args) {
2424
2440
  nextAction: `Call mesh_launch_session for node '${args.node_id}' and then retry mesh_send_task with that worker session_id, or use mesh_enqueue_task for queue-based worker assignment.`
2425
2441
  });
2426
2442
  }
2443
+ if (explicitTargetSession && isUnmanagedSessionRecord(explicitTargetSession)) {
2444
+ return JSON.stringify({
2445
+ success: false,
2446
+ recoverable: true,
2447
+ code: "mesh_target_session_unmanaged",
2448
+ reason: "mesh_target_session_unmanaged",
2449
+ nodeId: args.node_id,
2450
+ sessionId: args.session_id,
2451
+ taskMode: taskMode || "unspecified",
2452
+ unsafeTranscriptAlias: true,
2453
+ error: `Session '${args.session_id}' on node '${args.node_id}' has no Repo Mesh delegation metadata (missing meshNodeFor/meshCoordinatorFor/launchedByCoordinator). It may be the coordinator's own session or an unrelated session \u2014 dispatching risks self-send and orphaned completion events that never reach the coordinator ledger.`,
2454
+ nextAction: `Call mesh_launch_session for node '${args.node_id}' to start a fresh managed worker session, then retry mesh_send_task with the returned session_id. Alternatively use mesh_enqueue_task for queue-based assignment without specifying session_id.`
2455
+ });
2456
+ }
2427
2457
  } catch {
2428
2458
  explicitTargetSession = void 0;
2429
2459
  }
@@ -2519,6 +2549,34 @@ async function meshSendTask(ctx, args) {
2519
2549
  nextAction: `Launch a fresh session with mesh_launch_session(node_id: '${args.node_id}') or retry without session_id so Repo Mesh can target a live delegate session.`
2520
2550
  });
2521
2551
  }
2552
+ if (isMeshCoordinatorSessionRecord(explicitSession)) {
2553
+ return JSON.stringify({
2554
+ success: false,
2555
+ recoverable: true,
2556
+ code: "mesh_target_session_is_coordinator",
2557
+ reason: "mesh_target_session_is_coordinator",
2558
+ nodeId: args.node_id,
2559
+ sessionId: args.session_id,
2560
+ taskMode: taskMode || "unspecified",
2561
+ error: `Session '${args.session_id}' is a Repo Mesh coordinator session, not a visible worker session. Launch or use a visible worker session before dispatching this task.`,
2562
+ nextAction: `Call mesh_launch_session for node '${args.node_id}' and then retry mesh_send_task with that worker session_id, or use mesh_enqueue_task for queue-based worker assignment.`
2563
+ });
2564
+ }
2565
+ if (isUnmanagedSessionRecord(explicitSession)) {
2566
+ return JSON.stringify({
2567
+ success: false,
2568
+ recoverable: true,
2569
+ code: "mesh_target_session_unmanaged",
2570
+ reason: "mesh_target_session_unmanaged",
2571
+ nodeId: args.node_id,
2572
+ sessionId: args.session_id,
2573
+ taskMode: taskMode || "unspecified",
2574
+ unsafeTranscriptAlias: true,
2575
+ unsafeDelegateTarget: true,
2576
+ error: `Session '${args.session_id}' on node '${args.node_id}' has no Repo Mesh delegation metadata (missing meshNodeFor/meshCoordinatorFor/launchedByCoordinator). It may be the coordinator's own session or an unrelated session \u2014 dispatching risks self-send and orphaned completion events that never reach the coordinator ledger.`,
2577
+ nextAction: `Call mesh_launch_session for node '${args.node_id}' to start a fresh managed worker session, then retry mesh_send_task with the returned session_id. Alternatively use mesh_enqueue_task for queue-based assignment without specifying session_id.`
2578
+ });
2579
+ }
2522
2580
  resolvedProviderType = resolveSessionProviderType(explicitSession);
2523
2581
  if (resolvedProviderType) {
2524
2582
  meshSessionProviderMetadata.set(meshSessionCacheKey(args.node_id, args.session_id), {