@personaai/react 0.7.5 → 0.7.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/dist/index.cjs CHANGED
@@ -1435,6 +1435,7 @@ function useVoice(options = {}) {
1435
1435
  const voiceLogger = (0, import_react5.useMemo)(() => logger.child("voice"), [logger]);
1436
1436
  const agentId = options.agentId || defaultAgentId;
1437
1437
  const threadId = options.threadId;
1438
+ const contextOverride = options.contextOverride;
1438
1439
  const [state, setState] = (0, import_react5.useState)("idle");
1439
1440
  const [isMuted, setIsMuted] = (0, import_react5.useState)(false);
1440
1441
  const [transcript, setTranscript] = (0, import_react5.useState)(
@@ -1704,14 +1705,19 @@ function useVoice(options = {}) {
1704
1705
  setToolCalls([]);
1705
1706
  acceptedTurnSeqRef.current = 0;
1706
1707
  setState("connecting");
1707
- voiceLogger.debug("start() called", { agentId, threadId });
1708
+ voiceLogger.debug("start() called", {
1709
+ agentId,
1710
+ threadId,
1711
+ hasContextOverride: !!contextOverride
1712
+ });
1708
1713
  try {
1709
1714
  const res = await fetchWithAuth("/voice/sessions", {
1710
1715
  method: "POST",
1711
1716
  headers: { "Content-Type": "application/json" },
1712
1717
  body: JSON.stringify({
1713
1718
  agentId,
1714
- ...threadId ? { threadId } : {}
1719
+ ...threadId ? { threadId } : {},
1720
+ ...contextOverride ? { contextOverride } : {}
1715
1721
  })
1716
1722
  });
1717
1723
  if (!res.ok) {
@@ -1747,7 +1753,7 @@ function useVoice(options = {}) {
1747
1753
  }
1748
1754
  teardownAudio();
1749
1755
  }
1750
- }, [agentId, threadId, fetchWithAuth, handleMessage, teardownAudio, voiceLogger]);
1756
+ }, [agentId, threadId, contextOverride, fetchWithAuth, handleMessage, teardownAudio, voiceLogger]);
1751
1757
  const mute = (0, import_react5.useCallback)((muted) => {
1752
1758
  setIsMuted(muted);
1753
1759
  streamRef.current?.getAudioTracks().forEach((track) => {