@adhdev/daemon-core 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.mjs CHANGED
@@ -5632,6 +5632,15 @@ Do NOT retry on this node. Consider reassigning to a different node or asking th
5632
5632
  if (args.event === "monitor:long_generating") {
5633
5633
  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.`;
5634
5634
  }
5635
+ if (args.event === "worktree_bootstrap_complete") {
5636
+ const worktreePath = readNonEmptyString2(args.metadataEvent.worktreePath);
5637
+ const durationMs = typeof args.metadataEvent.durationMs === "number" ? args.metadataEvent.durationMs : void 0;
5638
+ 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.`;
5639
+ }
5640
+ if (args.event === "worktree_bootstrap_failed") {
5641
+ const error = readNonEmptyString2(args.metadataEvent.error);
5642
+ return `[System] ${args.nodeLabel} worktree bootstrap failed${error ? `: ${error}` : "."}. Use \`mesh_retry_node_bootstrap\` to retry or inspect the node state.`;
5643
+ }
5635
5644
  if (args.event === "refine:accepted") {
5636
5645
  const jobId = readRefineJobId({ metadataEvent: args.metadataEvent });
5637
5646
  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.`;
@@ -28823,6 +28832,7 @@ function expandPath2(template, input) {
28823
28832
  const vars = {
28824
28833
  cwd: workspaceResolved,
28825
28834
  cwd_dashed: workspaceResolved.replace(/\//g, "-"),
28835
+ cwd_claude_project: claudeProjectDirName(workspaceResolved),
28826
28836
  session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
28827
28837
  yyyy: String(now.getFullYear()),
28828
28838
  mm: String(now.getMonth() + 1).padStart(2, "0"),
@@ -28837,6 +28847,9 @@ function expandPath2(template, input) {
28837
28847
  if (missing) return null;
28838
28848
  return out;
28839
28849
  }
28850
+ function claudeProjectDirName(workspace) {
28851
+ return workspace.replace(/[^A-Za-z0-9_-]/g, "-");
28852
+ }
28840
28853
  function globToRegex(pattern) {
28841
28854
  const re = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]");
28842
28855
  return new RegExp(`^${re}$`);
@@ -28964,6 +28977,7 @@ function expandPathForDate(template, input, day) {
28964
28977
  const vars = {
28965
28978
  cwd: workspaceResolved,
28966
28979
  cwd_dashed: workspaceResolved.replace(/\//g, "-"),
28980
+ cwd_claude_project: claudeProjectDirName(workspaceResolved),
28967
28981
  session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
28968
28982
  yyyy: String(day.getFullYear()),
28969
28983
  mm: String(day.getMonth() + 1).padStart(2, "0"),
@@ -43548,10 +43562,11 @@ ${tail}` : ""
43548
43562
  let worktreeCleanup;
43549
43563
  if (node?.isLocalWorktree) {
43550
43564
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
43551
- const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
43565
+ const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch;
43552
43566
  if (isRemoteWorktree) {
43553
43567
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
43554
- ...typeof args === "object" && args !== null ? args : {}
43568
+ ...typeof args === "object" && args !== null ? args : {},
43569
+ _meshDirectDispatch: true
43555
43570
  });
43556
43571
  return forwarded ?? { success: false, error: "no response from remote node" };
43557
43572
  }
@@ -43622,9 +43637,10 @@ ${tail}` : ""
43622
43637
  const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
43623
43638
  if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
43624
43639
  const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
43625
- if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
43640
+ if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
43626
43641
  const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
43627
- ...typeof args === "object" && args !== null ? args : {}
43642
+ ...typeof args === "object" && args !== null ? args : {},
43643
+ _meshDirectDispatch: true
43628
43644
  });
43629
43645
  return forwarded ?? { success: false, error: "no response from remote node" };
43630
43646
  }
@@ -43861,9 +43877,10 @@ ${tail}` : ""
43861
43877
  if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
43862
43878
  if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
43863
43879
  const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
43864
- if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
43880
+ if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
43865
43881
  const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
43866
- ...typeof args === "object" && args !== null ? args : {}
43882
+ ...typeof args === "object" && args !== null ? args : {},
43883
+ _meshDirectDispatch: true
43867
43884
  });
43868
43885
  return forwarded ?? { success: false, error: "no response from remote node" };
43869
43886
  }