@adhdev/daemon-standalone 0.9.77-rc.42 → 0.9.77-rc.43
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 +3 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/vendor/mcp-server/index.js +35 -6
- package/vendor/mcp-server/index.js.map +1 -1
package/package.json
CHANGED
|
@@ -25686,6 +25686,7 @@ function addNode(meshId, opts) {
|
|
|
25686
25686
|
workspace: opts.workspace.trim(),
|
|
25687
25687
|
repoRoot: opts.repoRoot,
|
|
25688
25688
|
daemonId: opts.daemonId,
|
|
25689
|
+
machineId: opts.machineId,
|
|
25689
25690
|
userOverrides: opts.userOverrides || {},
|
|
25690
25691
|
policy: opts.policy || {},
|
|
25691
25692
|
isLocalWorktree: opts.isLocalWorktree,
|
|
@@ -53690,6 +53691,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
53690
53691
|
workspace: result.worktreePath,
|
|
53691
53692
|
repoRoot: result.worktreePath,
|
|
53692
53693
|
daemonId: sourceNode.daemonId,
|
|
53694
|
+
machineId: sourceNode.machineId ?? sourceNode.machine_id,
|
|
53693
53695
|
userOverrides: { ...sourceNode.userOverrides || {} },
|
|
53694
53696
|
policy: { ...sourceNode.policy || {} },
|
|
53695
53697
|
isLocalWorktree: true,
|
|
@@ -53703,6 +53705,7 @@ Run 'adhdev doctor' for detailed diagnostics.`
|
|
|
53703
53705
|
workspace: result.worktreePath,
|
|
53704
53706
|
repoRoot: result.worktreePath,
|
|
53705
53707
|
daemonId: sourceNode.daemonId,
|
|
53708
|
+
machineId: sourceNode.machineId ?? sourceNode.machine_id,
|
|
53706
53709
|
userOverrides: { ...sourceNode.userOverrides || {} },
|
|
53707
53710
|
isLocalWorktree: true,
|
|
53708
53711
|
worktreeBranch: result.branch,
|
|
@@ -58153,14 +58156,40 @@ function resolveCoordinatorNode(ctx) {
|
|
|
58153
58156
|
if (preferred) return preferred;
|
|
58154
58157
|
}
|
|
58155
58158
|
if (ctx.localMachineId) {
|
|
58156
|
-
const byMachine = ctx.mesh.nodes.find((n) => n
|
|
58159
|
+
const byMachine = ctx.mesh.nodes.find((n) => readNodeMachineId(n) === ctx.localMachineId);
|
|
58157
58160
|
if (byMachine) return byMachine;
|
|
58158
58161
|
}
|
|
58159
58162
|
if (ctx.localDaemonId) {
|
|
58160
|
-
return ctx.mesh.nodes.find((n) => n
|
|
58163
|
+
return ctx.mesh.nodes.find((n) => readNodeDaemonId(n) === ctx.localDaemonId);
|
|
58161
58164
|
}
|
|
58162
58165
|
return void 0;
|
|
58163
58166
|
}
|
|
58167
|
+
function readNodeMachineId(node) {
|
|
58168
|
+
return readString(node.machineId) || readString(node.machine_id);
|
|
58169
|
+
}
|
|
58170
|
+
function readNodeDaemonId(node) {
|
|
58171
|
+
return readString(node.daemonId) || readString(node.daemon_id);
|
|
58172
|
+
}
|
|
58173
|
+
function isDirectLocalNode(ctx, node) {
|
|
58174
|
+
const machineId = readNodeMachineId(node);
|
|
58175
|
+
const daemonId = readNodeDaemonId(node);
|
|
58176
|
+
return Boolean(
|
|
58177
|
+
ctx.localMachineId && machineId === ctx.localMachineId || ctx.localDaemonId && daemonId === ctx.localDaemonId
|
|
58178
|
+
);
|
|
58179
|
+
}
|
|
58180
|
+
function findClonedFromNode(ctx, node) {
|
|
58181
|
+
const clonedFromNodeId = readString(node.clonedFromNodeId) || readString(node.cloned_from_node_id);
|
|
58182
|
+
if (!clonedFromNodeId) return void 0;
|
|
58183
|
+
return ctx.mesh.nodes.find((n) => n.id === clonedFromNodeId || n.nodeId === clonedFromNodeId || n.node_id === clonedFromNodeId);
|
|
58184
|
+
}
|
|
58185
|
+
function isLocalControlPlaneNode(ctx, node) {
|
|
58186
|
+
if (isDirectLocalNode(ctx, node)) return true;
|
|
58187
|
+
if (node.isLocalWorktree === true) {
|
|
58188
|
+
const sourceNode = findClonedFromNode(ctx, node);
|
|
58189
|
+
if (sourceNode && isDirectLocalNode(ctx, sourceNode)) return true;
|
|
58190
|
+
}
|
|
58191
|
+
return false;
|
|
58192
|
+
}
|
|
58164
58193
|
function meshSessionCacheKey(nodeId, runtimeSessionId) {
|
|
58165
58194
|
return `${nodeId}:${runtimeSessionId}`;
|
|
58166
58195
|
}
|
|
@@ -58352,7 +58381,7 @@ function summarizeBranchConvergence(nodes) {
|
|
|
58352
58381
|
};
|
|
58353
58382
|
}
|
|
58354
58383
|
async function commandForNode(ctx, node, command, args = {}) {
|
|
58355
|
-
const isLocalNode = ctx
|
|
58384
|
+
const isLocalNode = isLocalControlPlaneNode(ctx, node);
|
|
58356
58385
|
if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
|
|
58357
58386
|
return ctx.transport.meshCommand(node.daemonId, command, args);
|
|
58358
58387
|
}
|
|
@@ -58780,7 +58809,7 @@ async function meshEnqueueTask(ctx, args) {
|
|
|
58780
58809
|
});
|
|
58781
58810
|
const dispatchPromises = [];
|
|
58782
58811
|
for (const node of ctx.mesh.nodes) {
|
|
58783
|
-
const isLocalNode = ctx
|
|
58812
|
+
const isLocalNode = isLocalControlPlaneNode(ctx, node);
|
|
58784
58813
|
if (isLocalNode || !node.daemonId) continue;
|
|
58785
58814
|
dispatchPromises.push(
|
|
58786
58815
|
ipcDispatchToRemoteAgent(ctx, node, { message: args.message }).then((result) => {
|
|
@@ -58891,7 +58920,7 @@ async function meshSendTask(ctx, args) {
|
|
|
58891
58920
|
});
|
|
58892
58921
|
return JSON.stringify(res);
|
|
58893
58922
|
}
|
|
58894
|
-
const isLocalNode = ctx
|
|
58923
|
+
const isLocalNode = isLocalControlPlaneNode(ctx, node);
|
|
58895
58924
|
if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
|
|
58896
58925
|
const cached2 = meshSessionProviderMetadata.get(meshSessionCacheKey(args.node_id, args.session_id || ""));
|
|
58897
58926
|
const result = await ipcDispatchToRemoteAgent(ctx, node, {
|
|
@@ -59106,7 +59135,7 @@ async function meshLaunchSession(ctx, args) {
|
|
|
59106
59135
|
});
|
|
59107
59136
|
} catch {
|
|
59108
59137
|
}
|
|
59109
|
-
const isLocalNode = ctx
|
|
59138
|
+
const isLocalNode = isLocalControlPlaneNode(ctx, node);
|
|
59110
59139
|
if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
|
|
59111
59140
|
ctx.transport.meshCommand(node.daemonId, "trigger_mesh_queue", { meshId: ctx.mesh.id }).catch(() => {
|
|
59112
59141
|
});
|