@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/bundled.js CHANGED
@@ -39287,7 +39287,15 @@ function UseAIProvider({
39287
39287
  const lastRegisteredToolsRef = useRef12("");
39288
39288
  useEffect11(() => {
39289
39289
  const client = clientRef.current;
39290
- if (!client || !client.isConnected() || !toolSystem.hasTools) return;
39290
+ if (!client || !client.isConnected()) return;
39291
+ if (!toolSystem.hasTools) {
39292
+ if (lastRegisteredToolsRef.current !== "") {
39293
+ lastRegisteredToolsRef.current = "";
39294
+ client.registerTools([]);
39295
+ console.log("[Provider] All tools unregistered, clearing client tools");
39296
+ }
39297
+ return;
39298
+ }
39291
39299
  const toolKeys = Object.keys(toolSystem.aggregatedTools).sort().join(",");
39292
39300
  if (toolKeys === lastRegisteredToolsRef.current) {
39293
39301
  console.log("[Provider] Skipping re-registration, tools unchanged");