@adhdev/daemon-core 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
|
@@ -5638,6 +5638,15 @@ Do NOT retry on this node. Consider reassigning to a different node or asking th
|
|
|
5638
5638
|
if (args.event === "monitor:long_generating") {
|
|
5639
5639
|
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.`;
|
|
5640
5640
|
}
|
|
5641
|
+
if (args.event === "worktree_bootstrap_complete") {
|
|
5642
|
+
const worktreePath = readNonEmptyString2(args.metadataEvent.worktreePath);
|
|
5643
|
+
const durationMs = typeof args.metadataEvent.durationMs === "number" ? args.metadataEvent.durationMs : void 0;
|
|
5644
|
+
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.`;
|
|
5645
|
+
}
|
|
5646
|
+
if (args.event === "worktree_bootstrap_failed") {
|
|
5647
|
+
const error = readNonEmptyString2(args.metadataEvent.error);
|
|
5648
|
+
return `[System] ${args.nodeLabel} worktree bootstrap failed${error ? `: ${error}` : "."}. Use \`mesh_retry_node_bootstrap\` to retry or inspect the node state.`;
|
|
5649
|
+
}
|
|
5641
5650
|
if (args.event === "refine:accepted") {
|
|
5642
5651
|
const jobId = readRefineJobId({ metadataEvent: args.metadataEvent });
|
|
5643
5652
|
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.`;
|
|
@@ -29155,6 +29164,7 @@ function expandPath2(template, input) {
|
|
|
29155
29164
|
const vars = {
|
|
29156
29165
|
cwd: workspaceResolved,
|
|
29157
29166
|
cwd_dashed: workspaceResolved.replace(/\//g, "-"),
|
|
29167
|
+
cwd_claude_project: claudeProjectDirName(workspaceResolved),
|
|
29158
29168
|
session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
|
|
29159
29169
|
yyyy: String(now.getFullYear()),
|
|
29160
29170
|
mm: String(now.getMonth() + 1).padStart(2, "0"),
|
|
@@ -29169,6 +29179,9 @@ function expandPath2(template, input) {
|
|
|
29169
29179
|
if (missing) return null;
|
|
29170
29180
|
return out;
|
|
29171
29181
|
}
|
|
29182
|
+
function claudeProjectDirName(workspace) {
|
|
29183
|
+
return workspace.replace(/[^A-Za-z0-9_-]/g, "-");
|
|
29184
|
+
}
|
|
29172
29185
|
function globToRegex(pattern) {
|
|
29173
29186
|
const re = pattern.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]");
|
|
29174
29187
|
return new RegExp(`^${re}$`);
|
|
@@ -29296,6 +29309,7 @@ function expandPathForDate(template, input, day) {
|
|
|
29296
29309
|
const vars = {
|
|
29297
29310
|
cwd: workspaceResolved,
|
|
29298
29311
|
cwd_dashed: workspaceResolved.replace(/\//g, "-"),
|
|
29312
|
+
cwd_claude_project: claudeProjectDirName(workspaceResolved),
|
|
29299
29313
|
session_id: input.providerSessionId || input.sessionId || input.historySessionId || "",
|
|
29300
29314
|
yyyy: String(day.getFullYear()),
|
|
29301
29315
|
mm: String(day.getMonth() + 1).padStart(2, "0"),
|
|
@@ -43831,10 +43845,11 @@ ${tail}` : ""
|
|
|
43831
43845
|
}
|
|
43832
43846
|
const selfDaemonId = this.deps.statusInstanceId;
|
|
43833
43847
|
const isRemote = nodeDaemonId && selfDaemonId && nodeDaemonId !== selfDaemonId;
|
|
43834
|
-
if (isRemote && this.deps.dispatchMeshCommand) {
|
|
43848
|
+
if (isRemote && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
|
|
43835
43849
|
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "fast_forward_mesh_node", {
|
|
43836
43850
|
...typeof args === "object" && args !== null ? args : {},
|
|
43837
|
-
workspace
|
|
43851
|
+
workspace,
|
|
43852
|
+
_meshDirectDispatch: true
|
|
43838
43853
|
});
|
|
43839
43854
|
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43840
43855
|
}
|
|
@@ -43875,10 +43890,11 @@ ${tail}` : ""
|
|
|
43875
43890
|
let worktreeCleanup;
|
|
43876
43891
|
if (node?.isLocalWorktree) {
|
|
43877
43892
|
const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
43878
|
-
const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand;
|
|
43893
|
+
const isRemoteWorktree = nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch;
|
|
43879
43894
|
if (isRemoteWorktree) {
|
|
43880
43895
|
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "remove_mesh_node", {
|
|
43881
|
-
...typeof args === "object" && args !== null ? args : {}
|
|
43896
|
+
...typeof args === "object" && args !== null ? args : {},
|
|
43897
|
+
_meshDirectDispatch: true
|
|
43882
43898
|
});
|
|
43883
43899
|
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43884
43900
|
}
|
|
@@ -43949,9 +43965,10 @@ ${tail}` : ""
|
|
|
43949
43965
|
const sourceNode = mesh.nodes?.find((n) => n.id === sourceNodeId || n.nodeId === sourceNodeId);
|
|
43950
43966
|
if (!sourceNode) return { success: false, error: `Source node '${sourceNodeId}' not found in mesh` };
|
|
43951
43967
|
const sourceDaemonId = typeof sourceNode.daemonId === "string" ? sourceNode.daemonId.trim() : void 0;
|
|
43952
|
-
if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
|
|
43968
|
+
if (sourceDaemonId && sourceDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
|
|
43953
43969
|
const forwarded = await this.deps.dispatchMeshCommand(sourceDaemonId, "clone_mesh_node", {
|
|
43954
|
-
...typeof args === "object" && args !== null ? args : {}
|
|
43970
|
+
...typeof args === "object" && args !== null ? args : {},
|
|
43971
|
+
_meshDirectDispatch: true
|
|
43955
43972
|
});
|
|
43956
43973
|
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
43957
43974
|
}
|
|
@@ -44188,9 +44205,10 @@ ${tail}` : ""
|
|
|
44188
44205
|
if (!node) return { success: false, error: `Node '${nodeId}' not found in mesh` };
|
|
44189
44206
|
if (!node.isLocalWorktree) return { success: false, error: "Node is not a local worktree node" };
|
|
44190
44207
|
const nodeDaemonId = typeof node.daemonId === "string" ? node.daemonId.trim() : void 0;
|
|
44191
|
-
if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand) {
|
|
44208
|
+
if (nodeDaemonId && nodeDaemonId !== this.deps.statusInstanceId && this.deps.dispatchMeshCommand && !args?._meshDirectDispatch) {
|
|
44192
44209
|
const forwarded = await this.deps.dispatchMeshCommand(nodeDaemonId, "retry_mesh_node_bootstrap", {
|
|
44193
|
-
...typeof args === "object" && args !== null ? args : {}
|
|
44210
|
+
...typeof args === "object" && args !== null ? args : {},
|
|
44211
|
+
_meshDirectDispatch: true
|
|
44194
44212
|
});
|
|
44195
44213
|
return forwarded ?? { success: false, error: "no response from remote node" };
|
|
44196
44214
|
}
|