@liveblocks/core 2.25.0-aiprivatebeta14 → 2.25.0-aiprivatebeta15

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.d.cts CHANGED
@@ -1191,8 +1191,10 @@ type CommentBodyParagraph = {
1191
1191
  type: "paragraph";
1192
1192
  children: CommentBodyInlineElement[];
1193
1193
  };
1194
- type CommentBodyMention = {
1194
+ type CommentBodyMention = Relax<CommentBodyUserMention>;
1195
+ type CommentBodyUserMention = {
1195
1196
  type: "mention";
1197
+ kind: "user";
1196
1198
  id: string;
1197
1199
  };
1198
1200
  type CommentBodyLink = {
@@ -1289,13 +1291,6 @@ type NotificationChannelSettings = {
1289
1291
  type NotificationSettingsPlain = {
1290
1292
  [C in NotificationChannel]?: NotificationChannelSettings;
1291
1293
  };
1292
- /**
1293
- * @deprecated Renamed to `NotificationSettings`
1294
- *
1295
- * Notification settings.
1296
- * One channel for one set of settings.
1297
- */
1298
- type UserNotificationSettings = NotificationSettings;
1299
1294
  /**
1300
1295
  * Notification settings.
1301
1296
  * One channel for one set of settings.
@@ -1362,10 +1357,6 @@ type RoomSubscriptionSettings = {
1362
1357
  type UserRoomSubscriptionSettings = {
1363
1358
  roomId: string;
1364
1359
  } & RoomSubscriptionSettings;
1365
- /**
1366
- * @deprecated Renamed to `RoomSubscriptionSettings`
1367
- */
1368
- type RoomNotificationSettings = RoomSubscriptionSettings;
1369
1360
 
1370
1361
  type SubscriptionData<K extends keyof DAD = keyof DAD> = {
1371
1362
  kind: NotificationKind<K>;
@@ -1818,14 +1809,11 @@ type CommentsOrNotificationsErrorContext = {
1818
1809
  inboxNotificationId: string;
1819
1810
  } | {
1820
1811
  type: "MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR" | "DELETE_ALL_INBOX_NOTIFICATIONS_ERROR";
1821
- } | {
1822
- type: "UPDATE_NOTIFICATION_SETTINGS_ERROR";
1823
- roomId: string;
1824
1812
  } | {
1825
1813
  type: "UPDATE_ROOM_SUBSCRIPTION_SETTINGS_ERROR";
1826
1814
  roomId: string;
1827
1815
  } | {
1828
- type: "UPDATE_USER_NOTIFICATION_SETTINGS_ERROR";
1816
+ type: "UPDATE_NOTIFICATION_SETTINGS_ERROR";
1829
1817
  };
1830
1818
  type LiveblocksErrorContext = Relax<RoomConnectionErrorContext | CommentsOrNotificationsErrorContext | AiConnectionErrorContext>;
1831
1819
  declare class LiveblocksError extends Error {
@@ -1833,8 +1821,6 @@ declare class LiveblocksError extends Error {
1833
1821
  constructor(message: string, context: LiveblocksErrorContext, cause?: Error);
1834
1822
  /** Convenience accessor for error.context.roomId (if available) */
1835
1823
  get roomId(): LiveblocksErrorContext["roomId"];
1836
- /** @deprecated Prefer using `context.code` instead, to enable type narrowing */
1837
- get code(): LiveblocksErrorContext["code"];
1838
1824
  /**
1839
1825
  * Creates a LiveblocksError from a generic error, by attaching Liveblocks
1840
1826
  * contextual information like room ID, thread ID, etc.
@@ -1842,6 +1828,12 @@ declare class LiveblocksError extends Error {
1842
1828
  static from(context: LiveblocksErrorContext, cause?: Error): LiveblocksError;
1843
1829
  }
1844
1830
 
1831
+ type MentionData = Relax<UserMentionData>;
1832
+ type UserMentionData = {
1833
+ kind: "user";
1834
+ id: string;
1835
+ };
1836
+
1845
1837
  type ResolveMentionSuggestionsArgs = {
1846
1838
  /**
1847
1839
  * The ID of the current room.
@@ -1903,7 +1895,7 @@ type InternalSyncStatus = SyncStatus | "has-local-changes";
1903
1895
  */
1904
1896
  type PrivateClientApi<U extends BaseUserMeta, M extends BaseMetadata> = {
1905
1897
  readonly currentUserId: Signal<string | undefined>;
1906
- readonly mentionSuggestionsCache: Map<string, string[]>;
1898
+ readonly mentionSuggestionsCache: Map<string, MentionData[]>;
1907
1899
  readonly resolveMentionSuggestions: ClientOptions<U>["resolveMentionSuggestions"];
1908
1900
  readonly usersStore: BatchStore<U["info"] | undefined, string>;
1909
1901
  readonly roomsInfoStore: BatchStore<DRI | undefined, string>;
@@ -2154,13 +2146,11 @@ type ClientOptions<U extends BaseUserMeta = DU> = {
2154
2146
  backgroundKeepAliveTimeout?: number;
2155
2147
  polyfills?: Polyfills;
2156
2148
  largeMessageStrategy?: LargeMessageStrategy;
2157
- /** @deprecated Use `largeMessageStrategy="experimental-fallback-to-http"` instead. */
2158
- unstable_fallbackToHTTP?: boolean;
2159
2149
  unstable_streamData?: boolean;
2160
2150
  /**
2161
- * A function that returns a list of user IDs matching a string.
2151
+ * A function that returns a list of mention suggestions matching a string.
2162
2152
  */
2163
- resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => Awaitable<string[]>;
2153
+ resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => Awaitable<string[] | MentionData[]>;
2164
2154
  /**
2165
2155
  * A function that returns user info from user IDs.
2166
2156
  * You should return a list of user objects of the same size, in the same order.
@@ -3012,11 +3002,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3012
3002
  readonly self: Observable<User<P, U>>;
3013
3003
  readonly myPresence: Observable<P>;
3014
3004
  readonly others: Observable<OthersEvent<P, U>>;
3015
- /**
3016
- * @deprecated Renamed to `storageBatch`. The `storage` event source will
3017
- * soon be replaced by another/incompatible API.
3018
- */
3019
- readonly storage: Observable<StorageUpdate[]>;
3020
3005
  readonly storageBatch: Observable<StorageUpdate[]>;
3021
3006
  readonly history: Observable<HistoryEvent>;
3022
3007
  /**
@@ -3313,12 +3298,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3313
3298
  * await room.getAttachmentUrl("at_xxx");
3314
3299
  */
3315
3300
  getAttachmentUrl(attachmentId: string): Promise<string>;
3316
- /**
3317
- * @deprecated Renamed to `getSubscriptionSettings`
3318
- *
3319
- * Gets the user's subscription settings for the current room.
3320
- */
3321
- getNotificationSettings(options?: GetSubscriptionSettingsOptions): Promise<RoomSubscriptionSettings>;
3322
3301
  /**
3323
3302
  * Gets the user's subscription settings for the current room.
3324
3303
  *
@@ -3326,12 +3305,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3326
3305
  * const settings = await room.getSubscriptionSettings();
3327
3306
  */
3328
3307
  getSubscriptionSettings(options?: GetSubscriptionSettingsOptions): Promise<RoomSubscriptionSettings>;
3329
- /**
3330
- * @deprecated Renamed to `updateSubscriptionSettings`
3331
- *
3332
- * Updates the user's subscription settings for the current room.
3333
- */
3334
- updateNotificationSettings(settings: Partial<RoomSubscriptionSettings>): Promise<RoomSubscriptionSettings>;
3335
3308
  /**
3336
3309
  * Updates the user's subscription settings for the current room.
3337
3310
  *
@@ -3630,14 +3603,14 @@ type AbortAiPair = DefineCmd<"abort-ai", {
3630
3603
  ok: true;
3631
3604
  }>;
3632
3605
  type ToolResultData = JsonObject;
3633
- type ToolResultResponse<R extends ToolResultData> = {
3606
+ type ToolResultResponse<R extends ToolResultData = ToolResultData> = {
3634
3607
  data: R;
3635
3608
  };
3636
3609
  type SetToolResultPair = DefineCmd<"set-tool-result", {
3637
3610
  chatId: ChatId;
3638
3611
  messageId: MessageId;
3639
3612
  invocationId: string;
3640
- result: ToolResultData;
3613
+ result: JsonObject;
3641
3614
  generationOptions: AiGenerationOptions;
3642
3615
  }, {
3643
3616
  ok: true;
@@ -4115,9 +4088,12 @@ declare function isCommentBodyText(element: CommentBodyElement): element is Comm
4115
4088
  declare function isCommentBodyMention(element: CommentBodyElement): element is CommentBodyMention;
4116
4089
  declare function isCommentBodyLink(element: CommentBodyElement): element is CommentBodyLink;
4117
4090
  /**
4118
- * Get an array of each user's ID that has been mentioned in a `CommentBody`.
4091
+ * Get an array of all mentions in a `CommentBody`.
4092
+ *
4093
+ * Narrow results with an optional predicate, e.g.
4094
+ * `(mention) => mention.kind === "user"` to only get user mentions.
4119
4095
  */
4120
- declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
4096
+ declare function getMentionsFromCommentBody(body: CommentBody, predicate?: (mention: CommentBodyMention) => boolean): CommentBodyMention[];
4121
4097
  declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
4122
4098
  declare function htmlSafe(value: string): HtmlSafeString;
4123
4099
  declare class HtmlSafeString {
@@ -4820,9 +4796,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
4820
4796
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
4821
4797
  };
4822
4798
 
4823
- /** @deprecated Use HttpError instead. */
4824
- declare const CommentsApiError: typeof HttpError;
4825
- /** @deprecated Use HttpError instead. */
4826
- declare const NotificationsApiError: typeof HttpError;
4827
-
4828
- export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultData, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
4799
+ export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultData, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
package/dist/index.d.ts CHANGED
@@ -1191,8 +1191,10 @@ type CommentBodyParagraph = {
1191
1191
  type: "paragraph";
1192
1192
  children: CommentBodyInlineElement[];
1193
1193
  };
1194
- type CommentBodyMention = {
1194
+ type CommentBodyMention = Relax<CommentBodyUserMention>;
1195
+ type CommentBodyUserMention = {
1195
1196
  type: "mention";
1197
+ kind: "user";
1196
1198
  id: string;
1197
1199
  };
1198
1200
  type CommentBodyLink = {
@@ -1289,13 +1291,6 @@ type NotificationChannelSettings = {
1289
1291
  type NotificationSettingsPlain = {
1290
1292
  [C in NotificationChannel]?: NotificationChannelSettings;
1291
1293
  };
1292
- /**
1293
- * @deprecated Renamed to `NotificationSettings`
1294
- *
1295
- * Notification settings.
1296
- * One channel for one set of settings.
1297
- */
1298
- type UserNotificationSettings = NotificationSettings;
1299
1294
  /**
1300
1295
  * Notification settings.
1301
1296
  * One channel for one set of settings.
@@ -1362,10 +1357,6 @@ type RoomSubscriptionSettings = {
1362
1357
  type UserRoomSubscriptionSettings = {
1363
1358
  roomId: string;
1364
1359
  } & RoomSubscriptionSettings;
1365
- /**
1366
- * @deprecated Renamed to `RoomSubscriptionSettings`
1367
- */
1368
- type RoomNotificationSettings = RoomSubscriptionSettings;
1369
1360
 
1370
1361
  type SubscriptionData<K extends keyof DAD = keyof DAD> = {
1371
1362
  kind: NotificationKind<K>;
@@ -1818,14 +1809,11 @@ type CommentsOrNotificationsErrorContext = {
1818
1809
  inboxNotificationId: string;
1819
1810
  } | {
1820
1811
  type: "MARK_ALL_INBOX_NOTIFICATIONS_AS_READ_ERROR" | "DELETE_ALL_INBOX_NOTIFICATIONS_ERROR";
1821
- } | {
1822
- type: "UPDATE_NOTIFICATION_SETTINGS_ERROR";
1823
- roomId: string;
1824
1812
  } | {
1825
1813
  type: "UPDATE_ROOM_SUBSCRIPTION_SETTINGS_ERROR";
1826
1814
  roomId: string;
1827
1815
  } | {
1828
- type: "UPDATE_USER_NOTIFICATION_SETTINGS_ERROR";
1816
+ type: "UPDATE_NOTIFICATION_SETTINGS_ERROR";
1829
1817
  };
1830
1818
  type LiveblocksErrorContext = Relax<RoomConnectionErrorContext | CommentsOrNotificationsErrorContext | AiConnectionErrorContext>;
1831
1819
  declare class LiveblocksError extends Error {
@@ -1833,8 +1821,6 @@ declare class LiveblocksError extends Error {
1833
1821
  constructor(message: string, context: LiveblocksErrorContext, cause?: Error);
1834
1822
  /** Convenience accessor for error.context.roomId (if available) */
1835
1823
  get roomId(): LiveblocksErrorContext["roomId"];
1836
- /** @deprecated Prefer using `context.code` instead, to enable type narrowing */
1837
- get code(): LiveblocksErrorContext["code"];
1838
1824
  /**
1839
1825
  * Creates a LiveblocksError from a generic error, by attaching Liveblocks
1840
1826
  * contextual information like room ID, thread ID, etc.
@@ -1842,6 +1828,12 @@ declare class LiveblocksError extends Error {
1842
1828
  static from(context: LiveblocksErrorContext, cause?: Error): LiveblocksError;
1843
1829
  }
1844
1830
 
1831
+ type MentionData = Relax<UserMentionData>;
1832
+ type UserMentionData = {
1833
+ kind: "user";
1834
+ id: string;
1835
+ };
1836
+
1845
1837
  type ResolveMentionSuggestionsArgs = {
1846
1838
  /**
1847
1839
  * The ID of the current room.
@@ -1903,7 +1895,7 @@ type InternalSyncStatus = SyncStatus | "has-local-changes";
1903
1895
  */
1904
1896
  type PrivateClientApi<U extends BaseUserMeta, M extends BaseMetadata> = {
1905
1897
  readonly currentUserId: Signal<string | undefined>;
1906
- readonly mentionSuggestionsCache: Map<string, string[]>;
1898
+ readonly mentionSuggestionsCache: Map<string, MentionData[]>;
1907
1899
  readonly resolveMentionSuggestions: ClientOptions<U>["resolveMentionSuggestions"];
1908
1900
  readonly usersStore: BatchStore<U["info"] | undefined, string>;
1909
1901
  readonly roomsInfoStore: BatchStore<DRI | undefined, string>;
@@ -2154,13 +2146,11 @@ type ClientOptions<U extends BaseUserMeta = DU> = {
2154
2146
  backgroundKeepAliveTimeout?: number;
2155
2147
  polyfills?: Polyfills;
2156
2148
  largeMessageStrategy?: LargeMessageStrategy;
2157
- /** @deprecated Use `largeMessageStrategy="experimental-fallback-to-http"` instead. */
2158
- unstable_fallbackToHTTP?: boolean;
2159
2149
  unstable_streamData?: boolean;
2160
2150
  /**
2161
- * A function that returns a list of user IDs matching a string.
2151
+ * A function that returns a list of mention suggestions matching a string.
2162
2152
  */
2163
- resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => Awaitable<string[]>;
2153
+ resolveMentionSuggestions?: (args: ResolveMentionSuggestionsArgs) => Awaitable<string[] | MentionData[]>;
2164
2154
  /**
2165
2155
  * A function that returns user info from user IDs.
2166
2156
  * You should return a list of user objects of the same size, in the same order.
@@ -3012,11 +3002,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3012
3002
  readonly self: Observable<User<P, U>>;
3013
3003
  readonly myPresence: Observable<P>;
3014
3004
  readonly others: Observable<OthersEvent<P, U>>;
3015
- /**
3016
- * @deprecated Renamed to `storageBatch`. The `storage` event source will
3017
- * soon be replaced by another/incompatible API.
3018
- */
3019
- readonly storage: Observable<StorageUpdate[]>;
3020
3005
  readonly storageBatch: Observable<StorageUpdate[]>;
3021
3006
  readonly history: Observable<HistoryEvent>;
3022
3007
  /**
@@ -3313,12 +3298,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3313
3298
  * await room.getAttachmentUrl("at_xxx");
3314
3299
  */
3315
3300
  getAttachmentUrl(attachmentId: string): Promise<string>;
3316
- /**
3317
- * @deprecated Renamed to `getSubscriptionSettings`
3318
- *
3319
- * Gets the user's subscription settings for the current room.
3320
- */
3321
- getNotificationSettings(options?: GetSubscriptionSettingsOptions): Promise<RoomSubscriptionSettings>;
3322
3301
  /**
3323
3302
  * Gets the user's subscription settings for the current room.
3324
3303
  *
@@ -3326,12 +3305,6 @@ type Room<P extends JsonObject = DP, S extends LsonObject = DS, U extends BaseUs
3326
3305
  * const settings = await room.getSubscriptionSettings();
3327
3306
  */
3328
3307
  getSubscriptionSettings(options?: GetSubscriptionSettingsOptions): Promise<RoomSubscriptionSettings>;
3329
- /**
3330
- * @deprecated Renamed to `updateSubscriptionSettings`
3331
- *
3332
- * Updates the user's subscription settings for the current room.
3333
- */
3334
- updateNotificationSettings(settings: Partial<RoomSubscriptionSettings>): Promise<RoomSubscriptionSettings>;
3335
3308
  /**
3336
3309
  * Updates the user's subscription settings for the current room.
3337
3310
  *
@@ -3630,14 +3603,14 @@ type AbortAiPair = DefineCmd<"abort-ai", {
3630
3603
  ok: true;
3631
3604
  }>;
3632
3605
  type ToolResultData = JsonObject;
3633
- type ToolResultResponse<R extends ToolResultData> = {
3606
+ type ToolResultResponse<R extends ToolResultData = ToolResultData> = {
3634
3607
  data: R;
3635
3608
  };
3636
3609
  type SetToolResultPair = DefineCmd<"set-tool-result", {
3637
3610
  chatId: ChatId;
3638
3611
  messageId: MessageId;
3639
3612
  invocationId: string;
3640
- result: ToolResultData;
3613
+ result: JsonObject;
3641
3614
  generationOptions: AiGenerationOptions;
3642
3615
  }, {
3643
3616
  ok: true;
@@ -4115,9 +4088,12 @@ declare function isCommentBodyText(element: CommentBodyElement): element is Comm
4115
4088
  declare function isCommentBodyMention(element: CommentBodyElement): element is CommentBodyMention;
4116
4089
  declare function isCommentBodyLink(element: CommentBodyElement): element is CommentBodyLink;
4117
4090
  /**
4118
- * Get an array of each user's ID that has been mentioned in a `CommentBody`.
4091
+ * Get an array of all mentions in a `CommentBody`.
4092
+ *
4093
+ * Narrow results with an optional predicate, e.g.
4094
+ * `(mention) => mention.kind === "user"` to only get user mentions.
4119
4095
  */
4120
- declare function getMentionedIdsFromCommentBody(body: CommentBody): string[];
4096
+ declare function getMentionsFromCommentBody(body: CommentBody, predicate?: (mention: CommentBodyMention) => boolean): CommentBodyMention[];
4121
4097
  declare function resolveUsersInCommentBody<U extends BaseUserMeta>(body: CommentBody, resolveUsers?: (args: ResolveUsersArgs) => Awaitable<(U["info"] | undefined)[] | undefined>): Promise<Map<string, U["info"]>>;
4122
4098
  declare function htmlSafe(value: string): HtmlSafeString;
4123
4099
  declare class HtmlSafeString {
@@ -4820,9 +4796,4 @@ type EnsureJson<T> = T extends Json ? T : T extends Array<infer I> ? (EnsureJson
4820
4796
  [K in keyof T as EnsureJson<T[K]> extends never ? never : K]: EnsureJson<T[K]>;
4821
4797
  };
4822
4798
 
4823
- /** @deprecated Use HttpError instead. */
4824
- declare const CommentsApiError: typeof HttpError;
4825
- /** @deprecated Use HttpError instead. */
4826
- declare const NotificationsApiError: typeof HttpError;
4827
-
4828
- export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, CommentsApiError, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, NotificationsApiError, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomNotificationSettings, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultData, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserNotificationSettings, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionedIdsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
4799
+ export { type AckOp, type ActivityData, type AiAssistantContentPart, type AiAssistantMessage, type AiChat, type AiChatMessage, type AiKnowledgeSource, type AiOpaqueToolDefinition, type AiOpaqueToolInvocationProps, type AiReasoningPart, type AiTextPart, type AiToolDefinition, type AiToolExecuteCallback, type AiToolExecuteContext, type AiToolInvocationPart, type AiToolInvocationProps, type AiToolTypePack, type AiUserMessage, type AsyncError, type AsyncLoading, type AsyncResult, type AsyncSuccess, type Awaitable, type BaseActivitiesData, type BaseAuthResult, type BaseMetadata, type BaseRoomInfo, type BaseUserMeta, type Brand, type BroadcastEventClientMsg, type BroadcastOptions, type BroadcastedEventServerMsg, type Client, type ClientMsg, ClientMsgCode, type ClientOptions, type CommentAttachment, type CommentBody, type CommentBodyBlockElement, type CommentBodyElement, type CommentBodyInlineElement, type CommentBodyLink, type CommentBodyLinkElementArgs, type CommentBodyMention, type CommentBodyMentionElementArgs, type CommentBodyParagraph, type CommentBodyParagraphElementArgs, type CommentBodyText, type CommentBodyTextElementArgs, type CommentData, type CommentDataPlain, type CommentLocalAttachment, type CommentMixedAttachment, type CommentReaction, type CommentUserReaction, type CommentUserReactionPlain, type CommentsEventServerMsg, type ContextualPromptContext, type ContextualPromptResponse, type CopilotId, CrdtType, type CreateListOp, type CreateManagedPoolOptions, type CreateMapOp, type CreateObjectOp, type CreateOp, type CreateRegisterOp, type Cursor, type CustomAuthenticationResult, type DAD, type DE, type DM, type DP, type DRI, type DS, type DU, DefaultMap, type Delegates, type DeleteCrdtOp, type DeleteObjectKeyOp, Deque, DerivedSignal, DevToolsTreeNode as DevTools, protocol as DevToolsMsg, type DistributiveOmit, type EnsureJson, type EnterOptions, type EventSource, type FetchStorageClientMsg, type FetchYDocClientMsg, type GetThreadsOptions, type History, type HistoryVersion, HttpError, type ISignal, type IUserInfo, type IWebSocket, type IWebSocketCloseEvent, type IWebSocketEvent, type IWebSocketInstance, type IWebSocketMessageEvent, type IYjsProvider, type IdTuple, type Immutable, type InboxNotificationCustomData, type InboxNotificationCustomDataPlain, type InboxNotificationData, type InboxNotificationDataPlain, type InboxNotificationDeleteInfo, type InboxNotificationTextMentionData, type InboxNotificationTextMentionDataPlain, type InboxNotificationThreadData, type InboxNotificationThreadDataPlain, type InferFromSchema, type InitialDocumentStateServerMsg, type Json, type JsonArray, type JsonObject, type JsonScalar, type KDAD, type LargeMessageStrategy, LiveList, type LiveListUpdate, LiveMap, type LiveMapUpdate, type LiveNode, LiveObject, type LiveObjectUpdate, type LiveStructure, LiveblocksError, type LiveblocksErrorContext, type LostConnectionEvent, type Lson, type LsonObject, type ManagedPool, type MentionData, type MessageId, MutableSignal, type NoInfr, type NodeMap, type NotificationChannel, type NotificationChannelSettings, type NotificationKind, type NotificationSettings, type NotificationSettingsPlain, type Observable, type Op, OpCode, type OpaqueClient, type OpaqueRoom, type OptionalTupleUnless, type OthersEvent, type ParentToChildNodeMap, type PartialNotificationSettings, type PartialUnless, type Patchable, Permission, type PlainLson, type PlainLsonFields, type PlainLsonList, type PlainLsonMap, type PlainLsonObject, type Poller, type PrivateClientApi, type PrivateRoomApi, Promise_withResolvers, type QueryMetadata, type QueryParams, type RejectedStorageOpServerMsg, type Relax, type Resolve, type ResolveMentionSuggestionsArgs, type ResolveRoomsInfoArgs, type ResolveUsersArgs, type Room, type RoomEventMessage, type RoomStateServerMsg, type RoomSubscriptionSettings, type SerializedChild, type SerializedCrdt, type SerializedList, type SerializedMap, type SerializedObject, type SerializedRegister, type SerializedRootObject, type ServerMsg, ServerMsgCode, type SetParentKeyOp, Signal, type SignalType, SortedList, type Status, type StorageStatus, type StorageUpdate, type StringifyCommentBodyElements, type StringifyCommentBodyOptions, type SubscriptionData, type SubscriptionDataPlain, type SubscriptionDeleteInfo, type SubscriptionDeleteInfoPlain, type SubscriptionKey, type SyncSource, type SyncStatus, TextEditorType, type ThreadData, type ThreadDataPlain, type ThreadDataWithDeleteInfo, type ThreadDeleteInfo, type ToImmutable, type ToJson, type ToolResultData, type ToolResultResponse, type URLSafeString, type UnsubscribeCallback, type UpdateObjectOp, type UpdatePresenceClientMsg, type UpdatePresenceServerMsg, type UpdateStorageClientMsg, type UpdateStorageServerMsg, type UpdateYDocClientMsg, type UploadAttachmentOptions, type User, type UserJoinServerMsg, type UserLeftServerMsg, type UserMentionData, type UserRoomSubscriptionSettings, type UserSubscriptionData, type UserSubscriptionDataPlain, WebsocketCloseCodes, type WithNavigation, type YDocUpdateServerMsg, type YjsSyncStatus, ackOp, asPos, assert, assertNever, autoRetry, b64decode, batch, checkBounds, chunk, cloneLson, compactObject, fancyConsole as console, convertToCommentData, convertToCommentUserReaction, convertToInboxNotificationData, convertToSubscriptionData, convertToThreadData, convertToUserSubscriptionData, createClient, createCommentAttachmentId, createCommentId, createInboxNotificationId, createManagedPool, createNotificationSettings, createThreadId, defineAiTool, deprecate, deprecateIf, detectDupes, entries, errorIf, freeze, generateCommentUrl, getMentionsFromCommentBody, getSubscriptionKey, html, htmlSafe, isChildCrdt, isCommentBodyLink, isCommentBodyMention, isCommentBodyText, isJsonArray, isJsonObject, isJsonScalar, isLiveNode, isNotificationChannelEnabled, isPlainObject, isRootCrdt, isStartsWithOperator, kInternal, keys, legacy_patchImmutableObject, lsonToJson, makeAbortController, makeEventSource, makePoller, makePosition, mapValues, memoizeOnSuccess, nanoid, nn, objectToQuery, patchLiveObjectKey, patchNotificationSettings, raise, resolveUsersInCommentBody, shallow, shallow2, stableStringify, stringifyCommentBody, throwUsageError, toAbsoluteUrl, toPlainLson, tryParseJson, url, urljoin, wait, withTimeout };
package/dist/index.js CHANGED
@@ -6,7 +6,7 @@ var __export = (target, all) => {
6
6
 
7
7
  // src/version.ts
8
8
  var PKG_NAME = "@liveblocks/core";
9
- var PKG_VERSION = "2.25.0-aiprivatebeta14";
9
+ var PKG_VERSION = "2.25.0-aiprivatebeta15";
10
10
  var PKG_FORMAT = "esm";
11
11
 
12
12
  // src/dupe-detection.ts
@@ -7776,7 +7776,7 @@ var LiveblocksError = class _LiveblocksError extends Error {
7776
7776
  get roomId() {
7777
7777
  return this.context.roomId;
7778
7778
  }
7779
- /** @deprecated Prefer using `context.code` instead, to enable type narrowing */
7779
+ /** @internal Use `context.code` instead, to enable type narrowing */
7780
7780
  get code() {
7781
7781
  return this.context.code;
7782
7782
  }
@@ -7846,11 +7846,9 @@ function defaultMessageFromContext(context) {
7846
7846
  return "Could not mark all inbox notifications as read";
7847
7847
  case "DELETE_ALL_INBOX_NOTIFICATIONS_ERROR":
7848
7848
  return "Could not delete all inbox notifications";
7849
- case "UPDATE_NOTIFICATION_SETTINGS_ERROR":
7850
- return "Could not update notification settings";
7851
7849
  case "UPDATE_ROOM_SUBSCRIPTION_SETTINGS_ERROR":
7852
7850
  return "Could not update room subscription settings";
7853
- case "UPDATE_USER_NOTIFICATION_SETTINGS_ERROR":
7851
+ case "UPDATE_NOTIFICATION_SETTINGS_ERROR":
7854
7852
  return "Could not update notification settings";
7855
7853
  default:
7856
7854
  return assertNever(context, "Unhandled case");
@@ -8983,8 +8981,6 @@ ${Array.from(traces).join("\n\n")}`
8983
8981
  others: eventHub.others.observable,
8984
8982
  self: eventHub.self.observable,
8985
8983
  myPresence: eventHub.myPresence.observable,
8986
- /** @deprecated */
8987
- storage: eventHub.storageBatch.observable,
8988
8984
  storageBatch: eventHub.storageBatch.observable,
8989
8985
  history: eventHub.history.observable,
8990
8986
  storageDidLoad: eventHub.storageDidLoad.observable,
@@ -9501,7 +9497,7 @@ function createClient(options) {
9501
9497
  enableDebugLogging: clientOptions.enableDebugLogging,
9502
9498
  baseUrl,
9503
9499
  errorEventSource: liveblocksErrorSource,
9504
- largeMessageStrategy: clientOptions.largeMessageStrategy ?? (clientOptions.unstable_fallbackToHTTP ? "experimental-fallback-to-http" : void 0),
9500
+ largeMessageStrategy: clientOptions.largeMessageStrategy,
9505
9501
  unstable_streamData: !!clientOptions.unstable_streamData,
9506
9502
  roomHttpClient: httpClient,
9507
9503
  createSyncSource
@@ -9781,21 +9777,30 @@ function traverseCommentBody(body, elementOrVisitor, possiblyVisitor) {
9781
9777
  }
9782
9778
  }
9783
9779
  }
9784
- function getMentionedIdsFromCommentBody(body) {
9785
- const mentionedIds = /* @__PURE__ */ new Set();
9786
- traverseCommentBody(
9787
- body,
9788
- "mention",
9789
- (mention) => mentionedIds.add(mention.id)
9790
- );
9791
- return Array.from(mentionedIds);
9780
+ function getMentionsFromCommentBody(body, predicate) {
9781
+ const mentionIds = /* @__PURE__ */ new Set();
9782
+ const mentions = [];
9783
+ traverseCommentBody(body, "mention", (mention) => {
9784
+ if (
9785
+ // If this mention isn't already in the list
9786
+ !mentionIds.has(mention.id) && // And the provided predicate is true
9787
+ (predicate ? predicate(mention) : true)
9788
+ ) {
9789
+ mentionIds.add(mention.id);
9790
+ mentions.push(mention);
9791
+ }
9792
+ });
9793
+ return mentions;
9792
9794
  }
9793
9795
  async function resolveUsersInCommentBody(body, resolveUsers) {
9794
9796
  const resolvedUsers = /* @__PURE__ */ new Map();
9795
9797
  if (!resolveUsers) {
9796
9798
  return resolvedUsers;
9797
9799
  }
9798
- const userIds = getMentionedIdsFromCommentBody(body);
9800
+ const userIds = getMentionsFromCommentBody(
9801
+ body,
9802
+ (mention) => mention.kind === "user"
9803
+ ).map((mention) => mention.id);
9799
9804
  const users = await resolveUsers({
9800
9805
  userIds
9801
9806
  });
@@ -10558,11 +10563,8 @@ var TextEditorType = /* @__PURE__ */ ((TextEditorType2) => {
10558
10563
 
10559
10564
  // src/index.ts
10560
10565
  detectDupes(PKG_NAME, PKG_VERSION, PKG_FORMAT);
10561
- var CommentsApiError = HttpError;
10562
- var NotificationsApiError = HttpError;
10563
10566
  export {
10564
10567
  ClientMsgCode,
10565
- CommentsApiError,
10566
10568
  CrdtType,
10567
10569
  DefaultMap,
10568
10570
  Deque,
@@ -10573,7 +10575,6 @@ export {
10573
10575
  LiveObject,
10574
10576
  LiveblocksError,
10575
10577
  MutableSignal,
10576
- NotificationsApiError,
10577
10578
  OpCode,
10578
10579
  Permission,
10579
10580
  Promise_withResolvers,
@@ -10615,7 +10616,7 @@ export {
10615
10616
  errorIf,
10616
10617
  freeze,
10617
10618
  generateCommentUrl,
10618
- getMentionedIdsFromCommentBody,
10619
+ getMentionsFromCommentBody,
10619
10620
  getSubscriptionKey,
10620
10621
  html,
10621
10622
  htmlSafe,