@liveblocks/react 2.25.0-aiprivatebeta10 → 2.25.0-aiprivatebeta12

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.
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "2.25.0-aiprivatebeta10";
3
+ var PKG_VERSION = "2.25.0-aiprivatebeta12";
4
4
  var PKG_FORMAT = "esm";
5
5
 
6
6
  // src/ClientSideSuspense.tsx
@@ -20,4 +20,4 @@ export {
20
20
  PKG_FORMAT,
21
21
  ClientSideSuspense
22
22
  };
23
- //# sourceMappingURL=chunk-Y2RSQZ5R.js.map
23
+ //# sourceMappingURL=chunk-HDEQ3QVH.js.map
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "2.25.0-aiprivatebeta10";
3
+ var PKG_VERSION = "2.25.0-aiprivatebeta12";
4
4
  var PKG_FORMAT = "cjs";
5
5
 
6
6
  // src/ClientSideSuspense.tsx
@@ -20,4 +20,4 @@ function ClientSideSuspense(props) {
20
20
 
21
21
 
22
22
  exports.PKG_NAME = PKG_NAME; exports.PKG_VERSION = PKG_VERSION; exports.PKG_FORMAT = PKG_FORMAT; exports.ClientSideSuspense = ClientSideSuspense;
23
- //# sourceMappingURL=chunk-MSLJX4ZW.cjs.map
23
+ //# sourceMappingURL=chunk-ICBBMT4U.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-MSLJX4ZW.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,wBAAA;AACvD,IAAM,WAAA,EAAgD,KAAA;ADD7D;AACA;AEJA,8BAA8C;AAkC1C,+CAAA;AAVG,SAAS,kBAAA,CAAmB,KAAA,EAAc;AAC/C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAE5C,EAAA,8BAAA,CAAU,EAAA,GAAM;AAGd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,uBACE,6BAAA,eAAC,EAAA,EAAS,QAAA,EAAU,KAAA,CAAM,QAAA,EACvB,QAAA,EAAA,QAAA,EACG,OAAO,KAAA,CAAM,SAAA,IAAa,WAAA,EACxB,KAAA,CAAM,QAAA,CAAS,EAAA,EACf,KAAA,CAAM,SAAA,EACR,KAAA,CAAM,SAAA,CACZ,CAAA;AAEJ;AF5BA;AACA;AACE;AACA;AACA;AACA;AACF,iJAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-MSLJX4ZW.cjs","sourcesContent":[null,"declare const __VERSION__: string;\ndeclare const TSUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof TSUP_FORMAT === \"string\" && TSUP_FORMAT;\n","import type { ReactNode } from \"react\";\nimport { Suspense, useEffect, useState } from \"react\";\n\ntype Props = {\n fallback: ReactNode;\n children: (() => ReactNode | undefined) | ReactNode | undefined;\n};\n\n/**\n * Almost like a normal <Suspense> component, except that for server-side\n * renders, the fallback will be used.\n *\n * The child props will have to be provided in a function, i.e. change:\n *\n * <Suspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </Suspense>\n *\n * To:\n *\n * <ClientSideSuspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </ClientSideSuspense>\n *\n */\nexport function ClientSideSuspense(props: Props) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n // Effects are never executed on the server side. The point of this is to\n // delay the flipping of this boolean until after hydration has happened.\n setMounted(true);\n }, []);\n\n return (\n <Suspense fallback={props.fallback}>\n {mounted\n ? typeof props.children === \"function\"\n ? props.children()\n : props.children\n : props.fallback}\n </Suspense>\n );\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-ICBBMT4U.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,wBAAA;AACvD,IAAM,WAAA,EAAgD,KAAA;ADD7D;AACA;AEJA,8BAA8C;AAkC1C,+CAAA;AAVG,SAAS,kBAAA,CAAmB,KAAA,EAAc;AAC/C,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,EAAA,EAAI,6BAAA,KAAc,CAAA;AAE5C,EAAA,8BAAA,CAAU,EAAA,GAAM;AAGd,IAAA,UAAA,CAAW,IAAI,CAAA;AAAA,EACjB,CAAA,EAAG,CAAC,CAAC,CAAA;AAEL,EAAA,uBACE,6BAAA,eAAC,EAAA,EAAS,QAAA,EAAU,KAAA,CAAM,QAAA,EACvB,QAAA,EAAA,QAAA,EACG,OAAO,KAAA,CAAM,SAAA,IAAa,WAAA,EACxB,KAAA,CAAM,QAAA,CAAS,EAAA,EACf,KAAA,CAAM,SAAA,EACR,KAAA,CAAM,SAAA,CACZ,CAAA;AAEJ;AF5BA;AACA;AACE;AACA;AACA;AACA;AACF,iJAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-ICBBMT4U.cjs","sourcesContent":[null,"declare const __VERSION__: string;\ndeclare const TSUP_FORMAT: string;\n\nexport const PKG_NAME = \"@liveblocks/react\";\nexport const PKG_VERSION = typeof __VERSION__ === \"string\" && __VERSION__;\nexport const PKG_FORMAT = typeof TSUP_FORMAT === \"string\" && TSUP_FORMAT;\n","import type { ReactNode } from \"react\";\nimport { Suspense, useEffect, useState } from \"react\";\n\ntype Props = {\n fallback: ReactNode;\n children: (() => ReactNode | undefined) | ReactNode | undefined;\n};\n\n/**\n * Almost like a normal <Suspense> component, except that for server-side\n * renders, the fallback will be used.\n *\n * The child props will have to be provided in a function, i.e. change:\n *\n * <Suspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </Suspense>\n *\n * To:\n *\n * <ClientSideSuspense fallback={<Loading />}>\n * <MyRealComponent a={1} />\n * </ClientSideSuspense>\n *\n */\nexport function ClientSideSuspense(props: Props) {\n const [mounted, setMounted] = useState(false);\n\n useEffect(() => {\n // Effects are never executed on the server side. The point of this is to\n // delay the flipping of this boolean until after hydration has happened.\n setMounted(true);\n }, []);\n\n return (\n <Suspense fallback={props.fallback}>\n {mounted\n ? typeof props.children === \"function\"\n ? props.children()\n : props.children\n : props.fallback}\n </Suspense>\n );\n}\n"]}
@@ -48,6 +48,18 @@ var RegisterAiKnowledge = memo(function RegisterAiKnowledge2(props) {
48
48
  }, [ai, layerKey, knowledgeKey, description, value]);
49
49
  return null;
50
50
  });
