@adhdev/daemon-core 0.9.77-rc.23 → 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/dist/commands/router.d.ts +1 -1
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/router.ts +1 -1
- package/src/mesh/mesh-events.ts +10 -3
package/package.json
CHANGED
package/src/commands/router.ts
CHANGED
|
@@ -332,7 +332,7 @@ export class DaemonCommandRouter {
|
|
|
332
332
|
this.deps = deps;
|
|
333
333
|
}
|
|
334
334
|
|
|
335
|
-
|
|
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;
|
package/src/mesh/mesh-events.ts
CHANGED
|
@@ -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 =
|
|
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 =
|
|
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 ?
|
|
454
|
+
const mesh = meshIdFromRuntime ? getMeshWithCache(components, meshIdFromRuntime) : getMeshByRepo(workspace);
|
|
448
455
|
const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
|
|
449
456
|
if (!meshId) return;
|
|
450
457
|
|