@liveblocks/react 3.8.0 → 3.9.0

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
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "3.8.0";
3
+ var PKG_VERSION = "3.9.0";
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-6MZ5AS3V.cjs.map
23
+ //# sourceMappingURL=chunk-QYVDIZ6C.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/chunk-6MZ5AS3V.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,OAAA;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-6MZ5AS3V.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-QYVDIZ6C.cjs","../src/version.ts","../src/ClientSideSuspense.tsx"],"names":[],"mappings":"AAAA;ACGO,IAAM,SAAA,EAAW,mBAAA;AACjB,IAAM,YAAA,EAAiD,OAAA;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-QYVDIZ6C.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,6 +1,6 @@
1
1
  // src/version.ts
2
2
  var PKG_NAME = "@liveblocks/react";
3
- var PKG_VERSION = "3.8.0";
3
+ var PKG_VERSION = "3.9.0";
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-C65QJNZB.js.map
23
+ //# sourceMappingURL=chunk-SCL5CBWP.js.map
package/dist/index.cjs CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk6MZ5AS3Vcjs = require('./chunk-6MZ5AS3V.cjs');
6
+ var _chunkQYVDIZ6Ccjs = require('./chunk-QYVDIZ6C.cjs');
7
7
 
8
8
 
9
9
 
@@ -78,12 +78,14 @@ var _chunk6MZ5AS3Vcjs = require('./chunk-6MZ5AS3V.cjs');
78
78
 
79
79
 
80
80
 
81
- var _chunkIQBSX6NScjs = require('./chunk-IQBSX6NS.cjs');
81
+
82
+ var _chunkNGMOQDHXcjs = require('./chunk-NGMOQDHX.cjs');
82
83
 
83
84
  // src/index.ts
84
85
  var _core = require('@liveblocks/core');
85
86
  var _client = require('@liveblocks/client');
86
- _core.detectDupes.call(void 0, _chunk6MZ5AS3Vcjs.PKG_NAME, _chunk6MZ5AS3Vcjs.PKG_VERSION, _chunk6MZ5AS3Vcjs.PKG_FORMAT);
87
+ _core.detectDupes.call(void 0, _chunkQYVDIZ6Ccjs.PKG_NAME, _chunkQYVDIZ6Ccjs.PKG_VERSION, _chunkQYVDIZ6Ccjs.PKG_FORMAT);
88
+
87
89
 
88
90
 
89
91
 
