@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/index.mjs CHANGED
@@ -1111,7 +1111,13 @@ function getMeshQueueStats(meshId) {
1111
1111
  assigned: queue.filter((q) => q.status === "assigned").length,
1112
1112
  completed: queue.filter((q) => q.status === "completed").length,
1113
1113
  failed: queue.filter((q) => q.status === "failed").length,
1114
- cancelled: queue.filter((q) => q.status === "cancelled").length
1114
+ cancelled: queue.filter((q) => q.status === "cancelled").length,
1115
+ activeAssignments: queue.filter((q) => q.status === "assigned").map((q) => ({
1116
+ id: q.id,
1117
+ nodeId: q.assignedNodeId,
1118
+ sessionId: q.assignedSessionId,
1119
+ message: q.message
1120
+ }))
1115
1121
  };
1116
1122
  }
1117
1123
  var init_mesh_work_queue = __esm({
@@ -2922,7 +2928,7 @@ ${lastSnapshot}`;
2922
2928
  }
2923
2929
  getFreshParsedStatusCache() {
2924
2930
  const cached = this.parsedStatusCache;
2925
- 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) {
2931
+ 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) {
2926
2932
  return cached.result;
2927
2933
  }
2928
2934
  return null;
@@ -4014,7 +4020,7 @@ ${lastSnapshot}`;
4014
4020
  const screenText = this.readTerminalScreenText();
4015
4021
  const parseScreenText = this.getParseScreenText(screenText);
4016
4022
  const cached = this.parsedStatusCache;
4017
- 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) {
4023
+ 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) {
4018
4024
  return cached.result;
4019
4025
  }
4020
4026
  const parsed = this.runParseSession();
@@ -4042,6 +4048,7 @@ ${lastSnapshot}`;
4042
4048
  currentTurnScope: this.currentTurnScope,
4043
4049
  recentOutputBuffer: this.recentOutputBuffer,
4044
4050
  accumulatedBuffer: this.accumulatedBuffer,
4051
+ accumulatedRawBuffer: this.accumulatedRawBuffer,
4045
4052
  screenText: parseScreenText,
4046
4053
  currentStatus: this.currentStatus,
4047
4054
  activeModal: this.activeModal,
@@ -21773,7 +21780,9 @@ function resolveHermesMeshCoordinatorSetup(options) {
21773
21780
  const mcpServer = resolveAdhdevMcpServerLaunch({
21774
21781
  meshId: options.meshId,
21775
21782
  nodeExecutable: options.nodeExecutable,
21776
- adhdevMcpEntryPath: options.adhdevMcpEntryPath
21783
+ adhdevMcpEntryPath: options.adhdevMcpEntryPath,
21784
+ adhdevMcpTransport: options.adhdevMcpTransport,
21785
+ adhdevMcpPort: options.adhdevMcpPort
21777
21786
  });
21778
21787
  if (!mcpServer) {
21779
21788
  return {
@@ -21840,7 +21849,9 @@ function resolveMeshCoordinatorSetup(options) {
21840
21849
  const mcpServer = resolveAdhdevMcpServerLaunch({
21841
21850
  meshId,
21842
21851
  nodeExecutable: options.nodeExecutable,
21843
- adhdevMcpEntryPath: options.adhdevMcpEntryPath
21852
+ adhdevMcpEntryPath: options.adhdevMcpEntryPath,
21853
+ adhdevMcpTransport: options.adhdevMcpTransport,
21854
+ adhdevMcpPort: options.adhdevMcpPort
21844
21855
  });
21845
21856
  if (!mcpServer) {
21846
21857
  return {
@@ -21914,11 +21925,27 @@ function resolveAdhdevMcpServerLaunch(options) {
21914
21925
  if (!entryPath) return null;
21915
21926
  const nodeExecutable = resolveMcpNodeExecutable(options.nodeExecutable);
21916
21927
  if (!nodeExecutable) return null;
21928
+ const transport = resolveMcpTransport(options.adhdevMcpTransport);
21929
+ const args = [entryPath, "--mode", transport, "--repo-mesh", options.meshId];
21930
+ const port = resolveMcpPort(options.adhdevMcpPort);
21931
+ if (port !== void 0) args.push("--port", String(port));
21917
21932
  return {
21918
21933
  command: nodeExecutable,
21919
- args: [entryPath, "--mode", "ipc", "--repo-mesh", options.meshId]
21934
+ args
21920
21935
  };
21921
21936
  }
21937
+ function resolveMcpTransport(explicitTransport) {
21938
+ if (explicitTransport === "local" || explicitTransport === "ipc") return explicitTransport;
21939
+ const envTransport = process.env.ADHDEV_COORDINATOR_MCP_TRANSPORT?.trim();
21940
+ return envTransport === "local" ? "local" : "ipc";
21941
+ }
21942
+ function resolveMcpPort(explicitPort) {
21943
+ if (typeof explicitPort === "number" && Number.isInteger(explicitPort) && explicitPort > 0) return explicitPort;
21944
+ const raw = process.env.ADHDEV_COORDINATOR_MCP_PORT?.trim();
21945
+ if (!raw) return void 0;
21946
+ const parsed = Number(raw);
21947
+ return Number.isInteger(parsed) && parsed > 0 ? parsed : void 0;
21948
+ }
21922
21949
  function resolveMcpNodeExecutable(explicitExecutable) {
21923
21950
  const explicit = explicitExecutable?.trim();
21924
21951
  if (explicit) return explicit;
@@ -24259,9 +24286,11 @@ ${block}`);
24259
24286
  args: coordinatorSetup.mcpServer.args
24260
24287
  };
24261
24288
  if (args?.inlineMesh) {
24289
+ const modeArgIndex = coordinatorSetup.mcpServer.args.findIndex((value) => value === "--mode");
24290
+ const mcpTransport = modeArgIndex >= 0 ? coordinatorSetup.mcpServer.args[modeArgIndex + 1] : "ipc";
24262
24291
  mcpServerEntry.env = {
24263
24292
  ADHDEV_INLINE_MESH: JSON.stringify(mesh),
24264
- ADHDEV_MCP_TRANSPORT: "ipc"
24293
+ ADHDEV_MCP_TRANSPORT: mcpTransport === "local" ? "local" : "ipc"
24265
24294
  };
24266
24295
  }
24267
24296
  try {
@@ -32484,6 +32513,7 @@ export {
32484
32513
  getLogLevel,
32485
32514
  getMesh,
32486
32515
  getMeshByRepo,
32516
+ getMeshQueueStats,
32487
32517
  getNpmExecOptions,
32488
32518
  getQueue,
32489
32519
  getRecentActivity,