@adhdev/daemon-core 0.9.82-rc.232 → 0.9.82-rc.234
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/index.js +11 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/mesh/mesh-events-coordinator.ts +10 -3
package/package.json
CHANGED
|
@@ -258,11 +258,18 @@ export function tryAssignQueueTask(
|
|
|
258
258
|
message: task.message,
|
|
259
259
|
status: 'delivering',
|
|
260
260
|
});
|
|
261
|
+
const localDaemonIdForDispatch = readNonEmptyString(loadConfig().machineId) || undefined;
|
|
261
262
|
components.dispatchMeshCommand(node.daemonId, 'agent_command', {
|
|
262
263
|
targetSessionId: sessionId,
|
|
263
264
|
cliType: providerType,
|
|
264
265
|
action: 'send_chat',
|
|
265
266
|
message: task.message,
|
|
267
|
+
meshContext: {
|
|
268
|
+
meshId,
|
|
269
|
+
nodeId,
|
|
270
|
+
taskId: task.id,
|
|
271
|
+
...(localDaemonIdForDispatch ? { coordinatorDaemonId: localDaemonIdForDispatch } : {}),
|
|
272
|
+
},
|
|
266
273
|
}).then(() => {
|
|
267
274
|
updateSessionDeliveryStatus(delivery.id, 'delivered');
|
|
268
275
|
}).catch((e: any) => {
|
|
@@ -1311,7 +1318,7 @@ function injectMeshSystemMessage(components: DaemonComponents, args: {
|
|
|
1311
1318
|
return true;
|
|
1312
1319
|
});
|
|
1313
1320
|
|
|
1314
|
-
const
|
|
1321
|
+
const isTerminalEvent = new Set(['refine:completed', 'refine:failed', 'agent:generating_completed', 'agent:stopped']).has(args.event);
|
|
1315
1322
|
|
|
1316
1323
|
if (coordinatorInstances.length === 0) {
|
|
1317
1324
|
if (queuePendingMeshCoordinatorEvent({
|
|
@@ -1333,7 +1340,7 @@ function injectMeshSystemMessage(components: DaemonComponents, args: {
|
|
|
1333
1340
|
return { success: true, forwarded: 0 };
|
|
1334
1341
|
}
|
|
1335
1342
|
|
|
1336
|
-
const allCoordinatorsGenerating =
|
|
1343
|
+
const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((inst) => {
|
|
1337
1344
|
const s = inst.getState();
|
|
1338
1345
|
const status = readNonEmptyString(s.status).toLowerCase();
|
|
1339
1346
|
const activeChatStatus = readNonEmptyString(s.activeChat?.status).toLowerCase();
|
|
@@ -1341,7 +1348,7 @@ function injectMeshSystemMessage(components: DaemonComponents, args: {
|
|
|
1341
1348
|
|| activeChatStatus === 'generating' || activeChatStatus === 'streaming';
|
|
1342
1349
|
});
|
|
1343
1350
|
|
|
1344
|
-
if (!
|
|
1351
|
+
if (!isTerminalEvent || allCoordinatorsGenerating) {
|
|
1345
1352
|
if (queuePendingMeshCoordinatorEvent({
|
|
1346
1353
|
event: args.event,
|
|
1347
1354
|
meshId: args.meshId,
|