@@ -161,5 +163,5 @@ _core.detectDupes.call(void 0, _chunk6MZ5AS3Vcjs.PKG_NAME, _chunk6MZ5AS3Vcjs.PKG
161
163
 
162
164
 
163
165
 
164
- exports.ClientContext = _chunkIQBSX6NScjs.ClientContext; exports.ClientSideSuspense = _chunk6MZ5AS3Vcjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkIQBSX6NScjs.LiveblocksProvider; exports.RegisterAiKnowledge = _chunkIQBSX6NScjs.RegisterAiKnowledge; exports.RegisterAiTool = _chunkIQBSX6NScjs.RegisterAiTool; exports.RoomContext = _chunkIQBSX6NScjs.RoomContext; exports.RoomProvider = _chunkIQBSX6NScjs._RoomProvider; exports.createLiveblocksContext = _chunkIQBSX6NScjs.createLiveblocksContext; exports.createRoomContext = _chunkIQBSX6NScjs.createRoomContext; exports.isNotificationChannelEnabled = _client.isNotificationChannelEnabled; exports.shallow = _client.shallow; exports.useAddReaction = _chunkIQBSX6NScjs._useAddReaction; exports.useAiChat = _chunkIQBSX6NScjs._useAiChat; exports.useAiChatMessages = _chunkIQBSX6NScjs._useAiChatMessages; exports.useAiChatStatus = _chunkIQBSX6NScjs.useAiChatStatus; exports.useAiChats = _chunkIQBSX6NScjs._useAiChats; exports.useAttachmentUrl = _chunkIQBSX6NScjs.useAttachmentUrl; exports.useBroadcastEvent = _chunkIQBSX6NScjs._useBroadcastEvent; exports.useCanRedo = _chunkIQBSX6NScjs.useCanRedo; exports.useCanUndo = _chunkIQBSX6NScjs.useCanUndo; exports.useClient = _chunkIQBSX6NScjs.useClient; exports.useCreateAiChat = _chunkIQBSX6NScjs.useCreateAiChat; exports.useCreateComment = _chunkIQBSX6NScjs.useCreateComment; exports.useCreateThread = _chunkIQBSX6NScjs._useCreateThread; exports.useDeleteAiChat = _chunkIQBSX6NScjs.useDeleteAiChat; exports.useDeleteAllInboxNotifications = _chunkIQBSX6NScjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkIQBSX6NScjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkIQBSX6NScjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkIQBSX6NScjs._useDeleteThread; exports.useEditComment = _chunkIQBSX6NScjs.useEditComment; exports.useEditThreadMetadata = _chunkIQBSX6NScjs._useEditThreadMetadata; exports.useErrorListener = _chunkIQBSX6NScjs.useErrorListener; exports.useEventListener = _chunkIQBSX6NScjs._useEventListener; exports.useGroupInfo = _chunkIQBSX6NScjs.useGroupInfo; exports.useHistory = _chunkIQBSX6NScjs.useHistory; exports.useHistoryVersionData = _chunkIQBSX6NScjs.useHistoryVersionData; exports.useHistoryVersions = _chunkIQBSX6NScjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkIQBSX6NScjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkIQBSX6NScjs.useInboxNotifications; exports.useIsInsideRoom = _chunkIQBSX6NScjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkIQBSX6NScjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkIQBSX6NScjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkIQBSX6NScjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkIQBSX6NScjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkIQBSX6NScjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkIQBSX6NScjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkIQBSX6NScjs._useMutation; exports.useMyPresence = _chunkIQBSX6NScjs._useMyPresence; exports.useNotificationSettings = _chunkIQBSX6NScjs.useNotificationSettings; exports.useOther = _chunkIQBSX6NScjs._useOther; exports.useOthers = _chunkIQBSX6NScjs._useOthers; exports.useOthersConnectionIds = _chunkIQBSX6NScjs.useOthersConnectionIds; exports.useOthersListener = _chunkIQBSX6NScjs._useOthersListener; exports.useOthersMapped = _chunkIQBSX6NScjs._useOthersMapped; exports.useRedo = _chunkIQBSX6NScjs.useRedo; exports.useRemoveReaction = _chunkIQBSX6NScjs.useRemoveReaction; exports.useRoom = _chunkIQBSX6NScjs._useRoom; exports.useRoomInfo = _chunkIQBSX6NScjs.useRoomInfo; exports.useRoomSubscriptionSettings = _chunkIQBSX6NScjs._useRoomSubscriptionSettings; exports.useSelf = _chunkIQBSX6NScjs._useSelf; exports.useSendAiMessage = _chunkIQBSX6NScjs.useSendAiMessage; exports.useStatus = _chunkIQBSX6NScjs.useStatus; exports.useStorage = _chunkIQBSX6NScjs._useStorage; exports.useStorageRoot = _chunkIQBSX6NScjs._useStorageRoot; exports.useSubscribeToThread = _chunkIQBSX6NScjs.useSubscribeToThread; exports.useSyncStatus = _chunkIQBSX6NScjs.useSyncStatus; exports.useThreadSubscription = _chunkIQBSX6NScjs.useThreadSubscription; exports.useThreads = _chunkIQBSX6NScjs._useThreads; exports.useUndo = _chunkIQBSX6NScjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkIQBSX6NScjs.useUnreadInboxNotificationsCount; exports.useUnsubscribeFromThread = _chunkIQBSX6NScjs.useUnsubscribeFromThread; exports.useUpdateMyPresence = _chunkIQBSX6NScjs._useUpdateMyPresence; exports.useUpdateNotificationSettings = _chunkIQBSX6NScjs.useUpdateNotificationSettings; exports.useUpdateRoomSubscriptionSettings = _chunkIQBSX6NScjs.useUpdateRoomSubscriptionSettings; exports.useUser = _chunkIQBSX6NScjs._useUser; exports.useUserThreads_experimental = _chunkIQBSX6NScjs._useUserThreads_experimental;
166
+ exports.ClientContext = _chunkNGMOQDHXcjs.ClientContext; exports.ClientSideSuspense = _chunkQYVDIZ6Ccjs.ClientSideSuspense; exports.LiveblocksProvider = _chunkNGMOQDHXcjs.LiveblocksProvider; exports.RegisterAiKnowledge = _chunkNGMOQDHXcjs.RegisterAiKnowledge; exports.RegisterAiTool = _chunkNGMOQDHXcjs.RegisterAiTool; exports.RoomContext = _chunkNGMOQDHXcjs.RoomContext; exports.RoomProvider = _chunkNGMOQDHXcjs._RoomProvider; exports.createLiveblocksContext = _chunkNGMOQDHXcjs.createLiveblocksContext; exports.createRoomContext = _chunkNGMOQDHXcjs.createRoomContext; exports.isNotificationChannelEnabled = _client.isNotificationChannelEnabled; exports.shallow = _client.shallow; exports.useAddReaction = _chunkNGMOQDHXcjs._useAddReaction; exports.useAiChat = _chunkNGMOQDHXcjs._useAiChat; exports.useAiChatMessages = _chunkNGMOQDHXcjs._useAiChatMessages; exports.useAiChatStatus = _chunkNGMOQDHXcjs.useAiChatStatus; exports.useAiChats = _chunkNGMOQDHXcjs._useAiChats; exports.useAttachmentUrl = _chunkNGMOQDHXcjs.useAttachmentUrl; exports.useBroadcastEvent = _chunkNGMOQDHXcjs._useBroadcastEvent; exports.useCanRedo = _chunkNGMOQDHXcjs.useCanRedo; exports.useCanUndo = _chunkNGMOQDHXcjs.useCanUndo; exports.useClient = _chunkNGMOQDHXcjs.useClient; exports.useCreateAiChat = _chunkNGMOQDHXcjs.useCreateAiChat; exports.useCreateComment = _chunkNGMOQDHXcjs.useCreateComment; exports.useCreateThread = _chunkNGMOQDHXcjs._useCreateThread; exports.useDeleteAiChat = _chunkNGMOQDHXcjs.useDeleteAiChat; exports.useDeleteAllInboxNotifications = _chunkNGMOQDHXcjs.useDeleteAllInboxNotifications; exports.useDeleteComment = _chunkNGMOQDHXcjs.useDeleteComment; exports.useDeleteInboxNotification = _chunkNGMOQDHXcjs.useDeleteInboxNotification; exports.useDeleteThread = _chunkNGMOQDHXcjs._useDeleteThread; exports.useEditComment = _chunkNGMOQDHXcjs.useEditComment; exports.useEditThreadMetadata = _chunkNGMOQDHXcjs._useEditThreadMetadata; exports.useErrorListener = _chunkNGMOQDHXcjs.useErrorListener; exports.useEventListener = _chunkNGMOQDHXcjs._useEventListener; exports.useGroupInfo = _chunkNGMOQDHXcjs.useGroupInfo; exports.useHistory = _chunkNGMOQDHXcjs.useHistory; exports.useHistoryVersionData = _chunkNGMOQDHXcjs.useHistoryVersionData; exports.useHistoryVersions = _chunkNGMOQDHXcjs._useHistoryVersions; exports.useInboxNotificationThread = _chunkNGMOQDHXcjs._useInboxNotificationThread; exports.useInboxNotifications = _chunkNGMOQDHXcjs.useInboxNotifications; exports.useIsInsideRoom = _chunkNGMOQDHXcjs._useIsInsideRoom; exports.useLostConnectionListener = _chunkNGMOQDHXcjs.useLostConnectionListener; exports.useMarkAllInboxNotificationsAsRead = _chunkNGMOQDHXcjs.useMarkAllInboxNotificationsAsRead; exports.useMarkInboxNotificationAsRead = _chunkNGMOQDHXcjs.useMarkInboxNotificationAsRead; exports.useMarkThreadAsRead = _chunkNGMOQDHXcjs.useMarkThreadAsRead; exports.useMarkThreadAsResolved = _chunkNGMOQDHXcjs.useMarkThreadAsResolved; exports.useMarkThreadAsUnresolved = _chunkNGMOQDHXcjs.useMarkThreadAsUnresolved; exports.useMutation = _chunkNGMOQDHXcjs._useMutation; exports.useMyPresence = _chunkNGMOQDHXcjs._useMyPresence; exports.useNotificationSettings = _chunkNGMOQDHXcjs.useNotificationSettings; exports.useOther = _chunkNGMOQDHXcjs._useOther; exports.useOthers = _chunkNGMOQDHXcjs._useOthers; exports.useOthersConnectionIds = _chunkNGMOQDHXcjs.useOthersConnectionIds; exports.useOthersListener = _chunkNGMOQDHXcjs._useOthersListener; exports.useOthersMapped = _chunkNGMOQDHXcjs._useOthersMapped; exports.useRedo = _chunkNGMOQDHXcjs.useRedo; exports.useRemoveReaction = _chunkNGMOQDHXcjs.useRemoveReaction; exports.useRoom = _chunkNGMOQDHXcjs._useRoom; exports.useRoomInfo = _chunkNGMOQDHXcjs.useRoomInfo; exports.useRoomSubscriptionSettings = _chunkNGMOQDHXcjs._useRoomSubscriptionSettings; exports.useSelf = _chunkNGMOQDHXcjs._useSelf; exports.useSendAiMessage = _chunkNGMOQDHXcjs.useSendAiMessage; exports.useStatus = _chunkNGMOQDHXcjs.useStatus; exports.useStorage = _chunkNGMOQDHXcjs._useStorage; exports.useStorageRoot = _chunkNGMOQDHXcjs._useStorageRoot; exports.useSubscribeToThread = _chunkNGMOQDHXcjs.useSubscribeToThread; exports.useSyncStatus = _chunkNGMOQDHXcjs.useSyncStatus; exports.useThreadSubscription = _chunkNGMOQDHXcjs.useThreadSubscription; exports.useThreads = _chunkNGMOQDHXcjs._useThreads; exports.useUndo = _chunkNGMOQDHXcjs.useUndo; exports.useUnreadInboxNotificationsCount = _chunkNGMOQDHXcjs.useUnreadInboxNotificationsCount; exports.useUnsubscribeFromThread = _chunkNGMOQDHXcjs.useUnsubscribeFromThread; exports.useUpdateMyPresence = _chunkNGMOQDHXcjs._useUpdateMyPresence; exports.useUpdateNotificationSettings = _chunkNGMOQDHXcjs.useUpdateNotificationSettings; exports.useUpdateRoomSubscriptionSettings = _chunkNGMOQDHXcjs.useUpdateRoomSubscriptionSettings; exports.useUrlMetadata = _chunkNGMOQDHXcjs._useUrlMetadata; exports.useUser = _chunkNGMOQDHXcjs._useUser; exports.useUserThreads_experimental = _chunkNGMOQDHXcjs._useUserThreads_experimental;
165
167
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;ACjFA,wCAA4B;AAe5B,4CAAsD;AAZtD,+BAAA,0BAAY,EAAU,6BAAA,EAAa,4BAAU,CAAA;ADkF7C;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,u0JAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","sourcesContent":[null,"/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} from \"./room\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n} from \"./liveblocks\";\n"]}
1
+ {"version":3,"sources":["/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","../src/index.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,wDAA6B;AAC7B;AACA;AClFA,wCAA4B;AAe5B,4CAAsD;AAZtD,+BAAA,0BAAY,EAAU,6BAAA,EAAa,4BAAU,CAAA;ADmF7C;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,m4JAAC","file":"/home/runner/work/liveblocks/liveblocks/packages/liveblocks-react/dist/index.cjs","sourcesContent":[null,"/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} from \"./room\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n useUrlMetadata,\n} from \"./liveblocks\";\n"]}
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-C97RX2dB.cjs';
2
- export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aG as useUser, aC as useUserThreads_experimental } from './room-C97RX2dB.cjs';
1
+ import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-BZvk8RRP.cjs';
2
+ export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aL as useUrlMetadata, aG as useUser, aC as useUserThreads_experimental } from './room-BZvk8RRP.cjs';
3
3
  export { Json, JsonObject, isNotificationChannelEnabled, shallow } from '@liveblocks/client';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
