@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.
@@ -84,7 +84,7 @@ export declare class DaemonCommandRouter {
84
84
  * the mesh doesn't exist in the local meshes.json file. */
85
85
  private inlineMeshCache;
86
86
  constructor(deps: CommandRouterDeps);
87
- private getCachedInlineMesh;
87
+ getCachedInlineMesh(meshId: string, inlineMesh?: unknown): any | undefined;
88
88
  private getMeshForCommand;
89
89
  private updateInlineMeshNode;
90
90
  private removeInlineMeshNode;
package/dist/index.js CHANGED
@@ -1315,13 +1315,18 @@ function formatCompletionMetadata(event) {
1315
1315
  ].filter(Boolean);
1316
1316
  return parts.length > 0 ? ` (${parts.join("; ")})` : "";
1317
1317
  }
1318
+ function getMeshWithCache(components, meshId) {
1319
+ const localMesh = getMesh(meshId);
1320
+ if (localMesh) return localMesh;
1321
+ return components.router?.getCachedInlineMesh(meshId);
1322
+ }
1318
1323
  function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType) {
1319
1324
  const task = claimNextTask(meshId, nodeId, sessionId);
1320
1325
  if (!task) {
1321
1326
  return false;
1322
1327
  }
1323
1328
  LOG.info("MeshQueue", `Node ${nodeId} (${sessionId}) pulled task ${task.id}`);
1324
- const mesh = getMesh(meshId);
1329
+ const mesh = getMeshWithCache(components, meshId);
1325
1330
  const node = mesh?.nodes.find((n) => n.id === nodeId);
1326
1331
  if (node?.daemonId && components.dispatchMeshCommand) {
1327
1332
  const isLocalNode = components.cliManager.adapters.has(sessionId);
@@ -1350,7 +1355,7 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
1350
1355
  return true;
1351
1356
  }
1352
1357
  function triggerMeshQueue(components, meshId) {
1353
- const mesh = getMesh(meshId);
1358
+ const mesh = getMeshWithCache(components, meshId);
1354
1359
  if (!mesh) return;
1355
1360
  const cliInstances = components.instanceManager.getByCategory("cli");
1356
1361
  for (const inst of cliInstances) {
@@ -1608,7 +1613,7 @@ function setupMeshEventForwarding(components) {
1608
1613
  const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
1609
1614
  const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
1610
1615
  if (!isMeshDelegate) return;
1611
- const mesh = meshIdFromRuntime ? getMesh(meshIdFromRuntime) : getMeshByRepo(workspace);
1616
+ const mesh = meshIdFromRuntime ? getMeshWithCache(components, meshIdFromRuntime) : getMeshByRepo(workspace);
1612
1617
  const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
1613
1618
  if (!meshId) return;
1614
1619
  const targetNode = mesh?.nodes?.find((n) => n.workspace === workspace);