@adhdev/daemon-core 0.9.73 → 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/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -194,6 +194,10 @@ function summarizeSessionHostPruneResult(result: unknown): Record<string, unknow
|
|
|
194
194
|
|
|
195
195
|
export class DaemonCommandRouter {
|
|
196
196
|
private deps: CommandRouterDeps;
|
|
197
|
+
/** In-memory cache for cloud-originating meshes passed via inlineMesh.
|
|
198
|
+
* Allows the MCP server to query mesh data via get_mesh even when
|
|
199
|
+
* the mesh doesn't exist in the local meshes.json file. */
|
|
200
|
+
private inlineMeshCache = new Map<string, any>();
|
|
197
201
|
|
|
198
202
|
constructor(deps: CommandRouterDeps) {
|
|
199
203
|
this.deps = deps;
|
|
@@ -937,11 +941,12 @@ export class DaemonCommandRouter {
|
|
|
937
941
|
try {
|
|
938
942
|
const { getMesh } = await import('../config/mesh-config.js');
|
|
939
943
|
const mesh = getMesh(meshId);
|
|
940
|
-
if (
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
}
|
|
944
|
+
if (mesh) return { success: true, mesh };
|
|
945
|
+
} catch { /* fall through to inline cache */ }
|
|
946
|
+
// Fallback: check in-memory cache for cloud-originating meshes
|
|
947
|
+
const cached = this.inlineMeshCache.get(meshId);
|
|
948
|
+
if (cached) return { success: true, mesh: cached };
|
|
949
|
+
return { success: false, error: 'Mesh not found' };
|
|
945
950
|
}
|
|
946
951
|
|
|
947
952
|
case 'create_mesh': {
|
|
@@ -1012,6 +1017,8 @@ export class DaemonCommandRouter {
|
|
|
1012
1017
|
let mesh: any;
|
|
1013
1018
|
if (args?.inlineMesh && typeof args.inlineMesh === 'object') {
|
|
1014
1019
|
mesh = args.inlineMesh;
|
|
1020
|
+
// Cache cloud mesh so the MCP server can retrieve it via get_mesh
|
|
1021
|
+
this.inlineMeshCache.set(meshId, mesh);
|
|
1015
1022
|
} else {
|
|
1016
1023
|
const { getMesh } = await import('../config/mesh-config.js');
|
|
1017
1024
|
mesh = getMesh(meshId);
|