@adhdev/daemon-core 0.9.77-rc.24 → 0.9.77-rc.25

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.77-rc.24",
3
+ "version": "0.9.77-rc.25",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -332,7 +332,7 @@ export class DaemonCommandRouter {
332
332
  this.deps = deps;
333
333
  }
334
334
 
335
- private getCachedInlineMesh(meshId: string, inlineMesh?: unknown): any | undefined {
335
+ public getCachedInlineMesh(meshId: string, inlineMesh?: unknown): any | undefined {
336
336
  if (inlineMesh && typeof inlineMesh === 'object') {
337
337
  this.inlineMeshCache.set(meshId, inlineMesh as any);
338
338
  return inlineMesh as any;
@@ -74,6 +74,13 @@ function formatCompletionMetadata(event: Record<string, unknown>): string {
74
74
  return parts.length > 0 ? ` (${parts.join('; ')})` : '';
75
75
  }
76
76
 
77
+ function getMeshWithCache(components: DaemonComponents, meshId: string): any | undefined {
78
+ const localMesh = getMesh(meshId);
79
+ if (localMesh) return localMesh;
80
+ return components.router?.getCachedInlineMesh(meshId);
81
+ }
82
+
83
+
77
84
  export function tryAssignQueueTask(
78
85
  components: DaemonComponents,
79
86
  meshId: string,
@@ -89,7 +96,7 @@ export function tryAssignQueueTask(
89
96
  LOG.info('MeshQueue', `Node ${nodeId} (${sessionId}) pulled task ${task.id}`);
90
97
 
91
98
  // Check if the node is remote
92
- const mesh = getMesh(meshId);
99
+ const mesh = getMeshWithCache(components, meshId);
93
100
  const node = mesh?.nodes.find((n: any) => n.id === nodeId);
94
101
 
95
102
  // If the node is explicitly remote and we have a dispatch mechanism, route via P2P
@@ -128,7 +135,7 @@ export function tryAssignQueueTask(
128
135
  * Called when a new task is enqueued, in case nodes are already idle.
129
136
  */
130
137
  export function triggerMeshQueue(components: DaemonComponents, meshId: string) {
131
- const mesh = getMesh(meshId);
138
+ const mesh = getMeshWithCache(components, meshId);
132
139
  if (!mesh) return;
133
140
 
134
141
  // Find all CLI instances that belong to this mesh and are idle
@@ -444,7 +451,7 @@ export function setupMeshEventForwarding(components: DaemonComponents) {
444
451
  const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
445
452
  if (!isMeshDelegate) return;
446
453
 
447
- const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
454
+ const mesh = meshIdFromRuntime ? getMeshWithCache(components, meshIdFromRuntime) : getMeshByRepo(workspace);
448
455
  const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
449
456
  if (!meshId) return;
450
457