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

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"),
@@ -73419,10 +73433,11 @@ ${tail}` : ""
73419
73433
  let worktreeCleanup;
73420
73434
  if (node?.isLocalWorktree) {
73421
73435
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73422
- const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
73436
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch;
73423
73437
  if (isRemoteWorktree) {
73424
73438
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
73425
- ...typeof args === "object" && args !== null ? args : {}
73439
+ ...typeof args === "object" && args !== null ? args : {},
73440
+ _meshDirectDispatch: true
73426
73441
  });
73427
73442
  return forwarded ?? { success: false, error: "no response from remote node" };
73428
73443
  }
@@ -73493,9 +73508,10 @@ ${tail}` : ""
73493
73508
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
73494
73509
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
73495
73510
  const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
73496
- if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73511
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
73497
73512
  const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
73498
- ...typeof args === "object" && args !== null ? args : {}
73513
+ ...typeof args === "object" && args !== null ? args : {},
73514
+ _meshDirectDispatch: true
73499
73515
  });
73500
73516
  return forwarded ?? { success: false, error: "no response from remote node" };
73501
73517
  }
@@ -73732,9 +73748,10 @@ ${tail}` : ""
73732
73748
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
73733
73749
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
73734
73750
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
73735
- if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
73751
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
73736
73752
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
73737
- ...typeof args === "object" && args !== null ? args : {}
73753
+ ...typeof args === "object" && args !== null ? args : {},
73754
+ _meshDirectDispatch: true
73738
73755
  });
73739
73756
  return forwarded ?? { success: false, error: "no response from remote node" };
73740
73757
  }