@@ -39,9 +39,12 @@ declare function ClientSideSuspense(props: Props): react_jsx_runtime.JSX.Element
39
39
  * description="The current mode of my application"
40
40
  * value="dark" />
41
41
  *
42
+ * Or scoped to a specific chat:
43
+ *
42
44
  * <RegisterAiKnowledge
43
45
  * description="The current list of todos"
44
- * value={todos} />
46
+ * value={todos}
47
+ * chatId="chat-1234" />
45
48
  *
46
49
  * By mounting this component, the AI will get access to this knwoledge.
47
50
  * By unmounting this component, the AI will no longer have access to it.
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-C97RX2dB.js';
2
- export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aG as useUser, aC as useUserThreads_experimental } from './room-C97RX2dB.js';
1
+ import { R as RegisterAiKnowledgeProps, w as RegisterAiToolProps } from './room-BZvk8RRP.js';
2
+ export { A as AiChatStatus, C as ClientContext, L as LiveblocksProvider, M as MutationContext, y as RoomContext, N as RoomProvider, S as SendAiMessageOptions, U as UseSendAiMessageOptions, x as UseThreadsOptions, B as createLiveblocksContext, K as createRoomContext, O as useAddReaction, aH as useAiChat, aJ as useAiChatMessages, aK as useAiChatStatus, aI as useAiChats, at as useAttachmentUrl, P as useBroadcastEvent, Q as useCanRedo, T as useCanUndo, z as useClient, az as useCreateAiChat, V as useCreateComment, W as useCreateThread, aA as useDeleteAiChat, D as useDeleteAllInboxNotifications, X as useDeleteComment, E as useDeleteInboxNotification, Y as useDeleteThread, Z as useEditComment, $ as useEditThreadMetadata, F as useErrorListener, a4 as useEventListener, aE as useGroupInfo, a5 as useHistory, al as useHistoryVersionData, au as useHistoryVersions, _ as useInboxNotificationThread, aw as useInboxNotifications, a6 as useIsInsideRoom, a7 as useLostConnectionListener, H as useMarkAllInboxNotificationsAsRead, I as useMarkInboxNotificationAsRead, a8 as useMarkThreadAsRead, a0 as useMarkThreadAsResolved, a1 as useMarkThreadAsUnresolved, a9 as useMutation, aa as useMyPresence, ax as useNotificationSettings, am as useOther, an as useOthers, ao as useOthersConnectionIds, ab as useOthersListener, ap as useOthersMapped, ac as useRedo, ad as useRemoveReaction, ae as useRoom, aD as useRoomInfo, av as useRoomSubscriptionSettings, aq as useSelf, aB as useSendAiMessage, af as useStatus, ar as useStorage, ag as useStorageRoot, a2 as useSubscribeToThread, J as useSyncStatus, ah as useThreadSubscription, as as useThreads, ai as useUndo, aF as useUnreadInboxNotificationsCount, a3 as useUnsubscribeFromThread, aj as useUpdateMyPresence, ay as useUpdateNotificationSettings, ak as useUpdateRoomSubscriptionSettings, aL as useUrlMetadata, aG as useUser, aC as useUserThreads_experimental } from './room-BZvk8RRP.js';
3
3
  export { Json, JsonObject, isNotificationChannelEnabled, shallow } from '@liveblocks/client';
4
4
  import * as react_jsx_runtime from 'react/jsx-runtime';
5
5
  import * as react from 'react';
@@ -39,9 +39,12 @@ declare function ClientSideSuspense(props: Props): react_jsx_runtime.JSX.Element
39
39
  * description="The current mode of my application"
40
40
  * value="dark" />
41
41
  *
42
+ * Or scoped to a specific chat:
43
+ *
42
44
  * <RegisterAiKnowledge
43
45
  * description="The current list of todos"
