@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adhdev/daemon-core",
3
- "version": "0.9.82-rc.115",
3
+ "version": "0.9.82-rc.116",
4
4
  "description": "ADHDev daemon core — CDP, IDE detection, providers, command execution",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -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 === 0) return true;
464
- return messageSessionIds.some((id) => id === explicitSessionId);
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
  }