@meetsmore-oss/use-ai-client 1.9.1 → 1.9.2

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.js CHANGED
@@ -5162,7 +5162,15 @@ function UseAIProvider({
5162
5162
  const lastRegisteredToolsRef = useRef12("");
5163
5163
  useEffect11(() => {
5164
5164
  const client = clientRef.current;
5165
- if (!client || !client.isConnected() || !toolSystem.hasTools) return;
5165
+ if (!client || !client.isConnected()) return;
5166
+ if (!toolSystem.hasTools) {
5167
+ if (lastRegisteredToolsRef.current !== "") {
5168
+ lastRegisteredToolsRef.current = "";
5169
+ client.registerTools([]);
5170
+ console.log("[Provider] All tools unregistered, clearing client tools");
5171
+ }
5172
+ return;
5173
+ }
5166
5174
  const toolKeys = Object.keys(toolSystem.aggregatedTools).sort().join(",");
5167
5175
  if (toolKeys === lastRegisteredToolsRef.current) {
5168
5176
  console.log("[Provider] Skipping re-registration, tools unchanged");