44
- * value={todos} />
46
+ * value={todos}
47
+ * chatId="chat-1234" />
45
48
  *
46
49
  * By mounting this component, the AI will get access to this knwoledge.
47
50
  * By unmounting this component, the AI will no longer have access to it.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ import {
3
3
  PKG_FORMAT,
4
4
  PKG_NAME,
5
5
  PKG_VERSION
6
- } from "./chunk-C65QJNZB.js";
6
+ } from "./chunk-SCL5CBWP.js";
7
7
  import {
8
8
  ClientContext,
9
9
  LiveblocksProvider,
@@ -36,6 +36,7 @@ import {
36
36
  _useStorageRoot,
37
37
  _useThreads,
38
38
  _useUpdateMyPresence,
39
+ _useUrlMetadata,
39
40
  _useUser,
40
41
  _useUserThreads_experimental,
41
42
  createLiveblocksContext,
@@ -78,7 +79,7 @@ import {
78
79
  useUnsubscribeFromThread,
79
80
  useUpdateNotificationSettings,
80
81
  useUpdateRoomSubscriptionSettings
81
- } from "./chunk-2R44HQCN.js";
82
+ } from "./chunk-J2LMX3A6.js";
82
83
 
83
84
  // src/index.ts
84
85
  import { detectDupes } from "@liveblocks/core";
@@ -159,6 +160,7 @@ export {
159
160
  _useUpdateMyPresence as useUpdateMyPresence,
160
161
  useUpdateNotificationSettings,
161
162
  useUpdateRoomSubscriptionSettings,
163
+ _useUrlMetadata as useUrlMetadata,
162
164
  _useUser as useUser,
163
165
  _useUserThreads_experimental as useUserThreads_experimental
164
166
  };
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} from \"./room\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAe5B,SAAS,SAAS,oCAAoC;AAZtD,YAAY,UAAU,aAAa,UAAU;","names":[]}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/* eslint-disable simple-import-sort/exports */\nimport { detectDupes } from \"@liveblocks/core\";\n\nimport { PKG_FORMAT, PKG_NAME, PKG_VERSION } from \"./version\";\ndetectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);\n\nexport { ClientSideSuspense } from \"./ClientSideSuspense\";\nexport type {\n MutationContext,\n UseSendAiMessageOptions,\n UseThreadsOptions,\n SendAiMessageOptions,\n} from \"./types\";\n\n// Re-exports from @liveblocks/client, for convenience\nexport type { Json, JsonObject } from \"@liveblocks/client\";\nexport { shallow, isNotificationChannelEnabled } from \"@liveblocks/client\";\n\n// Export all the top-level hooks\nexport { RegisterAiKnowledge, RegisterAiTool } from \"./ai\";\nexport type {\n AiChatStatus,\n RegisterAiKnowledgeProps,\n RegisterAiToolProps,\n} from \"./types/ai\";\nexport { ClientContext, RoomContext, useClient } from \"./contexts\";\nexport {\n createLiveblocksContext,\n LiveblocksProvider,\n useDeleteAllInboxNotifications,\n useDeleteInboxNotification,\n useErrorListener,\n useInboxNotificationThread,\n useMarkAllInboxNotificationsAsRead,\n useMarkInboxNotificationAsRead,\n useSyncStatus,\n} from \"./liveblocks\";\nexport {\n createRoomContext,\n RoomProvider,\n useAddReaction,\n useBroadcastEvent,\n useCanRedo,\n useCanUndo,\n useCreateComment,\n useCreateThread,\n useDeleteComment,\n useDeleteThread,\n useEditComment,\n useEditThreadMetadata,\n useMarkThreadAsResolved,\n useMarkThreadAsUnresolved,\n useSubscribeToThread,\n useUnsubscribeFromThread,\n useEventListener,\n useHistory,\n useIsInsideRoom,\n useLostConnectionListener,\n useMarkThreadAsRead,\n useMutation,\n useMyPresence,\n useOthersListener,\n useRedo,\n useRemoveReaction,\n useRoom,\n useStatus,\n useStorageRoot,\n useThreadSubscription,\n useUndo,\n useUpdateMyPresence,\n useUpdateRoomSubscriptionSettings,\n useHistoryVersionData,\n} from \"./room\";\n\n// Export the classic (non-Suspense) versions of our hooks\n// (This part differs from src/suspense.ts)\nexport {\n useOther,\n useOthers,\n useOthersConnectionIds,\n useOthersMapped,\n useSelf,\n useStorage,\n useThreads,\n useAttachmentUrl,\n useHistoryVersions,\n useRoomSubscriptionSettings,\n} from \"./room\";\nexport {\n useInboxNotifications,\n useNotificationSettings,\n useUpdateNotificationSettings,\n useCreateAiChat,\n useDeleteAiChat,\n useSendAiMessage,\n useUserThreads_experimental as useUserThreads_experimental,\n useRoomInfo,\n useGroupInfo,\n useUnreadInboxNotificationsCount,\n useUser,\n useAiChat,\n useAiChats,\n useAiChatMessages,\n useAiChatStatus,\n useUrlMetadata,\n} from \"./liveblocks\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,mBAAmB;AAe5B,SAAS,SAAS,oCAAoC;AAZtD,YAAY,UAAU,aAAa,UAAU;","names":[]}
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { ComponentType, Context, PropsWithChildren, ReactNode } from 'react';
3
3
  import { BaseUserMeta, Client, JsonObject, LsonObject, LiveObject, User, Json, RoomSubscriptionSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ClientOptions, ThreadData as ThreadData$1, CommentData as CommentData$1 } from '@liveblocks/client';
4
4
  import * as _liveblocks_core from '@liveblocks/core';
5
- import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, DerivedSignal, DefaultMap, SubscriptionData, SubscriptionKey, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
5
+ import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, UrlMetadata, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, SubscriptionKey, SubscriptionData, DerivedSignal, DefaultMap, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
8
  /**
@@ -35,14 +35,18 @@ type RegisterAiKnowledgeProps = AiKnowledgeSource & {
35
35
  * precedence.
36
36
  */
37
37
  id?: string;
38
+ /**
39
+ * When provided, the knowledge source will only be available for this chatId.
40
+ * If not provided, this knowledge source will be available globally.
41
+ */
42
+ chatId?: string;
38
43
  };
