reactbridge-sdk 0.2.20 → 0.2.21

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,CAkS9C"}
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,CAoS9C"}
package/dist/index.esm.js CHANGED
@@ -526,8 +526,9 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
526
526
  let previousResultResponse = null;
527
527
  while (currentToolCall && toolCallCount < maxToolCalls) {
528
528
  toolCallCount++;
529
- // Execute the current tool
530
- const toolResult = yield onIntentDetected(currentToolCall);
529
+ // Execute the current tool with isSequential flag for chained calls
530
+ const toolResultToolCall = Object.assign(Object.assign({}, currentToolCall), { isSequential: toolCallCount > 1 });
531
+ const toolResult = yield onIntentDetected(toolResultToolCall);
531
532
  // Step 3: Send tool result back to orchestrator
532
533
  if (lastRequestRef.current && currentResponse.sessionId) {
533
534
  const resultResponse = yield api.sendToolResult(currentResponse.sessionId, toolResult, lastRequestRef.current);
@@ -548,8 +549,7 @@ function useReactBridge({ onIntentDetected, currentContext, onError, onSpeechSta
548
549
  role: "assistant",
549
550
  content: resultResponse.message,
550
551
  timestamp: new Date(),
551
- toolCall: resultResponse.toolCall
552
- ? Object.assign(Object.assign({}, resultResponse.toolCall), { isSequential: toolCallCount > 1 }) : undefined,
552
+ toolCall: resultResponse.toolCall,
553
553
  };
554
554
  setMessages((prev) => [...prev, finalMessage]);
555
555
  // Trigger TTS for final response only if input came from voice (first iteration only)