@adhdev/daemon-standalone 0.9.82-rc.230 → 0.9.82-rc.232

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
@@ -35394,6 +35394,15 @@ Do NOT retry on this node. Consider reassigning to a different node or asking th
35394
35394
  if (args.event === "monitor:long_generating") {
35395
35395
  return `[System] ${args.nodeLabel} is still reported as generating after a long interval${metadata}. Wait for pendingCoordinatorEvents or a completion/status event; if the user explicitly asks for status, make one bounded status check and then wait again.`;
35396
35396
  }
35397
+ if (args.event === "worktree_bootstrap_complete") {
35398
+ const worktreePath = readNonEmptyString2(args.metadataEvent.worktreePath);
35399
+ const durationMs = typeof args.metadataEvent.durationMs === "number" ? args.metadataEvent.durationMs : void 0;
35400
+ return `[System] ${args.nodeLabel} worktree bootstrap completed${worktreePath ? ` at ${worktreePath}` : ""}${durationMs !== void 0 ? ` in ${Math.round(durationMs / 1e3)}s` : ""}. The worktree is ready \u2014 use \`mesh_launch_session\` to start an agent.`;
35401
+ }
35402
+ if (args.event === "worktree_bootstrap_failed") {
35403
+ const error48 = readNonEmptyString2(args.metadataEvent.error);
35404
+ return `[System] ${args.nodeLabel} worktree bootstrap failed${error48 ? `: ${error48}` : "."}. Use \`mesh_retry_node_bootstrap\` to retry or inspect the node state.`;
35405
+ }
35397
35406
  if (args.event === "refine:accepted") {
35398
35407
  const jobId = readRefineJobId({ metadataEvent: args.metadataEvent });
35399
35408
  return `[System] Refinery accepted async job${jobId ? ` ${jobId}` : ""} for ${args.nodeLabel}. Completion/failure will be delivered as a terminal refine event; do not poll repeatedly.`;
@@ -58759,6 +58768,7 @@ ${formatManifestValidationIssues2(validation.issues)}`,
58759
58768
  const vars = {
58760
58769
  cwd: workspaceResolved,
58761
58770
  cwd_dashed: workspaceResolved.replace(/\//g, "-"),
58771
+ cwd_claude_project: claudeProjectDirName(workspaceResolved),
58762
58772
  session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
58763
58773
  yyyy: String(now.getFullYear()),
58764
58774
  mm: String(now.getMonth() + 1).padStart(2, "0"),
@@ -58773,6 +58783,9 @@ ${formatManifestValidationIssues2(validation.issues)}`,
58773
58783
  if (missing) return null;
58774
58784
  return out;
58775
58785
  }
58786
+ function claudeProjectDirName(workspace) {
58787
+ return workspace.replace(/[^A-Za-z0-9_-]/g, "-");
58788
+ }
58776
58789
  function globToRegex(pattern) {
58777
58790
  const re = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]");
58778
58791
  return new RegExp(`^${re}$`);
@@ -58900,6 +58913,7 @@ ${formatManifestValidationIssues2(validation.issues)}`,
58900
58913
  const vars = {
58901
58914
  cwd: workspaceResolved,
58902
58915
  cwd_dashed: workspaceResolved.replace(/\//g, "-"),
58916
+ cwd_claude_project: claudeProjectDirName(workspaceResolved),
58903
58917
  session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
58904
58918
  yyyy: String(day.getFullYear()),
58905
58919
  mm: String(day.getMonth() + 1).padStart(2, "0"),
@@ -73375,10 +73389,11 @@ ${tail}` : ""
73375
73389
  }
73376
73390
  const selfDaemonId = this.deps.statusInstanceId;
73377
73391
  const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
73378
- if (isRemote && this.deps.dispatchMeshCommand) {
73392
+ if (isRemote && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
73379
73393
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
73380
73394
  ...typeof args === "object" && args !== null ? args : {},
73381
- workspace
73395
+ workspace,
73396
+ _meshDirectDispatch: true
73382
73397
  });
73383
73398
  return forwarded ?? { success: false, error: "no response from remote node" };
73384
73399
  }
@@ -73419,10 +73434,11 @@ ${tail}` : ""
73419
73434
  let worktreeCleanup;
73420
73435
  if (node?.isLocalWorktree) {
73421
73436
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73422
- const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
73437
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch;
73423
73438
  if (isRemoteWorktree) {
73424
73439
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
73425
- ...typeof args === "object" && args !== null ? args : {}
73440
+ ...typeof args === "object" && args !== null ? args : {},
73441
+ _meshDirectDispatch: true
73426
73442
  });
73427
73443
  return forwarded ?? { success: false, error: "no response from remote node" };
73428
73444
  }
@@ -73493,9 +73509,10 @@ ${tail}` : ""
73493
73509
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
73494
73510
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
73495
73511
  const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
73496
- if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73512
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
73497
73513
  const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
73498
- ...typeof args === "object" && args !== null ? args : {}
73514
+ ...typeof args === "object" && args !== null ? args : {},
73515
+ _meshDirectDispatch: true
73499
73516
  });
73500
73517
  return forwarded ?? { success: false, error: "no response from remote node" };
73501
73518
  }
@@ -73732,9 +73749,10 @@ ${tail}` : ""
73732
73749
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
73733
73750
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
73734
73751
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73735
- if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73752
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
73736
73753
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
73737
- ...typeof args === "object" && args !== null ? args : {}
73754
+ ...typeof args === "object" && args !== null ? args : {},
73755
+ _meshDirectDispatch: true
73738
73756
  });
73739
73757
  return forwarded ?? { success: false, error: "no response from remote node" };
73740
73758
  }