39
44
  type RegisterAiToolProps = {
40
45
  name: string;
41
46
  tool: AiOpaqueToolDefinition;
42
47
  /**
43
48
  * When provided, the tool will only be available for this chatId. If not
44
- * provided, this tool will globally be made available to any AiChat
45
- * instance.
49
+ * provided, this tool will be available globally.
46
50
  */
47
51
  chatId?: string;
48
52
  /**
@@ -59,6 +63,8 @@ type RegisterAiToolProps = {
59
63
  * generation is in progress.
60
64
  */
61
65
  type AiChatStatus = Relax<{
66
+ status: "disconnected";
67
+ } | {
62
68
  status: "loading";
63
69
  } | {
64
70
  status: "idle";
@@ -125,6 +131,11 @@ type ThreadsQuery<M extends BaseMetadata> = {
125
131
  * all threads will be returned.
126
132
  */
127
133
  resolved?: boolean;
134
+ /**
135
+ * Whether to only return threads that the user is subscribed to or not. If not provided,
136
+ * all threads will be returned.
137
+ */
138
+ subscribed?: boolean;
128
139
  /**
129
140
  * The metadata to filter the threads by. If provided, only threads with metadata that matches
130
141
  * the provided metadata will be returned. If not provided, all threads will be returned.
@@ -235,6 +246,8 @@ type AiChatAsyncSuccess = AsyncSuccess<AiChat, "chat">;
235
246
  type AiChatAsyncResult = AsyncResult<AiChat, "chat">;
236
247
  type AiChatMessagesAsyncSuccess = AsyncSuccess<readonly UiChatMessage[], "messages">;
237
248
  type AiChatMessagesAsyncResult = AsyncResult<readonly UiChatMessage[], "messages">;
249
+ type UrlMetadataAsyncSuccess = AsyncSuccess<UrlMetadata, "metadata">;
250
+ type UrlMetadataAsyncResult = AsyncResult<UrlMetadata, "metadata">;
238
251
 
239
252
  type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
240
253
  /**
@@ -1279,6 +1292,13 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
1279
1292
  * ```
1280
1293
  */
1281
1294
  useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
1295
+ /**
1296
+ * Returns metadata for a given URL.
1297
+ *
1298
+ * @example
1299
+ * const { metadata, error, isLoading } = useUrlMetadata("https://liveblocks.io");
1300
+ */
1301
+ useUrlMetadata(url: string): UrlMetadataAsyncResult;
1282
1302
  suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
1283
1303
  /**
1284
1304
  * Returns the inbox notifications for the current user.
@@ -1355,6 +1375,13 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
1355
1375
  * ```
1356
1376
  */
1357
1377
  useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
1378
+ /**
1379
+ * Returns metadata for a given URL.
1380
+ *
1381
+ * @example
1382
+ * const { metadata } = useUrlMetadata("https://liveblocks.io");
1383
+ */
1384
+ useUrlMetadata(url: string): UrlMetadataAsyncSuccess;
1358
1385
  }>;
1359
1386
  }>;
1360
1387
 
@@ -1405,8 +1432,10 @@ declare class ThreadDB<M extends BaseMetadata> {
1405
1432
  * 'desc' means by updatedAt DESC
1406
1433
  *
1407
1434
  * Will never return deleted threads in the result.
1435
+ *
1436
+ * Subscriptions are needed to filter threads based on the user's subscriptions.
1408
1437
  */
1409
- findMany(roomId: string | undefined, query: ThreadsQuery<M> | undefined, direction: "asc" | "desc"): ThreadData<M>[];
1438
+ findMany(roomId: string | undefined, query: ThreadsQuery<M> | undefined, direction: "asc" | "desc", subscriptions: Record<SubscriptionKey, SubscriptionData> | undefined): ThreadData<M>[];
1410
1439
  }
1411
1440
 
1412
1441
  type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | SubscribeToThreadOptimisticUpdate | UnsubscribeFromThreadOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateRoomSubscriptionSettingsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
@@ -1627,6 +1656,12 @@ declare function createStore_forHistoryVersions(): {
1627
1656
  }>;
1628
1657
  update: (roomId: string, versions: HistoryVersion[]) => void;
1629
1658
  };
1659
+ declare function createStore_forUrlsMetadata(): {
1660
+ signal: DerivedSignal<{
1661
+ [k: string]: UrlMetadata;
1662
+ }>;
1663
+ update: (url: string, metadata: UrlMetadata) => void;
1664
+ };
1630
1665
  declare function createStore_forPermissionHints(): {
1631
1666
  getPermissionForRoomΣ: (roomId: string) => ISignal<Set<Permission>>;
1632
1667
  update: (newHints: Record<string, Permission[]>) => void;
@@ -1666,6 +1701,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1666
1701
  readonly roomSubscriptionSettings: ReturnType<typeof createStore_forRoomSubscriptionSettings>;
1667
1702
  readonly historyVersions: ReturnType<typeof createStore_forHistoryVersions>;
1668
1703
  readonly unreadNotificationsCount: ReturnType<typeof createStore_forUnreadNotificationsCount>;
1704
+ readonly urlsMetadata: ReturnType<typeof createStore_forUrlsMetadata>;
1669
1705
  readonly permissionHints: ReturnType<typeof createStore_forPermissionHints>;
1670
1706
  readonly notificationSettings: ReturnType<typeof createStore_forNotificationSettings>;
1671
1707
  readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<M>>;
@@ -1684,6 +1720,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1684
1720
  readonly aiChats: DefaultMap<AiChatsQueryKey, LoadableResource<AiChatsAsyncResult>>;
1685
1721
  readonly messagesByChatId: DefaultMap<string, DefaultMap<MessageId | null, LoadableResource<AiChatMessagesAsyncResult>>>;
1686
1722
  readonly aiChatById: DefaultMap<string, LoadableResource<AiChatAsyncResult>>;
1723
+ readonly urlMetadataByUrl: DefaultMap<string, LoadableResource<UrlMetadataAsyncResult>>;
1687
1724
  };
1688
1725
  constructor(client: OpaqueClient);
1689
1726
  /**
@@ -1797,8 +1834,8 @@ declare function useCreateAiChat(): {
1797
1834
  */
1798
1835
  declare function useDeleteAiChat(): (chatId: string) => void;
1799
1836
  /**
1800
- * Returns the status of an AI chat, indicating whether it's idle or actively
1801
- * generating content. This is a convenience hook that derives its state from
1837
+ * Returns the status of an AI chat, indicating whether it's disconnected, loading, idle
1838
+ * or actively generating content. This is a convenience hook that derives its state from
1802
1839
  * the latest assistant message in the chat.
1803
1840
  *
1804
1841
  * Re-renders whenever any of the relevant fields change.
@@ -1812,7 +1849,7 @@ declare function useDeleteAiChat(): (chatId: string) => void;
1812
1849
  *
1813
1850
  * function ChatStatus() {
1814
1851
  * const { status, partType, toolName } = useAiChatStatus("my-chat");
1815
- * console.log(status); // "loading" | "idle" | "generating"
1852
+ * console.log(status); // "disconnected" | "loading" | "idle" | "generating"
1816
1853
  * console.log(status.partType); // "text" | "tool-invocation" | ...
1817
1854
  * console.log(status.toolName); // string | undefined
1818
1855
  * }
@@ -2102,6 +2139,20 @@ declare const _useAiChatMessages: TypedBundle$1["useAiChatMessages"];
2102
2139
  * const { messages, error, isLoading } = useAiChatMessages("my-chat");
2103
2140
  */
