adhdev 0.9.77-rc.25 → 0.9.77-rc.27
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/cli/index.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/vendor/mcp-server/index.js +76 -3
- package/vendor/mcp-server/index.js.map +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -95955,7 +95955,7 @@ var init_adhdev_daemon = __esm({
|
|
|
95955
95955
|
init_version();
|
|
95956
95956
|
init_src();
|
|
95957
95957
|
init_runtime_defaults();
|
|
95958
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.77-rc.
|
|
95958
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.77-rc.27" });
|
|
95959
95959
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
95960
95960
|
localHttpServer = null;
|
|
95961
95961
|
localWss = null;
|
package/dist/index.js
CHANGED
|
@@ -64791,7 +64791,7 @@ var init_adhdev_daemon = __esm({
|
|
|
64791
64791
|
init_version();
|
|
64792
64792
|
init_src();
|
|
64793
64793
|
init_runtime_defaults();
|
|
64794
|
-
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.77-rc.
|
|
64794
|
+
pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.77-rc.27" });
|
|
64795
64795
|
AdhdevDaemon = class _AdhdevDaemon {
|
|
64796
64796
|
localHttpServer = null;
|
|
64797
64797
|
localWss = null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adhdev",
|
|
3
|
-
"version": "0.9.77-rc.
|
|
3
|
+
"version": "0.9.77-rc.27",
|
|
4
4
|
"description": "ADHDev — Agent Dashboard Hub for Dev. Remote-control AI coding agents from anywhere.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"node": ">=18"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@adhdev/daemon-core": "0.9.77-rc.
|
|
50
|
+
"@adhdev/daemon-core": "0.9.77-rc.27",
|
|
51
51
|
"@adhdev/ghostty-vt-node": "*",
|
|
52
52
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
53
53
|
"@xterm/addon-serialize": "^0.14.0",
|
|
@@ -57466,6 +57466,49 @@ function extractGitDiff(value) {
|
|
|
57466
57466
|
function extractLaunchPayload(value) {
|
|
57467
57467
|
return findNestedPayload(value, (payload) => Boolean(payload?.sessionId || payload?.id || payload?.runtimeSessionId));
|
|
57468
57468
|
}
|
|
57469
|
+
async function ipcDispatchToRemoteAgent(ctx, node, args) {
|
|
57470
|
+
const transport = ctx.transport;
|
|
57471
|
+
const daemonId = node.daemonId;
|
|
57472
|
+
let sessionId = args.session_id?.trim() || "";
|
|
57473
|
+
const providerPriorityList = Array.isArray(node.policy?.providerPriority) ? node.policy.providerPriority : [];
|
|
57474
|
+
let resolvedProviderType = args.providerType?.trim() || providerPriorityList[0] || "";
|
|
57475
|
+
if (!sessionId) {
|
|
57476
|
+
try {
|
|
57477
|
+
const statusResult = await transport.meshCommand(daemonId, "get_status_metadata", {});
|
|
57478
|
+
const payload = unwrapCommandPayload(statusResult);
|
|
57479
|
+
const sessions = Array.isArray(payload?.sessions) ? payload.sessions : Array.isArray(payload?.status?.sessions) ? payload.status.sessions : [];
|
|
57480
|
+
const meshSessions = sessions.filter(
|
|
57481
|
+
(s) => s?.settings?.meshNodeFor === ctx.mesh.id || s?.settings?.meshNodeId === node.id || s?.settings?.launchedByCoordinator === true
|
|
57482
|
+
);
|
|
57483
|
+
const targetSession = meshSessions[0] || sessions.find(
|
|
57484
|
+
(s) => !resolvedProviderType || s?.providerType === resolvedProviderType || s?.cliType === resolvedProviderType
|
|
57485
|
+
) || sessions[0];
|
|
57486
|
+
if (targetSession?.id || targetSession?.sessionId) {
|
|
57487
|
+
sessionId = targetSession.id || targetSession.sessionId;
|
|
57488
|
+
if (!resolvedProviderType) {
|
|
57489
|
+
resolvedProviderType = targetSession.providerType || targetSession.cliType || "";
|
|
57490
|
+
}
|
|
57491
|
+
}
|
|
57492
|
+
} catch {
|
|
57493
|
+
}
|
|
57494
|
+
}
|
|
57495
|
+
if (!resolvedProviderType) {
|
|
57496
|
+
return { success: false, error: `Cannot dispatch to remote node '${node.id}': providerType unknown. Set providerPriority on the node policy or call mesh_launch_session first.` };
|
|
57497
|
+
}
|
|
57498
|
+
try {
|
|
57499
|
+
await transport.meshCommand(daemonId, "agent_command", {
|
|
57500
|
+
// Precise match when sessionId known, fuzzy type match otherwise
|
|
57501
|
+
...sessionId ? { targetSessionId: sessionId } : {},
|
|
57502
|
+
agentType: resolvedProviderType,
|
|
57503
|
+
cliType: resolvedProviderType,
|
|
57504
|
+
action: "send_chat",
|
|
57505
|
+
message: args.message
|
|
57506
|
+
});
|
|
57507
|
+
return { success: true, dispatched: true, sessionId: sessionId || resolvedProviderType };
|
|
57508
|
+
} catch (e) {
|
|
57509
|
+
return { success: false, error: `P2P dispatch failed: ${e?.message || String(e)}` };
|
|
57510
|
+
}
|
|
57511
|
+
}
|
|
57469
57512
|
function resolveCoordinatorNode(ctx) {
|
|
57470
57513
|
const preferredNodeId = typeof ctx.mesh.coordinator?.preferredNodeId === "string" ? ctx.mesh.coordinator.preferredNodeId.trim() : "";
|
|
57471
57514
|
if (preferredNodeId) {
|
|
@@ -57898,6 +57941,19 @@ async function meshEnqueueTask(ctx, args) {
|
|
|
57898
57941
|
if (isLocalTransport(ctx.transport)) {
|
|
57899
57942
|
ctx.transport.command("trigger_mesh_queue", { meshId: ctx.mesh.id }).catch(() => {
|
|
57900
57943
|
});
|
|
57944
|
+
if (ctx.transport instanceof IpcTransport) {
|
|
57945
|
+
for (const node of ctx.mesh.nodes) {
|
|
57946
|
+
const isLocalNode = ctx.localMachineId && node.machineId === ctx.localMachineId || ctx.localDaemonId && node.daemonId === ctx.localDaemonId;
|
|
57947
|
+
if (!isLocalNode && node.daemonId) {
|
|
57948
|
+
ctx.transport.meshCommand(
|
|
57949
|
+
node.daemonId,
|
|
57950
|
+
"trigger_mesh_queue",
|
|
57951
|
+
{ meshId: ctx.mesh.id }
|
|
57952
|
+
).catch(() => {
|
|
57953
|
+
});
|
|
57954
|
+
}
|
|
57955
|
+
}
|
|
57956
|
+
}
|
|
57901
57957
|
}
|
|
57902
57958
|
return JSON.stringify({ success: true, taskId: task.id, status: task.status });
|
|
57903
57959
|
} catch (e) {
|
|
@@ -57926,12 +57982,29 @@ async function meshSendTask(ctx, args) {
|
|
|
57926
57982
|
});
|
|
57927
57983
|
return JSON.stringify(res);
|
|
57928
57984
|
}
|
|
57929
|
-
const task = enqueueTask(ctx.mesh.id, args.message, { targetNodeId: args.node_id });
|
|
57930
57985
|
const isLocalNode = ctx.localMachineId && node.machineId === ctx.localMachineId || ctx.localDaemonId && node.daemonId === ctx.localDaemonId;
|
|
57931
57986
|
if (ctx.transport instanceof IpcTransport && node.daemonId && !isLocalNode) {
|
|
57932
|
-
|
|
57987
|
+
const cached2 = meshSessionProviderMetadata.get(meshSessionCacheKey(args.node_id, args.session_id || ""));
|
|
57988
|
+
const result = await ipcDispatchToRemoteAgent(ctx, node, {
|
|
57989
|
+
session_id: args.session_id,
|
|
57990
|
+
message: args.message,
|
|
57991
|
+
providerType: cached2?.providerType
|
|
57933
57992
|
});
|
|
57934
|
-
|
|
57993
|
+
if (result.success) {
|
|
57994
|
+
try {
|
|
57995
|
+
appendLedgerEntry(ctx.mesh.id, {
|
|
57996
|
+
kind: "task_dispatched",
|
|
57997
|
+
nodeId: args.node_id,
|
|
57998
|
+
sessionId: result.sessionId,
|
|
57999
|
+
payload: { message: args.message, via: "p2p_direct" }
|
|
58000
|
+
});
|
|
58001
|
+
} catch {
|
|
58002
|
+
}
|
|
58003
|
+
}
|
|
58004
|
+
return JSON.stringify({ ...result, nodeId: args.node_id });
|
|
58005
|
+
}
|
|
58006
|
+
const task = enqueueTask(ctx.mesh.id, args.message, { targetNodeId: args.node_id });
|
|
58007
|
+
if (isLocalTransport(ctx.transport)) {
|
|
57935
58008
|
ctx.transport.command("trigger_mesh_queue", { meshId: ctx.mesh.id }).catch(() => {
|
|
57936
58009
|
});
|
|
57937
58010
|
}
|