51
+ var RegisterAiTool = memo(function RegisterAiTool2({
52
+ chatId,
53
+ name,
54
+ tool
55
+ }) {
56
+ const client = useClient();
57
+ const ai = client[kInternal].ai;
58
+ useEffect(() => {
59
+ return ai.registerTool(name, tool, chatId);
60
+ }, [ai, chatId, name, tool]);
61
+ return null;
62
+ });
51
63
 
52
64
  // src/use-sync-external-store-with-selector.ts
53
65
  import {
@@ -2592,7 +2604,10 @@ function useCreateAiChat() {
2592
2604
  const client = useClient();
2593
2605
  return useCallback2(
2594
2606
  (options) => {
2595
- client[kInternal3].ai.getOrCreateChat(options.id, options).catch((err) => {
2607
+ client[kInternal3].ai.getOrCreateChat(options.id, {
2608
+ title: options.title,
2609
+ metadata: options.metadata
2610
+ }).catch((err) => {
2596
2611
  console.error(
2597
2612
  `Failed to create chat with ID "${options.id}": ${String(err)}`
2598
2613
  );
@@ -2659,7 +2674,8 @@ function createSharedContext(client) {
2659
2674
  useIsInsideRoom,
2660
2675
  useErrorListener,
2661
2676
  useSyncStatus: useSyncStatus2,
2662
- RegisterAiKnowledge
2677
+ RegisterAiKnowledge,
2678
+ RegisterAiTool
2663
2679
  },
2664
2680
  suspense: {
2665
2681
  useClient: useClient2,
@@ -2668,7 +2684,8 @@ function createSharedContext(client) {
2668
2684
  useIsInsideRoom,
2669
2685
  useErrorListener,
2670
2686
  useSyncStatus: useSyncStatus2,
2671
- RegisterAiKnowledge
2687
+ RegisterAiKnowledge,
2688
+ RegisterAiTool
2672
2689
  }
2673
2690
  };
2674
2691
  }
@@ -4631,6 +4648,7 @@ export {
4631
4648
  useClient,
4632
4649
  RoomContext,
4633
4650
  RegisterAiKnowledge,
4651
+ RegisterAiTool,
4634
4652
  useSyncExternalStoreWithSelector,
4635
4653
  useSignal,
4636
4654
  getUmbrellaStoreForClient,
@@ -4746,4 +4764,4 @@ export {
4746
4764
  _useStorageRoot,
4747
4765
  _useUpdateMyPresence
4748
4766
  };
4749
- //# sourceMappingURL=chunk-Y7BGHNHH.js.map
4767
+ //# sourceMappingURL=chunk-KLANVQIZ.js.map