2104
2141
  declare const _useAiChatMessagesSuspense: TypedBundle$1["suspense"]["useAiChatMessages"];
2142
+ /**
2143
+ * Returns metadata for a given URL.
2144
+ *
2145
+ * @example
2146
+ * const { metadata, error, isLoading } = useUrlMetadata("https://liveblocks.io");
2147
+ */
2148
+ declare const _useUrlMetadata: TypedBundle$1["useUrlMetadata"];
2149
+ /**
2150
+ * Returns metadata for a given URL.
2151
+ *
2152
+ * @example
2153
+ * const { metadata } = useUrlMetadata("https://liveblocks.io");
2154
+ */
2155
+ declare const _useUrlMetadataSuspense: TypedBundle$1["suspense"]["useUrlMetadata"];
2105
2156
  /**
2106
2157
  * Returns the current Liveblocks sync status, and triggers a re-render
2107
2158
  * whenever it changes. Can be used to render a "Saving..." indicator, or for
@@ -2856,4 +2907,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
2856
2907
  */
2857
2908
  declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
2858
2909
 
2859
- export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserThreadsSuspense_experimental as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useOtherSuspense as aL, _useOthersSuspense as aM, useOthersConnectionIdsSuspense as aN, _useOthersMappedSuspense as aO, _useSelfSuspense as aP, _useStorageSuspense as aQ, _useThreadsSuspense as aR, useAttachmentUrlSuspense as aS, _useHistoryVersionsSuspense as aT, _useRoomSubscriptionSettingsSuspense as aU, useInboxNotificationsSuspense as aV, useNotificationSettingsSuspense as aW, useRoomInfoSuspense as aX, useGroupInfoSuspense as aY, useUnreadInboxNotificationsCountSuspense as aZ, _useUserSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useAiChatsSuspense as b0, _useAiChatMessagesSuspense as b1, _useAiChatSuspense as b2, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
2910
+ export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserSuspense as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useUrlMetadata as aL, _useOtherSuspense as aM, _useOthersSuspense as aN, useOthersConnectionIdsSuspense as aO, _useOthersMappedSuspense as aP, _useSelfSuspense as aQ, _useStorageSuspense as aR, _useThreadsSuspense as aS, useAttachmentUrlSuspense as aT, _useHistoryVersionsSuspense as aU, _useRoomSubscriptionSettingsSuspense as aV, useInboxNotificationsSuspense as aW, useNotificationSettingsSuspense as aX, useRoomInfoSuspense as aY, useGroupInfoSuspense as aZ, useUnreadInboxNotificationsCountSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useUserThreadsSuspense_experimental as b0, _useAiChatsSuspense as b1, _useAiChatMessagesSuspense as b2, _useAiChatSuspense as b3, _useUrlMetadataSuspense as b4, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
@@ -2,7 +2,7 @@ import * as react from 'react';
2
2
  import { ComponentType, Context, PropsWithChildren, ReactNode } from 'react';
3
3
  import { BaseUserMeta, Client, JsonObject, LsonObject, LiveObject, User, Json, RoomSubscriptionSettings, Room, Status, BroadcastOptions, OthersEvent, LostConnectionEvent, History, BaseMetadata as BaseMetadata$1, ClientOptions, ThreadData as ThreadData$1, CommentData as CommentData$1 } from '@liveblocks/client';
4
4
  import * as _liveblocks_core from '@liveblocks/core';
5
- import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, DerivedSignal, DefaultMap, SubscriptionData, SubscriptionKey, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
5
+ import { OpaqueClient, OpaqueRoom, AiKnowledgeSource, AiOpaqueToolDefinition, Relax, AiAssistantContentPart, BaseMetadata, QueryMetadata, AsyncResult, DRI, AsyncSuccess, DGI, GroupData, Resolve, CommentBody, CommentAttachment, PartialUnless, Patchable, InboxNotificationData, NotificationSettings, ToImmutable, MessageId, PartialNotificationSettings, AiChatsQuery, AsyncLoading, AsyncError, ThreadData, HistoryVersion, AiChat, UrlMetadata, Client as Client$1, LiveblocksError, SyncStatus, RoomEventMessage, CommentData, AiUserMessage, WithRequired, AiChatMessage, WithNavigation, MutableSignal, ThreadDataWithDeleteInfo, ThreadDeleteInfo, SubscriptionKey, SubscriptionData, DerivedSignal, DefaultMap, CommentUserReaction, InboxNotificationDeleteInfo, SubscriptionDeleteInfo, RoomSubscriptionSettings as RoomSubscriptionSettings$1, ISignal, Permission, BaseUserMeta as BaseUserMeta$1, DistributiveOmit, DU, DM, TextEditorType, IYjsProvider, MentionData, DP, DS, DE } from '@liveblocks/core';
6
6
  import * as react_jsx_runtime from 'react/jsx-runtime';
7
7
 
8
8
  /**
@@ -35,14 +35,18 @@ type RegisterAiKnowledgeProps = AiKnowledgeSource & {
35
35
  * precedence.
36
36
  */
37
37
  id?: string;
38
+ /**
39
+ * When provided, the knowledge source will only be available for this chatId.
40
+ * If not provided, this knowledge source will be available globally.
41
+ */
42
+ chatId?: string;
38
43
  };
