adhdev 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/dist/cli/index.js CHANGED
@@ -40882,6 +40882,10 @@ var init_router = __esm({
40882
40882
  READ_DEBUG_ENABLED2 = process.argv.includes("--dev") || process.env.ADHDEV_READ_DEBUG === "1";
40883
40883
  DaemonCommandRouter = class {
40884
40884
  deps;
40885
+ /** In-memory cache for cloud-originating meshes passed via inlineMesh.
40886
+ * Allows the MCP server to query mesh data via get_mesh even when
40887
+ * the mesh doesn't exist in the local meshes.json file. */
40888
+ inlineMeshCache = /* @__PURE__ */ new Map();
40885
40889
  constructor(deps) {
40886
40890
  this.deps = deps;
40887
40891
  }
@@ -41530,11 +41534,12 @@ var init_router = __esm({
41530
41534
  try {
41531
41535
  const { getMesh: getMesh3 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
41532
41536
  const mesh = getMesh3(meshId);
41533
- if (!mesh) return { success: false, error: "Mesh not found" };
41534
- return { success: true, mesh };
41535
- } catch (e) {
41536
- return { success: false, error: e.message };
41537
+ if (mesh) return { success: true, mesh };
41538
+ } catch {
41537
41539
  }
41540
+ const cached2 = this.inlineMeshCache.get(meshId);
41541
+ if (cached2) return { success: true, mesh: cached2 };
41542
+ return { success: false, error: "Mesh not found" };
41538
41543
  }
41539
41544
  case "create_mesh": {
41540
41545
  const name = typeof args?.name === "string" ? args.name.trim() : "";
@@ -41597,13 +41602,27 @@ var init_router = __esm({
41597
41602
  let mesh;
41598
41603
  if (args?.inlineMesh && typeof args.inlineMesh === "object") {
41599
41604
  mesh = args.inlineMesh;
41605
+ this.inlineMeshCache.set(meshId, mesh);
41600
41606
  } else {
41601
41607
  const { getMesh: getMesh3 } = await Promise.resolve().then(() => (init_mesh_config(), mesh_config_exports));
41602
41608
  mesh = getMesh3(meshId);
41603
41609
  }
41604
41610
  if (!mesh) return { success: false, error: "Mesh not found" };
41605
41611
  if (!Array.isArray(mesh.nodes) || mesh.nodes.length === 0) return { success: false, error: "No nodes in mesh" };
41606
- const workspace = mesh.nodes[0].workspace;
41612
+ const requestedCoordinatorNodeId = typeof args?.coordinatorNodeId === "string" ? args.coordinatorNodeId.trim() : "";
41613
+ const preferredCoordinatorNodeId = requestedCoordinatorNodeId || (typeof mesh.coordinator?.preferredNodeId === "string" ? mesh.coordinator.preferredNodeId.trim() : "");
41614
+ const coordinatorNode = preferredCoordinatorNodeId ? mesh.nodes.find((node) => node?.id === preferredCoordinatorNodeId || node?.nodeId === preferredCoordinatorNodeId) : mesh.nodes[0];
41615
+ if (!coordinatorNode) {
41616
+ return {
41617
+ success: false,
41618
+ code: "mesh_coordinator_node_not_found",
41619
+ error: `Coordinator node ${preferredCoordinatorNodeId} was not found in mesh`,
41620
+ meshId,
41621
+ cliType
41622
+ };
41623
+ }
41624
+ const workspace = typeof coordinatorNode.workspace === "string" ? coordinatorNode.workspace.trim() : "";
41625
+ if (!workspace) return { success: false, error: "Coordinator node workspace required", meshId, cliType };
41607
41626
  const providerMeta = this.deps.providerLoader.resolve?.(cliType) || this.deps.providerLoader.getMeta(cliType);
41608
41627
  const coordinatorSetup = resolveMeshCoordinatorSetup({
41609
41628
  provider: providerMeta,
@@ -90239,7 +90258,7 @@ var init_adhdev_daemon = __esm({
90239
90258
  init_version();
90240
90259
  init_src();
90241
90260
  init_runtime_defaults();
90242
- pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.72" });
90261
+ pkgVersion = resolvePackageVersion({ injectedVersion: "0.9.74" });
90243
90262
  AdhdevDaemon = class _AdhdevDaemon {
90244
90263
  localHttpServer = null;
90245
90264
  localWss = null;