@adhdev/daemon-core 0.9.77-rc.36 → 0.9.77-rc.38
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/commands/mesh-coordinator.d.ts +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +35 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +34 -5
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-work-queue.d.ts +6 -0
- package/dist/shared-types.d.ts +14 -0
- package/package.json +1 -1
- package/src/commands/mesh-coordinator.ts +27 -1
- package/src/commands/router.ts +3 -1
- package/src/index.ts +2 -2
- package/src/mesh/mesh-work-queue.ts +14 -0
- package/src/shared-types.ts +14 -0
|
@@ -37,6 +37,8 @@ export interface ResolveMeshCoordinatorSetupOptions {
|
|
|
37
37
|
adhdevMcpCommand?: string;
|
|
38
38
|
adhdevMcpEntryPath?: string;
|
|
39
39
|
nodeExecutable?: string;
|
|
40
|
+
adhdevMcpTransport?: 'local' | 'ipc';
|
|
41
|
+
adhdevMcpPort?: number;
|
|
40
42
|
}
|
|
41
43
|
export declare function createHermesManualMeshCoordinatorSetup(meshId: string, workspace: string): MeshCoordinatorSetup;
|
|
42
44
|
export declare function resolveMeshCoordinatorSetup(options: ResolveMeshCoordinatorSetupOptions): MeshCoordinatorSetup;
|
package/dist/index.d.ts
CHANGED
|
@@ -33,8 +33,8 @@ export { syncMeshes } from './mesh/mesh-sync.js';
|
|
|
33
33
|
export type { MeshSyncTransport, MeshSyncResult, RemoteMeshRecord } from './mesh/mesh-sync.js';
|
|
34
34
|
export { appendLedgerEntry, readLedgerEntries, getLedgerSummary, getLedgerDir, getSessionRecoveryContext } from './mesh/mesh-ledger.js';
|
|
35
35
|
export type { MeshLedgerEntry, MeshLedgerKind, MeshLedgerSummary, ReadLedgerOptions, SessionRecoveryContext } from './mesh/mesh-ledger.js';
|
|
36
|
-
export { enqueueTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus, cancelTask, requeueTask } from './mesh/mesh-work-queue.js';
|
|
37
|
-
export type { MeshWorkQueueEntry, MeshTaskStatus } from './mesh/mesh-work-queue.js';
|
|
36
|
+
export { enqueueTask, getQueue, claimNextTask, updateTaskStatus, updateSessionTaskStatus, cancelTask, requeueTask, getMeshQueueStats } from './mesh/mesh-work-queue.js';
|
|
37
|
+
export type { MeshWorkQueueEntry, MeshTaskStatus, MeshWorkQueueStats } from './mesh/mesh-work-queue.js';
|
|
38
38
|
export { triggerMeshQueue } from './mesh/mesh-events.js';
|
|
39
39
|
export { loadState, saveState, resetState } from './config/state-store.js';
|
|
40
40
|
export type { DaemonState } from './config/state-store.js';
|
package/dist/index.js
CHANGED
|
@@ -1113,7 +1113,13 @@ function getMeshQueueStats(meshId) {
|
|
|
1113
1113
|
assigned: queue.filter((q) => q.status === "assigned").length,
|
|
1114
1114
|
completed: queue.filter((q) => q.status === "completed").length,
|
|
1115
1115
|
failed: queue.filter((q) => q.status === "failed").length,
|
|
1116
|
-
cancelled: queue.filter((q) => q.status === "cancelled").length
|
|
1116
|
+
cancelled: queue.filter((q) => q.status === "cancelled").length,
|
|
1117
|
+
activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
|
|
1118
|
+
id: q.id,
|
|
1119
|
+
nodeId: q.assignedNodeId,
|
|
1120
|
+
sessionId: q.assignedSessionId,
|
|
1121
|
+
message: q.message
|
|
1122
|
+
}))
|
|
1117
1123
|
};
|
|
1118
1124
|
}
|
|
1119
1125
|
var import_fs4, import_path4, import_crypto5;
|
|
@@ -4926,6 +4932,7 @@ __export(index_exports, {
|
|
|
4926
4932
|
getLogLevel: () => getLogLevel,
|
|
4927
4933
|
getMesh: () => getMesh,
|
|
4928
4934
|
getMeshByRepo: () => getMeshByRepo,
|
|
4935
|
+
getMeshQueueStats: () => getMeshQueueStats,
|
|
4929
4936
|
getNpmExecOptions: () => getNpmExecOptions,
|
|
4930
4937
|
getQueue: () => getQueue,
|
|
4931
4938
|
getRecentActivity: () => getRecentActivity,
|
|
@@ -21993,7 +22000,9 @@ function resolveHermesMeshCoordinatorSetup(options) {
|
|
|
21993
22000
|
const mcpServer = resolveAdhdevMcpServerLaunch({
|
|
21994
22001
|
meshId: options.meshId,
|
|
21995
22002
|
nodeExecutable: options.nodeExecutable,
|
|
21996
|
-
adhdevMcpEntryPath: options.adhdevMcpEntryPath
|
|
22003
|
+
adhdevMcpEntryPath: options.adhdevMcpEntryPath,
|
|
22004
|
+
adhdevMcpTransport: options.adhdevMcpTransport,
|
|
22005
|
+
adhdevMcpPort: options.adhdevMcpPort
|
|
21997
22006
|
});
|
|
21998
22007
|
if (!mcpServer) {
|
|
21999
22008
|
return {
|
|
@@ -22060,7 +22069,9 @@ function resolveMeshCoordinatorSetup(options) {
|
|
|
22060
22069
|
const mcpServer = resolveAdhdevMcpServerLaunch({
|
|
22061
22070
|
meshId,
|
|
22062
22071
|
nodeExecutable: options.nodeExecutable,
|
|
22063
|
-
adhdevMcpEntryPath: options.adhdevMcpEntryPath
|
|
22072
|
+
adhdevMcpEntryPath: options.adhdevMcpEntryPath,
|
|
22073
|
+
adhdevMcpTransport: options.adhdevMcpTransport,
|
|
22074
|
+
adhdevMcpPort: options.adhdevMcpPort
|
|
22064
22075
|
});
|
|
22065
22076
|
if (!mcpServer) {
|
|
22066
22077
|
return {
|
|
@@ -22134,11 +22145,27 @@ function resolveAdhdevMcpServerLaunch(options) {
|
|
|
22134
22145
|
if (!entryPath) return null;
|
|
22135
22146
|
const nodeExecutable = resolveMcpNodeExecutable(options.nodeExecutable);
|
|
22136
22147
|
if (!nodeExecutable) return null;
|
|
22148
|
+
const transport = resolveMcpTransport(options.adhdevMcpTransport);
|
|
22149
|
+
const args = [entryPath, "--mode", transport, "--repo-mesh", options.meshId];
|
|
22150
|
+
const port = resolveMcpPort(options.adhdevMcpPort);
|
|
22151
|
+
if (port !== void 0) args.push("--port", String(port));
|
|
22137
22152
|
return {
|
|
22138
22153
|
command: nodeExecutable,
|
|
22139
|
-
args
|
|
22154
|
+
args
|
|
22140
22155
|
};
|
|
22141
22156
|
}
|
|
22157
|
+
function resolveMcpTransport(explicitTransport) {
|
|
22158
|
+
if (explicitTransport === "local" || explicitTransport === "ipc") return explicitTransport;
|
|
22159
|
+
const envTransport = process.env.ADHDEV_COORDINATOR_MCP_TRANSPORT?.trim();
|
|
22160
|
+
return envTransport === "local" ? "local" : "ipc";
|
|
22161
|
+
}
|
|
22162
|
+
function resolveMcpPort(explicitPort) {
|
|
22163
|
+
if (typeof explicitPort === "number" && Number.isInteger(explicitPort) && explicitPort > 0) return explicitPort;
|
|
22164
|
+
const raw = process.env.ADHDEV_COORDINATOR_MCP_PORT?.trim();
|
|
22165
|
+
if (!raw) return void 0;
|
|
22166
|
+
const parsed = Number(raw);
|
|
22167
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : void 0;
|
|
22168
|
+
}
|
|
22142
22169
|
function resolveMcpNodeExecutable(explicitExecutable) {
|
|
22143
22170
|
const explicit = explicitExecutable?.trim();
|
|
22144
22171
|
if (explicit) return explicit;
|
|
@@ -24479,9 +24506,11 @@ ${block}`);
|
|
|
24479
24506
|
args: coordinatorSetup.mcpServer.args
|
|
24480
24507
|
};
|
|
24481
24508
|
if (args?.inlineMesh) {
|
|
24509
|
+
const modeArgIndex = coordinatorSetup.mcpServer.args.findIndex((value) => value === "--mode");
|
|
24510
|
+
const mcpTransport = modeArgIndex >= 0 ? coordinatorSetup.mcpServer.args[modeArgIndex + 1] : "ipc";
|
|
24482
24511
|
mcpServerEntry.env = {
|
|
24483
24512
|
ADHDEV_INLINE_MESH: JSON.stringify(mesh),
|
|
24484
|
-
ADHDEV_MCP_TRANSPORT: "ipc"
|
|
24513
|
+
ADHDEV_MCP_TRANSPORT: mcpTransport === "local" ? "local" : "ipc"
|
|
24485
24514
|
};
|
|
24486
24515
|
}
|
|
24487
24516
|
try {
|
|
@@ -32700,6 +32729,7 @@ async function shutdownDaemonComponents(components) {
|
|
|
32700
32729
|
getLogLevel,
|
|
32701
32730
|
getMesh,
|
|
32702
32731
|
getMeshByRepo,
|
|
32732
|
+
getMeshQueueStats,
|
|
32703
32733
|
getNpmExecOptions,
|
|
32704
32734
|
getQueue,
|
|
32705
32735
|
getRecentActivity,
|