39
44
  type RegisterAiToolProps = {
40
45
  name: string;
41
46
  tool: AiOpaqueToolDefinition;
42
47
  /**
43
48
  * When provided, the tool will only be available for this chatId. If not
44
- * provided, this tool will globally be made available to any AiChat
45
- * instance.
49
+ * provided, this tool will be available globally.
46
50
  */
47
51
  chatId?: string;
48
52
  /**
@@ -59,6 +63,8 @@ type RegisterAiToolProps = {
59
63
  * generation is in progress.
60
64
  */
61
65
  type AiChatStatus = Relax<{
66
+ status: "disconnected";
67
+ } | {
62
68
  status: "loading";
63
69
  } | {
64
70
  status: "idle";
@@ -125,6 +131,11 @@ type ThreadsQuery<M extends BaseMetadata> = {
125
131
  * all threads will be returned.
126
132
  */
127
133
  resolved?: boolean;
134
+ /**
135
+ * Whether to only return threads that the user is subscribed to or not. If not provided,
136
+ * all threads will be returned.
137
+ */
138
+ subscribed?: boolean;
128
139
  /**
129
140
  * The metadata to filter the threads by. If provided, only threads with metadata that matches
130
141
  * the provided metadata will be returned. If not provided, all threads will be returned.
@@ -235,6 +246,8 @@ type AiChatAsyncSuccess = AsyncSuccess<AiChat, "chat">;
235
246
  type AiChatAsyncResult = AsyncResult<AiChat, "chat">;
236
247
  type AiChatMessagesAsyncSuccess = AsyncSuccess<readonly UiChatMessage[], "messages">;
237
248
  type AiChatMessagesAsyncResult = AsyncResult<readonly UiChatMessage[], "messages">;
249
+ type UrlMetadataAsyncSuccess = AsyncSuccess<UrlMetadata, "metadata">;
250
+ type UrlMetadataAsyncResult = AsyncResult<UrlMetadata, "metadata">;
238
251
 
239
252
  type RoomProviderProps<P extends JsonObject, S extends LsonObject> = Resolve<{
240
253
  /**
@@ -1279,6 +1292,13 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
1279
1292
  * ```
1280
1293
  */
1281
1294
  useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
1295
+ /**
1296
+ * Returns metadata for a given URL.
1297
+ *
1298
+ * @example
1299
+ * const { metadata, error, isLoading } = useUrlMetadata("https://liveblocks.io");
1300
+ */
1301
+ useUrlMetadata(url: string): UrlMetadataAsyncResult;
1282
1302
  suspense: Resolve<LiveblocksContextBundleCommon<M> & SharedContextBundle<U>["suspense"] & {
1283
1303
  /**
1284
1304
  * Returns the inbox notifications for the current user.
@@ -1355,6 +1375,13 @@ type LiveblocksContextBundle<U extends BaseUserMeta, M extends BaseMetadata> = R
1355
1375
  * ```
1356
1376
  */
1357
1377
  useAiChatStatus(chatId: string, branchId?: MessageId): AiChatStatus;
1378
+ /**
1379
+ * Returns metadata for a given URL.
1380
+ *
1381
+ * @example
1382
+ * const { metadata } = useUrlMetadata("https://liveblocks.io");
1383
+ */
1384
+ useUrlMetadata(url: string): UrlMetadataAsyncSuccess;
1358
1385
  }>;
1359
1386
  }>;
1360
1387
 
@@ -1405,8 +1432,10 @@ declare class ThreadDB<M extends BaseMetadata> {
1405
1432
  * 'desc' means by updatedAt DESC
1406
1433
  *
1407
1434
  * Will never return deleted threads in the result.
1435
+ *
1436
+ * Subscriptions are needed to filter threads based on the user's subscriptions.
1408
1437
  */
1409
- findMany(roomId: string | undefined, query: ThreadsQuery<M> | undefined, direction: "asc" | "desc"): ThreadData<M>[];
1438
+ findMany(roomId: string | undefined, query: ThreadsQuery<M> | undefined, direction: "asc" | "desc", subscriptions: Record<SubscriptionKey, SubscriptionData> | undefined): ThreadData<M>[];
1410
1439
  }
1411
1440
 
1412
1441
  type OptimisticUpdate<M extends BaseMetadata> = CreateThreadOptimisticUpdate<M> | DeleteThreadOptimisticUpdate | EditThreadMetadataOptimisticUpdate<M> | MarkThreadAsResolvedOptimisticUpdate | MarkThreadAsUnresolvedOptimisticUpdate | SubscribeToThreadOptimisticUpdate | UnsubscribeFromThreadOptimisticUpdate | CreateCommentOptimisticUpdate | EditCommentOptimisticUpdate | DeleteCommentOptimisticUpdate | AddReactionOptimisticUpdate | RemoveReactionOptimisticUpdate | MarkInboxNotificationAsReadOptimisticUpdate | MarkAllInboxNotificationsAsReadOptimisticUpdate | DeleteInboxNotificationOptimisticUpdate | DeleteAllInboxNotificationsOptimisticUpdate | UpdateRoomSubscriptionSettingsOptimisticUpdate | UpdateNotificationSettingsOptimisticUpdate;
@@ -1627,6 +1656,12 @@ declare function createStore_forHistoryVersions(): {
1627
1656
  }>;
1628
1657
  update: (roomId: string, versions: HistoryVersion[]) => void;
1629
1658
  };
1659
+ declare function createStore_forUrlsMetadata(): {
1660
+ signal: DerivedSignal<{
1661
+ [k: string]: UrlMetadata;
1662
+ }>;
1663
+ update: (url: string, metadata: UrlMetadata) => void;
1664
+ };
1630
1665
  declare function createStore_forPermissionHints(): {
1631
1666
  getPermissionForRoomΣ: (roomId: string) => ISignal<Set<Permission>>;
1632
1667
  update: (newHints: Record<string, Permission[]>) => void;
@@ -1666,6 +1701,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1666
1701
  readonly roomSubscriptionSettings: ReturnType<typeof createStore_forRoomSubscriptionSettings>;
1667
1702
  readonly historyVersions: ReturnType<typeof createStore_forHistoryVersions>;
1668
1703
  readonly unreadNotificationsCount: ReturnType<typeof createStore_forUnreadNotificationsCount>;
1704
+ readonly urlsMetadata: ReturnType<typeof createStore_forUrlsMetadata>;
1669
1705
  readonly permissionHints: ReturnType<typeof createStore_forPermissionHints>;
1670
1706
  readonly notificationSettings: ReturnType<typeof createStore_forNotificationSettings>;
1671
1707
  readonly optimisticUpdates: ReturnType<typeof createStore_forOptimistic<M>>;
@@ -1684,6 +1720,7 @@ declare class UmbrellaStore<M extends BaseMetadata> {
1684
1720
  readonly aiChats: DefaultMap<AiChatsQueryKey, LoadableResource<AiChatsAsyncResult>>;
1685
1721
  readonly messagesByChatId: DefaultMap<string, DefaultMap<MessageId | null, LoadableResource<AiChatMessagesAsyncResult>>>;
1686
1722
  readonly aiChatById: DefaultMap<string, LoadableResource<AiChatAsyncResult>>;
1723
+ readonly urlMetadataByUrl: DefaultMap<string, LoadableResource<UrlMetadataAsyncResult>>;
1687
1724
  };
1688
1725
  constructor(client: OpaqueClient);
1689
1726
  /**
@@ -1797,8 +1834,8 @@ declare function useCreateAiChat(): {
1797
1834
  */
1798
1835
  declare function useDeleteAiChat(): (chatId: string) => void;
1799
1836
  /**
1800
- * Returns the status of an AI chat, indicating whether it's idle or actively
1801
- * generating content. This is a convenience hook that derives its state from
1837
+ * Returns the status of an AI chat, indicating whether it's disconnected, loading, idle
1838
+ * or actively generating content. This is a convenience hook that derives its state from
1802
1839
  * the latest assistant message in the chat.
1803
1840
  *
1804
1841
  * Re-renders whenever any of the relevant fields change.
@@ -1812,7 +1849,7 @@ declare function useDeleteAiChat(): (chatId: string) => void;
1812
1849
  *
1813
1850
  * function ChatStatus() {
1814
1851
  * const { status, partType, toolName } = useAiChatStatus("my-chat");
1815
- * console.log(status); // "loading" | "idle" | "generating"
1852
+ * console.log(status); // "disconnected" | "loading" | "idle" | "generating"
1816
1853
  * console.log(status.partType); // "text" | "tool-invocation" | ...
1817
1854
  * console.log(status.toolName); // string | undefined
1818
1855
  * }
@@ -2102,6 +2139,20 @@ declare const _useAiChatMessages: TypedBundle$1["useAiChatMessages"];
2102
2139
  * const { messages, error, isLoading } = useAiChatMessages("my-chat");
2103
2140
  */
2104
2141
  declare const _useAiChatMessagesSuspense: TypedBundle$1["suspense"]["useAiChatMessages"];
2142
+ /**
2143
+ * Returns metadata for a given URL.
2144
+ *
2145
+ * @example
2146
+ * const { metadata, error, isLoading } = useUrlMetadata("https://liveblocks.io");
2147
+ */
2148
+ declare const _useUrlMetadata: TypedBundle$1["useUrlMetadata"];
2149
+ /**
2150
+ * Returns metadata for a given URL.
2151
+ *
2152
+ * @example
2153
+ * const { metadata } = useUrlMetadata("https://liveblocks.io");
2154
+ */
2155
+ declare const _useUrlMetadataSuspense: TypedBundle$1["suspense"]["useUrlMetadata"];
2105
2156
  /**
2106
2157
  * Returns the current Liveblocks sync status, and triggers a re-render
2107
2158
  * whenever it changes. Can be used to render a "Saving..." indicator, or for
@@ -2856,4 +2907,4 @@ declare const _useStorageRoot: TypedBundle["useStorageRoot"];
2856
2907
  */
2857
2908
  declare const _useUpdateMyPresence: TypedBundle["useUpdateMyPresence"];
2858
2909
 
2859
- export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserThreadsSuspense_experimental as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useOtherSuspense as aL, _useOthersSuspense as aM, useOthersConnectionIdsSuspense as aN, _useOthersMappedSuspense as aO, _useSelfSuspense as aP, _useStorageSuspense as aQ, _useThreadsSuspense as aR, useAttachmentUrlSuspense as aS, _useHistoryVersionsSuspense as aT, _useRoomSubscriptionSettingsSuspense as aU, useInboxNotificationsSuspense as aV, useNotificationSettingsSuspense as aW, useRoomInfoSuspense as aX, useGroupInfoSuspense as aY, useUnreadInboxNotificationsCountSuspense as aZ, _useUserSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useAiChatsSuspense as b0, _useAiChatMessagesSuspense as b1, _useAiChatSuspense as b2, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };
2910
+ export { _useEditThreadMetadata as $, type AiChatStatus as A, createLiveblocksContext as B, ClientContext as C, useDeleteAllInboxNotifications as D, useDeleteInboxNotification as E, useErrorListener as F, type GroupAsyncResult as G, useMarkAllInboxNotificationsAsRead as H, useMarkInboxNotificationAsRead as I, useSyncStatus as J, createRoomContext as K, LiveblocksProvider as L, type MutationContext as M, _RoomProvider as N, _useAddReaction as O, _useBroadcastEvent as P, useCanRedo as Q, type RegisterAiKnowledgeProps as R, type SendAiMessageOptions as S, useCanUndo as T, type UseSendAiMessageOptions as U, useCreateComment as V, _useCreateThread as W, useDeleteComment as X, _useDeleteThread as Y, useEditComment as Z, _useInboxNotificationThread as _, useAddRoomCommentReaction as a, _useUserSuspense as a$, useMarkThreadAsResolved as a0, useMarkThreadAsUnresolved as a1, useSubscribeToThread as a2, useUnsubscribeFromThread as a3, _useEventListener as a4, useHistory as a5, _useIsInsideRoom as a6, useLostConnectionListener as a7, useMarkThreadAsRead as a8, _useMutation as a9, useDeleteAiChat as aA, useSendAiMessage as aB, _useUserThreads_experimental as aC, useRoomInfo as aD, useGroupInfo as aE, useUnreadInboxNotificationsCount as aF, _useUser as aG, _useAiChat as aH, _useAiChats as aI, _useAiChatMessages as aJ, useAiChatStatus as aK, _useUrlMetadata as aL, _useOtherSuspense as aM, _useOthersSuspense as aN, useOthersConnectionIdsSuspense as aO, _useOthersMappedSuspense as aP, _useSelfSuspense as aQ, _useStorageSuspense as aR, _useThreadsSuspense as aS, useAttachmentUrlSuspense as aT, _useHistoryVersionsSuspense as aU, _useRoomSubscriptionSettingsSuspense as aV, useInboxNotificationsSuspense as aW, useNotificationSettingsSuspense as aX, useRoomInfoSuspense as aY, useGroupInfoSuspense as aZ, useUnreadInboxNotificationsCountSuspense as a_, _useMyPresence as aa, _useOthersListener as ab, useRedo as ac, useRemoveReaction as ad, _useRoom as ae, useStatus as af, _useStorageRoot as ag, useThreadSubscription as ah, useUndo as ai, _useUpdateMyPresence as aj, useUpdateRoomSubscriptionSettings as ak, useHistoryVersionData as al, _useOther as am, _useOthers as an, useOthersConnectionIds as ao, _useOthersMapped as ap, _useSelf as aq, _useStorage as ar, _useThreads as as, useAttachmentUrl as at, _useHistoryVersions as au, _useRoomSubscriptionSettings as av, useInboxNotifications as aw, useNotificationSettings as ax, useUpdateNotificationSettings as ay, useCreateAiChat as az, useCreateRoomComment as b, _useUserThreadsSuspense_experimental as b0, _useAiChatsSuspense as b1, _useAiChatMessagesSuspense as b2, _useAiChatSuspense as b3, _useUrlMetadataSuspense as b4, useCreateRoomThread as c, useCreateTextMention as d, useDeleteRoomComment as e, useDeleteRoomThread as f, getUmbrellaStoreForClient as g, useDeleteTextMention as h, useEditRoomComment as i, useEditRoomThreadMetadata as j, useMarkRoomThreadAsRead as k, useMarkRoomThreadAsResolved as l, useMarkRoomThreadAsUnresolved as m, useMentionSuggestionsCache as n, useRemoveRoomCommentReaction as o, useReportTextEditor as p, useResolveMentionSuggestions as q, useRoomAttachmentUrl as r, useRoomPermissions as s, useRoomThreadSubscription as t, useClientOrNull as u, useYjsProvider as v, type RegisterAiToolProps as w, type UseThreadsOptions as x, RoomContext as y, useClient as z };