@adhdev/daemon-core 0.9.76-rc.68 → 0.9.76-rc.69

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 CHANGED
@@ -1610,8 +1610,10 @@ var init_provider_cli_shared = __esm({
1610
1610
  return;
1611
1611
  }
1612
1612
  while (line.length < this.col) line.push(" ");
1613
+ const wide = isWideCodePoint(ch);
1613
1614
  line[this.col] = ch;
1614
- this.col += isWideCodePoint(ch) ? 2 : 1;
1615
+ if (wide) line[this.col + 1] = "";
1616
+ this.col += wide ? 2 : 1;
1615
1617
  }
1616
1618
  consumeEscape(seq) {
1617
1619
  if (seq.length < 2) return 0;
@@ -21364,6 +21366,11 @@ function normalizeExistingPath(filePath) {
21364
21366
  // src/mesh/mesh-events.ts
21365
21367
  init_mesh_config();
21366
21368
  init_logger();
21369
+ var MAX_PENDING_EVENTS = 50;
21370
+ var pendingMeshCoordinatorEvents = [];
21371
+ function drainPendingMeshCoordinatorEvents() {
21372
+ return pendingMeshCoordinatorEvents.splice(0);
21373
+ }
21367
21374
  function readNonEmptyString(value) {
21368
21375
  return typeof value === "string" && value.trim() ? value.trim() : "";
21369
21376
  }
@@ -21407,7 +21414,19 @@ function injectMeshSystemMessage(components, args) {
21407
21414
  if (args.sourceInstanceId && instState.instanceId === args.sourceInstanceId) return false;
21408
21415
  return true;
21409
21416
  });
21410
- if (coordinatorInstances.length === 0) return { success: true, forwarded: 0 };
21417
+ if (coordinatorInstances.length === 0) {
21418
+ if (pendingMeshCoordinatorEvents.length < MAX_PENDING_EVENTS) {
21419
+ pendingMeshCoordinatorEvents.push({
21420
+ event: args.event,
21421
+ meshId: args.meshId,
21422
+ nodeLabel: args.nodeLabel,
21423
+ metadataEvent: args.metadataEvent,
21424
+ queuedAt: Date.now()
21425
+ });
21426
+ LOG.info("MeshEvents", `Queued ${args.event} for MCP coordinator (mesh ${args.meshId})`);
21427
+ }
21428
+ return { success: true, forwarded: 0 };
21429
+ }
21411
21430
  const messageText = buildMeshSystemMessage({
21412
21431
  event: args.event,
21413
21432
  nodeLabel: args.nodeLabel,
@@ -22587,6 +22606,10 @@ var DaemonCommandRouter = class {
22587
22606
  case "mesh_forward_event": {
22588
22607
  return handleMeshForwardEvent({ instanceManager: this.deps.instanceManager }, args);
22589
22608
  }
22609
+ case "get_pending_mesh_events": {
22610
+ const events = drainPendingMeshCoordinatorEvents();
22611
+ return { success: true, events };
22612
+ }
22590
22613
  case "launch_cli":
22591
22614
  case "stop_cli":
22592
22615
  case "set_cli_view_mode":