reactbridge-sdk 0.2.18 → 0.2.20

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.
@@ -1 +1 @@
1
- {"version":3,"file":"useReactBridge.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactBridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EAIrB,MAAM,UAAU,CAAC;AAElB,wBAAgB,cAAc,CAAC,EAC7B,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,EAAE,qBAAqB,GAAG,oBAAoB,CA6R9C"}
1
+ {"version":3,"file":"useReactBridge.d.ts","sourceRoot":"","sources":["../../src/hooks/useReactBridge.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAEV,qBAAqB,EACrB,oBAAoB,EAIrB,MAAM,UAAU,CAAC;AAElB,wBAAgB,cAAc,CAAC,EAC7B,gBAAgB,EAChB,cAAc,EACd,OAAO,EACP,aAAa,EACb,WAAW,EACX,YAAY,EACZ,eAAe,GAChB,EAAE,qBAAqB,GAAG,oBAAoB,CAkS9C"}
package/dist/index.esm.js CHANGED
@@ -532,7 +532,10 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
532
532
  if (lastRequestRef.current && currentResponse.sessionId) {
533
533
  const resultResponse = yield api.sendToolResult(currentResponse.sessionId, toolResult, lastRequestRef.current);
534
534
  // Check if result is identical to previous one (prevent infinite loops on duplicate responses)
535
- const currentResultString = JSON.stringify(resultResponse);
535
+ const currentResultString = JSON.stringify({
536
+ message: resultResponse.message,
537
+ toolCall: resultResponse.toolCall,
538
+ });
536
539
  if (previousResultResponse === currentResultString) {
537
540
  console.warn("Identical tool response detected. Exiting loop to prevent infinite loop.");
538
541
  currentToolCall = null;
@@ -545,7 +548,8 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
545
548
  role: "assistant",
546
549
  content: resultResponse.message,
547
550
  timestamp: new Date(),
548
- toolCall: resultResponse.toolCall,
551
+ toolCall: resultResponse.toolCall
552
+ ? Object.assign(Object.assign({}, resultResponse.toolCall), { isSequential: toolCallCount > 1 }) : undefined,
549
553
  };
550
554
  setMessages((prev) => [...prev, finalMessage]);
551
555
  // Trigger TTS for final response only if input came from voice (first iteration only)