@adhdev/daemon-standalone 0.9.72 → 0.9.74

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/public/index.html CHANGED
@@ -7,7 +7,7 @@
7
7
  <meta name="description" content="ADHDev self-hosted dashboard for controlling AI agents" />
8
8
  <link rel="icon" href="/otter-logo.png" />
9
9
  <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap" rel="stylesheet" />
10
- <script type="module" crossorigin src="/assets/index-BhyF9G2f.js"></script>
10
+ <script type="module" crossorigin src="/assets/index-Bu3OpXMi.js"></script>
11
11
  <link rel="modulepreload" crossorigin href="/assets/vendor-CLec0455.js">
12
12
  <link rel="stylesheet" crossorigin href="/assets/index-CVquu5qt.css">
13
13
  </head>
@@ -47512,6 +47512,10 @@ Run 'adhdev doctor' for detailed diagnostics.`
47512
47512
  READ_DEBUG_ENABLED2 = process.argv.includes("--dev") || process.env.ADHDEV_READ_DEBUG === "1";
47513
47513
  DaemonCommandRouter = class {
47514
47514
  deps;
47515
+ /** In-memory cache for cloud-originating meshes passed via inlineMesh.
47516
+ * Allows the MCP server to query mesh data via get_mesh even when
47517
+ * the mesh doesn't exist in the local meshes.json file. */
47518
+ inlineMeshCache = /* @__PURE__ */ new Map();
47515
47519
  constructor(deps) {
47516
47520
  this.deps = deps;
47517
47521
  }
@@ -48160,11 +48164,12 @@ Run 'adhdev doctor' for detailed diagnostics.`
48160
48164
  try {
48161
48165
  const { getMesh: getMesh3 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
48162
48166
  const mesh = getMesh3(meshId);
48163
- if (!mesh) return { success: false, error: "Mesh not found" };
48164
- return { success: true, mesh };
48165
- } catch (e) {
48166
- return { success: false, error: e.message };
48167
+ if (mesh) return { success: true, mesh };
48168
+ } catch {
48167
48169
  }
48170
+ const cached2 = this.inlineMeshCache.get(meshId);
48171
+ if (cached2) return { success: true, mesh: cached2 };
48172
+ return { success: false, error: "Mesh not found" };
48168
48173
  }
48169
48174
  case "create_mesh": {
48170
48175
  const name = typeof args?.name === "string" ? args.name.trim() : "";
@@ -48227,13 +48232,27 @@ Run 'adhdev doctor' for detailed diagnostics.`
48227
48232
  let mesh;
48228
48233
  if (args?.inlineMesh && typeof args.inlineMesh === "object") {
48229
48234
  mesh = args.inlineMesh;
48235
+ this.inlineMeshCache.set(meshId, mesh);
48230
48236
  } else {
48231
48237
  const { getMesh: getMesh3 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
48232
48238
  mesh = getMesh3(meshId);
48233
48239
  }
48234
48240
  if (!mesh) return { success: false, error: "Mesh not found" };
48235
48241
  if (!Array.isArray(mesh.nodes) || mesh.nodes.length === 0) return { success: false, error: "No nodes in mesh" };
48236
- const workspace = mesh.nodes[0].workspace;
48242
+ const requestedCoordinatorNodeId = typeof args?.coordinatorNodeId === "string" ? args.coordinatorNodeId.trim() : "";
48243
+ const preferredCoordinatorNodeId = requestedCoordinatorNodeId || (typeof mesh.coordinator?.preferredNodeId === "string" ? mesh.coordinator.preferredNodeId.trim() : "");
48244
+ const coordinatorNode = preferredCoordinatorNodeId ? mesh.nodes.find((node) => node?.id === preferredCoordinatorNodeId || node?.nodeId === preferredCoordinatorNodeId) : mesh.nodes[0];
48245
+ if (!coordinatorNode) {
48246
+ return {
48247
+ success: false,
48248
+ code: "mesh_coordinator_node_not_found",
48249
+ error: `Coordinator node ${preferredCoordinatorNodeId} was not found in mesh`,
48250
+ meshId,
48251
+ cliType
48252
+ };
48253
+ }
48254
+ const workspace = typeof coordinatorNode.workspace === "string" ? coordinatorNode.workspace.trim() : "";
48255
+ if (!workspace) return { success: false, error: "Coordinator node workspace required", meshId, cliType };
48237
48256
  const providerMeta = this.deps.providerLoader.resolve?.(cliType) || this.deps.providerLoader.getMeta(cliType);
48238
48257
  const coordinatorSetup = resolveMeshCoordinatorSetup({
48239
48258
  provider: providerMeta,
@@ -53405,9 +53424,21 @@ async function startMcpServer(opts) {
53405
53424
  const { getMesh: getMesh2 } = await Promise.resolve().then(() => (init_dist2(), dist_exports));
53406
53425
  mesh = getMesh2(opts.meshId);
53407
53426
  } catch (e) {
53408
- process.stderr.write(`[adhdev-mcp] Failed to load mesh config: ${e.message}
53427
+ process.stderr.write(`[adhdev-mcp] Local meshes.json lookup failed: ${e.message}
53428
+ `);
53429
+ }
53430
+ }
53431
+ if (!mesh && transport instanceof LocalTransport) {
53432
+ try {
53433
+ const result = await transport.command("get_mesh", { meshId: opts.meshId });
53434
+ if (result?.success && result.mesh) {
53435
+ mesh = result.mesh;
53436
+ process.stderr.write(`[adhdev-mcp] Loaded mesh config from daemon
53437
+ `);
53438
+ }
53439
+ } catch (e) {
53440
+ process.stderr.write(`[adhdev-mcp] Daemon mesh query failed: ${e.message}
53409
53441
  `);
53410
- process.exit(1);
53411
53442
  }
53412
53443
  }
53413
53444
  if (!mesh) {
@@ -53424,7 +53455,7 @@ async function startMcpServer(opts) {
53424
53455
  coordinatorPrompt = `You are a Repo Mesh Coordinator for "${mesh.name}" (${mesh.repoIdentity}). Use mesh_* tools to orchestrate work.`;
53425
53456
  }
53426
53457
  const server2 = new import_server.Server(
53427
- { name: "adhdev-mcp-server", version: "0.9.72" },
53458
+ { name: "adhdev-mcp-server", version: "0.9.74" },
53428
53459
  { capabilities: { tools: {}, resources: {} } }
53429
53460
  );
53430
53461
  const { ListResourcesRequestSchema, ReadResourceRequestSchema } = await import("@modelcontextprotocol/sdk/types.js");