minivibe 0.2.12 → 0.2.14

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.
Files changed (2) hide show
  1. package/agent/agent.js +20 -6
  2. package/package.json +1 -1
package/agent/agent.js CHANGED
@@ -679,12 +679,20 @@ function handleLocalMessage(clientWs, msg) {
679
679
  }
680
680
 
681
681
  // Log important message types from CLI
682
+ const sessionPrefix = msg.sessionId ? `[${msg.sessionId.slice(0, 8)}]` : '';
682
683
  if (msg.type === 'claude_message') {
683
- const sessionPrefix = msg.sessionId ? `[${msg.sessionId.slice(0, 8)}]` : '';
684
- const contentPreview = msg.content ? msg.content.toString().slice(0, 200) : '(no content)';
685
- log(`${sessionPrefix} 🤖 Claude: ${contentPreview}${msg.content?.length > 200 ? '...' : ''}`, colors.cyan);
684
+ // Content is nested in msg.message.content (not msg.content)
685
+ const rawContent = msg.message?.content || msg.content;
686
+ const sender = msg.message?.sender || 'claude';
687
+ // Handle both string and object content (e.g., encrypted)
688
+ const contentStr = typeof rawContent === 'string' ? rawContent :
689
+ (rawContent?.ciphertext ? '[encrypted]' : JSON.stringify(rawContent || ''));
690
+ const preview = contentStr.slice(0, 150);
691
+ const truncated = contentStr.length > 150 ? '...' : '';
692
+ const emoji = sender === 'user' ? '📱' : '🤖';
693
+ const label = sender === 'user' ? 'User' : 'Claude';
694
+ log(`${sessionPrefix} ${emoji} ${label}: ${preview}${truncated}`, sender === 'user' ? colors.green : colors.cyan);
686
695
  } else if (msg.type === 'permission_request') {
687
- const sessionPrefix = msg.sessionId ? `[${msg.sessionId.slice(0, 8)}]` : '';
688
696
  log(`${sessionPrefix} 🔔 Permission request: ${msg.toolName || msg.question || 'unknown'}`, colors.yellow);
689
697
  }
690
698
 
@@ -872,9 +880,15 @@ function handleMessage(msg) {
872
880
 
873
881
  case 'send_message':
874
882
  // Mobile sent a message - relay to local vibe-cli
875
- log(`📱 Relaying send_message to local client: "${(msg.content || '').toString().slice(0, 50)}..."`, colors.cyan);
883
+ const sendSessionPrefix = msg.sessionId ? `[${msg.sessionId.slice(0, 8)}]` : '';
884
+ // Handle both string and object content (e.g., encrypted)
885
+ const sendContentStr = typeof msg.content === 'string' ? msg.content :
886
+ (msg.content?.ciphertext ? '[encrypted]' : JSON.stringify(msg.content || ''));
887
+ const sendPreview = sendContentStr.slice(0, 150);
888
+ const sendTruncated = sendContentStr.length > 150 ? '...' : '';
889
+ log(`${sendSessionPrefix} 📱 User: ${sendPreview}${sendTruncated}`, colors.green);
876
890
  if (!relayToLocalClient(msg)) {
877
- log(`⚠️ Failed to relay send_message - no local client for session ${msg.sessionId?.slice(0, 8)}`, colors.yellow);
891
+ log(`${sendSessionPrefix} ⚠️ Failed to relay - no local client`, colors.yellow);
878
892
  }
879
893
  break;
880
894
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "minivibe",
3
- "version": "0.2.12",
3
+ "version": "0.2.14",
4
4
  "description": "CLI wrapper for Claude Code with mobile remote control via MiniVibe iOS app",
5
5
  "author": "MiniVibe <hello@minivibeapp.com>",
6
6
  "homepage": "https://github.com/minivibeapp/minivibe",