@adhdev/daemon-core 0.9.82-rc.246 → 0.9.82-rc.248
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 +16 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -2
- package/dist/index.mjs.map +1 -1
- package/dist/mesh/mesh-events-coordinator.d.ts +21 -0
- package/package.json +1 -1
- package/src/mesh/mesh-events-coordinator.ts +21 -2
|
@@ -39,6 +39,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
39
39
|
duplicateCompletion?: undefined;
|
|
40
40
|
duplicateStopped?: undefined;
|
|
41
41
|
error?: undefined;
|
|
42
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
42
43
|
} | {
|
|
43
44
|
success: boolean;
|
|
44
45
|
forwarded: number;
|
|
@@ -51,6 +52,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
51
52
|
duplicateCompletion?: undefined;
|
|
52
53
|
duplicateStopped?: undefined;
|
|
53
54
|
error?: undefined;
|
|
55
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
54
56
|
} | {
|
|
55
57
|
success: boolean;
|
|
56
58
|
forwarded: number;
|
|
@@ -63,6 +65,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
63
65
|
duplicateCompletion?: undefined;
|
|
64
66
|
duplicateStopped?: undefined;
|
|
65
67
|
error?: undefined;
|
|
68
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
66
69
|
} | {
|
|
67
70
|
success: boolean;
|
|
68
71
|
forwarded: number;
|
|
@@ -75,6 +78,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
75
78
|
duplicateCompletion?: undefined;
|
|
76
79
|
duplicateStopped?: undefined;
|
|
77
80
|
error?: undefined;
|
|
81
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
78
82
|
} | {
|
|
79
83
|
success: boolean;
|
|
80
84
|
forwarded: number;
|
|
@@ -87,6 +91,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
87
91
|
duplicateApproval?: undefined;
|
|
88
92
|
duplicateStopped?: undefined;
|
|
89
93
|
error?: undefined;
|
|
94
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
90
95
|
} | {
|
|
91
96
|
success: boolean;
|
|
92
97
|
forwarded: number;
|
|
@@ -99,6 +104,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
99
104
|
duplicateApproval?: undefined;
|
|
100
105
|
duplicateStopped?: undefined;
|
|
101
106
|
error?: undefined;
|
|
107
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
102
108
|
} | {
|
|
103
109
|
success: boolean;
|
|
104
110
|
forwarded: number;
|
|
@@ -111,6 +117,7 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
111
117
|
duplicateApproval?: undefined;
|
|
112
118
|
duplicateCompletion?: undefined;
|
|
113
119
|
error?: undefined;
|
|
120
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
114
121
|
} | {
|
|
115
122
|
success: boolean;
|
|
116
123
|
forwarded: number;
|
|
@@ -123,6 +130,20 @@ export declare function handleMeshForwardEvent(components: DaemonComponents, pay
|
|
|
123
130
|
duplicateCompletion?: undefined;
|
|
124
131
|
duplicateStopped?: undefined;
|
|
125
132
|
error?: undefined;
|
|
133
|
+
bufferedForGeneratingCoordinator?: undefined;
|
|
134
|
+
} | {
|
|
135
|
+
success: boolean;
|
|
136
|
+
forwarded: number;
|
|
137
|
+
bufferedForGeneratingCoordinator: boolean;
|
|
138
|
+
suppressed?: undefined;
|
|
139
|
+
intentionalCleanupStop?: undefined;
|
|
140
|
+
terminalLedgerEvidence?: undefined;
|
|
141
|
+
terminalLedgerKind?: undefined;
|
|
142
|
+
duplicateRefineTerminalEvent?: undefined;
|
|
143
|
+
duplicateApproval?: undefined;
|
|
144
|
+
duplicateCompletion?: undefined;
|
|
145
|
+
duplicateStopped?: undefined;
|
|
146
|
+
error?: undefined;
|
|
126
147
|
} | {
|
|
127
148
|
success: boolean;
|
|
128
149
|
error: string;
|
package/package.json
CHANGED
|
@@ -1340,7 +1340,18 @@ function injectMeshSystemMessage(components: DaemonComponents, args: {
|
|
|
1340
1340
|
return { success: true, forwarded: 0 };
|
|
1341
1341
|
}
|
|
1342
1342
|
|
|
1343
|
-
|
|
1343
|
+
// When all coordinators are generating, buffer terminal events rather than injecting
|
|
1344
|
+
// them mid-turn. Injecting into a generating PTY corrupts the input stream and gets
|
|
1345
|
+
// silently dropped. The auto-flush on idle transition delivers from the pending queue.
|
|
1346
|
+
const activeStatuses = new Set(['generating', 'streaming', 'long_generating', 'working', 'starting', 'waiting_approval']);
|
|
1347
|
+
const allCoordinatorsGenerating = isTerminalEvent && coordinatorInstances.every((coord) => {
|
|
1348
|
+
const s = coord.getState();
|
|
1349
|
+
const status = readNonEmptyString(s.status).toLowerCase();
|
|
1350
|
+
const activeChatStatus = readNonEmptyString(s.activeChat?.status).toLowerCase();
|
|
1351
|
+
return activeStatuses.has(status) || activeStatuses.has(activeChatStatus);
|
|
1352
|
+
});
|
|
1353
|
+
|
|
1354
|
+
if (!isTerminalEvent || allCoordinatorsGenerating) {
|
|
1344
1355
|
if (queuePendingMeshCoordinatorEvent({
|
|
1345
1356
|
event: args.event,
|
|
1346
1357
|
meshId: args.meshId,
|
|
@@ -1355,10 +1366,18 @@ function injectMeshSystemMessage(components: DaemonComponents, args: {
|
|
|
1355
1366
|
queuedAt: Date.now(),
|
|
1356
1367
|
...(workerCoordinatorDaemonId ? { targetCoordinatorDaemonId: workerCoordinatorDaemonId } : {}),
|
|
1357
1368
|
})) {
|
|
1358
|
-
|
|
1369
|
+
if (allCoordinatorsGenerating) {
|
|
1370
|
+
LOG.info('MeshEvents', `Queued ${args.event} for generating CLI coordinator (mesh ${args.meshId}) — will be delivered via auto-flush when coordinator returns to idle`);
|
|
1371
|
+
} else {
|
|
1372
|
+
LOG.info('MeshEvents', `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
|
|
1373
|
+
}
|
|
1359
1374
|
}
|
|
1360
1375
|
}
|
|
1361
1376
|
|
|
1377
|
+
if (allCoordinatorsGenerating) {
|
|
1378
|
+
return { success: true, forwarded: 0, bufferedForGeneratingCoordinator: true };
|
|
1379
|
+
}
|
|
1380
|
+
|
|
1362
1381
|
for (const coord of coordinatorInstances) {
|
|
1363
1382
|
const coordState = coord.getState();
|
|
1364
1383
|
LOG.info('MeshEvents', `Forwarding mesh event to coordinator ${coordState.instanceId}`);
|