bloby-bot 0.49.5 → 0.49.6

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": "bloby-bot",
3
- "version": "0.49.5",
3
+ "version": "0.49.6",
4
4
  "releaseNotes": [
5
5
  "1. Something great..",
6
6
  "2. ",
@@ -872,6 +872,11 @@ export class ChannelManager {
872
872
  log.info(`[channels] Starting live conversation for admin: ${convId}`);
873
873
 
874
874
  await startConversation(convId, model, (type, eventData) => {
875
+ // Snapshot the surface BEFORE routeWaStreamEvent consumes the routing target
876
+ // on bot:response — used to decide whether to mirror turn events to chat clients.
877
+ const triggerSurface = this.peekCurrentSurface(convId);
878
+ const isDashboardTurn = !triggerSurface || triggerSurface === 'chat' || triggerSurface === 'workspace';
879
+
875
880
  // WhatsApp routing — purely queue-driven, no fallback mirror jid. The
876
881
  // routing target carries the destination; whatever surface triggered the
877
882
  // turn owns the reply.
@@ -910,9 +915,14 @@ export class ChannelManager {
910
915
  return;
911
916
  }
912
917
 
913
- // Mirror non-turn events (bot:idle, bot:error, channel:*) to chat clients.
914
- // Turn events (tokens, response, tools) go to WhatsApp only via the routing FIFO.
915
- if (!CHAT_TURN_EVENTS.has(type)) broadcastBloby(type, eventData);
918
+ // Suppress turn events (bot:token / bot:response / bot:tool) only for
919
+ // non-dashboard surfaces (WhatsApp/Alexa). Dashboard turns (chat /
920
+ // workspace) Mac via /bloby/ws is `surface: 'chat'`, the tablet
921
+ // workspace chat is `surface: 'workspace'` — MUST receive bot:response
922
+ // so the Morphy continuation resolves and TTS plays, and so the
923
+ // workspace stops the "Thinking" spinner.
924
+ if (CHAT_TURN_EVENTS.has(type) && !isDashboardTurn) return;
925
+ broadcastBloby(type, eventData);
916
926
  }, { botName, humanName }, recentMessages);
917
927
  }
918
928
 
@@ -1020,6 +1030,11 @@ export class ChannelManager {
1020
1030
 
1021
1031
  const waState = this.createWaStreamState();
1022
1032
  await startConversation(convId, model, (type, eventData) => {
1033
+ // Snapshot the surface BEFORE routeWaStreamEvent consumes it on bot:response —
1034
+ // dashboard turns (chat / workspace / Mac) still need bot:response broadcast.
1035
+ const triggerSurface = this.peekCurrentSurface(convId);
1036
+ const isDashboardTurn = !triggerSurface || triggerSurface === 'chat' || triggerSurface === 'workspace';
1037
+
1023
1038
  // Same routing as WhatsApp — alexa surface branch lives inside this method.
1024
1039
  this.routeWaStreamEvent(waState, type, eventData, botName);
1025
1040
 
@@ -1049,8 +1064,11 @@ export class ChannelManager {
1049
1064
  return;
1050
1065
  }
1051
1066
 
1052
- // Turn events go to Alexa only via the routing FIFO; suppress from chat-bubble.
1053
- if (!CHAT_TURN_EVENTS.has(type)) broadcastBloby(type, eventData);
1067
+ // Dashboard turns (chat / workspace / Mac) need bot:response broadcast so
1068
+ // the Morphy continuation resolves and the workspace stops "Thinking".
1069
+ // Alexa/WhatsApp turns keep them suppressed (routing FIFO handles delivery).
1070
+ if (CHAT_TURN_EVENTS.has(type) && !isDashboardTurn) return;
1071
+ broadcastBloby(type, eventData);
1054
1072
  }, { botName, humanName }, recentMessages);
1055
1073
  }
1056
1074