bs-agent 0.0.23 → 0.0.25

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.
@@ -509,25 +509,7 @@ function handleTextDelta(event, setMessages, syncSessionRef, modifier, fullTextM
509
509
  }
510
510
  function handleClientToolCall(event, setMessages, syncSessionRef, toolContext, agentId) {
511
511
  const tool = toolContext?.getTool(agentId, event.data.toolName);
512
- console.log(
513
- "[DEBUG] handleClientToolCall:",
514
- event.data.toolName,
515
- "paused:",
516
- event.data.paused,
517
- "toolFound:",
518
- !!tool,
519
- "hasRender:",
520
- !!tool?.render
521
- );
522
- if (!tool?.render && !event.data.paused) {
523
- console.log("[DEBUG] handleClientToolCall: SKIPPING part creation \u2014 not paused and no render");
524
- return;
525
- }
526
- console.log(
527
- "[DEBUG] handleClientToolCall: CREATING widget part for",
528
- event.data.toolName,
529
- event.data.callId
530
- );
512
+ if (!tool?.render && !event.data.paused) return;
531
513
  setMessages((prev) => {
532
514
  const lastMessage = prev[prev.length - 1];
533
515
  const newPart = {
@@ -815,34 +797,19 @@ function useAgent(agent, options) {
815
797
  sessionUtils.syncSessionRef.current(messagesRef.current);
816
798
  }
817
799
  }, [sessionUtils.syncSessionRef]);
818
- return (0, import_react3.useMemo)(
819
- () => ({
820
- inProgress,
821
- messages,
822
- handleSend,
823
- resumeTool,
824
- addOptimisticMessage,
825
- abort,
826
- sessionId: currentSessionId,
827
- switchSession: sessionUtils.switchSession,
828
- deleteSession: sessionUtils.deleteSession,
829
- sessions: sessionUtils.sessionsList,
830
- debugData
831
- }),
832
- [
833
- inProgress,
834
- messages,
835
- handleSend,
836
- resumeTool,
837
- addOptimisticMessage,
838
- abort,
839
- currentSessionId,
840
- sessionUtils.switchSession,
841
- sessionUtils.deleteSession,
842
- sessionUtils.sessionsList,
843
- debugData
844
- ]
845
- );
800
+ return {
801
+ inProgress,
802
+ messages,
803
+ handleSend,
804
+ resumeTool,
805
+ addOptimisticMessage,
806
+ abort,
807
+ sessionId: currentSessionId,
808
+ switchSession: sessionUtils.switchSession,
809
+ deleteSession: sessionUtils.deleteSession,
810
+ sessions: sessionUtils.sessionsList,
811
+ debugData
812
+ };
846
813
  }
847
814
 
848
815
  // src/core/stream.ts
@@ -1661,19 +1628,6 @@ function ToolRenderer({ agentId, part }) {
1661
1628
  throw new Error("ToolRenderer must be used within <AgentContextProvider>");
1662
1629
  }
1663
1630
  const tool = context.getTool(agentId, part.toolName);
1664
- console.log(
1665
- "[DEBUG] ToolRenderer:",
1666
- part.toolName,
1667
- part.callId,
1668
- "toolFound:",
1669
- !!tool,
1670
- "hasRender:",
1671
- !!tool?.render,
1672
- "paused:",
1673
- part.paused,
1674
- "status:",
1675
- localStatus
1676
- );
1677
1631
  const handleSubmit = (0, import_react6.useCallback)(
1678
1632
  (result) => {
1679
1633
  if (localStatus === "submitted") return;