@adhdev/daemon-core 0.9.77-rc.24 → 0.9.77-rc.26
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/dist/index.mjs
CHANGED
|
@@ -1309,13 +1309,18 @@ function formatCompletionMetadata(event) {
|
|
|
1309
1309
|
].filter(Boolean);
|
|
1310
1310
|
return parts.length > 0 ? ` (${parts.join("; ")})` : "";
|
|
1311
1311
|
}
|
|
1312
|
+
function getMeshWithCache(components, meshId) {
|
|
1313
|
+
const localMesh = getMesh(meshId);
|
|
1314
|
+
if (localMesh) return localMesh;
|
|
1315
|
+
return components.router?.getCachedInlineMesh(meshId);
|
|
1316
|
+
}
|
|
1312
1317
|
function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType) {
|
|
1313
1318
|
const task = claimNextTask(meshId, nodeId, sessionId);
|
|
1314
1319
|
if (!task) {
|
|
1315
1320
|
return false;
|
|
1316
1321
|
}
|
|
1317
1322
|
LOG.info("MeshQueue", `Node ${nodeId} (${sessionId}) pulled task ${task.id}`);
|
|
1318
|
-
const mesh =
|
|
1323
|
+
const mesh = getMeshWithCache(components, meshId);
|
|
1319
1324
|
const node = mesh?.nodes.find((n) => n.id === nodeId);
|
|
1320
1325
|
if (node?.daemonId && components.dispatchMeshCommand) {
|
|
1321
1326
|
const isLocalNode = components.cliManager.adapters.has(sessionId);
|
|
@@ -1344,7 +1349,7 @@ function tryAssignQueueTask(components, meshId, nodeId, sessionId, providerType)
|
|
|
1344
1349
|
return true;
|
|
1345
1350
|
}
|
|
1346
1351
|
function triggerMeshQueue(components, meshId) {
|
|
1347
|
-
const mesh =
|
|
1352
|
+
const mesh = getMeshWithCache(components, meshId);
|
|
1348
1353
|
if (!mesh) return;
|
|
1349
1354
|
const cliInstances = components.instanceManager.getByCategory("cli");
|
|
1350
1355
|
for (const inst of cliInstances) {
|
|
@@ -1602,7 +1607,7 @@ function setupMeshEventForwarding(components) {
|
|
|
1602
1607
|
const meshIdFromRuntime = readNonEmptyString(settings.meshNodeFor);
|
|
1603
1608
|
const isMeshDelegate = Boolean(meshIdFromRuntime || settings.launchedByCoordinator);
|
|
1604
1609
|
if (!isMeshDelegate) return;
|
|
1605
|
-
const mesh = meshIdFromRuntime ?
|
|
1610
|
+
const mesh = meshIdFromRuntime ? getMeshWithCache(components, meshIdFromRuntime) : getMeshByRepo(workspace);
|
|
1606
1611
|
const meshId = meshIdFromRuntime || readNonEmptyString(mesh?.id);
|
|
1607
1612
|
if (!meshId) return;
|
|
1608
1613
|
const targetNode = mesh?.nodes?.find((n) => n.workspace === workspace);
|