@adhdev/daemon-core 0.9.82-rc.115 → 0.9.82-rc.116
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 +25 -2
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -2
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/commands/chat-commands.ts +29 -2
package/package.json
CHANGED
|
@@ -455,18 +455,45 @@ function hasSafeNativeHistoryMapping(args: {
|
|
|
455
455
|
ptyMessages?: ChatMessage[];
|
|
456
456
|
requireWorkspaceContentOverlap?: boolean;
|
|
457
457
|
}): boolean {
|
|
458
|
+
const isCoordinatorTranscript = args.nativeMessages.some((m: any) => {
|
|
459
|
+
const text = typeof m?.content === 'string' ? m.content : JSON.stringify(m?.content || '');
|
|
460
|
+
return text.includes('mesh_send_task') || text.includes('mesh_status') || text.includes('mesh_read_chat') || text.includes('mesh_launch_session');
|
|
461
|
+
});
|
|
462
|
+
|
|
458
463
|
const explicitSessionId = String(args.historySessionId || args.providerSessionId || '').trim();
|
|
459
464
|
if (explicitSessionId) {
|
|
460
465
|
const messageSessionIds = args.nativeMessages
|
|
461
466
|
.map((message: any) => typeof message?.historySessionId === 'string' ? message.historySessionId.trim() : '')
|
|
462
467
|
.filter(Boolean);
|
|
463
|
-
if (messageSessionIds.length
|
|
464
|
-
|
|
468
|
+
if (messageSessionIds.length > 0) {
|
|
469
|
+
return messageSessionIds.some((id) => id === explicitSessionId);
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
if (isCoordinatorTranscript && args.ptyMessages && args.ptyMessages.length > 0) {
|
|
473
|
+
const ptyHasCoordinator = args.ptyMessages.some((m: any) => {
|
|
474
|
+
const text = typeof m?.content === 'string' ? m.content : JSON.stringify(m?.content || '');
|
|
475
|
+
return text.includes('mesh_send_task') || text.includes('mesh_status') || text.includes('mesh_read_chat');
|
|
476
|
+
});
|
|
477
|
+
if (!ptyHasCoordinator) {
|
|
478
|
+
return false;
|
|
479
|
+
}
|
|
480
|
+
}
|
|
465
481
|
}
|
|
466
482
|
const workspace = String(args.workspace || '').trim();
|
|
467
483
|
if (!workspace) return false;
|
|
468
484
|
const workspaceMatches = args.nativeMessages.some((message: any) => String(message?.workspace || '').trim() === workspace);
|
|
469
485
|
if (!workspaceMatches) return false;
|
|
486
|
+
|
|
487
|
+
if (isCoordinatorTranscript && args.ptyMessages && args.ptyMessages.length > 0) {
|
|
488
|
+
const ptyHasCoordinator = args.ptyMessages.some((m: any) => {
|
|
489
|
+
const text = typeof m?.content === 'string' ? m.content : JSON.stringify(m?.content || '');
|
|
490
|
+
return text.includes('mesh_send_task') || text.includes('mesh_status') || text.includes('mesh_read_chat');
|
|
491
|
+
});
|
|
492
|
+
if (!ptyHasCoordinator) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
|
|
470
497
|
if (!args.requireWorkspaceContentOverlap) return true;
|
|
471
498
|
return hasOverlappingVisibleConversationText(args.nativeMessages, args.ptyMessages || []);
|
|
472
499
|
}
|