@adhdev/daemon-core 0.9.77-rc.35 → 0.9.77-rc.37
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 +38 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -7
- 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/cli-adapters/provider-cli-adapter.ts +4 -0
- 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;
|
|
@@ -2926,7 +2932,7 @@ ${lastSnapshot}`;
|
|
|
2926
2932
|
}
|
|
2927
2933
|
getFreshParsedStatusCache() {
|
|
2928
2934
|
const cached = this.parsedStatusCache;
|
|
2929
|
-
if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.screenText === this.lastScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
|
|
2935
|
+
if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBuffer === this.accumulatedRawBuffer && cached.screenText === this.lastScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
|
|
2930
2936
|
return cached.result;
|
|
2931
2937
|
}
|
|
2932
2938
|
return null;
|
|
@@ -4018,7 +4024,7 @@ ${lastSnapshot}`;
|
|
|
4018
4024
|
const screenText = this.readTerminalScreenText();
|
|
4019
4025
|
const parseScreenText = this.getParseScreenText(screenText);
|
|
4020
4026
|
const cached = this.parsedStatusCache;
|
|
4021
|
-
if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.screenText === parseScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
|
|
4027
|
+
if (cached && cached.responseBuffer === this.responseBuffer && cached.currentTurnScope === this.currentTurnScope && cached.recentOutputBuffer === this.recentOutputBuffer && cached.accumulatedBuffer === this.accumulatedBuffer && cached.accumulatedRawBuffer === this.accumulatedRawBuffer && cached.screenText === parseScreenText && cached.currentStatus === this.currentStatus && cached.activeModal === this.activeModal && cached.cliName === this.cliName) {
|
|
4022
4028
|
return cached.result;
|
|
4023
4029
|
}
|
|
4024
4030
|
const parsed = this.runParseSession();
|
|
@@ -4046,6 +4052,7 @@ ${lastSnapshot}`;
|
|
|
4046
4052
|
currentTurnScope: this.currentTurnScope,
|
|
4047
4053
|
recentOutputBuffer: this.recentOutputBuffer,
|
|
4048
4054
|
accumulatedBuffer: this.accumulatedBuffer,
|
|
4055
|
+
accumulatedRawBuffer: this.accumulatedRawBuffer,
|
|
4049
4056
|
screenText: parseScreenText,
|
|
4050
4057
|
currentStatus: this.currentStatus,
|
|
4051
4058
|
activeModal: this.activeModal,
|
|
@@ -4925,6 +4932,7 @@ __export(index_exports, {
|
|
|
4925
4932
|
getLogLevel: () => getLogLevel,
|
|
4926
4933
|
getMesh: () => getMesh,
|
|
4927
4934
|
getMeshByRepo: () => getMeshByRepo,
|
|
4935
|
+
getMeshQueueStats: () => getMeshQueueStats,
|
|
4928
4936
|
getNpmExecOptions: () => getNpmExecOptions,
|
|
4929
4937
|
getQueue: () => getQueue,
|
|
4930
4938
|
getRecentActivity: () => getRecentActivity,
|
|
@@ -21992,7 +22000,9 @@ function resolveHermesMeshCoordinatorSetup(options) {
|
|
|
21992
22000
|
const mcpServer = resolveAdhdevMcpServerLaunch({
|
|
21993
22001
|
meshId: options.meshId,
|
|
21994
22002
|
nodeExecutable: options.nodeExecutable,
|
|
21995
|
-
adhdevMcpEntryPath: options.adhdevMcpEntryPath
|
|
22003
|
+
adhdevMcpEntryPath: options.adhdevMcpEntryPath,
|
|
22004
|
+
adhdevMcpTransport: options.adhdevMcpTransport,
|
|
22005
|
+
adhdevMcpPort: options.adhdevMcpPort
|
|
21996
22006
|
});
|
|
21997
22007
|
if (!mcpServer) {
|
|
21998
22008
|
return {
|
|
@@ -22059,7 +22069,9 @@ function resolveMeshCoordinatorSetup(options) {
|
|
|
22059
22069
|
const mcpServer = resolveAdhdevMcpServerLaunch({
|
|
22060
22070
|
meshId,
|
|
22061
22071
|
nodeExecutable: options.nodeExecutable,
|
|
22062
|
-
adhdevMcpEntryPath: options.adhdevMcpEntryPath
|
|
22072
|
+
adhdevMcpEntryPath: options.adhdevMcpEntryPath,
|
|
22073
|
+
adhdevMcpTransport: options.adhdevMcpTransport,
|
|
22074
|
+
adhdevMcpPort: options.adhdevMcpPort
|
|
22063
22075
|
});
|
|
22064
22076
|
if (!mcpServer) {
|
|
22065
22077
|
return {
|
|
@@ -22133,11 +22145,27 @@ function resolveAdhdevMcpServerLaunch(options) {
|
|
|
22133
22145
|
if (!entryPath) return null;
|
|
22134
22146
|
const nodeExecutable = resolveMcpNodeExecutable(options.nodeExecutable);
|
|
22135
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));
|
|
22136
22152
|
return {
|
|
22137
22153
|
command: nodeExecutable,
|
|
22138
|
-
args
|
|
22154
|
+
args
|
|
22139
22155
|
};
|
|
22140
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
|
+
}
|
|
22141
22169
|
function resolveMcpNodeExecutable(explicitExecutable) {
|
|
22142
22170
|
const explicit = explicitExecutable?.trim();
|
|
22143
22171
|
if (explicit) return explicit;
|
|
@@ -24478,9 +24506,11 @@ ${block}`);
|
|
|
24478
24506
|
args: coordinatorSetup.mcpServer.args
|
|
24479
24507
|
};
|
|
24480
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";
|
|
24481
24511
|
mcpServerEntry.env = {
|
|
24482
24512
|
ADHDEV_INLINE_MESH: JSON.stringify(mesh),
|
|
24483
|
-
ADHDEV_MCP_TRANSPORT: "ipc"
|
|
24513
|
+
ADHDEV_MCP_TRANSPORT: mcpTransport === "local" ? "local" : "ipc"
|
|
24484
24514
|
};
|
|
24485
24515
|
}
|
|
24486
24516
|
try {
|
|
@@ -32699,6 +32729,7 @@ async function shutdownDaemonComponents(components) {
|
|
|
32699
32729
|
getLogLevel,
|
|
32700
32730
|
getMesh,
|
|
32701
32731
|
getMeshByRepo,
|
|
32732
|
+
getMeshQueueStats,
|
|
32702
32733
|
getNpmExecOptions,
|
|
32703
32734
|
getQueue,
|
|
32704
32735
|
getRecentActivity,
|