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.
- package/dist/react/index.cjs +14 -60
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +14 -60
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -478,25 +478,7 @@ function handleTextDelta(event, setMessages, syncSessionRef, modifier, fullTextM
|
|
|
478
478
|
}
|
|
479
479
|
function handleClientToolCall(event, setMessages, syncSessionRef, toolContext, agentId) {
|
|
480
480
|
const tool = toolContext?.getTool(agentId, event.data.toolName);
|
|
481
|
-
|
|
482
|
-
"[DEBUG] handleClientToolCall:",
|
|
483
|
-
event.data.toolName,
|
|
484
|
-
"paused:",
|
|
485
|
-
event.data.paused,
|
|
486
|
-
"toolFound:",
|
|
487
|
-
!!tool,
|
|
488
|
-
"hasRender:",
|
|
489
|
-
!!tool?.render
|
|
490
|
-
);
|
|
491
|
-
if (!tool?.render && !event.data.paused) {
|
|
492
|
-
console.log("[DEBUG] handleClientToolCall: SKIPPING part creation \u2014 not paused and no render");
|
|
493
|
-
return;
|
|
494
|
-
}
|
|
495
|
-
console.log(
|
|
496
|
-
"[DEBUG] handleClientToolCall: CREATING widget part for",
|
|
497
|
-
event.data.toolName,
|
|
498
|
-
event.data.callId
|
|
499
|
-
);
|
|
481
|
+
if (!tool?.render && !event.data.paused) return;
|
|
500
482
|
setMessages((prev) => {
|
|
501
483
|
const lastMessage = prev[prev.length - 1];
|
|
502
484
|
const newPart = {
|
|
@@ -784,34 +766,19 @@ function useAgent(agent, options) {
|
|
|
784
766
|
sessionUtils.syncSessionRef.current(messagesRef.current);
|
|
785
767
|
}
|
|
786
768
|
}, [sessionUtils.syncSessionRef]);
|
|
787
|
-
return
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
}),
|
|
801
|
-
[
|
|
802
|
-
inProgress,
|
|
803
|
-
messages,
|
|
804
|
-
handleSend,
|
|
805
|
-
resumeTool,
|
|
806
|
-
addOptimisticMessage,
|
|
807
|
-
abort,
|
|
808
|
-
currentSessionId,
|
|
809
|
-
sessionUtils.switchSession,
|
|
810
|
-
sessionUtils.deleteSession,
|
|
811
|
-
sessionUtils.sessionsList,
|
|
812
|
-
debugData
|
|
813
|
-
]
|
|
814
|
-
);
|
|
769
|
+
return {
|
|
770
|
+
inProgress,
|
|
771
|
+
messages,
|
|
772
|
+
handleSend,
|
|
773
|
+
resumeTool,
|
|
774
|
+
addOptimisticMessage,
|
|
775
|
+
abort,
|
|
776
|
+
sessionId: currentSessionId,
|
|
777
|
+
switchSession: sessionUtils.switchSession,
|
|
778
|
+
deleteSession: sessionUtils.deleteSession,
|
|
779
|
+
sessions: sessionUtils.sessionsList,
|
|
780
|
+
debugData
|
|
781
|
+
};
|
|
815
782
|
}
|
|
816
783
|
|
|
817
784
|
// src/core/stream.ts
|
|
@@ -1630,19 +1597,6 @@ function ToolRenderer({ agentId, part }) {
|
|
|
1630
1597
|
throw new Error("ToolRenderer must be used within <AgentContextProvider>");
|
|
1631
1598
|
}
|
|
1632
1599
|
const tool = context.getTool(agentId, part.toolName);
|
|
1633
|
-
console.log(
|
|
1634
|
-
"[DEBUG] ToolRenderer:",
|
|
1635
|
-
part.toolName,
|
|
1636
|
-
part.callId,
|
|
1637
|
-
"toolFound:",
|
|
1638
|
-
!!tool,
|
|
1639
|
-
"hasRender:",
|
|
1640
|
-
!!tool?.render,
|
|
1641
|
-
"paused:",
|
|
1642
|
-
part.paused,
|
|
1643
|
-
"status:",
|
|
1644
|
-
localStatus
|
|
1645
|
-
);
|
|
1646
1600
|
const handleSubmit = useCallback6(
|
|
1647
1601
|
(result) => {
|
|
1648
1602
|
if (localStatus === "submitted") return;
|